File "footer-frontend.js"

Full Path: /home/warrior1/public_html/wp-content-20241001222009/plugins/woocommerce/packages/woocommerce-blocks/build/mini-cart-contents-block/footer-frontend.js
File size: 23.88 KB
MIME-type: text/plain
Charset: utf-8

(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[52],{138:function(e,t,s){"use strict";var a=s(0);s(199),t.a=()=>Object(a.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},199:function(e,t){},211:function(e,t,s){"use strict";s.d(t,"b",(function(){return U})),s.d(t,"a",(function(){return $}));var a=s(0),r=s(19),n=s(7);let c,i;!function(e){e.PRISTINE="pristine",e.STARTED="started",e.PROCESSING="processing",e.ERROR="has_error",e.FAILED="failed",e.SUCCESS="success",e.COMPLETE="complete"}(c||(c={})),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",e.SET_ACTIVE_PAYMENT_METHOD="set_active_payment_method"}(i||(i={}));const o={currentStatus:c.PRISTINE,shouldSavePaymentMethod:!1,activePaymentMethod:"",paymentMethodData:{payment_method:""},errorMessage:"",paymentMethods:{},expressPaymentMethods:{}},d={setPaymentStatus:()=>({pristine:()=>{},started:()=>{},processing:()=>{},completed:()=>{},error:e=>{},failed:(e,t)=>{},success:(e,t)=>{}}),currentStatus:{isPristine:!0,isStarted:!1,isProcessing:!1,isFinished:!1,hasError:!1,hasFailed:!1,isSuccessful:!1,isDoingExpressPayment:!1},paymentStatuses:c,paymentMethodData:{},errorMessage:"",activePaymentMethod:"",activeSavedToken:"",setActivePaymentMethod:()=>{},customerPaymentMethods:{},paymentMethods:{},expressPaymentMethods:{},paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,onPaymentProcessing:()=>()=>()=>{},setExpressPaymentError:()=>{},isExpressPaymentMethodActive:!1,setShouldSavePayment:()=>{},shouldSavePayment:!1};var l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,{type:t,paymentMethodData:s,shouldSavePaymentMethod:a=!1,errorMessage:r="",paymentMethods:n={},paymentMethod:d=""}=arguments.length>1?arguments[1]:void 0;switch(t){case c.PRISTINE:return{...o,...e,errorMessage:"",currentStatus:c.PRISTINE};case c.STARTED:return{...e,currentStatus:c.STARTED};case c.ERROR:return e.currentStatus!==c.ERROR?{...e,currentStatus:c.ERROR,errorMessage:r||e.errorMessage}:e;case c.FAILED:return e.currentStatus!==c.FAILED?{...e,currentStatus:c.FAILED,paymentMethodData:s||e.paymentMethodData,errorMessage:r||e.errorMessage}:e;case c.SUCCESS:return e.currentStatus!==c.SUCCESS?{...e,currentStatus:c.SUCCESS,paymentMethodData:s||e.paymentMethodData}:e;case c.PROCESSING:return e.currentStatus!==c.PROCESSING?{...e,currentStatus:c.PROCESSING,errorMessage:""}:e;case c.COMPLETE:return e.currentStatus!==c.COMPLETE?{...e,currentStatus:c.COMPLETE}:e;case i.SET_REGISTERED_PAYMENT_METHODS:return{...e,paymentMethods:n};case i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:return{...e,expressPaymentMethods:n};case i.SET_SHOULD_SAVE_PAYMENT_METHOD:return{...e,shouldSavePaymentMethod:a};case i.SET_ACTIVE_PAYMENT_METHOD:return{...e,activePaymentMethod:d,paymentMethodData:s||e.paymentMethodData}}},u=s(1),p=s(16),m=s(31),_=s(2),h=s(51),y=s(25),b=s.n(y),g=s(29),S=s(50),E=s(32),O=s(30),v=s(67);const M=(e,t,s,r)=>{const[c,i]=Object(a.useState)(!1),{isEditor:o}=Object(g.a)(),{selectedRates:d}=Object(v.a)(),{billingAddress:l,shippingAddress:p}=Object(S.b)(),y=Object(m.a)(d),O=Object(m.a)(s),M=Object(E.a)(),{cartTotals:f,cartIsLoading:j,cartNeedsShipping:P,paymentRequirements:R}=M,T=Object(a.useRef)({cart:M,cartTotals:f,cartNeedsShipping:P,billingData:l,billingAddress:l,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:R}),{createErrorNotice:k}=Object(n.useDispatch)("core/notices");Object(a.useEffect)(()=>{T.current={cart:M,cartTotals:f,cartNeedsShipping:P,get billingData(){return b()("billingData",{alternative:"billingAddress",plugin:"woocommerce-gutenberg-products-block",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"}),this.billingAddress},billingAddress:l,shippingAddress:p,selectedShippingMethods:y,paymentRequirements:R}},[M,f,P,l,p,y,R]);const w=Object(a.useCallback)(async()=>{let s={};const a=e=>{s={...s,[e.name]:e}};for(let e=0;e<O.length;e++){const s=O[e],n=t[s];if(n)try{const e=!!o||await Promise.resolve(n.canMakePayment(T.current));if(e){if("object"==typeof e&&null!==e&&e.error)throw new Error(e.error.message);a(n)}}catch(e){if(_.CURRENT_USER_IS_ADMIN||o){const t=Object(u.sprintf)(
/* translators: %s the id of the payment method being registered (bank transfer, cheque...) */
Object(u.__)("There was an error registering the payment method with id '%s': ","woocommerce"),n.paymentMethodId);k(`${t} ${e}`,{context:r,id:`wc-${n.paymentMethodId}-registration-error`})}}}e(s),i(!0)},[k,e,o,r,O,t]),D=Object(h.a)(w,500,{leading:!0});return Object(a.useEffect)(()=>{j||D()},[D,M,y,l,j]),c},f=e=>({type:e}),j=e=>({type:c.ERROR,errorMessage:e}),P=e=>{let{errorMessage:t,paymentMethodData:s}=e;return{type:c.FAILED,errorMessage:t,paymentMethodData:s}},R=e=>{let{paymentMethodData:t}=e;return{type:c.SUCCESS,paymentMethodData:t}},T=e=>({type:i.SET_REGISTERED_PAYMENT_METHODS,paymentMethods:e}),k=e=>({type:i.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),w=e=>({type:i.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),D=(e,t)=>({type:i.SET_ACTIVE_PAYMENT_METHOD,paymentMethod:e,paymentMethodData:t});var x=s(68),A=s(36),C=s(98),I=s(208);var N=s(210),Y=s(202);const L=Object(a.createContext)(d),U=()=>Object(a.useContext)(L),$=e=>{let{children:t}=e;const{isProcessing:s,isIdle:i,isCalculating:d,hasError:u}=Object(A.b)(),{isEditor:m,getPreviewData:h}=Object(g.a)(),{setValidationErrors:y}=Object(Y.b)(),{createErrorNotice:b,removeNotice:S}=Object(n.useDispatch)("core/notices"),{isSuccessResponse:E,isErrorResponse:v,isFailResponse:U,noticeContexts:$}=Object(O.d)(),[F,q]=Object(a.useReducer)(C.b,{}),{onPaymentProcessing:H}=(e=>Object(a.useMemo)(()=>({onPaymentProcessing:Object(I.a)("payment_processing",e)}),[e]))(q),z=Object(a.useRef)(F);Object(a.useEffect)(()=>{z.current=F},[F]);const[G,B]=Object(a.useReducer)(l,o),{dispatchActions:V,setPaymentStatus:X}=(e=>{const{setBillingAddress:t,setShippingAddress:s}=Object(x.a)();return{dispatchActions:Object(a.useMemo)(()=>({setRegisteredPaymentMethods:t=>{e(T(t))},setRegisteredExpressPaymentMethods:t=>{e(k(t))},setShouldSavePayment:t=>{e(w(t))},setActivePaymentMethod:function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(D(t,s))}}),[e]),setPaymentStatus:Object(a.useCallback)(()=>({pristine:()=>e(f(c.PRISTINE)),started:()=>e(f(c.STARTED)),processing:()=>e(f(c.PROCESSING)),completed:()=>e(f(c.COMPLETE)),error:t=>e(j(t)),failed:function(s,a){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),e(P({errorMessage:s||"",paymentMethodData:a||{}}))},success:function(a){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;r&&t(r),void 0!==typeof n&&null!=n&&n.address&&s(n.address),e(R({paymentMethodData:a}))}}),[e,t,s])}})(B),K=(e=>{const t=Object(p.getPaymentMethods)(),{noticeContexts:s}=Object(O.d)(),a=new Set([...Object(_.getSetting)("paymentGatewaySortOrder",[]),...Object.keys(t)]);return M(e,t,Array.from(a),s.PAYMENTS)})(V.setRegisteredPaymentMethods),W=(e=>{const t=Object(p.getExpressPaymentMethods)(),{noticeContexts:s}=Object(O.d)();return M(e,t,Object.keys(t),s.EXPRESS_PAYMENTS)})(V.setRegisteredExpressPaymentMethods),J=Object(a.useMemo)(()=>m?h("previewSavedPaymentMethods"):K?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===Object.keys(e).length)return{};const t=Object(_.getSetting)("customerPaymentMethods",{}),s=Object.keys(t),a={};return s.forEach(s=>{const r=t[s].filter(t=>{var s;let{method:{gateway:a}}=t;return a in e&&(null===(s=e[a].supports)||void 0===s?void 0:s.showSavedCards)});r.length&&(a[s]=r)}),a}(G.paymentMethods):{},[m,h,K,G.paymentMethods]),Q=Object(a.useCallback)(e=>{e?b(e,{id:"wc-express-payment-error",context:$.EXPRESS_PAYMENTS}):S("wc-express-payment-error",$.EXPRESS_PAYMENTS)},[b,$.EXPRESS_PAYMENTS,S]),Z=Object.keys(G.expressPaymentMethods).includes(G.activePaymentMethod),ee=Object(a.useMemo)(()=>({isPristine:G.currentStatus===c.PRISTINE,isStarted:G.currentStatus===c.STARTED,isProcessing:G.currentStatus===c.PROCESSING,isFinished:[c.ERROR,c.FAILED,c.SUCCESS].includes(G.currentStatus),hasError:G.currentStatus===c.ERROR,hasFailed:G.currentStatus===c.FAILED,isSuccessful:G.currentStatus===c.SUCCESS,isDoingExpressPayment:G.currentStatus!==c.PRISTINE&&Z}),[G.currentStatus,Z]);Object(a.useEffect)(()=>{const e=Object.keys(G.paymentMethods);if(!K||!e.length)return;const t=[...e,...Object.keys(G.expressPaymentMethods)];if(G.activePaymentMethod&&t.includes(G.activePaymentMethod))return;X().pristine();const s=Object.keys(J).flatMap(e=>J[e])[0]||void 0;if(s){const e=s.tokenId.toString(),t=s.method.gateway,a=`wc-${t}-payment-token`;V.setActivePaymentMethod(t,{token:e,payment_method:t,[a]:e,isSavedToken:!0})}else V.setActivePaymentMethod(Object.keys(G.paymentMethods)[0])},[K,G.paymentMethods,G.expressPaymentMethods,V,X,G.activePaymentMethod,J]),Object(a.useEffect)(()=>{!s||u||d||ee.isFinished||X().processing()},[s,u,d,ee.isFinished,X]),Object(a.useEffect)(()=>{i&&!ee.isSuccessful&&X().pristine()},[i,ee.isSuccessful,X]),Object(a.useEffect)(()=>{u&&ee.isSuccessful&&X().pristine()},[u,ee.isSuccessful,X]),Object(a.useEffect)(()=>{ee.isProcessing&&(S("wc-payment-error",$.PAYMENTS),Object(N.b)(z.current,"payment_processing",{}).then(e=>{let t,s;var a,r,n,c,i,o;if(e.forEach(e=>{E(e)&&(t=e),(v(e)||U(e))&&(s=e)}),t&&!s)X().success(null===(a=t)||void 0===a||null===(r=a.meta)||void 0===r?void 0:r.paymentMethodData,null===(n=t)||void 0===n||null===(c=n.meta)||void 0===c?void 0:c.billingAddress,null===(i=t)||void 0===i||null===(o=i.meta)||void 0===o?void 0:o.shippingData);else if(s&&U(s)){var d,l,u,p,m,_;s.message&&s.message.length&&b(s.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(_=s)||void 0===_?void 0:_.messageContext)||$.PAYMENTS}),X().failed(null===(d=s)||void 0===d?void 0:d.message,null===(l=s)||void 0===l||null===(u=l.meta)||void 0===u?void 0:u.paymentMethodData,null===(p=s)||void 0===p||null===(m=p.meta)||void 0===m?void 0:m.billingAddress)}else if(s){var h,g;s.message&&s.message.length&&b(s.message,{id:"wc-payment-error",isDismissible:!1,context:(null===(g=s)||void 0===g?void 0:g.messageContext)||$.PAYMENTS}),X().error(s.message),y(null===(h=s)||void 0===h?void 0:h.validationErrors)}else X().success()}))},[ee.isProcessing,y,X,S,$.PAYMENTS,E,U,v,b]);const te="object"==typeof G.paymentMethodData&&Object(r.b)(G.paymentMethodData,"token")?G.paymentMethodData.token+"":"",se={setPaymentStatus:X,currentStatus:ee,paymentStatuses:c,paymentMethodData:G.paymentMethodData,errorMessage:G.errorMessage,activePaymentMethod:G.activePaymentMethod,activeSavedToken:te,setActivePaymentMethod:V.setActivePaymentMethod,onPaymentProcessing:H,customerPaymentMethods:J,paymentMethods:G.paymentMethods,expressPaymentMethods:G.expressPaymentMethods,paymentMethodsInitialized:K,expressPaymentMethodsInitialized:W,setExpressPaymentError:Q,isExpressPaymentMethodActive:Z,shouldSavePayment:G.shouldSavePaymentMethod,setShouldSavePayment:V.setShouldSavePayment};return Object(a.createElement)(L.Provider,{value:se},t)}},269:function(e,t,s){"use strict";var a=s(12),r=s.n(a),n=s(0),c=s(42),i=s(4),o=s.n(i),d=s(138);s(270),t.a=e=>{let{className:t,showSpinner:s=!1,children:a,variant:i="contained",...l}=e;const u=o()("wc-block-components-button",t,i,{"wc-block-components-button--loading":s});return Object(n.createElement)(c.a,r()({className:u},l),s&&Object(n.createElement)(d.a,null),Object(n.createElement)("span",{className:"wc-block-components-button__text"},a))}},270:function(e,t){},279:function(e,t){},282:function(e,t,s){"use strict";s.d(t,"b",(function(){return c})),s.d(t,"a",(function(){return i}));var a=s(31),r=s(211);const n=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{paymentMethods:t,expressPaymentMethods:s,paymentMethodsInitialized:n,expressPaymentMethodsInitialized:c}=Object(r.b)(),i=Object(a.a)(t),o=Object(a.a)(s);return{paymentMethods:e?o:i,isInitialized:e?c:n}},c=()=>n(!1),i=()=>n(!0)},284:function(e,t,s){"use strict";var a=s(12),r=s.n(a),n=s(0),c=s(4),i=s.n(c);const o=e=>"wc-block-components-payment-method-icon wc-block-components-payment-method-icon--"+e;var d=e=>{let{id:t,src:s=null,alt:a=""}=e;return s?Object(n.createElement)("img",{className:o(t),src:s,alt:a}):null},l=s(47);const u=[{id:"alipay",alt:"Alipay",src:l.l+"payment-methods/alipay.svg"},{id:"amex",alt:"American Express",src:l.l+"payment-methods/amex.svg"},{id:"bancontact",alt:"Bancontact",src:l.l+"payment-methods/bancontact.svg"},{id:"diners",alt:"Diners Club",src:l.l+"payment-methods/diners.svg"},{id:"discover",alt:"Discover",src:l.l+"payment-methods/discover.svg"},{id:"eps",alt:"EPS",src:l.l+"payment-methods/eps.svg"},{id:"giropay",alt:"Giropay",src:l.l+"payment-methods/giropay.svg"},{id:"ideal",alt:"iDeal",src:l.l+"payment-methods/ideal.svg"},{id:"jcb",alt:"JCB",src:l.l+"payment-methods/jcb.svg"},{id:"laser",alt:"Laser",src:l.l+"payment-methods/laser.svg"},{id:"maestro",alt:"Maestro",src:l.l+"payment-methods/maestro.svg"},{id:"mastercard",alt:"Mastercard",src:l.l+"payment-methods/mastercard.svg"},{id:"multibanco",alt:"Multibanco",src:l.l+"payment-methods/multibanco.svg"},{id:"p24",alt:"Przelewy24",src:l.l+"payment-methods/p24.svg"},{id:"sepa",alt:"Sepa",src:l.l+"payment-methods/sepa.svg"},{id:"sofort",alt:"Sofort",src:l.l+"payment-methods/sofort.svg"},{id:"unionpay",alt:"Union Pay",src:l.l+"payment-methods/unionpay.svg"},{id:"visa",alt:"Visa",src:l.l+"payment-methods/visa.svg"},{id:"wechat",alt:"WeChat",src:l.l+"payment-methods/wechat.svg"}];var p=s(49);s(279),t.a=e=>{let{icons:t=[],align:s="center",className:a}=e;const c=(e=>{const t={};return e.forEach(e=>{let s={};"string"==typeof e&&(s={id:e,alt:e,src:null}),"object"==typeof e&&(s={id:e.id||"",alt:e.alt||"",src:e.src||null}),s.id&&Object(p.a)(s.id)&&!t[s.id]&&(t[s.id]=s)}),Object.values(t)})(t);if(0===c.length)return null;const o=i()("wc-block-components-payment-method-icons",{"wc-block-components-payment-method-icons--align-left":"left"===s,"wc-block-components-payment-method-icons--align-right":"right"===s},a);return Object(n.createElement)("div",{className:o},c.map(e=>{const t={...e,...(s=e.id,u.find(e=>e.id===s)||{})};var s;return Object(n.createElement)(d,r()({key:"payment-method-icon-"+e.id},t))}))}},31:function(e,t,s){"use strict";s.d(t,"a",(function(){return c}));var a=s(0),r=s(11),n=s.n(r);function c(e){const t=Object(a.useRef)(e);return n()(e,t.current)||(t.current=e),t.current}},382:function(e,t,s){"use strict";s.d(t,"a",(function(){return a}));const a=e=>Object.values(e).reduce((e,t)=>(null!==t.icons&&(e=e.concat(t.icons)),e),[])},431:function(e,t,s){"use strict";s.r(t);var a=s(0),r=s(1),n=s(9),c=s(41),i=s(282),o=s(32),d=s(284),l=s(382),u=s(2),p=s(47),m=s(269),_=s(211),h=s(4),y=s.n(h);const b=()=>{const{paymentMethods:e}=Object(i.b)();return Object(a.createElement)(d.a,{icons:Object(l.a)(e)})};t.default=e=>{let{className:t}=e;const{cartTotals:s}=Object(o.a)(),i=Object(u.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(s.total_items,10)+parseInt(s.total_items_tax,10):parseInt(s.total_items,10);return Object(a.createElement)("div",{className:y()(t,"wc-block-mini-cart__footer")},Object(a.createElement)(n.TotalsItem,{className:"wc-block-mini-cart__footer-subtotal",currency:Object(c.getCurrencyFromPriceResponse)(s),label:Object(r.__)("Subtotal","woocommerce"),value:i,description:Object(r.__)("Shipping, taxes, and discounts calculated at checkout.","woocommerce")}),Object(a.createElement)("div",{className:"wc-block-mini-cart__footer-actions"},p.c&&Object(a.createElement)(m.a,{className:"wc-block-mini-cart__footer-cart",href:p.c,variant:"outlined"},Object(r.__)("View my cart","woocommerce")),p.d&&Object(a.createElement)(m.a,{className:"wc-block-mini-cart__footer-checkout",href:p.d},Object(r.__)("Go to checkout","woocommerce"))),Object(a.createElement)(_.a,null,Object(a.createElement)(b,null)))}},50:function(e,t,s){"use strict";s.d(t,"b",(function(){return c})),s.d(t,"a",(function(){return i}));var a=s(0),r=s(68);const n=Object(a.createContext)({isInitialized:!1,billingAddress:{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:""},setBillingAddress:()=>{},setShippingAddress:()=>{}}),c=()=>Object(a.useContext)(n),i=e=>{let{children:t}=e;const s=Object(r.a)();return Object(a.createElement)(n.Provider,{value:s},t)}},67:function(e,t,s){"use strict";s.d(t,"a",(function(){return y}));var a=s(6),r=s(7),n=s(0),c=s(11),i=s.n(c),o=s(19),d=s(1),l=s(47),u=s(2);const p=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:Object(d.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:Object(d._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:Object(d._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(d.__)("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(d.__)("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}]}],m=Object(u.getSetting)("displayCartPricesIncludingTax",!1),_={coupons:[],shipping_rates:Object(u.getSetting)("shippingMethodsExist",!1)?p:[],items:[{key:"1",id:1,quantity:2,name:Object(d.__)("Beanie","woocommerce"),short_description:Object(d.__)("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:l.l+"previews/beanie.jpg",thumbnail:l.l+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(d.__)("Color","woocommerce"),value:Object(d.__)("Yellow","woocommerce")},{attribute:Object(d.__)("Size","woocommerce"),value:Object(d.__)("Small","woocommerce")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"12000":"10000",regular_price:m?"12000":"10000",sale_price:m?"12000":"10000",raw_prices:{precision:6,price:m?"12000000":"10000000",regular_price:m?"12000000":"10000000",sale_price:m?"12000000":"10000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}},{key:"2",id:2,quantity:1,name:Object(d.__)("Cap","woocommerce"),short_description:Object(d.__)("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:l.l+"previews/cap.jpg",thumbnail:l.l+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:Object(d.__)("Color","woocommerce"),value:Object(d.__)("Orange","woocommerce")}],prices:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",price:m?"2400":"2000",regular_price:m?"2400":"2000",sale_price:m?"2400":"2000",raw_prices:{precision:6,price:m?"24000000":"20000000",regular_price:m?"24000000":"20000000",sale_price:m?"24000000":"20000000"}},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",line_subtotal:"2000",line_subtotal_tax:"400",line_total:"2000",line_total_tax:"400"},extensions:{}}],fees:[{id:"fee",name:Object(d.__)("Fee","woocommerce"),totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total:"100",total_tax:"20",tax_lines:[{name:Object(d.__)("Sales tax","woocommerce"),rate:"20%",price:"20"}]}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:Object(u.getSetting)("shippingEnabled",!0),has_calculated_shipping:!0,shipping_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},billing_address:{first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",email:"",phone:""},totals:{currency_code:"USD",currency_symbol:"$",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"$",currency_suffix:"",total_items:"4000",total_items_tax:"800",total_fees:"100",total_fees_tax:"20",total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:"820",total_price:"4920",tax_lines:[{name:Object(d.__)("Sales tax","woocommerce"),rate:"20%",price:"820"}]},errors:[],payment_requirements:["products"],extensions:{}};var h=s(70);const y=()=>{const{shippingRates:e,needsShipping:t,hasCalculatedShipping:s,isLoadingRates:c}=Object(r.useSelect)(e=>{const t=!!e("core/editor"),s=e(a.CART_STORE_KEY);return{shippingRates:t?_.shipping_rates:s.getShippingRates(),needsShipping:t?_.needs_shipping:s.getNeedsShipping(),hasCalculatedShipping:t?_.has_calculated_shipping:s.getHasCalculatedShipping(),isLoadingRates:!t&&s.isCustomerDataUpdating()}}),{isSelectingRate:d,selectShippingRate:l}=Object(h.a)(),u=Object(n.useRef)({});return Object(n.useEffect)(()=>{const t=(e=>Object.fromEntries(e.map(e=>{var t;let{package_id:s,shipping_rates:a}=e;return[s,null===(t=a.find(e=>e.selected))||void 0===t?void 0:t.rate_id]})))(e);Object(o.a)(t)&&!i()(u.current,t)&&(u.current=t)},[e]),{isSelectingRate:d,selectedRates:u.current,selectShippingRate:l,shippingRates:e,needsShipping:t,hasCalculatedShipping:s,isLoadingRates:c}}},68:function(e,t,s){"use strict";s.d(t,"a",(function(){return n}));var a=s(7),r=s(6);const n=()=>{const{customerData:e,isInitialized:t}=Object(a.useSelect)(e=>{const t=e(r.CART_STORE_KEY);return{customerData:t.getCustomerData(),isInitialized:t.hasFinishedResolution("getCartData")}}),{setShippingAddress:s,setBillingAddress:n}=Object(a.useDispatch)(r.CART_STORE_KEY);return{isInitialized:t,billingAddress:e.billingAddress,shippingAddress:e.shippingAddress,setBillingAddress:n,setShippingAddress:s}}},70:function(e,t,s){"use strict";s.d(t,"a",(function(){return o}));var a=s(7),r=s(0),n=s(6),c=s(75),i=s(59);const o=()=>{const e=Object(c.a)(),{dispatchCheckoutEvent:t}=Object(i.a)(),{selectShippingRate:s}=Object(a.useDispatch)(n.CART_STORE_KEY);return{selectShippingRate:Object(r.useCallback)((a,r)=>{s(a,r).then(()=>{t("set-selected-shipping-rate",{shippingRateId:a})}).catch(t=>{e(t)})},[s,t,e]),isSelectingRate:Object(a.useSelect)(e=>e(n.CART_STORE_KEY).isShippingRateBeingSelected(),[])}}},75:function(e,t,s){"use strict";s.d(t,"a",(function(){return r}));var a=s(0);const r=()=>{const[,e]=Object(a.useState)();return Object(a.useCallback)(t=>{e(()=>{throw t})},[])}}}]);