@dropins/storefront-account 3.0.0-beta4 → 3.0.0-beta6
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.
- package/LICENSE.md +25 -25
- package/api.js +1 -1
- package/chunks/AddressValidation.js +1 -1
- package/chunks/getOrderHistoryList.js +5 -4
- package/chunks/getOrderHistoryList.js.map +1 -1
- package/chunks/getStoreConfig.js +1 -1
- package/chunks/initialize.js +1 -1
- package/chunks/removeCustomerAddress.js +1 -1
- package/chunks/updateCustomer.js +1 -1
- package/containers/AddressForm.js +1 -1
- package/containers/AddressValidation.js +1 -1
- package/containers/Addresses.js +1 -1
- package/containers/CustomerInformation.js +1 -1
- package/containers/OrdersList.js +1 -1
- package/fragments.js +1 -1
- package/package.json +1 -1
- package/render.js +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
Last Updated:
|
|
1
|
+
Last Updated: 8 December 2025
|
|
2
2
|
|
|
3
|
-
ADOBE COMMERCE DROP-IN LICENSE AGREEMENT
|
|
3
|
+
**ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
|
|
4
4
|
|
|
5
|
-
applicable to Adobe Commerce Customers
|
|
5
|
+
applicable to Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer Customers
|
|
6
6
|
|
|
7
7
|
**Effective Date:** first date you download or use the Drop-in
|
|
8
8
|
|
|
9
|
-
NOTICE TO USER: The Adobe Commerce Drop-in (
|
|
9
|
+
NOTICE TO USER: The Adobe Commerce Drop-ins are licensed only for use with Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer. The Adobe Commerce Drop-in ("Drop-in") is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
|
|
10
10
|
|
|
11
11
|
Your access to and use of the Drop-in is governed by the Adobe Enterprise Licensing Terms previously agreed to by you and Adobe or an authorized Adobe Reseller in a separate agreement. If you have not previously agreed to licensing terms then your installation and use of the Drop-in is subject to the current applicable Adobe Enterprise Licensing Terms available at <http://www.adobe.com/legal/terms/enterprise-licensing.html>. You agree that this agreement will have the same effect as any written negotiated agreement signed by you.
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ By downloading, installing or making use of any portion of the Drop-in, you acce
|
|
|
14
14
|
|
|
15
15
|
This agreement is enforceable against any person or entity that installs and uses the Drop-in and any person or entity (e.g., system integrator, consultant or contractor) that installs or uses the drop-in on another person's or entity's behalf (e.g., Adobe Customer).
|
|
16
16
|
|
|
17
|
-
Notice to U.S. Government End Users: Products and services are
|
|
17
|
+
Notice to U.S. Government End Users: Products and services are "Commercial Product(s)," and "Commercial Service(s)" as those terms are defined at 48 C.F.R. section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
|
|
18
18
|
|
|
19
19
|
**ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
|
|
20
20
|
|
|
@@ -22,21 +22,21 @@ applicable to Developers
|
|
|
22
22
|
|
|
23
23
|
**Effective Date:** first date you download or use the Drop-in
|
|
24
24
|
|
|
25
|
-
The Adobe Commerce Drop-in (
|
|
25
|
+
The Adobe Commerce Drop-ins are licensed only for use with Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer. The Adobe Commerce Drop-in ("Drop-in") is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
|
|
26
26
|
|
|
27
27
|
**AGREED TERMS AND CONDITIONS**
|
|
28
28
|
|
|
29
29
|
1. **DEFINITIONS**.
|
|
30
30
|
|
|
31
|
-
1.1
|
|
31
|
+
1.1 "**Adobe**" means collectively, Adobe Inc., a company incorporated in Delaware, U.S.A., having a place of business at 345 Park Avenue, San Jose, California USA 95110-2704, U.S.A. ("**Adobe US**") and Adobe Systems Software Ireland, company incorporated in Ireland, having a place of business 4-6 Riverwalk, City West Business Campus, Saggart, Dublin 24, Ireland ("**Adobe Ireland**").
|
|
32
32
|
|
|
33
|
-
1.2
|
|
33
|
+
1.2 "**Adobe Product(s)**" means software applications, programs and other technologies not included in or with the Drop-in which are or may be made available by Adobe for licensing to the general public. This agreement does not govern use of Adobe Products. See the end user license agreement accompanying an Adobe Product for terms governing its use.
|
|
34
34
|
|
|
35
|
-
1.3
|
|
35
|
+
1.3 "**Developer Product(s)**" means any software application(s), program(s) and other technolog(y/ies) you develop with use of the Drop-in to function or interoperate with Adobe Products.
|
|
36
36
|
|
|
37
|
-
1.4
|
|
37
|
+
1.4 "**Intellectual Property Rights**" means copyright, moral rights, trademark, trade dress, patent, trade secret, unfair competition, and any other intellectual and proprietary rights.
|
|
38
38
|
|
|
39
|
-
1.5
|
|
39
|
+
1.5 "**Adobe Commerce Drop-in**" or "Drop-in" means all items comprising the application and all associated materials licensed to you by Adobe as part of the Drop-in, including all Drop-in system files, tools, programs and utilities, as well as any plug-ins or other application programming interfaces, header or JAR files ("**API**"), sample images, sounds, or similar assets ("**Content** **Files**"), software code samples, runtimes and libraries, including any portion(s) that is modified by you, or merged or incorporated with your Developer Products ("**Sample Code**"), and any related documentation, technical specifications, notes and explanatory materials, as well any modifications, updates, upgrades, or copies of, any of the foregoing items, that may be made available by Adobe, whether online or recorded on media, or manually downloaded by you.
|
|
40
40
|
|
|
41
41
|
2. **LICENSES GRANTED TO YOU**.
|
|
42
42
|
|
|
@@ -50,23 +50,23 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
50
50
|
|
|
51
51
|
3. **SCOPE OF LICENSE; LIMITATIONS AND RESTRICTIONS**
|
|
52
52
|
|
|
53
|
-
3.1 You may not distribute the Drop-ins or any of its component parts to interoperate with or to run on a platform other than
|
|
53
|
+
3.1 You may not distribute the Drop-ins or any of its component parts to interoperate with or to run on a platform other than Adobe Commerce as a Cloud Service and Adobe Commerce Optimizer.
|
|
54
54
|
|
|
55
55
|
3.2 Third-Party Software. The Drop-ins may contain third-party software, subject to additional terms and conditions, available at <http://www.adobe.com/go/thirdparty>; and
|
|
56
56
|
|
|
57
|
-
3.3 You may not modify, port, adapt,
|
|
57
|
+
3.3 You may not modify, port, adapt, create derivate works, redistribute, or translate any portion of this Drop-in; or add or delete any Drop-in program files that would in any way result in modifying the functionality or appearance of any element of the Adobe Products.
|
|
58
58
|
|
|
59
|
-
3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in, except and only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile the Drop-in in order to obtain information necessary to render the Drop-in interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in to ensure that Adobe
|
|
59
|
+
3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in, except and only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile the Drop-in in order to obtain information necessary to render the Drop-in interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in to ensure that Adobe's and its licensors' Intellectual Proprietary Rights in the Drop-in are protected.
|
|
60
60
|
|
|
61
|
-
3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the Drop-in, or any of your rights in the Drop-in, nor authorize any portion of the Drop-in to be copied onto another
|
|
61
|
+
3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the Drop-in, or any of your rights in the Drop-in, nor authorize any portion of the Drop-in to be copied onto another's device, computer or platform, including on a service bureau basis to other providers (i.e., volume printing, banking, payroll service providers, etc) who provide you free or fee-based business services.
|
|
62
62
|
|
|
63
63
|
4. **VIRAL OPEN SOURCE SOFTWARE AND SERVICES**
|
|
64
64
|
|
|
65
|
-
You are not
|
|
65
|
+
You are not licensed to (and you agree that you will not) merge, integrate or use the Drop-in with any Viral Open Source Software or Viral Service, or otherwise take any action that could require disclosure, distribution, or licensing of all or any part of the Drop-in in source code form for any purpose whatsoever. For purposes of this Section, "**Viral Open Source Software**" means software licensed under the GNU General Public License, the GNU Affero General Public License (AGPL), the GNU Lesser General Public License (LGPL), or any other license terms that would require, or condition your use, modification, or distribution of such licensed software on the disclosure, distribution, or licensing of any other software in source code form, for the purpose of making derivative works, or at no charge, and "**Viral Service**" means any service that contains any viruses, Trojan horses, worms, time bombs, cancelbots or other computer programming routines that are intended to damage, detrimentally interfere with, surreptitiously intercept, expropriate or deprive owners' possession of any system, data or personal information, or that in any way violates any law, statute, ordinance, regulation or rights (including any law, regulations or rights respecting intellectual property, computer spyware, privacy, export control, unfair competition, antidiscrimination or false advertising), or otherwise interferes with the operability of Adobe Products or third-party programs or software.
|
|
66
66
|
|
|
67
67
|
5. **NON-BLOCKING OF ADOBE DEVELOPMENT**
|
|
68
68
|
|
|
69
|
-
You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement will impair, limit or curtail Adobe
|
|
69
|
+
You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement will impair, limit or curtail Adobe's right to continue with its development, maintenance or distribution of Adobe Products. You agree that you will not assert in any way any patent owned by you arising out of or in connection with your use of the Drop-in, or any Drop-in modifications made by you, against Adobe, its customers, subsidiaries or affiliates, or any of their customers, direct or indirect, agents and contractors for the manufacture, use, import, license, offer for sale, or sale of any Adobe Products.
|
|
70
70
|
|
|
71
71
|
6. **OWNERSHIP; INTELLECTUAL PROPERTY RIGHTS**
|
|
72
72
|
|
|
@@ -74,13 +74,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
74
74
|
|
|
75
75
|
6.2 The Drop-in, or any of its component parts, may be supplied to you with certain accompanying proprietary notices, including patent, copyright and trademark notices. You agree to protect all copyright and other ownership interests of Adobe and its licensors in the Drop-in supplied to you under this agreement; to preserve exactly (and not remove or alter) all proprietary notices displayed in or on the Drop-in; to reproduce the same proprietary notices in all copies you make of any portion of the Drop-in.
|
|
76
76
|
|
|
77
|
-
6.3 You agree to include in your Developer Products Adobe
|
|
77
|
+
6.3 You agree to include in your Developer Products Adobe's copyright notices, wherever such notices are customarily posted, in substantially the following form: _Portions of software used to develop this product copyrighted by Adobe and its licensors. All Rights Reserved_.
|
|
78
78
|
|
|
79
79
|
6.4 Nothing in this agreement gives you a right to use the name, logo or trademarks of Adobe or its licensors to market your Developer Products.
|
|
80
80
|
|
|
81
81
|
7. **CONFIDENTIAL INFORMATION**
|
|
82
82
|
|
|
83
|
-
With respect to the API, and any portion, included in the Drop-in (for purposes of this Section,
|
|
83
|
+
With respect to the API, and any portion, included in the Drop-in (for purposes of this Section, "**Adobe Confidential Information**"), you will treat the Adobe Confidential Information, and exercise the same degree of care to protect it, as you afford to your own confidential information. Your obligations under this Section will terminate when you can document that (a) the Adobe Confidential Information was in the public domain at or subsequent to the time Adobe communicated or provided it to you with no fault of your own; (b) your employees or agents developed independently without reference to any Adobe Confidential Information Adobe communicated or provided to you; or (c) your communication of Adobe Confidential Information was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of a party under this agreement.
|
|
84
84
|
|
|
85
85
|
8. **TERM; TERMINATION**
|
|
86
86
|
|
|
@@ -90,13 +90,13 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
90
90
|
|
|
91
91
|
You expressly understand and agree that, to the maximum extent permitted by applicable law:
|
|
92
92
|
|
|
93
|
-
9.1 **Use
|
|
93
|
+
9.1 **Use of the DROP-IN is entirely at your own risk. The Drop-in is provided by Adobe "AS-IS" and with all faults. Adobe and its licensors are not liable to you or anyone else for any special, incidental, indirect, consequential, or punitive damages whatsoever (even if Adobe has been advised of the possibility of such damages), including (a) damages resulting from loss of use, data, or profits, whether or not foreseeable, (b) damages based on any theory of liability, including breach of contract or warranty, negligence or other tortious action, or (c) damages arising from any other claim arising out of or in connection with your use of the Drop-in.**
|
|
94
94
|
|
|
95
|
-
9.2 **Adobe
|
|
95
|
+
9.2 **Adobe's total liability in any matter arising out of or related to these terms is limited to US $100. This limitation will apply even if Adobe has been advised of the possibility of such damages and regardless of any failure of the essential purpose of any limited remedy.**
|
|
96
96
|
|
|
97
97
|
10. **INDEMNIFICATION**
|
|
98
98
|
|
|
99
|
-
To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors, or suppliers from any claim or demand, including reasonable attorneys
|
|
99
|
+
To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors, or suppliers from any claim or demand, including reasonable attorneys' fees, that arise from the use and distribution of your Developer Products that contain or are based upon any portion of the Drop-in, or from your violation of the terms of this agreement.
|
|
100
100
|
|
|
101
101
|
11. **DISPUTE RESOLUTION**
|
|
102
102
|
|
|
@@ -104,7 +104,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
104
104
|
|
|
105
105
|
11.2 **Venue.** You agree that any claim or dispute you may have against Adobe must be resolved by a court located in Santa Clara County, California, United States of America. You agree to submit to the personal jurisdiction of the courts located in Santa Clara County, California, United States of America when the laws of California apply, and the courts of Dublin, Ireland, when the laws of Ireland applies, for the purpose of litigating such claims or disputes. The parties specifically disclaim the U.N. Convention on Contracts for the International Sale of Goods.
|
|
106
106
|
|
|
107
|
-
11.3 **Injunctive Relief.** Notwithstanding the foregoing, in the event of your or others
|
|
107
|
+
11.3 **Injunctive Relief.** Notwithstanding the foregoing, in the event of your or others' unauthorized access to or use of the Drop-in in violation of this Agreement, you agree that Adobe is entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
|
108
108
|
|
|
109
109
|
12. **EXPORT RULES**
|
|
110
110
|
|
|
@@ -112,7 +112,7 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
112
112
|
|
|
113
113
|
13. **NOTICE TO U.S. GOVERNMENT END USERS**
|
|
114
114
|
|
|
115
|
-
Products and services are
|
|
115
|
+
Products and services are "Commercial Product(s)," and "Commercial Service(s)" as those terms are defined at 48 C.F.R. section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
|
|
116
116
|
|
|
117
117
|
14. **GENERAL PROVISIONS**
|
|
118
118
|
|
|
@@ -124,4 +124,4 @@ The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the ter
|
|
|
124
124
|
|
|
125
125
|
14.4 **Entire Agreement.** This Agreement is the entire agreement, superseding any prior written or oral agreements, between you and Adobe relating to the Drop-in.
|
|
126
126
|
|
|
127
|
-
Adobe Commerce Drop-in License Agreement_en_US-
|
|
127
|
+
Adobe Commerce Drop-in License Agreement_en_US-20251208_v1
|
package/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{c as b,i as v}from"./chunks/initialize.js";import{f as d,h as m,a as u}from"./chunks/removeCustomerAddress.js";import{e as _,d as A,g as F,j as N,i as O,k as R,r as $,s as H,b as I,c as Q,u as w}from"./chunks/removeCustomerAddress.js";import{g as k,b as J,a as j,u as q}from"./chunks/updateCustomer.js";import{g as B}from"./chunks/getOrderHistoryList.js";import{g as K}from"./chunks/getStoreConfig.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"./fragments.js";const g=t=>{var r,s;const a=(s=(r=t==null?void 0:t.data)==null?void 0:r.country)==null?void 0:s.available_regions;return a?a.filter(e=>{if(!e)return!1;const{id:i,code:n,name:c}=e;return!!(i&&n&&c)}).map(e=>{const{id:i}=e;return{id:i,text:e.name,value:`${e.code},${e.id}`}}):[]},f=`
|
|
4
4
|
query GET_REGIONS($countryCode: String!) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as a,Fragment as D,jsxs as j}from"@dropins/tools/preact-jsx-runtime.js";import{useRef as Qe,useState as B,useEffect as ee,useCallback as U,useMemo as oe}from"@dropins/tools/preact-hooks.js";import{classes as K,Slot as he}from"@dropins/tools/lib.js";import{Field as le,TextArea as De,Checkbox as Ve,InputDate as et,Picker as tt,Input as rt,Skeleton as ze,SkeletonRow as P,Card as me,Button as de,Tag as pe,Icon as ke,Modal as st,ProgressSpinner as nt,IllustratedMessage as at,Header as dt,InLineAlert as ot}from"@dropins/tools/components.js";import{m as Ue,n as qe,u as Ce,d as je,i as lt,l as it,k as ct,j as ut,e as pt}from"./removeCustomerAddress.js";import{useText as re}from"@dropins/tools/i18n.js";import*as G from"@dropins/tools/preact-compat.js";import{memo as $e,forwardRef as ft,useImperativeHandle as At,useId as mt,useMemo as ye,useCallback as Oe}from"@dropins/tools/preact-compat.js";import{Fragment as Se}from"@dropins/tools/preact.js";import"@dropins/tools/event-bus.js";const fe=({hideActionFormButtons:e,formName:n,showFormLoader:s,showSaveCheckBox:r,saveCheckBoxValue:d,forwardFormRef:o,slots:i,addressesFormTitle:l,className:f,addressFormId:c,inputsDefaultValueSet:p,billingCheckBoxValue:b,shippingCheckBoxValue:S,showBillingCheckBox:v,showShippingCheckBox:y,isOpen:T,fieldIdPrefix:Z,onSubmit:t,onCloseBtnClick:h,onSuccess:A,onError:N,onChange:C})=>a("div",{className:K(["account-address-form"]),children:a(Dt,{hideActionFormButtons:e,formName:n,showFormLoader:s,slots:i,addressesFormTitle:l,className:f,addressFormId:c,inputsDefaultValueSet:p,shippingCheckBoxValue:S,billingCheckBoxValue:b,showShippingCheckBox:y,showBillingCheckBox:v,isOpen:T,fieldIdPrefix:Z,onSubmit:t,onCloseBtnClick:h,onSuccess:A,onError:N,onChange:C,forwardFormRef:o,showSaveCheckBox:r,saveCheckBoxValue:d})}),ht=e=>e.reduce((n,s)=>({...n,[s.name]:s.value}),{}),Lt=e=>/^\d+$/.test(e),gt=e=>/^[a-zA-Z0-9\s]+$/.test(e),bt=e=>/^[a-zA-Z0-9]+$/.test(e),Ct=e=>/^[a-zA-Z]+$/.test(e),yt=e=>/^[a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]+(\.[a-z0-9,!\#\$%&'\*\+\/=\?\^_`\{\|\}~-]+)*@([a-z0-9-]+\.)+[a-z]{2,}$/i.test(e),vt=e=>/^\d{4}-\d{2}-\d{2}$/.test(e)&&!isNaN(Date.parse(e)),Mt=(e,n,s)=>{const r=new Date(e).getTime()/1e3;return!(isNaN(r)||r<0||n!==void 0&&r<n||s!==void 0&&r>s)},Fe=e=>!e||isNaN(Number(e))?"":new Date(parseInt(e,10)*1e3).toISOString().split("T")[0],$t=e=>/^(https?|ftp):\/\/(([A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))(\.[A-Z0-9]([A-Z0-9_-]*[A-Z0-9]|))*)(:(\d+))?(\/[A-Z0-9~](([A-Z0-9_~-]|\.)*[A-Z0-9~]|))*\/?(.*)?$/i.test(e),_t=(e,n,s)=>{const r=e.length;return r>=n&&r<=s},be=(e,n,s,r)=>{var m,I;const{requiredFieldError:d,lengthTextError:o,numericError:i,alphaNumWithSpacesError:l,alphaNumericError:f,alphaError:c,emailError:p,dateError:b,urlError:S,dateLengthError:v}=s,y=n==null?void 0:n.customUpperCode,T={[y]:""};if(r[y]&&delete r[y],n!=null&&n.required&&(!e||e==="false"))return{[y]:d};if(!(n!=null&&n.required)&&!e||!((m=n==null?void 0:n.validateRules)!=null&&m.length))return T;const Z=ht(n==null?void 0:n.validateRules),t=Z.MIN_TEXT_LENGTH??1,h=Z.MAX_TEXT_LENGTH??255,A=Z.DATE_RANGE_MIN,N=Z.DATE_RANGE_MAX;if(!_t(e,+t,+h)&&!(A||N))return{[y]:o.replace("{min}",t).replace("{max}",h)};if(!Mt(e,+A,+N)&&(A||N))return{[y]:v.replace("{min}",Fe(A)).replace("{max}",Fe(N))};const H={numeric:{validate:Lt,error:i},"alphanum-with-spaces":{validate:gt,error:l},alphanumeric:{validate:bt,error:f},alpha:{validate:Ct,error:c},email:{validate:yt,error:p},date:{validate:vt,error:b},url:{validate:$t,error:S}}[Z.INPUT_VALIDATION];return H&&!H.validate(e)&&!((I=r[y])!=null&&I.length)?{[y]:H.error}:T},We=e=>{switch(e){case"on":case"true":case 1:case"1":return!0;case"0":case"off":case"false":case 0:return!1;default:return!1}},Et=["true","false","yes","on","off"],Nt={firstName:"",lastName:"",city:"",company:"",countryCode:"",region:"",regionCode:"",regionId:"",id:"",telephone:"",vatId:"",postcode:"",defaultShipping:"",defaultBilling:"",street:"",saveAddressBook:"",prefix:"",middleName:"",fax:"",suffix:"",uid:""},Tt=e=>{const n={},s={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const d=e[r],o=r.match(/^(.*)Multiline_(\d+)$/);if(o){const i=o[1],l=parseInt(o[2],10);s[i]||(s[i]=[]),s[i].push({index:l,value:d})}else Object.keys(e).filter(l=>l.startsWith(`${r}Multiline_`)).length>0?s[r]=[{index:1,value:d}]:n[r]=d}for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const d=s[r];d.sort((o,i)=>o.index-i.index),n[r]=d.map(o=>o.value)}return n},Zt=e=>{const n={},s=[];for(const r in e){const d=Et.includes(e[r])?We(e[r]):e[r];Object.prototype.hasOwnProperty.call(e,r)&&(Object.prototype.hasOwnProperty.call(Nt,r)?n[r]=d:s.push({code:qe(r),value:d}))}return{...n,customAttributes:s}},ae=(e,n=!1)=>{const s=Ue(e,"camelCase",{firstname:"firstName",lastname:"lastName",middlename:"middleName"}),r=Zt(Tt(s));if(!n)return r;const[d,o]=r.region?r.region.split(","):[];return{...r,region:{regionCode:d,...o&&{regionId:+o}}}},Ae=e=>{if(!e.current)return{};const n=e.current.elements;return Array.from(n).reduce((r,d)=>(d.name&&(r[d.name]=d.type==="checkbox"?d.checked:d.value),r),{})},xe=(e,n)=>Object.keys(e).length?Object.keys(e).every(r=>r in n&&n[r]!==""):!1,Pe=e=>typeof e=="function",Ot=e=>e.reduce((n,{customUpperCode:s,required:r,defaultValue:d})=>(r&&s&&(n.initialData[s]=d||"",n.errorList[s]=""),n),{initialData:{},errorList:{}}),Be=e=>Object.keys(e).length>0,St=({fieldsConfig:e,onSubmit:n,onChange:s,setInputChange:r,formName:d})=>{const o=re({requiredFieldError:"Account.FormText.requiredFieldError",lengthTextError:"Account.FormText.lengthTextError",numericError:"Account.FormText.numericError",alphaNumWithSpacesError:"Account.FormText.alphaNumWithSpacesError",alphaNumericError:"Account.FormText.alphaNumericError",alphaError:"Account.FormText.alphaError",emailError:"Account.FormText.emailError",dateError:"Account.FormText.dateError",dateLengthError:"Account.FormText.dateLengthError",urlError:"Account.FormText.urlError"}),i=Qe(null),[l,f]=B({}),[c,p]=B({}),[b,S]=B({}),[v,y]=B(!0),[T,Z]=B(!1),[t,h]=B(!1),[A,N]=B(!0),[C,H]=B(!1);ee(()=>{const u=()=>{if(i.current){const M=window.getComputedStyle(i.current).getPropertyValue("grid-template-rows").split(" ").length,F=i.current.querySelector(".account-address-form--saveAddressBook");F&&(F.style.gridRow=String(M-1))}};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},[e==null?void 0:e.length]);const m=U((u=!1)=>{let $=!0;const M={...c};let F=null;for(const[x,q]of Object.entries(l)){const _=e==null?void 0:e.find(O=>O.customUpperCode.includes(x)),L=be(q.toString(),_,o,M);L[x]&&(Object.assign(M,L),$=!1),F||(F=Object.keys(M).find(O=>M[O])||null)}if(u||p(M),F&&i.current&&!u){const x=i.current.elements.namedItem(F);x==null||x.focus()}return $},[c,e,l,o]),I=U((u,$,M,F)=>{const x={...Ae(i),[$]:u,...$.includes("countryCode")?{region:""}:{}},q={data:ae(x,!0),isDataValid:xe(M,x)};H(q.isDataValid),m(!0),["selectedShippingAddress","selectedBillingAddress"].includes(d)&&sessionStorage.setItem(`${d}_addressData`,JSON.stringify(q)),s==null||s(q,{},F)},[m,d,s]);ee(()=>{if(e!=null&&e.length){const{initialData:u,errorList:$}=Ot(e);f(M=>({...u,...M})),p($),S($)}},[JSON.stringify(e)]),ee(()=>{if(t)return;const u=Ae(i),$=sessionStorage.getItem(`${d}_addressData`);if(Be(l)&&Be(b)){let M={};const F=xe(b,l);$?M=JSON.parse($).data:M=ae(u,!0)??{},s==null||s({data:M,isDataValid:F},{},null),H(F),h(!0)}},[l,b]),ee(()=>{var x;if(!A)return;const u=Ae(i),$=!!(u!=null&&u.countryCode),M=!!((x=u==null?void 0:u.region)!=null&&x.length);u&&$&&!M&&Pe(s)&&I(u==null?void 0:u.region,"region",b,null)},[A,v,e,i,s,I,b,T]);const z=U((u,$)=>{const{name:M,value:F,type:x,checked:q}=u==null?void 0:u.target,_=x==="checkbox"?q:F;f(w=>{const g={...w,[M]:_};return M==="countryCode"&&(g.region="",y(!0),Z(!1)),g}),r==null||r({[M]:_}),h(!0);const L=e==null?void 0:e.find(w=>w.customUpperCode.includes(M));let O=$?{...$}:{...c};if(L){const w=be(_.toString(),L,o,O);w&&Object.assign(O,w),p(O)}I(_,M,b,u)},[r,e,c,o,I,b,v]),E=U(u=>{const{name:$}=u==null?void 0:u.target,M=e==null?void 0:e.find(F=>F.customUpperCode===$);$==="region"&&(M!=null&&M.options.length)&&N(!1),N($==="countryCode")},[]),k=U((u,$)=>{const{name:M,value:F,type:x,checked:q}=u==null?void 0:u.target,_=x==="checkbox"?q:F,L=e==null?void 0:e.find(O=>O.customUpperCode===M);if(L){const O=$?{...$}:{...c},w=be(_.toString(),L,o,O);w&&Object.assign(O,w),p(O)}},[c,e,o]),W=U(u=>{u.preventDefault();const $=m();n==null||n(u,$)},[m,n]);return{isDataValid:C,formData:l,errors:c,formRef:i,handleInputChange:z,onFocus:E,handleBlur:k,handleSubmit:W,handleValidationSubmit:m}};var te=(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))(te||{});const Ft=$e(({loading:e,values:n,fields:s=[],errors:r,className:d="",onChange:o,onBlur:i,onFocus:l,slots:f,fieldIdPrefix:c})=>{const p=`${d}__field`,b=(t,h)=>{if(!(f!=null&&f[`AddressFormInput_${t.code}`]))return;const A={inputName:t.customUpperCode,handleOnChange:o,handleOnBlur:i,handleOnFocus:l,errorMessage:h,errors:r,config:t};return a(he,{"data-testid":`addressFormInput_${t.code}`,name:`AddressFormInput_${t.code}`,slot:f[`AddressFormInput_${t.code}`],context:A},t.id)},S=(t,h,A)=>{var C;const N=((C=t.options.find(H=>H.isDefault))==null?void 0:C.value)??h??t.defaultValue;return a(D,{children:b(t,A)??a(le,{error:A,className:K([p,`${p}--${t.id}`,[`${p}--${t.id}-hidden`,t.isHidden],t.className]),"data-testid":`${d}--${t.id}`,disabled:e||t.disabled,children:a(tt,{"aria-label":t.label,"aria-required":t.required?"true":"false",id:c?`${c}_${t.code}`:t.code,required:t==null?void 0:t.required,name:t.customUpperCode,floatingLabel:`${t.label} ${t.required?"*":""}`,placeholder:t.label,options:t.options,onBlur:i,onFocus:l,handleSelect:o,defaultValue:N,value:N})},t.id)})},v=(t,h,A)=>a(D,{children:b(t,A)??a(le,{error:A,className:K([p,`${p}--${t.id}`,[`${p}--${t.id}-hidden`,t.isHidden],t.className]),"data-testid":`${d}--${t.id}`,disabled:e,children:a(rt,{"aria-label":t.label,"aria-required":t.required?"true":"false",id:c?`${c}_${t.code}`:t.code,type:"text",name:t.customUpperCode,value:h??t.defaultValue,placeholder:t.label,floatingLabel:`${t.label} ${t.required?"*":""}`,onBlur:i,onFocus:l,onChange:o})},t.id)}),y=(t,h,A)=>a(D,{children:b(t,A)??a(le,{error:A,className:K([p,`${p}--${t.id}`,[`${p}--${t.id}-hidden`,t.isHidden],t.className]),"data-testid":`${d}--${t.id}`,disabled:e||t.disabled,children:a(et,{"aria-label":t.label,"aria-required":t.required?"true":"false",id:c?`${c}_${t.code}`:t.code,type:"text",name:t.customUpperCode,value:h||t.defaultValue,placeholder:t.label,floatingLabel:`${t.label} ${t.required?"*":""}`,onBlur:i,onChange:o,disabled:e||t.disabled})},t.id)}),T=(t,h,A)=>a(D,{children:b(t,A)??a(le,{error:A,className:K([p,`${p}--${t.id}`,[`${p}--${t.id}-hidden`,t.isHidden],t.className]),"data-testid":`${d}--${t.id}`,disabled:(t==null?void 0:t.isHidden)??e,children:a(Ve,{"aria-label":t.label,"aria-required":t.required?"true":"false","aria-hidden":t.isHidden,tabindex:t!=null&&t.isHidden?-1:0,id:c?`${c}_${t.code}`:t.code,name:t.customUpperCode,checked:h||t.defaultValue,placeholder:t.label,label:`${t.label} ${t.required?"*":""}`,onBlur:i,onChange:o})},t.id)}),Z=(t,h,A)=>a(D,{children:b(t,A)??a(le,{error:A,className:K([p,`${p}--${t.id}`,[`${p}--${t.id}-hidden`,t.isHidden],t.className]),"data-testid":`${d}--${t.id}`,disabled:e,children:a(De,{"aria-label":t.label,"aria-required":t.required?"true":"false",id:c?`${c}_${t.code}`:t.code,type:"text",name:t.customUpperCode,value:h??t.defaultValue,label:`${t.label} ${t.required?"*":""}`,onBlur:i,onChange:o})},t.id)});return s.length?a(D,{children:s.map(t=>{const h=r==null?void 0:r[t.customUpperCode],A=n==null?void 0:n[t.customUpperCode];switch(t.fieldType){case te.TEXT:return t.options.length?S(t,A,h):v(t,A,h);case te.MULTILINE:return v(t,A,h);case te.SELECT:return S(t,A,h);case te.DATE:return y(t,A,h);case te.BOOLEAN:return T(t,A,h);case te.TEXTAREA:return Z(t,A,h);default:return null}})}):null}),Ge=({testId:e,withCard:n=!0})=>{const s=j(ze,{"data-testid":e||"skeletonLoader",children:[a(P,{variant:"heading",size:"xlarge",fullWidth:!1,lines:1}),a(P,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1}),a(P,{variant:"heading",size:"xlarge",fullWidth:!0,lines:1})]});return n?s:a(me,{variant:"secondary",className:K(["account-account-loaders","account-account-loaders--card-loader"]),children:s})},xt=()=>j(ze,{"data-testid":"addressFormLoader",children:[a(P,{variant:"heading",size:"medium"}),a(P,{variant:"empty",size:"medium"}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large",fullWidth:!0}),a(P,{size:"large",fullWidth:!0,lines:3}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large"}),a(P,{size:"large",fullWidth:!0})]}),Bt=$e(ft(({setInputChange:e,showFormLoader:n,slots:s,name:r,loading:d,children:o,className:i="defaultForm",fieldsConfig:l,onSubmit:f,onChange:c,forwardFormRef:p,regionOptions:b,showSaveCheckBox:S,handleSaveCheckBoxAddress:v,saveCheckBoxAddress:y,fieldIdPrefix:T})=>{const Z=re({saveAddressBook:"Account.AddressForm.formText.saveAddressBook"}),{isDataValid:t,formData:h,errors:A,formRef:N,handleInputChange:C,handleBlur:H,handleSubmit:m,handleValidationSubmit:I,onFocus:z}=St({fieldsConfig:l,onSubmit:f,onChange:c,setInputChange:e,formName:r});return At(p,()=>{const E=Ae(N);return{handleValidationSubmit:I,requestSubmit:()=>{var k;(k=N.current)==null||k.requestSubmit()},formData:ae(E,!0),isDataValid:t}}),n||!(l!=null&&l.length)?a(xt,{}):j("form",{className:K(["account-form",i]),onSubmit:m,name:r,ref:N,children:[a(Ft,{className:i,loading:d,fields:l,onChange:C,onBlur:H,errors:A,values:h,onFocus:z,slots:s,fieldIdPrefix:T}),s!=null&&s.AddressFormInputs?a(he,{"data-testid":"addressFormInputs",name:"AddressFormInputs",slot:s.AddressFormInputs,context:{formActions:{handleChange:C}}}):null,S?a("div",{className:"account-address-form--saveAddressBook",children:a(Ve,{"data-testid":"testSaveAddressBook",name:"saveAddressBook",label:Z.saveAddressBook,checked:y,onChange:E=>{C(E),v==null||v(E)}})}):null,o]})})),Ie=(e,n,s={},r="editButton")=>{const d=r==="removeButton",o={shippingAndBilling:{edit:s.editAddressAriaLabelShippingAndBilling,remove:s.removeAddressAriaLabelShippingAndBilling},shipping:{edit:s.editAddressAriaLabelShipping,remove:s.removeAddressAriaLabelShipping},billing:{edit:s.editAddressAriaLabelBilling,remove:s.removeAddressAriaLabelBilling},default:{edit:s.editAddressAriaLabelDefault,remove:s.removeAddressAriaLabelDefault}};let i="default";return e&&n?i="shippingAndBilling":e?i="shipping":n&&(i="billing"),d?o[i].remove:o[i].edit},ve=({slots:e,selectable:n,selectShipping:s,selectBilling:r,variant:d="secondary",minifiedView:o,keysSortOrder:i,addressData:l,loading:f,setAddressId:c,handleRenderModal:p,handleRenderForm:b})=>{const S=mt(),v=o?"minifiedView":"fullSizeView",y=re({actionRemove:`Account.${v}.Addresses.addressCard.actionRemove`,actionEdit:`Account.${v}.Addresses.addressCard.actionEdit`,cardLabelShipping:`Account.${v}.Addresses.addressCard.cardLabelShipping`,cardLabelBilling:`Account.${v}.Addresses.addressCard.cardLabelBilling`,defaultLabelText:`Account.${v}.Addresses.addressCard.defaultLabelText`,editAddressAriaLabelDefault:`Account.${v}.Addresses.addressCard.ariaLabel.editButton.default`,editAddressAriaLabelShipping:`Account.${v}.Addresses.addressCard.ariaLabel.editButton.shipping`,editAddressAriaLabelBilling:`Account.${v}.Addresses.addressCard.ariaLabel.editButton.billing`,editAddressAriaLabelShippingAndBilling:`Account.${v}.Addresses.addressCard.ariaLabel.editButton.shippingAndBilling`,removeAddressAriaLabelDefault:`Account.${v}.Addresses.addressCard.ariaLabel.removeButton.default`,removeAddressAriaLabelShipping:`Account.${v}.Addresses.addressCard.ariaLabel.removeButton.shipping`,removeAddressAriaLabelBilling:`Account.${v}.Addresses.addressCard.ariaLabel.removeButton.billing`,removeAddressAriaLabelShippingAndBilling:`Account.${v}.Addresses.addressCard.ariaLabel.removeButton.shippingAndBilling`}),T=y.cardLabelBilling.toLocaleUpperCase(),Z=y.cardLabelShipping.toLocaleUpperCase(),t=y.defaultLabelText.toLocaleUpperCase(),h=ye(()=>{const E={shippingLabel:Z,billingLabel:T,hideShipping:!1,hideBilling:!1};return n?s&&!r?{shippingLabel:t,billingLabel:t,hideShipping:!1,hideBilling:!0}:r&&!s?{shippingLabel:t,billingLabel:t,hideShipping:!0,hideBilling:!1}:E:E},[T,t,Z,r,s,n]),A=Oe(()=>{c==null||c(l==null?void 0:l.id),p==null||p()},[p,l==null?void 0:l.id,c]),N=Oe(()=>{c==null||c(l==null?void 0:l.id),b==null||b()},[b,l==null?void 0:l.id,c]),C=ye(()=>{if(!i)return[];const{region:E,...k}=l,W={...k,...E};return i.filter(({name:u})=>W[u]).map(u=>({name:u.name,orderNumber:u.orderNumber,value:W[u.name],label:u.label}))},[l,i]),{shippingLabel:H,billingLabel:m,hideShipping:I,hideBilling:z}=h;return a(me,{variant:d,className:"account-address-card","data-testid":"addressCard",children:f?a(Ge,{}):j(D,{children:[j("div",{className:"account-address-card__action",children:[p?a(de,{type:"button",variant:"tertiary",onClick:A,"data-testid":"removeButton","aria-label":Ie(l==null?void 0:l.defaultShipping,l==null?void 0:l.defaultBilling,y,"removeButton"),"aria-describedby":S,children:y.actionRemove}):null,b?a(de,{type:"button",variant:"tertiary",onClick:N,className:"account-address-card__action--editbutton","data-testid":"editButton","aria-label":Ie(l==null?void 0:l.defaultShipping,l==null?void 0:l.defaultBilling,y,"editButton"),"aria-describedby":S,children:y.actionEdit}):null]}),a("div",{className:"account-address-card__description",id:S,children:e!=null&&e.AddressCard?a(he,{name:"AddressCard",slot:e==null?void 0:e.AddressCard,context:{addressData:C}}):a(D,{children:C.map((E,k)=>{const W=E.label?`${E.label}: ${E==null?void 0:E.value}`:E==null?void 0:E.value;return a("p",{"data-testid":`${E.name}_${k}`,children:W},k)})})}),(l!=null&&l.defaultShipping||l!=null&&l.defaultBilling)&&!n?j("div",{className:"account-address-card__labels",children:[l!=null&&l.defaultShipping?a(pe,{label:Z}):null,l!=null&&l.defaultBilling?a(pe,{label:T}):null]}):null,n?j("div",{className:"account-address-card__labels",children:[!I&&(l!=null&&l.defaultShipping)?a(pe,{label:H}):null,!z&&(l!=null&&l.defaultBilling)?a(pe,{label:m}):null]}):null]})})},It=e=>G.createElement("svg",{id:"Icon_Add_Base","data-name":"Icon \\u2013 Add \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},G.createElement("g",{id:"Large"},G.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),G.createElement("g",{id:"Add_icon","data-name":"Add icon",transform:"translate(9.734 9.737)"},G.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_579","data-name":"Line 579",y2:12.7,transform:"translate(2.216 -4.087)",fill:"none",stroke:"currentColor"}),G.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_580","data-name":"Line 580",x2:12.7,transform:"translate(-4.079 2.263)",fill:"none",stroke:"currentColor"})))),wt=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",{d:"M3.375 7.38672C3.09886 7.38672 2.875 7.61058 2.875 7.88672C2.875 8.16286 3.09886 8.38672 3.375 8.38672V7.38672ZM5.88409 8.38672C6.16023 8.38672 6.38409 8.16286 6.38409 7.88672C6.38409 7.61058 6.16023 7.38672 5.88409 7.38672V8.38672ZM3.375 11.1836C3.09886 11.1836 2.875 11.4075 2.875 11.6836C2.875 11.9597 3.09886 12.1836 3.375 12.1836V11.1836ZM5.88409 12.1836C6.16023 12.1836 6.38409 11.9597 6.38409 11.6836C6.38409 11.4075 6.16023 11.1836 5.88409 11.1836V12.1836ZM3.375 15.6133C3.09886 15.6133 2.875 15.8371 2.875 16.1133C2.875 16.3894 3.09886 16.6133 3.375 16.6133V15.6133ZM5.88409 16.6133C6.16023 16.6133 6.38409 16.3894 6.38409 16.1133C6.38409 15.8371 6.16023 15.6133 5.88409 15.6133V16.6133ZM8.52059 16.4182C8.51422 16.6942 8.73286 16.9232 9.00893 16.9296C9.285 16.9359 9.51396 16.7173 9.52032 16.4412L8.52059 16.4182ZM9.19302 14.8261L8.70612 14.7124C8.70434 14.72 8.70274 14.7277 8.70132 14.7354L9.19302 14.8261ZM11.2762 13.3887L11.4404 13.8611L11.4499 13.8576L11.2762 13.3887ZM12.3195 13.1013C12.4035 12.8382 12.2583 12.5569 11.9953 12.4729C11.7322 12.3889 11.4509 12.5341 11.3669 12.7971L12.3195 13.1013ZM15.7342 16.4412C15.7406 16.7173 15.9695 16.9359 16.2456 16.9296C16.5217 16.9232 16.7403 16.6942 16.734 16.4182L15.7342 16.4412ZM16.0615 14.8261L16.5532 14.7354C16.5518 14.7277 16.5502 14.72 16.5484 14.7124L16.0615 14.8261ZM13.9784 13.3887L13.8046 13.8577L13.8142 13.861L13.9784 13.3887ZM13.8877 12.7971C13.8037 12.5341 13.5223 12.3889 13.2593 12.4729C12.9962 12.5569 12.8511 12.8382 12.9351 13.1013L13.8877 12.7971ZM10.9023 10.418L11.4023 10.418V10.418H10.9023ZM11.2309 8.60993L11.6861 8.81678L11.6861 8.81678L11.2309 8.60993ZM12.0518 12.7684L11.7218 13.1441L11.7682 13.1848L11.823 13.213L12.0518 12.7684ZM13.202 12.7684L13.4308 13.213L13.4787 13.1884L13.5203 13.1541L13.202 12.7684ZM3.375 8.38672H5.88409V7.38672H3.375V8.38672ZM3.375 12.1836H5.88409V11.1836H3.375V12.1836ZM3.375 16.6133H5.88409V15.6133H3.375V16.6133ZM6.41058 2.375H18.844V1.375H6.41058V2.375ZM18.844 2.375C19.4866 2.375 20.125 2.99614 20.125 3.9225H21.125C21.125 2.57636 20.1627 1.375 18.844 1.375V2.375ZM20.125 3.9225V20.0775H21.125V3.9225H20.125ZM20.125 20.0775C20.125 20.9945 19.485 21.625 18.844 21.625V22.625C20.1643 22.625 21.125 21.4105 21.125 20.0775H20.125ZM18.844 21.625H6.41058V22.625H18.844V21.625ZM6.41058 21.625C5.76792 21.625 5.12955 21.0039 5.12955 20.0775H4.12955C4.12955 21.4236 5.09185 22.625 6.41058 22.625V21.625ZM5.12955 20.0775V3.9225H4.12955V20.0775H5.12955ZM5.12955 3.9225C5.12955 3.0055 5.76956 2.375 6.41058 2.375V1.375C5.0902 1.375 4.12955 2.5895 4.12955 3.9225H5.12955ZM9.52032 16.4412C9.53194 15.9373 9.59014 15.4295 9.68473 14.9168L8.70132 14.7354C8.59869 15.2917 8.53362 15.853 8.52059 16.4182L9.52032 16.4412ZM9.67993 14.9397C9.69157 14.8899 9.78099 14.7261 10.1128 14.496C10.4223 14.2813 10.8711 14.0589 11.4404 13.861L11.112 12.9165C10.4856 13.1343 9.94827 13.3931 9.54284 13.6743C9.15974 13.94 8.80542 14.2871 8.70612 14.7124L9.67993 14.9397ZM11.4499 13.8576C11.5852 13.8074 11.7547 13.7102 11.8933 13.6105C11.9656 13.5584 12.0441 13.4954 12.1133 13.4247C12.1723 13.3646 12.2709 13.2534 12.3195 13.1013L11.3669 12.7971C11.3809 12.7532 11.3985 12.7277 11.4022 12.7225C11.407 12.7157 11.4073 12.7164 11.3993 12.7246C11.3827 12.7416 11.3525 12.7676 11.3092 12.7988C11.2674 12.8288 11.222 12.8575 11.1805 12.8808C11.1363 12.9057 11.1089 12.9175 11.1024 12.9199L11.4499 13.8576ZM16.734 16.4182C16.7209 15.853 16.6559 15.2917 16.5532 14.7354L15.5698 14.9168C15.6644 15.4295 15.7226 15.9373 15.7342 16.4412L16.734 16.4182ZM16.5484 14.7124C16.4491 14.2871 16.0948 13.94 15.7117 13.6743C15.3063 13.3931 14.769 13.1343 14.1426 12.9165L13.8142 13.861C14.3834 14.0589 14.8322 14.2813 15.1417 14.496C15.4736 14.7261 15.563 14.8899 15.5746 14.9397L16.5484 14.7124ZM14.1521 12.9199C14.1456 12.9175 14.1183 12.9057 14.074 12.8808C14.0325 12.8575 13.9871 12.8288 13.9453 12.7988C13.9021 12.7676 13.8719 12.7416 13.8552 12.7246C13.8472 12.7164 13.8476 12.7157 13.8524 12.7225C13.856 12.7277 13.8736 12.7532 13.8877 12.7971L12.9351 13.1013C12.9836 13.2534 13.0823 13.3646 13.1412 13.4247C13.2105 13.4954 13.2889 13.5584 13.3612 13.6105C13.4999 13.7102 13.6694 13.8074 13.8046 13.8576L14.1521 12.9199ZM11.4023 10.418C11.4023 9.83385 11.4811 9.26803 11.6861 8.81678L10.7757 8.40309C10.4878 9.03666 10.4023 9.76284 10.4023 10.418H11.4023ZM11.6861 8.81678C11.8053 8.55448 12.0796 8.38672 12.5813 8.38672V7.38672C11.8704 7.38672 11.1213 7.6426 10.7757 8.40309L11.6861 8.81678ZM12.5813 8.38672C13.087 8.38672 13.4614 8.60522 13.5777 8.83539L14.4703 8.38448C14.1169 7.685 13.2884 7.38672 12.5813 7.38672V8.38672ZM13.5777 8.83539C13.7606 9.19738 13.8523 9.72518 13.8523 10.418H14.8523C14.8523 9.66433 14.757 8.95213 14.4703 8.38448L13.5777 8.83539ZM12.5813 12.4492C12.5364 12.4492 12.5158 12.4464 12.5087 12.4451C12.5046 12.4444 12.5042 12.4442 12.5008 12.4428C12.4922 12.4391 12.4782 12.4321 12.438 12.4096C12.4018 12.3893 12.3471 12.358 12.2805 12.3238L11.823 13.213C11.8698 13.2371 11.9055 13.2576 11.9494 13.2821C11.9893 13.3045 12.0449 13.3354 12.1079 13.3623C12.2569 13.426 12.403 13.4492 12.5813 13.4492V12.4492ZM12.3817 12.3927C11.8273 11.9058 11.4022 11.3083 11.4023 10.418L10.4023 10.4179C10.4022 11.6973 11.0412 12.5462 11.7218 13.1441L12.3817 12.3927ZM13.8523 10.418C13.8523 11.3319 13.4575 11.9093 12.8838 12.3828L13.5203 13.1541C14.2611 12.5427 14.8523 11.7035 14.8523 10.418H13.8523ZM12.9733 12.3238C12.7638 12.4316 12.717 12.4492 12.5813 12.4492V13.4492C12.9639 13.4492 13.1869 13.3385 13.4308 13.213L12.9733 12.3238Z",fill:"currentColor"})),Ht=e=>G.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...e},G.createElement("g",{id:"Large"},G.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),G.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},G.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),Rt=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",{d:"M12.002 21L11.8275 21.4686C11.981 21.5257 12.1528 21.5041 12.2873 21.4106C12.4218 21.3172 12.502 21.1638 12.502 21H12.002ZM3.89502 17.9823H3.39502C3.39502 18.1912 3.52485 18.378 3.72059 18.4509L3.89502 17.9823ZM3.89502 8.06421L4.07193 7.59655C3.91831 7.53844 3.74595 7.55948 3.61082 7.65284C3.47568 7.74619 3.39502 7.89997 3.39502 8.06421H3.89502ZM12.0007 21H11.5007C11.5007 21.1638 11.5809 21.3172 11.7154 21.4106C11.8499 21.5041 12.0216 21.5257 12.1751 21.4686L12.0007 21ZM20.1076 17.9823L20.282 18.4509C20.4778 18.378 20.6076 18.1912 20.6076 17.9823H20.1076ZM20.1076 8.06421H20.6076C20.6076 7.89997 20.527 7.74619 20.3918 7.65284C20.2567 7.55948 20.0843 7.53844 19.9307 7.59655L20.1076 8.06421ZM12.0007 11.1311L11.8238 10.6634C11.6293 10.737 11.5007 10.9232 11.5007 11.1311H12.0007ZM20.2858 8.53191C20.5441 8.43421 20.6743 8.14562 20.5766 7.88734C20.4789 7.62906 20.1903 7.49889 19.932 7.5966L20.2858 8.53191ZM12.002 4.94826L12.1775 4.48008C12.0605 4.43623 11.9314 4.43775 11.8154 4.48436L12.002 4.94826ZM5.87955 6.87106C5.62334 6.97407 5.49915 7.26528 5.60217 7.52149C5.70518 7.77769 5.99639 7.90188 6.2526 7.79887L5.87955 6.87106ZM18.1932 7.80315C18.4518 7.90008 18.74 7.76904 18.8369 7.51047C18.9338 7.2519 18.8028 6.96371 18.5442 6.86678L18.1932 7.80315ZM12 4.94827L11.5879 5.23148C11.6812 5.36719 11.8353 5.44827 12 5.44827C12.1647 5.44827 12.3188 5.36719 12.4121 5.23148L12 4.94827ZM14.0263 2L14.2028 1.53218C13.9875 1.45097 13.7446 1.52717 13.6143 1.71679L14.0263 2ZM21.8421 4.94827L22.2673 5.2113C22.3459 5.08422 22.3636 4.92863 22.3154 4.78717C22.2673 4.64571 22.1584 4.53319 22.0186 4.48045L21.8421 4.94827ZM9.97368 2L10.3857 1.71679C10.2554 1.52717 10.0125 1.45097 9.79721 1.53218L9.97368 2ZM2.15789 4.94827L1.98142 4.48045C1.84161 4.53319 1.73271 4.64571 1.68456 4.78717C1.63641 4.92863 1.65406 5.08422 1.73267 5.2113L2.15789 4.94827ZM12 11.1256L11.6702 11.5014C11.8589 11.667 12.1411 11.667 12.3298 11.5014L12 11.1256ZM15.0395 8.45812L14.8732 7.98659C14.8131 8.00779 14.7576 8.04028 14.7097 8.08232L15.0395 8.45812ZM23 5.65024L23.3288 6.0269C23.5095 5.86916 23.5527 5.60532 23.4318 5.39817C23.3109 5.19102 23.0599 5.09893 22.8337 5.17871L23 5.65024ZM8.96053 8.45812L9.29034 8.08232C9.24244 8.04028 9.18695 8.00779 9.12685 7.98659L8.96053 8.45812ZM1 5.65024L1.16632 5.17871C0.940115 5.09893 0.689119 5.19102 0.568192 5.39817C0.447264 5.60532 0.49048 5.86916 0.671176 6.0269L1 5.65024ZM12.1764 20.5314L4.06945 17.5137L3.72059 18.4509L11.8275 21.4686L12.1764 20.5314ZM4.39502 17.9823V8.06421H3.39502V17.9823H4.39502ZM3.71811 8.53187L11.8251 11.5987L12.1789 10.6634L4.07193 7.59655L3.71811 8.53187ZM11.502 11.1311V21H12.502V11.1311H11.502ZM12.1751 21.4686L20.282 18.4509L19.9332 17.5137L11.8262 20.5314L12.1751 21.4686ZM20.6076 17.9823V8.06421H19.6076V17.9823H20.6076ZM19.9307 7.59655L11.8238 10.6634L12.1776 11.5987L20.2845 8.53187L19.9307 7.59655ZM11.5007 11.1311V21H12.5007V11.1311H11.5007ZM19.932 7.5966L11.8251 10.6634L12.1789 11.5987L20.2858 8.53191L19.932 7.5966ZM11.8154 4.48436L5.87955 6.87106L6.2526 7.79887L12.1885 5.41217L11.8154 4.48436ZM11.8265 5.41645L18.1932 7.80315L18.5442 6.86678L12.1775 4.48008L11.8265 5.41645ZM11.502 4.94826V11.1311H12.502V4.94826H11.502ZM12.4121 5.23148L14.4384 2.28321L13.6143 1.71679L11.5879 4.66507L12.4121 5.23148ZM13.8498 2.46782L21.6656 5.4161L22.0186 4.48045L14.2028 1.53218L13.8498 2.46782ZM21.4169 4.68525L20.5485 6.08919L21.3989 6.61524L22.2673 5.2113L21.4169 4.68525ZM12.4121 4.66507L10.3857 1.71679L9.56162 2.28321L11.5879 5.23148L12.4121 4.66507ZM9.79721 1.53218L1.98142 4.48045L2.33437 5.4161L10.1502 2.46782L9.79721 1.53218ZM1.73267 5.2113L2.60109 6.61524L3.45154 6.08919L2.58312 4.68525L1.73267 5.2113ZM12.3298 11.5014L15.3693 8.83392L14.7097 8.08232L11.6702 10.7498L12.3298 11.5014ZM15.2058 8.92965L23.1663 6.12177L22.8337 5.17871L14.8732 7.98659L15.2058 8.92965ZM22.6712 5.27358L19.7764 7.80067L20.4341 8.554L23.3288 6.0269L22.6712 5.27358ZM12.3298 10.7498L9.29034 8.08232L8.63072 8.83392L11.6702 11.5014L12.3298 10.7498ZM9.12685 7.98659L1.16632 5.17871L0.83368 6.12177L8.79421 8.92965L9.12685 7.98659ZM0.671176 6.0269L3.56591 8.554L4.22356 7.80067L1.32882 5.27358L0.671176 6.0269Z",fill:"currentColor"})),we=({selectable:e,className:n,addNewAddress:s,minifiedView:r,routeAddressesPage:d})=>{const o=r?"minifiedView":"fullSizeView",i=re({viewAllAddressesButton:`Account.${o}.Addresses.viewAllAddressesButton`,addNewAddressButton:`Account.${o}.Addresses.addNewAddressButton`,differentAddressButton:`Account.${o}.Addresses.differentAddressButton`}),l=e?"span":"button",f=e?{}:{AriaRole:"button",type:"button"},c=r&&!s?i.viewAllAddressesButton:i.addNewAddressButton,p=e?i.differentAddressButton:c;return j(l,{...f,className:K(["account-actions-address",["account-actions-address--viewall",r],["account-actions-address--address",!r],["account-actions-address--selectable",e],n]),"data-testid":"showRouteFullAddress",onClick:d,children:[a("span",{className:"account-actions-address__title","data-testid":"addressActionsText",children:p}),a(ke,{source:r&&!s?Ht:It,size:"32"})]})},Vt=({minifiedView:e,keysSortOrder:n,addressData:s,open:r,submitLoading:d,onRemoveAddress:o,closeModal:i})=>{const l=e?"minifiedView":"fullSizeView",f=re({title:`Account.${l}.Addresses.removeAddressModal.title`,description:`Account.${l}.Addresses.removeAddressModal.description`,actionCancel:`Account.${l}.Addresses.removeAddressModal.actionCancel`,actionConfirm:`Account.${l}.Addresses.removeAddressModal.actionConfirm`});return r?a(st,{className:"account-address-modal--overlay",title:a("h3",{children:f.title}),size:"full","data-testid":"addressModal",showCloseButton:!0,onClose:i,children:j("div",{className:"account-address-modal",children:[d?a("div",{className:"account-address-modal__spinner","data-testid":"progressSpinner",children:a(nt,{stroke:"4",size:"large"})}):null,a("p",{children:f.description}),a(ve,{minifiedView:e,addressData:s,keysSortOrder:n}),j("div",{className:"account-address-modal__buttons",children:[a(de,{type:"button",onClick:i,variant:"secondary",disabled:d,children:f.actionCancel}),a(de,{disabled:d,onClick:o,children:f.actionConfirm})]})]})}):null},zt=({typeList:e,isEmpty:n,minifiedView:s,className:r})=>{const d=s?"minifiedView":"fullSizeView",o=re({addressesMessage:`Account.${d}.EmptyList.Addresses.message`,ordersListMessage:`Account.${d}.EmptyList.OrdersList.message`}),i=ye(()=>{switch(e){case"address":return{icon:wt,text:a("p",{children:o.addressesMessage})};case"orders":return{icon:Rt,text:a("p",{children:o.ordersListMessage})};default:return{icon:"",text:""}}},[e,o]);return!n||!e||!i.text?null:a(at,{className:K(["account-empty-list",s?"account-empty-list--minified":"",r]),message:i.text,icon:a(ke,{source:i.icon}),"data-testid":"emptyList"})},kt=async(e,n)=>{if(n.length===1){const i=n[0],f=Object.values(i.region).every(p=>!!p)?{}:{region:{...i.region,regionId:0}};return!!await Ce({addressId:Number(i==null?void 0:i.id),defaultShipping:!1,defaultBilling:!1,...f})}const s=n.filter(i=>i.id!==e&&(i.defaultBilling||i.defaultShipping)||i.id!==e),r=n[n.length-1],d=s[0]||((r==null?void 0:r.id)!==e?r:null);return!d||!d.id?!1:!!await Ce({addressId:+d.id,defaultShipping:!0,defaultBilling:!0})},Ut=["firstname","lastname","city","company","country_code","region","region_code","region_id","telephone","id","vat_id","postcode","street","street_multiline_2","default_shipping","default_billing","fax","prefix","suffix","middlename"],ir=["email","firstname","lastname","middlename","gender","dob","prefix","suffix","fax"],Je=(e,n,s)=>{if(n&&s||!n&&!s)return e;const r=e.slice();return n?r.sort((d,o)=>Number(o.defaultShipping)-Number(d.defaultShipping)):s?r.sort((d,o)=>Number(o.defaultBilling)-Number(d.defaultBilling)):e},Me=e=>e==null?!0:typeof e!="object"?!1:Object.keys(e).length===0||Object.values(e).every(Me),qt=({selectShipping:e,selectBilling:n,defaultSelectAddressId:s,onAddressData:r,minifiedView:d,routeAddressesPage:o,onSuccess:i})=>{const[l,f]=B(""),[c,p]=B(!1),[b,S]=B(!1),[v,y]=B(!1),[T,Z]=B(!1),[t,h]=B(!1),[A,N]=B(""),[C,H]=B([]),[m,I]=B([]),z=U(async()=>{y(!0),Promise.all([je("shortRequest"),lt()]).then(_=>{const[L,O]=_;if(L){const w=L.map(({name:g,orderNumber:R,label:V})=>({name:it(g),orderNumber:R,label:Ut.includes(g)?null:V}));I(w)}if(O)if(d){const w=O.filter(R=>!!R.defaultShipping||!!R.defaultBilling),g=w.length?w:O.slice(-1);H(g)}else H(O)}).finally(()=>{y(!1)})},[d]);ee(()=>{z()},[z]),ee(()=>{var _;if(C.length)if(s===0)h(!0),f("0");else{const L=C.find(w=>{var g;return typeof s=="string"?w.uid===s||((g=w.id)==null?void 0:g.toString())===s:+w.id===s})||Je(C,e,n)[0],O={data:ae(L),isDataValid:!Me(L)};f(((_=L==null?void 0:L.id)==null?void 0:_.toString())||(L==null?void 0:L.uid)||""),r==null||r(O)}},[C,s,r,n,e]);const E=U(_=>{N(_),h(!1)},[]),k=U((_,L)=>{const O=(_==null?void 0:_.target).value,w=(_==null?void 0:_.target).nextSibling;f(O);const g={data:ae(L),isDataValid:!Me(ae(L))};r==null||r(g),h(O==="0"),w&&(w.focus(),window.scrollBy(0,100))},[r]),W=U(()=>{S(!0)},[]),u=U(()=>{N(""),S(!1),p(!1)},[]),$=U(()=>{p(!0)},[]),M=U(async()=>{Z(!0),await kt(A,C),ct(+A).then(()=>{z(),u()}).finally(()=>{Z(!1)})},[C,A,u,z]),F=U(()=>{h(!1)},[]),x=U(()=>{Pe(o)&&d&&!t?window.location.href=o():(h(!0),N(""))},[t,o,d]),q=U(async()=>{await z(),await(i==null?void 0:i())},[z,i]);return{keysSortOrder:m,submitLoading:T,isModalRendered:c,isFormRendered:b,loading:v,addNewAddress:t,addressesList:C,addressId:A,handleRenderForm:W,handleRenderModal:$,removeAddress:M,onCloseBtnClick:u,setEditingAddressId:E,closeNewAddressForm:F,redirectToAddressesRoute:x,handleOnSuccess:q,handleSelectAddressOption:k,selectedAddressOption:l}},cr=$e(({minifiedViewKey:e,hideActionFormButtons:n=!1,inputName:s,slots:r,title:d="",addressFormTitle:o="",defaultSelectAddressId:i="",showFormLoader:l=!1,onAddressData:f,forwardFormRef:c,className:p,showSaveCheckBox:b=!1,saveCheckBoxValue:S=!1,selectShipping:v=!1,selectBilling:y=!1,selectable:T=!1,withHeader:Z=!0,minifiedView:t=!1,withActionsInMinifiedView:h=!1,withActionsInFullSizeView:A=!0,inputsDefaultValueSet:N,showShippingCheckBox:C=!0,showBillingCheckBox:H=!0,shippingCheckBoxValue:m=!0,billingCheckBoxValue:I=!0,routeAddressesPage:z,onSubmit:E,onSuccess:k,onError:W})=>{const u=re({containerTitle:`Account.${e}.Addresses.containerTitle`,differentAddressFormTitle:`Account.${e}.Addresses.differentAddressFormTitle`,editAddressFormTitle:`Account.${e}.Addresses.editAddressFormTitle`,viewAllAddressesButton:`Account.${e}.Addresses.viewAllAddressesButton`,newAddressFormTitle:`Account.${e}.Addresses.newAddressFormTitle`,ariaLabelAddressPicker:`Account.${e}.Addresses.ariaLabelAddressPicker`}),{keysSortOrder:$,submitLoading:M,isModalRendered:F,isFormRendered:x,loading:q,addNewAddress:_,addressesList:L,addressId:O,handleRenderForm:w,handleRenderModal:g,removeAddress:R,onCloseBtnClick:V,handleOnSuccess:J,setEditingAddressId:Y,closeNewAddressForm:X,redirectToAddressesRoute:ie,handleSelectAddressOption:_e,selectedAddressOption:Ee}=qt({defaultSelectAddressId:i,minifiedView:t,routeAddressesPage:z,onSuccess:k,onAddressData:f,selectShipping:v,selectBilling:y}),ce=d||u.containerTitle;let Le=null;if(T){const Q=Je(L,v,y)||[];let se;_?se=a("div",{className:K(["account-addresses-form__footer__wrapper",["account-addresses-form__footer__wrapper-show",_]]),children:a(fe,{slots:r,hideActionFormButtons:n,formName:s,showFormLoader:l,isOpen:_,forwardFormRef:c,showSaveCheckBox:b,saveCheckBoxValue:S,shippingCheckBoxValue:m,billingCheckBoxValue:I,addressesFormTitle:o||u.differentAddressFormTitle,inputsDefaultValueSet:N,showShippingCheckBox:C,showBillingCheckBox:H,onCloseBtnClick:X,onChange:f,onError:W,onSubmit:E,onSuccess:J})}):Q.length?se=a(we,{selectable:T,minifiedView:t,addNewAddress:_,routeAddressesPage:ie}):se=null;const Ne=`generalLabel_${ce.replace(/\s+/g,"")}`;Le=j("div",{className:"account-addresses-wrapper--select-view",children:[a("span",{id:Ne,style:"display: none;",children:ce}),Q.map((ne,Xe)=>{var Ze;const ue=((Ze=ne.id)==null?void 0:Ze.toString())||ne.uid,ge=`${s}_${ue}`,Te=`${ge}_label`;return j(Se,{children:[a("input",{"data-testid":`radio-${Xe+1}`,type:"radio",name:s,id:ge,value:ue,checked:Ee===ue,onChange:Ye=>_e(Ye,ne),"aria-labelledby":`${Ne} ${Te}`}),a("label",{id:Te,htmlFor:ge,className:"account-addresses-wrapper__label",children:a(ve,{slots:r,selectable:T,selectShipping:v,selectBilling:y,minifiedView:t,addressData:ne,keysSortOrder:$,loading:q})})]},ue)}),se&&j("div",{className:"account-addresses-wrapper__footer-section",children:[a("input",{"aria-label":`${ce} ${u.ariaLabelAddressPicker}`,"data-testid":"radio-0",type:"radio",name:s,id:`${s}_addressActions`,value:"0",checked:Ee==="0",onChange:ne=>_e(ne,{}),tabindex:se?0:-1}),a("label",{htmlFor:`${s}_addressActions`,className:"account-addresses-wrapper__label",children:se})]})]})}else Le=j(D,{children:[L.map(Q=>a(Se,{children:O===Q.id&&x?a(me,{variant:"secondary",style:{marginBottom:20},children:a(fe,{slots:r,isOpen:O===Q.id&&x,addressFormId:O,inputsDefaultValueSet:Q,addressesFormTitle:u.editAddressFormTitle,showShippingCheckBox:C,showBillingCheckBox:H,shippingCheckBoxValue:m,billingCheckBoxValue:I,forwardFormRef:c,onCloseBtnClick:V,onChange:f,onError:W,onSubmit:E,onSuccess:J})}):a(ve,{slots:r,minifiedView:t,addressData:Q,keysSortOrder:$,loading:q,setAddressId:Y,handleRenderModal:t&&h||!t&&A?g:void 0,handleRenderForm:t&&h||!t&&A?w:void 0},Q.id)},Q.id)),a("div",{className:"account-addresses__footer",children:_?a(me,{variant:"secondary",children:a(fe,{slots:r,isOpen:_,addressesFormTitle:u.newAddressFormTitle,inputsDefaultValueSet:N,showShippingCheckBox:!!(L!=null&&L.length),showBillingCheckBox:!!(L!=null&&L.length),shippingCheckBoxValue:m,billingCheckBoxValue:I,forwardFormRef:c,onChange:f,onCloseBtnClick:X,onError:W,onSubmit:E,onSuccess:J})}):a(we,{minifiedView:t,addNewAddress:_,routeAddressesPage:ie})})]});return j("div",{children:[Z?a(dt,{title:ce,divider:!t,className:t?"account-addresses-header":""}):null,j("div",{className:K(["account-addresses-wrapper",p]),"data-testid":"addressesIdWrapper",children:[a(Vt,{minifiedView:t,addressData:L==null?void 0:L.find(Q=>Q.id===O),keysSortOrder:$,submitLoading:M,open:F,closeModal:V,onRemoveAddress:R}),q?a(Ge,{testId:"addressSkeletonLoader",withCard:!1}):T?a(fe,{slots:r,hideActionFormButtons:n,formName:s,isOpen:!(L!=null&&L.length),forwardFormRef:c,showSaveCheckBox:b,saveCheckBoxValue:S,shippingCheckBoxValue:m,billingCheckBoxValue:I,inputsDefaultValueSet:N,showShippingCheckBox:C,showBillingCheckBox:H,onChange:f,onCloseBtnClick:X,onError:W,onSubmit:E,onSuccess:J}):a(zt,{isEmpty:!(L!=null&&L.length),typeList:"address",minifiedView:t}),Le]})]})}),Ke={entityType:"CUSTOMER_ADDRESS",isUnique:!1,options:[],multilineCount:0,validateRules:[],defaultValue:!1,fieldType:te.BOOLEAN,className:"",required:!1,orderNumber:90,isHidden:!1},jt={...Ke,label:"Set as default shipping address",name:"default_shipping",id:"default_shipping",code:"default_shipping",customUpperCode:"defaultShipping"},Wt={...Ke,label:"Set as default billing address",name:"default_billing",id:"default_billing",code:"default_billing",customUpperCode:"defaultBilling"},Pt=(e,n)=>n==null?void 0:n.map(s=>{const r={...e,firstName:e.firstname??e.firstName,lastName:e.lastname??e.lastName,middleName:e.middlename??e.middleName},d=JSON.parse(JSON.stringify(s));if(Object.hasOwn(r,s.customUpperCode)){const o=r[s.customUpperCode];s.customUpperCode==="region"&&typeof o=="object"?d.defaultValue=o.regionCode&&o.regionId?`${o.regionCode},${o.regionId}`:o.region??o.regionCode:d.defaultValue=o}return d}),He=e=>{if(!e)return null;const n=new FormData(e);if(e.querySelectorAll('input[type="checkbox"]').forEach(r=>{n.has(r.name)||n.set(r.name,"false"),r.checked&&n.set(r.name,"true")}),n&&typeof n.entries=="function"){const r=n.entries();if(r&&typeof r[Symbol.iterator]=="function")return JSON.parse(JSON.stringify(Object.fromEntries(r)))||{}}return{}},Gt=({fields:e,addressId:n,countryOptions:s,disableField:r,regionOptions:d,isRequiredRegion:o,isRequiredPostCode:i})=>e.filter(f=>!(n&&(f.customUpperCode==="defaultShipping"||f.customUpperCode==="defaultBilling")&&f.defaultValue)).map(f=>f.customUpperCode==="countryCode"?{...f,options:s,disabled:r}:f.customUpperCode==="postcode"?{...f,required:i}:f.customUpperCode==="region"?{...f,options:d,required:o,disabled:r}:f),Jt=(e,n="address")=>{const s=n==="address"?["region","city","company","countryCode","countryId","defaultBilling","defaultShipping","fax","firstName","lastName","middleName","postcode","prefix","street","suffix","telephone","vatId","addressId"]:["email","firstName","lastName","middleName","gender","dob","prefix","suffix","fax"],r={},d=[];return Object.keys(e).forEach(o=>{s.includes(o)?r[o]=e[o]:d.push({attribute_code:qe(o),value:e[o]})}),d.length>0&&(r.custom_attributesV2=d),r},Re=e=>{const n=["street","streetMultiline_1","streetMultiline_2"],s=["on","off","true","false"],r=[],d={};for(const y in e){const T=e[y];s.includes(T)&&(d[y]=We(T)),n.includes(y)&&r.push(T)}const{street:o,streetMultiline_2:i,streetMultiline_1:l,region:f,...c}=e,[p,b]=f?f.split(","):[void 0,void 0],S=b&&p?{regionId:+b,regionCode:p}:{region:p};return Jt({...c,...d,region:{...S},street:r})},Kt=(e,n)=>{const s={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const d=e[r];if(r==="region"&&d.regionId){const o=n.find(i=>(i==null?void 0:i.id)===d.regionId);o?s[r]={...d,text:o.text}:s[r]=d}else Array.isArray(d)?(s[r]=d[0]||"",d.slice(1).forEach((o,i)=>{s[`${r}Multiline_${i+2}`]=o})):s[r]=d}return s},Xt=(e,n)=>e&&Object.keys(e).length>0?e:n&&Object.keys(n).length>0?n:{},Yt=({showFormLoader:e,showSaveCheckBox:n,saveCheckBoxValue:s,addressFormId:r,billingCheckBoxValue:d,shippingCheckBoxValue:o,showShippingCheckBox:i,showBillingCheckBox:l,inputsDefaultValueSet:f,onCloseBtnClick:c,onSuccess:p,onError:b,formName:S})=>{const[v,y]=B({text:"",type:"success"}),[T,Z]=B(e??!1),[t,h]=B(r||""),[A,N]=B([]),[C,H]=B(null),[m,I]=B(()=>{var R,V;const g=sessionStorage.getItem(`${S}_addressData`);return g?{countryCode:(V=(R=JSON.parse(g))==null?void 0:R.data)==null?void 0:V.countryCode}:f}),[z,E]=B(!1),[k,W]=B(()=>{var V,J;const g=sessionStorage.getItem(`${S}_addressData`);return g?(J=(V=JSON.parse(g))==null?void 0:V.data)==null?void 0:J.saveAddressBook:s}),u=U(g=>{W(g.target.checked)},[]);ee(()=>{typeof e>"u"||Z(e)},[e]),ee(()=>{je(t?"customer_address_edit":"customer_register_address").then(g=>{N(g)})},[t]),ee(()=>{E(!0),ut().then(({availableCountries:g,countriesWithRequiredRegion:R,optionalZipCountries:V})=>{H({availableCountries:g,countriesWithRequiredRegion:R,optionalZipCountries:V}),E(!1)})},[]);const $=oe(()=>(C==null?void 0:C.availableCountries)||[],[C]),M=oe(()=>!(m!=null&&m.countryCode)||!C?!1:C.countriesWithRequiredRegion.includes(m.countryCode),[m==null?void 0:m.countryCode,C]),F=oe(()=>!(m!=null&&m.countryCode)||!C?!0:!C.optionalZipCountries.includes(m.countryCode),[m==null?void 0:m.countryCode,C]),x=oe(()=>{var R;if(!(m!=null&&m.countryCode)||!C)return[];const g=C.availableCountries.find(V=>V.value===m.countryCode);return((R=g==null?void 0:g.availableRegions)==null?void 0:R.map(V=>({text:V.name,value:`${V.code},${V.id}`})))||[]},[m==null?void 0:m.countryCode,C]),q=U(()=>{y({text:"",type:"success"}),c==null||c()},[c]),_=U(async(g,R)=>{if(!R)return null;Z(!0);const V=He(g.target),J=Re(V);await Ce(J).then(()=>{var Y;p==null||p(),c==null||c(),(Y=g==null?void 0:g.target)==null||Y.reset()}).catch(Y=>{y(X=>({...X,text:Y.message,type:"error"})),b==null||b(Y)}).finally(()=>{h(""),Z(!1)})},[c,b,p]),L=U(async(g,R)=>{if(!R)return;Z(!0);const{saveAddressBook:V,...J}=He(g.target),Y=Re(J);await pt(Y).then(()=>{var X;p==null||p(),c==null||c(),(X=g==null?void 0:g.target)==null||X.reset()}).catch(X=>{y(ie=>({...ie,text:X.message,type:"error"})),b==null||b(X)}).finally(()=>{h(""),Z(!1)})},[c,b,p]),O=oe(()=>{if(!A.length)return[];const g={...jt,defaultValue:o??!1,isHidden:n&&!k?!0:!i},R={...Wt,defaultValue:d??!1,isHidden:n&&!k?!0:!l},V=[...A,g,R],J=sessionStorage.getItem(`${S}_addressData`),Y=J?Kt(JSON.parse(J).data,x):{},X=Pt(Xt(Y,f),V);return Gt({fields:X,addressId:t,countryOptions:$,disableField:z,regionOptions:x,isRequiredRegion:M,isRequiredPostCode:F})},[A,o,n,k,i,d,l,S,x,f,t,$,z,M,F]),w=U(g=>{I(R=>({...R,...g}))},[]);return{regionOptions:x,saveCheckBoxAddress:k,inLineAlert:v,addressId:t,submitLoading:T,normalizeFieldsConfig:O,handleSaveCheckBoxAddress:u,handleUpdateAddress:_,handleCreateAddress:L,handleOnCloseForm:q,handleInputChange:w}},Qt=e=>{var d;if(!e||!Array.isArray(e.customAttributes))return e??{};const n={};(d=e==null?void 0:e.customAttributes)==null||d.forEach(o=>{o.code&&Object.hasOwn(o,"value")&&(n[o.code]=o.value)});const{customAttributes:s,...r}=e;return{...r,...Ue(n,"camelCase",{})}},Dt=({hideActionFormButtons:e,formName:n="",showFormLoader:s=!1,showSaveCheckBox:r=!1,saveCheckBoxValue:d=!1,forwardFormRef:o,slots:i,addressesFormTitle:l,className:f,addressFormId:c,inputsDefaultValueSet:p,showShippingCheckBox:b=!0,showBillingCheckBox:S=!0,shippingCheckBoxValue:v=!0,billingCheckBoxValue:y=!0,isOpen:T,fieldIdPrefix:Z,onSubmit:t,onCloseBtnClick:h,onSuccess:A,onError:N,onChange:C})=>{const H=re({secondaryButton:"Account.AddressForm.formText.secondaryButton",primaryButton:"Account.AddressForm.formText.primaryButton",saveAddressBook:"Account.AddressForm.formText.saveAddressBook"}),{inLineAlert:m,addressId:I,submitLoading:z,normalizeFieldsConfig:E,handleUpdateAddress:k,handleCreateAddress:W,handleOnCloseForm:u,handleSaveCheckBoxAddress:$,saveCheckBoxAddress:M,handleInputChange:F,regionOptions:x}=Yt({showFormLoader:s,addressFormId:c,inputsDefaultValueSet:Qt(p),shippingCheckBoxValue:v,billingCheckBoxValue:y,showShippingCheckBox:b,showBillingCheckBox:S,saveCheckBoxValue:d,showSaveCheckBox:r,onSuccess:A,onError:N,onCloseBtnClick:h,formName:n}),[q,_]=B(0);return ee(()=>{_(L=>L+1)},[p]),T?j("div",{className:K(["account-address-form-wrapper",f]),children:[l?a("div",{className:"account-address-form-wrapper__title","data-testid":"addressesFormTitle",children:l}):null,m.text?a(ot,{"data-testid":"inLineAlert",className:"account-address-form-wrapper__notification",type:m.type,variant:"secondary",heading:m.text,icon:m.icon}):null,j(Bt,{regionOptions:x,forwardFormRef:o,slots:i,className:"account-address-form",name:n||"addressesForm",fieldsConfig:E,onSubmit:t||(I?k:W),setInputChange:F,loading:z,showFormLoader:s,showSaveCheckBox:r,handleSaveCheckBoxAddress:$,saveCheckBoxAddress:M,onChange:C,fieldIdPrefix:Z,children:[I?a("input",{type:"hidden",name:"addressId",value:I,"data-testid":"hidden_test_id"}):null,e?null:a("div",{className:K(["dropin-field account-address-form-wrapper__buttons",["account-address-form-wrapper__buttons--empty",r]]),children:i!=null&&i.AddressFormActions?a(he,{"data-testid":"addressFormActions",name:"AddressFormActions",slot:i.AddressFormActions,context:{handleUpdateAddress:k,handleCreateAddress:W,addressId:I}}):a(D,{children:r?null:j(D,{children:[a(de,{type:"button",onClick:u,variant:"secondary",disabled:z,children:H.secondaryButton}),a(de,{disabled:z,children:H.primaryButton})]})})})]},q)]}):null};export{fe as A,Ge as C,zt as E,Bt as F,Ht as S,cr as a,Pe as c,ir as d,He as g,Jt as n};
|
|
4
4
|
//# sourceMappingURL=AddressValidation.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{t as
|
|
3
|
+
import{t as H,f as Y,a as j}from"./removeCustomerAddress.js";import{c as J}from"./initialize.js";import"@dropins/tools/event-bus.js";import{merge as K}from"@dropins/tools/lib.js";import{ADDRESS_FRAGMENT as Q,ORDER_SUMMARY_FRAGMENT as B}from"../fragments.js";const V=(a,t="en-US",s={})=>{const d={...{day:"2-digit",month:"2-digit",year:"numeric"},...s},u=new Date(a);return isNaN(u.getTime())?"Invalid Date":new Intl.DateTimeFormat(t,d).format(u)},c={value:0,currency:"USD"},W=a=>{var t,s,_,d,u,g,l,f,p,n;return{subtotal:((t=a==null?void 0:a.total)==null?void 0:t.subtotal)??c,grandTotal:((s=a==null?void 0:a.total)==null?void 0:s.grand_total)??c,grandTotalExclTax:((_=a==null?void 0:a.total)==null?void 0:_.grand_total_excl_tax)??c,totalGiftcard:((d=a==null?void 0:a.total)==null?void 0:d.total_giftcard)??c,subtotalExclTax:((u=a==null?void 0:a.total)==null?void 0:u.subtotal_excl_tax)??c,subtotalInclTax:((g=a==null?void 0:a.total)==null?void 0:g.subtotal_incl_tax)??c,taxes:((l=a==null?void 0:a.total)==null?void 0:l.taxes)??[],totalTax:((f=a==null?void 0:a.total)==null?void 0:f.total_tax)??c,totalShipping:((p=a==null?void 0:a.total)==null?void 0:p.total_shipping)??c,discounts:((n=a==null?void 0:a.total)==null?void 0:n.discounts)??[]}},X=a=>{var d,u,g,l,f,p,n,h,S,y,T,E,R,O,D,b,A,x,M,I,k,N,q,G,$,C,v,F,i,z;if(!((u=(d=a.data)==null?void 0:d.customer)!=null&&u.orders))return null;const t=((l=(g=a==null?void 0:a.data)==null?void 0:g.customer)==null?void 0:l.returns)??[],_={items:(((n=(p=(f=a==null?void 0:a.data)==null?void 0:f.customer)==null?void 0:p.orders)==null?void 0:n.items)??[]).map(r=>{var L;return{items:r==null?void 0:r.items.map(o=>{var P,U,w;return{status:(o==null?void 0:o.status)??"",productName:(o==null?void 0:o.product_name)??"",id:o==null?void 0:o.id,quantityOrdered:(o==null?void 0:o.quantity_ordered)??0,quantityShipped:(o==null?void 0:o.quantity_shipped)??0,quantityInvoiced:(o==null?void 0:o.quantity_invoiced)??0,sku:(o==null?void 0:o.product_sku)??"",urlKey:(o==null?void 0:o.product_url_key)??"",topLevelSku:((P=o==null?void 0:o.product)==null?void 0:P.sku)??"",product:{smallImage:{url:((w=(U=o==null?void 0:o.product)==null?void 0:U.small_image)==null?void 0:w.url)??""}}}}),token:r==null?void 0:r.token,email:r==null?void 0:r.email,shippingMethod:r==null?void 0:r.shipping_method,paymentMethods:(r==null?void 0:r.payment_methods)??[],shipments:(r==null?void 0:r.shipments)??[],id:r==null?void 0:r.id,carrier:r==null?void 0:r.carrier,status:r==null?void 0:r.status,number:r==null?void 0:r.number,returns:(L=t==null?void 0:t.items)==null?void 0:L.filter(o=>o.order.id===r.id),orderDate:V(r.order_date),shippingAddress:H(r.shipping_address),billingAddress:H(r.billing_address),total:W(r)}}),pageInfo:{pageSize:((T=(y=(S=(h=a==null?void 0:a.data)==null?void 0:h.customer)==null?void 0:S.orders)==null?void 0:y.page_info)==null?void 0:T.page_size)??10,totalPages:((D=(O=(R=(E=a==null?void 0:a.data)==null?void 0:E.customer)==null?void 0:R.orders)==null?void 0:O.page_info)==null?void 0:D.total_pages)??1,currentPage:((M=(x=(A=(b=a==null?void 0:a.data)==null?void 0:b.customer)==null?void 0:A.orders)==null?void 0:x.page_info)==null?void 0:M.current_page)??1},totalCount:((N=(k=(I=a==null?void 0:a.data)==null?void 0:I.customer)==null?void 0:k.orders)==null?void 0:N.total_count)??0,dateOfFirstOrder:(($=(G=(q=a==null?void 0:a.data)==null?void 0:q.customer)==null?void 0:G.orders)==null?void 0:$.date_of_first_order)??""};return K(_,(z=(i=(F=(v=(C=J)==null?void 0:C.getConfig())==null?void 0:v.models)==null?void 0:F.OrderHistoryModel)==null?void 0:i.transformer)==null?void 0:z.call(i,a.data))},Z=`
|
|
4
4
|
query GET_CUSTOMER_ORDERS_LIST(
|
|
5
5
|
$currentPage: Int
|
|
6
6
|
$pageSize: Int
|
|
@@ -68,6 +68,7 @@ import{t as L,f as H,a as Y}from"./removeCustomerAddress.js";import{c as j}from"
|
|
|
68
68
|
product_sku
|
|
69
69
|
product_url_key
|
|
70
70
|
product {
|
|
71
|
+
sku
|
|
71
72
|
small_image {
|
|
72
73
|
url
|
|
73
74
|
}
|
|
@@ -80,7 +81,7 @@ import{t as L,f as H,a as Y}from"./removeCustomerAddress.js";import{c as j}from"
|
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
${K}
|
|
84
84
|
${Q}
|
|
85
|
-
|
|
85
|
+
${B}
|
|
86
|
+
`,m={sort_direction:"DESC",sort_field:"CREATED_AT"},da=async(a,t,s)=>{const _=t.includes("viewAll")?{}:{order_date:JSON.parse(t)};return await Y(Z,{method:"GET",cache:"no-cache",variables:{pageSize:a,currentPage:s,filter:_,sort:m}}).then(d=>X(d)).catch(j)};export{da as g};
|
|
86
87
|
//# sourceMappingURL=getOrderHistoryList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOrderHistoryList.js","sources":["/@dropins/storefront-account/src/lib/formatDateToLocale.ts","/@dropins/storefront-account/src/data/transforms/transform-order-history-list.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/getOrderHistoryList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Formats a date string according to a specified locale and options.\n * Returns \"Invalid Date\" if the input date string is invalid.\n *\n * @param {string} date - The date string to be formatted.\n * @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.\n * @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.\n * @returns {string} The formatted date string, or \"Invalid Date\" if the input is invalid.\n *\n * @example\n * // Default formatting (en-US locale, MM/DD/YYYY)\n * console.log(formatDateToLocale('2023-08-29'));\n * // Output: \"08/29/2023\"\n *\n * @example\n * // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)\n * console.log(formatDateToLocale('2023-08-29', 'en-GB'));\n * // Output: \"29/08/2023\"\n *\n * @example\n * // Formatting with a specified locale and custom options (e.g., de-DE with long month format)\n * console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));\n * // Output: \"29. August 2023\"\n *\n * @example\n * // Handling an invalid date string\n * console.log(formatDateToLocale('invalid-date'));\n * // Output: \"Invalid Date\"\n */\nexport const formatDateToLocale = (\n date: string,\n locale: string = 'en-US',\n options: Intl.DateTimeFormatOptions = {}\n): string => {\n const defaultOptions: Intl.DateTimeFormatOptions = {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n };\n const formatOptions: Intl.DateTimeFormatOptions = {\n ...defaultOptions,\n ...options,\n };\n\n const dateObj = new Date(date);\n\n if (isNaN(dateObj.getTime())) {\n return 'Invalid Date';\n }\n\n const formatter = new Intl.DateTimeFormat(locale, formatOptions);\n return formatter.format(dateObj);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n OrderHistoryListResponse, OrderItemProps,\n OrderProps,\n ReturnProps,\n} from '@/account/types';\nimport { OrderHistoryModel } from '@/account/data/models';\nimport { transformSingleAddress } from '@/account/data/transforms/transform-customer-address';\nimport { formatDateToLocale } from '@/account/lib/formatDateToLocale';\nimport { config } from '@/account/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\n\nconst initialMoneyProps = {\n value: 0,\n currency: 'USD',\n};\n\nconst transformOrderHistoryTotal = (item: any) => {\n return {\n subtotal: item?.total?.subtotal ?? initialMoneyProps,\n grandTotal: item?.total?.grand_total ?? initialMoneyProps,\n grandTotalExclTax: item?.total?.grand_total_excl_tax ?? initialMoneyProps,\n totalGiftcard: item?.total?.total_giftcard ?? initialMoneyProps,\n subtotalExclTax: item?.total?.subtotal_excl_tax ?? initialMoneyProps,\n subtotalInclTax: item?.total?.subtotal_incl_tax ?? initialMoneyProps,\n taxes: item?.total?.taxes ?? [],\n totalTax: item?.total?.total_tax ?? initialMoneyProps,\n totalShipping: item?.total?.total_shipping ?? initialMoneyProps,\n discounts: item?.total?.discounts ?? [],\n };\n};\n\nexport const transformOrderHistoryList = (\n response: OrderHistoryListResponse\n): OrderHistoryModel | null => {\n if (!response.data?.customer?.orders) return null;\n\n const returns = response?.data?.customer?.returns ?? [];\n const items = response?.data?.customer?.orders?.items ?? [];\n\n const model = {\n items: items.map((item: OrderProps) => {\n return {\n items: item?.items.map((element: OrderItemProps) => ({\n status: element?.status ?? '',\n productName: element?.product_name ?? '',\n id: element?.id,\n quantityOrdered: element?.quantity_ordered ?? 0,\n quantityShipped: element?.quantity_shipped ?? 0,\n quantityInvoiced: element?.quantity_invoiced ?? 0,\n sku: element?.product_sku ?? '',\n urlKey: element?.product_url_key ?? '',\n product: {\n smallImage: {\n url: element?.product?.small_image?.url ?? '',\n },\n },\n })),\n token: item?.token,\n email: item?.email,\n shippingMethod: item?.shipping_method,\n paymentMethods: item?.payment_methods ?? [],\n shipments: item?.shipments ?? [],\n id: item?.id,\n carrier: item?.carrier,\n status: item?.status,\n number: item?.number,\n returns: returns?.items?.filter(\n (returnItem: ReturnProps) => returnItem.order.id === item.id\n ),\n orderDate: formatDateToLocale(item.order_date),\n shippingAddress: transformSingleAddress(item.shipping_address),\n billingAddress: transformSingleAddress(item.billing_address),\n total: transformOrderHistoryTotal(item),\n };\n }),\n pageInfo: {\n pageSize: response?.data?.customer?.orders?.page_info?.page_size ?? 10,\n totalPages: response?.data?.customer?.orders?.page_info?.total_pages ?? 1,\n currentPage:\n response?.data?.customer?.orders?.page_info?.current_page ?? 1,\n },\n totalCount: response?.data?.customer?.orders?.total_count ?? 0,\n dateOfFirstOrder:\n response?.data?.customer?.orders?.date_of_first_order ?? '',\n };\n\n return merge(\n model, // default transformer\n config?.getConfig()?.models?.OrderHistoryModel?.transformer?.(response.data) // custom transformer\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n ADDRESS_FRAGMENT,\n ORDER_SUMMARY_FRAGMENT,\n} from '@/account/api/fragments';\n\nexport const GET_CUSTOMER_ORDERS_LIST = /* GraphQL */ `\n query GET_CUSTOMER_ORDERS_LIST(\n $currentPage: Int\n $pageSize: Int\n $filter: CustomerOrdersFilterInput\n $sort: CustomerOrderSortInput\n ) {\n customer {\n returns {\n items {\n uid\n number\n order {\n id\n }\n }\n }\n orders(\n currentPage: $currentPage\n pageSize: $pageSize\n filter: $filter\n sort: $sort\n ) {\n page_info {\n page_size\n total_pages\n current_page\n }\n date_of_first_order\n total_count\n items {\n token\n email\n shipping_method\n payment_methods {\n name\n type\n }\n shipping_address {\n ...ADDRESS_FRAGMENT\n }\n billing_address {\n ...ADDRESS_FRAGMENT\n }\n shipments {\n id\n number\n tracking {\n title\n number\n carrier\n }\n }\n number\n id\n order_date\n carrier\n status\n items {\n status\n product_name\n id\n quantity_ordered\n quantity_shipped\n quantity_invoiced\n product_sku\n product_url_key\n product {\n small_image {\n url\n }\n }\n }\n total {\n ...ORDER_SUMMARY_FRAGMENT\n }\n }\n }\n }\n }\n ${ADDRESS_FRAGMENT}\n ${ORDER_SUMMARY_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/account/api';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { GET_CUSTOMER_ORDERS_LIST } from './graphql/getOrderHistoryList.graphql';\nimport { OrderHistoryListResponse } from '@/account/types';\nimport { transformOrderHistoryList } from '@/account/data/transforms';\nimport { OrderHistoryModel } from '@/account/data/models';\n\nconst SORT_DIRECTION = { sort_direction: 'DESC', sort_field: 'CREATED_AT' };\n\nexport const getOrderHistoryList = async (\n pageSize: number,\n selectOrdersDate: string,\n currentPage: number\n): Promise<OrderHistoryModel | null> => {\n const filterOrderDate = !selectOrdersDate.includes('viewAll')\n ? {\n order_date: JSON.parse(selectOrdersDate),\n }\n : {};\n\n return await fetchGraphQl(GET_CUSTOMER_ORDERS_LIST, {\n method: 'GET',\n cache: 'no-cache',\n variables: {\n pageSize,\n currentPage,\n filter: filterOrderDate,\n sort: SORT_DIRECTION,\n },\n })\n .then((response: OrderHistoryListResponse) => {\n return transformOrderHistoryList(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["formatDateToLocale","date","locale","options","formatOptions","dateObj","initialMoneyProps","transformOrderHistoryTotal","item","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","transformOrderHistoryList","response","returns","model","element","returnItem","transformSingleAddress","_k","_o","_n","_m","_l","_s","_r","_q","_p","_v","_u","_t","_y","_x","_w","merge","_D","_C","_B","_A","_z","config","GET_CUSTOMER_ORDERS_LIST","ADDRESS_FRAGMENT","ORDER_SUMMARY_FRAGMENT","SORT_DIRECTION","getOrderHistoryList","pageSize","selectOrdersDate","currentPage","filterOrderDate","fetchGraphQl","handleNetworkError"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"getOrderHistoryList.js","sources":["/@dropins/storefront-account/src/lib/formatDateToLocale.ts","/@dropins/storefront-account/src/data/transforms/transform-order-history-list.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/graphql/getOrderHistoryList.graphql.ts","/@dropins/storefront-account/src/api/getOrderHistoryList/getOrderHistoryList.ts"],"sourcesContent":["/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\n/**\n * Formats a date string according to a specified locale and options.\n * Returns \"Invalid Date\" if the input date string is invalid.\n *\n * @param {string} date - The date string to be formatted.\n * @param {string} [locale='en-US'] - The locale to use for formatting. Defaults to 'en-US'.\n * @param {Intl.DateTimeFormatOptions} [options={}] - Optional formatting options to customize the output.\n * @returns {string} The formatted date string, or \"Invalid Date\" if the input is invalid.\n *\n * @example\n * // Default formatting (en-US locale, MM/DD/YYYY)\n * console.log(formatDateToLocale('2023-08-29'));\n * // Output: \"08/29/2023\"\n *\n * @example\n * // Formatting with a specified locale (e.g., en-GB for DD/MM/YYYY)\n * console.log(formatDateToLocale('2023-08-29', 'en-GB'));\n * // Output: \"29/08/2023\"\n *\n * @example\n * // Formatting with a specified locale and custom options (e.g., de-DE with long month format)\n * console.log(formatDateToLocale('2023-08-29', 'de-DE', { month: 'long', year: 'numeric' }));\n * // Output: \"29. August 2023\"\n *\n * @example\n * // Handling an invalid date string\n * console.log(formatDateToLocale('invalid-date'));\n * // Output: \"Invalid Date\"\n */\nexport const formatDateToLocale = (\n date: string,\n locale: string = 'en-US',\n options: Intl.DateTimeFormatOptions = {}\n): string => {\n const defaultOptions: Intl.DateTimeFormatOptions = {\n day: '2-digit',\n month: '2-digit',\n year: 'numeric',\n };\n const formatOptions: Intl.DateTimeFormatOptions = {\n ...defaultOptions,\n ...options,\n };\n\n const dateObj = new Date(date);\n\n if (isNaN(dateObj.getTime())) {\n return 'Invalid Date';\n }\n\n const formatter = new Intl.DateTimeFormat(locale, formatOptions);\n return formatter.format(dateObj);\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n OrderHistoryListResponse, OrderItemProps,\n OrderProps,\n ReturnProps,\n} from '@/account/types';\nimport { OrderHistoryModel } from '@/account/data/models';\nimport { transformSingleAddress } from '@/account/data/transforms/transform-customer-address';\nimport { formatDateToLocale } from '@/account/lib/formatDateToLocale';\nimport { config } from '@/account/api';\nimport { merge } from '@adobe-commerce/elsie/lib';\n\nconst initialMoneyProps = {\n value: 0,\n currency: 'USD',\n};\n\nconst transformOrderHistoryTotal = (item: any) => {\n return {\n subtotal: item?.total?.subtotal ?? initialMoneyProps,\n grandTotal: item?.total?.grand_total ?? initialMoneyProps,\n grandTotalExclTax: item?.total?.grand_total_excl_tax ?? initialMoneyProps,\n totalGiftcard: item?.total?.total_giftcard ?? initialMoneyProps,\n subtotalExclTax: item?.total?.subtotal_excl_tax ?? initialMoneyProps,\n subtotalInclTax: item?.total?.subtotal_incl_tax ?? initialMoneyProps,\n taxes: item?.total?.taxes ?? [],\n totalTax: item?.total?.total_tax ?? initialMoneyProps,\n totalShipping: item?.total?.total_shipping ?? initialMoneyProps,\n discounts: item?.total?.discounts ?? [],\n };\n};\n\nexport const transformOrderHistoryList = (\n response: OrderHistoryListResponse\n): OrderHistoryModel | null => {\n if (!response.data?.customer?.orders) return null;\n\n const returns = response?.data?.customer?.returns ?? [];\n const items = response?.data?.customer?.orders?.items ?? [];\n\n const model = {\n items: items.map((item: OrderProps) => {\n return {\n items: item?.items.map((element: OrderItemProps) => ({\n status: element?.status ?? '',\n productName: element?.product_name ?? '',\n id: element?.id,\n quantityOrdered: element?.quantity_ordered ?? 0,\n quantityShipped: element?.quantity_shipped ?? 0,\n quantityInvoiced: element?.quantity_invoiced ?? 0,\n sku: element?.product_sku ?? '',\n urlKey: element?.product_url_key ?? '',\n topLevelSku: element?.product?.sku ?? '',\n product: {\n smallImage: {\n url: element?.product?.small_image?.url ?? '',\n },\n },\n })),\n token: item?.token,\n email: item?.email,\n shippingMethod: item?.shipping_method,\n paymentMethods: item?.payment_methods ?? [],\n shipments: item?.shipments ?? [],\n id: item?.id,\n carrier: item?.carrier,\n status: item?.status,\n number: item?.number,\n returns: returns?.items?.filter(\n (returnItem: ReturnProps) => returnItem.order.id === item.id\n ),\n orderDate: formatDateToLocale(item.order_date),\n shippingAddress: transformSingleAddress(item.shipping_address),\n billingAddress: transformSingleAddress(item.billing_address),\n total: transformOrderHistoryTotal(item),\n };\n }),\n pageInfo: {\n pageSize: response?.data?.customer?.orders?.page_info?.page_size ?? 10,\n totalPages: response?.data?.customer?.orders?.page_info?.total_pages ?? 1,\n currentPage:\n response?.data?.customer?.orders?.page_info?.current_page ?? 1,\n },\n totalCount: response?.data?.customer?.orders?.total_count ?? 0,\n dateOfFirstOrder:\n response?.data?.customer?.orders?.date_of_first_order ?? '',\n };\n\n return merge(\n model, // default transformer\n config?.getConfig()?.models?.OrderHistoryModel?.transformer?.(response.data) // custom transformer\n );\n};\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport {\n ADDRESS_FRAGMENT,\n ORDER_SUMMARY_FRAGMENT,\n} from '@/account/api/fragments';\n\nexport const GET_CUSTOMER_ORDERS_LIST = /* GraphQL */ `\n query GET_CUSTOMER_ORDERS_LIST(\n $currentPage: Int\n $pageSize: Int\n $filter: CustomerOrdersFilterInput\n $sort: CustomerOrderSortInput\n ) {\n customer {\n returns {\n items {\n uid\n number\n order {\n id\n }\n }\n }\n orders(\n currentPage: $currentPage\n pageSize: $pageSize\n filter: $filter\n sort: $sort\n ) {\n page_info {\n page_size\n total_pages\n current_page\n }\n date_of_first_order\n total_count\n items {\n token\n email\n shipping_method\n payment_methods {\n name\n type\n }\n shipping_address {\n ...ADDRESS_FRAGMENT\n }\n billing_address {\n ...ADDRESS_FRAGMENT\n }\n shipments {\n id\n number\n tracking {\n title\n number\n carrier\n }\n }\n number\n id\n order_date\n carrier\n status\n items {\n status\n product_name\n id\n quantity_ordered\n quantity_shipped\n quantity_invoiced\n product_sku\n product_url_key\n product {\n sku\n small_image {\n url\n }\n }\n }\n total {\n ...ORDER_SUMMARY_FRAGMENT\n }\n }\n }\n }\n }\n ${ADDRESS_FRAGMENT}\n ${ORDER_SUMMARY_FRAGMENT}\n`;\n","/********************************************************************\n * ADOBE CONFIDENTIAL\n * __________________\n *\n * Copyright 2024 Adobe\n * All Rights Reserved.\n *\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n *******************************************************************/\n\nimport { fetchGraphQl } from '@/account/api';\nimport { handleNetworkError } from '@/account/lib/network-error';\nimport { GET_CUSTOMER_ORDERS_LIST } from './graphql/getOrderHistoryList.graphql';\nimport { OrderHistoryListResponse } from '@/account/types';\nimport { transformOrderHistoryList } from '@/account/data/transforms';\nimport { OrderHistoryModel } from '@/account/data/models';\n\nconst SORT_DIRECTION = { sort_direction: 'DESC', sort_field: 'CREATED_AT' };\n\nexport const getOrderHistoryList = async (\n pageSize: number,\n selectOrdersDate: string,\n currentPage: number\n): Promise<OrderHistoryModel | null> => {\n const filterOrderDate = !selectOrdersDate.includes('viewAll')\n ? {\n order_date: JSON.parse(selectOrdersDate),\n }\n : {};\n\n return await fetchGraphQl(GET_CUSTOMER_ORDERS_LIST, {\n method: 'GET',\n cache: 'no-cache',\n variables: {\n pageSize,\n currentPage,\n filter: filterOrderDate,\n sort: SORT_DIRECTION,\n },\n })\n .then((response: OrderHistoryListResponse) => {\n return transformOrderHistoryList(response);\n })\n .catch(handleNetworkError);\n};\n"],"names":["formatDateToLocale","date","locale","options","formatOptions","dateObj","initialMoneyProps","transformOrderHistoryTotal","item","_a","_b","_c","_d","_e","_f","_g","_h","_i","_j","transformOrderHistoryList","response","returns","model","element","returnItem","transformSingleAddress","_k","_o","_n","_m","_l","_s","_r","_q","_p","_v","_u","_t","_y","_x","_w","merge","_D","_C","_B","_A","_z","config","GET_CUSTOMER_ORDERS_LIST","ADDRESS_FRAGMENT","ORDER_SUMMARY_FRAGMENT","SORT_DIRECTION","getOrderHistoryList","pageSize","selectOrdersDate","currentPage","filterOrderDate","fetchGraphQl","handleNetworkError"],"mappings":"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"}
|
package/chunks/getStoreConfig.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{f as e,h as m,a as u}from"./removeCustomerAddress.js";const f=t=>{var a,r,c,_,i,o,d,h;return{baseMediaUrl:(r=(a=t==null?void 0:t.data)==null?void 0:a.storeConfig)==null?void 0:r.base_media_url,minLength:+((_=(c=t==null?void 0:t.data)==null?void 0:c.storeConfig)==null?void 0:_.minimum_password_length)||3,requiredCharacterClasses:+((o=(i=t==null?void 0:t.data)==null?void 0:i.storeConfig)==null?void 0:o.required_character_classes_number)||0,storeCode:((h=(d=t==null?void 0:t.data)==null?void 0:d.storeConfig)==null?void 0:h.store_code)??""}},g=`
|
|
4
4
|
query GET_STORE_CONFIG {
|
package/chunks/initialize.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{Initializer as o}from"@dropins/tools/lib.js";const i=new o({init:async n=>{const e={authHeaderConfig:{header:"Authorization",tokenPrefix:"Bearer"}};i.config.setConfig({...e,...n})},listeners:()=>[]}),a=i.config;export{a as c,i};
|
|
4
4
|
//# sourceMappingURL=initialize.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{events as E}from"@dropins/tools/event-bus.js";import{FetchGraphQL as C}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:j,setFetchGraphQlHeader:k,removeFetchGraphQlHeader:L,setFetchGraphQlHeaders:P,fetchGraphQl:s,getConfig:J}=new C().getMethods(),S=`
|
|
4
4
|
query GET_ATTRIBUTES_FORM($formCode: String!) {
|
package/chunks/updateCustomer.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{l as n,f as C,h as o,a as h,m as x}from"./removeCustomerAddress.js";import{BASIC_CUSTOMER_INFO_FRAGMENT as F}from"../fragments.js";import{c as V}from"./initialize.js";import"@dropins/tools/event-bus.js";import{merge as B}from"@dropins/tools/lib.js";const L=t=>{var r,u,i,d,_,f,E,S,T,w,e,g,O,P,A,M,U,R,b,N,$,G,v,D,c,I;const m=(i=(u=(r=t==null?void 0:t.data)==null?void 0:r.customer)==null?void 0:u.custom_attributes)==null?void 0:i.filter(l=>l).reduce((l,y)=>(l[n(y.code)]=y.value??"",l),{}),a={email:((_=(d=t==null?void 0:t.data)==null?void 0:d.customer)==null?void 0:_.email)||"",firstName:((E=(f=t==null?void 0:t.data)==null?void 0:f.customer)==null?void 0:E.firstname)||"",lastName:((T=(S=t==null?void 0:t.data)==null?void 0:S.customer)==null?void 0:T.lastname)||"",middleName:((e=(w=t==null?void 0:t.data)==null?void 0:w.customer)==null?void 0:e.middlename)||"",gender:((O=(g=t==null?void 0:t.data)==null?void 0:g.customer)==null?void 0:O.gender)||"1",dateOfBirth:((A=(P=t==null?void 0:t.data)==null?void 0:P.customer)==null?void 0:A.date_of_birth)||"",prefix:((U=(M=t==null?void 0:t.data)==null?void 0:M.customer)==null?void 0:U.prefix)||"",suffix:((b=(R=t==null?void 0:t.data)==null?void 0:R.customer)==null?void 0:b.suffix)||"",createdAt:(($=(N=t==null?void 0:t.data)==null?void 0:N.customer)==null?void 0:$.created_at)||"",...m};return B(a,(I=(c=(D=(v=(G=V)==null?void 0:G.getConfig())==null?void 0:v.models)==null?void 0:D.CustomerDataModelShort)==null?void 0:c.transformer)==null?void 0:I.call(c,t.data))},k=`
|
|
4
4
|
query GET_CUSTOMER {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{A as l,A as u}from"../chunks/AddressValidation.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/preact.js";export{l as AddressForm,u as default};
|
|
4
4
|
//# sourceMappingURL=AddressForm.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as m,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{useState as f,useMemo as _,useCallback as h,useEffect as y}from"@dropins/tools/preact-hooks.js";import{classes as v}from"@dropins/tools/lib.js";import"../chunks/AddressValidation.js";import"@dropins/tools/preact-compat.js";import{Header as N,ToggleButton as $}from"@dropins/tools/components.js";import"@dropins/tools/event-bus.js";import{useText as b}from"@dropins/tools/i18n.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact.js";function A(i){if(!i)return[];const l=`${i.firstName} ${i.lastName}`.trim(),o=i.street??"",s=i.city??"",t=i.region||void 0,a=i.postcode??"",c=i.countryCode??"";let e="";s&&t?e=`${s}, ${(t==null?void 0:t.regionCode)??""}`.trim():s?e=s:t&&(e=(t==null?void 0:t.regionCode)??"");let r=e;a&&(r=e?`${e} ${a}`:a);let d=r;return c&&(d=r?`${r}, ${c}`:c),[l,o,d]}const g=({title:i,address:l,selected:o,busy:s,onChange:t})=>{const[a,c,e]=A(l);return n("div",{className:"account-address-validation__option",children:n($,{busy:s,className:"account-address-validation__radio",label:m("div",{children:[n("div",{className:"account-address-validation__option-title",children:n("strong",{children:i})}),a&&n("div",{children:a}),c&&n("div",{children:c}),e&&n("div",{children:e})]}),name:"address-validation-choice",selected:o,value:i,onChange:t})})},C=({busy:i=!1,className:l,originalAddress:o,onSelectionChange:s,selection:t,suggestedAddress:a})=>{const c=!!a,e=b({title:"Account.AddressValidation.title",subtitle:"Account.AddressValidation.subtitle",suggestedAddress:"Account.AddressValidation.suggestedAddress",originalAddress:"Account.AddressValidation.originalAddress"});return m("div",{className:v(["account-address-validation",l]),children:[n(N,{className:"account-address-validation__title",divider:!1,title:e.title}),n("div",{className:"account-address-validation__subtitle",children:e.subtitle}),m("div",{className:v(["account-address-validation__options",i&&"account-address-validation__options--busy"]),children:[c&&n(g,{address:a,busy:i,selected:t==="suggested",title:e.suggestedAddress,onChange:()=>s("suggested")}),n(g,{address:o,busy:i,selected:t==="original",title:e.originalAddress,onChange:()=>s("original")})]})]})},M=({selectedAddress:i=null,suggestedAddress:l,originalAddress:o,handleSelectedAddress:s})=>{const[t,a]=f(i),[c,e]=f(!1),r=_(()=>!l||!o?null:{...o,...l},[o,l]),d=h(async u=>{a(u);const p=u==="suggested"?r:o;e(!0);try{await(s==null?void 0:s({selection:u,address:p}))}finally{e(!1)}},[r,o,s]);return y(()=>{t&&d(t)},[t,d]),n(C,{busy:c,originalAddress:o,selection:t,suggestedAddress:r,onSelectionChange:d})};export{M as AddressValidation,M as default};
|
|
4
4
|
//# sourceMappingURL=AddressValidation.js.map
|
package/containers/Addresses.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as o}from"@dropins/tools/preact-jsx-runtime.js";import{classes as q}from"@dropins/tools/lib.js";import{a as C}from"../chunks/AddressValidation.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";import"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/i18n.js";import"@dropins/tools/preact.js";const E=(e,r)=>e&&r?"selectedAddress":e?"selectedShippingAddress":r?"selectedBillingAddress":"default",T=({hideActionFormButtons:e,formName:r,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,forwardFormRef:u,showSaveCheckBox:c,saveCheckBoxValue:l,selectShipping:s,selectBilling:t,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,showShippingCheckBox:j,showBillingCheckBox:v,shippingCheckBoxValue:y,billingCheckBoxValue:z,onAddressData:D,routeAddressesPage:F,onSubmit:K,onSuccess:W,onError:b})=>{const h=i?"minifiedView":"fullSizeView",k=r??E(s,t);return o("div",{className:q(["account-addresses",d]),"data-testid":"addressesid",children:o(C,{inputName:k,minifiedViewKey:h,hideActionFormButtons:e,slots:m,title:a,addressFormTitle:p,defaultSelectAddressId:f,showFormLoader:n,onAddressData:D,forwardFormRef:u,selectShipping:s,selectBilling:t,showSaveCheckBox:c,saveCheckBoxValue:l,selectable:A,className:d,withHeader:w,minifiedView:i,withActionsInMinifiedView:x,withActionsInFullSizeView:N,inputsDefaultValueSet:V,billingCheckBoxValue:z,shippingCheckBoxValue:y,showBillingCheckBox:v,showShippingCheckBox:j,routeAddressesPage:F,onSubmit:K,onSuccess:W,onError:b})})};export{T as Addresses,T as default};
|
|
4
4
|
//# sourceMappingURL=Addresses.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as L,jsx as d,Fragment as he}from"@dropins/tools/preact-jsx-runtime.js";import{classes as ne,Slot as ge}from"@dropins/tools/lib.js";import{F as we,d as Ce,g as Pe,n as ee,C as pe}from"../chunks/AddressValidation.js";import*as V from"@dropins/tools/preact-compat.js";import{Card as X,Header as Q,InLineAlert as oe,InputPassword as R,Button as H}from"@dropins/tools/components.js";import{useState as m,useEffect as B,useCallback as C,useMemo as G}from"@dropins/tools/preact-hooks.js";import"@dropins/tools/event-bus.js";import{g as Ee}from"../chunks/getStoreConfig.js";import{u as be,g as Ve,b as re,a as ye}from"../chunks/updateCustomer.js";import{useText as O}from"@dropins/tools/i18n.js";import{d as Ie}from"../chunks/removeCustomerAddress.js";import"@dropins/tools/preact.js";import"../fragments.js";import"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const _e=e=>({firstName:e.firstName,lastName:e.lastName,emailAddress:(e==null?void 0:e.email)||"",accountId:(e==null?void 0:e.email)||""}),ve=e=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},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:"M6.75 12.762L10.2385 15.75L17.25 9",stroke:"currentColor"})),Le=e=>V.createElement("svg",{id:"Icon_Warning_Base",width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},V.createElement("g",{clipPath:"url(#clip0_841_1324)"},V.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.9949 2.30237L0.802734 21.6977H23.1977L11.9949 2.30237Z",stroke:"currentColor",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"}),V.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",strokeWidth:1,strokeLinecap:"round",strokeLinejoin:"round"})),V.createElement("defs",null,V.createElement("clipPath",{id:"clip0_841_1324"},V.createElement("rect",{width:24,height:21,fill:"white",transform:"translate(0 1.5)",strokeWidth:1})))),Fe=e=>V.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},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=()=>{const[e,r]=m(null);return B(()=>{const n=sessionStorage.getItem("accountStoreConfig"),t=n?JSON.parse(n):null;if(t){const{minLength:o,requiredCharacterClasses:s}=t;r({minLength:o,requiredCharacterClasses:s})}else Ee().then(o=>{if(o){const{minLength:s,requiredCharacterClasses:P}=o;sessionStorage.setItem("accountStoreConfig",JSON.stringify(o)),r({minLength:s,requiredCharacterClasses:P})}})},[]),{passwordConfigs:e}},Ae=({currentPassword:e,newPassword:r,confirmPassword:n,translations:t})=>{let o={...K};const s=!e.length&&!r.length&&!n.length,P=e.length&&r!==n;return s?(o={...o,currentPassword:t.requiredFieldError,newPassword:t.requiredFieldError,confirmPassword:t.requiredFieldError},{isValid:!1,errors:o}):e.length?r.length?n.length?P?(o={...o,currentPassword:"",newPassword:"",confirmPassword:t.passwordMismatch},{isValid:!1,errors:o}):{isValid:!0,errors:o}:(o={...o,confirmPassword:t.requiredFieldError},{isValid:!1,errors:o}):(o={...o,newPassword:t.requiredFieldError},{isValid:!1,errors:o}):(o={...o,currentPassword:t.requiredFieldError},{isValid:!1,errors:o})},ae=(e,r)=>{if(r<=1)return!0;const n=/[0-9]/.test(e)?1:0,t=/[a-z]/.test(e)?1:0,o=/[A-Z]/.test(e)?1:0,s=/[^a-zA-Z0-9\s]/.test(e)?1:0;return n+t+o+s>=r},K={currentPassword:"",newPassword:"",confirmPassword:""},Se=({passwordConfigs:e,handleSetInLineAlert:r,handleHideChangePassword:n})=>{const t=O({requiredFieldError:"Account.FormText.requiredFieldError",passwordMismatch:"Account.minifiedView.CustomerInformation.changePassword.passwordValidationMessage.passwordMismatch",incorrectCurrentPassword:"Account.minifiedView.CustomerInformation.changePassword.passwordValidationMessage.incorrectCurrentPassword",passwordUpdateMessage:"Account.minifiedView.CustomerInformation.changePassword.passwordValidationMessage.passwordUpdateMessage"}),[o,s]=m(!1),[P,u]=m(!1),[c,p]=m(""),[h,l]=m(""),[F,y]=m(""),[I,E]=m({currentPassword:"",newPassword:"",confirmPassword:""}),i=C(()=>{n(()=>{r({}),E(K)})},[n,r]),A=C(f=>{p(f),E(b=>({...b,currentPassword:f?"":t.requiredFieldError}))},[t]),w=C(f=>{l(f),E(b=>({...b,newPassword:f?"":t.requiredFieldError}))},[t]),Z=C(f=>{y(f),E(b=>({...b,confirmPassword:f?"":t.requiredFieldError}))},[t]),N=C(f=>{const{name:b,value:$}=f==null?void 0:f.target;E(_=>({..._,[b]:$?"":t.requiredFieldError}))},[t]),U=C(()=>{const{isValid:f,errors:b}=Ae({currentPassword:c,newPassword:h,confirmPassword:F,translations:t});return E(b),f},[c,h,F,t]),W=C(f=>{f.preventDefault(),u(!0);const b=(e==null?void 0:e.requiredCharacterClasses)??0,$=(e==null?void 0:e.minLength)??1;if(!U()){s(!0),u(!1);return}if(!ae(h,b)||$>(h==null?void 0:h.length)){s(!0),u(!1);return}be({currentPassword:c,newPassword:h}).then(_=>{if(!(_!=null&&_.length)){u(!1);return}p(""),l(""),y(""),E(K),s(!1),r({type:"success",text:t.passwordUpdateMessage})}).catch(_=>{_.message==="Invalid login or password."&&r({type:"error",text:t.incorrectCurrentPassword}),_.message==="The account is locked."&&r({type:"error",text:_.message})}),u(!1)},[e,U,h,c,r,t]);return{hideChangePassword:i,handleOnBlurPassword:N,handleConfirmPasswordChange:Z,handleNewPasswordChange:w,handleCurrentPasswordChange:A,mutationChangePassword:W,currentPassword:c,newPassword:h,confirmPassword:F,passwordErrors:I,submitLoading:P,isClickSubmit:o}},Te=({passwordConfigs:e,isClickSubmit:r,password:n})=>{const t=O({messageLengthPassword:"Account.minifiedView.CustomerInformation.changePassword.passwordValidationMessage.messageLengthPassword"}),[o,s]=m("pending");B(()=>{if(!e)return;const u=ae(n,e.requiredCharacterClasses);r&&n.length>0?s(u?"success":"error"):r&&n.length===0?s("pending"):s(u?"success":"pending")},[r,e,n]);const P=G(()=>{var c;if(!e)return;const u={status:"pending",icon:"pending",message:(c=t.messageLengthPassword)==null?void 0:c.replace("{minLength}",`${e.minLength}`)};return n.length&&n.length>=e.minLength?{...u,icon:"success",status:"success"}:n.length&&n.length<e.minLength?r?{...u,icon:"error",status:"error"}:{...u,icon:"pending",status:"pending"}:u},[e,t.messageLengthPassword,n==null?void 0:n.length,r]);return{isValidUniqueSymbols:o,defaultLengthMessage:P}},Me=(e,r,n,t,o)=>e==="error"||(r==null?void 0:r.status)==="error"||n&&t.trim().length===0?o.newPassword:void 0,ke=({handleHideChangePassword:e,handleSetInLineAlert:r,inLineAlertProps:n})=>{const{passwordConfigs:t}=Ne(),{hideChangePassword:o,handleOnBlurPassword:s,handleConfirmPasswordChange:P,handleNewPasswordChange:u,handleCurrentPasswordChange:c,mutationChangePassword:p,currentPassword:h,newPassword:l,confirmPassword:F,passwordErrors:y,submitLoading:I,isClickSubmit:E}=Se({passwordConfigs:t,handleSetInLineAlert:r,handleHideChangePassword:e}),{isValidUniqueSymbols:i,defaultLengthMessage:A}=Te({password:l,isClickSubmit:E,passwordConfigs:t}),w=O({containerTitle:"Account.minifiedView.CustomerInformation.changePassword.containerTitle",currentPasswordPlaceholder:"Account.minifiedView.CustomerInformation.changePassword.currentPassword.placeholder",currentPasswordFloatingLabel:"Account.minifiedView.CustomerInformation.changePassword.currentPassword.floatingLabel",newPasswordPlaceholder:"Account.minifiedView.CustomerInformation.changePassword.newPassword.placeholder",newPasswordFloatingLabel:"Account.minifiedView.CustomerInformation.changePassword.newPassword.floatingLabel",confirmPasswordPlaceholder:"Account.minifiedView.CustomerInformation.changePassword.confirmPassword.placeholder",confirmPasswordFloatingLabel:"Account.minifiedView.CustomerInformation.changePassword.confirmPassword.floatingLabel",buttonSecondary:"Account.minifiedView.CustomerInformation.changePassword.buttonSecondary",buttonPrimary:"Account.minifiedView.CustomerInformation.changePassword.buttonPrimary"});return L(X,{className:"account-change-password",variant:"secondary",children:[d(Q,{title:w.containerTitle,divider:!1,className:"account-change-password__title"}),n.text?d(oe,{className:"account-change-password__notification",type:n.type,variant:"secondary",heading:n.text,icon:n.icon,"data-testid":"changePasswordInLineAlert"}):null,L("div",{className:"account-change-password__fields",children:[d(R,{className:"account-change-password__fields-item",autoComplete:"currentPassword",name:"currentPassword",placeholder:w.currentPasswordPlaceholder,floatingLabel:w.currentPasswordFloatingLabel,errorMessage:y.currentPassword,defaultValue:h,onValue:c,onBlur:s}),d(R,{className:"account-change-password__fields-item",autoComplete:"newPassword",name:"newPassword",placeholder:w.newPasswordPlaceholder,floatingLabel:w.newPasswordFloatingLabel,minLength:t==null?void 0:t.minLength,validateLengthConfig:A,uniqueSymbolsStatus:i,requiredCharacterClasses:t==null?void 0:t.requiredCharacterClasses,errorMessage:Me(i,A,E,l,y),defaultValue:l,onValue:u,onBlur:s}),d(R,{className:"account-change-password__fields-item",autoComplete:"confirmPassword",name:"confirmPassword",placeholder:w.confirmPasswordPlaceholder,floatingLabel:w.confirmPasswordFloatingLabel,errorMessage:y.confirmPassword,defaultValue:F,onValue:P,onBlur:s})]}),L("div",{className:"account-change-password__actions",children:[d(H,{type:"button",disabled:I,onClick:o,variant:"secondary",children:w.buttonSecondary}),d(H,{variant:"primary",type:"button",disabled:I,onClick:p,children:w.buttonPrimary})]})]})},qe=({inLineAlertProps:e,errorPasswordEmpty:r,passwordValue:n,showPasswordOnEmailChange:t,submitLoading:o,formFieldsList:s,handleHideEditForm:P,handleUpdateCustomerInformation:u,handleInputChange:c,handleSetPassword:p,handleOnBlurPassword:h})=>{const l=O({buttonSecondary:"Account.minifiedView.CustomerInformation.editCustomerInformation.buttonSecondary",buttonPrimary:"Account.minifiedView.CustomerInformation.editCustomerInformation.buttonPrimary",placeholder:"Account.minifiedView.CustomerInformation.editCustomerInformation.passwordField.placeholder",floatingLabel:"Account.minifiedView.CustomerInformation.editCustomerInformation.passwordField.floatingLabel",containerTitle:"Account.minifiedView.CustomerInformation.editCustomerInformation.containerTitle",requiredFieldError:"Account.FormText.requiredFieldError"});return L(X,{variant:"secondary",className:"account-edit-customer-information",children:[d(Q,{title:l.containerTitle,divider:!1,className:"account-edit-customer-information__title"}),e.text?d(oe,{className:"account-edit-customer-information__notification",type:e.type,variant:"secondary",heading:e.text,icon:e.icon,"data-testid":"editCustomerInLineAlert"}):null,L(we,{loading:o,fieldsConfig:s||[],name:"editCustomerInformation",className:"account-edit-customer-information-form",onSubmit:u,setInputChange:c,children:[t?d("div",{className:"account-edit-customer-information__password",children:d(R,{autoComplete:"password",name:"password",placeholder:l.placeholder,floatingLabel:l.floatingLabel,errorMessage:r?l.requiredFieldError:void 0,defaultValue:n,onValue:p,onBlur:h})}):null,L("div",{className:"account-edit-customer-information__actions",children:[d(H,{disabled:o,type:"button",variant:"secondary",onClick:()=>P(),children:l.buttonSecondary}),d(H,{disabled:o,type:"submit",variant:"primary",children:l.buttonPrimary})]})]})]})},xe=({createdAt:e,slots:r,orderedCustomerData:n,showEditForm:t,showChangePassword:o,handleShowChangePassword:s,handleShowEditForm:P})=>{const u=O({buttonSecondary:"Account.minifiedView.CustomerInformation.customerInformationCard.buttonSecondary",buttonPrimary:"Account.minifiedView.CustomerInformation.customerInformationCard.buttonPrimary",accountCreation:"Account.minifiedView.CustomerInformation.customerInformationCard.accountCreation"});return d(X,{variant:"secondary",className:ne(["account-customer-information-card",["account-customer-information-card-short",o||t]]),children:L("div",{className:"account-customer-information-card__wrapper",children:[L("div",{className:"account-customer-information-card__actions",children:[d(H,{type:"button",variant:"tertiary",onClick:s,children:u.buttonSecondary}),d(H,{type:"button",variant:"tertiary",onClick:P,children:u.buttonPrimary})]}),d("div",{className:"account-customer-information-card__content",children:r!=null&&r.CustomerData?d(ge,{name:"CustomerData",slot:r==null?void 0:r.CustomerData,context:{customerData:n}}):L(he,{children:[n==null?void 0:n.map((c,p)=>{const h=c!=null&&c.label?`${c.label}: ${c==null?void 0:c.value}`:c==null?void 0:c.value;return d("p",{"data-testid":`${c.name}_${p}`,children:h},`${c.name}_${p}`)}),L("p",{children:[u.accountCreation,": ",e]})]})})]})})},Oe=e=>{if(!(e!=null&&e.dateOfBirth))return e;const{dateOfBirth:r,...n}=e;return{...n,dob:r}},Ue="accountContext";var x=(e=>(e.EDIT_ACCOUNT_EVENT="edit-account",e))(x||{});const Be={EDIT_ACCOUNT_EVENT:"edit-account"};function se(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function He(e,r){const n=se();n.push({[e]:null}),n.push({[e]:r})}function Ze(e,r){se().push(t=>{const o=t.getState?t.getState():{};t.push({event:e,eventInfo:{...o,...r}})})}function We(e){const r=_e(e);He(Ue,r),Ze(Be.EDIT_ACCOUNT_EVENT)}const te=(e,r)=>{const n=sessionStorage.getItem("accountStoreConfig"),o={...n?JSON.parse(n):{},...r};switch(e){case"edit-account":We(o);break;default:return null}},$e=({handleSetInLineAlert:e})=>{const r=O({accountSuccess:"Account.minifiedView.CustomerInformation.editCustomerInformation.accountSuccess",accountError:"Account.minifiedView.CustomerInformation.editCustomerInformation.accountError",genderMale:"Account.minifiedView.CustomerInformation.genderMale",genderFemale:"Account.minifiedView.CustomerInformation.genderFemale"}),[n,t]=m(!0),[o,s]=m(!1),[P,u]=m(!1),[c,p]=m(!1),[h,l]=m(!1),[F,y]=m(!1),[I,E]=m([]),[i,A]=m(null),[w,Z]=m([]),[N,U]=m({}),[W,f]=m(""),[b,$]=m(""),_=C(a=>{const{value:g}=a==null?void 0:a.target;g.length&&l(!1),g.length||l(!0)},[]),S=C(a=>{f(a)},[]),ie=C(a=>{U(a)},[]),ce=C(()=>{u(!0),p(!1),e(),S("")},[e,S]),de=C(a=>{a==null||a(),u(!1)},[]),ue=C(()=>{p(!0),u(!1),e(),S("")},[e,S]),le=C(a=>{a==null||a(),p(!1)},[]),T=C((a,g)=>{a==="success"?e({type:"success",text:g??r.accountSuccess}):a==="error"?e({type:"error",text:g??r.accountError}):e(),s(!1)},[e,r]),j=C(()=>{Ve().then(a=>{var v;const g=(v=a==null?void 0:a.createdAt)==null?void 0:v.split(" ")[0],M=Oe({...a,gender:a.gender===1?r.genderMale:r.genderFemale});A(M),$(g)})},[r.genderFemale,r.genderMale]);B(()=>{j()},[]),B(()=>{Ie("customer_account_edit").then(a=>{Z(a);const g=a.map(({name:M,customUpperCode:v,orderNumber:k,label:D})=>({name:v,orderNumber:k,label:Ce.includes(M)?null:D}));E(g)})},[]),B(()=>{N.email&&N.email!==(i==null?void 0:i.email)?y(!0):N.email&&N.email===(i==null?void 0:i.email)&&y(!1)},[i==null?void 0:i.email,N]);const z=G(()=>!I||!i?[]:I.filter(({name:g})=>g!==void 0&&i[g]).map(g=>({name:g.name,orderNumber:g.orderNumber,value:i[g.name],label:g.label})),[i,I]);B(()=>{z!=null&&z.length&&t(!1)},[z]);const me=G(()=>w==null?void 0:w.map(a=>({...a,defaultValue:a!=null&&a.customUpperCode&&i?i[a.customUpperCode]??"":""})).map(a=>a.customUpperCode==="gender"?{...a,defaultValue:a.defaultValue==="Male"?1:2}:a),[w,i]),fe=C(async(a,g)=>{const M=Pe(a.target),{email:v,password:k,...D}=M,Y=v!==(i==null?void 0:i.email)&&k.length===0;if(!g){Y&&l(!0);return}if(l(!1),s(!0),v===(i==null?void 0:i.email)){S(""),re(ee(D,"account")).then(q=>{q&&(j(),T("success"),te(x==null?void 0:x.EDIT_ACCOUNT_EVENT,{...M}))}).catch(q=>{T("error",q.message)});return}if(Y){l(!0),s(!1);return}v!=null&&v.length&&(k!=null&&k.length)&&ye({email:v,password:k}).then(q=>{q&&re(ee(D,"account")).then(J=>{J&&(j(),T("success"),te(x==null?void 0:x.EDIT_ACCOUNT_EVENT,{...M}))}).catch(J=>{T("error",J.message)})}).catch(q=>{T("error",q.message)})},[i,S,j,T]);return{createdAt:b,errorPasswordEmpty:h,passwordValue:W,showPasswordOnEmailChange:F,orderedCustomerData:z,loading:n,normalizeFieldsConfig:me,submitLoading:o,showEditForm:c,showChangePassword:P,handleShowChangePassword:ce,handleHideChangePassword:de,handleShowEditForm:ue,handleHideEditForm:le,handleUpdateCustomerInformation:fe,handleInputChange:ie,handleSetPassword:S,handleOnBlurPassword:_,renderAlertMessage:T}},ze={success:d(ve,{}),warning:d(Le,{}),error:d(Fe,{})},je=()=>{const[e,r]=m({}),n=C(t=>{if(!(t!=null&&t.type)){r({});return}const o=ze[t.type];r({...t,icon:o})},[]);return{inLineAlertProps:e,handleSetInLineAlert:n}},sr=({className:e,withHeader:r=!0,slots:n})=>{const t=O({containerTitle:"Account.minifiedView.CustomerInformation.containerTitle"}),{inLineAlertProps:o,handleSetInLineAlert:s}=je(),{createdAt:P,errorPasswordEmpty:u,passwordValue:c,showPasswordOnEmailChange:p,orderedCustomerData:h,loading:l,normalizeFieldsConfig:F,submitLoading:y,showEditForm:I,showChangePassword:E,handleShowChangePassword:i,handleHideChangePassword:A,handleShowEditForm:w,handleHideEditForm:Z,handleUpdateCustomerInformation:N,handleInputChange:U,handleSetPassword:W,handleOnBlurPassword:f}=$e({handleSetInLineAlert:s});return l?d("div",{"data-testid":"customerInformationLoader",children:d(pe,{withCard:!0})}):L("div",{className:ne(["account-customer-information",e]),children:[r?d(Q,{title:t.containerTitle,divider:!1,className:"customer-information__title"}):null,d(xe,{createdAt:P,slots:n,orderedCustomerData:h,showEditForm:I,showChangePassword:E,handleShowChangePassword:i,handleShowEditForm:w}),E?d(ke,{inLineAlertProps:o,handleSetInLineAlert:s,handleHideChangePassword:A}):null,I?d(qe,{inLineAlertProps:o,submitLoading:y,formFieldsList:F,errorPasswordEmpty:u,passwordValue:c,showPasswordOnEmailChange:p,handleSetPassword:W,handleOnBlurPassword:f,handleUpdateCustomerInformation:N,handleHideEditForm:Z,handleInputChange:U}):null]})};export{sr as CustomerInformation,sr as default};
|
|
4
4
|
//# sourceMappingURL=CustomerInformation.js.map
|
package/containers/OrdersList.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as t,jsxs as u,Fragment as M}from"@dropins/tools/preact-jsx-runtime.js";import{classes as T,Slot as I}from"@dropins/tools/lib.js";import{S as B,c as j,E as R,C as Q}from"../chunks/AddressValidation.js";import"@dropins/tools/preact-compat.js";import{Card as G,Icon as F,Image as J,Price as X,ContentGrid as Z,Header as rr,Picker as tr,Pagination as er}from"@dropins/tools/components.js";import{useText as E}from"@dropins/tools/i18n.js";import{useState as y,useEffect as P,useMemo as U,useCallback as K}from"@dropins/tools/preact-hooks.js";import{events as sr}from"@dropins/tools/event-bus.js";import{g as ar}from"../chunks/getOrderHistoryList.js";import{g as nr}from"../chunks/getStoreConfig.js";import"../chunks/removeCustomerAddress.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/preact.js";import"../chunks/initialize.js";import"../fragments.js";const V={size:"32",stroke:"2"},W=({minifiedView:n,orderNumber:c,orderToken:r,routeOrdersList:s,routeOrderDetails:h})=>{const a=n?"minifiedView":"fullSizeView",l=E({viewAllOrdersButton:`Account.${a}.OrdersList.viewAllOrdersButton`,ariaLabelLink:`Account.${a}.OrdersList.ariaLabelLink`});return s?t("a",{className:T(["account-orders-list-action",["account-orders-list-action--minifiedView",n]]),"data-testid":"ordersListActionButtonMinifiedView",href:s(),children:t(G,{"data-testid":"ordersListActionMinifiedView",variant:"secondary",children:u("div",{className:"account-orders-list-action__card-wrapper",children:[t("p",{children:l.viewAllOrdersButton}),t(F,{source:B,...V})]})})}):t("a",{"aria-label":`${l.ariaLabelLink} ${c??r}`,href:j(h)?h(c,r):"#",className:"account-orders-list-action","data-testid":"ordersListActionButton",children:t(F,{source:B,...V})})},cr=()=>{const[n,c]=y(window.innerWidth<768);return P(()=>{const r=()=>{c(window.innerWidth<768)};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),n},or=({placeholderImage:n,minifiedView:c,item:r,withThumbnails:s,children:h,slots:a,routeTracking:l,routeOrderProduct:L,routeReturnDetails:O,...b})=>{var w,i,N,$,z,Y,f,D,C,m,v,x;const o=c?"minifiedView":"fullSizeView",g=E({orderNumber:`Account.${o}.OrdersList.OrdersListCard.orderNumber`,itemsAmount:`Account.${o}.OrdersList.OrdersListCard.itemsAmount`,carrier:`Account.${o}.OrdersList.OrdersListCard.carrier`,returnsText:`Account.${o}.OrdersList.OrdersListCard.returns`,deliveryDateText:`Account.${o}.OrdersList.OrdersListCard.orderDate`}),d=cr(),S=j(L),_=U(()=>((r==null?void 0:r.items)??[]).map((e,p)=>{var k,q;const A={title:(e==null?void 0:e.productName)??"",src:((q=(k=e==null?void 0:e.product)==null?void 0:k.smallImage)==null?void 0:q.url)||n,alt:(e==null?void 0:e.productName)??"",width:65,height:65,loading:"eager"};return t(I,{name:"OrderItemImage",slot:a==null?void 0:a.OrderItemImage,context:{data:e,defaultImageProps:A},children:S?t("a",{href:(L==null?void 0:L(e))??"",target:"_blank",rel:"noreferrer",children:t(J,{...A})}):t(J,{...A})},`${p}_${e.id}`)}),[S,r.items,n,L,a==null?void 0:a.OrderItemImage]);return u(G,{variant:"secondary",...b,className:T(["account-orders-list-card",["account-orders-list-card--full",((w=r==null?void 0:r.items)==null?void 0:w.length)>6]]),children:[t("div",{className:"account-orders-list-card__content",children:a!=null&&a.OrdersListCard?t(I,{"data-testid":`ordersListCard${r.id}`,name:"OrdersListCard",slot:a==null?void 0:a.OrdersListCard,context:{orderHistoryListItem:r}}):u(M,{children:[t("div",{children:r==null?void 0:r.status}),u("p",{children:[g.deliveryDateText," ",r==null?void 0:r.orderDate]}),u("p",{children:[g.orderNumber," ",r.number]}),(i=r==null?void 0:r.shipments)==null?void 0:i.map(e=>{var p;return(p=e==null?void 0:e.tracking)==null?void 0:p.map(A=>{const k=l==null?void 0:l(A);return u("p",{"data-testid":A.number,children:[t("span",{children:`${g.carrier} ${A.carrier.toLocaleUpperCase()} `}),k?t("a",{href:k,target:"_blank",className:"account-orders-list-card__content--track_number",rel:"noreferrer",children:A.number}):t("span",{className:"account-orders-list-card__content--track_number",children:A.number})]},e.id)})}),r!=null&&r.returns&&((N=r.returns)!=null&&N.length)?u("p",{"data-testid":r.number,children:[u("span",{children:[g.returnsText," "]}),($=r==null?void 0:r.returns)==null?void 0:$.map(e=>t("span",{"data-testid":e.number,children:u("a",{href:(O==null?void 0:O({orderNumber:r.number,orderToken:r.token,returnNumber:e.number}))??"#",className:"account-orders-list-card__content--return_number",children:[e.number," "]})},e.uid))]},r.id):null,t("p",{children:t(X,{amount:((Y=(z=r==null?void 0:r.total)==null?void 0:z.grandTotal)==null?void 0:Y.value)??0,currency:(D=(f=r==null?void 0:r.total)==null?void 0:f.grandTotal)==null?void 0:D.currency,weight:"normal",size:"medium"})}),u("p",{"data-testid":"itemsAmount",children:[(C=r==null?void 0:r.items)!=null&&C.length?(m=r==null?void 0:r.items)==null?void 0:m.reduce((e,p)=>{const A=(p==null?void 0:p.quantityOrdered)||0;return e+A},0):0," ",g.itemsAmount]}),(v=r==null?void 0:r.items)==null?void 0:v.map((e,p)=>{if(p>=0&&p<10)return u("p",{className:"account-orders-list-card__content--product-name",children:[u("span",{className:"account-orders-list-card__content--quantity",children:[(e==null?void 0:e.quantityOrdered)>1?e==null?void 0:e.quantityOrdered:null," "]}),e==null?void 0:e.productName.replaceAll("-"," ")]},`${p}_${e.id}`);if(p===11)return t("p",{children:"..."},"ellipsis")})]})}),s&&((x=r==null?void 0:r.items)!=null&&x.length)?t(Z,{maxColumns:d?3:9,emptyGridContent:t(M,{}),className:T(["account-orders-list-card__images",["account-orders-list-card__images-3",d]]),"data-testid":"ordersListCardImages",children:_}):null,t("div",{className:"account-orders-list-card__actions",children:h})]})},dr=({ordersInMinifiedView:n,minifiedView:c,pageSize:r,selectedDate:s,selectedPage:h,handleSetFirstOrderDate:a})=>{const[l,L]=y([]),[O,b]=y({totalPages:1,currentPage:1,pageSize:1}),[o,g]=y(!1),[d,S]=y(""),[_,w]=y(0);return P(()=>{nr().then(i=>{S(i.baseMediaUrl)})},[]),P(()=>{const i=sr.on("companyContext/changed",()=>{w(N=>N+1)});return()=>{i==null||i.off()}},[]),P(()=>{g(!0),ar(c?n:r,s,h).then(i=>{!i||!i.items||(b(i.pageInfo),L(i.items),a==null||a(i.dateOfFirstOrder))}).finally(()=>{g(!1)})},[a,c,n,r,s,h,_]),{loading:o,orderHistoryListItems:l,pageInfo:O,placeholderImage:d}},H=(n,c=1)=>{const r=new Date,s=new Date(r);switch(n){case"sixMonthsAgo":{s.setMonth(s.getMonth()-c);break}case"oneYearAgo":{s.setFullYear(s.getFullYear()-c);break}default:return""}return{from:s==null?void 0:s.toISOString().split("T")[0],to:`${r==null?void 0:r.toISOString().split("T")[0]} 23:59:59`}},ir=n=>{const c=[],r=new Date().getFullYear();for(let s=n;s<=r-1;s++)c.push({value:`{"from":"${s}-01-01","to":"${s+1}-01-01 23:59:59"}`,text:s.toString()});return c},lr=()=>{const n=E({pastSixMonths:"Account.fullSizeView.OrdersList.OrdersListSelectDate.pastSixMonths",currentYear:"Account.fullSizeView.OrdersList.OrdersListSelectDate.currentYear",viewAll:"Account.fullSizeView.OrdersList.OrdersListSelectDate.viewAll"}),[c,r]=y(),[s,h]=y(JSON.stringify(H("sixMonthsAgo",6))),[a,l]=y(1);P(()=>{window==null||window.scrollTo({top:100,behavior:"smooth"})},[a]);const L=U(()=>{const o=[{value:JSON.stringify(H("sixMonthsAgo",6)),text:n.pastSixMonths},{value:JSON.stringify(H("oneYearAgo",1)),text:n.currentYear},{value:"viewAll",text:n.viewAll}];if(c){const d=new Date(c).getFullYear();o==null||o.splice(2,0,...ir(d))}return o},[n,c]),O=K(o=>{r(o)},[]),b=K(o=>{const d=o.target.value;h(d),l(1)},[]);return{selectableDateList:L,selectedDate:s,selectedPage:a,handleSelectDate:b,setSelectedPage:l,handleSetFirstOrderDate:O}},ur=({className:n,withHeader:c=!0,minifiedView:r=!1,withThumbnails:s=!0,withFilter:h=!0,ordersInMinifiedView:a=1,pageSize:l=10,routeOrdersList:L,routeOrderDetails:O,routeReturnDetails:b,routeTracking:o,routeOrderProduct:g,slots:d})=>{const S=r?"minifiedView":"fullSizeView",_=E({containerTitle:`Account.${S}.OrdersList.containerTitle`,dateOrderPlaced:`Account.${S}.OrdersList.dateOrderPlaced`}),{selectableDateList:w,selectedDate:i,handleSelectDate:N,selectedPage:$,setSelectedPage:z,handleSetFirstOrderDate:Y}=lr(),{pageInfo:f,loading:D,orderHistoryListItems:C,placeholderImage:m}=dr({minifiedView:r,pageSize:l,ordersInMinifiedView:a,selectedDate:i,selectedPage:$,handleSetFirstOrderDate:Y});return u("div",{children:[c?t(rr,{"aria-label":_.containerTitle,role:"region",title:_.containerTitle,divider:!r,className:r?"account-orders-list-header":""}):null,u("div",{className:T(["account-orders-list",n]),children:[!r&&h?u("div",{className:"account-orders-list__date-select",children:[t("span",{children:_.dateOrderPlaced}),t(tr,{value:i,name:"orderDatePicker",options:w,handleSelect:N})]}):null,D?t(M,{children:Array.from(Array(f==null?void 0:f.pageSize).keys()).map(v=>t(Q,{testId:"orderSkeletonLoader",withCard:!1},v))}):t(M,{children:C.length?t(M,{children:C.map((v,x)=>t(or,{placeholderImage:m,routeTracking:o,routeOrderProduct:g,routeReturnDetails:b,minifiedView:r,item:v,withThumbnails:s,slots:d,children:d!=null&&d.OrdersListAction?t(I,{"data-testid":`ordersListActionSlot_${x}`,name:"OrdersListAction",slot:d==null?void 0:d.OrdersListAction,context:{orderHistoryListItem:v}}):t(W,{minifiedView:r,orderNumber:v.number,orderToken:v.token,routeOrderDetails:O})},x))}):t(R,{isEmpty:!C.length,typeList:"orders",minifiedView:r})}),!r&&(f==null?void 0:f.totalPages)>1?t(er,{totalPages:f==null?void 0:f.totalPages,currentPage:$,onChange:z}):null,r?t(W,{minifiedView:r,routeOrdersList:L}):null]})]})},$r=({className:n,withHeader:c,minifiedView:r,withThumbnails:s,withFilter:h,ordersInMinifiedView:a,pageSize:l,routeOrdersList:L,routeOrderDetails:O,routeReturnDetails:b,routeTracking:o,routeOrderProduct:g,slots:d})=>t("div",{className:T(["account-orders-list",n]),"data-testid":"ordersListId",children:t(ur,{className:n,withHeader:c,minifiedView:r,withThumbnails:s,withFilter:h,ordersInMinifiedView:a,pageSize:l,routeOrdersList:L,routeOrderDetails:O,routeReturnDetails:b,routeTracking:o,routeOrderProduct:g,slots:d})});export{$r as OrdersList,$r as default};
|
|
4
4
|
//# sourceMappingURL=OrdersList.js.map
|
package/fragments.js
CHANGED
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-account", "version": "3.0.0-
|
|
1
|
+
{"name": "@dropins/storefront-account", "version": "3.0.0-beta6", "@dropins/tools": "~1.6.0", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2026 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(e,r){try{if(typeof document<"u"){const a=document.createElement("style"),o=r.styleId;for(const t in r.attributes)a.setAttribute(t,r.attributes[t]);a.setAttribute("data-dropin",o),a.appendChild(document.createTextNode(e));const c=document.querySelector('style[data-dropin="sdk"]');if(c)c.after(a);else{const t=document.querySelector('link[rel="stylesheet"], style');t?t.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(`.account-orders-list-header{margin-bottom:var(--spacing-medium)}.account-orders-list ul{list-style:none;margin:0;padding:0}.account-orders-list__date-select{margin-bottom:var(--spacing-xbig)}.account-orders-list__date-select span{display:inline-block;font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);margin-bottom:var(--spacing-xsmall)}.account-orders-list__date-select .dropin-picker{max-width:224px}
|
|
4
4
|
.account-form{display:grid;flex-direction:column;gap:var(--spacing-medium)}@media (min-width: 768px){.account-form{display:grid;grid-template-columns:repeat(2,1fr)}.account-form>.dropin-field:nth-child(1),.account-form>.dropin-field:nth-child(2){grid-column:span 1}.account-form>.dropin-field:nth-child(3),.account-form>.dropin-field:nth-child(4),.account-form>.dropin-field:nth-child(5){grid-column:span 2}.account-form>.dropin-field:nth-child(6),.account-form>.dropin-field:nth-child(7){grid-column:span 1}.account-form>.dropin-field:nth-child(8),.account-form>.dropin-field:nth-child(9){grid-column:span 1}.account-form>.dropin-field:nth-child(n+10){grid-column:span 2}}.account-form [class$=-hidden]{position:absolute;opacity:0;height:0;width:0;overflow:hidden;clip:rect(0,0,0,0);display:none}.account-account-loaders--card-loader{margin-bottom:var(--spacing-small)}.account-account-loaders--picker-loader div:first-child{max-width:200px}.account-account-loaders--picker-loader div:nth-child(3){max-width:400px}.account-address-card{margin-bottom:var(--spacing-small)}.account-address-card .dropin-card__content{display:grid;grid-template-columns:1fr auto;gap:var(--spacing-small) 0px;grid-template-areas:"description action" "labels action"}.account-address-card .account-address-card__action{display:flex;justify-content:flex-end;align-items:baseline;cursor:pointer;grid-area:action}.account-address-card .account-address-card__action--editbutton{margin-left:var(--spacing-small)}.account-address-card .account-address-card__action button{padding:0}.account-address-card .account-address-card__action button:hover{text-decoration:underline}.account-address-card .account-address-card__description{grid-area:description;margin:0;padding:0}.account-address-card .account-address-card__labels{display:flex;gap:0 var(--spacing-xsmall);grid-area:labels}.account-address-card .account-address-card__description p{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing);line-height:var(--spacing-xbig);color:var(--color-neutral-800);padding:0;margin:0 var(--spacing-xsmall) 0 0}.account-address-card .account-address-card__description p:nth-child(1),.account-address-card .account-address-card__description p:nth-child(2){margin:0 var(--spacing-xsmall) var(--spacing-xsmall) 0;color:var(--color-neutral-800);font:var(--type-button-2-font);font-weight:500;cursor:default}.account-address-card .account-address-card__description p:nth-child(1),.account-address-card .account-address-card__description p:nth-child(3),.account-address-card .account-address-card__description p:nth-child(4),.account-address-card .account-address-card__description p:nth-child(6){float:left}.account-actions-address{cursor:pointer;padding:var(--spacing-xsmall) var(--spacing-medium);border-radius:var(--shape-border-radius-2);border:var(--shape-border-width-2) solid var(--color-neutral-400);background-color:var(--color-neutral-50);width:100%;height:88px;display:flex;align-items:center;justify-content:space-between}.account-actions-address--selectable{max-width:100%;width:auto}.account-actions-address__title{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing);-moz-appearance:none;appearance:none;-webkit-appearance:none;color:var(--color-neutral-800)}.account-actions-address svg{stroke:var(--shape-icon-stroke-4);color:var(--color-neutral-800)}@supports (height: 100dvh){.account-address-modal .dropin-modal{height:100dvh}}.account-address-modal--overlay{position:relative;padding:var(--spacing-small) var(--spacing-small) var(--spacing-small) var(--spacing-small);width:100%;margin:auto;max-width:340px}@media (min-width: 768px){.account-address-modal--overlay{position:relative;padding:var(--spacing-xbig) var(--spacing-xxbig) var(--spacing-xxbig) var(--spacing-xxbig);width:100%;margin:auto;max-width:721px}.account-address-card .dropin-card__content{padding:var(--spacing-small)}}.dropin-modal__body--medium>.dropin-modal__header-title,.dropin-modal__body--full>.dropin-modal__header-title,.account-address-modal .dropin-modal__content{margin:0;align-items:center}.account-address-modal .dropin-modal__header-title-content h3{font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);margin:0;padding:0}.account-address-modal .account-address-modal__spinner{position:absolute;top:0;left:0;background-color:var(--color-neutral-200);opacity:.8;width:100%;height:100%;display:flex;justify-content:center;align-items:center;z-index:1}.account-address-modal p{margin:var(--spacing-small) 0}@media (min-width: 768px){.account-address-modal p{color:var(--color-neutral-800);font:var(--type-body-2-strong-font);letter-spacing:var(--type-body-2-strong-letter-spacing);margin-bottom:var(--spacing-medium)}}.account-address-modal .account-address-modal__buttons{display:flex;align-items:center;justify-content:right;gap:0 var(--spacing-small)}.account-empty-list{margin-bottom:var(--spacing-small)}.account-empty-list.account-empty-list--minified,.account-empty-list .dropin-card{border:none}.account-empty-list .dropin-card__content{gap:0;padding:var(--spacing-xxbig)}.account-empty-list.account-empty-list--minified .dropin-card__content{flex-direction:row;align-items:center;padding:var(--spacing-big) var(--spacing-small)}.account-empty-list .dropin-card__content svg{width:64px;height:64px;margin-bottom:var(--spacing-medium)}.account-empty-list.account-empty-list--minified .dropin-card__content svg{margin:0 var(--spacing-small) 0 0;width:32px;height:32px}.account-empty-list .dropin-card__content svg path{fill:var(--color-neutral-800)}.account-empty-list.account-empty-list--minified .dropin-card__content svg path{fill:var(--color-neutral-500)}.account-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)}.account-empty-list.account-empty-list--minified .dropin-card__content p{font:var(--type-body-1-strong-font);color:var(--color-neutral-800)}.account-orders-list-action{margin:0;padding:0;border:none;background-color:transparent;cursor:pointer;text-decoration:none}a.account-orders-list-action:focus-visible{display:inline-block}.account-orders-list-action--minifiedView{width:100%;text-align:left;font:var(--type-body-1-default-font)}.account-orders-list-action.account-orders-list-action--minifiedView:hover{text-decoration:none}.account-orders-list-action--minifiedView .account-orders-list-action__card-wrapper{display:flex;justify-content:space-between;align-items:center;color:var(--color-neutral-800);height:calc(88px - var(--spacing-small) * 2)}.account-orders-list-action__card-wrapper>p{font:var(--type-button-2-font);letter-spacing:var(--type-button-2-letter-spacing)}.account-orders-list-action__card-wrapper svg,.account-orders-list-action svg{color:var(--color-neutral-800)}.account-orders-list-action--minifiedView .dropin-card__content{padding:var(--spacing-small) var(--spacing-medium)}.account-orders-list-action--minifiedView p{font:var(--type-body-1-strong-font)}.account-orders-list-card{height:100%;margin-bottom:var(--spacing-small)}.account-orders-list-card .dropin-card__content{padding:var(--spacing-medium);display:grid;grid-template-areas:"content actions" "imageList actions";gap:0;max-height:100%}.account-orders-list-card .account-orders-list-card__content{grid-area:content;margin-bottom:var(--spacing-small)}.account-orders-list-card__content--quantity{font-weight:500;color:var(--color-neutral-800)}.account-orders-list-card__content--track_number,.account-orders-list-card__content--return_number{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing)}.account-orders-list-card .account-orders-list-card__content>div:first-child{font-weight:500}.account-orders-list-card .account-orders-list-card__content p,.account-orders-list-card .account-orders-list-card__content div{padding:0;text-align:left;font:var(--type-body-1-default-font);margin:0 0 var(--spacing-small) 0;color:var(--color-neutral-800)}.account-orders-list-card p.account-orders-list-card__content--product-name{margin:0}.account-orders-list-card .account-orders-list-card__content p:last-child{margin:0}.account-orders-list-card .account-orders-list-card__content div{font:var(--type-button-2-font);margin-bottom:var(--spacing-small)}.account-orders-list-card .account-orders-list-card__actions{grid-area:actions}.account-orders-list-card .account-orders-list-card__images{overflow:auto}.account-orders-list-card .account-orders-list-card__images .dropin-content-grid__content{grid-template-columns:repeat(6,max-content)!important}.account-orders-list-card .account-orders-list-card__images-3 .dropin-content-grid__content{grid-template-columns:repeat(3,max-content)!important}.account-orders-list-card .account-orders-list-card__images img{object-fit:contain;width:65px;height:65px}.account-orders-list-card .account-orders-list-card__actions{position:relative;align-self:center;margin-left:auto}@media (min-width: 768px){.account-orders-list-card.account-orders-list-card--full .dropin-card__content{max-height:100%}}.account-addresses-header{margin-bottom:var(--spacing-medium)}.account-addresses-wrapper{box-sizing:border-box;position:relative}.account-addresses-wrapper--select-view{position:relative;margin:0;padding:0;border:none}.account-addresses-wrapper--select-view input[type=radio]{position:absolute;clip:rect(0,0,0,0);width:1px;height:1px;padding:0;margin:-1px;border:0;overflow:hidden}.account-addresses-wrapper--select-view .account-addresses-wrapper__label{cursor:pointer;display:block;border-radius:0}.account-addresses-wrapper--select-view .account-addresses-wrapper__label .account-address-card{border-radius:0}.account-addresses-wrapper--select-view .account-addresses-wrapper__label:nth-child(2){border-radius:var(--shape-border-radius-1) var(--shape-border-radius-1) 0 0}.account-addresses-wrapper--select-view>.account-addresses-wrapper__label:nth-child(2)>.account-address-card{border-radius:var(--shape-border-radius-1) var(--shape-border-radius-1) 0 0}.account-addresses-wrapper--select-view>.account-addresses-wrapper__label:last-child,.account-addresses-wrapper--select-view>.account-addresses-wrapper__label:last-child>.account-actions-address.account-actions-address--address{border-radius:0 0 var(--shape-border-radius-1) var(--shape-border-radius-1)}.account-addresses-wrapper--select-view .account-addresses-wrapper__label .account-address-card,.account-addresses-wrapper--select-view .account-addresses-wrapper__label .account-actions-address.account-actions-address--address{background-color:var(--color-neutral-200)}.account-addresses-wrapper--select-view input[type=radio]:checked+.account-addresses-wrapper__label>.account-address-card{border:var(--shape-border-width-1) solid var(--color-neutral-900);position:relative}.account-addresses-wrapper--select-view input[type=radio]:focus+.account-addresses-wrapper__label>.account-address-card{border:var(--shape-border-width-1) solid var(--color-neutral-900);outline:var(--spacing-xxsmall) solid var(--color-button-focus);position:relative}.account-addresses-wrapper--select-view input[type=radio]:checked+.account-addresses-wrapper__label>.account-addresses-form__footer__wrapper{border:var(--shape-border-width-1) solid var(--color-neutral-900);position:relative}.account-addresses-wrapper--select-view input[type=radio]:checked+.account-addresses-wrapper__label .account-address-card,.account-addresses-wrapper--select-view input[type=radio]:checked+.account-addresses-wrapper__label .account-actions-address.account-actions-address--address{background-color:var(--color-neutral-50)}.account-addresses-wrapper--select-view .account-address-card{margin:0}.account-addresses-wrapper--select-view .account-addresses-form__footer__wrapper{padding:var(--spacing-medium)}.account-address-form-wrapper{box-sizing:border-box;background-color:var(--color-neutral-50)}.account-address-form-wrapper__notification{margin-bottom:var(--spacing-medium)}.account-address-form-wrapper__title{color:var(--color-neutral-800);font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);margin-bottom:var(--spacing-medium)}.account-address-form-wrapper__buttons{display:flex;align-items:center;justify-content:end;gap:0 var(--spacing-medium);margin-top:var(--spacing-medium)}.account-address-form-wrapper__buttons--empty{gap:0;margin:0;padding:0;display:inline-block}.account-address-form-wrapper__buttons button{min-width:142px}.account-change-password .dropin-card__content{gap:0}.account-change-password__title,.account-change-password .account-change-password__notification,.account-change-password .account-change-password__fields .account-change-password__fields-item{margin-bottom:var(--spacing-medium)}.account-change-password .account-change-password__fields .account-change-password__fields-item:last-child{margin-bottom:0}.account-change-password .account-change-password__actions{display:flex;justify-content:right;align-items:center;gap:0 var(--grid-3-gutters)}.account-change-password .account-change-password__actions button{min-width:144px}.account-edit-customer-information__title{margin-bottom:var(--spacing-medium)}.account-edit-customer-information .dropin-card__content{gap:0}.account-edit-customer-information .account-edit-customer-information__notification{margin-bottom:var(--spacing-medium)}.account-edit-customer-information .account-edit-customer-information-form__field:nth-child(n+3),.account-edit-customer-information .account-edit-customer-information__password{grid-column:span 2}.account-edit-customer-information .account-edit-customer-information__actions{display:flex;justify-content:end;align-items:center;gap:0 var(--grid-2-gutters);grid-column:span 2}.account-edit-customer-information .account-edit-customer-information__actions button{min-width:144px}.customer-information__title{margin-bottom:var(--spacing-medium)}.account-customer-information-card-short{margin-bottom:var(--spacing-small)}.account-customer-information-card .dropin-card__content{gap:0}.account-customer-information-card__wrapper{display:grid;grid-template-columns:1fr;align-items:start;gap:var(--grid-1-gutters) 0}.account-customer-information-card .account-customer-information-card__actions{margin-left:auto;display:flex;justify-content:space-between;align-items:center;gap:0 var(--grid-2-gutters)}@media (max-width: 300px){.account-customer-information-card .account-customer-information-card__actions{align-items:self-end;flex-direction:column-reverse}}.account-customer-information-card .account-customer-information-card__actions button{cursor:pointer;margin:0;padding:0}.account-customer-information-card__content p{font:var(--type-body-1-default-font);margin:0 var(--spacing-xsmall) 0 0;line-height:var(--spacing-xbig);padding:0}.account-customer-information-card__content p:nth-child(1),.account-customer-information-card__content p:nth-child(2){font:var(--type-body-1-strong-font);font-weight:500;margin:0 var(--spacing-xsmall) var(--spacing-xsmall) 0}.account-customer-information-card__content p:nth-child(1){float:left}.account-address-validation{display:grid;gap:var(--spacing-medium)}.account-address-validation__options--busy{opacity:.4;pointer-events:none}.account-address-validation__title{margin-bottom:var(--spacing-small)}.account-address-validation__subtitle{color:var(--color-neutral-700);font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.account-address-validation__options{display:grid;gap:var(--spacing-xbig);grid-template-columns:1fr 1fr}.account-address-validation__option{margin:0}.account-address-validation__option-title{margin-bottom:var(--spacing-xsmall)}`,{styleId:"account"});
|