9 lines
19 KiB
JavaScript
9 lines
19 KiB
JavaScript
|
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[41],{105:function(e,t,n){"use strict";var c=n(1),a=(n(10),n(6)),r=n.n(a),o=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,a=e.screenReaderLabel,i=e.showSpinner,s=void 0!==i&&i,l=e.isLoading,p=void 0===l||l;return React.createElement("div",{className:r()(n,{"wc-block-components-loading-mask":p})},p&&s&&React.createElement(o.a,null),React.createElement("div",{className:r()({"wc-block-components-loading-mask__children":p}),"aria-hidden":p},t),p&&React.createElement("span",{className:"screen-reader-text"},a||Object(c.__)("Loading…",'woocommerce')))}},138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},147:function(e,t){},174:function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,a=e.secondaryDescription,r=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:r&&"".concat(r,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:r&&"".concat(r,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},c&&React.createElement("span",{id:r&&"".concat(r,"__description"),className:"wc-block-components-radio-control__description"},c),a&&React.createElement("span",{id:r&&"".concat(r,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},a)))}},175:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(23),o=n.n(r),i=n(6),s=n.n(i),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,r=o()(e,l),i=s()("wc-block-components-title",n),p="h".concat(c);return React.createElement(p,a()({className:i},r),t)}},179:function(e,t,n){"use strict";var c=n(4),a=n.n(c),r=n(6),o=n.n(r),i=n(174);t.a=function(e){var t,n=e.checked,c=e.name,r=e.onChange,s=e.option,l=s.value,p=s.label,u=s.description,d=s.secondaryLabel,b=s.secondaryDescription;return React.createElement("label",{className:o()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(c,"-").concat(l)},React.createElement("input",{id:"".concat(c,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:c,value:l,onChange:function(e){return r(e.target.value)},checked:n,"aria-describedby":o()((t={},a()(t,"".concat(c,"-").concat(l,"__label"),p),a()(t,"".concat(c,"-").concat(l,"__secondary-label"),d),a()(t,"".concat(c,"-").concat(l,"__description"),u),a()(t,"".concat(c,"-").concat(l,"__secondary-description"),b),t))}),React.createElement(i.a,{id:"".concat(c,"-").concat(l),label:p,secondaryLabel:d,description:u,secondaryDescription:b}))}},180:function(e,t){},181:function(e,t){},207:function(e,t,n){"use strict";var c=n(6),a=n.n(c),r=n(24),o=n(179);n(252),t.a=Object(r.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,r=e.selected,i=e.onChange,s=e.options,l=void 0===s?[]:s,p=c||n;return l.length&&React.createElement("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(o.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===r,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},209:function(e,t,n){"use strict";var c=n(23),a=n.n(c),r=n(1),o=n(0),i=n(33),s=n(105),l=n(26),p=n(326),u=n(32),d=n(36),b=n(6),m=n.n(b),g=n(28),f=n(51),h=n(5),O=n.n(h),v=n(25),j=n.n(v),w=n(118),_=n(52),R=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},k=n(207),y=n(174),E=n(58),N=n(69),S=n(2),P=function(e){var t=Object(S.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e
|
||
|
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
|
||
|
Object(r._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),N=React.createElement(C,{className:n,noResultsMessage:c,rates:i.shipping_rates,onSelectRate:k,selected:y,renderOption:a});return p?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:E},N):React.createElement("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},E,N)}),L=["package_id"],x=["extensions","receiveCart"],F=function(e){var t=e.packages,n=e.collapse,c=e.showItems,r=e.collapsible,o=e.noResultsMessage,i=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,s=a()(e,L);return React.createElement(D,{key:t,packageId:t,packageData:s,collapsible:r,collapse:n,showItems:c,noResultsMessage:o,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,c=e.className,b=e.collapsible,m=void 0!==b&&b,g=e.noResultsMessage,f=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(p.a)(t),c=Object(p.b)(t);1===e?Object(i.speak)(Object(r.sprintf)(
|
||
|
/* translators: %d number of shipping options found. */
|
||
|
Object(r._n)("%d shipping option was found.","%d shipping options were found.",c,'woocommerce'),c)):Object(i.speak)(Object(r.sprintf)(
|
||
|
/* translators: %d number of shipping packages packages. */
|
||
|
Object(r._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(r.sprintf)(
|
||
|
/* translators: %d number of shipping options available. */
|
||
|
Object(r._n)("%d shipping option was found","%d shipping options were found",c,'woocommerce'),c))}}),[n,t]);var h=Object(u.a)(),O=h.extensions,v=(h.receiveCart,{className:c,collapsible:m,noResultsMessage:g,renderOption:f,extensions:O,cart:a()(h,x),components:{ShippingRatesControlPackage:D}}),j=Object(d.a)().isEditor;return React.createElement(s.a,{isLoading:n,screenReaderLabel:Object(r.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},j?React.createElement(F,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,v),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(F,{packages:t,noResultsMessage:g,renderOption:f}))))}},248:function(e,t){},252:function(e,t){},253:function(e,t){},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var c=function(e){return e.length},a=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},345:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(188);t.a=function(e){return function(t){return function(n){var c=Object(r.a)(e,n);return React.createElement(t,a()({},n,c))}}}},346:function(e,t){},349:function(e,t,n){"use strict";var c=n(1);t.a=function(e){var t=e.defaultTitle,n=void 0===t?Object(c.__)("Step",'woocommerce'):t,a=e.defaultDescription,r=void 0===a?Object(c.__)("Step description text.",'woocommerce'):a,o=e.defaultShowStepNumber;return{title:{type:"string",default:n},description:{type:"string",default:r},showStepNumber:{type:"boolean",default:void 0===o||o}}}},350:function(e,t,n){"use strict";var c=n(6),a=n.n(c),r=(n(10),n(175)),o=(n(346),function(e){var t=e.title,n=e.stepHeadingContent;return React.createElement("div",{className:"wc-block-components-checkout-step__heading"},React.createElement(r.a,{"aria-hidden":"true",className:"wc-block-components-checkout-step__title",headingLevel:"2"},t),!!n&&React.createElement("span",{className:"wc-block-components-checkout-step__heading-content"},n))});t.a=function(e){var t=e.id,n=e.className,c=e.title,r=e.legend,i=e.description,s=e.children,l=e.disabled,p=void 0!==l&&l,u=e.showStepNumber,d=void 0===u||u,b=e.stepHeadingContent,m=void 0===b?function(){}:b,g=r||c?"fieldset":"div";return React.createElement(g,{className:a()(n,"wc-block-components-checkout-step",{"wc-block-components-checkout-step--with-step-number":d,"wc-block-components-checkout-step--disabled":p}),id:t,disabled:p},!(!r&&!c)&&React.createElement("legend",{className:"screen-reader-text"},r||c),!!c&&React.createElement(o,{title:c,stepHeadingContent:m()}),React.createElement("div",{className:"wc-block-components-checkout-step__container"},!!i&&React.createElement("p",{className:"wc-block-components-checkout-step__description"},i),React.createElement("div",{className:"wc-block-components-checkout-step__content"},s)))}},352:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var c=n(4),a=n.n(c),r=n(23),o=n.n(r),i=n(2),s=n(0),l=n(66),p=n(60),u=["email"];function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var b=function(){var e=Object(l.b)().needsShipping,t=Object(p.b)(),n=t.billingData,c=t.setBillingData,r=t.shippingAddress,b=t.setShippingAddress,m=t.shippingAsBilling,g=t.setShippingAsBilling,f=Object(s.useRef)(m),h=Object(s.useRef)(n),O=Object(s.useCallback)((function(e){b(e),m&&c(e)}),[m,b,c]),v=Object(s.useCallback)((function(t){c(t),e||b(t)}),[e,b,c]);Object(s.useEffect)((function(){if(f.current!==m){if(m)h.current=n,c(r);else{var e=h.current,t=(e.email,o()(e,u));c(function(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){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor
|