diff --git a/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js b/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js index 27e442e6a..d57677c20 100644 --- a/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js +++ b/scripts/__dropins__/storefront-order/chunks/confirmCancelOrder.js @@ -1,6 +1,6 @@ /*! Copyright 2024 Adobe All Rights Reserved. */ -import{h as O}from"./network-error.js";import{f as s,h as E}from"./fetch-graphql.js";import{R as f}from"./fragments.js";import{G as _}from"./getGuestOrder.graphql.js";import{events as a}from"@dropins/tools/event-bus.js";import{b as I}from"./transform-customer-orders-returns.js";const T=` +import{h as O}from"./network-error.js";import{f as s,h as E}from"./fetch-graphql.js";import{R as f}from"./fragments.js";import{G as a}from"./getGuestOrder.graphql.js";import{events as _}from"@dropins/tools/event-bus.js";import{b as l}from"./transform-customer-orders-returns.js";const I=` mutation REORDER_ITEMS_MUTATION($orderNumber: String!) { reorderItems(orderNumber: $orderNumber) { cart { @@ -17,7 +17,7 @@ mutation REORDER_ITEMS_MUTATION($orderNumber: String!) { } } } -`,S=async o=>await s(T,{method:"POST",variables:{orderNumber:o}}).then(e=>{var i,n,m,c,u,R;if((i=e.errors)!=null&&i.length)return E(e.errors);const t=!!((c=(m=(n=e==null?void 0:e.data)==null?void 0:n.reorderItems)==null?void 0:m.cart)!=null&&c.itemsV2.items.length),r=((R=(u=e==null?void 0:e.data)==null?void 0:u.reorderItems)==null?void 0:R.userInputErrors)??[];return{success:t,userInputErrors:r}}).catch(O),l=` +`,S=async i=>await s(I,{method:"POST",variables:{orderNumber:i}}).then(e=>{var t,o,c,m,u,R;if((t=e.errors)!=null&&t.length)return E(e.errors);const n=!!((m=(c=(o=e==null?void 0:e.data)==null?void 0:o.reorderItems)==null?void 0:c.cart)!=null&&m.itemsV2.items.length),r=((R=(u=e==null?void 0:e.data)==null?void 0:u.reorderItems)==null?void 0:R.userInputErrors)??[];return{success:n,userInputErrors:r}}).catch(O),T=` mutation CONFIRM_RETURN_GUEST_ORDER($input: ConfirmReturnInput!) { confirmReturn(input: $input) { return { @@ -25,7 +25,7 @@ mutation CONFIRM_RETURN_GUEST_ORDER($input: ConfirmReturnInput!) { } } } -${f}`,$=async(o,e)=>await s(l,{method:"POST",variables:{input:{orderId:o,confirmationKey:e}}}).then(t=>{var r;return(r=t.errors)!=null&&r.length?E(t.errors):t.data}).catch(O),d=` +${f}`,$=async(i,e)=>{const n={orderId:i,confirmationKey:e};return alert(n),await s(T,{method:"POST",variables:{input:n}}).then(r=>{var t;return(t=r.errors)!=null&&t.length?E(r.errors):r.data}).catch(O)},d=` mutation CONFIRM_CANCEL_ORDER_MUTATION( $orderId: ID!, $confirmationKey: String! @@ -43,5 +43,5 @@ ${f}`,$=async(o,e)=>await s(l,{method:"POST",variables:{input:{orderId:o,confirm } } } -${_} -`,g=async(o,e)=>s(d,{variables:{orderId:o,confirmationKey:e}}).then(async({errors:t,data:r})=>{var m,c,u,R;const i=[...(m=r==null?void 0:r.confirmCancelOrder)!=null&&m.errorV2?[(c=r==null?void 0:r.confirmCancelOrder)==null?void 0:c.errorV2]:[],...t??[]];let n=null;return(u=r==null?void 0:r.confirmCancelOrder)!=null&&u.order&&(n=I((R=r==null?void 0:r.confirmCancelOrder)==null?void 0:R.order),a.emit("order/data",n)),i.length>0?E(i):n});export{$ as a,g as c,S as r}; +${a} +`,g=async(i,e)=>s(d,{variables:{orderId:i,confirmationKey:e}}).then(async({errors:n,data:r})=>{var c,m,u,R;const t=[...(c=r==null?void 0:r.confirmCancelOrder)!=null&&c.errorV2?[(m=r==null?void 0:r.confirmCancelOrder)==null?void 0:m.errorV2]:[],...n??[]];let o=null;return(u=r==null?void 0:r.confirmCancelOrder)!=null&&u.order&&(o=l((R=r==null?void 0:r.confirmCancelOrder)==null?void 0:R.order),_.emit("order/data",o)),t.length>0?E(t):o});export{$ as a,g as c,S as r};