Файловый менеджер - Редактировать - /home/harasnat/www/horse/wp-content/plugins/woocommerce/assets/client/blocks/wc-blocks-data.js
Назад
(()=>{"use strict";var e={290:(e,t,r)=>{r.d(t,{isBoolean:()=>s,isObject:()=>a,isString:()=>n,objectHasProp:()=>i});const s=e=>"boolean"==typeof e,a=e=>!(e=>null===e)(e)&&e instanceof Object&&e.constructor===Object;function i(e,t){return a(e)&&t in e}r(2063);const n=e=>"string"==typeof e;r(1089)},2063:(e,t,r)=>{r.d(t,{mW:()=>a});var s=r(290);const a=e=>(0,s.isObject)(e)&&(0,s.objectHasProp)(e,"type")},1089:(e,t,r)=>{r.d(t,{Y:()=>a});var s=r(290);const a=e=>(0,s.isObject)(e)&&Object.entries(e).every((([e,t])=>{return(0,s.isString)(e)&&(r=t,(0,s.isObject)(r)&&(0,s.objectHasProp)(r,"message")&&(0,s.objectHasProp)(r,"hidden")&&(0,s.isString)(r.message)&&(0,s.isBoolean)(r.hidden));var r}))},254:e=>{var t,r=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=function(e){if(!(!e||!1!==e.batch))return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}(t),this._batchScheduleFn=function(e){var t=e&&e.batchScheduleFn;if(void 0===t)return s;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}(t),this._cacheKeyFn=function(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}(t),this._cacheMap=function(e){if(!(!e||!1!==e.cache))return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}(t),this._batch=null,this.name=function(e){return e&&e.name?e.name:null}(t)}var t=e.prototype;return t.load=function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value, but got: "+String(e)+".");var t=function(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length<e._maxBatchSize)return t;var r={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=r,e._batchScheduleFn((function(){!function(e,t){if(t.hasDispatched=!0,0!==t.keys.length){var r;try{r=e._batchLoadFn(t.keys)}catch(r){return a(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function errored synchronously: "+String(r)+"."))}if(!r||"function"!=typeof r.then)return a(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!n(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));i(t);for(var r=0;r<t.callbacks.length;r++){var s=e[r];s instanceof Error?t.callbacks[r].reject(s):t.callbacks[r].resolve(s)}})).catch((function(r){a(e,t,r)}))}else i(t)}(e,r)})),r}(this),r=this._cacheMap,s=this._cacheKeyFn(e);if(r){var o=r.get(s);if(o){var c=t.cacheHits||(t.cacheHits=[]);return new Promise((function(e){c.push((function(){e(o)}))}))}}t.keys.push(e);var d=new Promise((function(e,r){t.callbacks.push({resolve:e,reject:r})}));return r&&r.set(s,d),d},t.loadMany=function(e){if(!n(e))throw new TypeError("The loader.loadMany() function must be called with Array<key> but got: "+e+".");for(var t=[],r=0;r<e.length;r++)t.push(this.load(e[r]).catch((function(e){return e})));return Promise.all(t)},t.clear=function(e){var t=this._cacheMap;if(t){var r=this._cacheKeyFn(e);t.delete(r)}return this},t.clearAll=function(){var e=this._cacheMap;return e&&e.clear(),this},t.prime=function(e,t){var r=this._cacheMap;if(r){var s,a=this._cacheKeyFn(e);void 0===r.get(a)&&(t instanceof Error?(s=Promise.reject(t)).catch((function(){})):s=Promise.resolve(t),r.set(a,s))}return this},e}(),s="object"==typeof process&&"function"==typeof process.nextTick?function(e){t||(t=Promise.resolve()),t.then((function(){process.nextTick(e)}))}:"function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e)};function a(e,t,r){i(t);for(var s=0;s<t.keys.length;s++)e.clear(t.keys[s]),t.callbacks[s].reject(r)}function i(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function n(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&(0===e.length||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}e.exports=r}},t={};function r(s){var a=t[s];if(void 0!==a)return a.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s={};r.r(s),r.d(s,{API_BLOCK_NAMESPACE:()=>G,CART_STORE_KEY:()=>Sa,CHECKOUT_STORE_KEY:()=>qi,COLLECTIONS_STORE_KEY:()=>En,CheckoutPutAbortController:()=>ci,EMPTY_CART_COUPONS:()=>V,EMPTY_CART_CROSS_SELLS:()=>q,EMPTY_CART_ERRORS:()=>Q,EMPTY_CART_FEES:()=>z,EMPTY_CART_ITEMS:()=>B,EMPTY_CART_ITEM_ERRORS:()=>K,EMPTY_EXTENSIONS:()=>Z,EMPTY_PAYMENT_METHODS:()=>X,EMPTY_PAYMENT_REQUIREMENTS:()=>$,EMPTY_SHIPPING_RATES:()=>W,EMPTY_TAX_LINES:()=>J,PAYMENT_STORE_KEY:()=>la,QUERY_STATE_STORE_KEY:()=>fn,SCHEMA_STORE_KEY:()=>xn,STORE_NOTICES_STORE_KEY:()=>Bn,VALIDATION_STORE_KEY:()=>ra,cartStore:()=>ha,checkoutStore:()=>Bi,clearCheckoutPutRequests:()=>di,collectionsStore:()=>mn,getErrorDetails:()=>We,getInvalidParamNoticeContext:()=>Je,getNoticeContextFromErrorResponse:()=>et,hasInState:()=>Wi,isEditor:()=>It,paymentStore:()=>ua,processErrorResponse:()=>tt,queryStateStore:()=>Cn,schemaStore:()=>kn,storeNoticesStore:()=>Vn,updateState:()=>pn,validationStore:()=>ta});var a={};r.r(a),r.d(a,{getCartData:()=>se,getCartErrors:()=>le,getCartItem:()=>he,getCartMeta:()=>de,getCartTotals:()=>ce,getCouponBeingApplied:()=>_e,getCouponBeingRemoved:()=>Ee,getCustomerData:()=>ae,getHasCalculatedShipping:()=>oe,getItemsPendingDelete:()=>Re,getItemsPendingQuantityUpdate:()=>Te,getNeedsShipping:()=>ne,getProductsPendingAdd:()=>Ie,getShippingRates:()=>ie,hasPendingItemsOperations:()=>Ce,isAddressFieldsForShippingRatesUpdating:()=>Ae,isApplyingCoupon:()=>pe,isCartDataStale:()=>ue,isCustomerDataUpdating:()=>Se,isItemPendingDelete:()=>ye,isItemPendingQuantity:()=>ge,isRemovingCoupon:()=>me,isShippingRateBeingSelected:()=>Pe});var i={};r.r(i),r.d(i,{addItemToCart:()=>Mt,applyCoupon:()=>wt,applyExtensionCartUpdate:()=>bt,changeCartItemQuantity:()=>Lt,finishAddingToCart:()=>kt,itemIsPendingDelete:()=>zt,itemIsPendingQuantity:()=>qt,receiveApplyingCoupon:()=>Gt,receiveCart:()=>Ct,receiveCartContents:()=>ft,receiveCartItem:()=>Bt,receiveError:()=>vt,receiveRemovingCoupon:()=>Vt,removeCoupon:()=>Ot,removeItemFromCart:()=>xt,selectShippingRate:()=>Ut,setBillingAddress:()=>$t,setCartData:()=>Ft,setErrorData:()=>Yt,setIsCartDataStale:()=>Kt,setProductsPendingAdd:()=>Jt,setShippingAddress:()=>Zt,shippingRatesBeingSelected:()=>Xt,startAddingToCart:()=>Nt,syncCartWithIAPIStore:()=>Dt,updateCustomerData:()=>jt,updatingAddressFieldsForShippingRates:()=>Wt,updatingCustomerData:()=>Qt});var n={};r.r(n),r.d(n,{getCartData:()=>lr,getCartTotals:()=>pr});var o={};r.r(o),r.d(o,{__internalEmitPaymentProcessingEvent:()=>Qr,__internalRemoveAvailableExpressPaymentMethod:()=>ls,__internalRemoveAvailablePaymentMethod:()=>ds,__internalSetActivePaymentMethod:()=>ss,__internalSetAvailableExpressPaymentMethods:()=>os,__internalSetAvailablePaymentMethods:()=>ns,__internalSetExpressPaymentError:()=>Kr,__internalSetExpressPaymentMethodsInitialized:()=>ts,__internalSetExpressPaymentStarted:()=>Xr,__internalSetPaymentError:()=>Zr,__internalSetPaymentIdle:()=>Wr,__internalSetPaymentMethodData:()=>as,__internalSetPaymentMethodsInitialized:()=>es,__internalSetPaymentProcessing:()=>$r,__internalSetPaymentReady:()=>Jr,__internalSetPaymentResult:()=>is,__internalSetRegisteredExpressPaymentMethods:()=>cs,__internalSetShouldSavePaymentMethod:()=>rs,__internalUpdateAvailablePaymentMethods:()=>ps});var c={};r.r(c),r.d(c,{expressPaymentMethodsInitialized:()=>Ns,getActivePaymentMethod:()=>Is,getActiveSavedPaymentMethods:()=>Os,getActiveSavedToken:()=>Rs,getAvailableExpressPaymentMethods:()=>fs,getAvailablePaymentMethods:()=>Cs,getCurrentStatus:()=>ks,getIncompatiblePaymentMethods:()=>Ds,getPaymentMethodData:()=>bs,getPaymentResult:()=>Ls,getRegisteredExpressPaymentMethods:()=>vs,getSavedPaymentMethods:()=>ws,getShouldSavePaymentMethod:()=>xs,getState:()=>Hs,hasPaymentError:()=>As,isExpressPaymentMethodActive:()=>Ts,isExpressPaymentStarted:()=>hs,isPaymentFailed:()=>Ps,isPaymentIdle:()=>ms,isPaymentPristine:()=>_s,isPaymentProcessing:()=>gs,isPaymentReady:()=>ys,isPaymentStarted:()=>Es,isPaymentSuccess:()=>Ss,paymentMethodsInitialized:()=>Ms});var d={};r.r(d),r.d(d,{clearAllValidationErrors:()=>zs,clearValidationError:()=>Ks,clearValidationErrors:()=>qs,hideValidationError:()=>Qs,setValidationErrors:()=>Bs,showAllValidationErrors:()=>Xs,showValidationError:()=>Ws});var l={};r.r(l),r.d(l,{getValidationError:()=>$s,getValidationErrorId:()=>Zs,hasValidationErrors:()=>Js});var p={};r.r(p),r.d(p,{getAdditionalFields:()=>Oa,getCheckoutStatus:()=>Ma,getCustomerId:()=>Pa,getCustomerPassword:()=>Ta,getEditingBillingAddress:()=>va,getEditingShippingAddress:()=>ba,getExtensionData:()=>Da,getOrderId:()=>Ra,getOrderNotes:()=>Ia,getRedirectUrl:()=>Ca,getShouldCreateAccount:()=>wa,getUseShippingAsBilling:()=>fa,hasError:()=>Na,hasOrder:()=>ka,isAfterProcessing:()=>Ua,isBeforeProcessing:()=>Ha,isCalculating:()=>Fa,isComplete:()=>xa,isIdle:()=>La,isProcessing:()=>ja,prefersCollection:()=>Ya});var u={};r.r(u),r.d(u,{__internalDecrementCalculating:()=>Ci,__internalEmitAfterProcessingEvents:()=>ui,__internalEmitValidateEvent:()=>pi,__internalFinishCalculation:()=>Ri,__internalIncrementCalculating:()=>Ii,__internalProcessCheckoutResponse:()=>li,__internalSetAfterProcessing:()=>yi,__internalSetBeforeProcessing:()=>hi,__internalSetComplete:()=>Si,__internalSetCustomerId:()=>fi,__internalSetCustomerPassword:()=>vi,__internalSetExtensionData:()=>Li,__internalSetHasError:()=>Pi,__internalSetIdle:()=>Ei,__internalSetOrderNotes:()=>Ni,__internalSetProcessing:()=>gi,__internalSetRedirectUrl:()=>Ai,__internalSetShouldCreateAccount:()=>Oi,__internalSetUseShippingAsBilling:()=>bi,__internalStartCalculation:()=>Ti,disableCheckoutFor:()=>mi,setAdditionalFields:()=>Mi,setEditingBillingAddress:()=>Di,setEditingShippingAddress:()=>wi,setExtensionData:()=>xi,setPrefersCollection:()=>ki,updateDraftOrder:()=>_i});var _={};r.r(_),r.d(_,{getCollection:()=>$i,getCollectionError:()=>Zi,getCollectionHeader:()=>Ji,getCollectionLastModified:()=>en});var m={};r.r(m),r.d(m,{receiveCollection:()=>sn,receiveCollectionError:()=>an,receiveLastModified:()=>nn});var E={};r.r(E),r.d(E,{getCollection:()=>cn,getCollectionHeader:()=>dn});var h={};r.r(h),r.d(h,{getValueForQueryContext:()=>Sn,getValueForQueryKey:()=>yn});var g={};r.r(g),r.d(g,{setQueryValue:()=>Tn,setValueForQueryContext:()=>Rn});var y={};r.r(y),r.d(y,{getRoute:()=>vn,getRoutes:()=>bn});var S={};r.r(S),r.d(S,{receiveRoutes:()=>wn});var A={};r.r(A),r.d(A,{getRoute:()=>On,getRoutes:()=>Mn});var P={};r.r(P),r.d(P,{registerContainer:()=>Hn,unregisterContainer:()=>Un});var T={};r.r(T),r.d(T,{getRegisteredContainers:()=>jn});const R=window.wp.notices,I=window.wp.data,C=window.wp.dataControls,f=window.wp.i18n,v="wc/store/cart",b={code:"cart_api_error",message:(0,f.__)("Unable to get cart data from the API.","woocommerce"),data:{status:500}},D=window.wc.wcSettings,w=(0,D.getSetting)("wcBlocksConfig",{pluginUrl:"",productCount:0,defaultAvatar:"",restApiRoutes:{},wordCountType:"words"}),O=w.pluginUrl+"assets/images/",M=(w.pluginUrl,D.STORE_PAGES.shop,D.STORE_PAGES.checkout,D.STORE_PAGES.checkout,D.STORE_PAGES.privacy,D.STORE_PAGES.privacy,D.STORE_PAGES.terms,D.STORE_PAGES.terms,D.STORE_PAGES.cart,D.STORE_PAGES.cart,D.STORE_PAGES.myaccount?.permalink?D.STORE_PAGES.myaccount.permalink:(0,D.getSetting)("wpLoginUrl","/wp-login.php"),(0,D.getSetting)("localPickupEnabled",!1)),N=((0,D.getSetting)("shippingMethodsExist",!1),(0,D.getSetting)("shippingEnabled",!0)),k=(0,D.getSetting)("countries",{}),x=(0,D.getSetting)("countryData",{}),L={...Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowBilling)).map((e=>[e,k[e]||""]))),...Object.fromEntries(Object.keys(x).filter((e=>!0===x[e].allowShipping)).map((e=>[e,k[e]||""])))},H=(Object.fromEntries(Object.keys(L).map((e=>[e,x[e].states||{}]))),Object.fromEntries(Object.keys(L).map((e=>[e,x[e].locale||{}])))),U={address:["first_name","last_name","company","address_1","address_2","city","postcode","country","state","phone"],contact:["email"],order:[]},j=(0,D.getSetting)("addressFieldsLocations",U).address,F=(0,D.getSetting)("addressFieldsLocations",U).contact,Y=(0,D.getSetting)("addressFieldsLocations",U).order,G=((0,D.getSetting)("additionalOrderFields",{}),(0,D.getSetting)("additionalContactFields",{}),(0,D.getSetting)("additionalAddressFields",{}),"wc/blocks"),V=[],B=[],q=[],z=[],K=[],Q=[],W=[],X=[],$=[],Z={},J=[],ee={};j.forEach((e=>{ee[e]=""}));const te={};j.forEach((e=>{te[e]=""})),te.email="";const re={cartItemsPendingQuantity:[],cartItemsPendingDelete:[],productsPendingAdd:[],cartData:{coupons:V,shippingRates:W,shippingAddress:ee,billingAddress:te,items:B,itemsCount:0,itemsWeight:0,crossSells:q,needsShipping:!0,needsPayment:!1,hasCalculatedShipping:!0,fees:z,totals:{currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:".",currency_thousand_separator:",",currency_prefix:"",currency_suffix:"",total_items:"0",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_price:"0",total_tax:"0",tax_lines:J},errors:K,paymentMethods:X,paymentRequirements:$,extensions:Z},metaData:{updatingCustomerData:!1,updatingAddressFieldsForShippingRates:!1,updatingSelectedRate:!1,applyingCoupon:"",removingCoupon:"",isCartDataStale:!1},errors:Q},se=e=>e.cartData,ae=(0,I.createSelector)((e=>({shippingAddress:e.cartData.shippingAddress,billingAddress:e.cartData.billingAddress}))),ie=e=>e.cartData.shippingRates,ne=e=>e.cartData.needsShipping,oe=e=>e.cartData.hasCalculatedShipping,ce=e=>e.cartData.totals||re.cartData.totals,de=e=>e.metaData||re.metaData,le=e=>e.errors,pe=e=>!!e.metaData.applyingCoupon,ue=e=>e.metaData.isCartDataStale,_e=e=>e.metaData.applyingCoupon||"",me=e=>!!e.metaData.removingCoupon,Ee=e=>e.metaData.removingCoupon||"",he=(e,t)=>e.cartData.items.find((e=>e.key===t)),ge=(e,t)=>e.cartItemsPendingQuantity.includes(t),ye=(e,t)=>e.cartItemsPendingDelete.includes(t),Se=e=>!!e.metaData.updatingCustomerData,Ae=e=>!!e.metaData.updatingAddressFieldsForShippingRates,Pe=e=>!!e.metaData.updatingSelectedRate,Te=e=>e.cartItemsPendingQuantity,Re=e=>e.cartItemsPendingDelete,Ie=e=>e.productsPendingAdd,Ce=e=>e.productsPendingAdd.length>0||e.cartItemsPendingQuantity.length>0||e.cartItemsPendingDelete.length>0,fe={SET_CART_DATA:"SET_CART_DATA",SET_ERROR_DATA:"SET_ERROR_DATA",APPLYING_COUPON:"APPLYING_COUPON",REMOVING_COUPON:"REMOVING_COUPON",RECEIVE_CART_ITEM:"RECEIVE_CART_ITEM",ITEM_PENDING_QUANTITY:"ITEM_PENDING_QUANTITY",SET_IS_CART_DATA_STALE:"SET_IS_CART_DATA_STALE",RECEIVE_REMOVED_ITEM:"RECEIVE_REMOVED_ITEM",UPDATING_CUSTOMER_DATA:"UPDATING_CUSTOMER_DATA",UPDATING_ADDRESS_FIELDS_FOR_SHIPPING_RATES:"UPDATING_ADDRESS_FIELDS_FOR_SHIPPING_RATES",SET_BILLING_ADDRESS:"SET_BILLING_ADDRESS",SET_SHIPPING_ADDRESS:"SET_SHIPPING_ADDRESS",UPDATING_SELECTED_SHIPPING_RATE:"UPDATING_SELECTED_SHIPPING_RATE",PRODUCT_PENDING_ADD:"PRODUCT_PENDING_ADD"},ve=window.wc.wcTypes;var be=function(){return be=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++)for(var a in t=arguments[r])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},be.apply(this,arguments)};function De(e){return e.toLowerCase()}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var we=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Oe=/[^A-Z0-9]+/gi;function Me(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}function Ne(e,t){var r=e.charAt(0),s=e.substr(1).toLowerCase();return t>0&&r>="0"&&r<="9"?"_"+r+s:""+r.toUpperCase()+s}function ke(e,t){return 0===t?e.toLowerCase():Ne(e,t)}const xe=e=>((e,t)=>Object.entries(e).reduce(((e,[r,s])=>({...e,[t(0,r)]:s})),{}))(e,((e,t)=>{return void 0===r&&(r={}),function(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,s=void 0===r?we:r,a=t.stripRegexp,i=void 0===a?Oe:a,n=t.transform,o=void 0===n?De:n,c=t.delimiter,d=void 0===c?" ":c,l=Me(Me(e,s,"$1\0$2"),i,"\0"),p=0,u=l.length;"\0"===l.charAt(p);)p++;for(;"\0"===l.charAt(u-1);)u--;return l.slice(p,u).split("\0").map(o).join(d)}(e,be({delimiter:"",transform:Ne},t))}(t,be({transform:ke},r));var r})),Le=window.CustomEvent||null,He=(e,{bubbles:t=!1,cancelable:r=!1,element:s,detail:a={}})=>{if(!Le)return;s||(s=document.body);const i=new Le(e,{bubbles:t,cancelable:r,detail:a});s.dispatchEvent(i)},Ue=()=>{He("wc-blocks_adding_to_cart",{bubbles:!0,cancelable:!0})},je=({preserveCartData:e=!1})=>{He("wc-blocks_added_to_cart",{bubbles:!0,cancelable:!0,detail:{preserveCartData:e}})},Fe=window.wp.htmlEntities,Ye=window.wp.hooks,Ge=window.wp.dom,Ve=e=>(0,Ge.__unstableStripHTML)((0,Fe.decodeEntities)(e)),Be=({oldCart:e,newCart:t,cartItemsPendingQuantity:r=[],cartItemsPendingDelete:s=[],productsPendingAdd:a=[]})=>{(0,I.select)(v).hasFinishedResolution("getCartData")&&(((e,t,r)=>{e.items.forEach((e=>{r.includes(e.key)||!t.items.find((t=>t&&t.key===e.key))&&(0,Ye.applyFilters)("woocommerce_show_cart_item_removed_notice",!0,e)&&(0,I.dispatch)("core/notices").createInfoNotice((0,f.sprintf)(/* translators: %s is the name of the item. */ /* translators: %s is the name of the item. */ (0,f.__)('"%s" was removed from your cart.',"woocommerce"),Ve(e.name)),{context:"wc/cart",speak:!0,type:"snackbar",id:`${e.key}-removed`})}))})(e,t,s),((e,t,r,s)=>{t.items.forEach((t=>{if(r.includes(t.key)||s.includes(t.id))return;const a=e.items.find((e=>e&&e.key===t.key));return a&&t.key===a.key?(t.quantity!==a.quantity&&(e=>e.quantity>=e.quantity_limits.minimum&&e.quantity<=e.quantity_limits.maximum&&e.quantity%e.quantity_limits.multiple_of==0)(t)&&(0,Ye.applyFilters)("woocommerce_show_cart_item_quantity_changed_notice",!0,t)&&(0,I.dispatch)("core/notices").createInfoNotice((0,f.sprintf)(/* translators: %1$s is the name of the item, %2$d is the quantity of the item. */ /* translators: %1$s is the name of the item, %2$d is the quantity of the item. */ (0,f.__)('The quantity of "%1$s" was changed to %2$s.',"woocommerce"),Ve(t.name),t.quantity),{context:"wc/cart",speak:!0,type:"snackbar",id:`${t.key}-quantity-update`}),t):void 0}))})(e,t,r,a))},qe=(0,f.__)("Something went wrong. Please contact us to get assistance.","woocommerce"),ze=(e,t,r)=>{const s=r?.context;(0,I.select)("wc/store/payment").isExpressPaymentMethodActive()||void 0===s||(0,I.dispatch)(R.store).createNotice(e,t,{isDismissible:!0,...r,context:s})};let Ke=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.ORDER_INFORMATION="wc/checkout/order-information",e}({});const Qe=e=>!(0,ve.isObject)(e)||void 0===e.retry||!0===e.retry,We=e=>{const t=(0,ve.objectHasProp)(e.data,"details")?Object.entries(e.data.details):null;return t?t.reduce(((e,[t,{code:r,message:s,additional_errors:a=[],data:i}])=>[...e,{param:t,id:`${t}_${r}`,code:r,message:(0,Fe.decodeEntities)(s),data:i},...Array.isArray(a)?a.flatMap((e=>{if(!(0,ve.objectHasProp)(e,"code")||!(0,ve.objectHasProp)(e,"message"))return[];const r=[{param:t,id:`${t}_${e.code}`,code:e.code,message:(0,Fe.decodeEntities)(e.message),data:e.data}];return void 0!==e.data?[...r,...We(e)]:r})):[]]),[]):[]},Xe=e=>{switch(e){case"woocommerce_rest_missing_email_address":case"woocommerce_rest_invalid_email_address":return Ke.CONTACT_INFORMATION;default:return Ke.CART}},$e=(e,t)=>{switch(e){case"invalid_email":return Ke.CONTACT_INFORMATION;case"billing_address":return"invalid_email"===t?Ke.CONTACT_INFORMATION:Ke.BILLING_ADDRESS;case"shipping_address":return Ke.SHIPPING_ADDRESS;default:return}},Ze=({code:e,id:t,param:r,data:s},a)=>{let i="",n="";return(0,ve.isObject)(s)&&(0,ve.objectHasProp)(s,"key")&&(0,ve.objectHasProp)(s,"location")&&(0,ve.isString)(s.location)&&(i=(e=>{switch(e){case"contact":return Ke.CONTACT_INFORMATION;case"order":return Ke.ORDER_INFORMATION;default:return}})(s.location)),(0,ve.objectHasProp)(s,"key")&&(0,ve.isString)(s.key)&&(n=`${s.key}__${t}`),{id:n||t,context:a||i||$e(r,e)||Xe(e)}},Je=(e,t)=>We(e).map((e=>Ze(e,t))),et=(e,t)=>"rest_invalid_param"===e.code?Je(e,t):[{id:e.code,context:t||e?.data?.context||Xe(e.code)}],tt=(e,t)=>{if(!(0,ve.isApiErrorResponse)(e))return;if("rest_invalid_param"===e.code)return((e,t)=>{We(e).forEach((e=>{ze("error",e.message,Ze(e,t))}))})(e,t);let r=(0,Fe.decodeEntities)(e.message)||qe;"invalid_json"===e.code&&(r=qe),ze("error",r,{id:e.code,context:t||e?.data?.context||Xe(e.code)})},rt=(e=null,t=null)=>{null!==t&&t.flatMap((e=>et(e))).forEach((e=>{var t;t=e,(0,I.dispatch)("core/notices").removeNotice(t.id,t.context)})),null!==e&&(e=>{e.forEach((e=>{ze("error",(0,Fe.decodeEntities)(e.message),{id:e.code,context:e?.data?.context||"wc/cart"})}))})((e=>e.filter(ve.isApiErrorResponse))(e))},st=window.wp.apiFetch;var at=r.n(st),it=r(254),nt=r.n(it);const ot={},ct={code:"invalid_json",message:(0,f.__)("The response is not a valid JSON response.","woocommerce")},dt=e=>{at().setNonce&&"function"==typeof at().setNonce?at().setNonce(e):console.error('The monkey patched function on APIFetch, "setNonce", is not present, likely another plugin or some other code has removed this augmentation'),at().setCartHash&&"function"==typeof at()?.setCartHash?at().setCartHash(e):console.error('The monkey patched function on APIFetch, "setCartHash", is not present, likely another plugin or some other code has removed this augmentation')},lt=new(nt())((e=>at()({path:"/wc/store/v1/batch",method:"POST",data:{requests:e.map((e=>({...e,body:e?.data})))}}).then((t=>((0,ve.assertBatchResponseIsValid)(t),e.map(((e,r)=>t.responses[r]||ot)))))),{batchScheduleFn:e=>setTimeout(e,300),cache:!1,maxBatchSize:25}),pt=e=>({type:"API_FETCH_WITH_HEADERS",options:e}),ut=["/wc/store/v1/cart/select-shipping-rate","/wc/store/v1/checkout","/wc/store/v1/checkout?__experimental_calc_totals=true"],_t=e=>new Promise(((t,r)=>{!e.method||"GET"===e.method||ut.includes(e.path||"")?at()({...e,parse:!1}).then((e=>{e instanceof Response?e.json().then((r=>{t({response:r,headers:e.headers}),dt(e.headers)})).catch((()=>{r(ct)})):r(ct)})).catch((e=>{"AbortError"!==e.name&&dt(e.headers),"function"==typeof e.json?e.json().then((e=>{r(e)})).catch((()=>{r(ct)})):r(e.message)})):(async e=>await lt.load(e))(e).then((e=>{throw(0,ve.assertResponseIsValid)(e),e.status>=200&&e.status<300&&(t({response:e.body,headers:e.headers}),dt(e.headers)),e})).catch((e=>{e.headers&&dt(e.headers),e.body?r(e.body):r(e)}))})),mt=e=>_t(e),Et={API_FETCH_WITH_HEADERS:({options:e})=>_t(e)},ht=(e,t,r)=>{let s,a=null;const i=(...i)=>{a=i,s&&clearTimeout(s),s=setTimeout((()=>{s=null,!r&&a&&e(...a)}),t),r&&!s&&e(...i)};return i.flush=()=>{s&&a&&(e(...a),clearTimeout(s),s=null)},i.clear=()=>{s&&clearTimeout(s),s=null},i},gt=window.wp.url,yt="wc/store/validation",St=(e,t)=>"string"!=typeof t?t:"email"===e?(0,gt.isEmail)(t)?t.trim():"":"postcode"===e?t.replace(" ","").toUpperCase():t.trim(),At=(e,t)=>Object.keys(e).filter((r=>St(r,e[r])!==St(r,t[r]))),Pt=ht((e=>{window.localStorage.setItem("WOOCOMMERCE_CHECKOUT_IS_CUSTOMER_DATA_DIRTY",e?"true":"false")}),300);let Tt=!0;const Rt=e=>{Tt=e},It=()=>(0,gt.getPath)(window.location.href)?.includes("site-editor.php")||(0,gt.getPath)(window.location.href)?.includes("post.php")||!1,Ct=e=>({dispatch:t,select:r})=>{const s=xe(e),a=r.getCartData(),i=[...a.errors,...r.getCartErrors()];t.setCartData(s);const n=r.getCartData();Be({oldCart:a,newCart:n,cartItemsPendingQuantity:r.getItemsPendingQuantityUpdate(),cartItemsPendingDelete:r.getItemsPendingDelete(),productsPendingAdd:r.getProductsPendingAdd()}),rt(n.errors,i),t.setErrorData(null)},ft=e=>({dispatch:t})=>{const{shipping_address:r,billing_address:s,...a}=e;t.receiveCart(a)},vt=(e=null)=>({dispatch:t})=>{(0,ve.isApiErrorResponse)(e)&&(e.data?.cart&&t.receiveCart(e?.data?.cart),t.setErrorData(e))},bt=e=>async({dispatch:t})=>{try{const{response:r}=await mt({path:"/wc/store/v1/cart/extensions",method:"POST",data:{namespace:e.namespace,data:e.data},cache:"no-store"});if(!0===e.overwriteDirtyCustomerData)return t.receiveCart(r),r;if("true"===window.localStorage.getItem("WOOCOMMERCE_CHECKOUT_IS_CUSTOMER_DATA_DIRTY")){const{shipping_address:e,billing_address:__,...s}=r;return t.receiveCart(s),r}return t.receiveCart(r),r}catch(e){return t.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Promise.reject(e)}},Dt=({cartItemsPendingQuantity:e,cartItemsPendingDelete:t,productsPendingAdd:r})=>async({dispatch:s,select:a})=>{try{r&&r.length>0&&r.forEach((e=>{s.setProductsPendingAdd(e,!0)})),e&&e.length>0&&e.forEach((e=>{s.itemIsPendingQuantity(e,!0)})),t&&t.length>0&&t.forEach((e=>{s.itemIsPendingDelete(e,!0)}));const{response:i}=await mt({path:"/wc/store/v1/cart",method:"GET",cache:"no-store"}),n=xe(i),o=a.getCartData(),c=[...o.errors,...a.getCartErrors()];Rt(!1),s.setCartData(n),Rt(!0),r&&r.length>0&&r.forEach((e=>{s.setProductsPendingAdd(e,!1)})),e&&e.length>0&&e.forEach((e=>{s.itemIsPendingQuantity(e,!1)})),t&&t.length>0&&t.forEach((e=>{s.itemIsPendingDelete(e,!1)}));const d=a.getCartData();Be({oldCart:o,newCart:d,cartItemsPendingQuantity:e,cartItemsPendingDelete:t,productsPendingAdd:r}),rt(d.errors,c),s.setErrorData(null)}catch(a){return r&&r.length>0&&r.forEach((e=>{s.setProductsPendingAdd(e,!1)})),e&&e.length>0&&e.forEach((e=>{s.itemIsPendingQuantity(e,!1)})),t&&t.length>0&&t.forEach((e=>{s.itemIsPendingDelete(e,!1)})),s.receiveError((0,ve.isApiErrorResponse)(a)?a:null),Promise.reject(a)}},wt=e=>async({dispatch:t})=>{try{t.receiveApplyingCoupon(e);const{response:r}=await mt({path:"/wc/store/v1/cart/apply-coupon",method:"POST",data:{code:e},cache:"no-store"});return t.receiveCart(r),r}catch(e){return t.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Promise.reject(e)}finally{t.receiveApplyingCoupon("")}},Ot=e=>async({dispatch:t})=>{try{t.receiveRemovingCoupon(e);const{response:r}=await mt({path:"/wc/store/v1/cart/remove-coupon",method:"POST",data:{code:e},cache:"no-store"});return t.receiveCart(r),r}catch(e){return t.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Promise.reject(e)}finally{t.receiveRemovingCoupon("")}},Mt=(e,t=1,r,s={})=>async({dispatch:a})=>{try{a.startAddingToCart(e);const{response:i}=await mt({path:"/wc/store/v1/cart/add-item",method:"POST",data:{...s,id:e,quantity:t,variation:r},cache:"no-store"});return a.receiveCart(i),a.finishAddingToCart(e),i}catch(t){return a.receiveError((0,ve.isApiErrorResponse)(t)?t:null),a.finishAddingToCart(e,!1),Promise.reject(t)}};function Nt(e){return async({dispatch:t})=>{Ue(),t.setProductsPendingAdd(e,!0)}}function kt(e,t=!0){return async({dispatch:r})=>{t&&je({preserveCartData:!0}),r.setProductsPendingAdd(e,!1)}}const xt=e=>async({dispatch:t})=>{try{t.itemIsPendingDelete(e);const{response:r}=await mt({path:"/wc/store/v1/cart/remove-item",data:{key:e},method:"POST",cache:"no-store"});return t.receiveCart(r),r}catch(e){return t.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Promise.reject(e)}finally{t.itemIsPendingDelete(e,!1)}},Lt=(e,t)=>async({dispatch:r,select:s})=>{const a=s.getCartItem(e);if(a?.quantity!==t)try{r.itemIsPendingQuantity(e);const{response:s}=await mt({path:"/wc/store/v1/cart/update-item",method:"POST",data:{key:e,quantity:t},cache:"no-store"});return r.receiveCart(s),s}catch(e){return r.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Promise.reject(e)}finally{r.itemIsPendingQuantity(e,!1)}};let Ht=null;const Ut=(e,t=null)=>async({dispatch:r,select:s})=>{const a=s.getShippingRates().find((e=>e.package_id===t))?.shipping_rates.find((e=>!0===e.selected));if(a?.rate_id!==e){if(!It())try{r.shippingRatesBeingSelected(!0),Ht&&Ht.abort(),Ht="undefined"==typeof AbortController?null:new AbortController;const{response:s}=await mt({path:"/wc/store/v1/cart/select-shipping-rate",method:"POST",data:{package_id:t,rate_id:e},cache:"no-store",signal:Ht?.signal||null}),{shipping_address:a,billing_address:i,...n}=s;return r.receiveCart(n),r.shippingRatesBeingSelected(!1),s}catch(e){return r.receiveError((0,ve.isApiErrorResponse)(e)?e:null),r.shippingRatesBeingSelected(!1),Promise.reject(e)}}else Ht&&Ht.abort()},jt=(e,t=!0,r=!1)=>async({dispatch:s})=>{try{s.updatingCustomerData(!0),"shipping_address"in e&&r&&s.updatingAddressFieldsForShippingRates(!0);const{response:a}=await mt({path:"/wc/store/v1/cart/update-customer",method:"POST",data:e,cache:"no-store"});return t?s.receiveCartContents(a):s.receiveCart(a),Pt(!1),a}catch(e){return s.receiveError((0,ve.isApiErrorResponse)(e)?e:null),Pt(!0),Promise.reject(e)}finally{s.updatingCustomerData(!1),s.updatingAddressFieldsForShippingRates(!1)}};function Ft(e){return{type:fe.SET_CART_DATA,response:e}}function Yt(e){return{type:fe.SET_ERROR_DATA,error:e}}function Gt(e){return{type:fe.APPLYING_COUPON,couponCode:e}}function Vt(e){return{type:fe.REMOVING_COUPON,couponCode:e}}function Bt(e=null){return{type:fe.RECEIVE_CART_ITEM,cartItem:e}}function qt(e,t=!0){return{type:fe.ITEM_PENDING_QUANTITY,cartItemKey:e,isPendingQuantity:t}}function zt(e,t=!0){return{type:fe.RECEIVE_REMOVED_ITEM,cartItemKey:e,isPendingDelete:t}}function Kt(e=!0){return{type:fe.SET_IS_CART_DATA_STALE,isCartDataStale:e}}function Qt(e){return{type:fe.UPDATING_CUSTOMER_DATA,isResolving:e}}function Wt(e){return{type:fe.UPDATING_ADDRESS_FIELDS_FOR_SHIPPING_RATES,isResolving:e}}function Xt(e){return{type:fe.UPDATING_SELECTED_SHIPPING_RATE,isResolving:e}}function $t(e){return{type:fe.SET_BILLING_ADDRESS,billingAddress:e}}function Zt(e){return{type:fe.SET_SHIPPING_ADDRESS,shippingAddress:e}}function Jt(e,t){return{type:fe.PRODUCT_PENDING_ADD,productId:e,isAdding:t}}const er={currency_code:D.SITE_CURRENCY.code,currency_symbol:D.SITE_CURRENCY.symbol,currency_minor_unit:D.SITE_CURRENCY.minorUnit,currency_decimal_separator:D.SITE_CURRENCY.decimalSeparator,currency_thousand_separator:D.SITE_CURRENCY.thousandSeparator,currency_prefix:D.SITE_CURRENCY.prefix,currency_suffix:D.SITE_CURRENCY.suffix},tr=(e,t=2)=>{const r=D.SITE_CURRENCY.minorUnit;if(r===t||!e)return e;const s=Math.pow(10,r);return(Math.round(parseInt(e,10)/Math.pow(10,t))*s).toString()},rr=(0,D.getSetting)("localPickupEnabled",!1),sr=(0,D.getSetting)("localPickupText",(0,f.__)("Local pickup","woocommerce")),ar=(0,D.getSetting)("localPickupCost",""),ir=rr?(0,D.getSetting)("localPickupLocations",[]):[],nr=ir?Object.values(ir).map(((e,t)=>({...er,name:`${sr} (${e.name})`,description:"",delivery_time:"",price:tr(ar,0)||"0",taxes:"0",rate_id:`pickup_location:${t+1}`,instance_id:t+1,meta_data:[{key:"pickup_location",value:e.name},{key:"pickup_address",value:e.formatted_address},{key:"pickup_details",value:e.details}],method_id:"pickup_location",selected:!1}))):[],or=[{destination:{address_1:"",address_2:"",city:"",state:"",postcode:"",country:""},package_id:0,name:(0,f.__)("Shipping","woocommerce"),items:[{key:"33e75ff09dd601bbe69f351039152189",name:(0,f._x)("Beanie with Logo","example product in Cart Block","woocommerce"),quantity:2},{key:"6512bd43d9caa6e02c990b0a82652dca",name:(0,f._x)("Beanie","example product in Cart Block","woocommerce"),quantity:1}],shipping_rates:[{...er,name:(0,f.__)("Flat rate shipping","woocommerce"),description:"",delivery_time:"",price:tr("500"),taxes:"0",rate_id:"flat_rate:0",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!1},{...er,name:(0,f.__)("Free shipping","woocommerce"),description:"",delivery_time:"",price:"0",taxes:"0",rate_id:"free_shipping:1",instance_id:0,meta_data:[],method_id:"flat_rate",selected:!0},...nr]}],cr=(0,D.getSetting)("displayCartPricesIncludingTax",!1),dr={coupons:[],shipping_rates:(0,D.getSetting)("shippingMethodsExist",!1)||(0,D.getSetting)("localPickupEnabled",!1)?or:[],items:[{key:"1",id:1,type:"simple",quantity:2,catalog_visibility:"visible",name:(0,f.__)("Beanie","woocommerce"),summary:(0,f.__)("Beanie","woocommerce"),short_description:(0,f.__)("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,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:10,src:O+"previews/beanie.jpg",thumbnail:O+"previews/beanie.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,f.__)("Color","woocommerce"),value:(0,f.__)("Yellow","woocommerce")},{attribute:(0,f.__)("Size","woocommerce"),value:(0,f.__)("Small","woocommerce")}],prices:{...er,price:tr(cr?"12000":"10000"),regular_price:tr(cr?"120":"100"),sale_price:tr(cr?"12000":"10000"),price_range:null,raw_prices:{precision:6,price:cr?"12000000":"10000000",regular_price:cr?"12000000":"10000000",sale_price:cr?"12000000":"10000000"}},totals:{...er,line_subtotal:tr("2000"),line_subtotal_tax:tr("400"),line_total:tr("2000"),line_total_tax:tr("400")},extensions:{},item_data:[]},{key:"2",id:2,type:"simple",quantity:1,catalog_visibility:"visible",name:(0,f.__)("Cap","woocommerce"),summary:(0,f.__)("Cap","woocommerce"),short_description:(0,f.__)("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",low_stock_remaining:null,permalink:"https://example.org",backorders_allowed:!1,show_backorder_badge:!1,sold_individually:!1,quantity_limits:{minimum:1,maximum:99,multiple_of:1,editable:!0},images:[{id:11,src:O+"previews/cap.jpg",thumbnail:O+"previews/cap.jpg",srcset:"",sizes:"",name:"",alt:""}],variation:[{attribute:(0,f.__)("Color","woocommerce"),value:(0,f.__)("Orange","woocommerce")}],prices:{...er,price:tr(cr?"2400":"2000"),regular_price:tr(cr?"2400":"2000"),sale_price:tr(cr?"2400":"2000"),price_range:null,raw_prices:{precision:6,price:cr?"24000000":"20000000",regular_price:cr?"24000000":"20000000",sale_price:cr?"24000000":"20000000"}},totals:{...er,line_subtotal:tr("2000"),line_subtotal_tax:tr("400"),line_total:tr("2000"),line_total_tax:tr("400")},extensions:{},item_data:[]}],cross_sells:[{id:1,name:(0,f.__)("Polo","woocommerce"),slug:"polo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-polo",short_description:(0,f.__)("Polo","woocommerce"),description:(0,f.__)("Polo","woocommerce"),on_sale:!1,prices:{...er,price:tr(cr?"24000":"20000"),regular_price:tr(cr?"24000":"20000"),sale_price:tr(cr?"12000":"10000"),price_range:null},price_html:"",average_rating:"4.5",review_count:2,images:[{id:17,src:O+"previews/polo.jpg",thumbnail:O+"previews/polo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:2,name:(0,f.__)("Long Sleeve Tee","woocommerce"),slug:"long-sleeve-tee",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-long-sleeve-tee",short_description:(0,f.__)("Long Sleeve Tee","woocommerce"),description:(0,f.__)("Long Sleeve Tee","woocommerce"),on_sale:!1,prices:{...er,price:tr(cr?"30000":"25000"),regular_price:tr(cr?"30000":"25000"),sale_price:tr(cr?"30000":"25000"),price_range:null},price_html:"",average_rating:"4",review_count:2,images:[{id:17,src:O+"previews/long-sleeve-tee.jpg",thumbnail:O+"previews/long-sleeve-tee.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:3,name:(0,f.__)("Hoodie with Zipper","woocommerce"),slug:"hoodie-with-zipper",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-zipper",short_description:(0,f.__)("Hoodie with Zipper","woocommerce"),description:(0,f.__)("Hoodie with Zipper","woocommerce"),on_sale:!0,prices:{...er,price:tr(cr?"15000":"12500"),regular_price:tr(cr?"30000":"25000"),sale_price:tr(cr?"15000":"12500"),price_range:null},price_html:"",average_rating:"1",review_count:2,images:[{id:17,src:O+"previews/hoodie-with-zipper.jpg",thumbnail:O+"previews/hoodie-with-zipper.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:4,name:(0,f.__)("Hoodie with Logo","woocommerce"),slug:"hoodie-with-logo",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-logo",short_description:(0,f.__)("Polo","woocommerce"),description:(0,f.__)("Polo","woocommerce"),on_sale:!1,prices:{...er,price:tr(cr?"4500":"4250"),regular_price:tr(cr?"4500":"4250"),sale_price:tr(cr?"4500":"4250"),price_range:null},price_html:"",average_rating:"5",review_count:2,images:[{id:17,src:O+"previews/hoodie-with-logo.jpg",thumbnail:O+"previews/hoodie-with-logo.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:5,name:(0,f.__)("Hoodie with Pocket","woocommerce"),slug:"hoodie-with-pocket",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-hoodie-with-pocket",short_description:(0,f.__)("Hoodie with Pocket","woocommerce"),description:(0,f.__)("Hoodie with Pocket","woocommerce"),on_sale:!0,prices:{...er,price:tr(cr?"3500":"3250"),regular_price:tr(cr?"4500":"4250"),sale_price:tr(cr?"3500":"3250"),price_range:null},price_html:"",average_rating:"3.75",review_count:4,images:[{id:17,src:O+"previews/hoodie-with-pocket.jpg",thumbnail:O+"previews/hoodie-with-pocket.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}},{id:6,name:(0,f.__)("T-Shirt","woocommerce"),slug:"t-shirt",parent:0,type:"simple",variation:"",permalink:"https://example.org",sku:"woo-t-shirt",short_description:(0,f.__)("T-Shirt","woocommerce"),description:(0,f.__)("T-Shirt","woocommerce"),on_sale:!1,prices:{...er,price:tr(cr?"1800":"1500"),regular_price:tr(cr?"1800":"1500"),sale_price:tr(cr?"1800":"1500"),price_range:null},price_html:"",average_rating:"3",review_count:2,images:[{id:17,src:O+"previews/tshirt.jpg",thumbnail:O+"previews/tshirt.jpg",srcset:"",sizes:"",name:"",alt:""}],categories:[],tags:[],attributes:[],variations:[],has_options:!1,is_purchasable:!0,is_in_stock:!0,is_on_backorder:!1,low_stock_remaining:null,sold_individually:!1,add_to_cart:{text:"",description:"",url:"",minimum:1,maximum:99,multiple_of:1}}],fees:[{id:"fee",name:(0,f.__)("Fee","woocommerce"),totals:{...er,total:tr("100"),total_tax:tr("20")}}],items_count:3,items_weight:0,needs_payment:!0,needs_shipping:N,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:{...er,total_items:tr("4000"),total_items_tax:tr("800"),total_fees:tr("100"),total_fees_tax:tr("20"),total_discount:"0",total_discount_tax:"0",total_shipping:"0",total_shipping_tax:"0",total_tax:tr("820"),total_price:tr("4920"),tax_lines:[{name:(0,f.__)("Sales tax","woocommerce"),rate:"20%",price:tr("820")}]},errors:[],payment_methods:["cod","bacs","cheque"],payment_requirements:["products"],extensions:{}},lr=()=>async({dispatch:e})=>{if(It())return void e.receiveCart(dr);const t=await at()({path:"/wc/store/v1/cart",method:"GET",cache:"no-store",parse:!1});"function"==typeof at().setCartHash&&at().setCartHash(t?.headers);try{const r=await t.json(),{receiveCart:s,receiveError:a}=e;if(!r)return void a(b);Rt(!1),s(r),Rt(!0)}catch(t){const{receiveError:r}=e;r(b)}},pr=()=>async({resolveSelect:e})=>{await e.getCartData()},ur=e=>{const t=document.cookie.split(";").reduce(((e,t)=>{const[r,s]=t.split("=").map((e=>e.trim()));return r&&s&&(e[r]=decodeURIComponent(s)),e}),{});return e?t[e]||"":t},_r=()=>!!ur("woocommerce_items_in_cart"),mr=()=>{if(!_r()||!(()=>{const e=ur("woocommerce_cart_hash");return(window.localStorage?.getItem("storeApiCartHash")||"")===e})())return null;const e=window.localStorage?.getItem("storeApiCartData");if(!e)return null;const t=JSON.parse(e);return t&&"object"==typeof t?t:null},Er=(hr=(e=re,t)=>{switch(t.type){case fe.PRODUCT_PENDING_ADD:if(t.isAdding){const r=[...e.productsPendingAdd];r.push(t.productId),e={...e,productsPendingAdd:r};break}e={...e,productsPendingAdd:e.productsPendingAdd.filter((e=>e!==t.productId))};break;case fe.SET_ERROR_DATA:"error"in t&&t.error&&(e={...e,errors:[t.error]});break;case fe.SET_CART_DATA:t.response&&(e={...e,errors:Q,cartData:{...e.cartData,...t.response}});break;case fe.APPLYING_COUPON:(t.couponCode||""===t.couponCode)&&(e={...e,metaData:{...e.metaData,applyingCoupon:t.couponCode}});break;case fe.SET_BILLING_ADDRESS:const r=Object.keys(t.billingAddress).some((r=>t.billingAddress[r]!==e.cartData.billingAddress?.[r]));e={...e,cartData:{...e.cartData,billingAddress:{...e.cartData.billingAddress,...t.billingAddress}}},r&&Pt(!0);break;case fe.SET_SHIPPING_ADDRESS:const s=Object.keys(t.shippingAddress).some((r=>t.shippingAddress[r]!==e.cartData.shippingAddress?.[r]));e={...e,cartData:{...e.cartData,shippingAddress:{...e.cartData.shippingAddress,...t.shippingAddress}}},s&&Pt(!0);break;case fe.REMOVING_COUPON:(t.couponCode||""===t.couponCode)&&(e={...e,metaData:{...e.metaData,removingCoupon:t.couponCode}});break;case fe.ITEM_PENDING_QUANTITY:const a=e.cartItemsPendingQuantity.filter((e=>e!==t.cartItemKey));t.isPendingQuantity&&t.cartItemKey&&a.push(t.cartItemKey),e={...e,cartItemsPendingQuantity:a};break;case fe.RECEIVE_REMOVED_ITEM:const i=e.cartItemsPendingDelete.filter((e=>e!==t.cartItemKey));t.isPendingDelete&&t.cartItemKey&&i.push(t.cartItemKey),e={...e,cartItemsPendingDelete:i};break;case fe.RECEIVE_CART_ITEM:e={...e,errors:Q,cartData:{...e.cartData,items:e.cartData.items.map((e=>e.key===t.cartItem?.key?t.cartItem:e))}};break;case fe.UPDATING_CUSTOMER_DATA:e={...e,metaData:{...e.metaData,updatingCustomerData:!!t.isResolving}};break;case fe.UPDATING_ADDRESS_FIELDS_FOR_SHIPPING_RATES:e={...e,metaData:{...e.metaData,updatingAddressFieldsForShippingRates:!!t.isResolving}};break;case fe.UPDATING_SELECTED_SHIPPING_RATE:e={...e,metaData:{...e.metaData,updatingSelectedRate:!!t.isResolving}};break;case fe.SET_IS_CART_DATA_STALE:e={...e,metaData:{...e.metaData,isCartDataStale:t.isCartDataStale}}}return e},(e,t)=>{const r=hr(e,t);return r.cartData&&!It()&&(s=r.cartData,window.localStorage.setItem("storeApiCartData",JSON.stringify(s))),r;var s});var hr;const gr=Object.entries(H).reduce(((e,[t,r])=>(e[t]=Object.entries(r).reduce(((e,[t,r])=>(e[t]=(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,f.sprintf)(/* translators: %s Field label. */ /* translators: %s Field label. */ (0,f.__)("%s (optional)","woocommerce"),e.label)),e.index&&((0,ve.isNumber)(e.index)&&(t.index=e.index),(0,ve.isString)(e.index)&&(t.index=parseInt(e.index,10))),e.hidden&&(t.required=!1),t})(r),e)),{}),e)),{}),yr=["state","country","postcode","city"],Sr=e=>{const t=((e,t,r="")=>{const s=r&&void 0!==gr[r]?gr[r]:{};return e.map((e=>({key:e,...t&&e in t?t[e]:{},...s&&e in s?s[e]:{}}))).sort(((e,t)=>e.index-t.index))})(j,D.defaultFields,e.country),r=Object.assign({},e);return t.forEach((({key:t,hidden:s})=>{!0===s&&((e,t)=>e in t)(t,e)&&(r[t]="")})),r},Ar=window.wp.isShallowEqual;var Pr=r.n(Ar);const Tr={customerDataIsInitialized:!1,doingPush:!1,customerData:{billingAddress:{},shippingAddress:{}},dirtyProps:{billingAddress:[],shippingAddress:[]}},Rr=()=>{if(Tr.doingPush)return;Tr.doingPush=!0,(()=>{const e=(0,I.select)(ha).getCustomerData();Tr.dirtyProps.billingAddress=[...Tr.dirtyProps.billingAddress,...At(Tr.customerData.billingAddress,e.billingAddress)],Tr.dirtyProps.shippingAddress=[...Tr.dirtyProps.shippingAddress,...At(Tr.customerData.shippingAddress,e.shippingAddress)],Tr.customerData=e;const t=Tr.dirtyProps.shippingAddress,r=Tr.dirtyProps.billingAddress,s=Tr.customerData.shippingAddress,a=Tr.customerData.billingAddress,i=t.includes("country"),n=r.includes("country"),o=t.includes("state"),c=r.includes("state"),d=t.includes("postcode"),l=r.includes("postcode");i&&!d&&(t.push("postcode"),s.postcode=""),n&&!l&&(r.push("postcode"),a.postcode=""),i&&!o&&(t.push("state"),s.state=""),n&&!c&&(r.push("state"),a.state="")})();const e=Tr.dirtyProps.billingAddress.length>0,t=Tr.dirtyProps.shippingAddress.length>0;if(!e&&!t)return void(Tr.doingPush=!1);if(!(e=>{const t=(0,I.select)(yt);return 0===[...e.billingAddress.filter((e=>void 0!==t.getValidationError("billing_"+e))),...e.shippingAddress.filter((e=>void 0!==t.getValidationError("shipping_"+e)))].filter(Boolean).length})(Tr.dirtyProps))return void(Tr.doingPush=!1);const r=Tr.dirtyProps.shippingAddress.some((e=>yr.includes(e)));(0,I.dispatch)(ha).updateCustomerData({...e&&{billing_address:Tr.customerData.billingAddress},...t&&{shipping_address:Tr.customerData.shippingAddress}},!0,r).then((()=>{Tr.dirtyProps.billingAddress=[],Tr.dirtyProps.shippingAddress=[],Tr.doingPush=!1})).catch((e=>{Tr.doingPush=!1,tt(e)}))},Ir=ht((()=>{Tr.doingPush?Ir():Rr()}),1500),Cr="wc/store/payment";let fr=function(e){return e.IDLE="idle",e.EXPRESS_STARTED="express_started",e.PROCESSING="processing",e.READY="ready",e.ERROR="has_error",e}({});const vr="wc/store/checkout";let br=function(e){return e.IDLE="idle",e.COMPLETE="complete",e.BEFORE_PROCESSING="before_processing",e.PROCESSING="processing",e.AFTER_PROCESSING="after_processing",e}({});const Dr={order_id:0,customer_id:0,billing_address:{},shipping_address:{},additional_fields:{},...(0,D.getSetting)("checkoutData",{})||{}},wr=(0,D.getSetting)("globalPaymentMethods"),Or=(0,D.getSetting)("customerPaymentMethods",{}),Mr=It()?wr[0]?.id||"":Dr?.payment_method,Nr={status:fr.IDLE,activePaymentMethod:Mr||"",availablePaymentMethods:{},availableExpressPaymentMethods:{},registeredExpressPaymentMethods:{},savedPaymentMethods:(0,D.getSetting)("customerPaymentMethods",{}),paymentMethodData:function(){if(!Mr)return{};const e=Object.keys(Or).flatMap((e=>Or[e])).find((e=>e.method.gateway===Mr));if(e){const t=e.tokenId.toString(),r=e.method.gateway,s=`wc-${r}-payment-token`;return{token:t,payment_method:r,[s]:t}}return{}}(),paymentResult:null,paymentMethodsInitialized:!1,expressPaymentMethodsInitialized:!1,shouldSavePaymentMethod:!1};let kr=function(e){return e.SET_PAYMENT_IDLE="SET_PAYMENT_IDLE",e.SET_EXPRESS_PAYMENT_STARTED="SET_EXPRESS_PAYMENT_STARTED",e.SET_PAYMENT_READY="SET_PAYMENT_READY",e.SET_PAYMENT_PROCESSING="SET_PAYMENT_PROCESSING",e.SET_PAYMENT_ERROR="SET_PAYMENT_ERROR",e.SET_PAYMENT_METHODS_INITIALIZED="SET_PAYMENT_METHODS_INITIALIZED",e.SET_EXPRESS_PAYMENT_METHODS_INITIALIZED="SET_EXPRESS_PAYMENT_METHODS_INITIALIZED",e.SET_ACTIVE_PAYMENT_METHOD="SET_ACTIVE_PAYMENT_METHOD",e.SET_SHOULD_SAVE_PAYMENT_METHOD="SET_SHOULD_SAVE_PAYMENT_METHOD",e.SET_AVAILABLE_PAYMENT_METHODS="SET_AVAILABLE_PAYMENT_METHODS",e.SET_AVAILABLE_EXPRESS_PAYMENT_METHODS="SET_AVAILABLE_EXPRESS_PAYMENT_METHODS",e.SET_REGISTERED_EXPRESS_PAYMENT_METHODS="SET_REGISTERED_EXPRESS_PAYMENT_METHODS",e.REMOVE_AVAILABLE_PAYMENT_METHOD="REMOVE_AVAILABLE_PAYMENT_METHOD",e.REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD="REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD",e.INITIALIZE_PAYMENT_METHODS="INITIALIZE_PAYMENT_METHODS",e.SET_PAYMENT_METHOD_DATA="SET_PAYMENT_METHOD_DATA",e.SET_PAYMENT_RESULT="SET_PAYMENT_RESULT",e}({});const xr=e=>Object.fromEntries(e.map((({package_id:e,shipping_rates:t})=>[e,t.find((e=>e.selected))?.rate_id||""]))),Lr=window.wc.wcBlocksRegistry,Hr=(e,t,r=!1)=>{const{createErrorNotice:s}=(0,I.dispatch)("core/notices"),a=r?Ke.EXPRESS_PAYMENTS:Ke.PAYMENTS;s(`${(0,f.sprintf)(/* translators: %s the id of the payment method being registered (bank transfer, cheque...) */ /* translators: %s the id of the payment method being registered (bank transfer, cheque...) */ (0,f.__)("There was an error registering the payment method with id '%s': ","woocommerce"),e.paymentMethodId)} ${t}`,{context:a,id:`wc-${e.paymentMethodId}-registration-error`})},Ur=async(e=!1)=>{let t={};const r=e?(0,Lr.getExpressPaymentMethods)():(0,Lr.getPaymentMethods)(),s=r=>{if(e){const{name:e,title:s,description:a,gatewayId:i,supports:n}=r;t={...t,[r.name]:{name:e,title:s,description:a,gatewayId:i,supportsStyle:n?.style}}}else{const{name:e}=r;t={...t,[r.name]:{name:e}}}},a=e?Object.keys(r):Array.from(new Set([...(0,D.getSetting)("paymentMethodSortOrder",[]),...Object.keys(r)])),i=(()=>{let e;if((0,I.select)("core/editor")){const t={cartCoupons:dr.coupons,cartItems:dr.items,crossSellsProducts:dr.cross_sells,cartFees:dr.fees,cartItemsCount:dr.items_count,cartItemsWeight:dr.items_weight,cartNeedsPayment:dr.needs_payment,cartNeedsShipping:dr.needs_shipping,cartItemErrors:K,cartTotals:dr.totals,cartIsLoading:!1,cartErrors:Q,billingData:re.cartData.billingAddress,billingAddress:re.cartData.billingAddress,shippingAddress:re.cartData.shippingAddress,extensions:Z,shippingRates:dr.shipping_rates,isLoadingRates:!1,cartHasCalculatedShipping:dr.has_calculated_shipping,paymentRequirements:dr.payment_requirements,receiveCart:()=>{}};e={cart:t,cartTotals:t.cartTotals,cartNeedsShipping:t.cartNeedsShipping,billingData:t.billingAddress,billingAddress:t.billingAddress,shippingAddress:t.shippingAddress,selectedShippingMethods:xr(t.shippingRates),paymentMethods:dr.payment_methods,paymentRequirements:t.paymentRequirements}}else{const t=(0,I.select)(v),r=t.getCartData(),s=t.getCartErrors(),a=t.getCartTotals(),i=!t.hasFinishedResolution("getCartData"),n=t.isAddressFieldsForShippingRatesUpdating(),o=xr(r.shippingRates);e={cart:{cartCoupons:r.coupons,cartItems:r.items,crossSellsProducts:r.crossSells,cartFees:r.fees,cartItemsCount:r.itemsCount,cartItemsWeight:r.itemsWeight,cartNeedsPayment:r.needsPayment,cartNeedsShipping:r.needsShipping,cartItemErrors:r.errors,cartTotals:a,cartIsLoading:i,cartErrors:s,billingData:Sr(r.billingAddress),billingAddress:Sr(r.billingAddress),shippingAddress:Sr(r.shippingAddress),extensions:r.extensions,shippingRates:r.shippingRates,isLoadingRates:n,cartHasCalculatedShipping:r.hasCalculatedShipping,paymentRequirements:r.paymentRequirements,receiveCart:(0,I.dispatch)(v).receiveCart},cartTotals:r.totals,cartNeedsShipping:r.needsShipping,billingData:r.billingAddress,billingAddress:r.billingAddress,shippingAddress:r.shippingAddress,selectedShippingMethods:o,paymentMethods:r.paymentMethods,paymentRequirements:r.paymentRequirements}}return e})(),n=i.paymentMethods,o=!!(0,I.select)("core/editor");for(let t=0;t<a.length;t++){const c=a[t],d=r[c];if(d)try{const t=!(!o&&!e)||n.includes(c),r=!!o||t&&await Promise.resolve(d.canMakePayment(i));if(r){if("object"==typeof r&&r.error)throw new Error(r.error.message);s(d)}}catch(t){(D.CURRENT_USER_IS_ADMIN||o)&&Hr(d,t,e)}}const c=(0,I.select)(Cr),d=Object.keys(t),l=e?c.getAvailableExpressPaymentMethods():c.getAvailablePaymentMethods();if(Object.keys(l).length===d.length&&Object.keys(l).every((e=>d.includes(e))))return!0;const{__internalSetAvailablePaymentMethods:p,__internalSetAvailableExpressPaymentMethods:u}=(0,I.dispatch)(Cr);return(e?u:p)(t),!0},jr=async e=>{const t=Object.keys(e),r=Object.keys((0,I.select)(ua).getAvailableExpressPaymentMethods()),s=[...t,...r],a=(0,I.select)(ua).getActivePaymentMethod();if(a&&s.includes(a))return;const i=(0,I.select)(ua).getSavedPaymentMethods(),n=Object.keys(i).flatMap((e=>i[e])),o=n.find((e=>e.is_default))||n[0]||void 0;if(o){const e=o.tokenId.toString(),t=o.method.gateway,r=`wc-${t}-payment-token`;(0,I.dispatch)(ua).__internalSetActivePaymentMethod(t,{token:e,payment_method:t,[r]:e,isSavedToken:!0})}else(0,I.dispatch)(ua).__internalSetPaymentIdle(),(0,I.dispatch)(ua).__internalSetActivePaymentMethod(t[0])},Fr=window.wp.deprecated;var Yr=r.n(Fr);const Gr=(window.wp.element,"payment_setup"),Vr=e=>["first_name","last_name","company","address_1","address_2","city","state","postcode","country","phone"].every((t=>(0,ve.objectHasProp)(e,t))),Br=e=>Vr(e)&&(0,ve.objectHasProp)(e,"email");var qr=r(2063),zr=r(1089);const Kr=e=>({registry:t})=>{const{createErrorNotice:r,removeNotice:s}=t.dispatch(R.store);e?r(e,{id:"wc-express-payment-error",context:Ke.EXPRESS_PAYMENTS}):s("wc-express-payment-error",Ke.EXPRESS_PAYMENTS)},Qr=(e,t)=>({dispatch:r,registry:s})=>{const{createErrorNotice:a,removeNotice:i}=s.dispatch(R.store);return i("wc-payment-error",Ke.PAYMENTS),(async(e,t,r)=>{const s=[],a=((e,t)=>e[t]?Array.from(e[t].values()).sort(((e,t)=>e.priority-t.priority)):[])(e,t);for(const e of a)try{const t=await Promise.resolve(e.callback(r));if(!(0,ve.isObserverResponse)(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,ve.isErrorResponse)(t)||(0,ve.isFailResponse)(t))return s.push(t),s;s.push(t)}catch(e){return console.error(e),s.push({type:ve.responseTypes.ERROR}),s}return s})(e,Gr,{}).then((e=>{let i,n,o,c;e.forEach((e=>{(0,ve.isSuccessResponse)(e)&&(i=e),((0,ve.isErrorResponse)(e)||(0,ve.isFailResponse)(e))&&(n=e);const{billingAddress:t,billingData:r,shippingAddress:s,shippingData:a}=e?.meta||{};o=t,c=s,r&&(o=r,Yr()("returning billingData from an onPaymentProcessing observer in WooCommerce Blocks",{version:"9.5.0",alternative:"billingAddress",link:"https://github.com/woocommerce/woocommerce-blocks/pull/6369"})),(0,ve.objectHasProp)(a,"address")&&a.address&&(c=a.address,Yr()("returning shippingData from an onPaymentProcessing observer in WooCommerce Blocks",{version:"9.5.0",alternative:"shippingAddress",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8163"}))}));const{setBillingAddress:d,setShippingAddress:l}=s.dispatch(ha);if((0,qr.mW)(i)&&!n){const{paymentMethodData:e}=i?.meta||{};Br(o)&&d(o),Vr(c)&&l(c),r.__internalSetPaymentMethodData((0,ve.isObject)(e)?e:{}),r.__internalSetPaymentReady()}else if((0,ve.isFailResponse)(n)){const{paymentMethodData:e}=n?.meta||{};if((0,ve.objectHasProp)(n,"message")&&(0,ve.isString)(n.message)&&n.message.length){let e=Ke.PAYMENTS;(0,ve.objectHasProp)(n,"messageContext")&&(0,ve.isString)(n.messageContext)&&n.messageContext.length&&(e=n.messageContext),a(n.message,{id:"wc-payment-error",isDismissible:!1,context:e})}Br(o)&&d(o),r.__internalSetPaymentMethodData((0,ve.isObject)(e)?e:{}),r.__internalSetPaymentError()}else if((0,ve.isErrorResponse)(n)){if((0,ve.objectHasProp)(n,"message")&&(0,ve.isString)(n.message)&&n.message.length){let e=Ke.PAYMENTS;(0,ve.objectHasProp)(n,"messageContext")&&(0,ve.isString)(n.messageContext)&&n.messageContext.length&&(e=n.messageContext),a(n.message,{id:"wc-payment-error",isDismissible:!1,context:e})}r.__internalSetPaymentError(),(0,zr.Y)(n.validationErrors)&&t(n.validationErrors)}else r.__internalSetPaymentReady()}))},Wr=()=>({type:kr.SET_PAYMENT_IDLE}),Xr=()=>({type:kr.SET_EXPRESS_PAYMENT_STARTED}),$r=()=>({type:kr.SET_PAYMENT_PROCESSING}),Zr=()=>({type:kr.SET_PAYMENT_ERROR}),Jr=()=>({type:kr.SET_PAYMENT_READY}),es=e=>async({select:t,dispatch:r})=>{const s=t.getAvailablePaymentMethods();e&&await jr(s),r({type:kr.SET_PAYMENT_METHODS_INITIALIZED,initialized:e})},ts=e=>({type:kr.SET_EXPRESS_PAYMENT_METHODS_INITIALIZED,initialized:e}),rs=e=>({type:kr.SET_SHOULD_SAVE_PAYMENT_METHOD,shouldSavePaymentMethod:e}),ss=(e,t={})=>({type:kr.SET_ACTIVE_PAYMENT_METHOD,activePaymentMethod:e,paymentMethodData:t}),as=(e={})=>({type:kr.SET_PAYMENT_METHOD_DATA,paymentMethodData:e}),is=e=>({type:kr.SET_PAYMENT_RESULT,data:e}),ns=e=>async({dispatch:t,select:r})=>{r.getActivePaymentMethod()in e||await jr(e),t({type:kr.SET_AVAILABLE_PAYMENT_METHODS,paymentMethods:e})},os=e=>({type:kr.SET_AVAILABLE_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),cs=e=>({type:kr.SET_REGISTERED_EXPRESS_PAYMENT_METHODS,paymentMethods:e}),ds=e=>({type:kr.REMOVE_AVAILABLE_PAYMENT_METHOD,name:e}),ls=e=>({type:kr.REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD,name:e});function ps(){return async({select:e,dispatch:t})=>{const r=await Ur(!0),s=await Ur(!1),{paymentMethodsInitialized:a,expressPaymentMethodsInitialized:i}=e;s&&!a()&&t(es(!0)),r&&!i()&&t(ts(!0))}}const us={};(0,D.getSetting)("globalPaymentMethods")&&(0,D.getSetting)("globalPaymentMethods").forEach((e=>{us[e.id]=e.title}));const _s=e=>(Yr()("isPaymentPristine",{since:"9.6.0",alternative:"isPaymentIdle",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),e.status===fr.IDLE),ms=e=>e.status===fr.IDLE,Es=e=>(Yr()("isPaymentStarted",{since:"9.6.0",alternative:"isExpressPaymentStarted",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),e.status===fr.EXPRESS_STARTED),hs=e=>e.status===fr.EXPRESS_STARTED,gs=e=>e.status===fr.PROCESSING,ys=e=>e.status===fr.READY,Ss=e=>(Yr()("isPaymentSuccess",{since:"9.6.0",alternative:"isPaymentReady",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),e.status===fr.READY),As=e=>e.status===fr.ERROR,Ps=e=>(Yr()("isPaymentFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),e.status===fr.ERROR),Ts=e=>Object.keys(e.availableExpressPaymentMethods).includes(e.activePaymentMethod),Rs=e=>"object"==typeof e.paymentMethodData&&(0,ve.objectHasProp)(e.paymentMethodData,"token")?e.paymentMethodData.token+"":"",Is=e=>e.activePaymentMethod,Cs=e=>e.availablePaymentMethods,fs=e=>e.availableExpressPaymentMethods,vs=e=>e.registeredExpressPaymentMethods,bs=e=>e.paymentMethodData,Ds=(0,I.createSelector)((e=>{const{availablePaymentMethods:t,availableExpressPaymentMethods:r,paymentMethodsInitialized:s,expressPaymentMethodsInitialized:a}=e;return s&&a?Object.fromEntries(Object.entries(us).filter((([e])=>!(e in{...t,...r})))):{}}),(e=>[e.availablePaymentMethods,e.availableExpressPaymentMethods,e.paymentMethodsInitialized,e.expressPaymentMethodsInitialized])),ws=e=>e.savedPaymentMethods,Os=e=>((e=[],t)=>{if(0===e.length)return{};const r=(0,Lr.getPaymentMethods)(),s=Object.fromEntries(e.map((e=>[e,r[e]]))),a=Object.keys(t),i={};return a.forEach((e=>{const r=t[e].filter((({method:{gateway:e}})=>e in s&&s[e].supports?.showSavedCards));r.length&&(i[e]=r)})),i})(Object.keys(e.availablePaymentMethods),e.savedPaymentMethods),Ms=e=>e.paymentMethodsInitialized,Ns=e=>e.expressPaymentMethodsInitialized,ks=e=>(Yr()("getCurrentStatus",{since:"8.9.0",alternative:"isPaymentIdle, isPaymentProcessing, hasPaymentError",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/7666"}),{get isPristine(){return Yr()("isPristine",{since:"9.6.0",alternative:"isIdle",plugin:"WooCommerce Blocks"}),ms(e)},isIdle:ms(e),isStarted:hs(e),isProcessing:gs(e),get isFinished(){return Yr()("isFinished",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),As(e)||ys(e)},hasError:As(e),get hasFailed(){return Yr()("hasFailed",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),As(e)},get isSuccessful(){return Yr()("isSuccessful",{since:"9.6.0",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/8110"}),ys(e)},isDoingExpressPayment:Ts(e)}),xs=e=>e.shouldSavePaymentMethod,Ls=e=>e.paymentResult,Hs=e=>e,Us="SET_VALIDATION_ERRORS",js="CLEAR_VALIDATION_ERROR",Fs="CLEAR_VALIDATION_ERRORS",Ys="HIDE_VALIDATION_ERROR",Gs="SHOW_VALIDATION_ERROR",Vs="SHOW_ALL_VALIDATION_ERRORS",Bs=e=>({type:Us,errors:e}),qs=e=>({type:Fs,errors:e}),zs=()=>(Yr()("clearAllValidationErrors",{version:"9.0.0",alternative:"clearValidationErrors",plugin:"WooCommerce Blocks",link:"https://github.com/woocommerce/woocommerce-blocks/pull/7601",hint:"Calling `clearValidationErrors` with no arguments will clear all validation errors."}),qs()),Ks=e=>({type:js,error:e}),Qs=e=>({type:Ys,error:e}),Ws=e=>({type:Gs,error:e}),Xs=()=>({type:Vs}),$s=(e,t)=>e[t],Zs=(e,t)=>{if(e.hasOwnProperty(t)&&!e[t].hidden)return`validate-error-${t}`},Js=e=>Object.keys(e).length>0,ea={reducer:(e={},t)=>{const r={...e};switch(t.type){case Us:return t.errors&&Object.entries(t.errors).some((([t,r])=>!("string"!=typeof r?.message||e.hasOwnProperty(t)&&Pr()(e[t],r))))?{...e,...t.errors}:e;case js:return(0,ve.isString)(t.error)&&r.hasOwnProperty(t.error)?(delete r[t.error],r):r;case Fs:const{errors:s}=t;return void 0===s?{}:Array.isArray(s)?(s.forEach((e=>{r.hasOwnProperty(e)&&delete r[e]})),r):r;case Ys:return(0,ve.isString)(t.error)&&r.hasOwnProperty(t.error)?(r[t.error].hidden=!0,r):r;case Gs:return(0,ve.isString)(t.error)&&r.hasOwnProperty(t.error)?(r[t.error].hidden=!1,r):r;case Vs:return Object.keys(r).forEach((e=>{r[e].hidden&&(r[e].hidden=!1)})),{...r};default:return e}},selectors:l,actions:d},ta=(0,I.createReduxStore)(yt,ea);(0,I.register)(ta);const ra=yt,sa=e=>{let t="";if(F.includes(e))t="contact_";else{if(!Y.includes(e))return!1;t="order_"}return!!(0,I.select)(ta).getValidationError(`${t}${e}`)},aa={isInitialized:!1,doingPush:!1,checkoutData:{orderNotes:"",additionalFields:{},activePaymentMethod:""},hasSession:!1},ia=(0,D.getSetting)("isCheckoutBlock",!1),na=()=>{if(!aa.hasSession)return;if(aa.doingPush)return;if(aa.doingPush=!0,!ia)return void(aa.doingPush=!1);if((0,I.select)(Cr).isExpressPaymentStarted())return void(aa.doingPush=!1);const e=(0,I.select)(vr),t=(0,I.select)(Cr),r={orderNotes:e.getOrderNotes(),additionalFields:e.getAdditionalFields(),activePaymentMethod:t.getActivePaymentMethod()};if(""===r.activePaymentMethod)return void(aa.doingPush=!1);const s=Object.keys(r.additionalFields).filter((e=>!sa(e)&&(e in aa.checkoutData.additionalFields||""!==r.additionalFields[e])&&aa.checkoutData.additionalFields[e]!==r.additionalFields[e])).reduce(((e,t)=>(e[t]=r.additionalFields[t],e)),{}),a={};if(Object.keys(s).length>0&&(a.additional_fields=s),!(e=>{if(0===Object.keys(e).length)return!0;for(const t of Object.keys(e))if(sa(t))return!1;return!0})(s))return aa.doingPush=!1,void(aa.checkoutData=r);r.orderNotes!==aa.checkoutData.orderNotes&&(a.order_notes=r.orderNotes),r.activePaymentMethod!==aa.checkoutData.activePaymentMethod&&(a.payment_method=r.activePaymentMethod),0!==Object.keys(a).length?(aa.checkoutData=r,(0,I.dispatch)(vr).updateDraftOrder(a).then((()=>{var e;e=a,(0,ve.isObject)(e)&&e?.additional_fields&&(0,ve.isObject)(e.additional_fields)&&Object.keys(e.additional_fields).forEach((e=>{(e=>{const{removeNotice:t}=(0,I.dispatch)(R.store),r=(0,I.select)("wc/store/store-notices").getRegisteredContainers(),{getNotices:s}=(0,I.select)(R.store);r.forEach((r=>{s(r).forEach((s=>{s.id.startsWith(e)&&t(s.id,r)}))}))})(e)})),aa.doingPush=!1})).catch((e=>{aa.doingPush=!1,tt(e)})),aa.doingPush=!1):aa.doingPush=!1},oa=ht((()=>{aa.doingPush||na()}),1500),ca=(e=!0)=>{aa.isInitialized?e?oa():na():(()=>{const e=(0,I.select)(vr),t=(0,I.select)(Cr);aa.checkoutData={orderNotes:e.getOrderNotes(),additionalFields:e.getAdditionalFields(),activePaymentMethod:t.getActivePaymentMethod()},aa.hasSession=document.cookie.includes("woocommerce_cart_hash"),aa.isInitialized=!0})()},da=()=>{oa.clear()},la=Cr,pa={reducer:(e=Nr,t)=>{let r=e;switch(t.type){case kr.SET_PAYMENT_IDLE:r={...e,status:fr.IDLE};break;case kr.SET_EXPRESS_PAYMENT_STARTED:r={...e,status:fr.EXPRESS_STARTED};break;case kr.SET_PAYMENT_PROCESSING:r={...e,status:fr.PROCESSING};break;case kr.SET_PAYMENT_READY:r={...e,status:fr.READY};break;case kr.SET_PAYMENT_ERROR:r={...e,status:fr.ERROR};break;case kr.SET_SHOULD_SAVE_PAYMENT_METHOD:r={...e,shouldSavePaymentMethod:t.shouldSavePaymentMethod};break;case kr.SET_PAYMENT_METHOD_DATA:r={...e,paymentMethodData:t.paymentMethodData};break;case kr.SET_PAYMENT_RESULT:r={...e,paymentResult:t.data};break;case kr.REMOVE_AVAILABLE_PAYMENT_METHOD:const s={...e.availablePaymentMethods};delete s[t.name],r={...e,availablePaymentMethods:{...s}};break;case kr.REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD:const a={...e.availableExpressPaymentMethods};delete a[t.name],r={...e,availableExpressPaymentMethods:{...a}};break;case kr.SET_PAYMENT_METHODS_INITIALIZED:r={...e,paymentMethodsInitialized:t.initialized};break;case kr.SET_EXPRESS_PAYMENT_METHODS_INITIALIZED:r={...e,expressPaymentMethodsInitialized:t.initialized};break;case kr.SET_AVAILABLE_PAYMENT_METHODS:r={...e,availablePaymentMethods:t.paymentMethods};break;case kr.SET_AVAILABLE_EXPRESS_PAYMENT_METHODS:r={...e,availableExpressPaymentMethods:t.paymentMethods};break;case kr.SET_REGISTERED_EXPRESS_PAYMENT_METHODS:r={...e,registeredExpressPaymentMethods:t.paymentMethods};break;case kr.SET_ACTIVE_PAYMENT_METHOD:r={...e,activePaymentMethod:t.activePaymentMethod,paymentMethodData:t.paymentMethodData||e.paymentMethodData};break;default:return r}return r},selectors:c,actions:o,controls:{...C.controls,...Et},__experimentalUseThunks:!0},ua=(0,I.createReduxStore)(Cr,pa);(0,I.register)(ua),(0,I.subscribe)(ca,ua);const _a=async()=>!!(0,I.select)(ha).hasFinishedResolution("getCartData")&&(await(0,I.dispatch)(ua).__internalUpdateAvailablePaymentMethods(),!0),ma=ht(_a,1e3),Ea={reducer:Er,actions:i,controls:C.controls,selectors:a,resolvers:n,initialState:{...re,cartData:{...re.cartData,...mr()||{}}}},ha=(0,I.createReduxStore)(v,Ea);(0,I.register)(ha),window.addEventListener("load",(()=>{const e=mr(),t=e?.itemsCount>0;_r()&&!t||window.location?.search?.match(/add-to-cart/)||It()||(0,I.dispatch)(ha).finishResolution("getCartData")})),(0,I.subscribe)(((e=!0)=>{if((0,I.select)(ha).hasFinishedResolution("getCartData"))return Tr.customerDataIsInitialized?void(Pr()(Tr.customerData,(0,I.select)(ha).getCustomerData())||(e?Ir():Rr())):(Tr.customerData=(0,I.select)(ha).getCustomerData(),void(Tr.customerDataIsInitialized=!0))}),ha);let ga=null;(0,I.subscribe)((()=>{const e=(0,I.select)(v).getCartData();!0===Tt&&null!==ga&&ga!==e&&window.dispatchEvent(new CustomEvent("wc-blocks_store_sync_required",{detail:{type:"from_@wordpress/data"}})),ga=e}),ha),window.addEventListener("wc-blocks_store_sync_required",(e=>{const t=e,{type:r,quantityChanges:s}=t.detail;"from_iAPI"===r&&(0,I.dispatch)(ha).syncCartWithIAPIStore(s)})),document.body.addEventListener("focusout",(e=>{e.target&&e.target instanceof Element&&"input"===e.target.tagName.toLowerCase()&&Ir.flush()}));const ya=(0,I.subscribe)((async()=>{await _a()&&(ya(),(0,I.subscribe)(ma,ha))}),ha),Sa=v,Aa=(0,D.getSetting)("collectableMethodIds",[]),Pa=e=>e.customerId,Ta=e=>e.customerPassword,Ra=e=>e.orderId,Ia=e=>e.orderNotes,Ca=e=>e.redirectUrl,fa=e=>e.useShippingAsBilling,va=e=>e.editingBillingAddress,ba=e=>e.editingShippingAddress,Da=e=>e.extensionData,wa=e=>e.shouldCreateAccount,Oa=e=>e.additionalFields,Ma=e=>e.status,Na=e=>e.hasError,ka=e=>!!e.orderId,xa=e=>e.status===br.COMPLETE,La=e=>e.status===br.IDLE,Ha=e=>e.status===br.BEFORE_PROCESSING,Ua=e=>e.status===br.AFTER_PROCESSING,ja=e=>e.status===br.PROCESSING,Fa=e=>e.calculatingCount>0,Ya=e=>{if(void 0===e.prefersCollection){const e=(0,I.select)(v).getShippingRates();if(!e||!e.length)return!1;const r=e[0].shipping_rates.find((e=>e.selected));if((0,ve.objectHasProp)(r,"method_id")&&(0,ve.isString)(r.method_id))return t=r?.method_id,!!M&&(Array.isArray(t)?!!t.find((e=>Aa.includes(e))):Aa.includes(t))}var t;return e.prefersCollection},Ga="DECREMENT_CALCULATING",Va="INCREMENT_CALCULATING",Ba="SET_ADDITIONAL_FIELDS",qa="SET_AFTER_PROCESSING",za="SET_BEFORE_PROCESSING",Ka="SET_CHECKOUT_COMPLETE",Qa="SET_CHECKOUT_CUSTOMER_ID",Wa="SET_CHECKOUT_CUSTOMER_PASSWORD",Xa="SET_EXTENSION_DATA",$a="SET_CHECKOUT_HAS_ERROR",Za="SET_IDLE",Ja="SET_CHECKOUT_ORDER_NOTES",ei="SET_PREFERS_COLLECTION",ti="SET_CHECKOUT_IS_PROCESSING",ri="SET_REDIRECT_URL",si="SET_SHOULD_CREATE_ACCOUNT",ai="SET_USE_SHIPPING_AS_BILLING",ii="SET_EDITING_BILLING_ADDRESS",ni="SET_EDITING_SHIPPING_ADDRESS",oi=window.wc.blocksCheckoutEvents;let ci=new AbortController;function di(){ci.abort(),ci=new AbortController,da()}const li=e=>({dispatch:t})=>{const r=(e=>{const t={message:"",paymentStatus:"not set",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((({key:e,value:r})=>{t.paymentDetails[e]=(0,Fe.decodeEntities)(r)}))),"message"in e&&(t.message=(0,Fe.decodeEntities)(e.message)),!t.message&&"data"in e&&"status"in e.data&&e.data.status>299&&(t.message=(0,f.__)("Something went wrong. Please contact us to get assistance.","woocommerce")),t})(e);t.__internalSetRedirectUrl(r?.redirectUrl||""),(0,I.dispatch)(ua).__internalSetPaymentResult(r),t.__internalSetAfterProcessing()},pi=({setValidationErrors:e})=>({dispatch:t,registry:r})=>{const{createErrorNotice:s}=r.dispatch(R.store);((e,t)=>{const r=(0,I.select)("core/notices").getNotices(t),{removeNotice:s}=(0,I.dispatch)("core/notices");r.filter((e=>"error"===e.status)).forEach((e=>s(e.id,t)))})(),oi.checkoutEventsEmitter.emit(oi.CHECKOUT_EVENTS.CHECKOUT_VALIDATION).then((r=>{0===r.length||r.every(ve.isSuccessResponse)?t.__internalSetProcessing():(r.forEach((({errorMessage:t,validationErrors:r,context:a="wc/checkout"})=>{"string"==typeof t&&t&&s(t,{context:a}),(0,ve.isValidValidationErrorsObject)(r)&&e(r)})),t.__internalSetIdle(),t.__internalSetHasError())}))},ui=({notices:e})=>({select:t,dispatch:r,registry:s})=>{const{createErrorNotice:a}=s.dispatch(R.store),i={redirectUrl:t.getRedirectUrl(),orderId:t.getOrderId(),customerId:t.getCustomerId(),orderNotes:t.getOrderNotes(),processingResponse:(0,I.select)(ua).getPaymentResult()};t.hasError()?oi.checkoutEventsEmitter.emitWithAbort(oi.CHECKOUT_EVENTS.CHECKOUT_FAIL,i).then((t=>{(({observerResponses:e,notices:t,dispatch:r,createErrorNotice:s,data:a})=>{const i=(({observerResponses:e,createErrorNotice:t})=>{let r=null;return e.forEach((e=>{if(((0,ve.isErrorResponse)(e)||(0,ve.isFailResponse)(e))&&e.message&&(0,ve.isString)(e.message)){const s=e.messageContext&&(0,ve.isString)(e.messageContext)?{context:e.messageContext}:void 0;r=e,t(e.message,s)}})),r})({observerResponses:e,createErrorNotice:s});null!==i?Qe(i)?r.__internalSetIdle():r.__internalSetComplete(i):(t.checkoutNotices.some((e=>"error"===e.status))||t.expressPaymentNotices.some((e=>"error"===e.status))||t.paymentNotices.some((e=>"error"===e.status))||s(a.processingResponse?.message||(0,f.__)("Something went wrong. Please contact us to get assistance.","woocommerce"),{id:"checkout",context:"wc/checkout"}),r.__internalSetIdle())})({observerResponses:t,notices:e,dispatch:r,createErrorNotice:a,data:i})})):oi.checkoutEventsEmitter.emitWithAbort(oi.CHECKOUT_EVENTS.CHECKOUT_SUCCESS,i).then((e=>{(({observerResponses:e,dispatch:t,createErrorNotice:r})=>{let s=null,a=null;if(e.forEach((e=>{(0,ve.isSuccessResponse)(e)&&(s=e),((0,ve.isErrorResponse)(e)||(0,ve.isFailResponse)(e))&&(a=e)})),s&&!a)t.__internalSetComplete(s);else if((0,ve.isObject)(a)){if(a.message&&(0,ve.isString)(a.message)){const e=a.messageContext&&(0,ve.isString)(a.messageContext)?{context:a.messageContext}:void 0;r(a.message,e)}Qe(a)?t.__internalSetHasError(!0):t.__internalSetComplete(a)}else t.__internalSetComplete()})({observerResponses:e,dispatch:r,createErrorNotice:a})}))},_i=e=>async({registry:t})=>{const{receiveCartContents:r}=t.dispatch(Sa);try{const t=await mt({path:"/wc/store/v1/checkout?__experimental_calc_totals=true",method:"PUT",data:e,signal:ci.signal});return t?.response?.__experimentalCart&&r(t.response.__experimentalCart),t}catch(e){return Promise.reject(e)}},mi=e=>async({dispatch:t})=>{t.__internalStartCalculation();try{return await e()}finally{t.__internalFinishCalculation()}},Ei=()=>({type:Za}),hi=()=>({type:za}),gi=()=>({type:ti}),yi=()=>({type:qa}),Si=(e={})=>({type:Ka,data:e}),Ai=e=>({type:ri,redirectUrl:e}),Pi=(e=!0)=>({type:$a,hasError:e}),Ti=()=>({type:Va}),Ri=()=>({type:Ga}),Ii=()=>(Yr()("__internalIncrementCalculating",{alternative:"disableCheckoutFor",plugin:"WooCommerce",version:"9.9.0"}),{type:Va}),Ci=()=>(Yr()("__internalDecrementCalculating",{alternative:"disableCheckoutFor",plugin:"WooCommerce",version:"9.9.0"}),{type:Ga}),fi=e=>({type:Qa,customerId:e}),vi=e=>({type:Wa,customerPassword:e}),bi=e=>({type:ai,useShippingAsBilling:e}),Di=e=>({type:ii,isEditing:e}),wi=e=>({type:ni,isEditing:e}),Oi=e=>({type:si,shouldCreateAccount:e}),Mi=e=>({type:Ba,additionalFields:e}),Ni=e=>({type:Ja,orderNotes:e}),ki=e=>({type:ei,prefersCollection:e}),xi=(e,t,r=!1)=>({type:Xa,extensionData:t,namespace:e,replace:r}),Li=(...e)=>(Yr()("__internalSetExtensionData",{alternative:"setExtensionData",plugin:"WooCommerce",version:"9.9.0"}),xi(...e)),Hi=!(!Dr.billing_address.address_1||!Dr.billing_address.first_name&&!Dr.billing_address.last_name),Ui=!(!Dr.shipping_address.address_1||!Dr.shipping_address.first_name&&!Dr.shipping_address.last_name),ji=(Fi=Dr.billing_address,Yi=Dr.shipping_address,j.every((e=>Fi[e]===Yi[e])));var Fi,Yi;const Gi={additionalFields:Dr.additional_fields||{},calculatingCount:0,customerId:Dr.customer_id,customerPassword:"",extensionData:{},hasError:!1,orderId:Dr.order_id,orderNotes:Dr.customer_note||"",prefersCollection:void 0,redirectUrl:"",shouldCreateAccount:!1,status:br.IDLE,useShippingAsBilling:ji,editingBillingAddress:!Hi,editingShippingAddress:!Ui},Vi={reducer:(e=Gi,t)=>{let r=e;switch(t.type){case Za:r=e.status!==br.IDLE?{...e,status:br.IDLE}:e;break;case ri:r=void 0!==t.redirectUrl&&t.redirectUrl!==e.redirectUrl?{...e,redirectUrl:t.redirectUrl}:e;break;case Ka:r={...e,status:br.COMPLETE,redirectUrl:"string"==typeof t.data?.redirectUrl?t.data.redirectUrl:e.redirectUrl};break;case ti:r={...e,status:br.PROCESSING,hasError:!1};break;case za:r={...e,status:br.BEFORE_PROCESSING,hasError:!1};break;case qa:r={...e,status:br.AFTER_PROCESSING};break;case $a:r={...e,hasError:t.hasError,status:e.status===br.PROCESSING||e.status===br.BEFORE_PROCESSING?br.IDLE:e.status};break;case Va:r={...e,calculatingCount:e.calculatingCount+1};break;case Ga:r={...e,calculatingCount:Math.max(0,e.calculatingCount-1)};break;case Qa:void 0!==t.customerId&&(r={...e,customerId:t.customerId});break;case Wa:void 0!==t.customerPassword&&(r={...e,customerPassword:t.customerPassword});break;case Ba:void 0!==t.additionalFields&&(r={...e,additionalFields:{...e.additionalFields,...t.additionalFields}});break;case ai:void 0!==t.useShippingAsBilling&&t.useShippingAsBilling!==e.useShippingAsBilling&&(r={...e,useShippingAsBilling:t.useShippingAsBilling});break;case ii:r={...e,editingBillingAddress:t.isEditing};break;case ni:r={...e,editingShippingAddress:t.isEditing};break;case si:void 0!==t.shouldCreateAccount&&t.shouldCreateAccount!==e.shouldCreateAccount&&(r={...e,shouldCreateAccount:t.shouldCreateAccount});break;case ei:void 0!==t.prefersCollection&&t.prefersCollection!==e.prefersCollection&&(r={...e,prefersCollection:t.prefersCollection});break;case Ja:void 0!==t.orderNotes&&e.orderNotes!==t.orderNotes&&(r={...e,orderNotes:t.orderNotes});break;case Xa:void 0!==t.extensionData&&void 0!==t.namespace&&(r={...e,extensionData:{...e.extensionData,[t.namespace]:t.replace?t.extensionData:{...e.extensionData[t.namespace],...t.extensionData}}})}return r},selectors:p,actions:u,__experimentalUseThunks:!0},Bi=(0,I.createReduxStore)(vr,Vi);(0,I.register)(Bi),(0,I.subscribe)(ca,Bi);const qi=vr,zi="wc/store/collections",Ki=[],Qi=(e,t)=>!!t&&!!t.reduce(((e,t)=>"object"==typeof e&&null!==e?e[t]:void 0),e);function Wi(e,t){return Qi(e,t)}const Xi=({state:e,namespace:t,resourceName:r,query:s,ids:a,type:i="items",fallback:n=Ki})=>Wi(e,[t,r,a=JSON.stringify(a),s=null!==s?(0,gt.addQueryArgs)("",s):"",i])?e[t][r][a][s][i]:n,$i=(e,t,r,s=null,a=Ki)=>Xi({state:e,namespace:t,resourceName:r,query:s,ids:a}),Zi=(e,t,r,s=null,a=Ki)=>Xi({state:e,namespace:t,resourceName:r,query:s,ids:a,type:"error",fallback:null}),Ji=(e,t,r,s,a=null,i=Ki)=>{const n=((e,t,r,s=null,a=Ki)=>Xi({state:e,namespace:t,resourceName:r,query:s,ids:a,type:"headers",fallback:void 0}))(e,r,s,a,i);return n&&n.get?n.has(t)?n.get(t):void 0:null},en=e=>e.lastModified||0,tn={RECEIVE_COLLECTION:"RECEIVE_COLLECTION",RESET_COLLECTION:"RESET_COLLECTION",ERROR:"ERROR",RECEIVE_LAST_MODIFIED:"RECEIVE_LAST_MODIFIED",INVALIDATE_RESOLUTION_FOR_STORE:"INVALIDATE_RESOLUTION_FOR_STORE"};let rn=window.Headers||null;function sn(e,t,r="",s=[],a={items:[],headers:rn},i=!1){return{type:i?tn.RESET_COLLECTION:tn.RECEIVE_COLLECTION,namespace:e,resourceName:t,queryString:r,ids:s,response:a}}function an(e,t,r,s,a){return{type:"ERROR",namespace:e,resourceName:t,queryString:r,ids:s,response:{items:[],headers:rn,error:a}}}function nn(e){return{type:tn.RECEIVE_LAST_MODIFIED,timestamp:e}}rn=rn?new rn:{get:()=>{},has:()=>{}};const on="wc/store/schema";function*cn(e,t,r,s){const a=yield I.controls.resolveSelect(on,"getRoute",e,t,s),i=(0,gt.addQueryArgs)("",r);if(a)try{const{response:r=Ki,headers:n}=yield pt({path:a+i});n&&n.get&&n.has("last-modified")&&(yield function*(e){const t=yield I.controls.resolveSelect(zi,"getCollectionLastModified");t?e>t&&(yield I.controls.dispatch(zi,"invalidateResolutionForStore"),yield I.controls.dispatch(zi,"receiveLastModified",e)):yield I.controls.dispatch(zi,"receiveLastModified",e)}(parseInt(n.get("last-modified"),10))),yield sn(e,t,i,s,{items:r,headers:n})}catch(r){yield an(e,t,i,s,r)}else yield sn(e,t,i,s)}function*dn(e,t,r,s,a){const i=[t,r,s,a].filter((e=>void 0!==e));yield I.controls.resolveSelect(zi,"getCollection",...i)}function ln(e,t,r,s=0){const a=t[s];if(s===t.length-1)return{...e,[a]:r};const i=e[a]||{};return{...e,[a]:ln(i,t,r,s+1)}}function pn(e,t,r){return ln(e,t,r)}const un={reducer:(e={},t)=>{if(t.type===tn.RECEIVE_LAST_MODIFIED)return t.timestamp===e.lastModified?e:{...e,lastModified:t.timestamp};if(t.type===tn.INVALIDATE_RESOLUTION_FOR_STORE)return{};const{type:r,namespace:s,resourceName:a,queryString:i,response:n}=t,o=t.ids?JSON.stringify(t.ids):"[]";switch(r){case tn.RECEIVE_COLLECTION:if(Wi(e,[s,a,o,i]))return e;e=pn(e,[s,a,o,i],n);break;case tn.RESET_COLLECTION:case tn.ERROR:e=pn(e,[s,a,o,i],n)}return e},actions:m,controls:{...C.controls,...Et},selectors:_,resolvers:E},mn=(0,I.createReduxStore)(zi,un);(0,I.register)(mn);const En=zi,hn="wc/store/query-state",gn=(e,t)=>void 0===e[t]?null:e[t],yn=(e,t,r,s={})=>{let a=gn(e,t);return null===a?s:(a=JSON.parse(a),void 0!==a[r]?a[r]:s)},Sn=(e,t,r={})=>{const s=gn(e,t);return null===s?r:JSON.parse(s)},An="SET_QUERY_KEY_VALUE",Pn="SET_QUERY_CONTEXT_VALUE",Tn=(e,t,r)=>({type:An,context:e,queryKey:t,value:r}),Rn=(e,t)=>({type:Pn,context:e,value:t}),In={reducer:(e={},t)=>{const{type:r,context:s,queryKey:a,value:i}=t,n=gn(e,s);let o;switch(r){case An:const t=null!==n?JSON.parse(n):{};t[a]=i,o=JSON.stringify(t),n!==o&&(e={...e,[s]:o});break;case Pn:o=JSON.stringify(i),n!==o&&(e={...e,[s]:o})}return e},actions:g,selectors:h},Cn=(0,I.createReduxStore)(hn,In);(0,I.register)(Cn);const fn=hn,vn=(0,I.createRegistrySelector)((e=>(t,r,s,a=[])=>{const i=e(on).hasFinishedResolution("getRoutes",[r]);let n="";if((t=t.routes)[r]?t[r][s]||(n=(0,f.sprintf)("There is no route for the given resource name (%s) in the store",s)):n=(0,f.sprintf)("There is no route for the given namespace (%s) in the store",r),""!==n){if(i)throw new Error(n);return""}const o=((e,t=[])=>{const r=(e=Object.entries(e)).find((([,e])=>t.length===e.length)),[s,a]=r||[];return s?0===t.length?s:((e,t,r)=>(t.forEach(((t,s)=>{e=e.replace(`{${t}}`,r[s])})),e))(s,a,t):""})(t[r][s],a);if(""===o&&i)throw new Error((0,f.sprintf)("While there is a route for the given namespace (%1$s) and resource name (%2$s), there is no route utilizing the number of ids you included in the select arguments. The available routes are: (%3$s)",r,s,JSON.stringify(t[r][s])));return o})),bn=(0,I.createRegistrySelector)((e=>(t,r)=>{const s=e(on).hasFinishedResolution("getRoutes",[r]),a=t.routes[r];if(!a){if(s)throw new Error((0,f.sprintf)("There is no route for the given namespace (%s) in the store",r));return[]}let i=[];for(const e in a)i=[...i,...Object.keys(a[e])];return i})),Dn={RECEIVE_MODEL_ROUTES:"RECEIVE_MODEL_ROUTES"};function wn(e,t=G){return{type:Dn.RECEIVE_MODEL_ROUTES,routes:e,namespace:t}}function*On(e){yield I.controls.resolveSelect(on,"getRoutes",e)}function*Mn(e){const t=yield(0,C.apiFetch)({path:e}),r=t&&t.routes?Object.keys(t.routes):[];yield wn(r,e)}const Nn={reducer:(0,I.combineReducers)({routes:(e={},t)=>{const{type:r,routes:s,namespace:a}=t;return r===Dn.RECEIVE_MODEL_ROUTES&&s.forEach((t=>{const r=((e,t)=>(t=t.replace(`${e}/`,"")).replace(/\/\(\?P\<[a-z_]*\>\[\\*[a-z]\]\+\)/g,""))(a,t);if(r&&r!==a){const s=(e=>{const t=e.match(/\<[a-z_]*\>/g);return Array.isArray(t)&&0!==t.length?t.map((e=>e.replace(/<|>/g,""))):[]})(t),i=((e,t)=>Array.isArray(t)&&0!==t.length?(t.forEach((t=>{const r=`\\(\\?P<${t}>.*?\\)`;e=e.replace(new RegExp(r),`{${t}}`)})),e):e)(t,s);Wi(e,[a,r,i])||(e=pn(e,[a,r,i],s))}})),e}}),actions:S,controls:C.controls,selectors:y,resolvers:A},kn=(0,I.createReduxStore)(on,Nn);(0,I.register)(kn);const xn=on;let Ln=function(e){return e.REGISTER_CONTAINER="REGISTER_CONTAINER",e.UNREGISTER_CONTAINER="UNREGISTER_CONTAINER",e}({});const Hn=e=>({type:Ln.REGISTER_CONTAINER,containerContext:e}),Un=e=>({type:Ln.UNREGISTER_CONTAINER,containerContext:e}),jn=e=>e.containers,Fn={containers:[]},Yn="wc/store/store-notices",Gn={reducer:(e=Fn,t)=>{switch(t.type){case Ln.REGISTER_CONTAINER:return{...e,containers:[...e.containers,t.containerContext]};case Ln.UNREGISTER_CONTAINER:const r=e.containers.filter((e=>e!==t.containerContext));return{...e,containers:r}}return e},actions:P,selectors:T},Vn=(0,I.createReduxStore)(Yn,Gn);(0,I.register)(Vn);const Bn=Yn;(this.wc=this.wc||{}).wcBlocksData=s})();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка