From cc98b47be0adeb752f309df23fc4db8410becf99 Mon Sep 17 00:00:00 2001 From: Konstantin Fandelyuk Date: Tue, 12 Nov 2024 22:02:09 +0200 Subject: [PATCH] test bug? 9 --- scripts/__dropins__/storefront-order/api.js | 14 +++++++------- .../getOrderDetailsById.d.ts | 3 ++- .../api/requestReturn/graphql/fragments.d.ts | 2 ++ .../graphql/requestReturn.graphql.d.ts | 2 +- .../chunks/CartSummaryItem.js | 2 +- .../chunks/getAttributesForm.js | 2 +- .../chunks/getGuestOrder.graphql.js | 1 + .../storefront-order/chunks/requestReturn.js | 19 ++++++++++++------- .../chunks/returnOrdersHelper.js | 2 +- .../chunks/transform-attributes-form.js | 2 +- .../containers/CreateReturn.js | 2 +- .../containers/OrderProductList.js | 2 +- .../containers/ShippingStatus.js | 2 +- .../transforms/transform-attributes-form.d.ts | 2 +- scripts/__dropins__/storefront-order/reload | 2 +- .../__dropins__/storefront-order/render.js | 2 +- .../types/api/getOrderDetails.types.d.ts | 8 ++++++++ 17 files changed, 43 insertions(+), 26 deletions(-) create mode 100644 scripts/__dropins__/storefront-order/api/requestReturn/graphql/fragments.d.ts diff --git a/scripts/__dropins__/storefront-order/api.js b/scripts/__dropins__/storefront-order/api.js index a86d37ce46..45f78abffa 100644 --- a/scripts/__dropins__/storefront-order/api.js +++ b/scripts/__dropins__/storefront-order/api.js @@ -1,5 +1,5 @@ -import{Initializer as I}from"@dropins/tools/lib.js";import{events as d}from"@dropins/tools/event-bus.js";import{f as n,h as m}from"./chunks/fetch-graphql.js";import{g as U,r as q,s as z,a as Y,b as Q}from"./chunks/fetch-graphql.js";import{h as l}from"./chunks/network-error.js";import{P as u,a as _,G as p,O as c,B as O,R as D,c as b}from"./chunks/transform-order-details.js";import{O as h,A as R}from"./chunks/getGuestOrder.graphql.js";import{t as f}from"./chunks/getCustomer.js";import{g as K,a as j}from"./chunks/getCustomer.js";import{g as V}from"./chunks/getAttributesForm.js";import{g as X}from"./chunks/getStoreConfig.js";import{g as ee}from"./chunks/getCustomerOrdersReturn.js";import{g as te,r as ae}from"./chunks/requestReturn.js";import{c as de,r as oe}from"./chunks/requestGuestOrderCancel.js";import{r as ne}from"./chunks/reorderItems.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/convertCase.js";import"./chunks/transform-attributes-form.js";const G=` -query ORDER_BY_NUMBER($orderNumber: String!) { +import{Initializer as I}from"@dropins/tools/lib.js";import{events as o}from"@dropins/tools/event-bus.js";import{f as n,h as m}from"./chunks/fetch-graphql.js";import{g as U,r as Y,s as q,a as Q,b as H}from"./chunks/fetch-graphql.js";import{h as l}from"./chunks/network-error.js";import{P as u,a as _,G as p,O as c,B as O,R as D,c as b}from"./chunks/transform-order-details.js";import{O as R,A as h}from"./chunks/getGuestOrder.graphql.js";import{t as T}from"./chunks/getCustomer.js";import{g as j,a as J}from"./chunks/getCustomer.js";import{g as W}from"./chunks/getAttributesForm.js";import{g as Z}from"./chunks/getStoreConfig.js";import{g as re}from"./chunks/getCustomerOrdersReturn.js";import{g as ae,r as se}from"./chunks/requestReturn.js";import{c as oe,r as ie}from"./chunks/requestGuestOrderCancel.js";import{r as me}from"./chunks/reorderItems.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/convertCase.js";import"./chunks/transform-attributes-form.js";const G=` +query ORDER_BY_NUMBER($orderNumber: String!, $pageSize: Int) { customer { orders( filter: { number: { eq: $orderNumber } } @@ -15,7 +15,7 @@ query ORDER_BY_NUMBER($orderNumber: String!) { carrier shipping_method is_virtual - returns(pageSize: 50) { + returns(pageSize: $pageSize) { ...OrderReturns } items_eligible_for_return { @@ -108,10 +108,10 @@ ${_} ${p} ${c} ${O} -${h} ${R} +${h} ${D} -`,T=async(e,r,t)=>await n(G,{method:"GET",cache:"force-cache",variables:{orderNumber:e}}).then(a=>{var s;return(s=a.errors)!=null&&s.length?m(a.errors):b(t??"orderData",a,r)}).catch(l),g=` +`,y=async({orderId:e,returnRef:r,queryType:t,returnsPageSize:a=50})=>await n(G,{method:"GET",cache:"force-cache",variables:{orderNumber:e,pageSize:a}}).then(s=>{var d;return(d=s.errors)!=null&&d.length?m(s.errors):b(t??"orderData",s,r)}).catch(l),f=` query ORDER_BY_TOKEN($token: String!) { guestOrderByToken(input: { token: $token }) { email @@ -205,7 +205,7 @@ ${_} ${p} ${c} ${O} -${h} ${R} +${h} ${D} -`,A=async(e,r)=>await n(g,{method:"GET",cache:"no-cache",variables:{token:e}}).then(t=>{var a;return(a=t.errors)!=null&&a.length?m(t.errors):f(t,r)}).catch(l),y=async e=>{var i;const r=(e==null?void 0:e.orderRef)??"",t=(e==null?void 0:e.returnRef)??"",a=r&&typeof(e==null?void 0:e.orderRef)=="string"&&((i=e==null?void 0:e.orderRef)==null?void 0:i.length)>20,s=(e==null?void 0:e.orderData)??null;if(s){d.emit("order/data",{...s,returnNumber:t});return}if(!r){console.error("Order Token or number not received.");return}const o=a?await A(r,t):await T(r,t,"orderData");o?d.emit("order/data",{...o,returnNumber:t}):d.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},E=new I({init:async e=>{const r={};E.config.setConfig({...r,...e}),y(e).catch(console.error)},listeners:()=>[]}),v=E.config;export{de as cancelOrder,v as config,n as fetchGraphQl,V as getAttributesForm,te as getAttributesList,U as getConfig,K as getCustomer,ee as getCustomerOrdersReturn,j as getGuestOrder,T as getOrderDetailsById,X as getStoreConfig,A as guestOrderByToken,E as initialize,q as removeFetchGraphQlHeader,ne as reorderItems,oe as requestGuestOrderCancel,ae as requestReturn,z as setEndpoint,Y as setFetchGraphQlHeader,Q as setFetchGraphQlHeaders}; +`,$=async(e,r)=>await n(f,{method:"GET",cache:"no-cache",variables:{token:e}}).then(t=>{var a;return(a=t.errors)!=null&&a.length?m(t.errors):T(t,r)}).catch(l),A="orderData",C=async e=>{var i;const r=typeof(e==null?void 0:e.orderRef)=="string"?e==null?void 0:e.orderRef:"",t=typeof(e==null?void 0:e.returnRef)=="string"?e==null?void 0:e.returnRef:"",a=r&&typeof(e==null?void 0:e.orderRef)=="string"&&((i=e==null?void 0:e.orderRef)==null?void 0:i.length)>20,s=(e==null?void 0:e.orderData)??null;if(s){o.emit("order/data",{...s,returnNumber:t});return}if(!r){console.error("Order Token or number not received.");return}const d=a?await $(r,t):await y({orderId:r,returnRef:t,queryType:A});d?o.emit("order/data",{...d,returnNumber:t}):o.emit("order/error",{source:"order",type:"network",error:"The data was not received."})},E=new I({init:async e=>{const r={};E.config.setConfig({...r,...e}),C(e).catch(console.error)},listeners:()=>[]}),x=E.config;export{oe as cancelOrder,x as config,n as fetchGraphQl,W as getAttributesForm,ae as getAttributesList,U as getConfig,j as getCustomer,re as getCustomerOrdersReturn,J as getGuestOrder,y as getOrderDetailsById,Z as getStoreConfig,$ as guestOrderByToken,E as initialize,Y as removeFetchGraphQlHeader,me as reorderItems,ie as requestGuestOrderCancel,se as requestReturn,q as setEndpoint,Q as setFetchGraphQlHeader,H as setFetchGraphQlHeaders}; diff --git a/scripts/__dropins__/storefront-order/api/getOrderDetailsById/getOrderDetailsById.d.ts b/scripts/__dropins__/storefront-order/api/getOrderDetailsById/getOrderDetailsById.d.ts index d06579bdaa..c9745a694c 100644 --- a/scripts/__dropins__/storefront-order/api/getOrderDetailsById/getOrderDetailsById.d.ts +++ b/scripts/__dropins__/storefront-order/api/getOrderDetailsById/getOrderDetailsById.d.ts @@ -1,4 +1,5 @@ +import { GetOrderDetailsByIdProps } from '../../types'; import { TransformedData } from '../../data/models'; -export declare const getOrderDetailsById: (orderId?: string, returnRef?: string, queryType?: T | undefined) => Promise>; +export declare const getOrderDetailsById: ({ orderId, returnRef, queryType, returnsPageSize, }: GetOrderDetailsByIdProps) => Promise>; //# sourceMappingURL=getOrderDetailsById.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/api/requestReturn/graphql/fragments.d.ts b/scripts/__dropins__/storefront-order/api/requestReturn/graphql/fragments.d.ts new file mode 100644 index 0000000000..1a06f4fcf8 --- /dev/null +++ b/scripts/__dropins__/storefront-order/api/requestReturn/graphql/fragments.d.ts @@ -0,0 +1,2 @@ +export declare const REQUEST_RETURN_ORDER_FRAGMENT = "\n fragment OrderReturn on Return {\n __typename\n uid\n status\n number\n created_at\n }\n"; +//# sourceMappingURL=fragments.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/api/requestReturn/graphql/requestReturn.graphql.d.ts b/scripts/__dropins__/storefront-order/api/requestReturn/graphql/requestReturn.graphql.d.ts index e543a059fe..2053c33748 100644 --- a/scripts/__dropins__/storefront-order/api/requestReturn/graphql/requestReturn.graphql.d.ts +++ b/scripts/__dropins__/storefront-order/api/requestReturn/graphql/requestReturn.graphql.d.ts @@ -1,2 +1,2 @@ -export declare const REQUEST_RETURN_ORDER = "\nmutation REQUEST_RETURN_ORDER($input: RequestReturnInput!) {\n requestReturn(input: $input) {\n return {\n uid\n status\n number\n created_at\n }\n }\n}\n"; +export declare const REQUEST_RETURN_ORDER: string; //# sourceMappingURL=requestReturn.graphql.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js b/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js index d97f0578f5..85b40962e3 100644 --- a/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js +++ b/scripts/__dropins__/storefront-order/chunks/CartSummaryItem.js @@ -1 +1 @@ -import{jsx as t,jsxs as E,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Price as u,CartItem as o,Icon as r,Image as U,Incrementer as c}from"@dropins/tools/components.js";import{useCallback as d}from"@dropins/tools/preact-hooks.js";import{classes as X}from"@dropins/tools/lib.js";import*as V from"@dropins/tools/preact-compat.js";const p=N=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...N},V.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),V.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ne=({loading:N,product:e,itemType:Y,taxConfig:D,translations:v,disabledIncrementer:C,showConfigurableOptions:_,onQuantity:y,routeProductDetails:b,isReturnProductList:I})=>{var H,M,Z,j,q,x,z,F,O,R,W,$,B,K,A,G,J;const{taxExcluded:S,taxIncluded:L}=D,m=d((h,T,g)=>t(u,{amount:h,currency:T,weight:"normal",...g}),[]);let k={};const Q=Y==="cancelled",P=(M=(H=e==null?void 0:e.product)==null?void 0:H.stockStatus)==null?void 0:M.includes("IN_STOCK"),l=(e==null?void 0:e.giftCard)||{},a=(Z=e==null?void 0:e.itemPrices)==null?void 0:Z.priceIncludingTax,s=(j=e==null?void 0:e.itemPrices)==null?void 0:j.originalPrice,n=(q=e==null?void 0:e.itemPrices)==null?void 0:q.price,i=e.discounted&&((x=e.price)==null?void 0:x.value)!==(s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),f={..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in l&&(l!=null&&l.senderName)?{[v.sender]:l==null?void 0:l.senderName}:{},..."senderEmail"in l&&(l!=null&&l.senderEmail)?{[v.sender]:l==null?void 0:l.senderEmail}:{},..."recipientName"in l&&(l!=null&&l.recipientName)?{[v.recipient]:l==null?void 0:l.recipientName}:{},..."recipientEmail"in l&&(l!=null&&l.recipientEmail)?{[v.recipient]:l==null?void 0:l.recipientEmail}:{},..."message"in l&&(l!=null&&l.message)?{[v.message]:l==null?void 0:l.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${(z=e==null?void 0:e.downloadableLinks)==null?void 0:z.count} ${v.downloadableCount}`]:(F=e==null?void 0:e.downloadableLinks)==null?void 0:F.result}:{}};if(L&&S){const h=i?s==null?void 0:s.value:(a==null?void 0:a.value)*(e==null?void 0:e.totalQuantity);k={taxExcluded:!0,taxIncluded:void 0,price:m(s==null?void 0:s.value,s==null?void 0:s.currency),total:E(w,{children:[m(h,s==null?void 0:s.currency,{variant:e.discounted&&(a==null?void 0:a.value)!==h?"strikethrough":"default"}),e.discounted&&(a==null?void 0:a.value)!==h?m(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:m((n==null?void 0:n.value)*e.totalQuantity,n==null?void 0:n.currency)}}else if(!L&&S)k={taxExcluded:void 0,taxIncluded:void 0,price:m(s==null?void 0:s.value,s==null?void 0:s.currency),total:E(w,{children:[m((s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),a==null?void 0:a.currency,{variant:i?"strikethrough":"default"}),i?m((O=e.price)==null?void 0:O.value,(R=e.price)==null?void 0:R.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:m((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),n==null?void 0:n.currency)};else if(L&&!S){const h=i?s.value:a.value*e.totalQuantity;k={taxExcluded:void 0,taxIncluded:!0,price:m(a==null?void 0:a.value,a==null?void 0:a.currency),total:E(w,{children:[m(h,a==null?void 0:a.currency,{variant:i?"strikethrough":"default",weight:"bold"}),i?m(a==null?void 0:a.value,a==null?void 0:a.currency,{sale:!0,weight:"bold"}):null]})}}return t(o,{loading:N,alert:Q&&P?E("span",{children:[t(r,{source:p}),v.outOfStock]}):t(w,{}),configurations:(_==null?void 0:_(f))??f,title:b?t("a",{"data-testid":"product-name",className:X(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),href:b(e),children:(W=e==null?void 0:e.product)==null?void 0:W.name}):t("div",{"data-testid":"product-name",className:X(["cart-summary-item__title",["cart-summary-item__title--strikethrough",Q]]),children:($=e==null?void 0:e.product)==null?void 0:$.name}),sku:t("div",{children:(B=e==null?void 0:e.product)==null?void 0:B.sku}),quantity:e!=null&&e.eligibleForReturn&&(e!=null&&e.returnableQuantity)?(e==null?void 0:e.returnableQuantity)??e.totalQuantity:I?void 0:e.totalQuantity,image:b?t("a",{href:b(e),children:t(U,{src:(K=e==null?void 0:e.product)==null?void 0:K.thumbnail.url,alt:(A=e==null?void 0:e.product)==null?void 0:A.thumbnail.label,loading:"lazy",width:"90",height:"120"})}):t(U,{src:(G=e==null?void 0:e.product)==null?void 0:G.thumbnail.url,alt:(J=e==null?void 0:e.product)==null?void 0:J.thumbnail.label,loading:"lazy",width:"90",height:"120"}),...k,footer:y&&!C?t(c,{value:1,min:1,max:e==null?void 0:e.returnableQuantity,onValue:h=>y==null?void 0:y(Number(h)),name:"quantity"}):void 0})};export{ne as C,p as S}; +import{jsx as t,jsxs as E,Fragment as w}from"@dropins/tools/preact-jsx-runtime.js";import{Price as u,CartItem as o,Icon as r,Image as U,Incrementer as c}from"@dropins/tools/components.js";import{useCallback as d}from"@dropins/tools/preact-hooks.js";import{classes as X}from"@dropins/tools/lib.js";import*as Q from"@dropins/tools/preact-compat.js";const p=N=>Q.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...N},Q.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),Q.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),ne=({loading:N,product:e,itemType:Y,taxConfig:D,translations:v,disabledIncrementer:C,showConfigurableOptions:_,onQuantity:y,routeProductDetails:b,isReturnProductList:I})=>{var H,M,Z,j,q,x,z,F,O,R,W,$,B,K,A,G,J;const{taxExcluded:S,taxIncluded:f}=D,m=d((h,g,T)=>t(u,{amount:h,currency:g,weight:"normal",...T}),[]);let k={};const L=Y==="cancelled",P=(M=(H=e==null?void 0:e.product)==null?void 0:H.stockStatus)==null?void 0:M.includes("IN_STOCK"),a=(e==null?void 0:e.giftCard)||{},l=(Z=e==null?void 0:e.itemPrices)==null?void 0:Z.priceIncludingTax,s=(j=e==null?void 0:e.itemPrices)==null?void 0:j.originalPrice,n=(q=e==null?void 0:e.itemPrices)==null?void 0:q.price,i=e.discounted&&((x=e.price)==null?void 0:x.value)!==(s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),V={..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in a?{[v.sender]:a==null?void 0:a.senderName}:{},..."senderEmail"in a&&(a!=null&&a.senderEmail)?{[v.sender]:a==null?void 0:a.senderEmail}:{},..."recipientName"in a&&(a!=null&&a.recipientName)?{[v.recipient]:a==null?void 0:a.recipientName}:{},..."recipientEmail"in a&&(a!=null&&a.recipientEmail)?{[v.recipient]:a==null?void 0:a.recipientEmail}:{},..."message"in a&&(a!=null&&a.message)?{[v.message]:a==null?void 0:a.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${(z=e==null?void 0:e.downloadableLinks)==null?void 0:z.count} ${v.downloadableCount}`]:(F=e==null?void 0:e.downloadableLinks)==null?void 0:F.result}:{}};if(f&&S){const h=i?s==null?void 0:s.value:(l==null?void 0:l.value)*(e==null?void 0:e.totalQuantity);k={taxExcluded:!0,taxIncluded:void 0,price:m(s==null?void 0:s.value,s==null?void 0:s.currency),total:E(w,{children:[m(h,s==null?void 0:s.currency,{variant:e.discounted&&(l==null?void 0:l.value)!==h?"strikethrough":"default"}),e.discounted&&(l==null?void 0:l.value)!==h?m(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:m((n==null?void 0:n.value)*e.totalQuantity,n==null?void 0:n.currency)}}else if(!f&&S)k={taxExcluded:void 0,taxIncluded:void 0,price:m(s==null?void 0:s.value,s==null?void 0:s.currency),total:E(w,{children:[m((s==null?void 0:s.value)*(e==null?void 0:e.totalQuantity),l==null?void 0:l.currency,{variant:i?"strikethrough":"default"}),i?m((O=e.price)==null?void 0:O.value,(R=e.price)==null?void 0:R.currency,{sale:!0,weight:"bold"}):null]}),totalExcludingTax:m((n==null?void 0:n.value)*(e==null?void 0:e.totalQuantity),n==null?void 0:n.currency)};else if(f&&!S){const h=i?s.value:l.value*e.totalQuantity;k={taxExcluded:void 0,taxIncluded:!0,price:m(l==null?void 0:l.value,l==null?void 0:l.currency),total:E(w,{children:[m(h,l==null?void 0:l.currency,{variant:i?"strikethrough":"default",weight:"bold"}),i?m(l==null?void 0:l.value,l==null?void 0:l.currency,{sale:!0,weight:"bold"}):null]})}}return t(o,{loading:N,alert:L&&P?E("span",{children:[t(r,{source:p}),v.outOfStock]}):t(w,{}),configurations:(_==null?void 0:_(V))??V,title:b?t("a",{"data-testid":"product-name",className:X(["cart-summary-item__title",["cart-summary-item__title--strikethrough",L]]),href:b(e),children:(W=e==null?void 0:e.product)==null?void 0:W.name}):t("div",{"data-testid":"product-name",className:X(["cart-summary-item__title",["cart-summary-item__title--strikethrough",L]]),children:($=e==null?void 0:e.product)==null?void 0:$.name}),sku:t("div",{children:(B=e==null?void 0:e.product)==null?void 0:B.sku}),quantity:e!=null&&e.eligibleForReturn&&(e!=null&&e.returnableQuantity)?(e==null?void 0:e.returnableQuantity)??e.totalQuantity:I?void 0:e.totalQuantity,image:b?t("a",{href:b(e),children:t(U,{src:(K=e==null?void 0:e.product)==null?void 0:K.thumbnail.url,alt:(A=e==null?void 0:e.product)==null?void 0:A.thumbnail.label,loading:"lazy",width:"90",height:"120"})}):t(U,{src:(G=e==null?void 0:e.product)==null?void 0:G.thumbnail.url,alt:(J=e==null?void 0:e.product)==null?void 0:J.thumbnail.label,loading:"lazy",width:"90",height:"120"}),...k,footer:y&&!C?t(c,{value:1,min:1,max:e==null?void 0:e.returnableQuantity,onValue:h=>y==null?void 0:y(Number(h)),name:"quantity"}):void 0})};export{ne as C,p as S}; diff --git a/scripts/__dropins__/storefront-order/chunks/getAttributesForm.js b/scripts/__dropins__/storefront-order/chunks/getAttributesForm.js index 5059874bd8..ea6549d643 100644 --- a/scripts/__dropins__/storefront-order/chunks/getAttributesForm.js +++ b/scripts/__dropins__/storefront-order/chunks/getAttributesForm.js @@ -44,4 +44,4 @@ import{h as i}from"./network-error.js";import{f as u,h as s}from"./fetch-graphql } } } -`,T=async r=>await u(r!=="shortRequest"?n:_,{method:"GET",cache:"force-cache",variables:{formCode:r}}).then(t=>{var e,o,a;return(e=t.errors)!=null&&e.length?s(t.errors):m(((a=(o=t==null?void 0:t.data)==null?void 0:o.attributesForm)==null?void 0:a.items)??[])}).catch(i);export{T as g}; +`,T=async r=>await u(r!=="shortRequest"?n:_,{method:"GET",cache:"force-cache",variables:{formCode:r}}).then(t=>{var e,o,a;return(e=t.errors)!=null&&e.length?s(t.errors):m((a=(o=t==null?void 0:t.data)==null?void 0:o.attributesForm)==null?void 0:a.items)}).catch(i);export{T as g}; diff --git a/scripts/__dropins__/storefront-order/chunks/getGuestOrder.graphql.js b/scripts/__dropins__/storefront-order/chunks/getGuestOrder.graphql.js index 21f9223939..5778d24104 100644 --- a/scripts/__dropins__/storefront-order/chunks/getGuestOrder.graphql.js +++ b/scripts/__dropins__/storefront-order/chunks/getGuestOrder.graphql.js @@ -92,6 +92,7 @@ fragment AddressesList on OrderAddress { timestamp } items { + __typename id product_sku product_name diff --git a/scripts/__dropins__/storefront-order/chunks/requestReturn.js b/scripts/__dropins__/storefront-order/chunks/requestReturn.js index bf713ed850..4e63f82b5b 100644 --- a/scripts/__dropins__/storefront-order/chunks/requestReturn.js +++ b/scripts/__dropins__/storefront-order/chunks/requestReturn.js @@ -1,4 +1,4 @@ -import{h as i}from"./network-error.js";import{f as s,h as o}from"./fetch-graphql.js";import{t as c}from"./transform-attributes-form.js";import{a as m}from"./convertCase.js";const d=` +import{h as i}from"./network-error.js";import{f as s,h as o}from"./fetch-graphql.js";import{t as R}from"./transform-attributes-form.js";import{a as c}from"./convertCase.js";const m=` query GET_ATTRIBUTES_LIST($entityType: AttributeEntityTypeEnum!) { attributesList(entityType: $entityType) { items { @@ -31,15 +31,20 @@ import{h as i}from"./network-error.js";import{f as s,h as o}from"./fetch-graphql } } } -`,E=async u=>await s(d,{method:"GET",cache:"force-cache",variables:{entityType:u}}).then(t=>{var e,r,a;return(e=t.errors)!=null&&e.length?o(t.errors):c(((a=(r=t==null?void 0:t.data)==null?void 0:r.attributesList)==null?void 0:a.items)??[])}).catch(i),l=` +`,f=async n=>await s(m,{method:"GET",cache:"force-cache",variables:{entityType:n}}).then(t=>{var e,r,a;return(e=t.errors)!=null&&e.length?o(t.errors):R((a=(r=t==null?void 0:t.data)==null?void 0:r.attributesList)==null?void 0:a.items)}).catch(i),_=` + fragment OrderReturn on Return { + __typename + uid + status + number + created_at + } +`,T=` mutation REQUEST_RETURN_ORDER($input: RequestReturnInput!) { requestReturn(input: $input) { return { - uid - status - number - created_at + ...OrderReturn } } } -`,f=async u=>{const t=m(u,"snakeCase",{});return await s(l,{method:"POST",variables:{input:t}}).then(e=>{var n;if((n=e.errors)!=null&&n.length)return o(e.errors);const{created_at:r,...a}=e.data.requestReturn.return;return{...a,createdAt:r}}).catch(i)};export{E as g,f as r}; +${_}`,y=async n=>{const t=c(n,"snakeCase",{});return await s(T,{method:"POST",variables:{input:t}}).then(e=>{var u;if((u=e.errors)!=null&&u.length)return o(e.errors);const{created_at:r,...a}=e.data.requestReturn.return;return{...a,createdAt:r}}).catch(i)};export{f as g,y as r}; diff --git a/scripts/__dropins__/storefront-order/chunks/returnOrdersHelper.js b/scripts/__dropins__/storefront-order/chunks/returnOrdersHelper.js index 7f9f88c15b..7a0c70015a 100644 --- a/scripts/__dropins__/storefront-order/chunks/returnOrdersHelper.js +++ b/scripts/__dropins__/storefront-order/chunks/returnOrdersHelper.js @@ -1 +1 @@ -import{F as c}from"./form.types.js";const p={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},y=i=>{const n={};return Object.keys(i).forEach(t=>{if(t.match(/_(\d+)$/)){const e=t.replace(/_\d+$/,"");n[e]=i[t]}else n[t]=i[t]}),n},R=(i,n)=>i.map(t=>({...t,id:`${t.id}_${t.fieldType}_${n+1}`,name:`${t.name}_${t.fieldType}_${n+1}`,code:`${t.code}_${t.fieldType}_${n+1}`,customUpperCode:`${t.customUpperCode}_${t.fieldType}_${n+1}`})),_=(i,n)=>i==null?void 0:i.flatMap(t=>Array.from({length:n},(a,e)=>({...t,id:`${t.id}_${t.fieldType}_${e+1}`,name:`${t.name}_${t.fieldType}_${e+1}`,code:`${t.code}_${t.fieldType}_${e+1}`,customUpperCode:`${t.customUpperCode}_${t.fieldType}_${e+1}`}))),$=i=>{const n=[],t=[];return Object.entries(i).forEach(([a,e])=>{const s=a.lastIndexOf("_"),r=a.slice(0,s),u=a.slice(s+1);u===c.MULTISELECT||u===c.SELECT?n.push({attributeCode:r,value:btoa(e)}):t.push({attributeCode:r,value:e})}),{selectedCustomAttributes:n,enteredCustomAttributes:t}},m=i=>typeof i!="string"?"":p[i]??"",l=["REJECTED","PARTIALLY_REJECTED","DENIED","UNCONFIRMED","CLOSED"],A=i=>{const n=i==null?void 0:i.returns.filter(e=>!l.includes(e.returnStatus));return((i==null?void 0:i.itemsEligibleForReturn)??[]).flatMap(e=>{let s=e.quantityShipped,r={...e,returnableQuantity:s};return e.quantityShipped===0&&(r={...r,eligibleForReturn:!1,returnableQuantity:0}),n.forEach(u=>{u.items.forEach(o=>{if((o==null?void 0:o.id)===(e==null?void 0:e.id)){const d=s-o.requestQuantity;s=Math.max(d,0),r={...r,eligibleForReturn:s!==0,returnableQuantity:s}}})}),r}).sort((e,s)=>Number(s.eligibleForReturn)-Number(e.eligibleForReturn))},C=i=>{var a;let n=[];return((a=i==null?void 0:i.returns)==null?void 0:a.filter(e=>!l.includes(e.returnStatus)).flatMap(e=>e.items||[])).forEach(e=>{if(!n.length)n.push({...e,totalQuantity:e.requestQuantity});else{const s=n.findIndex(r=>r.id===e.id);s!==-1?n[s].totalQuantity+=e.requestQuantity:n.push({...e,totalQuantity:e.requestQuantity})}}),{returnedList:n,modifyOrder:E(i.items,n)}};function E(i,n){return i.map(t=>{const a=n.find(e=>e.id===t.id);if(a){const e=t.totalQuantity-a.totalQuantity;return e===0?null:{...t,totalQuantity:e}}return t}).filter(t=>t!==null)}export{y as c,C as e,m as f,R as m,$ as n,A as o,_ as r}; +import{F as c}from"./form.types.js";const p={PENDING:"pending",AUTHORIZED:"authorized",PARTIALLY_AUTHORIZED:"partiallyAuthorized",RECEIVED:"received",PARTIALLY_RECEIVED:"partiallyReceived",APPROVED:"approved",PARTIALLY_APPROVED:"partiallyApproved",REJECTED:"rejected",PARTIALLY_REJECTED:"partiallyRejected",DENIED:"denied",PROCESSED_AND_CLOSED:"processedAndClosed",CLOSED:"closed"},y=n=>{const s={};return Object.keys(n).forEach(e=>{if(e.match(/_(\d+)$/)){const t=e.replace(/_\d+$/,"");s[t]=n[e]}else s[e]=n[e]}),s},R=(n,s)=>n.map(e=>({...e,id:`${e.id}_${e.fieldType}_${s+1}`,name:`${e.name}_${e.fieldType}_${s+1}`,code:`${e.code}_${e.fieldType}_${s+1}`,customUpperCode:`${e.customUpperCode}_${e.fieldType}_${s+1}`})),_=(n,s)=>n==null?void 0:n.flatMap(e=>Array.from({length:s},(i,t)=>({...e,id:`${e.id}_${e.fieldType}_${t+1}`,name:`${e.name}_${e.fieldType}_${t+1}`,code:`${e.code}_${e.fieldType}_${t+1}`,customUpperCode:`${e.customUpperCode}_${e.fieldType}_${t+1}`}))),$=n=>{const s=[],e=[];return Object.entries(n).forEach(([i,t])=>{const a=i.lastIndexOf("_"),r=i.slice(0,a),u=i.slice(a+1);u===c.MULTISELECT||u===c.SELECT?s.push({attributeCode:r,value:btoa(t)}):e.push({attributeCode:r,value:t})}),{selectedCustomAttributes:s,enteredCustomAttributes:e}},m=n=>typeof n!="string"?"":p[n]??"",l=["REJECTED","PARTIALLY_REJECTED","DENIED","UNCONFIRMED","CLOSED"],A=n=>{const s=n==null?void 0:n.returns.filter(t=>!l.includes(t.returnStatus));return((n==null?void 0:n.itemsEligibleForReturn)??[]).flatMap(t=>{let a=t.quantityShipped,r={...t,returnableQuantity:a};return t.quantityShipped===0&&(r={...r,eligibleForReturn:!1,returnableQuantity:0}),s.forEach(u=>{u.items.forEach(o=>{if((o==null?void 0:o.id)===(t==null?void 0:t.id)){const d=a-o.requestQuantity;a=Math.max(d,0),r={...r,eligibleForReturn:a!==0,returnableQuantity:a}}})}),r}).sort((t,a)=>Number(a.eligibleForReturn)-Number(t.eligibleForReturn))},C=n=>{var i;let s=[];return((i=n==null?void 0:n.returns)==null?void 0:i.filter(t=>!l.includes(t.returnStatus)).flatMap(t=>t.items||[])).forEach(t=>{if(!s.length)s.push({...t,totalQuantity:t.requestQuantity});else{const a=s.findIndex(r=>r.id===t.id);a!==-1?s[a].totalQuantity+=t.requestQuantity:s.push({...t,totalQuantity:t.requestQuantity})}}),{returnedList:s??[],modifyOrder:E(n.items,s)??[]}};function E(n,s){const e=new Map(s.map(i=>[i.id,i]));return n.map(i=>{const t=e.get(i.id);if(t){const a=i.totalQuantity-t.totalQuantity;return a===0?null:{...i,totalQuantity:a}}return i}).filter(i=>i!==null)}export{y as c,C as e,m as f,R as m,$ as n,A as o,_ as r}; diff --git a/scripts/__dropins__/storefront-order/chunks/transform-attributes-form.js b/scripts/__dropins__/storefront-order/chunks/transform-attributes-form.js index b8ba7c03cf..ce74ed1d52 100644 --- a/scripts/__dropins__/storefront-order/chunks/transform-attributes-form.js +++ b/scripts/__dropins__/storefront-order/chunks/transform-attributes-form.js @@ -1 +1 @@ -import{c as d,a as m}from"./convertCase.js";const a=s=>{let o=[];for(const e of s)if(!(e.frontend_input!=="MULTILINE"||e.multiline_count<2))for(let n=2;n<=e.multiline_count;n++){const c={...e,name:`${e.code}_${n}`,code:`${e.code}_${n}`,id:`${e.code}_${n}`};o.push(c)}return o},f=s=>{var u;const o=s||[];if(!o.length)return[];const e=(u=o.filter(t=>{var r;return!((r=t.frontend_input)!=null&&r.includes("HIDDEN"))}))==null?void 0:u.map(({code:t,...r})=>{const i=t!=="country_id"?t:"country_code";return{...r,name:i,id:i,code:i}}),n=a(e);return e.concat(n).map(t=>{const r=d(t.code);return m({...t,customUpperCode:r},"camelCase",{frontend_input:"fieldType",frontend_class:"className",is_required:"required",sort_order:"orderNumber"})}).sort((t,r)=>t.orderNumber-r.orderNumber)};export{f as t}; +import{c as i,a as d}from"./convertCase.js";const a=n=>{let c=[];for(const e of n)if(!(e.frontend_input!=="MULTILINE"||e.multiline_count<2))for(let o=2;o<=e.multiline_count;o++){const s={...e,name:`${e.code}_${o}`,code:`${e.code}_${o}`,id:`${e.code}_${o}`};c.push(s)}return c},f=(n=[])=>{var s;if(!(n!=null&&n.length))return[];const c=(s=n.filter(t=>{var r;return!((r=t.frontend_input)!=null&&r.includes("HIDDEN"))}))==null?void 0:s.map(({code:t,...r})=>{const u=t!=="country_id"?t:"country_code";return{...r,name:u,id:u,code:u}}),e=a(c);return c.concat(e).map(t=>{const r=i(t.code);return d({...t,customUpperCode:r},"camelCase",{frontend_input:"fieldType",frontend_class:"className",is_required:"required",sort_order:"orderNumber"})}).sort((t,r)=>t.orderNumber-r.orderNumber)};export{f as t}; diff --git a/scripts/__dropins__/storefront-order/containers/CreateReturn.js b/scripts/__dropins__/storefront-order/containers/CreateReturn.js index 27581466bb..1feb8dbebb 100644 --- a/scripts/__dropins__/storefront-order/containers/CreateReturn.js +++ b/scripts/__dropins__/storefront-order/containers/CreateReturn.js @@ -1 +1 @@ -import{jsx as r,jsxs as x}from"@dropins/tools/preact-jsx-runtime.js";import{classes as q,Slot as P}from"@dropins/tools/lib.js";import{Checkbox as H,Button as Q,CartItem as V,Image as W,Header as Z,InLineAlert as D}from"@dropins/tools/components.js";import{u as z,a as U}from"../chunks/OrderCancel.js";import{useState as _,useRef as K,useEffect as T,useCallback as F}from"@dropins/tools/preact-hooks.js";import{events as G}from"@dropins/tools/event-bus.js";import{g as J}from"../chunks/getFormValues.js";import{s as X}from"../chunks/setTaxStatus.js";import{createRef as Y,Fragment as I}from"@dropins/tools/preact.js";import{o as ee,c as te,n as ne,r as re,m as ae}from"../chunks/returnOrdersHelper.js";import{g as se,r as ie}from"../chunks/requestReturn.js";import{g as ce}from"../chunks/getStoreConfig.js";import*as y from"@dropins/tools/preact-compat.js";import{S as ue,C as oe}from"../chunks/CartSummaryItem.js";import{O as le}from"../chunks/OrderLoaders.js";import{useText as de}from"@dropins/tools/i18n.js";import"../chunks/form.types.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-attributes-form.js";import"../chunks/convertCase.js";const pe=a=>y.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},y.createElement("g",{clipPath:"url(#clip0_841_1324)"},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),y.createElement("defs",null,y.createElement("clipPath",{id:"clip0_841_1324"},y.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),he=a=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),me=({onSuccess:a,onError:s,handleSetInLineAlert:c,orderData:d})=>{const[u,p]=_(d),[C,f]=_("products"),[O,b]=_(!0),[i,g]=_([]),[S,w]=_([]),[e,L]=_({taxIncluded:!1,taxExcluded:!1}),[t,h]=_([]),k=K([]);k.current.length!==i.length&&(k.current=i.map((n,o)=>k.current[o]||Y())),T(()=>{const n=G.on("order/data",o=>{p(o),h(ee(o)),b(!1)},{eager:!0});return()=>{n==null||n.off()}},[]),T(()=>{ce().then(n=>{if(n){const o=X(n==null?void 0:n.shoppingCartDisplayPrice);L(o)}})},[]),T(()=>{se("RMA_ITEM").then(n=>{n.length&&(w(n),b(!1))})},[]);const N=F(n=>{g(o=>o.findIndex(l=>(l==null?void 0:l.productSku)===(n==null?void 0:n.productSku))>-1?o.filter(l=>(l==null?void 0:l.productSku)!==(n==null?void 0:n.productSku)):[...o,n])},[]),R=F(n=>{f(n),c(),n==="products"&&g([])},[c]),A=F((n,o)=>{const v=i.map(l=>l.productSku===o?{...l,currentReturnOrderQuantity:n}:l);g(v)},[i]),E=F(async(n,o)=>{if(!o)return null;b(!0);const v={orderUid:(u==null?void 0:u.id)??"",contactEmail:(u==null?void 0:u.email)??""},l=[];k.current.length&&k.current.forEach(({current:m})=>{var M;const $=m==null?void 0:m.name.replace(/_\d+$/,""),j=((M=m==null?void 0:m.dataset)==null?void 0:M.quantity)??1,B=te(J(m));l.push({orderItemUid:$,quantityToReturn:+j,...ne(B)})}),ie({...v,items:l}).then(m=>{m&&(a==null||a(m),R("success"),c())}).catch(m=>{s==null||s(m.message),c({type:"error",heading:m.message})}),b(!1)},[R,s,a,c,u]);return{order:u,steps:C,loading:O,formsRef:k,taxConfig:e,attributesList:S,selectedProductList:i,itemsEligibleForReturn:t,handleSelectedProductList:N,handleSetQuantity:A,handleChangeStep:R,onSubmit:E}},ge={success:r(he,{}),warning:r(pe,{}),error:r(ue,{})},fe=()=>{const[a,s]=_({type:"success",heading:""}),c=F(d=>{if(!(d!=null&&d.type)){s({type:"success",heading:""});return}const u=ge[d.type];s({...d,icon:u})},[]);return{inLineAlertProps:a,handleSetInLineAlert:c}},be=({itemsEligibleForReturn:a,slots:s,loading:c=!1,taxConfig:d,translations:u={},selectedProductList:p,handleSelectedProductList:C,showConfigurableOptions:f,handleSetQuantity:O,handleChangeStep:b})=>x("ul",{className:"order-return-order-product-list",children:[a==null?void 0:a.map((i,g)=>{const S=p.some(e=>(e==null?void 0:e.productSku)===i.productSku&&i.eligibleForReturn&&i.quantityReturned===0),w=i.returnableQuantity===0?1:i.returnableQuantity;return x("li",{className:q(["order-return-order-product-list__item",["order-return-order-product-list__item--blur",!i.eligibleForReturn]]),children:[r(H,{"data-testid":`key_${g}`,name:`key_${g}`,checked:S,disabled:!i.eligibleForReturn||i.quantityReturned!==0,onChange:()=>{C({...i,currentReturnOrderQuantity:1})}}),r(oe,{loading:c,product:{...i,totalQuantity:w},itemType:"",taxConfig:d,translations:u,showConfigurableOptions:f,disabledIncrementer:!S,isReturnProductList:!0,onQuantity:(i==null?void 0:i.returnableQuantity)>1?e=>O(e,i.productSku):void 0}),s!=null&&s.ReturnOrderItem?r(P,{"data-testid":"returnOrderItem",name:"ReturnOrderItem",slot:s==null?void 0:s.ReturnOrderItem,context:{}}):null]},g)}),r("li",{className:"order-return-order-product-list__item",children:r(Q,{type:"button",onClick:()=>b("attributes"),disabled:!p.length,children:u.nextStep})})]}),ke=({routeReturnSuccess:a,translations:s,orderData:c})=>{const d=()=>{window.location.href=(a==null?void 0:a(c))??"#"};return x("div",{className:"order-return-order-message",children:[r("p",{className:"order-return-order-message__title",children:s.successTitle}),r("p",{className:"order-return-order-message__subtitle",children:s.successMessage}),r(Q,{onClick:d,type:"button",children:s.backStore})]})},ye=({slots:a,formsRef:s,selectedProductList:c,loading:d,fieldsConfig:u,translations:p,handleChangeStep:C,onSubmit:f})=>{const{formData:O,errors:b,formRef:i,handleChange:g,handleBlur:S,handleSubmit:w}=z({fieldsConfig:re(u,c==null?void 0:c.length),onSubmit:f});return x("form",{className:"order-return-reason-form",ref:i,onSubmit:w,name:"returnReasonForm",children:[c.map((e,L)=>{var E,n,o,v,l;const t=(e==null?void 0:e.giftCard)||{},h=e==null?void 0:e.product,k=ae(u,L),N=`${e==null?void 0:e.id}_${L}`,R=(e==null?void 0:e.currentReturnOrderQuantity)??1,A={...e!=null&&e.currentReturnOrderQuantity?{Quantity:R}:{},..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in t&&(t!=null&&t.senderName)?{[p.sender]:t==null?void 0:t.senderName}:{},..."senderEmail"in t&&(t!=null&&t.senderEmail)?{[p.sender]:t==null?void 0:t.senderEmail}:{},..."recipientName"in t&&(t!=null&&t.recipientName)?{[p.recipient]:t==null?void 0:t.recipientName}:{},..."recipientEmail"in t&&(t!=null&&t.recipientEmail)?{[p.recipient]:t==null?void 0:t.recipientEmail}:{},..."message"in t&&(t!=null&&t.message)?{[p.message]:t==null?void 0:t.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${(E=e==null?void 0:e.downloadableLinks)==null?void 0:E.count} ${p.downloadableCount}`]:(n=e==null?void 0:e.downloadableLinks)==null?void 0:n.result}:{}};return x(I,{children:[r(V,{loading:d,title:r("div",{"data-testid":"product-name",children:(o=e==null?void 0:e.product)==null?void 0:o.name}),sku:r("div",{children:h==null?void 0:h.sku}),image:r(W,{src:((v=h==null?void 0:h.thumbnail)==null?void 0:v.url)??"",alt:((l=h==null?void 0:h.thumbnail)==null?void 0:l.label)??"",loading:"lazy",width:"90",height:"120"}),configurations:A}),r("form",{name:N,ref:s==null?void 0:s.current[L],"data-quantity":R,children:r(U,{className:"className",loading:d,fields:k,onChange:g,onBlur:S,errors:b,values:O})})]},L)}),a!=null&&a.ReturnFormActions?r(P,{"data-testid":"returnFormActions",name:"ReturnFormActions",slot:a==null?void 0:a.ReturnFormActions,context:{handleChangeStep:C}}):x("div",{className:"order-return-reason-form__actions",children:[r(Q,{variant:"secondary",type:"button",onClick:()=>{C("products")},children:p.backStep}),r(Q,{children:p.submit})]})]})},He=({className:a,orderData:s,slots:c,onSuccess:d,onError:u,routeReturnSuccess:p,showConfigurableOptions:C})=>{const f=de({headerText:"Order.CreateReturn.headerText",successTitle:"Order.CreateReturn.success.title",successMessage:"Order.CreateReturn.success.message",sender:"Order.CreateReturn.giftCard.sender",recipient:"Order.CreateReturn.giftCard.recipient",message:"Order.CreateReturn.giftCard.message",outOfStock:"Order.CreateReturn.stockStatus.outOfStock",nextStep:"Order.CreateReturn.buttons.nextStep",backStep:"Order.CreateReturn.buttons.backStep",submit:"Order.CreateReturn.buttons.submit",backStore:"Order.CreateReturn.buttons.backStore",downloadableCount:"Order.CreateReturn.downloadableCount",returnedItems:"Order.CreateReturn.returnedItems"}),{inLineAlertProps:O,handleSetInLineAlert:b}=fe(),{order:i,itemsEligibleForReturn:g,formsRef:S,taxConfig:w,attributesList:e,steps:L,loading:t,selectedProductList:h,handleSelectedProductList:k,handleSetQuantity:N,handleChangeStep:R,onSubmit:A}=me({orderData:s,onSuccess:d,onError:u,handleSetInLineAlert:b});if(t)return r("div",{children:r(le,{})});if(!t&&!e.length)return r("div",{});const E={products:r(be,{itemsEligibleForReturn:g,slots:c,translations:f,loading:t,taxConfig:w,selectedProductList:h,handleSelectedProductList:k,showConfigurableOptions:C,handleSetQuantity:N,handleChangeStep:R}),attributes:r(ye,{slots:c,formsRef:S,loading:t,fieldsConfig:e,selectedProductList:h,handleChangeStep:R,translations:f,onSubmit:A}),success:r(ke,{translations:f,routeReturnSuccess:p,orderData:i}),error:null};return x("div",{className:q(["order-create-return",a]),children:[r(Z,{title:f.headerText}),O.heading?r(D,{className:"order-create-return_notification",variant:"secondary","data-testid":"orderCreateReturnNotification",...O}):null,E[L]]})};export{He as CreateReturn,He as default}; +import{jsx as r,jsxs as x}from"@dropins/tools/preact-jsx-runtime.js";import{classes as q,Slot as P}from"@dropins/tools/lib.js";import{Checkbox as H,Button as Q,CartItem as V,Image as W,Header as Z,InLineAlert as D}from"@dropins/tools/components.js";import{u as z,a as U}from"../chunks/OrderCancel.js";import{useState as _,useRef as K,useEffect as T,useCallback as F}from"@dropins/tools/preact-hooks.js";import{events as G}from"@dropins/tools/event-bus.js";import{g as J}from"../chunks/getFormValues.js";import{s as X}from"../chunks/setTaxStatus.js";import{createRef as Y,Fragment as I}from"@dropins/tools/preact.js";import{o as ee,c as te,n as ne,r as re,m as ae}from"../chunks/returnOrdersHelper.js";import{g as se,r as ie}from"../chunks/requestReturn.js";import{g as ce}from"../chunks/getStoreConfig.js";import*as y from"@dropins/tools/preact-compat.js";import{S as ue,C as oe}from"../chunks/CartSummaryItem.js";import{O as le}from"../chunks/OrderLoaders.js";import{useText as de}from"@dropins/tools/i18n.js";import"../chunks/form.types.js";import"../chunks/network-error.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/transform-attributes-form.js";import"../chunks/convertCase.js";const pe=a=>y.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},y.createElement("g",{clipPath:"url(#clip0_841_1324)"},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M12.4336 10.5504L12.3373 14.4766H11.6632L11.5669 10.5504V9.51273H12.4336V10.5504ZM11.5883 18.2636V17.2687H12.4229V18.2636H11.5883Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),y.createElement("defs",null,y.createElement("clipPath",{id:"clip0_841_1324"},y.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)"})))),he=a=>y.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...a},y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),y.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),me=({onSuccess:a,onError:s,handleSetInLineAlert:c,orderData:d})=>{const[u,p]=_(d),[C,f]=_("products"),[O,b]=_(!0),[i,g]=_([]),[S,w]=_([]),[e,L]=_({taxIncluded:!1,taxExcluded:!1}),[t,h]=_([]),k=K([]);k.current.length!==i.length&&(k.current=i.map((n,o)=>k.current[o]||Y())),T(()=>{const n=G.on("order/data",o=>{p(o),h(ee(o)),b(!1)},{eager:!0});return()=>{n==null||n.off()}},[]),T(()=>{ce().then(n=>{if(n){const o=X(n==null?void 0:n.shoppingCartDisplayPrice);L(o)}})},[]),T(()=>{se("RMA_ITEM").then(n=>{n.length&&(w(n),b(!1))})},[]);const N=F(n=>{g(o=>o.findIndex(l=>(l==null?void 0:l.productSku)===(n==null?void 0:n.productSku))>-1?o.filter(l=>(l==null?void 0:l.productSku)!==(n==null?void 0:n.productSku)):[...o,n])},[]),R=F(n=>{f(n),c(),n==="products"&&g([])},[c]),A=F((n,o)=>{const v=i.map(l=>l.productSku===o?{...l,currentReturnOrderQuantity:n}:l);g(v)},[i]),E=F(async(n,o)=>{if(!o)return null;b(!0);const v={orderUid:(u==null?void 0:u.id)??"",contactEmail:(u==null?void 0:u.email)??""},l=[];k.current.length&&k.current.forEach(({current:m})=>{var M;const $=m==null?void 0:m.name.replace(/_\d+$/,""),j=((M=m==null?void 0:m.dataset)==null?void 0:M.quantity)??1,B=te(J(m));l.push({orderItemUid:$,quantityToReturn:+j,...ne(B)})}),ie({...v,items:l}).then(m=>{m&&(a==null||a(m),R("success"),c())}).catch(m=>{s==null||s(m.message),c({type:"error",heading:m.message})}),b(!1)},[R,s,a,c,u]);return{order:u,steps:C,loading:O,formsRef:k,taxConfig:e,attributesList:S,selectedProductList:i,itemsEligibleForReturn:t,handleSelectedProductList:N,handleSetQuantity:A,handleChangeStep:R,onSubmit:E}},ge={success:r(he,{}),warning:r(pe,{}),error:r(ue,{})},fe=()=>{const[a,s]=_({type:"success",heading:""}),c=F(d=>{if(!(d!=null&&d.type)){s({type:"success",heading:""});return}const u=ge[d.type];s({...d,icon:u})},[]);return{inLineAlertProps:a,handleSetInLineAlert:c}},be=({itemsEligibleForReturn:a,slots:s,loading:c=!1,taxConfig:d,translations:u={},selectedProductList:p,handleSelectedProductList:C,showConfigurableOptions:f,handleSetQuantity:O,handleChangeStep:b})=>x("ul",{className:"order-return-order-product-list",children:[a==null?void 0:a.map((i,g)=>{const S=p.some(e=>(e==null?void 0:e.productSku)===i.productSku&&i.eligibleForReturn&&i.quantityReturned===0),w=i.returnableQuantity===0?1:i.returnableQuantity;return x("li",{className:q(["order-return-order-product-list__item",["order-return-order-product-list__item--blur",!i.eligibleForReturn]]),children:[r(H,{"data-testid":`key_${g}`,name:`key_${g}`,checked:S,disabled:!i.eligibleForReturn||i.quantityReturned!==0,onChange:()=>{C({...i,currentReturnOrderQuantity:1})}}),r(oe,{loading:c,product:{...i,totalQuantity:w},itemType:"",taxConfig:d,translations:u,showConfigurableOptions:f,disabledIncrementer:!S,isReturnProductList:!0,onQuantity:(i==null?void 0:i.returnableQuantity)>1?e=>O(e,i.productSku):void 0}),s!=null&&s.ReturnOrderItem?r(P,{"data-testid":"returnOrderItem",name:"ReturnOrderItem",slot:s==null?void 0:s.ReturnOrderItem,context:{}}):null]},g)}),r("li",{className:"order-return-order-product-list__item",children:r(Q,{type:"button",onClick:()=>b("attributes"),disabled:!p.length,children:u.nextStep})})]}),ke=({routeReturnSuccess:a,translations:s,orderData:c})=>{const d=()=>{window.location.href=(a==null?void 0:a(c))??"#"};return x("div",{className:"order-return-order-message",children:[r("p",{className:"order-return-order-message__title",children:s.successTitle}),r("p",{className:"order-return-order-message__subtitle",children:s.successMessage}),r(Q,{onClick:d,type:"button",children:s.backStore})]})},ye=({slots:a,formsRef:s,selectedProductList:c,loading:d,fieldsConfig:u,translations:p,handleChangeStep:C,onSubmit:f})=>{const{formData:O,errors:b,formRef:i,handleChange:g,handleBlur:S,handleSubmit:w}=z({fieldsConfig:re(u,c==null?void 0:c.length),onSubmit:f});return x("form",{className:"order-return-reason-form",ref:i,onSubmit:w,name:"returnReasonForm",children:[c.map((e,L)=>{var E,n,o,v,l;const t=(e==null?void 0:e.giftCard)||{},h=e==null?void 0:e.product,k=ae(u,L),N=`${e==null?void 0:e.id}_${L}`,R=(e==null?void 0:e.currentReturnOrderQuantity)??1,A={...e!=null&&e.currentReturnOrderQuantity?{Quantity:R}:{},..."configurableOptions"in e?e.configurableOptions:{},..."bundleOptions"in e?e.bundleOptions:{},..."senderName"in t?{[p.sender]:t==null?void 0:t.senderName}:{},..."senderEmail"in t&&(t!=null&&t.senderEmail)?{[p.sender]:t==null?void 0:t.senderEmail}:{},..."recipientName"in t&&(t!=null&&t.recipientName)?{[p.recipient]:t==null?void 0:t.recipientName}:{},..."recipientEmail"in t&&(t!=null&&t.recipientEmail)?{[p.recipient]:t==null?void 0:t.recipientEmail}:{},..."message"in t&&(t!=null&&t.message)?{[p.message]:t==null?void 0:t.message}:{},..."downloadableLinks"in e&&(e!=null&&e.downloadableLinks)?{[`${(E=e==null?void 0:e.downloadableLinks)==null?void 0:E.count} ${p.downloadableCount}`]:(n=e==null?void 0:e.downloadableLinks)==null?void 0:n.result}:{}};return x(I,{children:[r(V,{loading:d,title:r("div",{"data-testid":"product-name",children:(o=e==null?void 0:e.product)==null?void 0:o.name}),sku:r("div",{children:h==null?void 0:h.sku}),image:r(W,{src:((v=h==null?void 0:h.thumbnail)==null?void 0:v.url)??"",alt:((l=h==null?void 0:h.thumbnail)==null?void 0:l.label)??"",loading:"lazy",width:"90",height:"120"}),configurations:A}),r("form",{name:N,ref:s==null?void 0:s.current[L],"data-quantity":R,children:r(U,{className:"className",loading:d,fields:k,onChange:g,onBlur:S,errors:b,values:O})})]},L)}),a!=null&&a.ReturnFormActions?r(P,{"data-testid":"returnFormActions",name:"ReturnFormActions",slot:a==null?void 0:a.ReturnFormActions,context:{handleChangeStep:C}}):x("div",{className:"order-return-reason-form__actions",children:[r(Q,{variant:"secondary",type:"button",onClick:()=>{C("products")},children:p.backStep}),r(Q,{children:p.submit})]})]})},He=({className:a,orderData:s,slots:c,onSuccess:d,onError:u,routeReturnSuccess:p,showConfigurableOptions:C})=>{const f=de({headerText:"Order.CreateReturn.headerText",successTitle:"Order.CreateReturn.success.title",successMessage:"Order.CreateReturn.success.message",sender:"Order.CreateReturn.giftCard.sender",recipient:"Order.CreateReturn.giftCard.recipient",message:"Order.CreateReturn.giftCard.message",outOfStock:"Order.CreateReturn.stockStatus.outOfStock",nextStep:"Order.CreateReturn.buttons.nextStep",backStep:"Order.CreateReturn.buttons.backStep",submit:"Order.CreateReturn.buttons.submit",backStore:"Order.CreateReturn.buttons.backStore",downloadableCount:"Order.CreateReturn.downloadableCount",returnedItems:"Order.CreateReturn.returnedItems"}),{inLineAlertProps:O,handleSetInLineAlert:b}=fe(),{order:i,itemsEligibleForReturn:g,formsRef:S,taxConfig:w,attributesList:e,steps:L,loading:t,selectedProductList:h,handleSelectedProductList:k,handleSetQuantity:N,handleChangeStep:R,onSubmit:A}=me({orderData:s,onSuccess:d,onError:u,handleSetInLineAlert:b});if(t)return r("div",{children:r(le,{})});if(!t&&!e.length)return r("div",{});const E={products:r(be,{itemsEligibleForReturn:g,slots:c,translations:f,loading:t,taxConfig:w,selectedProductList:h,handleSelectedProductList:k,showConfigurableOptions:C,handleSetQuantity:N,handleChangeStep:R}),attributes:r(ye,{slots:c,formsRef:S,loading:t,fieldsConfig:e,selectedProductList:h,handleChangeStep:R,translations:f,onSubmit:A}),success:r(ke,{translations:f,routeReturnSuccess:p,orderData:i}),error:null};return x("div",{className:q(["order-create-return",a]),children:[r(Z,{title:f.headerText}),O.heading?r(D,{className:"order-create-return_notification",variant:"secondary","data-testid":"orderCreateReturnNotification",...O}):null,E[L]]})};export{He as CreateReturn,He as default}; diff --git a/scripts/__dropins__/storefront-order/containers/OrderProductList.js b/scripts/__dropins__/storefront-order/containers/OrderProductList.js index d3c7d3b85a..c2c9411c76 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderProductList.js +++ b/scripts/__dropins__/storefront-order/containers/OrderProductList.js @@ -1 +1 @@ -import{jsx as i,jsxs as T}from"@dropins/tools/preact-jsx-runtime.js";import{Card as S,Header as N}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as b}from"@dropins/tools/lib.js";import{useState as C,useEffect as x,useMemo as k}from"@dropins/tools/preact-hooks.js";import{events as v}from"@dropins/tools/event-bus.js";import{s as G}from"../chunks/setTaxStatus.js";import{g as j}from"../chunks/getStoreConfig.js";import{Fragment as q}from"@dropins/tools/preact.js";import"@dropins/tools/preact-compat.js";import{e as y}from"../chunks/returnOrdersHelper.js";import{O as w}from"../chunks/OrderLoaders.js";import{C as E}from"../chunks/CartSummaryItem.js";import{useText as F}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/form.types.js";const _=({orderData:l})=>{const[a,t]=C(!0),[u,c]=C(l),[m,d]=C({taxIncluded:!1,taxExcluded:!1});return x(()=>{j().then(e=>{if(e){const n=G(e==null?void 0:e.shoppingCartDisplayPrice);d(n)}}).finally(()=>{t(!1)})},[]),x(()=>{const e=v.on("order/data",n=>{c(n)},{eager:!0});return()=>{e==null||e.off()}},[]),{loading:a,taxConfig:m,order:u}},$=({loading:l,taxConfig:a,order:t=null,withHeader:u=!0,showConfigurableOptions:c,routeProductDetails:m})=>{const d=!!(t!=null&&t.returnNumber),e=t==null?void 0:t.returnNumber,n=F({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),g=k(()=>{var p,f;if(!t)return[];if(!d){const r=((p=y(t))==null?void 0:p.modifyOrder)??[],O=((f=y(t))==null?void 0:f.returnedList)??[],h=r==null?void 0:r.filter(o=>o.quantityCanceled),I=r==null?void 0:r.filter(o=>!o.quantityCanceled);return[{type:"returned",list:O,title:n.returned},{type:"cancelled",list:h,title:n.cancelled},{type:"allItems",list:I,title:n.allOrders}].filter(o=>{var P;return((P=o==null?void 0:o.list)==null?void 0:P.length)>0})}const s=t.returns.find(r=>r.returnNumber===e);return[{type:"returned",list:(s==null?void 0:s.items)??[],title:n.returned}]},[t,d,n,e]);return t?g.every(s=>s.list.length===0)?null:i(S,{variant:"secondary",className:"order-order-product-list-content",children:g.map((s,L)=>{var f;const p=s.list.reduce((r,{totalQuantity:O})=>O+r,0);return T(q,{children:[u?i(N,{title:`${s.title} (${p})`}):null,i("ul",{className:"order-order-product-list-content__items",children:(f=s.list)==null?void 0:f.map(r=>i("li",{"data-testid":"order-product-list-content-item",children:i(E,{loading:l,product:r,itemType:s.type,taxConfig:a,translations:n,showConfigurableOptions:c,routeProductDetails:m})},r.id))})]},L)})}):i(w,{})},et=({className:l,orderData:a,withHeader:t,showConfigurableOptions:u,routeProductDetails:c})=>{const{loading:m,taxConfig:d,order:e}=_({orderData:a});return i("div",{className:b(["order-order-product-list",l]),children:i($,{loading:m,taxConfig:d,order:e,withHeader:t,showConfigurableOptions:u,routeProductDetails:c})})};export{et as OrderProductList,et as default}; +import{jsx as i,jsxs as h}from"@dropins/tools/preact-jsx-runtime.js";import{Card as T,Header as I}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{classes as S}from"@dropins/tools/lib.js";import{useState as C,useEffect as x,useMemo as N}from"@dropins/tools/preact-hooks.js";import{events as b}from"@dropins/tools/event-bus.js";import{s as k}from"../chunks/setTaxStatus.js";import{g as v}from"../chunks/getStoreConfig.js";import{Fragment as G}from"@dropins/tools/preact.js";import"@dropins/tools/preact-compat.js";import{e as j}from"../chunks/returnOrdersHelper.js";import{O as q}from"../chunks/OrderLoaders.js";import{C as w}from"../chunks/CartSummaryItem.js";import{useText as E}from"@dropins/tools/i18n.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/form.types.js";const F=({orderData:a})=>{const[u,t]=C(!0),[c,m]=C(a),[f,d]=C({taxIncluded:!1,taxExcluded:!1});return x(()=>{v().then(e=>{if(e){const r=k(e==null?void 0:e.shoppingCartDisplayPrice);d(r)}}).finally(()=>{t(!1)})},[]),x(()=>{const e=b.on("order/data",r=>{m(r)},{eager:!0});return()=>{e==null||e.off()}},[]),{loading:u,taxConfig:f,order:c}},_=({loading:a,taxConfig:u,order:t=null,withHeader:c=!0,showConfigurableOptions:m,routeProductDetails:f})=>{const d=!!(t!=null&&t.returnNumber),e=t==null?void 0:t.returnNumber,r=E({cancelled:"Order.OrderProductListContent.cancelledTitle",allOrders:"Order.OrderProductListContent.allOrdersTitle",returned:"Order.OrderProductListContent.returnedTitle",refunded:"Order.OrderProductListContent.refundedTitle",sender:"Order.OrderProductListContent.GiftCard.sender",recipient:"Order.OrderProductListContent.GiftCard.recipient",message:"Order.OrderProductListContent.GiftCard.message",outOfStock:"Order.OrderProductListContent.stockStatus.outOfStock",downloadableCount:"Order.OrderProductListContent.downloadableCount"}),g=N(()=>{var p;if(!t)return[];if(!d){const{modifyOrder:s,returnedList:l}=j(t),O=s==null?void 0:s.filter(o=>o.quantityCanceled),y=(p=s??[])==null?void 0:p.filter(o=>!o.quantityCanceled);return[{type:"returned",list:l??[],title:r.returned},{type:"cancelled",list:O,title:r.cancelled},{type:"allItems",list:y,title:r.allOrders}].filter(o=>{var P;return((P=o==null?void 0:o.list)==null?void 0:P.length)>0})}const n=t.returns.find(s=>s.returnNumber===e);return[{type:"returned",list:(n==null?void 0:n.items)??[],title:r.returned}]},[t,d,r,e]);return t?g.every(n=>n.list.length===0)?null:i(T,{variant:"secondary",className:"order-order-product-list-content",children:g.map((n,L)=>{var s;const p=n.list.reduce((l,{totalQuantity:O})=>O+l,0);return h(G,{children:[c?i(I,{title:`${n.title} (${p})`}):null,i("ul",{className:"order-order-product-list-content__items",children:(s=n.list)==null?void 0:s.map(l=>i("li",{"data-testid":"order-product-list-content-item",children:i(w,{loading:a,product:l,itemType:n.type,taxConfig:u,translations:r,showConfigurableOptions:m,routeProductDetails:f})},l.id))})]},L)})}):i(q,{})},tt=({className:a,orderData:u,withHeader:t,showConfigurableOptions:c,routeProductDetails:m})=>{const{loading:f,taxConfig:d,order:e}=F({orderData:u});return i("div",{className:S(["order-order-product-list",a]),children:i(_,{loading:f,taxConfig:d,order:e,withHeader:t,showConfigurableOptions:c,routeProductDetails:m})})};export{tt as OrderProductList,tt as default}; diff --git a/scripts/__dropins__/storefront-order/containers/ShippingStatus.js b/scripts/__dropins__/storefront-order/containers/ShippingStatus.js index 8700d1112c..4bd502bb1e 100644 --- a/scripts/__dropins__/storefront-order/containers/ShippingStatus.js +++ b/scripts/__dropins__/storefront-order/containers/ShippingStatus.js @@ -1 +1 @@ -import{jsx as i,jsxs as S,Fragment as _}from"@dropins/tools/preact-jsx-runtime.js";import{classes as $,VComponent as A,Slot as E}from"@dropins/tools/lib.js";import{Card as L,Header as w,Accordion as R,AccordionSection as V,ContentGrid as G,Image as q}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useState as x,useEffect as k}from"@dropins/tools/preact-hooks.js";import{events as D}from"@dropins/tools/event-bus.js";import"@dropins/tools/preact.js";import{u as nn}from"../chunks/useIsMobile.js";import{Text as B,useText as en}from"@dropins/tools/i18n.js";import{C as pn}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";var M=(e=>(e.PENDING="pending",e.SHIPPING="shipping",e.COMPLETE="complete",e.PROCESSING="processing",e.HOLD="on hold",e.CANCELED="Canceled",e.SUSPECTED_FRAUD="suspected fraud",e.PAYMENT_REVIEW="payment review",e))(M||{});const tn=({orderData:e})=>{const[s,n]=x(!0),[t,m]=x(e),[h,o]=x(!1);return k(()=>{const d=D.on("order/data",u=>{m(u),o(u==null?void 0:u.isVirtual),n(!1)},{eager:!0});return()=>{d==null||d.off()}},[]),{loading:s,order:t,isVirtualProduct:h}},Z=({value:e,variant:s="primary",size:n="medium",icon:t,className:m,children:h,disabled:o=!1,active:d=!1,activeChildren:u,activeIcon:p,href:C,...a})=>{let g="dropin-button";(t&&!h||t&&d&&!u||!t&&d&&p)&&(g="dropin-iconButton"),d&&u&&(g="dropin-button"),m=$([g,`${g}--${n}`,`${g}--${s}`,[`${g}--${s}--disabled`,o],h&&t&&`${g}--with-icon`,!h&&u&&t&&`${g}--with-icon`,d&&p&&`${g}--with-icon`,m]);const c=$(["dropin-button-icon",`dropin-button-icon--${s}`,[`dropin-button-icon--${s}--disabled`,o],t==null?void 0:t.props.className]),b=C?{node:i("a",{}),role:"link",href:C,...a,disabled:o,active:d,onKeyDown:I=>{o&&I.preventDefault()},tabIndex:o?-1:0}:{node:i("button",{}),role:"button",...a,value:e,disabled:o,active:d};return S(A,{...b,className:m,children:[t&&!d&&i(A,{node:t,className:c}),p&&d&&i(A,{node:p,className:c}),h&&!d&&(typeof h=="string"?i("span",{children:h}):h),d&&u&&(typeof u=="string"?i("span",{children:u}):u)]})},ln=({slots:e,collapseThreshold:s,translations:n,returnData:t,routeTracking:m,routeProductDetails:h})=>{var u;const o=nn(),d=h?"a":"span";return S(L,{variant:"secondary",className:$(["order-shipping-status-card","order-shipping-status-card--return-order"]),children:[i(w,{title:n.returnOrderCardTitle}),S("div",{children:[(u=t==null?void 0:t.tracking)==null?void 0:u.map((p,C)=>{var b,I;const a={title:"",number:(p==null?void 0:p.trackingNumber)??"",carrier:((b=p==null?void 0:p.carrier)==null?void 0:b.label)??""},g=m==null?void 0:m(a),c=g?()=>{window.open(g,"_blank","noreferrer")}:null;return S("div",{className:"order-shipping-status-card__header",children:[S("div",{children:[`${n.carrier} `,`${(I=a.carrier)==null?void 0:I.toLocaleUpperCase()} | `,a.number]}),c?i(Z,{onClick:c,children:n.trackButton}):null]},`${a.number}_${C}`)}),e!=null&&e.ReturnItemsDetails?i(E,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:e==null?void 0:e.ReturnItemsDetails,context:{items:t.items}}):null,i(R,{actionIconPosition:"right","data-testid":"dropinAccordion",children:i(V,{defaultOpen:s>=t.items.length,title:i(B,{id:"Order.ShippingStatusCard.itemText",plural:t.items.reduce((p,C)=>p+C.totalQuantity,0),fields:{count:t.items.reduce((p,C)=>p+C.totalQuantity,0)}}),children:i(G,{maxColumns:o?3:9,emptyGridContent:i(_,{}),className:$(["order-shipping-status-card__images",["order-shipping-status-card__images-3",o]]),children:t.items.map((p,C)=>{var c,b;const a=(c=p.thumbnail)==null?void 0:c.label,g=(b=p.thumbnail)==null?void 0:b.url;return i(d,{href:(h==null?void 0:h(p))??"#","data-testid":`${C}${p.uid}`,children:i(q,{alt:a,src:g,width:85,height:114})},`${C}${p.uid}`)})})})})]})]})},sn=({translations:e,slots:s,orderData:n,collapseThreshold:t=10,routeProductDetails:m,routeTracking:h})=>{var I,U,H,j,v,F,Q;const o=!!(n!=null&&n.returnNumber),d=n==null?void 0:n.returnNumber,u=m?"a":"span",p=(I=n==null?void 0:n.status)==null?void 0:I.toLocaleLowerCase(),a=((U=n==null?void 0:n.shipments)==null?void 0:U.length)===1&&(p==null?void 0:p.includes(M.COMPLETE)),g=(H=n==null?void 0:n.shipments)==null?void 0:H.every(l=>l.tracking.length===0),c=(j=n==null?void 0:n.items)==null?void 0:j.filter(l=>(l==null?void 0:l.quantityShipped)===0||(l==null?void 0:l.quantityShipped)<(l==null?void 0:l.quantityOrdered)),b=(v=n==null?void 0:n.items)==null?void 0:v.reduce((l,f)=>{const O=f.quantityOrdered-f.quantityShipped;return l+(O>0?O:0)},0);if(o&&(n!=null&&n.returns.length)){const l=n.returns.find(f=>f.returnNumber===d);return!l||l.tracking.length===0?null:i(ln,{slots:s,collapseThreshold:t,translations:e,returnData:l,routeTracking:h,routeProductDetails:m})}return!n||p!=null&&p.includes(M.CANCELED)?null:(F=n==null?void 0:n.shipments)!=null&&F.length?g&&!(c!=null&&c.length)&&a?null:S(_,{children:[(Q=n==null?void 0:n.shipments)==null?void 0:Q.map(({tracking:l,items:f,id:O},P)=>{const K=f.reduce((r,N)=>{var y;return(r??0)+(((y=N.orderItem)==null?void 0:y.quantityShipped)??0)},0);return S(L,{variant:"secondary",className:"order-shipping-status-card",children:[i(w,{title:e.shippingCardTitle}),l==null?void 0:l.map(r=>{var y;const N=h==null?void 0:h(r),T=N?()=>{window.open(N,"_blank","noreferrer")}:null;return S("div",{className:"order-shipping-status-card__header",role:"status",children:[S("div",{className:"order-shipping-status-card__header--content",children:[S("p",{children:[e.carrier," ",(y=r==null?void 0:r.carrier)==null?void 0:y.toLocaleUpperCase()," | ",r==null?void 0:r.number]}),i("p",{children:r==null?void 0:r.title})]}),s!=null&&s.DeliveryTrackActions?i(E,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:s==null?void 0:s.DeliveryTrackActions,context:{trackInformation:r}}):T?i(Z,{onClick:T,children:e.trackButton}):null]},r.number)}),a?null:i(R,{actionIconPosition:"right","data-testid":"dropinAccordion",children:i(V,{"data-position":P+1,defaultOpen:t>=(f==null?void 0:f.length),title:i(_,{children:i(B,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:K,fields:{count:K}})}),children:i(G,{maxColumns:6,emptyGridContent:i(_,{}),className:"order-shipping-status-card__images",children:f==null?void 0:f.map(r=>{var y,W,Y,z,J,X;const N=(Y=(W=(y=r==null?void 0:r.orderItem)==null?void 0:y.product)==null?void 0:W.thumbnail)==null?void 0:Y.label,T=(X=(J=(z=r==null?void 0:r.orderItem)==null?void 0:z.product)==null?void 0:J.thumbnail)==null?void 0:X.url;return i(u,{href:(m==null?void 0:m(r))??"#",children:i(q,{alt:N,src:T||"",width:85,height:114})},r.id)})})})}),s!=null&&s.DeliveryTimeLine?i(E,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:s==null?void 0:s.DeliveryTimeLine,context:{}}):null]},O)}),c!=null&&c.length?S(L,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[i(w,{title:e.notYetShippedTitle}),i(R,{actionIconPosition:"right",children:i(V,{defaultOpen:t>=(c==null?void 0:c.length),title:i(B,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:b,fields:{count:b}}),children:i(G,{maxColumns:6,emptyGridContent:i(_,{}),className:"order-shipping-status-card__images",children:c==null?void 0:c.map(l=>{var f,O;return i(u,{href:(m==null?void 0:m(l))??"#",children:i(q,{alt:(f=l.thumbnail)==null?void 0:f.label,src:((O=l.thumbnail)==null?void 0:O.url)||"",width:85,height:114})},l.id)})})})})]}):null]}):S(L,{variant:"secondary",className:"order-shipping-status-card",children:[i(w,{title:e.shippingInfoTitle}),i("div",{className:"order-shipping-status-card__header",children:S("div",{className:"order-shipping-status-card__header--content",children:[n!=null&&n.carrier?i("p",{children:n==null?void 0:n.carrier}):null,i("p",{children:e.noInfoTitle})]})})]})},an=({slots:e,className:s,collapseThreshold:n,orderData:t,routeOrderDetails:m,routeTracking:h,routeProductDetails:o})=>{const{loading:d,order:u,isVirtualProduct:p}=tn({orderData:t}),C=en({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",returnOrderCardTitle:"Order.ShippingStatusCard.returnOrderCardTitle",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",noInfoTitle:"Order.ShippingStatusCard.noInfoTitle",returnNumber:"Order.ShippingStatusCard.returnNumber",orderNumber:"Order.ShippingStatusCard.orderNumber",trackButton:"Order.ShippingStatusCard.trackButton"});return!d&&p?null:i("div",{className:$(["order-shipping-status",s]),children:!d&&u?i(sn,{translations:C,routeOrderDetails:m,routeTracking:h,slots:e,orderData:u,collapseThreshold:n,routeProductDetails:o}):i(pn,{withCard:!1})})};export{an as ShippingStatus,an as default}; +import{jsx as i,jsxs as S,Fragment as _}from"@dropins/tools/preact-jsx-runtime.js";import{classes as $,VComponent as A,Slot as E}from"@dropins/tools/lib.js";import{Card as L,Header as w,Accordion as R,AccordionSection as G,ContentGrid as V,Image as q}from"@dropins/tools/components.js";import"../chunks/OrderCancel.js";import{useState as x,useEffect as k}from"@dropins/tools/preact-hooks.js";import{events as D}from"@dropins/tools/event-bus.js";import"@dropins/tools/preact.js";import{u as nn}from"../chunks/useIsMobile.js";import{Text as B,useText as en}from"@dropins/tools/i18n.js";import{C as pn}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";var M=(e=>(e.PENDING="pending",e.SHIPPING="shipping",e.COMPLETE="complete",e.PROCESSING="processing",e.HOLD="on hold",e.CANCELED="Canceled",e.SUSPECTED_FRAUD="suspected fraud",e.PAYMENT_REVIEW="payment review",e))(M||{});const tn=({orderData:e})=>{const[r,n]=x(!0),[t,m]=x(e),[h,o]=x(!1);return k(()=>{const d=D.on("order/data",u=>{m(u),o(u==null?void 0:u.isVirtual),n(!1)},{eager:!0});return()=>{d==null||d.off()}},[]),{loading:r,order:t,isVirtualProduct:h}},Z=({value:e,variant:r="primary",size:n="medium",icon:t,className:m,children:h,disabled:o=!1,active:d=!1,activeChildren:u,activeIcon:p,href:C,...b})=>{let g="dropin-button";(t&&!h||t&&d&&!u||!t&&d&&p)&&(g="dropin-iconButton"),d&&u&&(g="dropin-button"),m=$([g,`${g}--${n}`,`${g}--${r}`,[`${g}--${r}--disabled`,o],h&&t&&`${g}--with-icon`,!h&&u&&t&&`${g}--with-icon`,d&&p&&`${g}--with-icon`,m]);const c=$(["dropin-button-icon",`dropin-button-icon--${r}`,[`dropin-button-icon--${r}--disabled`,o],t==null?void 0:t.props.className]),a=C?{node:i("a",{}),role:"link",href:C,...b,disabled:o,active:d,onKeyDown:y=>{o&&y.preventDefault()},tabIndex:o?-1:0}:{node:i("button",{}),role:"button",...b,value:e,disabled:o,active:d};return S(A,{...a,className:m,children:[t&&!d&&i(A,{node:t,className:c}),p&&d&&i(A,{node:p,className:c}),h&&!d&&(typeof h=="string"?i("span",{children:h}):h),d&&u&&(typeof u=="string"?i("span",{children:u}):u)]})},sn=({slots:e,collapseThreshold:r,translations:n,returnData:t,routeTracking:m,routeProductDetails:h})=>{var u;const o=nn(),d=h?"a":"span";return S(L,{variant:"secondary",className:$(["order-shipping-status-card","order-shipping-status-card--return-order"]),children:[i(w,{title:n.returnOrderCardTitle}),S("div",{children:[(u=t==null?void 0:t.tracking)==null?void 0:u.map((p,C)=>{var a,y;const b={title:"",number:(p==null?void 0:p.trackingNumber)??"",carrier:((a=p==null?void 0:p.carrier)==null?void 0:a.label)??""},g=m==null?void 0:m(b),c=g?()=>{window.open(g,"_blank","noreferrer")}:null;return S("div",{className:"order-shipping-status-card__header",children:[S("div",{children:[`${n.carrier} `,`${(y=b.carrier)==null?void 0:y.toLocaleUpperCase()} | `,b.number]}),c?i(Z,{onClick:c,children:n.trackButton}):null]},`${b.number}_${C}`)}),e!=null&&e.ReturnItemsDetails?i(E,{"data-testid":"returnItemsDetails",name:"ReturnItemsDetails",slot:e==null?void 0:e.ReturnItemsDetails,context:{items:t.items}}):null,i(R,{actionIconPosition:"right","data-testid":"dropinAccordion",children:i(G,{defaultOpen:r>=t.items.length,title:i(B,{id:"Order.ShippingStatusCard.itemText",plural:t.items.reduce((p,C)=>p+C.totalQuantity,0),fields:{count:t.items.reduce((p,C)=>p+C.totalQuantity,0)}}),children:i(V,{maxColumns:o?3:9,emptyGridContent:i(_,{}),className:$(["order-shipping-status-card__images",["order-shipping-status-card__images-3",o]]),children:t.items.map((p,C)=>{var c,a;const b=(c=p.thumbnail)==null?void 0:c.label,g=(a=p.thumbnail)==null?void 0:a.url;return i(d,{href:(h==null?void 0:h(p))??"#","data-testid":`${C}${p.uid}`,children:i(q,{alt:b,src:g,width:85,height:114})},`${C}${p.uid}`)})})})})]})]})},rn=({translations:e,slots:r,orderData:n,collapseThreshold:t=10,routeProductDetails:m,routeTracking:h})=>{var y,U,H,j,v,F,Q;const o=!!(n!=null&&n.returnNumber),d=n==null?void 0:n.returnNumber,u=m?"a":"span",p=(y=n==null?void 0:n.status)==null?void 0:y.toLocaleLowerCase(),b=((U=n==null?void 0:n.shipments)==null?void 0:U.length)===1&&(p==null?void 0:p.includes(M.COMPLETE)),g=(H=n==null?void 0:n.shipments)==null?void 0:H.every(s=>s.tracking.length===0),c=(j=n==null?void 0:n.items)==null?void 0:j.filter(s=>(s==null?void 0:s.quantityShipped)===0||(s==null?void 0:s.quantityShipped)<(s==null?void 0:s.quantityOrdered)),a=(v=n==null?void 0:n.items)==null?void 0:v.reduce((s,f)=>{const I=f.quantityOrdered-f.quantityShipped;return s+(I>0?I:0)},0);if(o&&(n!=null&&n.returns.length)){const s=n.returns.find(f=>f.returnNumber===d);return!s||s.tracking.length===0?null:i(sn,{slots:r,collapseThreshold:t,translations:e,returnData:s,routeTracking:h,routeProductDetails:m})}return!n||p!=null&&p.includes(M.CANCELED)?null:(F=n==null?void 0:n.shipments)!=null&&F.length?g&&!(c!=null&&c.length)&&b?null:S(_,{children:[(Q=n==null?void 0:n.shipments)==null?void 0:Q.map(({tracking:s,items:f,id:I},P)=>{const K=f.reduce((l,N)=>{var O;return l+(((O=N.orderItem)==null?void 0:O.quantityShipped)??0)},0);return S(L,{variant:"secondary",className:"order-shipping-status-card",children:[i(w,{title:e.shippingCardTitle}),s==null?void 0:s.map(l=>{var T;const N=h==null?void 0:h(l),O=N?()=>{window.open(N,"_blank","noreferrer")}:null;return S("div",{className:"order-shipping-status-card__header",role:"status",children:[S("div",{className:"order-shipping-status-card__header--content",children:[S("p",{children:[e.carrier," ",(T=l==null?void 0:l.carrier)==null?void 0:T.toLocaleUpperCase()," | ",l==null?void 0:l.number]}),i("p",{children:l==null?void 0:l.title})]}),r!=null&&r.DeliveryTrackActions?i(E,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:r==null?void 0:r.DeliveryTrackActions,context:{trackInformation:l}}):O?i(Z,{onClick:O,children:e.trackButton}):null]},l.number)}),b?null:i(R,{actionIconPosition:"right","data-testid":"dropinAccordion",children:i(G,{"data-position":P+1,defaultOpen:t>=(f==null?void 0:f.length),title:i(_,{children:i(B,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:K,fields:{count:K}})}),children:i(V,{maxColumns:6,emptyGridContent:i(_,{}),className:"order-shipping-status-card__images",children:f==null?void 0:f.map(l=>{var T,W,Y,z,J,X;const N=(Y=(W=(T=l==null?void 0:l.orderItem)==null?void 0:T.product)==null?void 0:W.thumbnail)==null?void 0:Y.label,O=(X=(J=(z=l==null?void 0:l.orderItem)==null?void 0:z.product)==null?void 0:J.thumbnail)==null?void 0:X.url;return i(u,{href:(m==null?void 0:m(l))??"#",children:i(q,{alt:N,src:O||"",width:85,height:114})},l.id)})})})}),r!=null&&r.DeliveryTimeLine?i(E,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:r==null?void 0:r.DeliveryTimeLine,context:{}}):null]},I)}),c!=null&&c.length?S(L,{variant:"secondary",className:"order-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[i(w,{title:e.notYetShippedTitle}),i(R,{actionIconPosition:"right",children:i(G,{defaultOpen:t>=(c==null?void 0:c.length),title:i(B,{id:"Order.ShippingStatusCard.notYetShippedImagesTitle",plural:a,fields:{count:a}}),children:i(V,{maxColumns:6,emptyGridContent:i(_,{}),className:"order-shipping-status-card__images",children:c==null?void 0:c.map(s=>{var f,I;return i(u,{href:(m==null?void 0:m(s))??"#",children:i(q,{alt:(f=s.thumbnail)==null?void 0:f.label,src:((I=s.thumbnail)==null?void 0:I.url)||"",width:85,height:114})},s.id)})})})})]}):null]}):S(L,{variant:"secondary",className:"order-shipping-status-card",children:[i(w,{title:e.shippingInfoTitle}),i("div",{className:"order-shipping-status-card__header",children:S("div",{className:"order-shipping-status-card__header--content",children:[n!=null&&n.carrier?i("p",{children:n==null?void 0:n.carrier}):null,i("p",{children:e.noInfoTitle})]})})]})},bn=({slots:e,className:r,collapseThreshold:n,orderData:t,routeOrderDetails:m,routeTracking:h,routeProductDetails:o})=>{const{loading:d,order:u,isVirtualProduct:p}=tn({orderData:t}),C=en({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",returnOrderCardTitle:"Order.ShippingStatusCard.returnOrderCardTitle",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",noInfoTitle:"Order.ShippingStatusCard.noInfoTitle",returnNumber:"Order.ShippingStatusCard.returnNumber",orderNumber:"Order.ShippingStatusCard.orderNumber",trackButton:"Order.ShippingStatusCard.trackButton"});return!d&&p?null:i("div",{className:$(["order-shipping-status",r]),children:!d&&u?i(rn,{translations:C,routeOrderDetails:m,routeTracking:h,slots:e,orderData:u,collapseThreshold:n,routeProductDetails:o}):i(pn,{withCard:!1})})};export{bn as ShippingStatus,bn as default}; diff --git a/scripts/__dropins__/storefront-order/data/transforms/transform-attributes-form.d.ts b/scripts/__dropins__/storefront-order/data/transforms/transform-attributes-form.d.ts index bd92ba7964..fea2010f22 100644 --- a/scripts/__dropins__/storefront-order/data/transforms/transform-attributes-form.d.ts +++ b/scripts/__dropins__/storefront-order/data/transforms/transform-attributes-form.d.ts @@ -2,6 +2,6 @@ import { AttributesListItems, ResponseAttributesFormItemsProps } from '../../typ import { AttributesFormModel } from '../models'; export declare const cloneArrayIfExists: (fields: ResponseAttributesFormItemsProps[]) => any; -export declare const transformAttributesForm: (response: ResponseAttributesFormItemsProps[] | AttributesListItems[] | [ +export declare const transformAttributesForm: (items?: ResponseAttributesFormItemsProps[] | AttributesListItems[] | [ ]) => AttributesFormModel[]; //# sourceMappingURL=transform-attributes-form.d.ts.map \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/reload b/scripts/__dropins__/storefront-order/reload index 51b2ca093a..c5cb1aad20 100644 --- a/scripts/__dropins__/storefront-order/reload +++ b/scripts/__dropins__/storefront-order/reload @@ -1 +1 @@ -{"at":1731441153786} \ No newline at end of file +{"at":1731441681135} \ No newline at end of file diff --git a/scripts/__dropins__/storefront-order/render.js b/scripts/__dropins__/storefront-order/render.js index e0fff43820..8f67b48fa7 100644 --- a/scripts/__dropins__/storefront-order/render.js +++ b/scripts/__dropins__/storefront-order/render.js @@ -1,3 +1,3 @@ (function(n,e){try{if(typeof document<"u"){const r=document.createElement("style"),a=e.styleId;for(const t in e.attributes)r.setAttribute(t,e.attributes[t]);r.setAttribute("data-dropin",a),r.appendChild(document.createTextNode(n));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})(`.dropin-button,.dropin-iconButton{border:0 none;cursor:pointer;white-space:normal}.dropin-button{border-radius:var(--shape-border-radius-3);font-size:var(--type-button-1-font);font-weight:var(--type-button-1-font);padding:var(--spacing-xsmall) var(--spacing-medium);display:flex;justify-content:center;align-items:center;text-align:left;word-wrap:break-word}.dropin-iconButton{height:var(--spacing-xbig);width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button:disabled,.dropin-iconButton:disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button:not(:disabled),.dropin-iconButton:not(:disabled){cursor:pointer}.dropin-button:focus,.dropin-iconButton:focus{outline:none}.dropin-button:focus-visible,.dropin-iconButton:focus-visible{outline:var(--spacing-xxsmall) solid var(--color-button-focus)}.dropin-button--primary,a.dropin-button--primary,.dropin-iconButton--primary{border:none;background:var(--color-brand-500) 0 0% no-repeat padding-box;color:var(--color-neutral-50);text-align:left;margin-right:0}.dropin-iconButton--primary{border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button--primary--disabled,a.dropin-button--primary--disabled,.dropin-iconButton--primary--disabled{background:var(--color-neutral-300) 0 0% no-repeat padding-box;color:var(--color-neutral-500);fill:var(--color-neutral-300);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--primary:hover,a.dropin-button--primary:hover,.dropin-iconButton--primary:hover,.dropin-button--primary:focus:hover,.dropin-iconButton--primary:focus:hover{background-color:var(--color-button-hover);text-decoration:none}.dropin-button--primary:focus,.dropin-iconButton--primary:focus{background-color:var(--color-brand-500)}.dropin-button--primary:hover:active,.dropin-iconButton--primary:hover:active{background-color:var(--color-button-active)}.dropin-button--secondary,a.dropin-button--secondary,.dropin-iconButton--secondary{border:var(--shape-border-width-2) solid var(--color-brand-500);background:none 0 0% no-repeat padding-box;color:var(--color-brand-500);padding-top:calc(var(--spacing-xsmall) - var(--shape-border-width-2));padding-left:calc(var(--spacing-medium) - var(--shape-border-width-2))}.dropin-iconButton--secondary{border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall);padding-top:calc(var(--spacing-xsmall) - var(--shape-border-width-2));padding-left:calc(var(--spacing-xsmall) - var(--shape-border-width-2))}.dropin-button--secondary--disabled,a.dropin-button--secondary--disabled,.dropin-iconButton--secondary--disabled{border:var(--shape-border-width-2) solid var(--color-neutral-300);background:none 0 0% no-repeat padding-box;color:var(--color-neutral-500);fill:var(--color-neutral-300);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--secondary:hover,a.dropin-button--secondary:hover,.dropin-iconButton--secondary:hover{border:var(--shape-border-width-2) solid var(--color-button-hover);color:var(--color-button-hover);text-decoration:none}.dropin-button--secondary:active,.dropin-iconButton--secondary:active{border:var(--shape-border-width-2) solid var(--color-button-active);color:var(--color-button-active)}.dropin-button--tertiary,a.dropin-button--tertiary,.dropin-iconButton--tertiary{border:none;background:none 0 0% no-repeat padding-box;color:var(--color-brand-500)}.dropin-iconButton--tertiary{border:none;border-radius:var(--spacing-xbig);min-height:var(--spacing-xbig);min-width:var(--spacing-xbig);padding:var(--spacing-xsmall)}.dropin-button--tertiary--disabled,a.dropin-button--tertiary--disabled,.dropin-iconButton--tertiary--disabled{border:none;color:var(--color-neutral-500);pointer-events:none;-webkit-user-select:none;user-select:none}.dropin-button--tertiary:hover,a.dropin-button--tertiary:hover,.dropin-iconButton--tertiary:hover{color:var(--color-button-hover);text-decoration:none}.dropin-button--tertiary:active,.dropin-iconButton--tertiary:active{color:var(--color-button-active)}.dropin-button--tertiary:focus-visible,.dropin-iconButton--tertiary:focus-visible{-webkit-box-shadow:inset 0 0 0 2px var(--color-neutral-800);-moz-box-shadow:inset 0 0 0 2px var(--color-neutral-800);box-shadow:inset 0 0 0 2px var(--color-neutral-800)}.dropin-button--large{font:var(--type-button-1-font);letter-spacing:var(--type-button-1-letter-spacing)}.dropin-button--medium{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.dropin-button-icon{height:24px}.dropin-button--with-icon{column-gap:var(--spacing-xsmall);row-gap:var(--spacing-xsmall)} -.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper-description--actions-slot{margin-bottom:0}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p,.order-shipping-status-card--return-order p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card--return-order p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-shipping-status-card--return-order p a:hover{text-decoration:none;color:var(--color-brand-800)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-shipping-status-card.order-shipping-status-card--return-order .dropin-content-grid.order-shipping-status-card__images{overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing);cursor:pointer}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address,.order-customer-details-content__container-return-information{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-customer-details-content__container-return-information .order-customer-details-content__container-description p{float:none;display:block}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:85px;height:114px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0 0 var(--spacing-medium) 0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .order-create-return_notification{margin-bottom:var(--spacing-medium)}.order-return-order-product-list{list-style:none;margin:0;padding:0}.order-return-order-product-list .order-return-order-product-list__item{display:grid;grid-template-columns:auto 1fr;align-items:start;margin-bottom:var(--spacing-medium);position:relative}.order-return-order-product-list__item--blur:before{content:"";position:absolute;width:100%;height:100%;background-color:var(--color-opacity-24);z-index:1}.order-return-order-product-list>.order-return-order-product-list__item:last-child{display:flex;justify-content:flex-end}.order-return-order-product-list>.order-return-order-product-list__item .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-return-order-product-list>.order-return-order-product-list__item .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .dropin-cart-item__footer .dropin-incrementer.dropin-incrementer--medium{max-width:160px}@media only screen and (min-width: 320px) and (max-width: 768px){.order-return-order-product-list>.order-return-order-product-list__item{margin-bottom:var(--spacing-medium)}}.order-return-order-message p{margin:0;padding:0}.order-return-order-message .order-return-order-message__title{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800);margin-bottom:var(--spacing-small)}.order-return-order-message .order-return-order-message__subtitle{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-bottom:var(--spacing-xlarge)}.order-return-reason-form .dropin-cart-item,.order-return-reason-form form .dropin-field{margin-bottom:var(--spacing-medium)}.order-return-reason-form .order-return-reason-form__actions{display:flex;gap:0 var(--spacing-medium);justify-content:flex-end;margin-bottom:0}.order-order-cancel-reasons-form__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}`,{styleId:"order"}); +.order-order-search-form{gap:var(--spacing-small);border-color:transparent}.order-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.order-order-search-form p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin:0}.order-order-search-form__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin:0}.order-order-search-form__wrapper{display:grid;grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:"email" "postcode" "number" "button";gap:var(--spacing-medium)}.order-order-search-form__wrapper__item--email{grid-area:email}.order-order-search-form__wrapper__item--postcode{grid-area:postcode}.order-order-search-form__wrapper__item--number{grid-area:number}.order-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.order-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.order-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.order-order-status-content .dropin-card__content{gap:0}.order-order-status-content__wrapper .order-order-status-content__wrapper-description p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.order-order-status-content__wrapper-description--actions-slot{margin-bottom:0}.order-shipping-status-card .dropin-card__content{gap:0}.order-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card__header button{max-height:40px}.order-shipping-status-card__header--content p,.order-shipping-status-card--return-order p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);margin-bottom:var(--spacing-xsmall)}.order-shipping-status-card--return-order p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-shipping-status-card--return-order p a:hover{text-decoration:none;color:var(--color-brand-800)}.order-shipping-status-card .order-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-shipping-status-card.order-shipping-status-card--return-order .dropin-content-grid.order-shipping-status-card__images{overflow:auto!important}.order-shipping-status-card .order-shipping-status-card__images img{object-fit:contain;width:85px;height:114px}.order-order-loaders--card-loader{margin-bottom:var(--spacing-small)}.order-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.order-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing);cursor:pointer}.order-order-actions__wrapper--empty{display:none}.order-customer-details-content .dropin-card__content{gap:0}.order-customer-details-content__container{display:block;flex-direction:column}.order-customer-details-content__container-shipping_address,.order-customer-details-content__container-billing_address{margin:var(--spacing-medium) 0}@media (min-width: 768px){.order-customer-details-content__container{display:grid;grid-template-columns:auto;grid-template-rows:auto auto auto;grid-auto-flow:row}.order-customer-details-content__container-email{grid-area:1 / 1 / 2 / 2}.order-customer-details-content__container--no-margin p{margin-bottom:0}.order-customer-details-content__container-shipping_address{grid-area:2 / 1 / 3 / 2;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address,.order-customer-details-content__container-return-information{grid-area:2 / 2 / 3 / 3;margin:var(--spacing-medium) 0}.order-customer-details-content__container-billing_address--fullwidth{grid-area:2 / 1 / 3 / 3}.order-customer-details-content__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.order-customer-details-content__container-payment_methods{grid-area:3 / 2 / 4 / 3}.order-customer-details-content__container-payment_methods--fullwidth{grid-area:3 / 1 / 4 / 3}}.order-customer-details-content__container-title{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin:0 0 var(--spacing-xsmall) 0}.order-customer-details-content__container p{color:var(--color-neutral-800);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-top:0}.order-customer-details-content__container-payment_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.order-customer-details-content__container-payment_methods p.order-customer-details-content__container-payment_methods--icon{gap:0 var(--spacing-xsmall)}.order-customer-details-content__container-description p{margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-big);padding:0}.order-customer-details-content__container-description p:nth-child(1),.order-customer-details-content__container-description p:nth-child(3),.order-customer-details-content__container-description p:nth-child(4),.order-customer-details-content__container-description p:nth-child(6){float:left}.order-customer-details-content__container-return-information .order-customer-details-content__container-description p{float:none;display:block}.order-empty-list{margin-bottom:var(--spacing-small)}.order-empty-list.order-empty-list--minified,.order-empty-list .dropin-card{border:none}.order-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.order-empty-list.order-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.order-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.order-empty-list.order-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.order-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list--empty-box .dropin-card__content svg path{fill:var(--color-neutral-500)}.order-empty-list .dropin-card__content p{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.order-empty-list.order-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.order-returns-list-content .order-returns__header--minified{margin-bottom:var(--spacing-small)}.order-returns-list-content .order-returns__header--full-size{margin-bottom:0}.order-returns-list-content__cards-list{margin-bottom:var(--spacing-small)}.order-returns-list-content__cards-list .dropin-card__content{gap:0}.order-returns-list-content__cards-grid{display:grid;grid-template-columns:1fr 1fr auto;gap:0px 0px;grid-template-areas:"descriptions descriptions actions" "images images actions"}.order-returns-list-content__descriptions{grid-area:descriptions}.order-returns-list-content__descriptions p{margin:0 0 var(--spacing-small) 0;padding:0;box-sizing:border-box;font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);color:var(--color-neutral-800)}.order-returns-list-content__descriptions p a{display:inline-block;font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);color:var(--color-brand-800)}.order-returns-list-content__descriptions p a:hover{color:var(--color-brand-800)}.order-returns-list-content__descriptions .order-returns-list-content__return-status{font:var(--type-button-2-font);font-weight:500;color:var(--color-neutral-800)}.order-returns-list-content .order-returns-list-content__actions{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}.order-returns-list-content .order-returns-list-content__actions:hover{text-decoration:none;color:var(--color-brand-500)}.order-returns-list-content__card .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.order-returns-list-content__card .order-returns-list-content__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.order-returns-list-content__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.order-returns-list-content__card-wrapper svg{color:var(--color-neutral-800)}.order-returns-list-content__images{margin-top:var(--spacing-small);grid-area:images}.order-returns-list-content__actions{grid-area:actions;align-self:center}.order-returns-list-content .order-returns-list-content__images{overflow:auto}.order-returns-list-content .order-returns-list-content__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.order-returns-list-content .order-returns-list-content__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.order-returns-list-content .order-returns-list-content__images img{object-fit:contain;width:85px;height:114px}.order-order-product-list-content__items{display:grid;gap:var(--spacing-medium);list-style:none;margin:0 0 var(--spacing-medium) 0;padding:0}.order-order-product-list-content .dropin-card__content{gap:0}.order-order-product-list-content__items .dropin-card__content{gap:var(--spacing-xsmall)}.order-order-product-list-content .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-order-product-list-content .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}@media only screen and (min-width: 320px) and (max-width: 768px){.order-confirmation-cart-summary-item{margin-bottom:var(--spacing-medium)}}.order-cost-summary-content .dropin-card__content{gap:0}.order-cost-summary-content__description{margin-bottom:var(--spacing-xsmall)}.order-cost-summary-content__description .order-cost-summary-content__description--header,.order-cost-summary-content__description .order-cost-summary-content__description--subheader{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__description .order-cost-summary-content__description--header span{color:var(--color-neutral-800);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-cost-summary-content__description--subheader{margin-top:var(--spacing-xxsmall)}.order-cost-summary-content__description--subheader span{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-brand-700)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader{display:flex;justify-content:flex-start;align-items:center;gap:0 var(--spacing-xxsmall)}.order-cost-summary-content__description--subtotal .order-cost-summary-content__description--subheader .dropin-price,.order-cost-summary-content__description--shipping .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-overline-font)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--header span:last-child{color:var(--color-alert-800)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child{display:flex;justify-content:flex-start;align-items:flex-end;gap:0 var(--spacing-xsmall)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader span:first-child span{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-700)}.order-cost-summary-content__description--discount .order-cost-summary-content__description--subheader .dropin-price{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-alert-800)}.order-cost-summary-content__description--total{margin-top:var(--spacing-medium)}.order-cost-summary-content__description--total .order-cost-summary-content__description--header span{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.order-cost-summary-content__accordion .dropin-accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.order-cost-summary-content__accordion-row{display:flex;justify-content:space-between;align-items:center}.order-cost-summary-content__accordion-row p{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.order-cost-summary-content__accordion-row p:first-child{color:var(--color-neutral-700)}.order-cost-summary-content__accordion .order-cost-summary-content__accordion-row.order-cost-summary-content__accordion-total p:first-child{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .order-create-return_notification{margin-bottom:var(--spacing-medium)}.order-return-order-product-list{list-style:none;margin:0;padding:0}.order-return-order-product-list .order-return-order-product-list__item{display:grid;grid-template-columns:auto 1fr;align-items:start;margin-bottom:var(--spacing-medium);position:relative}.order-return-order-product-list__item--blur:before{content:"";position:absolute;width:100%;height:100%;background-color:var(--color-opacity-24);z-index:1}.order-return-order-product-list>.order-return-order-product-list__item:last-child{display:flex;justify-content:flex-end}.order-return-order-product-list>.order-return-order-product-list__item .dropin-cart-item__alert{margin-top:var(--spacing-xsmall)}.order-return-order-product-list>.order-return-order-product-list__item .cart-summary-item__title--strikethrough{text-decoration:line-through;color:var(--color-neutral-500);font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.order-create-return .dropin-cart-item__footer .dropin-incrementer.dropin-incrementer--medium{max-width:160px}.order-return-order-product-list .dropin-incrementer__button-container{margin:0}@media only screen and (min-width: 320px) and (max-width: 768px){.order-return-order-product-list>.order-return-order-product-list__item{margin-bottom:var(--spacing-medium)}}.order-return-order-message p{margin:0;padding:0}.order-return-order-message .order-return-order-message__title{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800);margin-bottom:var(--spacing-small)}.order-return-order-message .order-return-order-message__subtitle{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);margin-bottom:var(--spacing-xlarge)}.order-return-reason-form .dropin-cart-item,.order-return-reason-form form .dropin-field{margin-bottom:var(--spacing-medium)}.order-return-reason-form .order-return-reason-form__actions{display:flex;gap:0 var(--spacing-medium);justify-content:flex-end;margin-bottom:0}.order-order-cancel-reasons-form__text{text-align:left;color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel-reasons-form__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}.order-order-cancel__modal{margin:auto}.order-order-cancel__modal .dropin-modal__header{display:grid;grid-template-columns:1fr auto}.order-order-cancel__title{color:var(--color-neutral-900);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.order-order-cancel__text{color:var(--color-neutral-800);font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);padding-bottom:var(--spacing-xsmall)}.order-order-cancel__modal .dropin-modal__header-close-button{align-self:center}.order-order-cancel__button-container{display:grid;margin-top:var(--spacing-xbig);justify-content:end}@media only screen and (min-width: 768px){.dropin-modal__body--medium.order-order-cancel__modal>.dropin-modal__header-title{margin:0 var(--spacing-xxbig) var(--spacing-medium)}}`,{styleId:"order"}); import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{Render as n}from"@dropins/tools/lib.js";import{useState as s,useEffect as d}from"@dropins/tools/preact-hooks.js";import{UIProvider as l}from"@dropins/tools/components.js";import{events as c}from"@dropins/tools/event-bus.js";const u={CreateReturn:{headerText:"Return items",downloadableCount:"Files",returnedItems:"Returned items:",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},giftCard:{sender:"Sender",recipient:"Recipient",message:"Note"},success:{title:"Return submitted",message:"Your return request has been successfully submitted."},buttons:{nextStep:"Continue",backStep:"Back",submit:"Submit return",backStore:"Back to order"}},OrderCostSummary:{headerText:"Order summary",headerReturnText:"Return summary",subtotal:{title:"Subtotal"},shipping:{title:"Shipping",freeShipping:"Free shipping"},tax:{accordionTitle:"Taxes",accordionTotalTax:"Tax Total",totalExcludingTaxes:"Total excluding taxes",title:"Tax",incl:"Including taxes",excl:"Excluding taxes"},discount:{title:"Discount",subtitle:"discounted"},total:{title:"Total"}},Returns:{minifiedView:{returnsList:{viewAllOrdersButton:"View all returns",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Recent returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}},fullSizeView:{returnsList:{viewAllOrdersButton:"View all orders",ariaLabelLink:"Redirect to full order information",emptyOrdersListMessage:"No returns",minifiedViewTitle:"Returns",orderNumber:"Order number:",returnNumber:"Return number:",carrier:"Carrier:",itemText:{none:"",one:"item",many:"items"},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"}}}},OrderProductListContent:{cancelledTitle:"Cancelled",allOrdersTitle:"Your order",returnedTitle:"Returned",refundedTitle:"Your refunded",downloadableCount:"Files",stockStatus:{inStock:"In stock",outOfStock:"Out of stock"},GiftCard:{sender:"Sender",recipient:"Recipient",message:"Note"}},OrderSearchForm:{title:"Enter your information to view order details",description:"You can find your order number in the receipt you received via email.",button:"View Order",email:"Email",postcode:"Zip Code",orderNumber:"Order Number"},Form:{notifications:{requiredFieldError:"This is a required field."}},ShippingStatusCard:{orderNumber:"Order number:",returnNumber:"Return number:",itemText:{none:"",one:"Package contents ({{count}} item)",many:"Package contents ({{count}} items)"},trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",returnOrderCardTitle:"Package details",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping information",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:{singular:"Package contents ({{count}} item)",plural:"Package contents ({{count}} items)"}},OrderStatusContent:{noInfoTitle:"Check back later for more details.",returnMessage:"The order was placed on {ORDER_CREATE_DATE} and your return process started on {RETURN_CREATE_DATE}",returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},actions:{cancel:"Cancel order",createReturn:"Return or replace",createAnotherReturn:"Start another return",reorder:"Reorder"},orderPending:{title:"Pending",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderProcessing:{title:"Processing",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderOnHold:{title:"On hold",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderReceived:{title:"Order received",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},orderComplete:{title:"Complete",message:"Your order is complete. Need help with your order? Contact us at support@adobe.com"},orderCanceled:{title:"Canceled",message:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days.",messageWithoutDate:"This order was cancelled by you. You should see a refund to your original payment method with 5-7 business days."},orderSuspectedFraud:{title:"Suspected fraud",message:"We’ve run into an issue while processing your order on {DATE}. Please check back later or contact us at support@adobe.com for more information.",messageWithoutDate:"We’ve run into an issue while processing your order. Please check back later or contact us at support@adobe.com for more information."},orderPaymentReview:{title:"Payment Review",message:"The order was successfully placed on {DATE} and your order is processing. Check back for more details when your order ships.",messageWithoutDate:"Your order is processing. Check back for more details when your order ships."},guestOrderCancellationRequested:{title:"cancellation requested",message:"The cancellation has been requested on {DATE}. Check your email for further instructions.",messageWithoutDate:"The cancellation has been requested. Check your email for further instructions."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",orderReturnLabels:{createdReturnAt:"Return requested on: ",returnStatusLabel:"Return status: ",orderNumberLabel:"Order number: "},returnStatus:{pending:"Pending",authorized:"Authorized",partiallyAuthorized:"Partially authorized",received:"Received",partiallyReceived:"Partially received",approved:"Approved",partiallyApproved:"Partially approved",rejected:"Rejected",partiallyRejected:"Partially rejected",denied:"Denied",processedAndClosed:"Processed and closed",closed:"Closed"},email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},paymentMethods:{title:"Payment method"},returnInformation:{title:"Return details"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."},OrderCancel:{buttonText:"Cancel Order"},OrderCancelForm:{title:"Cancel order",description:"Select a reason for canceling the order",label:"Reason for cancel",button:"Submit Cancellation",errorHeading:"Error",errorDescription:"There was an error processing your order cancellation."}},p={Order:u},m={default:p},h=({children:t})=>{const[o,i]=s("en_US");return d(()=>{const e=c.on("locale",a=>{i(a)},{eager:!0});return()=>{e==null||e.off()}},[]),r(l,{lang:o,langDefinitions:m,children:t})},T=new n(r(h,{}));export{T as render}; diff --git a/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts b/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts index b3b80df6bf..e7df546ad6 100644 --- a/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts +++ b/scripts/__dropins__/storefront-order/types/api/getOrderDetails.types.d.ts @@ -246,6 +246,14 @@ export interface ErrorProps { message?: string; }[]; } +type GetOrderDetailsByParams = { + orderId?: string; + returnRef?: string; + queryType: T; + returnsPageSize: number; +}; +export interface GetOrderDetailsByIdProps extends GetOrderDetailsByParams { +} export interface OrdersResponse extends ErrorProps { data?: { customer?: {