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.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(g.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(N.a,{currency:Object(E.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(g.decodeEntities)(e.delivery_time))}},C=function(e){var t=e.className,n=e.noResultsMessage,c=e.onSelectRate,a=e.rates,r=e.renderOption,o=void 0===r?P:r,i=e.selected;if(0===a.length)return n;if(a.length>1)return React.createElement(k.a,{className:t,onChange:function(e){c(e)},selected:i,options:a.map(o)});var s=o(a[0]),l=s.label,p=s.secondaryLabel,u=s.description,d=s.secondaryDescription;return React.createElement(y.a,{label:l,secondaryLabel:p,description:u,secondaryDescription:d})},D=(n(253),function(e){var t=e.packageId,n=e.className,c=e.noResultsMessage,a=e.renderOption,i=e.packageData,s=e.collapsible,p=void 0!==s&&s,u=e.collapse,d=void 0!==u&&u,b=e.showItems,h=void 0!==b&&b,v=function(e,t){var n=Object(_.a)().dispatchCheckoutEvent,c=Object(w.a)(),a=c.selectShippingRate,r=c.isSelectingRate,i=Object(o.useState)((function(){return R(t)})),s=O()(i,2),l=s[0],p=s[1],u=Object(o.useRef)(t);return Object(o.useEffect)((function(){j()(u.current,t)||(u.current=t,p(R(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){p(t),a(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,a,n]),selectedShippingRate:l,isSelectingRate:r}}(t,i.shipping_rates),k=v.selectShippingRate,y=v.selectedShippingRate,E=React.createElement(React.Fragment,null,(h||p)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),h&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.items).map((function(e){var t=Object(g.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(f.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(r.sprintf)(
|
||
/* 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(n,t))}))}return e}({},t))}f.current=m}}),[m,c,r,n]);var j=Object(s.useCallback)((function(e){c({email:e})}),[c]),w=Object(s.useCallback)((function(e){c({phone:e})}),[c]),_=Object(s.useCallback)((function(e){O({phone:e})}),[O]);return{defaultAddressFields:i.defaultAddressFields,shippingFields:r,setShippingFields:O,billingFields:n,setBillingFields:v,setEmail:j,setPhone:w,setShippingPhone:_,shippingAsBilling:m,setShippingAsBilling:g,showShippingFields:e,showBillingFields:!e||!f.current}}},355:function(e,t,n){"use strict";var c=n(12),a=n(22),r=n(19),o=n(0),i=n(6),s=n.n(i),l=n(24),p=n(91);t.a=function(e){var t,n=e.icon,i=e.children,u=e.label,d=e.instructions,b=e.className,m=e.notices,g=e.preview,f=e.isColumnLayout,h=Object(r.a)(e,["icon","children","label","instructions","className","notices","preview","isColumnLayout"]),O=Object(l.useResizeObserver)(),v=Object(a.a)(O,2),j=v[0],w=v[1].width;"number"==typeof w&&(t={"is-large":w>=320,"is-medium":w>=160&&w<320,"is-small":w<160});var _=s()("components-placeholder",b,t),R=s()("components-placeholder__fieldset",{"is-column-layout":f});return Object(o.createElement)("div",Object(c.a)({},h,{className:_}),j,m,g&&Object(o.createElement)("div",{className:"components-placeholder__preview"},g),Object(o.createElement)("div",{className:"components-placeholder__label"},Object(o.createElement)(p.a,{icon:n}),u),!!d&&Object(o.createElement)("div",{className:"components-placeholder__instructions"},d),Object(o.createElement)("div",{className:R},i))}},373:function(e,t){},374:function(e,t){},407:function(e,t,n){"use strict";n.r(t);var c=n(345),a=n(350),r=n(48),o=n(352),i=n(1),s=n(209),l=n(326),p=n(58),u=n(69),d=n(36),b=n(66),m=n(28),g=n(153),f=n(6),h=n.n(f),O=n(2),v=n(355),j=n(76),w=n(152),_=n(34),R=React.createElement(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 17 13"},React.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"})),k=(n(374),function(){return React.createElement(v.a,{icon:React.createElement(w.a,{srcElement:R}),label:Object(i.__)("Shipping options",'woocommerce'),className:"wc-block-checkout__no-shipping-placeholder"},React.createElement("span",{className:"wc-block-checkout__no-shipping-placeholder-description"},Object(i.__)("Your store does not have any Shipping Options configured. Once you have added your Shipping Options they will appear here.",'woocommerce')),React.createElement(j.a,{isSecondary:!0,href:"".concat(O.ADMIN_URL,"admin.php?page=wc-settings&tab=shipping"),target:"_blank",rel:"noopener noreferrer"},Object(i.__)("Configure Shipping Options",'woocommerce')))}),y=(n(373),function(e){var t=Object(O.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(m.decodeEntities)(e.name),value:e.rate_id,description:Object(m.decodeEntities)(e.description),secondaryLabel:React.createElement(u.a,{currency:Object(p.getCurrencyFromPriceResponse)(e),value:t}),secondaryDescription:Object(m.decodeEntities)(e.delivery_time)}}),E=function(){var e=Object(d.a)().isEditor,t=Object(b.b)(),n=t.shippingRates,c=t.shippingRatesLoading,a=t.needsShipping,r=t.hasCalculatedShipping;if(!a)return null;var o=Object(l.a)(n);return e||r||o?React.createElement(React.Fragment,null,e&&!o?React.createElement(k,null):React.createElement(s.a,{noResultsMessage:React.createElement(g.a,{isDismissible:!1,className:h()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(i.__)("There are no shipping options available. Please check your shipping address.",'woocommerce')),renderOption:y,shippingRates:n,shippingRatesLoading:c})):React.createElement("p",null,Object(i.__)("Shipping options will be displayed here after entering your full shipping address.",'woocommerce'))},N=n(4),S=n.n(N),P=n(349);function C(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}function D(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){S()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var L=D(D({},Object(P.a)({defaultTitle:Object(i.__)("Shipping options",'woocommerce'),defaultDescription:""})),{},{allowCreateAccount:{type:"boolean",default:!1},lock:{type:"object",default:{move:!0,remove:!0}}});t.default=Object(c.a)(L)((function(e){var t=e.title,n=e.description,c=e.showStepNumber,i=e.children,s=Object(r.b)().isProcessing;return Object(o.a)().showShippingFields?React.createElement(a.a,{id:"shipping-option",disabled:s,className:"wc-block-checkout__shipping-option",title:t,description:n,showStepNumber:c},React.createElement(E,null),i):null}))},51:function(e,t,n){"use strict";var c=n(4),a=n.n(c),r=n(0),o=n(6),i=n.n(o);function s(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}function l(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){a()(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}t.a=function(e){var t,n=e.label,c=e.screenReaderLabel,a=e.wrapperElement,o=e.wrapperProps,s=void 0===o?{}:o,p=null!=n,u=null!=c;return!p&&u?(t=a||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,c)):(t=a||r.Fragment,p&&u&&n!==c?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},c)):React.createElement(t,s,n))}},69:function(e,t,n){"use strict";var c=n(14),a=n.n(c),r=n(4),o=n.n(r),i=n(23),s=n.n(i),l=n(126),p=n(6),u=n.n(p),d=(n(147),["className","value","currency","onValueChange","displayType"]);function b(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}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(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,c=e.currency,r=e.onValueChange,o=e.displayType,i=void 0===o?"text":o,p=s()(e,d),b="string"==typeof n?parseInt(n,10):n;if(!Number.isFinite(b))return null;var g=b/Math.pow(10,c.minorUnit);if(!Number.isFinite(g))return null;var f=u()("wc-block-formatted-money-amount","wc-block-components-formatted-money-amount",t),h=m(m(m({},p),function(e){return{thousandSeparator:e.thousandSeparator,decimalSeparator:e.decimalSeparator,decimalScale:e.minorUnit,fixedDecimalScale:!0,prefix:e.prefix,suffix:e.suffix,isNumericString:!0}}(c)),{},{value:void 0,currency:void 0,onValueChange:void 0}),O=r?function(e){var t=e.value*Math.pow(10,c.minorUnit);r(t)}:function(){};return React.createElement(l.a,a()({className:f,displayType:i},h,{value:g,onValueChange:O}))}}}]); |