module.exports=[285459,a=>{"use strict";var b,c=a.i(187924),d=a.i(572131);(b={}).UpdateDeliveryType="UPDATE_DELIVERY_TYPE",b.UpdateDeliveryPoint="UPDATE_DELIVERY_POINT",b.UpdatePaymentMethod="UPDATE_PAYMENT_METHOD",b.UpdateDeliverDate="UPDATE_DELIVERY_DATE",b.UpdateDeliveryAddress="UPDATE_DELIVERY_ADDRESS",b.ClearState="CLEAR_STATE",b.UpdateProductNote="UPDATE_PRODUCT_NOTE",b.UpdateShopNote="UPDATE_SHOP_NOTE",b.UpdateShopCoupon="UPDATE_SHOP_COUPON",b.DeleteShopCoupon="DELETE_SHOP_COUPON",b.UpdateTips="UPDATE_TIPS",b.UpdateFromWalletPrice="UPDATE_FROM_WALLET_PRICE";let e=(a,b)=>{switch(b.type){case"UPDATE_DELIVERY_TYPE":return{...a,deliveryType:b.payload.type};case"UPDATE_DELIVERY_POINT":return{...a,deliveryPoint:b.payload.point};case"UPDATE_PAYMENT_METHOD":return{...a,paymentMethod:b.payload.paymentMethod};case"UPDATE_DELIVERY_DATE":return{...a,deliveryDate:b.payload.date};case"UPDATE_DELIVERY_ADDRESS":return{...a,deliveryAddress:b.payload.address,deliveryPrice:b.payload.deliveryPrice};case"UPDATE_PRODUCT_NOTE":return{...a,notes:{...a.notes,[b.payload.stockId]:b.payload.note}};case"UPDATE_SHOP_NOTE":return{...a,shopNotes:{...a.shopNotes,[b.payload.shopId]:b.payload.note}};case"UPDATE_SHOP_COUPON":return{...a,coupons:{...a.coupons,[b.payload.shopId]:b.payload.name}};case"DELETE_SHOP_COUPON":{let c={...a.coupons};return delete c?.[b.payload.shopId],{...a,coupons:c}}case"UPDATE_TIPS":return{...a,tips:b.payload.tips};case"UPDATE_FROM_WALLET_PRICE":return{...a,fromWalletPrice:b.payload.fromWalletPrice};case"CLEAR_STATE":return{deliveryType:"delivery",deliveryPoint:void 0,deliveryPrice:void 0,deliveryAddress:void 0,paymentMethod:void 0,deliveryDate:new Date(Date.now()),notes:b.payload.all?{}:a.notes,shopNotes:b.payload.all?{}:a.shopNotes,coupons:b.payload.all?{}:a.coupons,fromWalletPrice:void 0};default:return a}},f={deliveryType:"delivery",deliveryDate:new Date(Date.now()),notes:{},shopNotes:{},coupons:{}},g=(0,d.createContext)({state:f,dispatch:()=>null});a.s(["default",0,({children:a})=>{let[b,h]=(0,d.useReducer)(e,f),i=(0,d.useMemo)(()=>({state:b,dispatch:h}),[b]);return(0,c.jsx)(g.Provider,{value:i,children:a})},"useCheckout",0,()=>{let a=(0,d.useContext)(g);if(!a)throw Error("useCheckout has to be used within <CheckoutContext.Provider>");return a}],285459)}];

//# sourceMappingURL=context_checkout_checkout_context_tsx_9fc7b541._.js.map