45 lines
211 KiB
JavaScript
45 lines
211 KiB
JavaScript
this.wc=this.wc||{},this.wc.blocks=this.wc.blocks||{},this.wc.blocks.checkout=function(e){function t(t){for(var r,a,s=t[0],i=t[1],l=t[2],p=0,d=[];p<s.length;p++)a=s[p],Object.prototype.hasOwnProperty.call(c,a)&&c[a]&&d.push(c[a][0]),c[a]=0;for(r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r]);for(u&&u(t);d.length;)d.shift()();return o.push.apply(o,l||[]),n()}function n(){for(var e,t=0;t<o.length;t++){for(var n=o[t],r=!0,s=1;s<n.length;s++){var i=n[s];0!==c[i]&&(r=!1)}r&&(o.splice(t--,1),e=a(a.s=n[0]))}return e}var r={},c={22:0,1:0},o=[];function a(t){if(r[t])return r[t].exports;var n=r[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=r,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},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 s=window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[],i=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=i;return o.push([821,0]),n()}({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,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(262),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-product-badge",n)},t)}},113:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(3),i=n(1),l=n(72);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d=Object(s.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(i.sprintf)(
|
||
/* translators: %s Field label. */
|
||
Object(i.__)("%s (optional)",'woocommerce'),e.label)),e.priority&&(Object(l.a)(e.priority)&&(t.index=e.priority),Object(l.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),n=t[0],r=t[1];return[n,Object.entries(r).map((function(e){var t=a()(e,2),n=t[0],r=t[1];return[n,b(r)]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{})]})).reduce((function(e,t){var n=a()(t,2),r=n[0],c=n[1];return e[r]=c,e}),{});t.a=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=n&&void 0!==m[n]?m[n]:{};return e.map((function(e){var n=s.defaultAddressFields[e]||{},c=r[e]||{},o=t[e]||{};return p(p(p({key:e},n),c),o)})).sort((function(e,t){return e.index-t.index}))}},114:function(e,t,n){"use strict";var r=n(0);n(209),t.a=function(){return Object(r.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,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(1),s=n(53),i=n(6),l=n.n(i),u=(n(2),n(47)),p=(n(206),function(e){var t=e.currency,n=e.maxPrice,r=e.minPrice,c=e.priceClassName,i=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(u.formatPrice)(r),Object(u.formatPrice)(n))),Object(o.createElement)("span",{"aria-hidden":!0},Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:r,style:i})," — ",Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",c),currency:t,value:n,style:i})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,r=e.regularPriceStyle,c=e.regularPrice,i=e.priceClassName,u=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)(s.a,{currency:t,renderText:function(e){return Object(o.createElement)("del",{className:l()("wc-block-components-product-price__regular",n),style:r},e)},value:c}),Object(o.createElement)("span",{className:"screen-reader-text"},Object(a.__)("Discounted price:",'woocommerce')),Object(o.createElement)(s.a,{currency:t,renderText:function(e){return Object(o.createElement)("ins",{className:l()("wc-block-components-product-price__value","is-discounted",i),style:u},e)},value:p}))};t.a=function(e){var t=e.align,n=e.className,r=e.currency,a=e.format,i=void 0===a?"<price/>":a,u=e.maxPrice,b=void 0===u?null:u,m=e.minPrice,f=void 0===m?null:m,O=e.price,g=void 0===O?null:O,h=e.priceClassName,j=e.priceStyle,v=e.regularPrice,E=e.regularPriceClassName,y=e.regularPriceStyle,_=l()(n,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var w=v&&g!==v,k=Object(o.createElement)("span",{className:l()("wc-block-components-product-price__value",h)});return w?k=Object(o.createElement)(d,{currency:r,price:g,priceClassName:h,priceStyle:j,regularPrice:v,regularPriceClassName:E,regularPriceStyle:y}):null!==f&&null!==b?k=Object(o.createElement)(p,{currency:r,maxPrice:b,minPrice:f,priceClassName:h,priceStyle:j}):null!==g&&(k=Object(o.createElement)(s.a,{className:l()("wc-block-components-product-price__value",h),currency:r,value:g,style:j})),Object(o.createElement)("span",{className:_},Object(o.createInterpolateElement)(i,{price:k}))}},125:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),s=n(13),i=n.n(s),l=n(19),u=n.n(l),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),O=n.n(f),g=n(0),h=(n(2),n(11)),j=n(1),v=n(37),E=function(e){var t=e.imageUrl,n=void 0===t?"".concat(v.m,"/block-error.svg"):t,r=e.header,c=void 0===r?Object(j.__)("Oops!",'woocommerce'):r,o=e.text,a=void 0===o?Object(j.__)("There was an error loading the content.",'woocommerce'):o,s=e.errorMessage,i=e.errorMessagePrefix,l=void 0===i?Object(j.__)("Error:",'woocommerce'):i,u=e.button;return Object(g.createElement)("div",{className:"wc-block-error wc-block-components-error"},n&&Object(g.createElement)("img",{className:"wc-block-error__image wc-block-components-error__image",src:n,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),s&&Object(g.createElement)("p",{className:"wc-block-error__message wc-block-components-error__message"},l?l+" ":"",s),u&&Object(g.createElement)("p",{className:"wc-block-error__button wc-block-components-error__button"},u)))};n(218);var y=function(e){u()(o,e);var t,n,r=(t=o,n=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,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),O()(i()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.imageUrl,r=e.showErrorMessage,c=e.text,o=e.errorMessagePrefix,a=e.renderError,s=e.button,i=this.state,l=i.errorMessage;return i.hasError?"function"==typeof a?a({errorMessage:l}):Object(g.createElement)(E,{errorMessage:r?l:null,header:t,imageUrl:n,text:c,errorMessagePrefix:o,button:s}):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,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return p}));var r,c=n(5),o=n.n(c),a=n(7);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}!function(e){e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback"}(r||(r={}));var l={addEventCallback:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return{id:Object(a.uniqueId)(),type:r.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:n}},removeEventCallback:function(e,t){return{id:t,type:r.REMOVE_EVENT_CALLBACK,eventType:e}}},u={},p=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0,n=t.type,c=t.eventType,a=t.id,s=t.callback,l=t.priority,p=e.hasOwnProperty(c)?new Map(e[c]):new Map;switch(n){case r.ADD_EVENT_CALLBACK:return p.set(a,{priority:l,callback:s}),i(i({},e),{},o()({},c,p));case r.REMOVE_EVENT_CALLBACK:return p.delete(a),i(i({},e),{},o()({},c,p))}}},127:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(8),c=n.n(r),o=n(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,n){"use strict";var r=n(0);t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,o=e.secondaryDescription,a=e.id;return Object(r.createElement)("div",{className:"wc-block-components-radio-control__option-layout"},Object(r.createElement)("div",{className:"wc-block-components-radio-control__label-group"},t&&Object(r.createElement)("span",{id:a&&"".concat(a,"__label"),className:"wc-block-components-radio-control__label"},t),n&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),Object(r.createElement)("div",{className:"wc-block-components-radio-control__description-group"},c&&Object(r.createElement)("span",{id:a&&"".concat(a,"__description"),className:"wc-block-components-radio-control__description"},c),o&&Object(r.createElement)("span",{id:a&&"".concat(a,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},o)))}},132:function(e,t,n){"use strict";n.d(t,"b",(function(){return j})),n.d(t,"a",(function(){return v}));var r=n(38),c=n.n(r),o=n(5),a=n.n(o),s=n(16),i=n.n(s),l=n(8),u=n.n(l),p=n(0),d=n(7),b=n(34),m=n.n(b);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function g(e){var t=function(e,t){if("object"!==c()(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==c()(r))return r;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}}),j=function(){return Object(p.useContext)(h)},v=function(e){var t=e.children,n=Object(p.useState)({}),r=u()(n,2),c=r[0],o=r[1],s=Object(p.useCallback)((function(e){return c[e]}),[c]),l=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],i()(t,[e].map(g))):t}))}),[]),f=Object(p.useCallback)((function(){o({})}),[]),j=Object(p.useCallback)((function(e){e&&o((function(t){return e=Object(d.pickBy)(e,(function(e,n){return!("string"!=typeof e.message||t.hasOwnProperty(n)&&m()(t[n],e))})),0===Object.values(e).length?t:O(O({},t),e)}))}),[]),v=Object(p.useCallback)((function(e,t){o((function(n){if(!n.hasOwnProperty(e))return n;var r=O(O({},n[e]),t);return m()(n[e],r)?n:O(O({},n),{},a()({},e,r))}))}),[]),E={getValidationError:s,setValidationErrors:j,clearValidationError:b,clearAllValidationErrors:f,hideValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!0})}),[v]),showValidationError:Object(p.useCallback)((function(e){v(e,{hidden:!1})}),[v]),showAllValidationErrors:Object(p.useCallback)((function(){o((function(e){var t={};return Object.keys(e).forEach((function(n){e[n].hidden&&(t[n]=O(O({},e[n]),{},{hidden:!1}))})),0===Object.values(t).length?e:O(O({},e),t)}))}),[]),hasValidationErrors:Object.keys(c).length>0,getValidationErrorId:l};return Object(p.createElement)(h.Provider,{value:E},t)}},134:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(14),c=n(0),o=n(24),a=n(127),s=function(){var e=Object(a.a)(),t=Object(r.useDispatch)(o.CART_STORE_KEY).selectShippingRate;return{selectShippingRate:Object(c.useCallback)((function(n,r){t(n,r).catch((function(t){e(t)}))}),[e,t]),isSelectingRate:Object(r.useSelect)((function(e){return e(o.CART_STORE_KEY).isShippingRateBeingSelected()}),[])}}},135:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=(n(2),n(260),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,r=e.headingLevel,o=a()(e,u),i=l()("wc-block-components-title",n),p="h".concat(r);return Object(s.createElement)(p,c()({className:i},o),t)}},136:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(11);function c(e,t){var n=Object(r.useRef)();return Object(r.useEffect)((function(){n.current===e||t&&!t(e,n.current)||(n.current=e)}),[e,t]),n.current}},14:function(e,t){e.exports=window.wp.data},140:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),s=n.n(a),i=n(129);t.a=function(e){var t,n=e.checked,r=e.name,a=e.onChange,l=e.option,u=l.value,p=l.label,d=l.description,b=l.secondaryLabel,m=l.secondaryDescription;return Object(o.createElement)("label",{className:s()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(r,"-").concat(u)},Object(o.createElement)("input",{id:"".concat(r,"-").concat(u),className:"wc-block-components-radio-control__input",type:"radio",name:r,value:u,onChange:function(e){return a(e.target.value)},checked:n,"aria-describedby":s()((t={},c()(t,"".concat(r,"-").concat(u,"__label"),p),c()(t,"".concat(r,"-").concat(u,"__secondary-label"),b),c()(t,"".concat(r,"-").concat(u,"__description"),d),c()(t,"".concat(r,"-").concat(u,"__secondary-description"),m),t))}),Object(o.createElement)(i.a,{id:"".concat(r,"-").concat(u),label:p,secondaryLabel:b,description:d,secondaryDescription:m}))}},141:function(e,t,n){"use strict";n.d(t,"b",(function(){return E})),n.d(t,"a",(function(){return y}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=(n(2),n(14)),l=n(68),u=n(63),p=n(9),d=n.n(p),b=n(6),m=n.n(b),f=n(890),O=(n(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,n=e.notices,r=e.removeNotice,c=n.filter((function(e){return"snackbar"!==e.type}));if(!c.length)return null;var o=m()(t,"wc-block-components-notices");return Object(s.createElement)("div",{className:o},c.map((function(e){return Object(s.createElement)(f.a,d()({key:"store-notice-"+e.id},e,{className:m()("wc-block-components-notices__notice",O(e)),onRemove:function(){e.isDismissible&&r(e.id)}}),e.content)})))};function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=Object(s.createContext)({notices:[],createNotice:function(e,t,n){},removeNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"}),E=function(){return Object(s.useContext)(v)},y=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,c=e.createNoticeContainer,o=void 0===c||c,p=e.context,d=void 0===p?"wc/core":p,b=Object(i.useDispatch)("core/notices"),m=b.createNotice,f=b.removeNotice,O=Object(s.useState)(!1),h=a()(O,2),E=h[0],y=h[1],_=Object(l.a)().dispatchStoreEvent,w=Object(u.b)().isEditor,k=Object(s.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};m(e,t,j(j({},n),{},{context:n.context||d})),_("store-notice-create",{status:e,content:t,options:n})}),[m,_,d]),S=Object(s.useCallback)((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d;f(e,t)}),[f,d]),C={notices:Object(i.useSelect)((function(e){return{notices:e("core/notices").getNotices(d)}}),[d]).notices,createNotice:k,removeNotice:S,context:d,setIsSuppressed:y},P=E?null:Object(s.createElement)(g,{className:r,notices:C.notices,removeNotice:C.removeNotice,isEditor:w});return Object(s.createElement)(v.Provider,{value:C},o&&P,t)}},142:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(8),c=n.n(r),o=function(e){return e.reduce((function(e,t){var n=c()(t,2),r=n[0],o=n[1];return e[r]=o,e}),{})}},15:function(e,t){e.exports=window.wp.apiFetch},154:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(25),l=n(6),u=n.n(l),p=(n(205),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,r=e.disabled,o=void 0!==r&&r,l=e.name,d=e.permalink,b=void 0===d?"":d,m=a()(e,p),f=u()("wc-block-components-product-name",n);return o?Object(s.createElement)("span",c()({className:f},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(l)}})):Object(s.createElement)("a",c()({className:f,href:b},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(l)}}))}},155:function(e,t,n){"use strict";var r=n(0),c=n(119),o=n(91),a=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},s=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},i=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",r=s(e),c=r.split(" ").splice(0,t).join(" ");return Object(o.autop)(i(c,n))},u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=s(e),a=c.slice(0,t);if(n)return Object(o.autop)(i(a,r));var l=a.match(/([\s]+)/g),u=l?l.length:0,p=c.slice(0,t+u);return Object(o.autop)(i(p,r))};t.a=function(e){var t=e.source,n=e.maxLength,s=void 0===n?15:n,i=e.countType,p=void 0===i?"words":i,d=e.className,b=void 0===d?"":d,m=Object(r.useMemo)((function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"words",r=Object(o.autop)(e),s=Object(c.count)(r,n);if(s<=t)return r;var i=a(r),p=Object(c.count)(i,n);return p<=t?i:"words"===n?l(i,t):u(i,t,"characters_including_spaces"===n)}(t,s,p)}),[t,s,p]);return Object(r.createElement)(r.RawHTML,{className:b},m)}},158:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("mask",{id:"external-mask",width:"24",height:"24",x:"0",y:"0",maskUnits:"userSpaceOnUse"},Object(r.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(r.createElement)("g",{mask:"url(#external-mask)"},Object(r.createElement)("path",{d:"M0 0h24v24H0z"})));t.a=o},159:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return i}));var r=n(26),c=n(37),o=function(e,t){if(c.n>2)return Object(r.registerBlockType)(e,t)},a=function(e,t){if(c.n>1)return Object(r.registerBlockType)(e,t)},s=function(){return c.n>2},i=function(){return c.n>1}},162:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return i}));var r=n(3),c=n(113),o=n(23),a=function(e){var t=e.country,n=void 0===t?"":t,r=e.state,c=void 0===r?"":r,o=e.city,a=void 0===o?"":o,s=e.postcode,i=void 0===s?"":s;return{country:n.trim(),state:c.trim(),city:a.trim(),postcode:i?i.replace(" ","").toUpperCase():""}},s=function(e){var t=e.email,n=void 0===t?"":t;return Object(o.isEmail)(n)?n.trim():""},i=function(e){var t=Object.keys(r.defaultAddressFields),n=Object(c.a)(t,{},e.country),o=Object.assign({},e);return n.forEach((function(t){var n=t.key,r=void 0===n?"":n,c=t.hidden;void 0!==c&&c&&function(e,t){return e in t}(r,e)&&(o[r]="")})),o}},163:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(62),c=n(174),o=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object(c.b)(),n=t.paymentMethods,o=t.expressPaymentMethods,a=t.paymentMethodsInitialized,s=t.expressPaymentMethodsInitialized,i=Object(r.a)(n),l=Object(r.a)(o);return{paymentMethods:e?l:i,isInitialized:e?s:a}},a=function(){return o(!1)},s=function(){return o(!0)}},167:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=n(21),s=n(140);n(272),t.a=Object(a.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,a=e.selected,i=e.onChange,l=e.options,u=void 0===l?[]:l,p=c||n;return u.length&&Object(r.createElement)("div",{className:o()("wc-block-components-radio-control",t)},u.map((function(e){return Object(r.createElement)(s.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===a,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},168:function(e,t,n){"use strict";var r=n(17),c=n.n(r),o=n(18),a=n.n(o),s=n(13),i=n.n(s),l=n(19),u=n.n(l),p=n(20),d=n.n(p),b=n(10),m=n.n(b),f=n(5),O=n.n(f),g=n(0),h=n(1),j=n(11),v=(n(2),n(3)),E=n(44);var y=function(e){u()(o,e);var t,n,r=(t=o,n=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,r=m()(t);if(n){var c=m()(this).constructor;e=Reflect.construct(r,arguments,c)}else e=r.apply(this,arguments);return d()(this,e)});function o(){var e;c()(this,o);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=r.call.apply(r,[this].concat(n)),O()(i()(e),"state",{errorMessage:"",hasError:!1}),e}return a()(o,[{key:"render",value:function(){var e=this.state,t=e.hasError,n=e.errorMessage,r=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');(r||v.CURRENT_USER_IS_ADMIN)&&(c=n||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}(j.Component);y.defaultProps={isEditor:!1},t.a=y},169:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=function(e){return"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--".concat(e)},p=function(e){var t=e.id,n=e.src,r=void 0===n?null:n,c=e.alt,o=void 0===c?"":c;return r?Object(s.createElement)("img",{className:u(t),src:r,alt:o}):null},d=n(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=n(38),f=n.n(m),O=n(72);function g(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?g(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n(275),t.a=function(e){var t=e.icons,n=void 0===t?[]:t,r=e.align,o=void 0===r?"center":r,a=function(e){var t={};return e.forEach((function(e){var n={};"string"==typeof e&&(n={id:e,alt:e,src:null}),"object"===f()(e)&&(n={id:e.id||"",alt:e.alt||"",src:e.src||null}),n.id&&Object(O.c)(n.id)&&!t[n.id]&&(t[n.id]=n)})),Object.values(t)}(n);if(0===a.length)return null;var i=l()("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(s.createElement)("div",{className:i},a.map((function(e){var t,n=h(h({},e),(t=e.id,b.find((function(e){return e.id===t}))||{}));return Object(s.createElement)(p,c()({key:"payment-method-icon-"+e.id},n))})))}},174:function(e,t,n){"use strict";n.d(t,"b",(function(){return Q})),n.d(t,"a",(function(){return ee}));var r,c,o=n(33),a=n.n(o),s=n(8),i=n.n(s),l=n(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"}(r||(r={})),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 u={currentStatus:r.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:r,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=n(5),b=n.n(d),m=n(38),f=n.n(m);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h=function(e){return!("object"!==f()(e)||!e.isSavedToken)},j=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,t=arguments.length>1?arguments[1]:void 0,n=t.type,o=t.paymentMethodData,a=t.shouldSavePaymentMethod,s=void 0!==a&&a,i=t.errorMessage,l=void 0===i?"":i,p=t.paymentMethods,d=void 0===p?{}:p;switch(n){case r.STARTED:return g(g({},e),{},{currentStatus:r.STARTED,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)});case r.ERROR:return e.currentStatus!==r.ERROR?g(g({},e),{},{currentStatus:r.ERROR,errorMessage:l||e.errorMessage}):e;case r.FAILED:return e.currentStatus!==r.FAILED?g(g({},e),{},{currentStatus:r.FAILED,paymentMethodData:o||e.paymentMethodData,errorMessage:l||e.errorMessage}):e;case r.SUCCESS:return e.currentStatus!==r.SUCCESS?g(g({},e),{},{currentStatus:r.SUCCESS,paymentMethodData:o||e.paymentMethodData,hasSavedToken:h(o||e.paymentMethodData)}):e;case r.PROCESSING:return e.currentStatus!==r.PROCESSING?g(g({},e),{},{currentStatus:r.PROCESSING,errorMessage:""}):e;case r.COMPLETE:return e.currentStatus!==r.COMPLETE?g(g({},e),{},{currentStatus:r.COMPLETE}):e;case r.PRISTINE:return g(g({},u),{},{currentStatus:r.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:s})}},v=n(29),E=n.n(v),y=n(22),_=n.n(y),w=n(1),k=n(60),S=n(62),C=n(3),P=n(222),N=n(63),x=n(75),R=n(67),T=n(43),A=n(59),I=n(50);function M(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?M(Object(n),!0).forEach((function(t){b()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):M(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var F=function(e,t,n,r){var c=Object(l.useState)(!1),o=i()(c,2),a=o[0],s=o[1],u=Object(N.b)().isEditor,p=Object(x.b)().selectedRates,d=Object(R.b)(),m=d.billingData,O=d.shippingAddress,g=Object(S.a)(p),h=Object(S.a)(n),j=Object(T.a)(),v=j.cartTotals,y=j.cartNeedsShipping,k=j.paymentRequirements,I=Object(l.useRef)({cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}),M=Object(A.a)().addErrorNotice;Object(l.useEffect)((function(){I.current={cart:j,cartTotals:v,cartNeedsShipping:y,billingData:m,shippingAddress:O,selectedShippingMethods:g,paymentRequirements:k}}),[j,v,y,m,O,g,k]);var F=Object(l.useCallback)(E()(_.a.mark((function n(){var c,o,a,i,l,p,d;return _.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:c={},o=function(e){c=D(D({},c),{},b()({},e.name,e))},a=0;case 3:if(!(a<h.length)){n.next=29;break}if(i=h[a],l=t[i]){n.next=8;break}return n.abrupt("continue",26);case 8:if(n.prev=8,!u){n.next=13;break}n.t0=!0,n.next=16;break;case 13:return n.next=15,Promise.resolve(l.canMakePayment(I.current));case 15:n.t0=n.sent;case 16:if(!(p=n.t0)){n.next=21;break}if("object"!==f()(p)||null===p||!p.error){n.next=20;break}throw new Error(p.error.message);case 20:o(l);case 21:n.next=26;break;case 23:n.prev=23,n.t1=n.catch(8),(C.CURRENT_USER_IS_ADMIN||u)&&(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'),l.paymentMethodId),M("".concat(d," ").concat(n.t1),{context:r,id:"wc-".concat(l.paymentMethodId,"-registration-error")}));case 26:a++,n.next=3;break;case 29:e(c),s(!0);case 31:case"end":return n.stop()}}),n,null,[[8,23]])}))),[M,e,u,r,h,t]),B=Object(P.a)(F,500),L=i()(B,1)[0];return Object(l.useEffect)((function(){L()}),[L,j,g,m]),a},B=function(e){return{type:e}},L=function(e){return{type:r.ERROR,errorMessage:e}},V=function(e){var t=e.errorMessage,n=e.paymentMethodData;return{type:r.FAILED,errorMessage:t,paymentMethodData:n}},U=function(e){var t=e.paymentMethodData;return{type:r.SUCCESS,paymentMethodData:t}},z=function(e){var t=e.paymentMethodData;return{type:r.STARTED,paymentMethodData:t}},H=function(e){return{type:c.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}},G=function(e){return{type:c.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}},q=function(e){return{type:c.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}},Y=n(68),W=n(57),$=n(126),X=n(321),K=n(322),J=n(132),Z=Object(l.createContext)(p),Q=function(){return Object(l.useContext)(Z)},ee=function(e){var t,n=e.children,c=Object(W.b)(),o=c.isProcessing,s=c.isIdle,p=c.isCalculating,d=c.hasError,b=Object(N.b)(),m=b.isEditor,O=b.getPreviewData,g=Object(J.b)().setValidationErrors,h=Object(A.a)(),v=h.addErrorNotice,E=h.removeNotice,y=Object(I.c)(),_=y.isSuccessResponse,w=y.isErrorResponse,S=y.isFailResponse,P=y.noticeContexts,T=Object(l.useReducer)($.b,{}),M=i()(T,2),D=M[0],Q=(t=M[1],Object(l.useMemo)((function(){return{onPaymentProcessing:Object(X.a)("payment_processing",t)}}),[t])).onPaymentProcessing,ee=Object(l.useRef)(D);Object(l.useEffect)((function(){ee.current=D}),[D]);var te,ne,re,ce=Object(l.useReducer)(j,u),oe=i()(ce,2),ae=oe[0],se=(te=oe[1],ne=Object(R.b)().setBillingData,re=Object(x.b)().setShippingAddress,{dispatchActions:Object(l.useMemo)((function(){return{setRegisteredPaymentMethods:function(e){te(H(e))},setRegisteredExpressPaymentMethods:function(e){te(G(e))},setShouldSavePayment:function(e){te(q(e))}}}),[te]),setPaymentStatus:Object(l.useCallback)((function(){return{pristine:function(){return te(B(r.PRISTINE))},started:function(e){te(z({paymentMethodData:e}))},processing:function(){return te(B(r.PROCESSING))},completed:function(){return te(B(r.COMPLETE))},error:function(e){return te(L(e))},failed:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;n&&ne(n),te(V({errorMessage:e||"",paymentMethodData:t||{}}))},success:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;t&&ne(t),void 0!==f()(n)&&null!=n&&n.address&&re(n.address),te(U({paymentMethodData:e}))}}}),[te,ne,re])}),ie=se.dispatchActions,le=se.setPaymentStatus,ue=function(e){var t=Object(k.getPaymentMethods)(),n=Object(I.c)().noticeContexts,r=new Set([].concat(a()(Object(C.getSetting)("paymentGatewaySortOrder",[])),a()(Object.keys(t))));return F(e,t,Array.from(r),n.PAYMENTS)}(ie.setRegisteredPaymentMethods),pe=function(e){var t=Object(k.getExpressPaymentMethods)(),n=Object(I.c)().noticeContexts;return F(e,t,Object.keys(t),n.EXPRESS_PAYMENTS)}(ie.setRegisteredExpressPaymentMethods),de=function(){var e=Object(Y.a)().dispatchCheckoutEvent,t=Object(l.useState)(""),n=i()(t,2),r=n[0],c=n[1],o=Object(l.useState)(""),a=i()(o,2),s=a[0],u=a[1];return Object(l.useEffect)((function(){e("set-active-payment-method",{activePaymentMethod:r})}),[e,r]),{activePaymentMethod:r,activeSavedToken:s,setActivePaymentMethod:c,setActiveSavedToken:u}}(),be=de.activePaymentMethod,me=de.activeSavedToken,fe=de.setActivePaymentMethod,Oe=de.setActiveSavedToken,ge=Object(l.useMemo)((function(){return m?O("previewSavedPaymentMethods"):ue?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",{}),n=Object.keys(t),r={};return n.forEach((function(n){var c=t[n].filter((function(t){var n,r=t.method.gateway;return r in e&&(null===(n=e[r].supports)||void 0===n?void 0:n.showSavedCards)}));c.length&&(r[n]=c)})),r}(ae.paymentMethods):{}}),[m,O,ue,ae.paymentMethods]),he=Object(l.useCallback)((function(e){e?v(e,{id:"wc-express-payment-error",context:P.EXPRESS_PAYMENTS}):E("wc-express-payment-error",P.EXPRESS_PAYMENTS)}),[v,P.EXPRESS_PAYMENTS,E]),je=Object.keys(ae.expressPaymentMethods).includes(be),ve=Object(l.useMemo)((function(){return{isPristine:ae.currentStatus===r.PRISTINE,isStarted:ae.currentStatus===r.STARTED,isProcessing:ae.currentStatus===r.PROCESSING,isFinished:[r.ERROR,r.FAILED,r.SUCCESS].includes(ae.currentStatus),hasError:ae.currentStatus===r.ERROR,hasFailed:ae.currentStatus===r.FAILED,isSuccessful:ae.currentStatus===r.SUCCESS,isDoingExpressPayment:ae.currentStatus!==r.PRISTINE&&je}}),[ae.currentStatus,je]);Object(l.useEffect)((function(){var e=Object.keys(ae.paymentMethods),t=[].concat(a()(e),a()(Object.keys(ae.expressPaymentMethods)));ue&&e.length&&fe((function(e){return e&&t.includes(e)?e:(le().pristine(),Object.keys(ae.paymentMethods)[0])}))}),[ue,ae.paymentMethods,ae.expressPaymentMethods,fe,le]),Object(l.useEffect)((function(){!o||d||p||ve.isFinished||le().processing()}),[o,d,p,ve.isFinished,le]),Object(l.useEffect)((function(){s&&!ve.isSuccessful&&le().pristine()}),[s,ve.isSuccessful,le]),Object(l.useEffect)((function(){d&&ve.isSuccessful&&!ae.hasSavedToken&&le().pristine()}),[d,ve.isSuccessful,ae.hasSavedToken,le]),Object(l.useEffect)((function(){ve.isProcessing&&(E("wc-payment-error",P.PAYMENTS),Object(K.b)(ee.current,"payment_processing",{}).then((function(e){var t,n,r,c,o,a,s,i;if(e.forEach((function(e){_(e)&&(t=e),(w(e)||S(e))&&(n=e)})),t&&!n)le().success(null===(r=t)||void 0===r||null===(c=r.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===(s=t)||void 0===s||null===(i=s.meta)||void 0===i?void 0:i.shippingData);else if(n&&S(n)){var l,u,p,d,b,m;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(m=n)||void 0===m?void 0:m.messageContext)||P.PAYMENTS}),le().failed(null===(l=n)||void 0===l?void 0:l.message,null===(u=n)||void 0===u||null===(p=u.meta)||void 0===p?void 0:p.paymentMethodData,null===(d=n)||void 0===d||null===(b=d.meta)||void 0===b?void 0:b.billingData)}else if(n){var f,O;n.message&&n.message.length&&v(n.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(O=n)||void 0===O?void 0:O.messageContext)||P.PAYMENTS}),le().error(n.message),g(null===(f=n)||void 0===f?void 0:f.validationErrors)}else le().success()})))}),[ve.isProcessing,g,le,E,P.PAYMENTS,_,S,w,v]);var Ee={setPaymentStatus:le,currentStatus:ve,paymentStatuses:r,paymentMethodData:ae.paymentMethodData,errorMessage:ae.errorMessage,activePaymentMethod:be,setActivePaymentMethod:fe,activeSavedToken:me,setActiveSavedToken:Oe,onPaymentProcessing:Q,customerPaymentMethods:ge,paymentMethods:ae.paymentMethods,expressPaymentMethods:ae.expressPaymentMethods,paymentMethodsInitialized:ue,expressPaymentMethodsInitialized:pe,setExpressPaymentError:he,isExpressPaymentMethodActive:je,shouldSavePayment:ae.shouldSavePaymentMethod,setShouldSavePayment:ie.setShouldSavePayment};return Object(l.createElement)(Z.Provider,{value:Ee},n)}},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,n){"use strict";var r=n(33),c=n.n(r),o=n(0),a=n(1),s=n(4),i=n(14),l=n(39);t.a=function(e){var t=e.setPageId,n=e.pageId,r=e.labels,u=Object(i.useSelect)((function(e){return e("core").getEntityRecords("postType","page",{status:"publish",orderby:"title",order:"asc",per_page:100})}),[])||null;return u?Object(o.createElement)(s.PanelBody,{title:r.title},Object(o.createElement)(s.SelectControl,{label:Object(a.__)("Link to",'woocommerce'),value:n,options:[{label:r.default,value:0}].concat(c()(u.map((function(e){return{label:Object(l.a)(e,u),value:parseInt(e.id,10)}})))),onChange:function(e){return t(parseInt(e,10))}})):null}},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(0),c=n(1),o=(n(2),n(66)),a=n(237),s=n(158),i=(n(258),function(e){var t=e.text,n=e.url,i=void 0===n?"https://ideas.woocommerce.com/forums/133476-woocommerce?category_id=384565":n;return Object(r.createElement)("div",{className:"wc-block-feedback-prompt"},Object(r.createElement)(o.a,{srcElement:a.a}),Object(r.createElement)("h2",{className:"wc-block-feedback-prompt__title"},Object(c.__)("Feedback?",'woocommerce')),Object(r.createElement)("p",{className:"wc-block-feedback-prompt__text"},t),Object(r.createElement)("a",{href:i,className:"wc-block-feedback-prompt__link",rel:"noreferrer noopener",target:"_blank"},Object(c.__)("Give us your feedback.",'woocommerce'),Object(r.createElement)(o.a,{srcElement:s.a,size:16})))}),l=function(){return Object(r.createElement)(i,{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,n){"use strict";var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(1),l=n(283),u=n(163),p=n(63),d=n(174),b=n(56),m=n.n(b),f=n(168);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(){var e=Object(p.b)().isEditor,t=Object(d.b)(),n=t.setActivePaymentMethod,r=t.setExpressPaymentError,c=t.activePaymentMethod,o=t.paymentMethodData,b=t.setPaymentStatus,O=Object(l.a)(),h=Object(u.a)().paymentMethods,j=Object(s.useRef)(c),v=Object(s.useRef)(o),E=Object(s.useCallback)((function(e){return function(){j.current=c,v.current=o,b().started({}),n(e)}}),[c,o,n,b]),y=Object(s.useCallback)((function(){b().pristine(),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b]),_=Object(s.useCallback)((function(e){b().error(e),r(e),n(j.current),v.current.isSavedToken&&b().started(v.current)}),[n,b,r]),w=Object(s.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):r("")}),[r,_]),k=Object.entries(h),S=k.length>0?k.map((function(t){var n=a()(t,2),r=n[0],c=n[1],o=e?c.edit:c.content;return Object(s.isValidElement)(o)?Object(s.createElement)("li",{key:r,id:"express-payment-method-".concat(r)},Object(s.cloneElement)(o,g(g({},O),{},{onClick:E(r),onClose:y,onError:_,setExpressPaymentError:w}))):null})):Object(s.createElement)("li",{key:"noneRegistered"},Object(i.__)("No registered Payment Methods",'woocommerce'));return Object(s.createElement)(f.a,{isEditor:e},Object(s.createElement)("ul",{className:"wc-block-components-express-payment__event-buttons"},S))}},200:function(e,t,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),s=n(64),i=n(83),l=n(27),u=n(500),p=n(43),d=n(63),b=n(6),m=n.n(b),f=n(25),O=n(41),g=n(8),h=n.n(g),j=n(34),v=n.n(j),E=n(134),y=n(68),_=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},w=n(167),k=n(129),S=n(47),C=n(53),P=n(3),N=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,n=e.noResultsMessage,r=e.onSelectRate,c=e.rates,a=e.renderOption,s=void 0===a?N:a,i=e.selected;if(0===c.length)return n;if(c.length>1)return Object(o.createElement)(w.a,{className:t,onChange:function(e){r(e)},selected:i,options:c.map(s)});var l=s(c[0]),u=l.label,p=l.secondaryLabel,d=l.description,b=l.secondaryDescription;return Object(o.createElement)(k.a,{label:u,secondaryLabel:p,description:d,secondaryDescription:b})},R=(n(271),function(e){var t=e.packageId,n=e.className,r=e.noResultsMessage,c=e.renderOption,s=e.packageData,i=e.collapsible,u=void 0!==i&&i,p=e.collapse,d=void 0!==p&&p,b=e.showItems,g=void 0!==b&&b,j=function(e,t){var n=Object(y.a)().dispatchCheckoutEvent,r=Object(E.a)(),c=r.selectShippingRate,a=r.isSelectingRate,s=Object(o.useState)((function(){return _(t)})),i=h()(s,2),l=i[0],u=i[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){v()(p.current,t)||(p.current=t,u(_(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){u(t),c(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,n]),selectedShippingRate:l,isSelectingRate:a}}(t,s.shipping_rates),w=j.selectShippingRate,k=j.selectedShippingRate,S=Object(o.createElement)(o.Fragment,null,(g||u)&&Object(o.createElement)("div",{className:"wc-block-components-shipping-rates-control__package-title"},s.name),g&&Object(o.createElement)("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(s.items).map((function(e){var t=Object(f.decodeEntities)(e.name),n=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:n>1?"".concat(t," × ").concat(n):"".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)",n,'woocommerce'),t,n)}))})))),C=Object(o.createElement)(x,{className:n,noResultsMessage:r,rates:s.shipping_rates,onSelectRate:w,selected:k,renderOption:c});return u?Object(o.createElement)(l.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",n)},S,C)}),T=["package_id"],A=["extensions","receiveCart"],I=function(e){var t=e.packages,n=e.collapse,r=e.showItems,a=e.collapsible,s=e.noResultsMessage,i=e.renderOption;return t.length?Object(o.createElement)(o.Fragment,null,t.map((function(e){var t=e.package_id,l=c()(e,T);return Object(o.createElement)(R,{key:t,packageId:t,packageData:l,collapsible:a,collapse:n,showItems:r,noResultsMessage:s,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,r=e.className,b=e.collapsible,m=void 0!==b&&b,f=e.noResultsMessage,O=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(u.a)(t),r=Object(u.b)(t);1===e?Object(s.speak)(Object(a.sprintf)(
|
||
/* translators: %d number of shipping options found. */
|
||
Object(a._n)("%d shipping option was found.","%d shipping options were found.",r,'woocommerce'),r)):Object(s.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",r,'woocommerce'),r))}}),[n,t]);var g=Object(p.a)(),h=g.extensions,j=(g.receiveCart,{className:r,collapsible:m,noResultsMessage:f,renderOption:O,extensions:h,cart:c()(g,A),components:{ShippingRatesControlPackage:R}}),v=Object(d.b)().isEditor;return Object(o.createElement)(i.a,{isLoading:n,screenReaderLabel:Object(a.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},v?Object(o.createElement)(I,{packages:t,noResultsMessage:f,renderOption:O}):Object(o.createElement)(o.Fragment,null,Object(o.createElement)(l.ExperimentalOrderShippingPackages.Slot,j),Object(o.createElement)(l.ExperimentalOrderShippingPackages,null,Object(o.createElement)(I,{packages:t,noResultsMessage:f,renderOption:O}))))}},201:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(5),c=n.n(r),o=n(1),a=n(14),s=n(24),i=n(25),l=n(43),u=n(0);n(8),n(2),n(899),n(6),n(27),n(68),n(63);var p=Object(u.createContext)({notices:[],createSnackbarNotice:function(e,t){},removeSnackbarNotice:function(e,t){},setIsSuppressed:function(e){},context:"wc/core"});function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(132),f=n(59);function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var g=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,r=Object(f.a)().addErrorNotice,d=function(){var e=Object(u.useContext)(p),t=e.notices,n=e.createSnackbarNotice,r=e.removeSnackbarNotice,c=e.setIsSuppressed,o=Object(u.useRef)(t);Object(u.useEffect)((function(){o.current=t}),[t]);var a=Object(u.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||r(t.id)}))},removeSnackbarNotice:r}}),[r]),s=Object(u.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return b(b(b({notices:t},a),s),{},{setIsSuppressed:c})}().addSnackbarNotice,g=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(a.useSelect)((function(e,t){var n=t.dispatch,c=e(s.CART_STORE_KEY),a=c.isApplyingCoupon(),l=c.isRemovingCoupon(),u=n(s.CART_STORE_KEY),p=u.applyCoupon,b=u.removeCoupon,m=u.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(i.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){r(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:a,isRemovingCoupon:l}}),[r,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,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=(n(2),n(6)),l=n.n(i),u=n(1),p=n(66),d=n(305),b=(n(179),["text","screenReaderText","element","className","radius","children"]),m=function(e){var t=e.text,n=e.screenReaderText,r=void 0===n?"":n,o=e.element,i=void 0===o?"li":o,u=e.className,p=void 0===u?"":u,d=e.radius,m=void 0===d?"small":d,f=e.children,O=void 0===f?null:f,g=a()(e,b),h=i,j=l()(p,"wc-block-components-chip","wc-block-components-chip--radius-"+m),v=Boolean(r&&r!==t);return Object(s.createElement)(h,c()({className:j},g),Object(s.createElement)("span",{"aria-hidden":v,className:"wc-block-components-chip__text"},t),v&&Object(s.createElement)("span",{className:"screen-reader-text"},r),O)},f=["ariaLabel","className","disabled","onRemove","removeOnAnyClick","text","screenReaderText"];t.a=function(e){var t=e.ariaLabel,n=void 0===t?"":t,r=e.className,o=void 0===r?"":r,i=e.disabled,b=void 0!==i&&i,O=e.onRemove,g=void 0===O?function(){}:O,h=e.removeOnAnyClick,j=void 0!==h&&h,v=e.text,E=e.screenReaderText,y=void 0===E?"":E,_=a()(e,f),w=j?"span":"button";if(!n){var k=y&&"string"==typeof y?y:v;n="string"!=typeof k?
|
||
/* translators: Remove chip. */
|
||
Object(u.__)("Remove",'woocommerce'):Object(u.sprintf)(
|
||
/* translators: %s text of the chip to remove. */
|
||
Object(u.__)('Remove "%s"','woocommerce'),k)}var S={"aria-label":n,disabled:b,onClick:g,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||g()}},C=j?S:{},P=j?{"aria-hidden":!0}:S;return Object(s.createElement)(m,c()({},_,C,{className:l()(o,"is-removable"),element:j?"button":_.element,screenReaderText:y,text:v}),Object(s.createElement)(w,c()({className:"wc-block-components-chip__remove"},P),Object(s.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,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(0),c=(n(2),n(132)),o=(n(210),function(e){var t=e.errorMessage,n=void 0===t?"":t,o=e.propertyName,a=void 0===o?"":o,s=e.elementId,i=void 0===s?"":s,l=Object(c.b)(),u=l.getValidationError,p=l.getValidationErrorId;if(!n||"string"!=typeof n){var d=u(a)||{};if(!d.message||d.hidden)return null;n=d.message}return Object(r.createElement)("div",{className:"wc-block-components-validation-error",role:"alert"},Object(r.createElement)("p",{id:p(i)},n))})},235:function(e,t,n){"use strict";n.d(t,"a",(function(){return T}));var r=n(0),c=n(197),o=n(3),a=n(125),s=n(174),i=n(75),l=n(67),u=n(57),p=n(29),d=n.n(p),b=n(5),m=n.n(b),f=n(8),O=n.n(f),g=n(22),h=n.n(g),j=n(1),v=n(15),E=n.n(v),y=n(162),_=n(42),w=function(e,t,n){var r=Object.keys(e).map((function(t){return{key:t,value:e[t]}}),[]),c="wc-".concat(n,"-new-payment-method");return r.push({key:c,value:t}),r},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=n(132),C=n(43),P=n(59);function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach((function(t){m()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(){var e=Object(u.b)(),t=e.hasError,n=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,v=Object(S.b)().hasValidationErrors,N=Object(i.b)().shippingErrorStatus,R=Object(l.b)(),T=R.billingData,A=R.shippingAddress,I=Object(C.a)(),M=I.cartNeedsPayment,D=I.receiveCart,F=Object(s.b)(),B=F.activePaymentMethod,L=F.isExpressPaymentMethodActive,V=F.currentStatus,U=F.paymentMethodData,z=F.expressPaymentMethods,H=F.paymentMethods,G=F.shouldSavePayment,q=Object(P.a)(),Y=q.addErrorNotice,W=q.removeNotice,$=q.setIsSuppressed,X=Object(r.useRef)(T),K=Object(r.useRef)(A),J=Object(r.useRef)(o),Z=Object(r.useState)(!1),Q=O()(Z,2),ee=Q[0],te=Q[1],ne=Object(r.useMemo)((function(){var e,t=x(x({},z),H);return null==t||null===(e=t[B])||void 0===e?void 0:e.paymentMethodId}),[B,z,H]),re=v&&!L||V.hasError||N.hasError,ce=!t&&!re&&(V.isSuccessful||!M)&&a;Object(r.useEffect)((function(){$(L)}),[L,$]),Object(r.useEffect)((function(){re===t||!a&&!p||L||c.setHasError(re)}),[re,t,a,p,L,c]),Object(r.useEffect)((function(){X.current=T,K.current=A,J.current=o}),[T,A,o]);var oe=Object(r.useCallback)((function(){return!v&&(V.hasError?{errorMessage:Object(j.__)("There was a problem with your payment option.",'woocommerce')}:!N.hasError||{errorMessage:Object(j.__)("There was a problem with your shipping option.",'woocommerce')})}),[v,V.hasError,N.hasError]);Object(r.useEffect)((function(){var e;return L||(e=n(oe,0)),function(){L||e()}}),[n,oe,L]),Object(r.useEffect)((function(){J.current&&(window.location.href=J.current)}),[b]);var ae=Object(r.useCallback)(d()(h.a.mark((function e(){var t,n;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=M?{payment_method:ne,payment_data:w(U,G,B)}:{},n=x(x({billing_address:Object(y.a)(X.current),shipping_address:Object(y.a)(K.current),customer_note:m,should_create_account:f},t),{},{extensions:x({},g)}),E()({path:"/wc/store/checkout",method:"POST",data:n,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,n,r;null!==(t=e.data)&&void 0!==t&&t.cart&&D(e.data.cart),Y(Object(_.b)(e),{id:"checkout"}),null===(n=e.additional_errors)||void 0===n||null===(r=n.forEach)||void 0===r||r.call(n,(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,M,ne,U,G,B,g,c,Y,D]);return Object(r.useEffect)((function(){ce&&!ee&&ae()}),[ae,ce,ee]),null},T=function(e){var t=e.children,n=e.isCart,p=void 0!==n&&n,d=e.redirectUrl;return Object(r.createElement)(u.a,{redirectUrl:d,isCart:p},Object(r.createElement)(l.a,null,Object(r.createElement)(i.a,null,Object(r.createElement)(s.a,null,t,Object(r.createElement)(a.a,{renderError:o.CURRENT_USER_IS_ADMIN?null:function(){return null}},Object(r.createElement)(c.PluginArea,{scope:"woocommerce-checkout"})),Object(r.createElement)(R,null)))))}},237:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.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},283:function(e,t,n){"use strict";n.d(t,"a",(function(){return x}));var r=n(1),c=n(47),o=n(0),a=n(6),s=n.n(a),i=n(28),l=Object(o.createElement)(i.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"})),u=n(303),p=n(502),d=Object(o.createElement)(i.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=n(66),m=n(72),f=(n(276),{bank:l,bill:u.a,card:p.a,checkPayment:d}),O=function(e){var t=e.icon,n=void 0===t?"":t,r=e.text,c=void 0===r?"":r,a=!!n,i=Object(o.useCallback)((function(e){return a&&Object(m.c)(e)&&Object(m.d)(f,e)}),[a]),l=s()("wc-block-components-payment-method-label",{"wc-block-components-payment-method-label--with-icon":a});return Object(o.createElement)("span",{className:l},i(n)?Object(o.createElement)(b.a,{srcElement:f[n]}):n,c)},g=n(169),h=n(3),j=n(56),v=n.n(j),E=n(234),y=n(43),_=n(201),w=n(50),k=n(57),S=n(174),C=n(75),P=n(67),N=function(e,t){var n=[],c=function(t,n){var r=n+"_tax",c=Object(m.d)(e,n)&&Object(m.c)(e[n])?parseInt(e[n],10):0;return{key:n,label:t,value:c,valueWithTax:c+(Object(m.d)(e,r)&&Object(m.c)(e[r])?parseInt(e[r],10):0)}};return n.push(c(Object(r.__)("Subtotal:",'woocommerce'),"total_items")),n.push(c(Object(r.__)("Fees:",'woocommerce'),"total_fees")),n.push(c(Object(r.__)("Discount:",'woocommerce'),"total_discount")),n.push({key:"total_tax",label:Object(r.__)("Taxes:",'woocommerce'),value:parseInt(e.total_tax,10),valueWithTax:parseInt(e.total_tax,10)}),t&&n.push(c(Object(r.__)("Shipping:",'woocommerce'),"total_shipping")),n},x=function(){var e=Object(k.b)(),t=e.isCalculating,n=e.isComplete,a=e.isIdle,s=e.isProcessing,i=e.onCheckoutBeforeProcessing,l=e.onCheckoutValidationBeforeProcessing,u=e.onCheckoutAfterProcessingWithSuccess,p=e.onCheckoutAfterProcessingWithError,d=e.onSubmit,b=e.customerId,m=Object(S.b)(),f=m.currentStatus,j=m.activePaymentMethod,x=m.onPaymentProcessing,R=m.setExpressPaymentError,T=m.shouldSavePayment,A=Object(C.b)(),I=A.shippingErrorStatus,M=A.shippingErrorTypes,D=A.shippingRates,F=A.shippingRatesLoading,B=A.selectedRates,L=A.setSelectedRates,V=A.isSelectingRate,U=A.onShippingRateSuccess,z=A.onShippingRateFail,H=A.onShippingRateSelectSuccess,G=A.onShippingRateSelectFail,q=A.needsShipping,Y=Object(P.b)(),W=Y.billingData,$=Y.shippingAddress,X=Y.setShippingAddress,K=Object(y.a)().cartTotals,J=Object(_.a)().appliedCoupons,Z=Object(w.c)(),Q=Z.noticeContexts,ee=Z.responseTypes,te=Object(o.useRef)(N(K,q)),ne=Object(o.useRef)({label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)});Object(o.useEffect)((function(){te.current=N(K,q),ne.current={label:Object(r.__)("Total",'woocommerce'),value:parseInt(K.total_price,10)}}),[K,q]);var re=Object(o.useCallback)((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";v()("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"}),R(e)}),[R]);return{activePaymentMethod:j,billing:{billingData:W,cartTotal:ne.current,currency:Object(c.getCurrencyFromPriceResponse)(K),cartTotalItems:te.current,displayPricesIncludingTax:Object(h.getSetting)("displayCartPricesIncludingTax",!1),appliedCoupons:J,customerId:b},checkoutStatus:{isCalculating:t,isComplete:n,isIdle:a,isProcessing:s},components:{ValidationInputError:E.a,PaymentMethodIcons:g.a,PaymentMethodLabel:O},emitResponse:{noticeContexts:Q,responseTypes:ee},eventRegistration:{onCheckoutBeforeProcessing:i,onCheckoutValidationBeforeProcessing:l,onCheckoutAfterProcessingWithSuccess:u,onCheckoutAfterProcessingWithError:p,onShippingRateSuccess:U,onShippingRateFail:z,onShippingRateSelectSuccess:H,onShippingRateSelectFail:G,onPaymentProcessing:x},onSubmit:d,paymentStatus:f,setExpressPaymentError:re,shippingData:{shippingRates:D,shippingRatesLoading:F,selectedRates:B,setSelectedRates:L,isSelectingRate:V,shippingAddress:$,setShippingAddress:X,needsShipping:q},shippingStatus:{shippingErrorStatus:I,shippingErrorTypes:M},shouldSavePayment:T}}},285:function(e,t,n){"use strict";n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return p}));var r=n(8),c=n.n(r),o=n(0),a=(n(2),n(21)),s=n(6),i=n.n(s),l=Object(o.createContext)({hasContainerWidth:!1,containerClassName:"",isMobile:!1,isSmall:!1,isMedium:!1,isLarge:!1}),u=function(){return Object(o.useContext)(l)},p=function(e){var t=e.children,n=e.className,r=void 0===n?"":n,s=function(){var e=Object(a.useResizeObserver)(),t=c()(e,2),n=t[0],r=t[1].width,o="";return r>700?o="is-large":r>520?o="is-medium":r>400?o="is-small":r&&(o="is-mobile"),[n,o]}(),u=c()(s,2),p=u[0],d=u[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)(l.Provider,{value:b},Object(o.createElement)("div",{className:i()(r,d)},p,t))}},286:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(8),i=n.n(s),l=n(16),u=n.n(l),p=n(0),d=n(1),b=n(11),m=n(6),f=n.n(m),O=n(132),g=n(57),h=n(234),j=n(21),v=n(72),E=n(41),y=(n(189),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),_=Object(b.forwardRef)((function(e,t){var n=e.className,r=e.id,o=e.type,a=void 0===o?"text":o,s=e.ariaLabel,l=e.ariaDescribedBy,d=e.label,b=e.screenReaderLabel,m=e.disabled,O=e.help,g=e.autoCapitalize,h=void 0===g?"off":g,j=e.autoComplete,v=void 0===j?"off":j,_=e.value,w=void 0===_?"":_,k=e.onChange,S=e.required,C=void 0!==S&&S,P=e.onBlur,N=void 0===P?function(){}:P,x=e.feedback,R=u()(e,y),T=Object(p.useState)(!1),A=i()(T,2),I=A[0],M=A[1];return Object(p.createElement)("div",{className:f()("wc-block-components-text-input",n,{"is-active":I||w})},Object(p.createElement)("input",c()({type:a,id:r,value:w,ref:t,autoCapitalize:h,autoComplete:v,onChange:function(e){k(e.target.value)},onFocus:function(){return M(!0)},onBlur:function(e){N(e.target.value),M(!1)},"aria-label":s||d,disabled:m,"aria-describedby":O&&!l?r+"__help":l,required:C},R)),Object(p.createElement)(E.a,{label:d,screenReaderLabel:b||d,wrapperElement:"label",wrapperProps:{htmlFor:r},htmlFor:r}),!!O&&Object(p.createElement)("p",{id:r+"__help",className:"wc-block-components-text-input__help"},O),x)})),w=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(j.withInstanceId)((function(e){var t=e.className,n=e.instanceId,r=e.id,o=e.ariaDescribedBy,s=e.errorId,l=e.validateOnMount,m=void 0===l||l,j=e.focusOnMount,E=void 0!==j&&j,y=e.onChange,k=e.showError,S=void 0===k||k,C=e.errorMessage,P=void 0===C?"":C,N=u()(e,w),x=Object(b.useState)(!0),R=i()(x,2),T=R[0],A=R[1],I=Object(b.useRef)(null),M=Object(O.b)(),D=M.getValidationError,F=M.hideValidationError,B=M.setValidationErrors,L=M.clearValidationError,V=M.getValidationErrorId,U=Object(g.b)().isBeforeProcessing,z=void 0!==r?r:"textinput-"+n,H=void 0!==s?s:z,G=Object(b.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=I.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?L(H):B(a()({},H,{message:t.validationMessage||Object(d.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[L,H,B]);Object(b.useEffect)((function(){var e;T&&(E&&(null===(e=I.current)||void 0===e||e.focus()),A(!1))}),[E,T,A]),Object(b.useEffect)((function(){T&&(m&&G(),A(!1))}),[T,A,m,G]),Object(b.useEffect)((function(){U&&G()}),[U,G]),Object(b.useEffect)((function(){return function(){L(H)}}),[L,H]);var q=D(H)||{};Object(v.c)(P)&&""!==P&&(q.message=P);var Y=q.message&&!q.hidden,W=S&&Y&&V(H)?V(H):o;return Object(p.createElement)(_,c()({className:f()(t,{"has-error":Y}),"aria-invalid":!0===Y,id:z,onBlur:function(){G(!1)},feedback:S&&Object(p.createElement)(h.a,{errorMessage:P,propertyName:H}),ref:I,onChange:function(e){F(H),y(e)},ariaDescribedBy:W},N))}))},3:function(e,t){e.exports=window.wc.wcSettings},303:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.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,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(28),l=["className","size"],u=Object(s.createElement)((function(e){var t=e.className,n=e.size,r=a()(e,l);return Object(s.createElement)(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},r),Object(s.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=u},307:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(0),a=n(25),s=n(3);t.a=function(e){var t=e.image,n=void 0===t?{}:t,r={src:n.thumbnail||s.PLACEHOLDER_IMG_SRC,alt:Object(a.decodeEntities)(n.alt)||""};return Object(o.createElement)("img",c()({},r,{alt:r.alt}))}},308:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(){return Object(r.createElement)(o.a,{className:"wc-block-components-product-backorder-badge"},Object(c.__)("Available on backorder",'woocommerce'))}},309:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(110);t.a=function(e){var t=e.lowStockRemaining;return t?Object(r.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,n){"use strict";var r=n(0),c=n(7),o=n(25),a=(n(264),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:Object(r.createElement)("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(c.kebabCase)(e.name)):"";return Object(r.createElement)("li",{key:e.name+(e.display||e.value),className:t},e.name&&Object(r.createElement)(r.Fragment,null,Object(r.createElement)("span",{className:"wc-block-components-product-details__name"},Object(o.decodeEntities)(e.name),":")," "),Object(r.createElement)("span",{className:"wc-block-components-product-details__value"},Object(o.decodeEntities)(e.display||e.value)))}))):null}),s=n(155),i=n(37),l=function(e){var t=e.className,n=e.shortDescription,c=void 0===n?"":n,o=e.fullDescription,a=c||(void 0===o?"":o);return a?Object(r.createElement)(s.a,{className:t,source:a,maxLength:15,countType:i.o.wordCountType||"words"}):null};n(263),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,c=e.fullDescription,o=void 0===c?"":c,s=e.itemData,i=void 0===s?[]:s,u=e.variation,p=void 0===u?[]:u;return Object(r.createElement)("div",{className:"wc-block-components-product-metadata"},Object(r.createElement)(l,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:o}),Object(r.createElement)(a,{details:i}),Object(r.createElement)(a,{details:p.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},321:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(126),c=function(e,t){return function(n){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,o=r.a.addEventCallback(e,n,c);return t(o),function(){t(r.a.removeEventCallback(e,o.id))}}}},322:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(38),c=n.n(r),o=n(29),a=n.n(o),s=n(22),i=n.n(s),l=function(e,t){return e[t]?Array.from(e[t].values()).sort((function(e,t){return e.priority-t.priority})):[]},u=n(50);function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return d(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(e,void 0):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,c=function(){};return{s:c,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},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,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var b=function(){var e=a()(i.a.mark((function e(t,n,r){var o,a,s,u,d,b;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=l(t,n),a=[],s=p(o),e.prev=3,s.s();case 5:if((u=s.n()).done){e.next=19;break}return d=u.value,e.prev=7,e.next=10,Promise.resolve(d.callback(r));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),s.e(e.t1);case 24:return e.prev=24,s.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,n){return e.apply(this,arguments)}}(),m=function(){var e=a()(i.a.mark((function e(t,n,r){var o,a,s,d,b,m;return i.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=[],a=l(t,n),s=p(a),e.prev=3,s.s();case 5:if((d=s.n()).done){e.next=28;break}return b=d.value,e.prev=7,e.next=10,Promise.resolve(b.callback(r));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(u.a)(m)&&!Object(u.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),s.e(e.t1);case 33:return e.prev=33,s.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,n,r){return e.apply(this,arguments)}}()},34:function(e,t){e.exports=window.wp.isShallowEqual},37:function(e,t,n){"use strict";n.d(t,"o",(function(){return o})),n.d(t,"m",(function(){return a})),n.d(t,"l",(function(){return s})),n.d(t,"n",(function(){return i})),n.d(t,"j",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return p})),n.d(t,"g",(function(){return d})),n.d(t,"k",(function(){return b})),n.d(t,"c",(function(){return m})),n.d(t,"d",(function(){return f})),n.d(t,"h",(function(){return O})),n.d(t,"a",(function(){return g})),n.d(t,"i",(function(){return h})),n.d(t,"b",(function(){return j}));var r,c=n(3),o=Object(c.getSetting)("wcBlocksConfig",{buildPhase:1,pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),a=o.pluginUrl+"images/",s=o.pluginUrl+"build/",i=o.buildPhase,l=null===(r=c.STORE_PAGES.shop)||void 0===r?void 0:r.permalink,u=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",{}),j=Object(c.getSetting)("allowedStates",{})},39:function(e,t,n){"use strict";n.d(t,"h",(function(){return b})),n.d(t,"e",(function(){return m})),n.d(t,"b",(function(){return f})),n.d(t,"i",(function(){return O})),n.d(t,"f",(function(){return g})),n.d(t,"c",(function(){return h})),n.d(t,"d",(function(){return j})),n.d(t,"g",(function(){return v})),n.d(t,"a",(function(){return E}));var r=n(5),c=n.n(r),o=n(23),a=n(15),s=n.n(a),i=n(7),l=n(3),u=n(37);function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function d(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var b=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,l=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=void 0===r?"":r,a=e.queryArgs,s=void 0===a?{}:a,i=u.o.productCount>100,l={per_page:i?100:0,catalog_visibility:"any",search:c,orderby:"title",order:"asc"},p=[Object(o.addQueryArgs)("/wc/store/products",d(d({},l),s))];return i&&n.length&&p.push(Object(o.addQueryArgs)("/wc/store/products",{catalog_visibility:"any",include:n,per_page:0})),p}({selected:n,search:c,queryArgs:void 0===a?{}:a});return Promise.all(l.map((function(e){return s()({path:e})}))).then((function(e){return Object(i.uniqBy)(Object(i.flatten)(e),"id").map((function(e){return d(d({},e),{},{parent:0})}))})).catch((function(e){throw e}))},m=function(e){return s()({path:"/wc/store/products/".concat(e)})},f=function(){return s()({path:"wc/store/products/attributes"})},O=function(e){return s()({path:"wc/store/products/attributes/".concat(e,"/terms")})},g=function(e){var t=e.selected,n=function(e){var t=e.selected,n=void 0===t?[]:t,r=e.search,c=Object(l.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:r})];return c&&n.length&&a.push(Object(o.addQueryArgs)("wc/store/products/tags",{include:n})),a}({selected:void 0===t?[]:t,search:e.search});return Promise.all(n.map((function(e){return s()({path:e})}))).then((function(e){return Object(i.uniqBy)(Object(i.flatten)(e),"id")}))},h=function(e){return s()({path:Object(o.addQueryArgs)("wc/store/products/categories",d({per_page:0},e))})},j=function(e){return s()({path:"wc/store/products/categories/".concat(e)})},v=function(e){return s()({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 n=1===t.filter((function(t){return t.title.raw===e.title.raw})).length;return e.title.raw+(n?"":" - ".concat(e.slug))}},4:function(e,t){e.exports=window.wp.components},41:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(6),s=n.n(a);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,r=e.screenReaderLabel,c=e.wrapperElement,a=e.wrapperProps,i=void 0===a?{}:a,u=null!=n,p=null!=r;return!u&&p?(t=c||"span",i=l(l({},i),{},{className:s()(i.className,"screen-reader-text")}),Object(o.createElement)(t,i,r)):(t=c||o.Fragment,u&&p&&n!==r?Object(o.createElement)(t,i,Object(o.createElement)("span",{"aria-hidden":"true"},n),Object(o.createElement)("span",{className:"screen-reader-text"},r)):Object(o.createElement)(t,i,n))}},42:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l}));var r=n(29),c=n.n(r),o=n(22),a=n.n(o),s=n(1),i=function(){var e=c()(a.a.mark((function e(t){var n;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 n=e.sent,e.abrupt("return",{message:n.message,type:n.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)}}(),l=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(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')}},43:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(8),c=n.n(r),o=n(5),a=n.n(o),s=n(7),i=n(0),l=n(24),u=n(14),p=n(25),d=n(142),b=n(162),m=n(63);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var g={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},h=O(O({},g),{},{email:""}),j={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:l.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},v=function(e){return Object(d.a)(Object.entries(e).map((function(e){var t=c()(e,2),n=t[0],r=t[1];return[n,Object(p.decodeEntities)(r)]})))},E={cartCoupons:l.EMPTY_CART_COUPONS,cartItems:l.EMPTY_CART_ITEMS,cartFees:l.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:l.EMPTY_CART_ITEM_ERRORS,cartTotals:j,cartIsLoading:!0,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,shippingRates:l.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:l.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:l.EMPTY_EXTENSIONS},y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},t=Object(m.b)(),n=t.isEditor,r=t.previewData,c=null==r?void 0:r.previewCart,o=e.shouldSelect,a=Object(i.useRef)(),p=Object(u.useSelect)((function(e,t){var r=t.dispatch;if(!o)return E;if(n)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:l.EMPTY_CART_ITEM_ERRORS,cartTotals:c.totals,cartIsLoading:!1,cartErrors:l.EMPTY_CART_ERRORS,billingAddress:h,shippingAddress:g,extensions:l.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(l.CART_STORE_KEY),s=a.getCartData(),i=a.getCartErrors(),u=a.getCartTotals(),p=!a.hasFinishedResolution("getCartData"),d=a.isCustomerDataUpdating(),m=r(l.CART_STORE_KEY).receiveCart,f=v(s.billingAddress),j=s.needsShipping?v(s.shippingAddress):f,y=s.fees.length>0?s.fees.map((function(e){return v(e)})):l.EMPTY_CART_FEES;return{cartCoupons:s.coupons.length>0?s.coupons.map((function(e){return O(O({},e),{},{label:e.code})})):l.EMPTY_CART_COUPONS,cartItems:s.items,cartFees:y,cartItemsCount:s.itemsCount,cartItemsWeight:s.itemsWeight,cartNeedsPayment:s.needsPayment,cartNeedsShipping:s.needsShipping,cartItemErrors:s.errors,cartTotals:u,cartIsLoading:p,cartErrors:i,billingAddress:Object(b.a)(f),shippingAddress:Object(b.a)(j),extensions:s.extensions,shippingRates:s.shippingRates,shippingRatesLoading:d,cartHasCalculatedShipping:s.hasCalculatedShipping,paymentRequirements:s.paymentRequirements,receiveCart:m}}),[o]);return a.current&&Object(s.isEqual)(a.current,p)||(a.current=p),a.current}},44:function(e,t,n){},46:function(e,t){e.exports=window.wp.keycodes},47:function(e,t){e.exports=window.wc.priceFormat},494:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c),a=(n(2),n(285));n(261),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)(a.a,{className:o()("wc-block-components-sidebar-layout",n)},t)}},495:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-main",n)},t)}},496:function(e,t,n){"use strict";var r=n(0),c=n(6),o=n.n(c);n(2),t.a=function(e){var t=e.children,n=e.className;return Object(r.createElement)("div",{className:o()("wc-block-components-sidebar",n)},t)}},497:function(e,t,n){"use strict";var r=n(0),c=n(1),o=n(83),a=n(220),s=(n(2),n(27)),i=n(3),l=(n(265),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,u=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===n.length)return null;var g=parseInt(f,10),h=Object(i.getSetting)("displayCartPricesIncludingTax",!1)?O+g:O,j=Object(s.__experimentalApplyCheckoutFilter)({arg:l,filterName:"coupons",defaultValue:n});return Object(r.createElement)(s.TotalsItem,{className:"wc-block-components-totals-discount",currency:u,description:0!==j.length&&Object(r.createElement)(o.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},Object(r.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},j.map((function(e){return Object(r.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,n){"use strict";var r=n(8),c=n.n(r),o=n(0),a=n(1),s=n(90),i=n(286),l=n(41),u=n(83),p=(n(2),n(21)),d=n(132),b=n(234),m=n(27);n(266),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,r=void 0!==n&&n,p=e.initialOpen,f=void 0!==p&&p,O=e.onSubmit,g=void 0===O?function(){}:O,h=Object(o.useState)(""),j=c()(h,2),v=j[0],E=j[1],y=Object(o.useRef)(!1),_=Object(d.b)(),w=_.getValidationError,k=_.getValidationErrorId,S=w("coupon");Object(o.useEffect)((function(){y.current!==r&&(r||!v||S||E(""),y.current=r)}),[r,v,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)(l.a,{label:Object(a.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(a.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},Object(o.createElement)(u.a,{screenReaderLabel:Object(a.__)("Applying coupon…",'woocommerce'),isLoading:r,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)(i.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(a.__)("Enter code",'woocommerce'),value:v,ariaDescribedBy:k(C),onChange:function(e){E(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),Object(o.createElement)(s.a,{className:"wc-block-components-totals-coupon__button",disabled:r||!v,showSpinner:r,onClick:function(e){e.preventDefault(),g(v)},type:"submit"},Object(a.__)("Apply",'woocommerce'))),Object(o.createElement)(b.a,{propertyName:"coupon",elementId:C}))))}))},50:function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return l})),n.d(t,"c",(function(){return p}));var r,c,o=n(72);!function(e){e.SUCCESS="success",e.FAIL="failure",e.ERROR="error"}(r||(r={})),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},s=function(e){return a(e,r.SUCCESS)},i=function(e){return a(e,r.ERROR)},l=function(e){return a(e,r.FAIL)},u=function(e){return!Object(o.b)(e)||void 0===e.retry||!0===e.retry},p=function(){return{responseTypes:r,noticeContexts:c,shouldRetry:u,isSuccessResponse:s,isErrorResponse:i,isFailResponse:l}}},500:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return c}));var r=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,n){"use strict";var r=n(16),c=n.n(r),o=n(0),a=n(1),s=n(53),i=(n(2),n(27)),l=n(43),u=n(3),p=(n(273),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,r=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,b=n.total_tax,m=Object(l.a)(),f=(m.receiveCart,c()(m,p)),O=Object(i.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(a.__)("Total",'woocommerce'),extensions:f.extensions,arg:{cart:f}}),g=parseInt(b,10);return Object(o.createElement)(i.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:O,value:parseInt(d,10),description:r&&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)(s.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:g})}))})}},502:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0V0z"}),Object(r.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,n){"use strict";var r=n(5),c=n.n(r),o=n(0),a=n(286),s=n(9),i=n.n(s),l=n(37),u=n(1),p=n(25),d=n(6),b=n.n(d),m=n(21),f=n(898),O=n(132),g=n(234),h=n(72),j=(n(269),Object(m.withInstanceId)((function(e){var t=e.id,n=e.className,r=e.label,a=e.onChange,s=e.options,i=e.value,l=e.required,p=void 0!==l&&l,d=e.errorMessage,m=void 0===d?Object(u.__)("Please select a value.",'woocommerce'):d,j=e.errorId,v=e.instanceId,E=void 0===v?"0":v,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),N=t||"control-"+E,x=j||N,R=k(x)||{message:"",hidden:!1};return Object(o.useEffect)((function(){return!p||i?C(x):S(c()({},x,{message:m,hidden:!0})),function(){C(x)}}),[C,i,x,m,p,S]),Object(o.createElement)("div",{id:N,className:b()("wc-block-components-combobox",n,{"is-active":i,"has-error":R.message&&!R.hidden}),ref:P},Object(o.createElement)(f.a,{className:"wc-block-components-combobox-control",label:r,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 n=e.toLocaleUpperCase(),r=s.find((function(e){return e.label.toLocaleUpperCase().startsWith(n)||e.value.toLocaleUpperCase()===n}));r&&a(r.value)}},options:s,value:i||"",allowReset:!1,autoComplete:_,"aria-invalid":R.message&&!R.hidden}),Object(o.createElement)(g.a,{propertyName:x}))}))),v=(n(268),function(e){var t=e.className,n=e.countries,r=e.id,c=e.label,a=e.onChange,s=e.value,i=void 0===s?"":s,l=e.autoComplete,d=void 0===l?"off":l,m=e.required,f=void 0!==m&&m,O=e.errorId,g=e.errorMessage,h=void 0===g?Object(u.__)("Please select a country.",'woocommerce'):g,v=Object(o.useMemo)((function(){return Object.keys(n).map((function(e){return{value:e,label:Object(p.decodeEntities)(n[e])}}))}),[n]);return Object(o.createElement)("div",{className:b()(t,"wc-block-components-country-input")},Object(o.createElement)(j,{id:r,label:c,onChange:a,options:v,value:i,errorId:O,errorMessage:h,required:f,autoComplete:d}),"off"!==d&&Object(o.createElement)("input",{type:"text","aria-hidden":!0,autoComplete:d,value:i,onChange:function(e){var t=e.target.value.toLocaleUpperCase(),n=v.find((function(e){return 2!==t.length&&e.label.toLocaleUpperCase()===t||2===t.length&&e.value.toLocaleUpperCase()===t}));a(n?n.value:"")},style:{minHeight:"0",height:"0",border:"0",padding:"0",position:"absolute"},tabIndex:-1}))}),E=function(e){return Object(o.createElement)(v,i()({countries:l.h},e))},y=function(e){return Object(o.createElement)(v,i()({countries:l.a},e))},_=(n(270),function(e,t){var n=t.find((function(t){return t.label.toLocaleUpperCase()===e.toLocaleUpperCase()||t.value.toLocaleUpperCase()===e.toLocaleUpperCase()}));return n?n.value:""}),w=function(e){var t=e.className,n=e.id,r=e.states,c=e.country,s=e.label,i=e.onChange,l=e.autoComplete,d=void 0===l?"off":l,m=e.value,f=void 0===m?"":m,O=e.required,g=void 0!==O&&O,h=r[c],v=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){i(v.length>0?_(e,v):e)}),[i,v]),y=Object(o.useRef)(f);return Object(o.useEffect)((function(){y.current!==f&&(y.current=f)}),[f]),Object(o.useEffect)((function(){if(v.length>0&&y.current){var e=_(y.current,v);e!==y.current&&E(e)}}),[v,E]),v.length>0?Object(o.createElement)(o.Fragment,null,Object(o.createElement)(j,{className:b()(t,"wc-block-components-state-input"),id:n,label:s,onChange:E,options:v,value:f,errorMessage:Object(u.__)("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:n,label:s,onChange:E,autoComplete:d,value:f,required:g})},k=function(e){return Object(o.createElement)(w,i()({states:l.i},e))},S=function(e){return Object(o.createElement)(w,i()({states:l.b},e))},C=n(62),P=n(3),N=n(113);function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=Object(m.withInstanceId)((function(e){var t=e.id,n=e.fields,r=void 0===n?Object.keys(P.defaultAddressFields):n,s=e.fieldConfig,i=void 0===s?{}:s,l=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,j=f.clearValidationError,v=Object(C.a)(r),_=g("shipping-missing-country")||{},w=Object(o.useMemo)((function(){return Object(N.a)(v,i,m.country)}),[v,i,m.country]);return Object(o.useEffect)((function(){w.forEach((function(e){e.hidden&&m[e.key]&&p(R(R({},m),{},c()({},e.key,"")))}))}),[w,p,m]),Object(o.useEffect)((function(){"shipping"===b&&function(e,t,n,r){r||e.country||!(e.city||e.state||e.postcode)||t({"shipping-missing-country":{message:Object(u.__)("Please select a country to calculate rates.",'woocommerce'),hidden:!1}}),r&&e.country&&n("shipping-missing-country")}(m,h,j,!!_.message&&!_.hidden)}),[m,_.message,_.hidden,h,j,b]),t=t||l,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 n="shipping"===b?E:y;return Object(o.createElement)(n,{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(R(R({},m),{},{country:e,state:""}))},errorId:"shipping"===b?"shipping-missing-country":null,errorMessage:e.errorMessage,required:e.required})}if("state"===e.key){var r="shipping"===b?k:S;return Object(o.createElement)(r,{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(R(R({},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(R(R({},m),{},c()({},e.key,t)))},errorMessage:e.errorMessage,required:e.required})})))}))},510:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(6),l=n.n(i),u=n(1),p=n(43),d=n(27),b=n(3),m=function(e){var t=e.selectedShippingRates;return Object(s.createElement)("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(u.__)("via",'woocommerce')," ",t.join(", "))},f=n(890),O=n(200),g=function(e){var t=e.hasRates,n=e.shippingRates,r=e.shippingRatesLoading,c=t?Object(u.__)("Shipping options",'woocommerce'):Object(u.__)("Choose a shipping option",'woocommerce');return Object(s.createElement)("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},Object(s.createElement)("legend",{className:"screen-reader-text"},c),Object(s.createElement)(O.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:Object(s.createElement)(f.a,{isDismissible:!1,className:l()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(u.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:r}))},h=n(75),j=n(90),v=n(34),E=n.n(v),y=n(132),_=(n(190),n(504)),w=function(e){var t=e.address,n=e.onUpdate,r=e.addressFields,c=Object(s.useState)(t),o=a()(c,2),i=o[0],l=o[1],p=Object(y.b)(),d=p.hasValidationErrors,b=p.showAllValidationErrors;return Object(s.createElement)("form",{className:"wc-block-components-shipping-calculator-address"},Object(s.createElement)(_.a,{fields:r,onChange:l,values:i}),Object(s.createElement)(j.a,{className:"wc-block-components-shipping-calculator-address__button",disabled:E()(i,t),onClick:function(e){if(e.preventDefault(),b(),!d)return n(i)},type:"submit"},Object(u.__)("Update",'woocommerce')))},k=function(e){var t=e.onUpdate,n=void 0===t?function(){}:t,r=e.addressFields,c=void 0===r?["country","state","city","postcode"]:r,o=Object(h.b)(),a=o.shippingAddress,i=o.setShippingAddress;return Object(s.createElement)("div",{className:"wc-block-components-shipping-calculator"},Object(s.createElement)(w,{address:a,addressFields:c,onUpdate:function(e){i(e),n(e)}}))},S=n(38),C=n.n(S),P=n(25),N=function(e){var t=e.address;if(0===Object.values(t).length)return null;var n=Object(b.getSetting)("shippingCountries",{}),r=Object(b.getSetting)("shippingStates",{}),c="string"==typeof n[t.country]?Object(P.decodeEntities)(n[t.country]):"",o="object"===C()(r[t.country])&&"string"==typeof r[t.country][t.state]?Object(P.decodeEntities)(r[t.country][t.state]):t.state,a=[];a.push(t.postcode.toUpperCase()),a.push(t.city),a.push(o),a.push(c);var i=a.filter(Boolean).join(", ");return i?Object(s.createElement)("span",{className:"wc-block-components-shipping-address"},Object(u.sprintf)(
|
||
/* translators: %s location. */
|
||
Object(u.__)("Shipping to %s",'woocommerce'),i)+" "):null},x=(n(267),function(e){var t=e.label,n=void 0===t?Object(u.__)("Calculate",'woocommerce'):t,r=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return Object(s.createElement)("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!r)},"aria-expanded":r},n)}),R=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(N,{address:c}),t&&Object(s.createElement)(x,{label:Object(u.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}))},T=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,r=e.setIsShippingCalculatorOpen;return t?Object(s.createElement)(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:r}):Object(s.createElement)("em",null,Object(u.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,r=e.showCalculator,o=void 0===r||r,i=e.showRateSelector,f=void 0===i||i,O=e.className,h=Object(s.useState)(!1),j=a()(h,2),v=j[0],E=j[1],y=Object(p.a)(),_=y.shippingAddress,w=y.cartHasCalculatedShipping,S=y.shippingRates,C=y.shippingRatesLoading,P=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),N=S.some((function(e){return e.shipping_rates.length}))||P,x={isShippingCalculatorOpen:v,setIsShippingCalculatorOpen:E},A=S.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return Object(s.createElement)("div",{className:l()("wc-block-components-totals-shipping",O)},Object(s.createElement)(d.TotalsItem,{label:Object(u.__)("Shipping",'woocommerce'),value:w?P:Object(s.createElement)(T,c()({showCalculator:o},x)),description:Object(s.createElement)(s.Fragment,null,w&&Object(s.createElement)(s.Fragment,null,Object(s.createElement)(m,{selectedShippingRates:A}),Object(s.createElement)(R,c()({shippingAddress:_,showCalculator:o},x)))),currency:t}),o&&v&&Object(s.createElement)(k,{onUpdate:function(){E(!1)}}),f&&w&&Object(s.createElement)(g,{hasRates:N,shippingRates:S,shippingRatesLoading:C}))}},517:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r=n(8),c=n.n(r),o=n(0),a=n(4),s=n(1),i=n(3),l=n(33),u=n.n(l),p=[],d=n(9),b=n.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 n=Object(o.useState)((function(){var n=window.localStorage.getItem(e);if(n)try{return JSON.parse(n)}catch(t){console.error("Value for key '".concat(e,"' could not be retrieved from localStorage because it can't be parsed."))}return t})),r=c()(n,2),a=r[0],s=r[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,s]}("wc-blocks_dismissed_compatibility_notices",p),n=c()(t,2),r=n[0],a=n[1],s=Object(o.useState)(!1),i=c()(s,2),l=i[0],d=i[1],b=r.includes(e);return Object(o.useEffect)((function(){d(!b)}),[b]),[l,function(){var t=new Set(r);t.add(e),a(u()(t))}]}(e.blockName),n=c()(t,2),r=n[0],l=n[1];return Object(i.isWpVersion)("5.4","<=")||!r?null:Object(o.createElement)(a.Guide,{className:"edit-post-welcome-guide",contentLabel:Object(s.__)("Compatibility notice",'woocommerce'),onFinish:function(){return l()},finishButtonText:Object(s.__)("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(s.__)("Compatibility notice",'woocommerce')),Object(o.createElement)("p",{className:"edit-post-welcome-guide__text"},Object(o.createInterpolateElement)(Object(s.__)("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(s.__)("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,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(1),c=n(37),o=n(3),a=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(r.__)("Shipping",'woocommerce'),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(r._x)("Beanie with Logo","example product in Cart Block",'woocommerce'),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(r._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(r.__)("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(r.__)("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}]}],s=Object(o.getSetting)("displayCartPricesIncludingTax",!1),i={coupons:[],shipping_rates:Object(o.getSetting)("shippingMethodsExist",!1)?a:[],items:[{key:"1",id:1,quantity:2,name:Object(r.__)("Beanie",'woocommerce'),short_description:Object(r.__)("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(r.__)("Color",'woocommerce'),value:Object(r.__)("Yellow",'woocommerce')},{attribute:Object(r.__)("Size",'woocommerce'),value:Object(r.__)("Small",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"800":"640",regular_price:s?"800":"640",sale_price:s?"800":"640",raw_prices:{precision:6,price:s?"8000000":"6400000",regular_price:s?"8000000":"6400000",sale_price:s?"8000000":"6400000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:s?"1600":"1280",line_subtotal_tax:"0",line_total:"1600",line_total_tax:s?"0":"320"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(r.__)("Cap",'woocommerce'),short_description:Object(r.__)("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(r.__)("Color",'woocommerce'),value:Object(r.__)("Orange",'woocommerce')}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:s?"1400":"1120",regular_price:s?"1600":"1280",sale_price:s?"1400":"1120",raw_prices:{precision:6,price:s?"14000000":"11200000",regular_price:s?"16000000":"12800000",sale_price:s?"14000000":"11200000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:s?"1400":"1120",line_subtotal_tax:s?"0":"280",line_total:"1400",line_total_tax:s?"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:s?"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(r.__)("Sales tax",'woocommerce'),rate:"20%",price:600}]},errors:[],payment_requirements:["products"],generated_timestamp:Date.now(),extensions:{}}},53:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(5),a=n.n(o),s=n(16),i=n.n(s),l=n(0),u=n(166),p=n(6),d=n.n(p),b=(n(175),["className","value","currency","onValueChange","displayType"]);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t=e.className,n=e.value,r=e.currency,o=e.onValueChange,a=e.displayType,s=void 0===a?"text":a,p=i()(e,b),m="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(m))return null;var O=m/Math.pow(10,r.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}}(r)),{},{value:void 0,currency:void 0,onValueChange:void 0}),j=o?function(e){var t=e.value*Math.pow(10,r.minorUnit);o(t)}:function(){};return Object(l.createElement)(u.a,c()({className:g,displayType:s},h,{value:O,onValueChange:j}))}},535:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-fields-block","version":"1.0.0","title":"Checkout Fields","description":"Column containing checkout address fields.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},536:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-totals-block","version":"1.0.0","title":"Checkout Totals","description":"Column containing the checkout 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}},"parent":["woocommerce/checkout"],"textdomain":'woocommerce',"apiVersion":2}')},537:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-address-block","version":"1.0.0","title":"Shipping Address","description":"Collect your customer\'s shipping address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},538:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-terms-block","version":"1.0.0","title":"Terms and Conditions","description":"Ensure customers agree to your terms and conditions and privacy policy.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false},"attributes":{"checkbox":{"type":"boolean","default":false},"text":{"type":"string","required":false}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},539:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-contact-information-block","version":"1.0.0","title":"Contact Information","description":"Collect your customer\'s contact information.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},540:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-billing-address-block","version":"1.0.0","title":"Billing Address","description":"Collect your customer\'s billing address.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},541:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-actions-block","version":"1.0.0","title":"Actions","description":"Allow customers to place 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/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},542:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-order-note-block","version":"1.0.0","title":"Order Note","description":"Allow customers to add a note to 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/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},543:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-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}}},"parent":["woocommerce/checkout-totals-block"],"textdomain":'woocommerce',"apiVersion":2}')},544:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-payment-block","version":"1.0.0","title":"Payment Options","description":"Payment options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},545:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-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/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},546:function(e){e.exports=JSON.parse('{"name":"woocommerce/checkout-shipping-methods-block","version":"1.0.0","title":"Shipping Options","description":"Shipping options for your store.","category":"woocommerce","supports":{"align":false,"html":false,"multiple":false,"reusable":false,"inserter":false},"attributes":{"lock":{"type":"object","default":{"remove":true,"move":true}}},"parent":["woocommerce/checkout-fields-block"],"textdomain":'woocommerce',"apiVersion":2}')},55:function(e,t){e.exports=window.wp.hooks},56:function(e,t){e.exports=window.wp.deprecated},567:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24"},Object(r.createElement)("path",{fill:"none",d:"M0 0h24v24H0z"}),Object(r.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"}));t.a=o},57:function(e,t,n){"use strict";n.d(t,"b",(function(){return F})),n.d(t,"a",(function(){return B}));var r,c=n(8),o=n.n(c),a=n(0),s=n(1),i=n(136),l=n(56),u=n.n(l),p=n(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"}(r||(r={}));var d,b,m=function(){return{type:r.SET_IDLE}},f=function(e){return{type:r.SET_REDIRECT_URL,redirectUrl:e}},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:r.SET_COMPLETE,data:e}},g=function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:e?r.SET_HAS_ERROR:r.SET_NO_ERROR}},h=n(5),j=n.n(h),v=n(3);function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}!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 n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({order_id:0,customer_id:0},(null===(d=Object(v.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 n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){j()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,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,n=t.redirectUrl,c=t.type,o=t.customerId,a=t.orderId,s=t.orderNotes,i=t.extensionData,l=t.shouldCreateAccount,u=t.data,p=e;switch(c){case r.SET_PRISTINE:p=_;break;case r.SET_IDLE:p=e.status!==b.IDLE?k(k({},e),{},{status:b.IDLE}):e;break;case r.SET_REDIRECT_URL:p=void 0!==n&&n!==e.redirectUrl?k(k({},e),{},{redirectUrl:n}):e;break;case r.SET_PROCESSING_RESPONSE:p=k(k({},e),{},{processingResponse:u});break;case r.SET_COMPLETE:p=e.status!==b.COMPLETE?k(k({},e),{},{status:b.COMPLETE,redirectUrl:void 0!==u&&"string"==typeof u.redirectUrl&&u.redirectUrl?u.redirectUrl:e.redirectUrl}):e;break;case r.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 r.SET_BEFORE_PROCESSING:p=e.status!==b.BEFORE_PROCESSING?k(k({},e),{},{status:b.BEFORE_PROCESSING,hasError:!1}):e;break;case r.SET_AFTER_PROCESSING:p=e.status!==b.AFTER_PROCESSING?k(k({},e),{},{status:b.AFTER_PROCESSING}):e;break;case r.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 r.SET_NO_ERROR:p=e.hasError?k(k({},e),{},{hasError:!1}):e;break;case r.INCREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:e.calculatingCount+1});break;case r.DECREMENT_CALCULATING:p=k(k({},e),{},{calculatingCount:Math.max(0,e.calculatingCount-1)});break;case r.SET_CUSTOMER_ID:p=void 0!==o?k(k({},e),{},{customerId:o}):e;break;case r.SET_ORDER_ID:p=void 0!==a?k(k({},e),{},{orderId:a}):e;break;case r.SET_SHOULD_CREATE_ACCOUNT:void 0!==l&&l!==e.shouldCreateAccount&&(p=k(k({},e),{},{shouldCreateAccount:l}));break;case r.SET_ORDER_NOTES:void 0!==s&&e.orderNotes!==s&&(p=k(k({},e),{},{orderNotes:s}));break;case r.SET_EXTENSION_DATA:void 0!==i&&e.extensionData!==i&&(p=k(k({},e),{},{extensionData:i}))}return p!==e&&c!==r.SET_PRISTINE&&p.status===b.PRISTINE&&(p.status=b.IDLE),p},C=n(25),P=n(126),N=n(321),x=n(322),R=n(132),T=n(59),A=n(68),I=n(14),M=n(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:{}}),F=function(){return Object(a.useContext)(D)},B=function(e){var t=e.children,n=e.redirectUrl,c=e.isCart,l=void 0!==c&&c;_.redirectUrl=n;var d,h=Object(a.useReducer)(S,_),j=o()(h,2),v=j[0],E=j[1],y=Object(R.b)().setValidationErrors,w=Object(T.a)(),k=w.addErrorNotice,F=w.removeNotices,B=Object(A.a)().dispatchCheckoutEvent,L=v.calculatingCount>0,V=Object(M.c)(),U=V.isSuccessResponse,z=V.isErrorResponse,H=V.isFailResponse,G=V.shouldRetry,q=(d=Object(M.c)().noticeContexts,{checkoutNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices("wc/checkout")}),[]),expressPaymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(d.EXPRESS_PAYMENTS)}),[d.EXPRESS_PAYMENTS]),paymentNotices:Object(I.useSelect)((function(e){return e("core/notices").getNotices(d.PAYMENTS)}),[d.PAYMENTS])}),Y=q.checkoutNotices,W=q.paymentNotices,$=q.expressPaymentNotices,X=Object(a.useReducer)(P.b,{}),K=o()(X,2),J=K[0],Z=K[1],Q=Object(a.useRef)(J),ee=function(e){return Object(a.useMemo)((function(){return{onCheckoutAfterProcessingWithSuccess:Object(N.a)("checkout_after_processing_with_success",e),onCheckoutAfterProcessingWithError:Object(N.a)("checkout_after_processing_with_error",e),onCheckoutValidationBeforeProcessing:Object(N.a)("checkout_validation_before_processing",e)}}),[e])}(Z),te=ee.onCheckoutAfterProcessingWithSuccess,ne=ee.onCheckoutAfterProcessingWithError,re=ee.onCheckoutValidationBeforeProcessing;Object(a.useEffect)((function(){Q.current=J}),[J]);var ce=Object(a.useMemo)((function(){return function(){return u()("onCheckoutBeforeProcessing",{alternative:"onCheckoutValidationBeforeProcessing",plugin:"WooCommerce Blocks"}),re.apply(void 0,arguments)}}),[re]),oe=Object(a.useMemo)((function(){return{resetCheckout:function(){E({type:r.SET_PRISTINE})},setRedirectUrl:function(e){E(f(e))},setHasError:function(e){E(g(e))},incrementCalculating:function(){E({type:r.INCREMENT_CALCULATING})},decrementCalculating:function(){E({type:r.DECREMENT_CALCULATING})},setCustomerId:function(e){var t;E((t=e,{type:r.SET_CUSTOMER_ID,customerId:t}))},setOrderId:function(e){E(function(e){return{type:r.SET_ORDER_ID,orderId:e}}(e))},setOrderNotes:function(e){E(function(e){return{type:r.SET_ORDER_NOTES,orderNotes:e}}(e))},setExtensionData:function(e){E(function(e){return{type:r.SET_EXTENSION_DATA,extensionData:e}}(e))},setAfterProcessing:function(e){var t,n=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 n=e.key,r=e.value;t.paymentDetails[n]=Object(C.decodeEntities)(r)}))),"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(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce')),t}(e);n.redirectUrl&&E(f(n.redirectUrl)),E((t=n,{type:r.SET_PROCESSING_RESPONSE,data:t})),E({type:r.SET_AFTER_PROCESSING})}}}),[]);Object(a.useEffect)((function(){v.status===b.BEFORE_PROCESSING&&(F("error"),Object(x.a)(Q.current,"checkout_validation_before_processing",{}).then((function(e){!0!==e?(Array.isArray(e)&&e.forEach((function(e){var t=e.errorMessage,n=e.validationErrors;k(t),y(n)})),E(m()),E(g())):E({type:r.SET_PROCESSING})})))}),[v.status,y,k,F,E]);var ae=Object(i.a)(v.status),se=Object(i.a)(v.hasError);Object(a.useEffect)((function(){if((v.status!==ae||v.hasError!==se)&&v.status===b.AFTER_PROCESSING){var e={redirectUrl:v.redirectUrl,orderId:v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,processingResponse:v.processingResponse};v.hasError?Object(x.b)(Q.current,"checkout_after_processing_with_error",e).then((function(t){var n=function(e){var t=null;return e.forEach((function(e){if((z(e)||H(e))&&e.message){var n=e.messageContext?{context:e.messageContext}:void 0;t=e,k(e.message,n)}})),t}(t);if(null!==n)G(n)?E(m()):E(O(n));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 r,c=(null===(r=e.processingResponse)||void 0===r?void 0:r.message)||Object(s.__)("Something went wrong. Please contact us to get assistance.",'woocommerce');k(c,{id:"checkout"})}E(m())}})):Object(x.b)(Q.current,"checkout_after_processing_with_success",e).then((function(e){var t=null,n=null;if(e.forEach((function(e){U(e)&&(t=e),(z(e)||H(e))&&(n=e)})),t&&!n)E(O(t));else if(Object(p.b)(n)){if(n.message){var r=n.messageContext?{context:n.messageContext}:void 0;k(n.message,r)}G(n)?E(g(!0)):E(O(n))}else E(O())}))}}),[v.status,v.hasError,v.redirectUrl,v.orderId,v.customerId,v.orderNotes,v.processingResponse,ae,se,oe,k,z,H,U,G,Y,$,W]);var ie={onSubmit:Object(a.useCallback)((function(){B("submit"),E({type:r.SET_BEFORE_PROCESSING})}),[B]),isComplete:v.status===b.COMPLETE,isIdle:v.status===b.IDLE,isCalculating:L,isProcessing:v.status===b.PROCESSING,isBeforeProcessing:v.status===b.BEFORE_PROCESSING,isAfterProcessing:v.status===b.AFTER_PROCESSING,hasError:v.hasError,redirectUrl:v.redirectUrl,onCheckoutBeforeProcessing:ce,onCheckoutValidationBeforeProcessing:re,onCheckoutAfterProcessingWithSuccess:te,onCheckoutAfterProcessingWithError:ne,dispatchActions:oe,isCart:l,orderId:v.orderId,hasOrder:!!v.orderId,customerId:v.customerId,orderNotes:v.orderNotes,shouldCreateAccount:v.shouldCreateAccount,setShouldCreateAccount:function(e){return E((t=e,{type:r.SET_SHOULD_CREATE_ACCOUNT,shouldCreateAccount:t}));var t},extensionData:v.extensionData};return Object(a.createElement)(D.Provider,{value:ie},t)}},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(5),c=n.n(r),o=n(0),a=n(141);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var l=function(){var e=Object(a.b)(),t=e.notices,n=e.createNotice,r=e.removeNotice,c=e.setIsSuppressed,s=Object(o.useRef)(t);Object(o.useEffect)((function(){s.current=t}),[t]);var l=Object(o.useMemo)((function(){return{hasNoticesOfType:function(e){return s.current.some((function(t){return t.type===e}))},removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;s.current.forEach((function(t){null!==e&&t.status!==e||r(t.id)}))},removeNotice:r}}),[r]),u=Object(o.useMemo)((function(){return{addDefaultNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("default",e,i({},t))},addErrorNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("error",e,i({},t))},addWarningNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("warning",e,i({},t))},addInfoNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("info",e,i({},t))},addSuccessNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n("success",e,i({},t))}}}),[n]);return i(i(i({notices:t},l),u),{},{setIsSuppressed:c})}},60:function(e,t){e.exports=window.wc.wcBlocksRegistry},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var r=n(0),c=n(34),o=n.n(c);function a(e){var t=Object(r.useRef)(e);return o()(e,t.current)||(t.current=e),t.current}},63:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return s}));var r=n(0),c=n(14),o=Object(r.createContext)({isEditor:!1,currentPostId:0,previewData:{},getPreviewData:function(){}}),a=function(){return Object(r.useContext)(o)},s=function(e){var t=e.children,n=e.currentPostId,a=void 0===n?0:n,s=e.previewData,i=void 0===s?{}:s,l=Object(c.useSelect)((function(e){return a||e("core/editor").getCurrentPostId()}),[a]),u=Object(r.useCallback)((function(e){return e in i?i[e]:{}}),[i]),p={isEditor:!0,currentPostId:l,previewData:i,getPreviewData:u};return Object(r.createElement)(o.Provider,{value:p},t)}},64:function(e,t){e.exports=window.wp.a11y},66:function(e,t,n){"use strict";var r=n(5),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}t.a=function(e){var t=e.srcElement,n=e.size,r=void 0===n?24:n,o=a()(e,i);return Object(s.isValidElement)(t)?Object(s.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:r,height:r},o)):null}},67:function(e,t,n){"use strict";n.d(t,"b",(function(){return _})),n.d(t,"a",(function(){return w}));var r=n(8),c=n.n(r),o=n(0),a=n(3),s=n(5),i=n.n(s),l=n(14),u=n(24),p=n(287),d=n(34),b=n.n(d),m=n(162),f=n(42),O=n(43),g=n(59);function h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function j(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?h(Object(n),!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var v=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=n(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,n=function(){var e=Object(l.useDispatch)(u.CART_STORE_KEY).updateCustomerData,t=Object(g.a)(),n=t.addErrorNotice,r=t.removeNotice,a=Object(O.a)(),s=a.billingAddress,i=a.shippingAddress,d=Object(o.useState)({billingData:s,shippingAddress:i}),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 j(j({},t),{},{billingData:j(j({},t.billingData),e)})}))}),[]),S=Object(o.useCallback)((function(e){E((function(t){return j(j({},t),{},{shippingAddress:j(j({},t.shippingAddress),e)})}))}),[]);return Object(o.useEffect)((function(){(v(y.current.billingData,w.billingData)||v(y.current.shippingAddress,w.shippingAddress))&&(y.current=w,e({billing_address:w.billingData,shipping_address:w.shippingAddress}).then((function(){r("checkout")})).catch((function(e){n(Object(f.b)(e),{id:"checkout"})})))}),[w,n,r,e]),{billingData:h.billingData,shippingAddress:h.shippingAddress,setBillingData:k,setShippingAddress:S}}(),r=n.billingData,s=n.shippingAddress,i=n.setBillingData,d=n.setShippingAddress,m=Object(O.a)().cartNeedsShipping,h=Object(E.b)().customerId,_=Object(o.useState)((function(){return m&&(!h||(e=s,t=r,Object.keys(a.defaultAddressFields).every((function(n){return e[n]===t[n]}))));var e,t})),w=c()(_,2),k=w[0],S=w[1],C={billingData:r,shippingAddress:s,setBillingData:i,setShippingAddress:d,shippingAsBilling:k,setShippingAsBilling:S};return Object(o.createElement)(y.Provider,{value:C},t)}},68:function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(5),c=n.n(r),o=n(55),a=n(0),s=n(43);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var u=function(){var e=Object(s.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 n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{Object(o.doAction)("experimental__woocommerce_blocks-checkout-".concat(e),l(l({},n),{},{storeCart:t.current}))}catch(e){console.error(e)}}),[])}}},7:function(e,t){e.exports=window.lodash},72:function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return o})),n.d(t,"d",(function(){return a}));var r=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,n){"use strict";n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return x}));var r=n(5),c=n.n(r),o=n(8),a=n.n(o),s=n(0),i=n(34),l=n.n(i),u=n(142),p=function(e){return Object(u.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 n=t.type;return Object.values(d).includes(n)?n:e},O=n(126),g=n(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)}},j=n(322),v=n(57),E=n(67),y=n(43),_=n(134);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var k=d.NONE,S=d.INVALID_ADDRESS,C=d.UNKNOWN,P=Object(s.createContext)(m),N=function(){return Object(s.useContext)(P)},x=function(e){var t=e.children,n=Object(v.b)().dispatchActions,r=Object(E.b)(),o=r.shippingAddress,i=r.setShippingAddress,u=Object(y.a)(),m=u.cartNeedsShipping,g=u.cartHasCalculatedShipping,N=u.shippingRates,x=u.shippingRatesLoading,R=u.cartErrors,T=Object(_.a)(),A=T.selectShippingRate,I=T.isSelectingRate,M=Object(s.useReducer)(f,k),D=a()(M,2),F=D[0],B=D[1],L=Object(s.useReducer)(O.b,{}),V=a()(L,2),U=V[0],z=V[1],H=Object(s.useRef)(U),G=Object(s.useMemo)((function(){return{onShippingRateSuccess:h(z).onSuccess,onShippingRateFail:h(z).onFail,onShippingRateSelectSuccess:h(z).onSelectSuccess,onShippingRateSelectFail:h(z).onSelectFail}}),[z]);Object(s.useEffect)((function(){H.current=U}),[U]);var q=Object(s.useRef)((function(){return p(N)}));Object(s.useEffect)((function(){var e=p(N);l()(q.current,e)||(q.current=e)}),[N]),Object(s.useEffect)((function(){x?n.incrementCalculating():n.decrementCalculating()}),[x,n]),Object(s.useEffect)((function(){I?n.incrementCalculating():n.decrementCalculating()}),[I,n]),Object(s.useEffect)((function(){R.length>0&&R.some((function(e){return!(!e.code||!Object.values(b).includes(e.code))}))?B({type:S}):B({type:k})}),[R]);var Y=Object(s.useMemo)((function(){return{isPristine:F===k,isValid:F===k,hasInvalidAddress:F===S,hasError:F===C||F===S}}),[F]);Object(s.useEffect)((function(){x||0!==N.length&&!Y.hasError||Object(j.a)(H.current,"shipping_rates_fail",{hasInvalidAddress:Y.hasInvalidAddress,hasError:Y.hasError})}),[N,x,Y.hasError,Y.hasInvalidAddress]),Object(s.useEffect)((function(){!x&&N.length>0&&!Y.hasError&&Object(j.a)(H.current,"shipping_rates_success",N)}),[N,x,Y.hasError]),Object(s.useEffect)((function(){I||(Y.hasError?Object(j.a)(H.current,"shipping_rate_select_fail",{hasError:Y.hasError,hasInvalidAddress:Y.hasInvalidAddress}):Object(j.a)(H.current,"shipping_rate_select_success",q.current))}),[I,Y.hasError,Y.hasInvalidAddress]);var W=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({shippingErrorStatus:Y,dispatchErrorStatus:B,shippingErrorTypes:d,shippingRates:N,shippingRatesLoading:x,selectedRates:q.current,setSelectedRates:A,isSelectingRate:I,shippingAddress:o,setShippingAddress:i,needsShipping:m,hasCalculatedShipping:g},G);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(P.Provider,{value:W},t))}},789:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h12c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M12 6H4V4.75h8zM12 9H4V7.75h8zM10 12H4v-1.25h6z"})));t.a=o},821:function(e,t,n){e.exports=n(851)},822:function(e,t){},823:function(e,t){},824:function(e,t){},825:function(e,t){},826:function(e,t){},827:function(e,t){},828:function(e,t){},829:function(e,t){},83:function(e,t,n){"use strict";var r=n(0),c=n(1),o=(n(2),n(6)),a=n.n(o),s=(n(259),n(114));t.a=function(e){var t=e.children,n=e.className,o=e.screenReaderLabel,i=e.showSpinner,l=void 0!==i&&i,u=e.isLoading,p=void 0===u||u;return Object(r.createElement)("div",{className:a()(n,{"wc-block-components-loading-mask":p})},p&&l&&Object(r.createElement)(s.a,null),Object(r.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&Object(r.createElement)("span",{className:"screen-reader-text"},o||Object(c.__)("Loading…",'woocommerce')))}},830:function(e,t){},831:function(e,t){},832:function(e,t){},833:function(e,t,n){"use strict";var r=n(0),c=n(28),o=Object(r.createElement)(c.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(r.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(r.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(r.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},834:function(e,t){},835:function(e,t){},836:function(e,t){},837:function(e,t){},838:function(e,t){},839:function(e,t){},840:function(e,t){},851:function(e,t,n){"use strict";n.r(t);var r=n(0),c=n(1),o=n(6),a=n.n(o),s=n(66),i=n(28),l=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/SVG",viewBox:"0 0 24 24",fill:"none"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",fill:"none",d:"M5 3.75h14c.69 0 1.25.56 1.25 1.25v14c0 .69-.56 1.25-1.25 1.25H5c-.69 0-1.25-.56-1.25-1.25V5c0-.69.56-1.25 1.25-1.25z"}),Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M6.4 10.75c0-.47.38-.85.85-.85h9.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-9.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h8.8v-.8H7.6zM12.4 15.25c0-.47.38-.85.85-.85h3.5c.47 0 .85.38.85.85v1.5c0 .47-.38.85-.85.85h-3.5a.85.85 0 01-.85-.85v-1.5zm1.2.35v.8h2.8v-.8h-2.8zM6.5 15.9a.6.6 0 01.6-.6h2.8a.6.6 0 010 1.2H7.1a.6.6 0 01-.6-.6zM6.5 7.9a.6.6 0 01.6-.6h9.8a.6.6 0 110 1.2H7.1a.6.6 0 01-.6-.6z",clipRule:"evenodd"})),u=n(159),p=n(12),d=n(494),b=n(63),m=n(235),f=n(518),O={cc:[{method:{gateway:"stripe",last4:"5678",brand:"Visa"},expires:"12/20",is_default:!1,tokenId:"1"}]},g=n(4),h=n(196),j=n(37),v=n(3),E=n(517),y=(n(840),n(16)),_=n.n(y),w=["children"],k=function(e){var t=e.children,n=_()(e,w),c=Object(p.useBlockProps)(n);return Object(r.createElement)("div",c,t)},S=n(5),C=n.n(S),P=n(74),N=n(14),x=n(46),R=n(55),T=n(26);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var M=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)},D=function(e){var t=e.ref,n=Object(R.hasFilter)("blocks.registerBlockType","core/lock/addAttribute"),c=t.current;return Object(r.useEffect)((function(){if(c&&!n)return c.addEventListener("keydown",e,{capture:!0,passive:!1}),function(){c.removeEventListener("keydown",e,{capture:!0})};function e(e){var t=e.keyCode,n=e.target;if(n instanceof HTMLElement&&(t===x.BACKSPACE||t===x.DELETE)&&!Object(P.isTextField)(n)){var r=n;void 0!==r.dataset.block&&function(e){var t,n,r,c,o;if(!e)return!1;var a=(0,Object(N.select)(p.store).getBlock)(e);if("boolean"==typeof(null==a||null===(t=a.attributes)||void 0===t||null===(n=t.lock)||void 0===n?void 0:n.remove))return a.attributes.lock.remove;var s,i,l,u=Object(T.getBlockType)(a.name);return"boolean"==typeof(null==u||null===(r=u.attributes)||void 0===r||null===(c=r.lock)||void 0===c||null===(o=c.default)||void 0===o?void 0:o.remove)&&(null==u||null===(s=u.attributes)||void 0===s||null===(i=s.lock)||void 0===i||null===(l=i.default)||void 0===l?void 0:l.remove)}(r.dataset.block)&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}}}),[c,n])},F=Object(r.createContext)({allowCreateAccount:!1,showCompanyField:!1,showApartmentField:!1,showPhoneField:!1,requireCompanyField:!1,requirePhoneField:!1}),B=Object(r.createContext)({addressFieldControls:function(){return null},accountControls:function(){return null}}),L=function(){return Object(r.useContext)(F)},V=function(){return Object(r.useContext)(B)};Object(R.hasFilter)("blocks.registerBlockType","core/lock/addAttribute")||Object(N.subscribe)((function(){var e,t,n,r,c=Object(N.select)(p.store);if(c){var o=c.getSelectedBlock();o&&(M("wc-lock-selected-block--remove",!(null==o||null===(e=o.attributes)||void 0===e||null===(t=e.lock)||void 0===t||!t.remove)),M("wc-lock-selected-block--move",!(null==o||null===(n=o.attributes)||void 0===n||null===(r=n.lock)||void 0===r||!r.move)))}}));var U=["woocommerce/checkout-fields-block","woocommerce/checkout-totals-block"],z=function(e){var t=e.attributes,n=e.setAttributes,o=t.hasDarkControls,a=Object(b.b)().currentPostId;return Object(r.createElement)(p.InspectorControls,null,a!==j.e&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__page-notice",isDismissible:!1,status:"warning"},Object(r.createInterpolateElement)(Object(c.__)("If you would like to use this block as your default checkout you must update your <a>page settings in WooCommerce</a>.",'woocommerce'),{a:Object(r.createElement)("a",{href:Object(v.getAdminLink)("admin.php?page=wc-settings&tab=advanced"),target:"_blank",rel:"noopener noreferrer"})})),Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Style",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Dark mode inputs",'woocommerce'),help:Object(c.__)("Inputs styled specifically for use on dark background colors.",'woocommerce'),checked:o,onChange:function(){return n({hasDarkControls:!o})}})),Object(r.createElement)(h.a,null))},H={isPreview:{type:"boolean",default:!1,save:!1},hasDarkControls:{type:"boolean",default:Object(v.getSetting)("hasDarkEditorStyleSupport",!1)},showCompanyField:{type:"boolean",default:!1},requireCompanyField:{type:"boolean",default:!1},allowCreateAccount:{type:"boolean",default:!1},showApartmentField:{type:"boolean",default:!0},showPhoneField:{type:"boolean",default:!0},requirePhoneField:{type:"boolean",default:!1},showOrderNotes:{type:"boolean",default:!0},showPolicyLinks:{type:"boolean",default:!0},showReturnToCart:{type:"boolean",default:!0},cartPageId:{type:"number",default:0},showRateAfterTaxName:{type:"boolean",default:Object(v.getSetting)("displayCartPricesIncludingTax",!1)}},G=n(892),q=n(893),Y=n(495),W=n(27),$=function(e){var t=e.clientId,n=e.template,c=Object(r.useRef)(n),o=Object(N.useDispatch)("core/block-editor").insertBlock,a=Object(N.useSelect)((function(e){return{innerBlocks:e("core/block-editor").getBlocks(t),templateTypes:c.current.map((function(e){return Object(T.getBlockType)(e)}))}}),[t,c]),s=a.innerBlocks,i=a.templateTypes;Object(r.useLayoutEffect)((function(){t&&i.forEach((function(e){if(e&&(i=e.attributes,Boolean((null===(r=i.lock)||void 0===r?void 0:r.remove)||(null===(c=i.lock)||void 0===c||null===(a=c.default)||void 0===a?void 0:a.remove)))&&!s.find((function(t){return t.name===e.name}))){var n=Object(T.createBlock)(e.name);o(n,s.length,t,!1)}var r,c,a,i}))}),[t,s,o,i])},X=n(33),K=n.n(X),J=["core/paragraph","core/image","core/separator"],Z=function(e){return[].concat(K()(Object(T.getBlockTypes)().filter((function(t){return((null==t?void 0:t.parent)||[]).includes(e)})).map((function(e){return e.name}))),J)},Q=(n(822),n(535));Object(u.d)(Q,{icon:{src:Object(r.createElement)(G.a,{icon:q.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,n=Object(p.useBlockProps)(),c=Z(W.innerBlockAreas.CHECKOUT_FIELDS),o=V().addressFieldControls;return $({clientId:t,template:c}),Object(r.createElement)(Y.a,{className:"wc-block-checkout__main"},Object(r.createElement)("div",n,Object(r.createElement)(o,null),Object(r.createElement)("form",{className:"wc-block-components-form wc-block-checkout__form"},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1,renderAppender:p.InnerBlocks.ButtonBlockAppender}))))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(p.InnerBlocks.Content,null))}});var ee=n(496),te=(n(823),n(536));Object(u.d)(te,{icon:{src:Object(r.createElement)(G.a,{icon:q.a}),foreground:"#874FB9"},edit:function(e){var t=e.clientId,n=Object(p.useBlockProps)(),c=Z(W.innerBlockAreas.CHECKOUT_TOTALS);return $({clientId:t,template:c}),Object(r.createElement)(ee.a,{className:"wc-block-checkout__sidebar"},Object(r.createElement)("div",n,Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c,templateLock:!1})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(p.InnerBlocks.Content,null))}});var ne=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.6 0A5.596 5.596 0 000 5.6C0 9.8 5.6 16 5.6 16s5.6-6.2 5.6-10.4C11.2 2.504 8.696 0 5.6 0zm-4 5.6c0-2.208 1.792-4 4-4s4 1.792 4 4c0 2.304-2.304 5.752-4 7.904-1.664-2.136-4-5.624-4-7.904zm2 0a2 2 0 114 0 2 2 0 01-4 0z"})),re=n(135),ce=function(e){var t=e.children,n=e.stepHeadingContent;return Object(r.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(r.createElement)(re.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(r.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))},oe=function(e){var t=e.attributes,n=e.setAttributes,o=e.className,s=void 0===o?"":o,i=e.children,l=t.title,u=void 0===l?"":l,d=t.description,b=void 0===d?"":d,m=t.showStepNumber,f=void 0===m||m,O=Object(p.useBlockProps)({className:a()("wc-block-components-checkout-step",s,{"wc-block-components-checkout-step--with-step-number":f})});return Object(r.createElement)("div",O,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Form Step Options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Show step number",'woocommerce'),checked:f,onChange:function(){return n({showStepNumber:!f})}}))),Object(r.createElement)(ce,null,Object(r.createElement)(p.PlainText,{className:"",value:u,onChange:function(e){return n({title:e})}})),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__container"},Object(r.createElement)("p",{className:"wc-block-components-checkout-step__description"},Object(r.createElement)(p.PlainText,{className:b?"":"wc-block-components-checkout-step__description-placeholder",value:b,placeholder:Object(c.__)("Optional text for this form step.",'woocommerce'),onChange:function(e){return n({description:e})}})),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))},ae=(n(825),function(e){var t=e.block,n=Object(p.useBlockProps)()["data-block"],c=Z(t);return $({clientId:n,template:c}),Object(r.createElement)("div",{className:"wc-block-checkout__additional_fields"},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:c}))}),se=function(){return Object(r.createElement)(p.InnerBlocks.Content,null)},ie=n(894),le=n(504),ue=n(75),pe=n(67),de=["email"];function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var me=function(){var e=Object(ue.b)().needsShipping,t=Object(pe.b)(),n=t.billingData,c=t.setBillingData,o=t.shippingAddress,a=t.setShippingAddress,s=t.shippingAsBilling,i=t.setShippingAsBilling,l=Object(r.useRef)(s),u=Object(r.useRef)(n),p=Object(r.useCallback)((function(e){a(e),s&&c(e)}),[s,a,c]),d=Object(r.useCallback)((function(t){c(t),e||a(t)}),[e,a,c]);Object(r.useEffect)((function(){if(l.current!==s){if(s)u.current=n,c(o);else{var e=u.current,t=(e.email,_()(e,de));c(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},t))}l.current=s}}),[s,c,o,n]);var b=Object(r.useCallback)((function(e){c({email:e})}),[c]),m=Object(r.useCallback)((function(e){c({phone:e})}),[c]),f=Object(r.useCallback)((function(e){p({phone:e})}),[p]);return{defaultAddressFields:v.defaultAddressFields,shippingFields:o,setShippingFields:p,billingFields:n,setBillingFields:d,setEmail:b,setPhone:m,setShippingPhone:f,shippingAsBilling:s,setShippingAsBilling:i,showShippingFields:e,showBillingFields:!e||!l.current}},fe=n(68),Oe=n(9),ge=n.n(Oe),he=n(21),je=(n(824),["className","label","id","instanceId","onChange","children","hasError"]),ve=Object(he.withInstanceId)((function(e){var t=e.className,n=e.label,c=e.id,o=e.instanceId,s=e.onChange,i=e.children,l=e.hasError,u=void 0!==l&&l,p=_()(e,je),d=c||"checkbox-control-".concat(o);return Object(r.createElement)("label",{className:a()("wc-block-components-checkbox",{"has-error":u},t),htmlFor:d},Object(r.createElement)("input",ge()({id:d,className:"wc-block-components-checkbox__input",type:"checkbox",onChange:function(e){return s(e.target.checked)},"aria-invalid":!0===u},p)),Object(r.createElement)("svg",{className:"wc-block-components-checkbox__mark","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 20"},Object(r.createElement)("path",{d:"M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"})),n&&Object(r.createElement)("span",{className:"wc-block-components-checkbox__label"},n),i)})),Ee=n(286),ye=function(e){var t=e.id,n=void 0===t?"phone":t,o=e.isRequired,a=void 0!==o&&o,s=e.value,i=void 0===s?"":s,l=e.onChange;return Object(r.createElement)(Ee.a,{id:n,type:"tel",autoComplete:"tel",required:a,label:a?Object(c.__)("Phone",'woocommerce'):Object(c.__)("Phone (optional)",'woocommerce'),value:i,onChange:l})},_e=function(e){var t=e.showCompanyField,n=void 0!==t&&t,o=e.showApartmentField,a=void 0!==o&&o,s=e.showPhoneField,i=void 0!==s&&s,l=e.requireCompanyField,u=void 0!==l&&l,p=e.requirePhoneField,d=void 0!==p&&p,m=me(),f=m.defaultAddressFields,O=m.setShippingFields,g=m.shippingFields,h=m.setShippingAsBilling,j=m.shippingAsBilling,v=m.setShippingPhone,E=Object(fe.a)().dispatchCheckoutEvent,y=Object(b.b)().isEditor;Object(r.useEffect)((function(){i||v("")}),[i,v]);var _=Object(r.useMemo)((function(){return{company:{hidden:!n,required:u},address_2:{hidden:!a}}}),[n,u,a]),w=y?ie.a:r.Fragment;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(w,null,Object(r.createElement)(le.a,{id:"shipping",type:"shipping",onChange:function(e){O(e),E("set-shipping-address")},values:g,fields:Object.keys(f),fieldConfig:_}),i&&Object(r.createElement)(ye,{id:"shipping-phone",isRequired:d,value:g.phone,onChange:function(e){v(e),E("set-phone-number",{step:"shipping"})}})),Object(r.createElement)(ve,{className:"wc-block-checkout__use-address-for-billing",label:Object(c.__)("Use same address for billing",'woocommerce'),checked:j,onChange:function(e){return h(e)}}))},we=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,r=e.defaultDescription,o=void 0===r?Object(c.__)("Step description text.",'woocommerce'):r,a=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:o},showStepNumber:{type:"boolean",default:void 0===a||a}}};function ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ke(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ce=Se(Se({},we({defaultTitle:Object(c.__)("Shipping address",'woocommerce'),defaultDescription:Object(c.__)("Enter the address where you want your order delivered.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),Pe=n(537);Object(u.d)(Pe,{icon:{src:Object(r.createElement)(s.a,{srcElement:ne}),foreground:"#874FB9"},attributes:Ce,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L(),o=c.showCompanyField,a=c.showApartmentField,s=c.requireCompanyField,i=c.showPhoneField,l=c.requirePhoneField,u=V().addressFieldControls;return Object(r.createElement)(oe,{setAttributes:n,attributes:t,className:"wc-block-checkout__shipping-fields"},Object(r.createElement)(u,null),Object(r.createElement)(_e,{showCompanyField:o,showApartmentField:a,requireCompanyField:s,showPhoneField:i,requirePhoneField:l}),Object(r.createElement)(ae,{block:W.innerBlockAreas.SHIPPING_ADDRESS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var Ne=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 16"},Object(r.createElement)("g",{fill:"currentColor",fillRule:"evenodd"},Object(r.createElement)("path",{d:"M13.147 2.527c.288.279.295.739.015 1.027L9 7.84l4.449 4.581a.726.726 0 11-1.042 1.012l-4.42-4.55-4.419 4.55a.726.726 0 01-1.042-1.012l4.45-4.581L2.81 3.554a.726.726 0 011.042-1.012l4.133 4.256 4.134-4.256a.726.726 0 011.027-.015z"}),Object(r.createElement)("path",{d:"M.467 7.915c0-.4.326-.726.727-.726H7.29l-.03-5.99a.726.726 0 011.452-.008l.031 5.998h6.229a.726.726 0 110 1.453H8.752l.033 6.328a.726.726 0 11-1.453.007L7.3 8.642H1.194a.726.726 0 01-.727-.727z"}))),xe=n(895),Re=(n(826),j.k?'<a href="'.concat(j.k,'">').concat(Object(c.__)("Terms and Conditions","woo-gutenberg-product-blocks"),"</a>"):Object(c.__)("Terms and Conditions","woo-gutenberg-product-blocks")),Te=j.g?'<a href="'.concat(j.g,'">').concat(Object(c.__)("Privacy Policy","woo-gutenberg-product-blocks"),"</a>"):Object(c.__)("Privacy Policy","woo-gutenberg-product-blocks"),Ae=Object(c.sprintf)(
|
||
/* translators: %1$s terms page link, %2$s privacy page link. */
|
||
Object(c.__)("By proceeding with your purchase you agree to our %1$s and %2$s","woo-gutenberg-product-blocks"),Re,Te),Ie=Object(c.sprintf)(
|
||
/* translators: %1$s terms page link, %2$s privacy page link. */
|
||
Object(c.__)("You must accept our %1$s and %2$s to continue with your purchase.","woo-gutenberg-product-blocks"),Re,Te),Me=n(538);Object(u.d)(Me,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ne}),foreground:"#874FB9"},edit:function(e){var t=e.attributes,n=t.checkbox,o=t.text,a=e.setAttributes,s=Object(p.useBlockProps)(),i=o||(n?Ie:Ae);return Object(r.createElement)("div",s,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Display options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Require checkbox",'woocommerce'),checked:n,onChange:function(){return a({checkbox:!n})}}))),Object(r.createElement)("div",{className:"wc-block-checkout__terms"},n?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(ve,{id:"terms-condition",checked:!1}),Object(r.createElement)(p.RichText,{value:i,onChange:function(e){return a({text:e})}})):Object(r.createElement)(p.RichText,{tagName:"span",value:i,onChange:function(e){return a({text:e})}})),(!j.k||!j.g)&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:[!j.k&&{className:"wc-block-checkout__terms_notice-button",label:Object(r.createElement)(r.Fragment,null,Object(c.__)("Setup a Terms and Conditions page",'woocommerce'),Object(r.createElement)(G.a,{icon:xe.a,size:16,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:function(){return window.open("".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=advanced"),"_blank")}},!j.g&&{className:"wc-block-checkout__terms_notice-button",label:Object(r.createElement)(r.Fragment,null,Object(c.__)("Setup a Privacy Policy page",'woocommerce'),Object(r.createElement)(G.a,{size:16,icon:xe.a,className:"wc-block-checkout__terms_notice-button__icon"})),onClick:function(){return window.open("".concat(v.ADMIN_URL,"options-privacy.php"),"_blank")}}].filter(Boolean)},Object(r.createElement)("p",null,Object(c.__)("You don't seem to have a Terms and Conditions and/or a Privacy Policy pages setup.",'woocommerce'))),j.k&&j.g&&!(i.includes(j.k)&&i.includes(j.g))&&Object(r.createElement)(g.Notice,{className:"wc-block-checkout__terms_notice",status:"warning",isDismissible:!1,actions:Ae!==o?[{label:Object(c.__)("Restore default text",'woocommerce'),onClick:function(){return a({text:""})}}]:[]},Object(r.createElement)("p",null,Object(c.__)("Ensure you add links to your policy pages in this section.",'woocommerce'))))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var De=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 16"},Object(r.createElement)("g",{fill:"none",fillRule:"evenodd"},Object(r.createElement)("path",{stroke:"currentColor",strokeWidth:"1.5",d:"M2 .75h16c.69 0 1.25.56 1.25 1.25v12c0 .69-.56 1.25-1.25 1.25H2c-.69 0-1.25-.56-1.25-1.25V2C.75 1.31 1.31.75 2 .75z"}),Object(r.createElement)("path",{fill:"currentColor",d:"M7.667 7.667A2.34 2.34 0 0010 5.333 2.34 2.34 0 007.667 3a2.34 2.34 0 00-2.334 2.333 2.34 2.34 0 002.334 2.334zM11.556 3H17v3.889h-5.444V3zm2.722 2.916l1.944-1.36v-.779L14.278 5.14l-1.945-1.362v.778l1.945 1.361zm-5.834-.583a.78.78 0 00-.777-.777.78.78 0 00-.778.777c0 .428.35.778.778.778a.78.78 0 00.777-.778zm3.89 5.904c0-1.945-3.088-2.785-4.667-2.785-1.58 0-4.667.84-4.667 2.785v1.097h9.333v-1.097zM7.666 10c-1.012 0-2.163.389-2.738.778h5.475C9.821 10.38 8.678 10 7.667 10z"}))),Fe=n(57),Be=function(e){var t=e.allowCreateAccount,n=Object(Fe.b)(),o=n.customerId,a=n.shouldCreateAccount,s=n.setShouldCreateAccount,i=me(),l=i.billingFields,u=i.setEmail,p=Object(fe.a)().dispatchCheckoutEvent,d=!o&&t&&Object(v.getSetting)("checkoutAllowsGuest",!1)&&Object(v.getSetting)("checkoutAllowsSignup",!1)&&Object(r.createElement)(ve,{className:"wc-block-checkout__create-account",label:Object(c.__)("Create an account?",'woocommerce'),checked:a,onChange:function(e){return s(e)}});return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(Ee.a,{id:"email",type:"email",label:Object(c.__)("Email address",'woocommerce'),value:l.email,autoComplete:"email",onChange:function(e){u(e),p("set-email-address")},required:!0}),d)};function Le(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Le(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Le(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ue=Ve(Ve({},we({defaultTitle:Object(c.__)("Contact information",'woocommerce'),defaultDescription:Object(c.__)("We'll use this email to send you details and updates about your order.",'woocommerce')})),{},{lock:{type:"object",default:{remove:!0,move:!0}}}),ze=n(539);Object(u.d)(ze,{icon:{src:Object(r.createElement)(s.a,{srcElement:De}),foreground:"#874FB9"},attributes:Ue,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L().allowCreateAccount,o=V().accountControls;return Object(r.createElement)(oe,{attributes:t,setAttributes:n},Object(r.createElement)(o,null),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(Be,{allowCreateAccount:c})),Object(r.createElement)(ae,{block:W.innerBlockAreas.CONTACT_INFORMATION}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var He=function(e){var t=e.showCompanyField,n=void 0!==t&&t,c=e.showApartmentField,o=void 0!==c&&c,a=e.showPhoneField,s=void 0!==a&&a,i=e.requireCompanyField,l=void 0!==i&&i,u=e.requirePhoneField,p=void 0!==u&&u,d=me(),m=d.defaultAddressFields,f=d.billingFields,O=d.setBillingFields,g=d.setPhone,h=Object(fe.a)().dispatchCheckoutEvent,j=Object(b.b)().isEditor;Object(r.useEffect)((function(){s||g("")}),[s,g]);var v=Object(r.useMemo)((function(){return{company:{hidden:!n,required:l},address_2:{hidden:!o}}}),[n,l,o]),E=j?ie.a:r.Fragment;return Object(r.createElement)(E,null,Object(r.createElement)(le.a,{id:"billing",type:"billing",onChange:function(e){O(e),h("set-billing-address")},values:f,fields:Object.keys(m),fieldConfig:v}),s&&Object(r.createElement)(ye,{isRequired:p,value:f.phone,onChange:function(e){g(e),h("set-phone-number",{step:"billing"})}}))};function Ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function qe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ge(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Ye=qe(qe({},we({defaultTitle:Object(c.__)("Billing address",'woocommerce'),defaultDescription:Object(c.__)("Enter the address that matches your card or payment method.",'woocommerce')})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),We=n(540);Object(u.d)(We,{icon:{src:Object(r.createElement)(s.a,{srcElement:ne}),foreground:"#874FB9"},attributes:Ye,edit:function(e){var t=e.attributes,n=e.setAttributes,c=L(),o=c.showCompanyField,a=c.showApartmentField,s=c.requireCompanyField,i=c.showPhoneField,l=c.requirePhoneField,u=V().addressFieldControls;return me().showBillingFields?Object(r.createElement)(oe,{setAttributes:n,attributes:t,className:"wc-block-checkout__billing-fields"},Object(r.createElement)(u,null),Object(r.createElement)(He,{showCompanyField:o,showApartmentField:a,requireCompanyField:s,showPhoneField:i,requirePhoneField:l}),Object(r.createElement)(ae,{block:W.innerBlockAreas.BILLING_ADDRESS})):null},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var $e=n(896),Xe=n(195),Ke=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24",fill:"currentColor"},Object(r.createElement)("path",{d:"M20 11H7.8l5.6-5.6L12 4l-8 8 8 8 1.4-1.4L7.8 13H20v-2z"})),Je=(n(828),function(e){var t=e.link;return Object(r.createElement)("a",{href:t||j.d,className:"wc-block-components-checkout-return-to-cart-button"},Object(r.createElement)(s.a,{srcElement:Ke}),Object(c.__)("Return to Cart",'woocommerce'))}),Ze=n(174),Qe=n(163),et=n(567),tt=n(90),nt=function(){var e=function(){var e=Object(Fe.b)(),t=e.onSubmit,n=e.isCalculating,r=e.isBeforeProcessing,o=e.isProcessing,a=e.isAfterProcessing,s=e.isComplete,i=e.hasError,l=Object(Qe.b)().paymentMethods,u=void 0===l?{}:l,p=Object(Ze.b)(),d=p.activePaymentMethod,b=p.currentStatus,m=u[d]||{},f=o||a||r,O=s&&!i;return{submitButtonText:(null==m?void 0:m.placeOrderButtonLabel)||Object(c.__)("Place Order",'woocommerce'),onSubmit:t,isCalculating:n,isDisabled:o||b.isDoingExpressPayment,waitingForProcessing:f,waitingForRedirect:O}}(),t=e.submitButtonText,n=e.onSubmit,o=e.isCalculating,a=e.isDisabled,i=e.waitingForProcessing,l=e.waitingForRedirect;return Object(r.createElement)(tt.a,{className:"wc-block-components-checkout-place-order-button",onClick:n,disabled:o||a||i||l,showSpinner:i},l?Object(r.createElement)(s.a,{srcElement:et.a,alt:Object(c.__)("Done",'woocommerce')}):t)},rt=(n(827),function(e){var t=e.cartPageId,n=e.showReturnToCart;return Object(r.createElement)("div",{className:"wc-block-checkout__actions"},n&&Object(r.createElement)(Je,{link:Object(v.getSetting)("page-"+t,!1)}),Object(r.createElement)(nt,null))}),ct=n(541);Object(u.d)(ct,{icon:{src:Object(r.createElement)(G.a,{icon:$e.a}),foreground:"#874FB9"},attributes:{cartPageId:{type:"number",default:0},showReturnToCart:{type:"boolean",default:!0},lock:{type:"object",default:{move:!0,remove:!0}}},edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(p.useBlockProps)(),a=t.cartPageId,s=void 0===a?0:a,i=t.showReturnToCart,l=void 0===i||i,u=Object(r.useRef)(s).current,d=Object(N.useSelect)((function(e){return u||e("core/editor").getCurrentPostId()}),[u]);return Object(r.createElement)("div",o,Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Account options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)('Show a "Return to Cart" link','woocommerce'),checked:l,onChange:function(){return n({showReturnToCart:!l})}})),l&&!(d===j.e&&0===u)&&Object(r.createElement)(Xe.a,{pageId:s,setPageId:function(e){return n({cartPageId:e})},labels:{title:Object(c.__)("Return to Cart button",'woocommerce'),default:Object(c.__)("WooCommerce Cart Page",'woocommerce')}})),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(rt,{showReturnToCart:l,cartPageId:s})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var ot=n(789),at=n(2),st=n.n(at),it=(n(830),function(e){var t=e.title,n=e.stepHeadingContent;return Object(r.createElement)("div",{className:"wc-block-components-checkout-step__heading"},Object(r.createElement)(re.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&Object(r.createElement)("span",{className:"wc-block-components-checkout-step__heading-content"},n))}),lt=function(e){var t=e.id,n=e.className,c=e.title,o=e.legend,s=e.description,i=e.children,l=e.disabled,u=void 0!==l&&l,p=e.showStepNumber,d=void 0===p||p,b=e.stepHeadingContent,m=void 0===b?function(){}:b,f=o||c?"fieldset":"div";return Object(r.createElement)(f,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":u}),id:t,disabled:u},!(!o&&!c)&&Object(r.createElement)("legend",{className:"screen-reader-text"},o||c),!!c&&Object(r.createElement)(it,{title:c,stepHeadingContent:m()}),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__container"},!!s&&Object(r.createElement)("p",{className:"wc-block-components-checkout-step__description"},s),Object(r.createElement)("div",{className:"wc-block-components-checkout-step__content"},i)))},ut=n(8),pt=n.n(ut),dt=(n(832),function(e){var t=e.className,n=void 0===t?"":t,c=e.disabled,o=void 0!==c&&c,s=e.onTextChange,i=e.placeholder,l=e.value,u=void 0===l?"":l;return Object(r.createElement)("textarea",{className:a()("wc-block-components-textarea",n),disabled:o,onChange:function(e){s(e.target.value)},placeholder:i,rows:2,value:u})});n(831),dt.propTypes={onTextChange:st.a.func.isRequired,disabled:st.a.bool,placeholder:st.a.string,value:st.a.string};var bt=function(e){var t=e.disabled,n=e.onChange,o=e.placeholder,a=e.value,s=Object(r.useState)(!1),i=pt()(s,2),l=i[0],u=i[1],p=Object(r.useState)(""),d=pt()(p,2),b=d[0],m=d[1];return Object(r.createElement)("div",{className:"wc-block-checkout__add-note"},Object(r.createElement)(ve,{disabled:t,label:Object(c.__)("Add a note to your order",'woocommerce'),checked:l,onChange:function(e){u(e),e?a!==b&&n(b):(n(""),m(a))}}),l&&Object(r.createElement)(dt,{disabled:t,onTextChange:n,placeholder:o,value:a}))},mt=function(){var e=Object(ue.b)().needsShipping,t=Object(Fe.b)(),n=t.isProcessing,o=t.orderNotes,a=t.dispatchActions.setOrderNotes;return Object(r.createElement)(lt,{id:"order-notes",showStepNumber:!1,className:"wc-block-checkout__order-notes",disabled:n},Object(r.createElement)(bt,{disabled:n,onChange:a,placeholder:e?Object(c.__)("Notes about your order, e.g. special notes for delivery.",'woocommerce'):Object(c.__)("Notes about your order.",'woocommerce'),value:o}))},ft=(n(829),n(542));Object(u.d)(ft,{icon:{src:Object(r.createElement)(s.a,{srcElement:ot.a}),foreground:"#874FB9"},edit:function(){var e=Object(p.useBlockProps)();return Object(r.createElement)("div",e,Object(r.createElement)(g.Disabled,null,Object(r.createElement)(mt,null)))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Ot=n(833),gt=n(285),ht=n(41),jt=n(124),vt=n(154),Et=n(47),yt=n(151),_t=n(43),wt=n(308),kt=n(307),St=n(309),Ct=n(311),Pt=["receiveCart"],Nt=function(e){return Object(W.mustContain)(e,"<price/>")},xt=function(e){var t=e.cartItem,n=t.images,o=t.low_stock_remaining,a=t.show_backorder_badge,s=t.name,i=t.permalink,l=t.prices,u=t.quantity,p=t.short_description,d=t.description,b=t.item_data,m=t.variation,f=t.totals,O=t.extensions,g=Object(_t.a)(),h=(g.receiveCart,_()(g,Pt)),j=Object(r.useMemo)((function(){return{context:"summary",cartItem:t,cart:h}}),[t,h]),E=Object(Et.getCurrencyFromPriceResponse)(l),y=Object(W.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:s,extensions:O,arg:j}),w=Object(yt.a)({amount:parseInt(l.raw_prices.regular_price,10),precision:parseInt(l.raw_prices.precision,10)}).convertPrecision(E.minorUnit).getAmount(),k=Object(yt.a)({amount:parseInt(l.raw_prices.price,10),precision:parseInt(l.raw_prices.precision,10)}).convertPrecision(E.minorUnit).getAmount(),S=Object(Et.getCurrencyFromPriceResponse)(f),C=parseInt(f.line_subtotal,10);Object(v.getSetting)("displayCartPricesIncludingTax",!1)&&(C+=parseInt(f.line_subtotal_tax,10));var P=Object(yt.a)({amount:C,precision:S.minorUnit}).getAmount(),N=Object(W.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:O,arg:j,validation:Nt}),x=Object(W.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:O,arg:j,validation:Nt});return Object(r.createElement)("div",{className:"wc-block-components-order-summary-item"},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__image"},Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__quantity"},Object(r.createElement)(ht.a,{label:u,screenReaderLabel:Object(c.sprintf)(
|
||
/* translators: %d number of products of the same type in the cart */
|
||
Object(c._n)("%d item","%d items",u,'woocommerce'),u)})),Object(r.createElement)(kt.a,{image:n.length?n[0]:{}})),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__description"},Object(r.createElement)(vt.a,{disabled:!0,name:y,permalink:i}),Object(r.createElement)(jt.a,{currency:E,price:k,regularPrice:w,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:N}),a?Object(r.createElement)(wt.a,null):!!o&&Object(r.createElement)(St.a,{lowStockRemaining:o}),Object(r.createElement)(Ct.a,{shortDescription:p,fullDescription:d,itemData:b,variation:m})),Object(r.createElement)("span",{className:"screen-reader-text"},Object(c.sprintf)(
|
||
/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
|
||
Object(c._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",u,'woocommerce'),u,y,Object(Et.formatPrice)(P,S))),Object(r.createElement)("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},Object(r.createElement)(jt.a,{currency:S,format:x,price:P})))},Rt=(n(834),function(e){var t=e.cartItems,n=void 0===t?[]:t,o=Object(gt.b)(),a=o.isLarge;return o.hasContainerWidth?Object(r.createElement)(W.Panel,{className:"wc-block-components-order-summary",initialOpen:a,hasBorder:!1,title:Object(r.createElement)("span",{className:"wc-block-components-order-summary__button-text"},Object(c.__)("Order summary",'woocommerce')),titleTag:"h2"},Object(r.createElement)("div",{className:"wc-block-components-order-summary__content"},n.map((function(e){return Object(r.createElement)(xt,{key:e.key,cartItem:e})})))):null}),Tt=n(497),At=n(498),It=n(510),Mt=n(501),Dt=n(201),Ft=["extensions","receiveCart"],Bt=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,c=Object(_t.a)(),o=c.cartItems,a=c.cartTotals,s=c.cartCoupons,i=c.cartFees,l=Object(Dt.a)(),u=l.applyCoupon,p=l.removeCoupon,d=l.isApplyingCoupon,b=l.isRemovingCoupon,m=Object(ue.b)().needsShipping,f=Object(Et.getCurrencyFromPriceResponse)(a),O=Object(_t.a)(),g=O.extensions,h=(O.receiveCart,{extensions:g,cart:_()(O,Ft)});return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(Rt,{cartItems:o})),Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(W.Subtotal,{currency:f,values:a}),Object(r.createElement)(W.TotalsFees,{currency:f,cartFees:i}),Object(r.createElement)(Tt.a,{cartCoupons:s,currency:f,isRemovingCoupon:b,removeCoupon:p,values:a})),Object(v.getSetting)("couponsEnabled",!0)&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(At.a,{onSubmit:u,initialOpen:!1,isLoading:d})),m&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(It.a,{showCalculator:!1,showRateSelector:!1,values:a,currency:f})),!Object(v.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(a.total_tax,10)>0&&Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(W.TotalsTaxes,{currency:f,showRateAfterTaxName:n,values:a})),Object(r.createElement)(W.TotalsWrapper,null,Object(r.createElement)(Mt.a,{currency:f,values:a})),Object(r.createElement)(W.ExperimentalOrderMeta.Slot,h))},Lt={showRateAfterTaxName:{type:"boolean",default:Object(v.getSetting)("displayCartPricesIncludingTax",!1)},lock:{type:"object",default:{move:!0,remove:!0}}},Vt=n(543);Object(u.d)(Vt,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ot.a}),foreground:"#874FB9"},attributes:Lt,edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(p.useBlockProps)(),a=Object(v.getSetting)("taxesEnabled"),s=Object(v.getSetting)("displayItemizedTaxes",!1),i=Object(v.getSetting)("displayCartPricesIncludingTax",!1);return Object(r.createElement)("div",o,Object(r.createElement)(p.InspectorControls,null,a&&s&&!i&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Taxes",'woocommerce')},Object(r.createElement)(g.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:t.showRateAfterTaxName,onChange:function(){return n({showRateAfterTaxName:!t.showRateAfterTaxName})}}))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(Bt,{showRateAfterTaxName:t.showRateAfterTaxName})))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Ut=n(502),zt=(n(835),function(e){var t=e.href,n=e.title,o=e.description;return Object(r.createElement)("a",{href:t,className:"wc-block-editor-components-external-link-card",target:"_blank",rel:"noreferrer"},Object(r.createElement)("span",{className:"wc-block-editor-components-external-link-card__content"},Object(r.createElement)("strong",{className:"wc-block-editor-components-external-link-card__title"},n),o&&Object(r.createElement)("span",{className:"wc-block-editor-components-external-link-card__description"},o)),Object(r.createElement)(g.VisuallyHidden,{as:"span"},
|
||
/* translators: accessibility text */
|
||
Object(c.__)("(opens in a new tab)",'woocommerce')),Object(r.createElement)(G.a,{icon:xe.a,className:"wc-block-editor-components-external-link-card__icon"}))}),Ht=n(141),Gt=n(50),qt=n(891),Yt=n(182),Wt=n(890),$t=(n(836),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Ut.a}),label:Object(c.__)("Payment methods",'woocommerce'),className:"wc-block-checkout__no-payment-methods-placeholder"},Object(r.createElement)("span",{className:"wc-block-checkout__no-payment-methods-placeholder-description"},Object(c.__)("Your store does not have any payment methods configured that support the checkout block. Once you have configured a compatible payment method (e.g. Stripe) it will be shown here.",'woocommerce')),Object(r.createElement)(Yt.a,{isSecondary:!0,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Configure Payment Methods",'woocommerce')))}),Xt=function(){return Object(r.createElement)(Wt.a,{isDismissible:!1,className:a()("wc-block-checkout__no-payment-methods-notice","woocommerce-message","woocommerce-error")},Object(c.__)("There are no payment methods available. This may be an error on our side. Please contact us if you need any help placing your order.",'woocommerce'))},Kt=function(){return Object(b.b)().isEditor?Object(r.createElement)($t,null):Object(r.createElement)(Xt,null)},Jt=n(283),Zt=n(59),Qt=n(38),en=n.n(Qt),tn=n(140),nn=Object(he.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,o=e.selected,s=e.onChange,i=e.options,l=void 0===i?[]:i,u=c||n;return l.length&&Object(r.createElement)("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){var t="object"===en()(e)&&"content"in e,n=e.value===o;return Object(r.createElement)("div",{className:"wc-block-components-radio-control-accordion-option",key:e.value},Object(r.createElement)(tn.a,{name:"radio-control-".concat(u),checked:n,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}}),t&&n&&Object(r.createElement)("div",{className:a()("wc-block-components-radio-control-accordion-content",{"wc-block-components-radio-control-accordion-content-hide":!n})},e.content))})))})),rn=n(168),cn=function(e){var t=e.children,n=e.showSaveOption,o=Object(b.b)().isEditor,a=Object(Ze.b)(),s=a.shouldSavePayment,i=a.setShouldSavePayment,l=Object(Fe.b)().customerId;return Object(r.createElement)(rn.a,{isEditor:o},t,l>0&&n&&Object(r.createElement)(ve,{className:"wc-block-components-payment-methods__save-card-info",label:Object(c.__)("Save payment information to my account for future purchases.",'woocommerce'),checked:s,onChange:function(){return i(!s)}}))},on=["activePaymentMethod"];function an(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?an(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ln=function(){var e=Object(Ze.b)(),t=e.setActivePaymentMethod,n=e.activeSavedToken,c=e.setActiveSavedToken,o=e.isExpressPaymentMethodActive,s=e.customerPaymentMethods,i=Object(Qe.b)().paymentMethods,l=Object(Jt.a)(),u=l.activePaymentMethod,p=_()(l,on),d=Object(Gt.c)().noticeContexts,m=Object(Zt.a)().removeNotice,f=Object(b.b)().isEditor,O=Object.keys(i).map((function(e){var t=i[e],n=t.edit,c=t.content,o=t.label,a=t.supports,s=f?n:c;return{value:e,label:"string"==typeof o?o:Object(r.cloneElement)(o,{components:p.components}),name:"wc-saved-payment-method-token-".concat(e),content:Object(r.createElement)(cn,{showSaveOption:a.showSaveOption},Object(r.cloneElement)(s,sn({activePaymentMethod:u},p)))}})),g=0===Object.keys(s).length&&1===Object.keys(i).length,h=a()({"disable-radio-control":g});return o?null:Object(r.createElement)(nn,{id:"wc-payment-method-options",className:h,selected:n?null:u,onChange:function(e){t(e),c(""),m("wc-payment-error",d.PAYMENTS)},options:O})},un=n(167),pn=n(60);function dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var bn=function(){var e,t,n=Object(Ze.b)(),o=n.setPaymentStatus,a=n.customerPaymentMethods,s=n.activePaymentMethod,i=n.setActivePaymentMethod,l=n.activeSavedToken,u=n.setActiveSavedToken,p=Object(pn.getPaymentMethods)(),d=Object(Qe.b)().paymentMethods,b=Object(Jt.a)(),m=Object(r.useRef)([]),f=Object(r.useCallback)((function(e){u(e)}),[u]);Object(r.useEffect)((function(){var e=Object.keys(a).flatMap((function(e){return a[e].map((function(t){var n="cc"===e||"echeck"===e?function(e,t,n){var r=e.method,o=e.expires,a=e.tokenId;return{value:a+"",label:Object(c.sprintf)(
|
||
/* translators: %1$s is referring to the payment method brand, %2$s is referring to the last 4 digits of the payment card, %3$s is referring to the expiry date. */
|
||
Object(c.__)("%1$s ending in %2$s (expires %3$s)","woo-gutenberg-product-blocks"),r.brand,r.last4,o),name:"wc-saved-payment-method-token-".concat(a),onChange:function(e){var c,o="wc-".concat(r.gateway,"-payment-token");t(r.gateway),n().started((c={payment_method:r.gateway},C()(c,o,e+""),C()(c,"isSavedToken",!0),c))}}}(t,i,o):function(e,t,n){var r=e.method,o=e.tokenId;return{value:o+"",label:Object(c.sprintf)(
|
||
/* translators: %s is the name of the payment method gateway. */
|
||
Object(c.__)("Saved token for %s",'woocommerce'),r.gateway),name:"wc-saved-payment-method-token-".concat(o),onChange:function(e){var c,o="wc-".concat(r.gateway,"-payment-token");t(r.gateway),n().started((c={payment_method:r.gateway},C()(c,o,e+""),C()(c,"isSavedToken",!0),c))}}}(t,i,o);return!s&&t.is_default&&""===l&&(f(t.tokenId+""),n.onChange(t.tokenId)),n}))})).filter(Boolean);m.current=e}),[a,f,l,s,i,o,p]);var O=l&&d[s]&&null!==(e=d[s])&&void 0!==e&&e.savedTokenComponent?Object(r.cloneElement)(null===(t=d[s])||void 0===t?void 0:t.savedTokenComponent,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dn(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({token:l},b)):null;return m.current.length>0?Object(r.createElement)(r.Fragment,null,Object(r.createElement)(un.a,{id:"wc-payment-method-saved-tokens",selected:l,onChange:f,options:m.current}),O):null},mn=function(){var e=Object(Qe.b)(),t=e.isInitialized,n=e.paymentMethods,o=Object(Ze.b)().customerPaymentMethods;return t&&0===Object.keys(n).length?Object(r.createElement)(Kt,null):Object(r.createElement)(r.Fragment,null,Object(r.createElement)(bn,null),Object.keys(o).length>0&&Object(r.createElement)(ht.a,{label:Object(c.__)("Use another payment method.",'woocommerce'),screenReaderLabel:Object(c.__)("Other available payment methods",'woocommerce'),wrapperElement:"p",wrapperProps:{className:["wc-block-components-checkout-step__description wc-block-components-checkout-step__description-payments-aligned"]}}),Object(r.createElement)(ln,null))},fn=function(){var e=Object(Gt.c)().noticeContexts;return Object(r.createElement)(Ht.a,{context:e.PAYMENTS},Object(r.createElement)(mn,null))};function On(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?On(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):On(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var hn=gn(gn({},we({defaultTitle:Object(c.__)("Payment options",'woocommerce'),defaultDescription:""})),{},{lock:{type:"object",default:{move:!0,remove:!0}}}),jn=n(544);Object(u.d)(jn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ut.a}),foreground:"#874FB9"},attributes:hn,edit:function(e){var t=Object(v.getSetting)("globalPaymentMethods");return Object(r.createElement)(oe,ge()({},e,{className:"wc-block-checkout__payment-method"}),Object(r.createElement)(p.InspectorControls,null,t.length>0&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Methods",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following payment integrations active.",'woocommerce')),t.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout§ion=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=checkout")},Object(c.__)("Manage payment methods",'woocommerce')))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(fn,null)),Object(r.createElement)(ae,{block:W.innerBlockAreas.PAYMENT_METHODS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var vn=n(83),En=n(198),yn=(n(274),function(){var e=Object(Fe.b)(),t=e.isCalculating,n=e.isProcessing,o=e.isAfterProcessing,a=e.isBeforeProcessing,s=e.isComplete,i=e.hasError,l=Object(Ze.b)().currentStatus,u=Object(Qe.a)(),p=u.paymentMethods,d=u.isInitialized,m=Object(b.b)().isEditor,f=Object(Gt.c)().noticeContexts;if(!d||d&&0===Object.keys(p).length)return m||v.CURRENT_USER_IS_ADMIN?Object(r.createElement)(Ht.a,{context:f.EXPRESS_PAYMENTS}):null;var O=n||o||a||s&&!i;return Object(r.createElement)(r.Fragment,null,Object(r.createElement)(vn.a,{isLoading:t||O||l.isDoingExpressPayment},Object(r.createElement)("div",{className:"wc-block-components-express-payment wc-block-components-express-payment--checkout"},Object(r.createElement)("div",{className:"wc-block-components-express-payment__title-container"},Object(r.createElement)(re.a,{className:"wc-block-components-express-payment__title",headingLevel:"2"},Object(c.__)("Express checkout",'woocommerce'))),Object(r.createElement)("div",{className:"wc-block-components-express-payment__content"},Object(r.createElement)(Ht.a,{context:f.EXPRESS_PAYMENTS},Object(r.createElement)("p",null,Object(c.__)("In a hurry? Use one of our express checkout options:",'woocommerce')),Object(r.createElement)(En.a,null))))),Object(r.createElement)("div",{className:"wc-block-components-express-payment-continue-rule wc-block-components-express-payment-continue-rule--checkout"},Object(c.__)("Or continue below",'woocommerce')))}),wn=function(){return Object(_t.a)().cartNeedsPayment?Object(r.createElement)(yn,null):null},kn=(n(837),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Ut.a}),label:Object(c.__)("Express Checkout",'woocommerce'),className:"wp-block-woocommerce-checkout-express-payment-block-placeholder"},Object(r.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(r.createElement)(Yt.a,{isPrimary:!0,href:"".concat(v.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')))}),Sn=n(545);Object(u.d)(Sn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Ut.a}),foreground:"#874FB9"},edit:function(e){var t=e.attributes,n=Object(Qe.a)(),c=n.paymentMethods,o=n.isInitialized,s=Object.keys(c).length>0,i=Object(p.useBlockProps)({className:a()({"wp-block-woocommerce-checkout-express-payment-block--has-express-payment-methods":s}),attributes:t});return o?Object(r.createElement)("div",i,s?Object(r.createElement)(wn,null):Object(r.createElement)(kn,null)):null},save:function(){return Object(r.createElement)("div",p.useBlockProps.save())}});var Cn=Object(r.createElement)(i.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 13"},Object(r.createElement)("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.667 2.5h1.666l3.334 3.333V10H15a2.5 2.5 0 11-5 0H6.667a2.5 2.5 0 11-5 0H0V1.667C0 .746.746 0 1.667 0H10c.92 0 1.667.746 1.667 1.667V2.5zM2.917 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0zm-1.25-2.5V1.667H10V7.5H1.667zM11.25 10a1.25 1.25 0 102.5 0 1.25 1.25 0 00-2.5 0z"})),Pn=n(200),Nn=n(500),xn=n(53),Rn=n(25),Tn=(n(839),function(){return Object(r.createElement)(qt.a,{icon:Object(r.createElement)(s.a,{srcElement:Cn}),label:Object(c.__)("Shipping options",'woocommerce'),className:"wc-block-checkout__no-shipping-placeholder"},Object(r.createElement)("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(c.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.",'woocommerce')),Object(r.createElement)(Yt.a,{isSecondary:!0,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping"),target:"_blank",rel:"noopener noreferrer"},Object(c.__)("Configure Shipping Options",'woocommerce')))}),An=(n(838),function(e){var t=Object(v.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(Rn.decodeEntities)(e.name),value:e.rate_id,description:Object(Rn.decodeEntities)(e.description),secondaryLabel:Object(r.createElement)(xn.a,{currency:Object(Et.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(Rn.decodeEntities)(e.delivery_time)}}),In=function(){var e=Object(b.b)().isEditor,t=Object(ue.b)(),n=t.shippingRates,o=t.shippingRatesLoading,s=t.needsShipping,i=t.hasCalculatedShipping;if(!s)return null;var l=Object(Nn.a)(n);return e||i||l?Object(r.createElement)(r.Fragment,null,e&&!l?Object(r.createElement)(Tn,null):Object(r.createElement)(Pn.a,{noResultsMessage:Object(r.createElement)(Wt.a,{isDismissible:!1,className:a()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(c.__)("There are no shipping options available. Please check your shipping address.",'woocommerce')),renderOption:An,shippingRates:n,shippingRatesLoading:o})):Object(r.createElement)("p",null,Object(c.__)("Shipping options will be displayed here after entering your full shipping address.",'woocommerce'))};function Mn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mn(Object(n),!0).forEach((function(t){C()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Fn=Dn(Dn({},we({defaultTitle:Object(c.__)("Shipping options",'woocommerce'),defaultDescription:""})),{},{allowCreateAccount:{type:"boolean",default:!1},lock:{type:"object",default:{move:!0,remove:!0}}}),Bn=n(546);Object(u.d)(Bn,{icon:{src:Object(r.createElement)(s.a,{srcElement:Cn}),foreground:"#874FB9"},attributes:Fn,edit:function(e){var t=e.attributes,n=e.setAttributes,o=Object(v.getSetting)("globalShippingMethods"),a=Object(v.getSetting)("activeShippingZones");return Object(r.createElement)(oe,{attributes:t,setAttributes:n},Object(r.createElement)(p.InspectorControls,null,o.length>0&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Methods",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following shipping integrations active.",'woocommerce')),o.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping§ion=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping")},Object(c.__)("Manage shipping methods",'woocommerce'))),a.length&&Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Zones",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("You currently have the following shipping zones active.",'woocommerce')),a.map((function(e){return Object(r.createElement)(zt,{key:e.id,href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping&zone_id=").concat(e.id),title:e.title,description:e.description})})),Object(r.createElement)(g.ExternalLink,{href:"".concat(v.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping")},Object(c.__)("Manage shipping zones",'woocommerce')))),Object(r.createElement)(g.Disabled,null,Object(r.createElement)(In,null)),Object(r.createElement)(ae,{block:W.innerBlockAreas.SHIPPING_METHODS}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save(),Object(r.createElement)(se,null))}});var Ln={title:Object(c.__)("Checkout",'woocommerce'),icon:{src:Object(r.createElement)(s.a,{srcElement:l}),foreground:"#874FB9"},category:"woocommerce",keywords:[Object(c.__)("WooCommerce",'woocommerce')],description:Object(c.__)("Display a checkout form so your customers can submit orders.",'woocommerce'),supports:{align:["wide","full"],html:!1,multiple:!1},attributes:H,apiVersion:2,edit:function(e){var t=e.attributes,n=e.setAttributes,o=t.allowCreateAccount,s=t.showCompanyField,i=t.requireCompanyField,l=t.showApartmentField,u=t.showPhoneField,h=t.requirePhoneField,j=t.showOrderNotes,v=t.showPolicyLinks,y=t.showReturnToCart,_=t.showRateAfterTaxName,w=[["woocommerce/checkout-fields-block",{},[["woocommerce/checkout-express-payment-block",{},[]],["woocommerce/checkout-contact-information-block",{},[]],["woocommerce/checkout-shipping-address-block",{},[]],["woocommerce/checkout-billing-address-block",{},[]],["woocommerce/checkout-shipping-methods-block",{},[]],["woocommerce/checkout-payment-block",{},[]],!!j&&["woocommerce/checkout-order-note-block",{},[]],!!v&&["woocommerce/checkout-terms-block",{},[]],["woocommerce/checkout-actions-block",{showReturnToCart:y,cartPageId:t.cartPageId},[]]].filter(Boolean)],["woocommerce/checkout-totals-block",{},[["woocommerce/checkout-order-summary-block",{showRateAfterTaxName:_},[]]]]],S=function(e){var r={};r[e]=!t[e],n(r)},C=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object(r.useRef)(),n=Object(p.useBlockProps)(I({ref:t},e));return D({ref:t}),n}();return Object(r.createElement)("div",C,Object(r.createElement)(b.a,{previewData:{previewCart:f.a,previewSavedPaymentMethods:O}},Object(r.createElement)(z,{attributes:t,setAttributes:n}),Object(r.createElement)(m.a,null,Object(r.createElement)(k,null,Object(r.createElement)(d.a,{className:a()("wc-block-checkout",{"has-dark-controls":t.hasDarkControls})},Object(r.createElement)(B.Provider,{value:{addressFieldControls:function(){return Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Address Fields",'woocommerce')},Object(r.createElement)("p",{className:"wc-block-checkout__controls-text"},Object(c.__)("Show or hide fields in the checkout address forms.",'woocommerce')),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Company",'woocommerce'),checked:s,onChange:function(){return S("showCompanyField")}}),s&&Object(r.createElement)(g.CheckboxControl,{label:Object(c.__)("Require company name?",'woocommerce'),checked:i,onChange:function(){return S("requireCompanyField")},className:"components-base-control--nested"}),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Apartment, suite, etc.",'woocommerce'),checked:l,onChange:function(){return S("showApartmentField")}}),Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Phone",'woocommerce'),checked:u,onChange:function(){return S("showPhoneField")}}),u&&Object(r.createElement)(g.CheckboxControl,{label:Object(c.__)("Require phone number?",'woocommerce'),checked:h,onChange:function(){return S("requirePhoneField")},className:"components-base-control--nested"})))},accountControls:function(){return Object(r.createElement)(p.InspectorControls,null,Object(r.createElement)(g.PanelBody,{title:Object(c.__)("Account options",'woocommerce')},Object(r.createElement)(g.ToggleControl,{label:Object(c.__)("Allow shoppers to sign up for a user account during checkout",'woocommerce'),checked:o,onChange:function(){return n({allowCreateAccount:!o})}})))}}},Object(r.createElement)(F.Provider,{value:{allowCreateAccount:o,showCompanyField:s,requireCompanyField:i,showApartmentField:l,showPhoneField:u,requirePhoneField:h}},Object(r.createElement)(p.InnerBlocks,{allowedBlocks:U,template:w,templateLock:"insert"}))))))),Object(r.createElement)(E.a,{blockName:"checkout"}))},save:function(){return Object(r.createElement)("div",p.useBlockProps.save({className:"wc-block-checkout is-loading"}),Object(r.createElement)(p.InnerBlocks.Content,null))},deprecated:[{attributes:H,save:function(e){var t=e.attributes;return Object(r.createElement)("div",{className:a()("is-loading",t.className)})}}]};Object(u.d)("woocommerce/checkout",Ln)},90:function(e,t,n){"use strict";var r=n(9),c=n.n(r),o=n(16),a=n.n(o),s=n(0),i=n(182),l=n(6),u=n.n(l),p=n(114),d=(n(208),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,r=void 0!==n&&n,o=e.children,l=a()(e,d),b=u()("wc-block-components-button",t,{"wc-block-components-button--loading":r});return Object(s.createElement)(i.a,c()({className:b},l),r&&Object(s.createElement)(p.a,null),Object(s.createElement)("span",{className:"wc-block-components-button__text"},o))}},91:function(e,t){e.exports=window.wp.autop}}); |