geno/wp-content/plugins/woocommerce/packages/woocommerce-blocks/build/cart-frontend.js

2 lines
99 KiB
JavaScript
Raw Normal View History

2024-02-01 17:24:18 +05:30
(()=>{var e,t,r={1984:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var o=r(9307);const n=(0,o.forwardRef)((function({icon:e,size:t=24,...r},n){return(0,o.cloneElement)(e,{width:t,height:t,...r,ref:n})}))},3340:(e,t,r)=>{"use strict";r.d(t,{Z:()=>u});var o=r(4617),n=r(5736),s=r(1478),a=r(2646),i=r(5271);const c=e=>{const 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=(0,n.sprintf)(/* translators: %s Field label. */
(0,n.__)("%s (optional)","woocommerce"),e.label)),e.priority&&((0,s.h)(e.priority)&&(t.index=e.priority),(0,a.H)(e.priority)&&(t.index=parseInt(e.priority,10))),e.hidden&&(t.required=!1),t},l=Object.entries(i.vr).map((([e,t])=>[e,Object.entries(t).map((([e,t])=>[e,c(t)])).reduce(((e,[t,r])=>(e[t]=r,e)),{})])).reduce(((e,[t,r])=>(e[t]=r,e)),{}),u=(e,t,r="")=>{const n=r&&void 0!==l[r]?l[r]:{};return e.map((e=>({key:e,...o.defaultAddressFields[e]||{},...n[e]||{},...t[e]||{}}))).sort(((e,t)=>e.index-t.index))}},1193:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var o=r(9196),n=r(5736),s=r(4184),a=r.n(s),i=r(711);r(6575);const c=({children:e,className:t,screenReaderLabel:r,showSpinner:s=!1,isLoading:c=!0})=>(0,o.createElement)("div",{className:a()(t,{"wc-block-components-loading-mask":c})},c&&s&&(0,o.createElement)(i.Spinner,null),(0,o.createElement)("div",{className:a()({"wc-block-components-loading-mask__children":c}),"aria-hidden":c},e),c&&(0,o.createElement)("span",{className:"screen-reader-text"},r||(0,n.__)("Loading…","woocommerce")))},5577:(e,t,r)=>{"use strict";r.d(t,{m:()=>n});var o=r(9638);const n=(e,t)=>(r,n=10)=>{const s=o.Nw.addEventCallback(e,r,n);return t(s),()=>{t(o.Nw.removeEventCallback(e,s.id))}}},5017:(e,t,r)=>{"use strict";r.d(t,{K:()=>s,P:()=>a});var o=r(6423),n=r(7755);const s=async(e,t,r)=>{const n=(0,o.Xj)(e,t),s=[];for(const e of n)try{const t=await Promise.resolve(e.callback(r));"object"==typeof t&&s.push(t)}catch(e){console.error(e)}return!s.length||s},a=async(e,t,r)=>{const s=[],a=(0,o.Xj)(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(r));if(!(0,n.X)(t))continue;if(!t.hasOwnProperty("type"))throw new Error("Returned objects from event emitter observers must return an object with a type property");if((0,o.qm)(t)||(0,o.x$)(t))return s.push(t),s;s.push(t)}catch(e){return console.error(e),s.push({type:o.dO.ERROR}),s}return s}},9638:(e,t,r)=>{"use strict";r.d(t,{I6:()=>a,Nw:()=>n});var o=r(5400);const n={addEventCallback:(e,t,r=10)=>({id:Math.floor(Math.random()*Date.now()).toString(),type:o.o.ADD_EVENT_CALLBACK,eventType:e,callback:t,priority:r}),removeEventCallback:(e,t)=>({id:t,type:o.o.REMOVE_EVENT_CALLBACK,eventType:e})},s={},a=(e=s,{type:t,eventType:r,id:n,callback:a,priority:i})=>{const c=e.hasOwnProperty(r)?new Map(e[r]):new Map;switch(t){case o.o.ADD_EVENT_CALLBACK:return c.set(n,{priority:i,callback:a}),{...e,[r]:c};case o.o.REMOVE_EVENT_CALLBACK:return c.delete(n),{...e,[r]:c}}}},5400:(e,t,r)=>{"use strict";r.d(t,{o:()=>o});let o=function(e){return e.ADD_EVENT_CALLBACK="add_event_callback",e.REMOVE_EVENT_CALLBACK="remove_event_callback",e}({})},6423:(e,t,r)=>{"use strict";r.d(t,{Xj:()=>n,dO:()=>s,n7:()=>a,qm:()=>c,x$:()=>l});var o=r(7884);const n=(e,t)=>e[t]?Array.from(e[t].values()).sort(((e,t)=>e.priority-t.priority)):[];let s=function(e){return e.SUCCESS="success",e.FAIL="failure",e.ERROR="error",e}({}),a=function(e){return e.CART="wc/cart",e.CHECKOUT="wc/checkout",e.PAYMENTS="wc/checkout/payments",e.EXPRESS_PAYMENTS="wc/checkout/express-payments",e.CONTACT_INFORMATION="wc/checkout/contact-information",e.SHIPPING_ADDRESS="wc/checkout/shipping-address",e.BILLING_ADDRESS="wc/checkout/billing-address",e.SHIPPING_METHODS="wc/checkout/shipping-methods",e.CHECKOUT_ACTIONS="wc/checkout/checkout-actions",e}({});const i=(e,t)=>(0,o.Kn)(e)&&"type"in e&&e.type===t,c=e=>i(e,s.ERROR),l=e=>i(e,s.FAIL)},4055:(e,t,r)=>{"use strict";r.d(t,{b:()=>k});var o=r(2991),n=r.n(o),s=r(9307),a=r(4801),i=r(9818),c=r(2629),l=r(3881),u=r(8832);var p=r(9456);const d=e=>{const t=null==e?void 0:e.detail;t&&t.preserveCartData||(0,i.dispatch)(a.CART_STORE_KEY).invalidateResolutionForStore()},m=e=>{(null!=e&&e.persisted||"back_forward"===(window.performance&&window.performance.getEntriesByType("navigation").length?window.performance.getEntriesByType("navigation")[0].type:""))&&(0,i.dispatch)(a.CART_STORE_KEY).invalidateResolutionForStore()},h=()=>{1===window.wcBlocksStoreCartListeners.count&&window.wcBlocksStoreCartListeners.remove(),window.wcBlocksStoreCartListeners.count--},f={first_name:"",last_name:"",