@dropins/storefront-order 0.1.0-alpha7 → 0.1.0-alpha8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -903,32 +903,22 @@ export declare const storyBookNormalizeAddress: {
903
903
  orderNumber: number;
904
904
  value: string;
905
905
  label: null;
906
- } | {
906
+ }[] | {
907
907
  name: string;
908
908
  orderNumber: number;
909
909
  value: string[];
910
910
  label: null;
911
- } | {
912
- name: string;
913
- orderNumber: number;
914
- value: string;
915
- label: string;
916
- })[];
911
+ }[])[];
917
912
  shippingAddress: ({
918
913
  name: string;
919
914
  orderNumber: number;
920
915
  value: string;
921
916
  label: null;
922
- } | {
917
+ }[] | {
923
918
  name: string;
924
919
  orderNumber: number;
925
920
  value: string[];
926
921
  label: null;
927
- } | {
928
- name: string;
929
- orderNumber: number;
930
- value: string;
931
- label: string;
932
- })[];
922
+ }[])[];
933
923
  };
934
924
  //# sourceMappingURL=mock.config.d.ts.map
@@ -1 +1 @@
1
- import{jsx as t,jsxs as p,Fragment as L}from"@dropins/tools/preact-jsx-runtime.js";import{classes as k}from"@dropins/tools/lib.js";import{useMemo as O,useState as v,useEffect as D,useCallback as V}from"@dropins/tools/preact-hooks.js";import{events as S}from"@dropins/tools/event-bus.js";import{e as W}from"../chunks/fetch-graphql.js";import{g as j}from"../chunks/getAttributesForm.js";import{Card as P,Header as Z,Price as x,Icon as z}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import*as o from"@dropins/tools/preact-compat.js";import{D as B}from"../chunks/OrderLoaders.js";import{useText as q}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const F=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),K=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),R=({loading:d,order:i,withHeader:f=!0,title:l,paymentIconsMap:u={},normalizeAddress:h})=>{var E,N,A,T,$,y,w;const a=q({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),g=O(()=>({checkmo:F,card:K,...u}),[u]);if(!i||d)return t(B,{});const C=(i==null?void 0:i.email)??"",n=(E=i==null?void 0:i.shipping)==null?void 0:E.code,c=(N=i==null?void 0:i.shipping)==null?void 0:N.amount,s=(A=i==null?void 0:i.shipping)==null?void 0:A.currency,m=i==null?void 0:i.payments,_=m&&m.length>0,b=_?(T=m[0])==null?void 0:T.name:"",M=_?($=m[0])==null?void 0:$.code:"",H=_&&b!=="";return p(P,{"data-testid":"order-details",variant:"secondary",className:k(["dropin-details"]),children:[f?t(Z,{title:l??a.headerText}):null,p("div",{className:"dropin-details__container",children:[p("div",{className:"dropin-details__container-email",children:[t("div",{className:"dropin-details__container-title",children:a.emailTitle}),t("p",{children:C})]}),p("div",{className:"dropin-details__container-shipping_address",children:[t("div",{className:"dropin-details__container-title",children:a.shippingAddressTitle}),t("div",{className:"dropin-details__container-description",children:(y=h.shippingAddress)==null?void 0:y.filter(({value:e})=>e).map((e,r)=>r===1?t("p",{"data-testid":`${e.name}_${r}`,children:t("span",{children:e.label?`${e.label}: ${e==null?void 0:e.value}`:e==null?void 0:e.value})},r):t("p",{"data-testid":`${e.name}_${r}`,children:e.label?`${e.label}: ${e==null?void 0:e.value}`:e==null?void 0:e.value},r))})]}),p("div",{className:"dropin-details__container-billing_address",children:[t("div",{className:"dropin-details__container-title",children:a.billingAddressTitle}),t("div",{className:"dropin-details__container-description",children:(w=h.billingAddress)==null?void 0:w.filter(({value:e})=>e).map((e,r)=>r===1||r===5?t("p",{"data-testid":`${e.name}_${r}`,children:t("span",{children:e.label?`${e.label}: ${e==null?void 0:e.value}`:e==null?void 0:e.value})},r):t("p",{"data-testid":`${e.name}_${r}`,children:e.label?`${e.label}: ${e==null?void 0:e.value}`:e==null?void 0:e.value},r))})]}),p("div",{className:"dropin-details__container-shipping_methods",children:[t("div",{className:"dropin-details__container-title",children:a.shippingMethodsTitle}),n?t(L,{children:c?p("p",{"data-testid":"shipping_methods_price",children:[t(x,{amount:c,currency:s})," ",n]}):t("p",{"data-testid":"shipping_methods_placeholder",children:a.freeShipping})}):null]}),p("div",{className:"dropin-details__container-billing_methods",children:[t("div",{className:"dropin-details__container-title",children:a.billingMethodsTitle}),H&&p("p",{"data-testid":"billing_methods_description",className:k([["dropin-details__container-billing_methods--icon",!!g[M]]]),children:[t(z,{source:g[M]}),b]})]})]})]})},G=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],I=({orderData:d})=>{const[i,f]=v(!0),[l,u]=v(d),[h,a]=v([]);D(()=>{const n=S.on("order/data",c=>{u(c)},{eager:!0});return()=>{n==null||n.off()}},[]),D(()=>{j("shortRequest").then(n=>{if(n){const c=n.map(({name:s,orderNumber:m,label:_})=>({name:W(s),orderNumber:m,label:G.includes(s)?null:_}));a(c)}}).finally(()=>{f(!1)})},[]);const g=V(n=>{if(!h.length||!l||!l[n])return[];const c=Object.fromEntries(Object.entries(l[n]).map(([s,m])=>[s.toLowerCase(),m]));return h.filter(({name:s})=>c[s.toLowerCase()]).map(s=>({name:s.name,orderNumber:s.orderNumber,value:c[s.name],label:s.label}))},[h,l]),C=O(()=>({billingAddress:g("billingAddress"),shippingAddress:g("shippingAddress")}),[g]);return{order:l,normalizeAddress:C,loading:i}},ae=({paymentIconsMap:d,orderData:i,title:f,className:l})=>{const{order:u,normalizeAddress:h,loading:a}=I({orderData:i});return t("div",{className:k(["dropin-customer-details",l]),children:t(R,{loading:a,order:u,title:f,paymentIconsMap:d,normalizeAddress:h})})};export{ae as CustomerDetails,ae as default};
1
+ import{jsx as t,jsxs as m,Fragment as P}from"@dropins/tools/preact-jsx-runtime.js";import{classes as b}from"@dropins/tools/lib.js";import{useMemo as V,useCallback as x,useState as k,useEffect as L}from"@dropins/tools/preact-hooks.js";import{events as Z}from"@dropins/tools/event-bus.js";import{e as R}from"../chunks/fetch-graphql.js";import{g as z}from"../chunks/getAttributesForm.js";import{Card as B,Header as F,Price as $,Icon as q}from"@dropins/tools/components.js";import"../chunks/CustomerDetailsContent.js";import*as p from"@dropins/tools/preact-compat.js";import{D as K}from"../chunks/OrderLoaders.js";import{useText as G}from"@dropins/tools/i18n.js";import"@dropins/tools/fetch-graphql.js";const I=r=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.93 14.8V18.75H5.97C4.75 18.75 3.75 17.97 3.75 17V6.5M3.75 6.5C3.75 5.53 4.74 4.75 5.97 4.75H15.94V8.25H5.97C4.75 8.25 3.75 7.47 3.75 6.5Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.35 11.64H14.04V14.81H19.35V11.64Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.9304 11.64V8.25H15.1504",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),J=r=>p.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M2.00718 5H22.1507C22.7047 5 23.1579 5.45323 23.1579 6.00718V7.51794C23.1579 7.51794 1.01007 7.58844 1 7.55823V6.00718C1 5.45323 1.45323 5 2.00718 5Z",stroke:"currentColor",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M23.1579 9.78409V18.3451C23.1579 18.899 22.7047 19.3523 22.1507 19.3523H2.00718C1.45323 19.3523 1 18.899 1 18.3451V9.78409H23.1579Z",stroke:"currentColor",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M3.01465 15.9682H8.40305",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round"}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M17.6192 17.5897C18.4535 17.5897 19.1299 16.9133 19.1299 16.0789C19.1299 15.2446 18.4535 14.5682 17.6192 14.5682C16.7848 14.5682 16.1084 15.2446 16.1084 16.0789C16.1084 16.9133 16.7848 17.5897 17.6192 17.5897Z",stroke:"currentColor",strokeWidth:1}),p.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19.8848 17.5897C20.7192 17.5897 21.3956 16.9133 21.3956 16.0789C21.3956 15.2446 20.7192 14.5682 19.8848 14.5682C19.0504 14.5682 18.374 15.2446 18.374 16.0789C18.374 16.9133 19.0504 17.5897 19.8848 17.5897Z",stroke:"currentColor",strokeWidth:1})),Q=({loading:r,order:e,withHeader:a=!0,title:c,paymentIconsMap:i={},normalizeAddress:s})=>{var N,M,E,T,D;const o=G({emailTitle:"Order.CustomerDetails.email.title",shippingAddressTitle:"Order.CustomerDetails.shippingAddress.title",shippingMethodsTitle:"Order.CustomerDetails.shippingMethods.title",billingAddressTitle:"Order.CustomerDetails.billingAddress.title",billingMethodsTitle:"Order.CustomerDetails.billingMethods.title",headerText:"Order.CustomerDetails.headerText",freeShipping:"Order.CustomerDetails.freeShipping"}),u=V(()=>({checkmo:I,card:J,...i}),[i]),_=x(j=>{var w;return(w=s[j])==null?void 0:w.map((f,S)=>t("div",{className:"dropin-details__container-description--row",children:f==null?void 0:f.map((l,W)=>t("p",{children:l.label?`${l.label}: ${Array.isArray(l.value)?l.value.join(" "):l==null?void 0:l.value}`:Array.isArray(l.value)?l.value.join(" "):l==null?void 0:l.value},W))},S))},[s]);if(!e||r)return t(K,{});const d=(e==null?void 0:e.email)??"",h=(N=e==null?void 0:e.shipping)==null?void 0:N.code,n=(M=e==null?void 0:e.shipping)==null?void 0:M.amount,v=(E=e==null?void 0:e.shipping)==null?void 0:E.currency,g=e==null?void 0:e.payments,C=g&&g.length>0,A=C?(T=g[0])==null?void 0:T.name:"",y=C?(D=g[0])==null?void 0:D.code:"",H=C&&A!=="";return m(B,{"data-testid":"order-details",variant:"secondary",className:b(["dropin-details"]),children:[a?t(F,{title:c??o.headerText}):null,m("div",{className:"dropin-details__container",children:[m("div",{className:"dropin-details__container-email",children:[t("div",{className:"dropin-details__container-title",children:o.emailTitle}),t("p",{children:d})]}),m("div",{className:"dropin-details__container-shipping_address",children:[t("div",{className:"dropin-details__container-title",children:o.shippingAddressTitle}),t("div",{className:"dropin-details__container-description",children:_("shippingAddress")})]}),m("div",{className:"dropin-details__container-billing_address",children:[t("div",{className:"dropin-details__container-title",children:o.billingAddressTitle}),t("div",{className:"dropin-details__container-description",children:_("billingAddress")})]}),m("div",{className:"dropin-details__container-shipping_methods",children:[t("div",{className:"dropin-details__container-title",children:o.shippingMethodsTitle}),h?t(P,{children:n?m("p",{"data-testid":"shipping_methods_price",children:[t($,{amount:n,currency:v})," ",h]}):t("p",{"data-testid":"shipping_methods_placeholder",children:o.freeShipping})}):null]}),m("div",{className:"dropin-details__container-billing_methods",children:[t("div",{className:"dropin-details__container-title",children:o.billingMethodsTitle}),H&&m("p",{"data-testid":"billing_methods_description",className:b([["dropin-details__container-billing_methods--icon",!!u[y]]]),children:[t(q,{source:u[y]}),A]})]})]})]})},U=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_2","default_shipping","default_billing"],O=r=>{r.sort((i,s)=>i.orderNumber-s.orderNumber);const e=[];let a=[];const c=i=>i.value!==void 0&&i.value!==null&&i.value!=="";for(let i=0;i<r.length;i++){const s=r[i];if(c(s))if(Array.isArray(s.value)){const o=s.value.map(u=>({...s,value:u}));e.push(o)}else e.length<4?(a.push(s),a.length===2&&(e.push(a),a=[])):e.push([s])}return a.length>0&&e.length<4&&e.push(a),e},X=({orderData:r})=>{const[e,a]=k(!0),[c,i]=k(r),[s,o]=k([]);L(()=>{const d=Z.on("order/data",h=>{i(h)},{eager:!0});return()=>{d==null||d.off()}},[]),L(()=>{z("shortRequest").then(d=>{if(d){const h=d.map(({name:n,orderNumber:v,label:g})=>({name:R(n),orderNumber:v,label:U.includes(n)?null:g}));o(h)}}).finally(()=>{a(!1)})},[]);const u=x(d=>{if(!s.length||!c||!c[d])return[];const h=Object.fromEntries(Object.entries(c[d]).map(([n,v])=>[n.toLowerCase(),v]));return s.filter(({name:n})=>h[n.toLowerCase()]).map(n=>({name:n.name,orderNumber:n.orderNumber,value:h[n.name.toLowerCase()],label:n.label}))},[s,c]),_=V(()=>({billingAddress:O(u("billingAddress")),shippingAddress:O(u("shippingAddress"))}),[u]);return{order:c,normalizeAddress:_,loading:e}},de=({paymentIconsMap:r,orderData:e,title:a,className:c})=>{const{order:i,normalizeAddress:s,loading:o}=X({orderData:e});return t("div",{className:b(["dropin-customer-details",c]),children:t(Q,{loading:o,order:i,title:a,paymentIconsMap:r,normalizeAddress:s})})};export{de as CustomerDetails,de as default};
@@ -4,8 +4,8 @@ import { NormalizeAddressProps, UseCustomerDetails } from '../../types';
4
4
  export declare const useCustomerDetails: ({ orderData }: UseCustomerDetails) => {
5
5
  order: OrderDataModel | undefined;
6
6
  normalizeAddress: {
7
- billingAddress: [] | NormalizeAddressProps[];
8
- shippingAddress: [] | NormalizeAddressProps[];
7
+ billingAddress: NormalizeAddressProps[][];
8
+ shippingAddress: NormalizeAddressProps[][];
9
9
  };
10
10
  loading: boolean;
11
11
  };
@@ -0,0 +1,6 @@
1
+ import { NormalizeAddressProps } from '../types';
2
+
3
+ type FormattedFields = NormalizeAddressProps[][];
4
+ export declare const formatAddressFields: (fields: NormalizeAddressProps[]) => FormattedFields;
5
+ export {};
6
+ //# sourceMappingURL=formatAddressFields.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-order", "version": "0.1.0-alpha7", "@dropins/elsie": "0.30.1-alpha917833"}
1
+ {"name": "@dropins/storefront-order", "version": "0.1.0-alpha8", "@dropins/elsie": "0.30.1-alpha917833"}
package/render.js CHANGED
@@ -1,2 +1,2 @@
1
- (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"});
1
+ (function(i,e){try{if(typeof document<"u"){const r=document.createElement("style"),o=e.styleId;for(const a in e.attributes)r.setAttribute(a,e.attributes[a]);r.setAttribute("data-dropin",o),r.appendChild(document.createTextNode(i));const t=document.querySelector('style[data-dropin="sdk"]');if(t)t.after(r);else{const a=document.querySelector('link[rel="stylesheet"], style');a?a.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--row{display:flex;justify-content:start;gap:0 var(--spacing-xsmall);margin-bottom:var(--spacing-xsmall)}.dropin-details__container-description .dropin-details__container-description--row p{margin:0;padding:0;word-wrap:break-word;max-width:200px}',{styleId:"order"});
2
2
  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};
@@ -6,7 +6,10 @@ export interface KeysSortOrderProps {
6
6
  label?: string | null;
7
7
  }
8
8
  export interface NormalizeAddressProps extends KeysSortOrderProps {
9
- value: any;
9
+ name: string;
10
+ orderNumber: number;
11
+ value?: string | string[];
12
+ label?: string | null;
10
13
  }
11
14
  export interface CustomerDetailsProps {
12
15
  className?: string;
@@ -22,8 +25,8 @@ export interface CustomerDetailsContentProps extends Omit<CustomerDetailsProps,
22
25
  loading: boolean;
23
26
  order?: OrderDataModel;
24
27
  normalizeAddress?: {
25
- billingAddress: NormalizeAddressProps[];
26
- shippingAddress: NormalizeAddressProps[];
28
+ billingAddress: NormalizeAddressProps[][];
29
+ shippingAddress: NormalizeAddressProps[][];
27
30
  };
28
31
  }
29
32
  export interface CustomerAddressesModel {