diff --git a/scripts/__dropins__/storefront-order/containers/OrderSearch.js b/scripts/__dropins__/storefront-order/containers/OrderSearch.js index 7d2ba25fa9..b2266165b6 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderSearch.js +++ b/scripts/__dropins__/storefront-order/containers/OrderSearch.js @@ -1 +1 @@ -import{jsxs as v,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _}from"@dropins/tools/lib.js";import{Card as U,InLineAlert as C,Icon as x,Button as V}from"@dropins/tools/components.js";import{F as L}from"../chunks/CustomerDetailsContent.js";import{useState as R,useCallback as D,useEffect as O,useMemo as k}from"@dropins/tools/preact-hooks.js";import*as g from"@dropins/tools/preact-compat.js";import{Text as S,useText as H}from"@dropins/tools/i18n.js";import{events as w}from"@dropins/tools/event-bus.js";import{c as A,g as P}from"../chunks/getCustomer.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const X=e=>g.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},g.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({onSubmit:e,loading:t,inLineAlert:o,fieldsConfig:r})=>v(U,{variant:"secondary",className:"dropin-order-search-form",children:[n("h2",{className:"dropin-order-search-form__title",children:n(S,{id:"Order.OrderSearchForm.title"})}),n("p",{children:n(S,{id:"Order.OrderSearchForm.description"})}),o.text?n(C,{"data-testid":"orderAlert",className:"dropin-order-search-form__alert",type:o.type,variant:"secondary",heading:o.text,icon:n(x,{source:X})}):null,n(L,{className:"dropin-order-search-form__wrapper",name:"orderSearchForm",loading:t,fieldsConfig:r,onSubmit:e,children:n("div",{className:"dropin-order-search-form__button-container",children:n(V,{className:"dropin-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:t,children:n(S,{id:"Order.OrderSearchForm.button"})},"logIn")})})]});var T=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(T||{});const j=e=>{if(!e)return null;const t=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(r=>{t.has(r.name)||t.set(r.name,"false"),r.checked&&t.set(r.name,"true")}),t&&typeof t.entries=="function"){const r=t.entries();if(r&&typeof r[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(r)))||{}}return{}},p=(e,t)=>{if(typeof e!="function")return;const o=e();if(!t||Object.keys(t).length===0){window.location.href=o;return}const r=new URLSearchParams;Object.entries(t).forEach(([u,d])=>{r.append(u,String(d))});const c=o.includes("?")?"&":"?";window.location.href=`${o}${c}${r.toString()}`},I=e=>{try{return new URL(window.location.href).searchParams.get(e)}catch{return null}},q=({onError:e,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c})=>{const[u,d]=R({text:"",type:"success"}),[E,h]=R(!1),f=H({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",postcode:"Order.OrderSearchForm.postcode",number:"Order.OrderSearchForm.orderNumber"}),b=D(async a=>{const s=I("orderRef"),i=s&&s.length>20;if(!a&&!s||!(a!=null&&a.number)&&!(a!=null&&a.token)&&!s)return null;if(t){const m=await A();(m==null?void 0:m.email)===a.email?p(r,{orderRef:a==null?void 0:a.number}):i||p(c,{orderRef:a.token})}else i||p(c,{orderRef:a==null?void 0:a.token})},[t,r,c]);O(()=>{const a=w.on("order/data",s=>{b(s)},{eager:!0});return()=>{a==null||a.off()}},[b]),O(()=>{const a=I("orderRef"),s=a&&a.length>20?a:null;a&&(s?p(c,{orderRef:a}):t?p(r,{orderRef:a}):o==null||o({render:!0,formValues:{number:a}}))},[t,r,c,o]);const M=k(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.email,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.postcode,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:2,name:"postcode",id:"postcode",code:"postcode"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.number,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number"}],[f]);return{onSubmit:D(async(a,s)=>{if(!s)return null;h(!0);const i=j(a.target);await P(i).then(l=>{l||d({text:f.invalidSearch,type:"warning"}),w.emit("order/data",l)}).catch(async l=>{var N;let m=!0;e==null||e({error:l.message});const y=t?await A():{email:""};(y==null?void 0:y.email)===(i==null?void 0:i.email)?(m=!1,p(r,{orderRef:i.number})):m=o==null?void 0:o({render:(N=l==null?void 0:l.message)==null?void 0:N.includes("Please login to view the order."),formValues:i}),m&&d({text:l.message,type:"warning"})}).finally(()=>{h(!1)})},[t,e,o,r,f.invalidSearch]),inLineAlert:u,loading:E,normalizeFieldsConfig:M}},te=({className:e,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c,onError:u})=>{const{onSubmit:d,loading:E,inLineAlert:h,normalizeFieldsConfig:f}=q({onError:u,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c});return n("div",{className:_(["dropin-order-search",e]),children:n(B,{onSubmit:d,loading:E,inLineAlert:h,fieldsConfig:f})})};export{te as OrderSearch,te as default}; +import{jsxs as v,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _}from"@dropins/tools/lib.js";import{Card as U,InLineAlert as C,Icon as x,Button as V}from"@dropins/tools/components.js";import{F as L}from"../chunks/CustomerDetailsContent.js";import*as R from"@dropins/tools/preact-compat.js";import{useState as D,useCallback as O,useEffect as g,useMemo as k}from"@dropins/tools/preact-hooks.js";import{Text as S,useText as H}from"@dropins/tools/i18n.js";import{events as w}from"@dropins/tools/event-bus.js";import{c as A,g as P}from"../chunks/getCustomer.js";import"../chunks/fetch-graphql.js";import"@dropins/tools/fetch-graphql.js";const X=e=>R.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},R.createElement("path",{vectorEffect:"non-scaling-stroke",fillRule:"evenodd",clipRule:"evenodd",d:"M1 20.8953L12.1922 1.5L23.395 20.8953H1ZM13.0278 13.9638L13.25 10.0377V9H11.25V10.0377L11.4722 13.9638H13.0278ZM11.2994 16V17.7509H13.2253V16H11.2994Z",fill:"currentColor"})),B=({onSubmit:e,loading:t,inLineAlert:o,fieldsConfig:r})=>v(U,{variant:"secondary",className:"dropin-order-search-form",children:[n("h2",{className:"dropin-order-search-form__title",children:n(S,{id:"Order.OrderSearchForm.title"})}),n("p",{children:n(S,{id:"Order.OrderSearchForm.description"})}),o.text?n(C,{"data-testid":"orderAlert",className:"dropin-order-search-form__alert",type:o.type,variant:"secondary",heading:o.text,icon:n(x,{source:X})}):null,n(L,{className:"dropin-order-search-form__wrapper",name:"orderSearchForm",loading:t,fieldsConfig:r,onSubmit:e,children:n("div",{className:"dropin-order-search-form__button-container",children:n(V,{className:"dropin-order-search-form__button",size:"medium",variant:"primary",type:"submit",disabled:t,children:n(S,{id:"Order.OrderSearchForm.button"})},"logIn")})})]});var T=(e=>(e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.DATETIME="DATETIME",e.DROPDOWN="DROPDOWN",e.FILE="FILE",e.GALLERY="GALLERY",e.HIDDEN="HIDDEN",e.IMAGE="IMAGE",e.MEDIA_IMAGE="MEDIA_IMAGE",e.MULTILINE="MULTILINE",e.MULTISELECT="MULTISELECT",e.PRICE="PRICE",e.SELECT="SELECT",e.TEXT="TEXT",e.TEXTAREA="TEXTAREA",e.UNDEFINED="UNDEFINED",e.VISUAL="VISUAL",e.WEIGHT="WEIGHT",e.EMPTY="",e))(T||{});const j=e=>{if(!e)return null;const t=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(r=>{t.has(r.name)||t.set(r.name,"false"),r.checked&&t.set(r.name,"true")}),t&&typeof t.entries=="function"){const r=t.entries();if(r&&typeof r[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(r)))||{}}return{}},p=(e,t)=>{if(typeof e!="function")return;const o=e();if(!t||Object.keys(t).length===0){window.location.href=o;return}const r=new URLSearchParams;Object.entries(t).forEach(([u,d])=>{r.append(u,String(d))});const c=o.includes("?")?"&":"?";window.location.href=`${o}${c}${r.toString()}`},I=e=>{try{return new URL(window.location.href).searchParams.get(e)}catch{return null}},q=({onError:e,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c})=>{const[u,d]=D({text:"",type:"success"}),[E,h]=D(!1),f=H({invalidSearch:"Order.Errors.invalidSearch",email:"Order.OrderSearchForm.email",postcode:"Order.OrderSearchForm.postcode",number:"Order.OrderSearchForm.orderNumber"}),b=O(async a=>{const s=I("orderRef"),i=s&&s.length>20;if(!a&&!s||!(a!=null&&a.number)&&!(a!=null&&a.token)&&!s)return null;if(t){const m=await A();(m==null?void 0:m.email)===a.email?p(r,{orderRef:a==null?void 0:a.number}):i||p(c,{orderRef:a.token})}else i||p(c,{orderRef:a==null?void 0:a.token})},[t,r,c]);g(()=>{const a=w.on("order/data",s=>{b(s)},{eager:!0});return()=>{a==null||a.off()}},[b]),g(()=>{const a=I("orderRef"),s=a&&a.length>20?a:null;a&&(s?p(c,{orderRef:a}):t?p(r,{orderRef:a}):o==null||o({render:!0,formValues:{number:a}}))},[t,r,c,o]);const M=k(()=>[{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.email,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:1,name:"email",id:"email",code:"email"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.postcode,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:2,name:"postcode",id:"postcode",code:"postcode"},{entityType:"CUSTOMER_ADDRESS",is_unique:!1,label:f.number,options:[],defaultValue:"",fieldType:T.TEXT,className:"",required:!0,orderNumber:3,name:"number",id:"number",code:"number"}],[f]);return{onSubmit:O(async(a,s)=>{if(!s)return null;h(!0);const i=j(a.target);await P(i).then(l=>{l||d({text:f.invalidSearch,type:"warning"}),w.emit("order/data",l)}).catch(async l=>{var N;let m=!0;e==null||e({error:l.message});const y=t?await A():{email:""};(y==null?void 0:y.email)===(i==null?void 0:i.email)?(m=!1,p(r,{orderRef:i.number})):m=o==null?void 0:o({render:(N=l==null?void 0:l.message)==null?void 0:N.includes("Please login to view the order."),formValues:i}),m&&d({text:l.message,type:"warning"})}).finally(()=>{h(!1)})},[t,e,o,r,f.invalidSearch]),inLineAlert:u,loading:E,normalizeFieldsConfig:M}},te=({className:e,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c,onError:u})=>{const{onSubmit:d,loading:E,inLineAlert:h,normalizeFieldsConfig:f}=q({onError:u,isAuth:t,renderSignIn:o,routeCustomerOrder:r,routeGuestOrder:c});return n("div",{className:_(["dropin-order-search",e]),children:n(B,{onSubmit:d,loading:E,inLineAlert:h,fieldsConfig:f})})};export{te as OrderSearch,te as default}; diff --git a/scripts/__dropins__/storefront-order/containers/OrderStatus.js b/scripts/__dropins__/storefront-order/containers/OrderStatus.js index 2490a1ff1f..daa34bbc8c 100644 --- a/scripts/__dropins__/storefront-order/containers/OrderStatus.js +++ b/scripts/__dropins__/storefront-order/containers/OrderStatus.js @@ -1 +1 @@ -import{jsx as t,jsxs as O,Fragment as f}from"@dropins/tools/preact-jsx-runtime.js";import{Card as E,Header as v,Button as p}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import{Slot as g,classes as m}from"@dropins/tools/lib.js";import{useState as C,useEffect as N}from"@dropins/tools/preact-hooks.js";import{useMemo as w}from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";import{C as y}from"../chunks/OrderLoaders.js";import{events as A}from"@dropins/tools/event-bus.js";const h={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived"},_=({slots:r,title:a,status:n,orderData:e})=>{var s;const c=String(n).toLocaleLowerCase(),d=l(`Order.OrderStatusContent.${h[c]}.title`),o=l(`Order.OrderStatusContent.${h[c]}.message`);return n?O(E,{className:"dropin-order-status-content",variant:"secondary",children:[t(v,{title:a??d.title}),O("div",{className:"dropin-order-status-content__wrapper",children:[t("div",{className:"dropin-order-status-content__wrapper-description",children:t("p",{children:(s=o.message)==null?void 0:s.replace("{DATE}","01.01.1900")})}),t(T,{orderData:e,slots:r})]})]}):t("div",{})};var i=(r=>(r.CANCEL="CANCEL",r.RETURN="RETURN",r.REORDER="REORDER",r))(i||{});const T=({className:r,children:a,orderData:n,slots:e,...c})=>{const d=l({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),o=w(()=>{const s=n==null?void 0:n.availableActions,R=!!(s!=null&&s.length);return t(f,{children:e!=null&&e.OrderActions?t(g,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:n}):t("div",{"data-testid":"availableActionsList",className:m(["dropin-order-actions__wrapper",["dropin-order-actions__wrapper--empty",!R]]),children:s==null?void 0:s.map((S,u)=>{switch(S){case i.CANCEL:return t(p,{variant:"secondary",children:d.cancel},u);case i.RETURN:return t(p,{variant:"secondary",children:d.return},u);case i.REORDER:return t(p,{variant:"secondary",children:d.reorder},u)}})})})},[n,e==null?void 0:e.OrderActions,d]);return t("div",{...c,className:m(["dropin-order-actions",r]),children:o})},L=({orderData:r})=>{const[a,n]=C(r),[e,c]=C(r==null?void 0:r.status);return N(()=>{const d=A.on("order/data",o=>{n(o),c(o.status)},{eager:!0});return()=>{d==null||d.off()}},[]),{orderStatus:e,order:a}},k=({slots:r,orderData:a,className:n,statusTitle:e,status:c})=>{const{orderStatus:d,order:o}=L({orderData:a});return t("div",{className:m(["dropin-order-status",n]),children:o?t(_,{title:e,status:c||d,slots:r,orderData:o}):t(y,{withCard:!1})})};export{k as OrderStatus,k as default}; +import{jsx as t,jsxs as O,Fragment as f}from"@dropins/tools/preact-jsx-runtime.js";import{Card as E,Header as v,Button as p}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import{Slot as g,classes as m}from"@dropins/tools/lib.js";import{useMemo as N}from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";import{useState as C,useEffect as w}from"@dropins/tools/preact-hooks.js";import{C as y}from"../chunks/OrderLoaders.js";import{events as A}from"@dropins/tools/event-bus.js";const h={pending:"orderPending",shiping:"orderShipped",complete:"orderComplete",processing:"orderProcessing","on hold":"orderOnHold",canceled:"orderCanceled","suspected fraud":"orderSuspectedFraud","payment Review":"orderPaymentReview","order received":"orderReceived"},_=({slots:r,title:a,status:n,orderData:e})=>{var s;const c=String(n).toLocaleLowerCase(),d=l(`Order.OrderStatusContent.${h[c]}.title`),o=l(`Order.OrderStatusContent.${h[c]}.message`);return n?O(E,{className:"dropin-order-status-content",variant:"secondary",children:[t(v,{title:a??d.title}),O("div",{className:"dropin-order-status-content__wrapper",children:[t("div",{className:"dropin-order-status-content__wrapper-description",children:t("p",{children:(s=o.message)==null?void 0:s.replace("{DATE}","01.01.1900")})}),t(T,{orderData:e,slots:r})]})]}):t("div",{})};var i=(r=>(r.CANCEL="CANCEL",r.RETURN="RETURN",r.REORDER="REORDER",r))(i||{});const T=({className:r,children:a,orderData:n,slots:e,...c})=>{const d=l({cancel:"Order.OrderStatusContent.actions.cancel",return:"Order.OrderStatusContent.actions.return",reorder:"Order.OrderStatusContent.actions.reorder"}),o=N(()=>{const s=n==null?void 0:n.availableActions,R=!!(s!=null&&s.length);return t(f,{children:e!=null&&e.OrderActions?t(g,{"data-testid":"OrderActionsSlot",name:"OrderCanceledActions",slot:e==null?void 0:e.OrderActions,context:n}):t("div",{"data-testid":"availableActionsList",className:m(["dropin-order-actions__wrapper",["dropin-order-actions__wrapper--empty",!R]]),children:s==null?void 0:s.map((S,u)=>{switch(S){case i.CANCEL:return t(p,{variant:"secondary",children:d.cancel},u);case i.RETURN:return t(p,{variant:"secondary",children:d.return},u);case i.REORDER:return t(p,{variant:"secondary",children:d.reorder},u)}})})})},[n,e==null?void 0:e.OrderActions,d]);return t("div",{...c,className:m(["dropin-order-actions",r]),children:o})},L=({orderData:r})=>{const[a,n]=C(r),[e,c]=C(r==null?void 0:r.status);return w(()=>{const d=A.on("order/data",o=>{n(o),c(o.status)},{eager:!0});return()=>{d==null||d.off()}},[]),{orderStatus:e,order:a}},k=({slots:r,orderData:a,className:n,statusTitle:e,status:c})=>{const{orderStatus:d,order:o}=L({orderData:a});return t("div",{className:m(["dropin-order-status",n]),children:o?t(_,{title:e,status:c||d,slots:r,orderData:o}):t(y,{withCard:!1})})};export{k as OrderStatus,k as default}; diff --git a/scripts/__dropins__/storefront-order/containers/ShippingStatus.js b/scripts/__dropins__/storefront-order/containers/ShippingStatus.js index a6ecc7c839..e287cd98c7 100644 --- a/scripts/__dropins__/storefront-order/containers/ShippingStatus.js +++ b/scripts/__dropins__/storefront-order/containers/ShippingStatus.js @@ -1 +1 @@ -import{jsx as e,jsxs as h,Fragment as $}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as A,classes as G}from"@dropins/tools/lib.js";import{Image as E,Card as m,Header as C,Accordion as b,AccordionSection as w}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import{useCallback as H,useState as M,useEffect as R}from"@dropins/tools/preact-hooks.js";import{useText as U}from"@dropins/tools/i18n.js";import{C as Y}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{events as j}from"@dropins/tools/event-bus.js";var f=(i=>(i.PENDING="pending",i.SHIPPING="shipping",i.COMPLETE="complete",i.PROCESSING="processing",i.HOLD="on hold",i.CANCELED="Canceled",i.SUSPECTED_FRAUD="suspected fraud",i.PAYMENT_REVIEW="payment review",i))(f||{});const F=({slots:i,orderData:n,collapseThreshold:o=0})=>{var T,S,I,v,O;const s=U({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),r=H(t=>t==null?void 0:t.map(p=>{var l,g,_,y,L,N;const a=(_=(g=(l=p==null?void 0:p.orderItem)==null?void 0:l.product)==null?void 0:g.thumbnail)==null?void 0:_.label,u=(N=(L=(y=p==null?void 0:p.orderItem)==null?void 0:y.product)==null?void 0:L.thumbnail)==null?void 0:N.url;return e(E,{alt:a,src:u,width:85,height:114},p.id)}),[]),d=(T=n==null?void 0:n.status)==null?void 0:T.toLocaleLowerCase(),x=((S=n==null?void 0:n.shipments)==null?void 0:S.length)===1&&(d==null?void 0:d.includes(f.COMPLETE)),c=(I=n==null?void 0:n.items)==null?void 0:I.filter(t=>(t==null?void 0:t.quantityShipped)===0);return!n||d!=null&&d.includes(f.CANCELED)?null:(v=n==null?void 0:n.shipments)!=null&&v.length?h($,{children:[(O=n==null?void 0:n.shipments)==null?void 0:O.map(({tracking:t,items:p,id:a},u)=>h(m,{variant:"secondary",className:"dropin-shipping-status-card",children:[e(C,{title:`${s.shippingCardTitle} ${u+1}`}),t==null?void 0:t.map(l=>{var g;return h("div",{className:"dropin-shipping-status-card__header",role:"status",children:[h("div",{className:"dropin-shipping-status-card__header--content",children:[h("p",{children:[s.carrier," ",(g=l==null?void 0:l.carrier)==null?void 0:g.toLocaleUpperCase()," | ",l==null?void 0:l.number]}),e("p",{children:l==null?void 0:l.title})]}),i!=null&&i.DeliveryTrackActions?e(A,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:l}}):null]},l.number)}),x?null:e(b,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(w,{"data-position":u+1,defaultOpen:o>=(p==null?void 0:p.length),title:`Package contents (${p==null?void 0:p.length} items)`,children:e("div",{className:"dropin-shipping-status-card__images",children:r(p)})})}),i!=null&&i.DeliveryTimeLine?e(A,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},a)),c!=null&&c.length?h(m,{variant:"secondary",className:"dropin-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(C,{title:s.notYetShippedTitle}),e(b,{actionIconPosition:"right",children:e(w,{title:`${s.notYetShippedImagesTitle} ${c==null?void 0:c.length}`,children:e("div",{className:"dropin-shipping-status-card__images",children:c==null?void 0:c.map(({id:t,thumbnail:{url:p,label:a}})=>e(E,{alt:a,src:p,width:85,height:114},t))})})})]}):null]}):h(m,{variant:"secondary",className:"dropin-shipping-status-card",children:[e(C,{title:s.shippingInfoTitle}),e("div",{className:"dropin-shipping-status-card__header",children:h("div",{className:"dropin-shipping-status-card__header--content",children:[n!=null&&n.carrier?e("p",{children:n==null?void 0:n.carrier}):null,e("p",{children:s.noInfoTitle})]})})]})},q=({orderData:i})=>{const[n,o]=M(i);return R(()=>{const s=j.on("order/data",r=>{o(r)},{eager:!0});return()=>{s==null||s.off()}},[]),{order:n}},k=({slots:i,className:n,collapseThreshold:o,orderData:s})=>{const{order:r}=q({orderData:s});return e("div",{className:G(["dropin-shipping-status",n]),children:r?e(F,{slots:i,orderData:r,collapseThreshold:o}):e(Y,{withCard:!1})})};export{k as ShippingStatus,k as default}; +import{jsxs as r,jsx as e,Fragment as A}from"@dropins/tools/preact-jsx-runtime.js";import{Slot as E,classes as R}from"@dropins/tools/lib.js";import{Card as g,Header as u,Accordion as b,AccordionSection as x,ContentGrid as U,Image as w}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import{useText as Y}from"@dropins/tools/i18n.js";import{C as $}from"../chunks/OrderLoaders.js";import"@dropins/tools/preact-compat.js";import{useState as j,useEffect as F}from"@dropins/tools/preact-hooks.js";import{events as q}from"@dropins/tools/event-bus.js";var m=(i=>(i.PENDING="pending",i.SHIPPING="shipping",i.COMPLETE="complete",i.PROCESSING="processing",i.HOLD="on hold",i.CANCELED="Canceled",i.SUSPECTED_FRAUD="suspected fraud",i.PAYMENT_REVIEW="payment review",i))(m||{});const V=({slots:i,orderData:n,collapseThreshold:d=0})=>{var C,f,T,S,I;const t=Y({carrier:"Order.ShippingStatusCard.carrier",prepositionOf:"Order.ShippingStatusCard.prepositionOf",shippingCardTitle:"Order.ShippingStatusCard.shippingCardTitle",shippingInfoTitle:"Order.ShippingStatusCard.shippingInfoTitle",notYetShippedTitle:"Order.ShippingStatusCard.notYetShippedTitle",notYetShippedImagesTitle:"Order.ShippingStatusCard.notYetShippedImagesTitle",noInfoTitle:"Order.OrderStatusContent.noInfoTitle"}),l=(C=n==null?void 0:n.status)==null?void 0:C.toLocaleLowerCase(),G=((f=n==null?void 0:n.shipments)==null?void 0:f.length)===1&&(l==null?void 0:l.includes(m.COMPLETE)),c=(T=n==null?void 0:n.items)==null?void 0:T.filter(h=>(h==null?void 0:h.quantityShipped)===0);return!n||l!=null&&l.includes(m.CANCELED)?null:(S=n==null?void 0:n.shipments)!=null&&S.length?r(A,{children:[(I=n==null?void 0:n.shipments)==null?void 0:I.map(({tracking:h,items:s,id:a},H)=>r(g,{variant:"secondary",className:"dropin-shipping-status-card",children:[e(u,{title:t.shippingCardTitle}),h==null?void 0:h.map(p=>{var o;return r("div",{className:"dropin-shipping-status-card__header",role:"status",children:[r("div",{className:"dropin-shipping-status-card__header--content",children:[r("p",{children:[t.carrier," ",(o=p==null?void 0:p.carrier)==null?void 0:o.toLocaleUpperCase()," | ",p==null?void 0:p.number]}),e("p",{children:p==null?void 0:p.title})]}),i!=null&&i.DeliveryTrackActions?e(E,{"data-testid":"deliverySlotActions",name:"DeliveryTrackActions",slot:i==null?void 0:i.DeliveryTrackActions,context:{trackInformation:p}}):null]},p.number)}),G?null:e(b,{actionIconPosition:"right","data-testid":"dropinAccordion",children:e(x,{"data-position":H+1,defaultOpen:d>=(s==null?void 0:s.length),title:`Package contents (${s==null?void 0:s.length} items)`,children:e(U,{maxColumns:6,emptyGridContent:e(A,{}),className:"dropin-shipping-status-card__images",children:s==null?void 0:s.map(p=>{var v,O,y,_,L,N;const o=(y=(O=(v=p==null?void 0:p.orderItem)==null?void 0:v.product)==null?void 0:O.thumbnail)==null?void 0:y.label,M=(N=(L=(_=p==null?void 0:p.orderItem)==null?void 0:_.product)==null?void 0:L.thumbnail)==null?void 0:N.url;return e(w,{alt:o,src:M,width:85,height:114},p.id)})})})}),i!=null&&i.DeliveryTimeLine?e(E,{"data-testid":"deliverySlotTimeLine",name:"DeliveryTimeLine",slot:i==null?void 0:i.DeliveryTimeLine,context:{}}):null]},a)),c!=null&&c.length?r(g,{variant:"secondary",className:"dropin-shipping-status-card","data-testid":"dropinAccordionNotYetShipped2",children:[e(u,{title:t.notYetShippedTitle}),e(b,{actionIconPosition:"right",children:e(x,{title:`${t.notYetShippedImagesTitle} ${c==null?void 0:c.length}`,children:e("div",{className:"dropin-shipping-status-card__images",children:c==null?void 0:c.map(({id:h,thumbnail:{url:s,label:a}})=>e(w,{alt:a,src:s,width:85,height:114},h))})})})]}):null]}):r(g,{variant:"secondary",className:"dropin-shipping-status-card",children:[e(u,{title:t.shippingInfoTitle}),e("div",{className:"dropin-shipping-status-card__header",children:r("div",{className:"dropin-shipping-status-card__header--content",children:[n!=null&&n.carrier?e("p",{children:n==null?void 0:n.carrier}):null,e("p",{children:t.noInfoTitle})]})})]})},W=({orderData:i})=>{const[n,d]=j(i);return F(()=>{const t=q.on("order/data",l=>{d(l)},{eager:!0});return()=>{t==null||t.off()}},[]),{order:n}},ii=({slots:i,className:n,collapseThreshold:d,orderData:t})=>{const{order:l}=W({orderData:t});return e("div",{className:R(["dropin-shipping-status",n]),children:l?e(V,{slots:i,orderData:l,collapseThreshold:d}):e($,{withCard:!1})})};export{ii as ShippingStatus,ii as default}; diff --git a/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts b/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts index cacdcb36d3..9de90cf053 100644 --- a/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts +++ b/scripts/__dropins__/storefront-order/i18n/en_US.json.d.ts @@ -17,7 +17,7 @@ declare const _default: { "trackButton": "Track package", "carrier": "Carrier:", "prepositionOf": "of", - "shippingCardTitle": "Package", + "shippingCardTitle": "Package details", "shippingInfoTitle": "Shipping info", "notYetShippedTitle": "Not yet shipped", "notYetShippedImagesTitle": "Package contents" diff --git a/scripts/__dropins__/storefront-order/render.js b/scripts/__dropins__/storefront-order/render.js index 90718e8594..ab63f2783b 100644 --- a/scripts/__dropins__/storefront-order/render.js +++ b/scripts/__dropins__/storefront-order/render.js @@ -1,2 +1,2 @@ -(function(a,t){try{if(typeof document<"u"){const r=document.createElement("style"),n=t.styleId;for(const i in t.attributes)r.setAttribute(i,t.attributes[i]);r.setAttribute("data-dropin",n),r.appendChild(document.createTextNode(a));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.after(r);else{const i=document.querySelector('link[rel="stylesheet"], style');i?i.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})('.dropin-order-search-form{gap:var(--spacing-small);border-color:transparent}.dropin-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.dropin-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}.dropin-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}.dropin-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)}.dropin-order-search-form__wrapper__item--email{grid-area:email}.dropin-order-search-form__wrapper__item--postcode{grid-area:postcode}.dropin-order-search-form__wrapper__item--number{grid-area:number}.dropin-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.dropin-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.dropin-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.dropin-order-status-content{margin-bottom:var(--spacing-small)}.dropin-order-status-content.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-order-status-content .dropin-card__content{gap:0}.dropin-order-status-content__wrapper p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.dropin-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.dropin-shipping-status-card{margin-bottom:var(--spacing-small)}.dropin-shipping-status-card .dropin-card__content{gap:0}.dropin-shipping-status-card.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.dropin-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.dropin-shipping-status-card__header button{max-height:40px}.dropin-shipping-status-card__header--content p{margin:0;padding:0;margin-bottom:var(--spacing-xsmall)}.dropin-shipping-status-card .dropin-shipping-status-card__images{max-width:580px;display:grid;grid-template-columns:repeat(auto-fill,85px);grid-template-rows:114px;gap:7px;overflow:hidden}.dropin-shipping-status-card .dropin-shipping-status-card__images img{object-fit:contain}.dropin-order-loaders--card-loader{margin-bottom:var(--spacing-small);border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.dropin-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.dropin-order-actions__wrapper--empty{display:none}.dropin-details .dropin-card__content{gap:0}.dropin-details__container{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.dropin-details__container{display:grid;grid-template-columns:max-content max-content;grid-template-rows:auto auto auto;gap:var(--spacing-medium);grid-auto-flow:row}.dropin-details__container-email{grid-area:1 / 1 / 2 / 2}.dropin-details__container-shipping_address{grid-area:2 / 1 / 3 / 2}.dropin-details__container-billing_address{grid-area:2 / 2 / 3 / 3}.dropin-details__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.dropin-details__container-billing_methods{grid-area:3 / 2 / 4 / 3}}.dropin-details__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}.dropin-details__container p{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.dropin-details__container-billing_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.dropin-details__container-billing_methods p.dropin-details__container-billing_methods--icon{gap:0 var(--spacing-xsmall)}.dropin-details__container-description p{margin:0;padding:0;display:inline-flex;overflow:hidden}.dropin-details__container-description p:nth-child(1),.dropin-details__container-description p:nth-child(2){text-align:left;cursor:default;margin-bottom:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(2){position:relative}.dropin-details__container-description p:nth-child(2) span{position:absolute}.dropin-details__container-description p:nth-child(1),.dropin-details__container-description p:nth-child(7){float:left;width:auto;margin-right:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(5){position:relative;margin-right:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(5) span{position:absolute}.dropin-details__container-description p:nth-child(2),.dropin-details__container-description p:nth-child(6),.dropin-details__container-description p:nth-child(8){display:inline;width:50%}.dropin-details__container-description p:nth-child(2):after,.dropin-details__container-description p:nth-child(6):after,.dropin-details__container-description p:nth-child(8):after{content:"\\a";white-space:pre;display:block;height:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(3),.dropin-details__container-description p:nth-child(4),.dropin-details__container-description p:nth-child(n+9){display:block;width:100%;margin-bottom:var(--spacing-xsmall)}',{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 d,useEffect as a}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as l}from"@dropins/tools/event-bus.js";const p={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:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents"},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",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."},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."},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."},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."},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."},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."},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."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."}},u={Order:p},m={default:u},h=({children:o})=>{const[i,t]=d("en_US");return a(()=>{const e=l.on("locale",s=>{t(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(c,{lang:i,langDefinitions:m,children:o})},C=new n(r(h,{}));export{C as render}; +(function(a,i){try{if(typeof document<"u"){const r=document.createElement("style"),n=i.styleId;for(const t in i.attributes)r.setAttribute(t,i.attributes[t]);r.setAttribute("data-dropin",n),r.appendChild(document.createTextNode(a));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.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-order-search-form{gap:var(--spacing-small);border-color:transparent}.dropin-order-search-form .dropin-card__content{padding:var(--spacing-big) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig)}.dropin-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}.dropin-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}.dropin-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)}.dropin-order-search-form__wrapper__item--email{grid-area:email}.dropin-order-search-form__wrapper__item--postcode{grid-area:postcode}.dropin-order-search-form__wrapper__item--number{grid-area:number}.dropin-order-search-form__button-container{display:flex;justify-content:flex-end;grid-area:button}.dropin-order-search-form form button{align-self:flex-end;justify-self:flex-end;margin-top:var(--spacing-small)}@media (min-width: 768px){.dropin-order-search-form__wrapper{grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto;grid-template-areas:"email postcode" "number number" "button button"}}.dropin-order-status-content{margin-bottom:var(--spacing-small)}.dropin-order-status-content.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-order-status-content .dropin-card__content{gap:0}.dropin-order-status-content__wrapper p{padding:0;margin:0;box-sizing:border-box;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.dropin-order-status-content__wrapper-description{margin-bottom:var(--spacing-medium)}.dropin-shipping-status-card{margin-bottom:var(--spacing-small)}.dropin-shipping-status-card .dropin-card__content{gap:0}.dropin-shipping-status-card.dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-shipping-status-card--count-steper{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing)}.dropin-shipping-status-card__header{display:grid;grid-template-columns:1fr auto;justify-items:self-start;align-items:center;margin-bottom:var(--spacing-xsmall)}.dropin-shipping-status-card__header button{max-height:40px}.dropin-shipping-status-card__header--content p{margin:0;padding:0;margin-bottom:var(--spacing-xsmall)}.dropin-shipping-status-card .dropin-shipping-status-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important;overflow:auto!important}.dropin-shipping-status-card .dropin-shipping-status-card__images img{object-fit:contain}.dropin-order-loaders--card-loader{margin-bottom:var(--spacing-small);border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-order-actions__wrapper{display:flex;justify-content:space-between;gap:0 var(--spacing-small);margin-bottom:var(--spacing-small);margin-top:var(--spacing-medium)}.dropin-order-actions__wrapper button{width:100%;font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.dropin-order-actions__wrapper--empty{display:none}.dropin-details .dropin-card__content{gap:0}.dropin-customer-details .dropin-card--secondary{border:var(--shape-border-width-1) solid var(--color-neutral-400);border-radius:var(--shape-border-radius-1)}.dropin-details__container{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.dropin-details__container{display:grid;grid-template-columns:max-content max-content;grid-template-rows:auto auto auto;gap:var(--spacing-medium);grid-auto-flow:row}.dropin-details__container-email{grid-area:1 / 1 / 2 / 2}.dropin-details__container-shipping_address{grid-area:2 / 1 / 3 / 2}.dropin-details__container-billing_address{grid-area:2 / 2 / 3 / 3}.dropin-details__container-shipping_methods{grid-area:3 / 1 / 4 / 2}.dropin-details__container-billing_methods{grid-area:3 / 2 / 4 / 3}}.dropin-details__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}.dropin-details__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}.dropin-details__container-billing_methods p{display:grid;gap:0;grid-template-columns:auto 1fr}.dropin-details__container-billing_methods p.dropin-details__container-billing_methods--icon{gap:0 var(--spacing-xsmall)}.dropin-details__container-description p{margin:0;padding:0;display:inline-flex;overflow:hidden}.dropin-details__container-description p:nth-child(1),.dropin-details__container-description p:nth-child(2){text-align:left;cursor:default;margin-bottom:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(2){position:relative}.dropin-details__container-description p:nth-child(2) span{position:absolute}.dropin-details__container-description p:nth-child(1),.dropin-details__container-description p:nth-child(7){float:left;width:auto;margin-right:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(5){position:relative;margin-right:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(5) span{position:absolute}.dropin-details__container-description p:nth-child(2),.dropin-details__container-description p:nth-child(6),.dropin-details__container-description p:nth-child(8){display:inline;width:50%}.dropin-details__container-description p:nth-child(2):after,.dropin-details__container-description p:nth-child(6):after,.dropin-details__container-description p:nth-child(8):after{content:"\\a";white-space:pre;display:block;height:var(--spacing-xsmall)}.dropin-details__container-description p:nth-child(3),.dropin-details__container-description p:nth-child(4),.dropin-details__container-description p:nth-child(n+9){display:block;width:100%;margin-bottom:var(--spacing-xsmall)}',{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 d,useEffect as a}from"@dropins/tools/preact-hooks.js";import{UIProvider as c}from"@dropins/tools/components.js";import{events as l}from"@dropins/tools/event-bus.js";const p={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:{trackButton:"Track package",carrier:"Carrier:",prepositionOf:"of",shippingCardTitle:"Package details",shippingInfoTitle:"Shipping info",notYetShippedTitle:"Not yet shipped",notYetShippedImagesTitle:"Package contents"},OrderStatusContent:{noInfoTitle:"Check back later for more details.",actions:{cancel:"Cancel order",return:"Return or replace",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."},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."},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."},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."},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."},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."},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."}},CustomerDetails:{headerText:"Customer information",freeShipping:"Free shipping",email:{title:"Contact details"},shippingAddress:{title:"Shipping address"},shippingMethods:{title:"Shipping method"},billingAddress:{title:"Billing address"},billingMethods:{title:"Payment method"}},Errors:{invalidOrder:"Invalid order. Please try again.",invalidSearch:"No order found with these order details."}},u={Order:p},m={default:u},h=({children:o})=>{const[i,t]=d("en_US");return a(()=>{const e=l.on("locale",s=>{t(s)},{eager:!0});return()=>{e==null||e.off()}},[]),r(c,{lang:i,langDefinitions:m,children:o})},C=new n(r(h,{}));export{C as render};