PageSourceSearch

https://shop-dnd.com/component---src-pages-account-past-orders-js-3160658d07ae5bfdfa02.js

js shop-dnd.com collected 2026-09-26 06:17:18 UTC 30,871 bytes, 468 lines download raw bytes

1"use strict";(self.webpackChunkgatsby_starter_minimal=self.webpackChunkgatsby_starter_minimal||[]).push([[601],{9484:function(e,t,r){r.d(t,{dQ:function(){return l},mn:function(){return s},nX:function(){return i},oi:function(){return n},BL:function(){return o},xq:function(){return d},K1:function(){return u}});var a=r(9708);const n=a.J1`
2  mutation registerUser(
3    $email: String!
4    $firstName: String!
5    $lastName: String!
6    $password: String!
7  ) {
8    registerUser(
9      input: {
10        username: $email
11        email: $email
12        firstName: $firstName
13        lastName: $lastName
14        password: $password
15      }
16    ) {
17      user {
18        databaseId
19        email
20      }
21    }
22  }
23`,i=a.J1`
24  mutation registerCustomer(
25    $email: String!
26    $firstName: String!
27    $lastName: String!
28    $password: String!
29    $billing: CustomerAddressInput
30    $shipping: CustomerAddressInput
31  ) {
32    registerCustomer(
33      input: {
34        username: $email
35        email: $email
36        firstName: $firstName
37        lastName: $lastName
38        password: $password
39        billing: $billing
40        shipping: $shipping
41      }
42    ) {
43      customer {
44        databaseId
45        email
46      }
47    }
48  }
49`,l=a.J1`
50  mutation logIn($login: String!, $password: String!) {
51    login(input: {
52      username: $login
53      password: $password
54    }) {
55      authToken
56      user {
57        id
58        customerId
59        databaseId
60        firstName
61        lastName
62        email
63      }
64    }
65  }
66`,s=a.J1`
67  mutation LogOut {
68    logout(input: {}) {
69      status
70    }
71  }
72`,o=(a.J1`
73  mutation ($input: AddToCartInput!) {
74    addToCart(input: $input) {
75      cartItem {
76        key
77        product {
78          node {
79            id
80            databaseId
81            name
82            description
83            type
84            onSale
85            slug
86            averageRating
87            reviewCount
88            image {
89              id
90              sourceUrl
91              altText
92            }
93            products {
94              hashtag
95              productTitle
96            }
97          }
98        }
99        variation {
100          node {
101            id
102            databaseId
103            name
104            description
105            type
106            onSale
107            price
108            regularPrice
109            salePrice
110            image {
111              id
112              sourceUrl
113              altText
114            }
115          }
116          attributes {
117            id
118            attributeId
119            name
120            value
121          }
122        }
123        quantity
124        total
125        subtotal
126        subtotalTax
127      }
128    }
129  }
130`,a.J1`
131    mutation ($input: UpdateItemQuantitiesInput!) {
132      updateItemQuantities(input: $input) {
133        items {
134          key
135          product {
136            node {
137              id
138              databaseId
139              name
140              description
141              type
142              onSale
143              slug
144              averageRating
145              reviewCount
146              image {
147                id
148                sourceUrl
149                altText
150              }
151              products {
152                hashtag
153                productTitle
154              }
155            }
156          }
157          variation {
158            node {
159              id
160              databaseId
161              name
162              description
163              type
164              onSale
165              price
166              regularPrice
167              salePrice
168              image {
169                id
170                sourceUrl
171                altText
172              }
173            }
174            attributes {
175              id
176              attributeId
177              name
178              value
179            }
180          }
181          quantity
182          total
183          subtotal
184          subtotalTax
185        }
186        removed {
187          key
188          product {
189            node {
190              id
191              databaseId
192            }
193          }
194          variation {
195            node {
196              id
197              databaseId
198            }
199          }
200        }
201        updated {
202          key
203          product {
204            node {
205              id
206              databaseId
207            }
208          }
209          variation {
210            node {
211              id
212              databaseId
213            }
214          }
215        }
216      }
217    }
218`,a.J1`
219    query GET_CART {
220      cart {
221        contents {
222          itemCount
223          productCount
224          nodes {
225            key
226            product {
227              node {
228                id
229                databaseId
230                name
231                description
232                type
233                onSale
234                slug
235                averageRating
236                reviewCount
237                image {
238                  id
239                  sourceUrl
240                  srcSet
241                  altText
242                  title
243                }
244                products {
245                  hashtag
246                  productTitle
247                }
248              }
249            }
250            variation {
251              node {
252                id
253                databaseId
254                name
255                description
256                type
257                onSale
258                price
259                regularPrice
260                salePrice
261                image {
262                  id
263                  sourceUrl
264                  srcSet
265                  altText
266                  title
267                }
268              }
269              attributes {
270                id
271                name
272                value
273              }
274            }
275            quantity
276            total
277            subtotal
278            subtotalTax
279          }
280        }
281        appliedCoupons {
282          code
283          discountAmount
284          discountTax
285          description
286        }
287        subtotal
288        subtotalTax
289        shippingTax
290        shippingTotal
291        total
292        totalTax
293        feeTax
294        feeTotal
295        discountTax
296        discountTotal
297      }
298    }
299`,a.J1`
300  mutation CLEAR_CART_MUTATION( $input: RemoveItemsFromCartInput! ) {
301    removeItemsFromCart(input: $input) {
302      cartItems {
303        quantity
304      }
305    }
306  }
307`,a.J1`
308  mutation UpdateUserDetails(
309    $id: ID! 
310    $billingFirstName: String
311    $billingLastName: String
312    $billingAddress1: String
313    $billingAddress2: String
314    $billingCity: String
315    $billingCountry: CountriesEnum
316    $billingPostcode: String
317    $billingPhone: String
318    $shippingFirstName: String
319    $shippingLastName: String
320    $shippingAddress1: String
321    $shippingAddress2: String
322    $shippingCity: String
323    $shippingCountry: CountriesEnum
324    $shippingPostcode: String
325    $shippingPhone: String
326  ) {
327    updateCustomer(
328      input: {
329        id: $id
330        billing: {
331          firstName: $billingFirstName
332          lastName: $billingLastName
333          address1: $billingAddress1
334          address2: $billingAddress2
335          city: $billingCity
336          country: $billingCountry
337          postcode: $billingPostcode
338          phone: $billingPhone
339        }
340        shipping: {
341          firstName: $shippingFirstName
342          lastName: $shippingLastName
343          address1: $shippingAddress1
344          address2: $shippingAddress2
345          city: $shippingCity
346          country: $shippingCountry
347          postcode: $shippingPostcode
348          phone: $shippingPhone
349        }
350      }
351    ) {
352      customer {
353        id
354        billing {
355          firstName
356          lastName
357          address1
358          address2
359          city
360          country
361          postcode
362          phone
363        }
364        shipping {
365          firstName
366          lastName
367          address1
368          address2
369          city
370          country
371          postcode
372          phone
373        }
374      }
375    }
376  }
377`),d=a.J1`
378  mutation UpdateUserShipping($input: UpdateUserShippingInput!) {
379    updateUserShipping(input: $input) {
380      success
381      user {
382        id
383        shippingFirstName
384        shippingLastName
385        shippingCompany
386        shippingAddress1
387        shippingAddress2
388        shippingCity
389        shippingState
390        shippingPostcode
391        shippingCountry
392      }
393    }
394  }
395`,u=(a.J1`
396  query RootQuery($where: RootQueryToProductConnectionWhereArgs) {
397    products(where: $where) {
398      nodes {
399        slug
400        title
401      }
402    }
403  }
404`,a.J1`
405  mutation ValidateCoupon($code: String!) {
406    validateCoupon(input: { code: $code }) {
407      id
408      code
409      type
410      amount
411      usageCount
412      usageLimit
413      dateCreated
414      dateModified
415      dateExpires
416      individualUse
417      productIds
418      excludedProductIds
419      valid
420      errorMessage
421    }
422  }
423`);a.J1`
424  input CreateWishlistInput {
425   
426      productId: ID!
427      userEmail: String!
428    
429  }
430
431  input DeleteWishlistInput {
432      id: ID!
433      productId: ID!
434      userEmail: String!
435  }
436`,a.J1`
437  mutation AddToWishlist($input: CreateWishlistInput!) {
438    createWishlist(input: $input) {
439      wishlist {
440        wishlst {
441          productId
442          userEmail
443        }
444      }
445    }
446  }
447`,a.J1`
448  mutation RemoveFromWishlist($input: DeleteWishlistInput!) {
449    deleteWishlist(input: $input) {
450      wishlist {
451        wishlst {
452          productId
453          userEmail
454        }
455      }
456    }
457  }
458`,a.J1`
459  query GetUserWishlist($userEmail: String!) {
460    wishlist(userEmail: $userEmail) {
461      wishlst {
462        productId
463        userEmail
464      }
465    }
466  }
467`},453:function(e,t,r){r.d(t,{A:function(){return p}});var a=r(6540),n=r(4194),i=r(2302),l=r(3818),s=r(5728);var o=e=>{let{children:t}=e;const{loggedIn:r,loading:o}=(0,i.Ay)(),{setLoading:d}=(0,l.M)();return(0,a.useEffect)((()=>{o||r||(0,n.navigate)("/auth/login")}),[r,o,n.navigate]),(0,a.useEffect)((()=>{d(o)}),[o,d]),r?a.createElement(a.Fragment,null,t):a.createElement(a.Fragment,null,o&&a.createElement(s.A,null))},d=r(9938);const u=[{path:"/account/",title:"Account Details"},{path:"/account/past-orders/",title:"Past Orders"},{path:"/account/wishlist/",title:"Wishlist"}];var c=r(5186),m=r(9484);var g=e=>{let{location:t}=e;const[r,{loading:i}]=(0,d.n)(m.mn,{onCompleted:c.vx});return a.createElement("ul",null,u.map((e=>a.createElement("li",{key:e.path,className:" border-b border-white border-solid py-4"},a.createElement(n.Link,{to:e.path,className:"account-sidebar-link "+((null==t?void 0:t.pathname)===e.path?"active":"")},e.title)))),a.createElement("li",{className:"border-b border-white border-solid py-4",onClick:()=>r(),disabled:i},a.createElement("span",{className:"account-sidebar-link cursor-pointer hover:text-dnd-yellow"},i?"Logging out...":"Logout")))};var p=e=>{let{children:t,location:r,className:n}=e;return a.createElement("div",{className:"limit-1440 pt-16 pb-20 px-6 1025:px-10 lg:pb-[140px]"},a.createElement(o,null,a.createElement("div",{className:"flex flex-col gap-y-16 lg:flex-row lg:gap-[152px]"},a.createElement("div",{className:"lg:w-[19%]"},a.createElement(g,{location:r})),a.createElement("div",{className:`lg:w-[65%] ${n} border-y border-solid border-white`},t))))}},9684:function(e,t,r){var a=r(6540),n=r(1500);t.A=e=>{let{showModal:t,handleClose:r,children:i}=e;const l=(0,a.useRef)(null),{0:s,1:o}=(0,a.useState)(!1);return(0,a.useEffect)((()=>{const e=l.current;t?n.os.fromTo(e,{x:"100%",opacity:0,onStart:()=>{o(!0)}},{x:"0%",opacity:1,duration:.6,ease:"elastic.out(0.5, 0.3)"}):n.os.to(e,{x:"100%",opacity:0,duration:.4,ease:"power2.in",onComplete:()=>{o(!1),r()}})}),[t,r]),a.createElement("div",{ref:l,className:"fixed inset-0 z-50 h-screen flex justify-center items-center bg-dnd-dark/75 translate-x-full"},a.createElement("div",{className:"flex flex-col space-y-8 w-11/12 lg:flex-row lg:gap-x-[140px] relative rounded-xl bg-dnd-darker-grey px-5 pt-[76px] pb-[66px] lg:pt-[80px] lg:pb-[111px] lg:px-[120px] lg:w-[1200px]"},i,a.createElement("div",{className:"absolute top-5 right-[30px] cursor-pointer",onClick:r,"aria-label":"Close modal"},a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none"},a.createElement("path",{d:"M26.1832 13.8167C26.0283 13.6605 25.8439 13.5365 25.6408 13.4519C25.4377 13.3673 25.2199 13.3237 24.9999 13.3237C24.7799 13.3237 24.562 13.3673 24.3589 13.4519C24.1558 13.5365 23.9715 13.6605 23.8166 13.8167L19.9999 17.65L16.1832 13.8167C15.8694 13.5029 15.4437 13.3265 14.9999 13.3265C14.5561 13.3265 14.1304 13.5029 13.8166 13.8167C13.5027 14.1305 13.3264 14.5562 13.3264 15C13.3264 15.4439 13.5027 15.8695 13.8166 16.1834L17.6499 20L13.8166 23.8167C13.6603 23.9716 13.5364 24.156 13.4517 24.3591C13.3671 24.5622 13.3236 24.78 13.3236 25C13.3236 25.2201 13.3671 25.4379 13.4517 25.641C13.5364 25.8441 13.6603 26.0284 13.8166 26.1834C13.9715 26.3396 14.1558 26.4636 14.3589 26.5482C14.562 26.6328 14.7799 26.6764 14.9999 26.6764C15.2199 26.6764 15.4377 26.6328 15.6408 26.5482C15.8439 26.4636 16.0283 26.3396 16.1832 26.1834L19.9999 22.35L23.8166 26.1834C23.9715 26.3396 24.1558 26.4636 24.3589 26.5482C24.562 26.6328 24.7799 26.6764 24.9999 26.6764C25.2199 26.6764 25.4377 26.6328 25.6408 26.5482C25.8439 26.4636 26.0283 26.3396 26.1832 26.1834C26.3394 26.0284 26.4634 25.8441 26.548 25.641C26.6327 25.4379 26.6762 25.2201 26.6762 25C26.6762 24.78 26.6327 24.5622 26.548 24.3591C26.4634 24.156 26.3394 23.9716 26.1832 23.8167L22.3499 20L26.1832 16.1834C26.3394 16.0284 26.4634 15.8441 26.548 15.641C26.6327 15.4379 26.6762 15.2201 26.6762 15C26.6762 14.78 26.6327 14.5622 26.548 14.3591C26.4634 14.156 26.3394 13.9716 26.1832 13.8167ZM31.7832 8.2167C30.2458 6.62486 28.4067 5.35516 26.3733 4.48167C24.3399 3.60819 22.1529 3.14842 19.9399 3.12919C17.7269 3.10996 15.5323 3.53166 13.484 4.36967C11.4357 5.20768 9.57485 6.44524 8.00997 8.01012C6.44509 9.57499 5.20754 11.4359 4.36953 13.4841C3.53151 15.5324 3.10982 17.7271 3.12905 19.9401C3.14828 22.153 3.60805 24.34 4.48153 26.3734C5.35501 28.4068 6.62472 30.2459 8.21655 31.7834C9.754 33.3752 11.5931 34.6449 13.6265 35.5184C15.6599 36.3919 17.8469 36.8516 20.0599 36.8709C22.2729 36.8901 24.4675 36.4684 26.5158 35.6304C28.5641 34.7924 30.4249 33.5548 31.9898 31.99C33.5547 30.4251 34.7922 28.5642 35.6303 26.5159C36.4683 24.4677 36.89 22.273 36.8707 20.06C36.8515 17.847 36.3917 15.66 35.5182 13.6266C34.6448 11.5932 33.3751 9.75414 31.7832 8.2167ZM29.4332 29.4334C27.2533 31.6157 24.3841 32.9747 21.3145 33.2789C18.245 33.583 15.1649 32.8135 12.5991 31.1013C10.0333 29.3892 8.14049 26.8404 7.24318 23.8892C6.34587 20.938 6.49956 17.7669 7.67808 14.9163C8.85659 12.0657 10.987 9.71194 13.7064 8.25597C16.4257 6.79999 19.5658 6.33191 22.5916 6.93149C25.6173 7.53106 28.3416 9.16118 30.3003 11.5441C32.2589 13.9271 33.3308 16.9154 33.3332 20C33.3392 21.7522 32.9975 23.4881 32.3281 25.1073C31.6587 26.7266 30.6747 28.1969 29.4332 29.4334Z",fill:"#FFA200"}
467)))))}},708:function(e,t,r){var a=r(6540),n=r(4730);t.A=e=>{let{src:t,alt:r,width:i,height:l,classList:s}=e;return a.createElement(n.k,{beforeInjection:e=>{s&&e.classList.add(s),i&&e.setAttribute("width",i),l&&e.setAttribute("height",l),r&&e.setAttribute("alt",r)},src:t})}},4734:function(e,t,r){r.r(t),r.d(t,{default:function(){return M}});var a=r(6540),n=r(4194),i=r(2302),l=r(453),s=r(7574),o=r(708);var d=e=>{let{width:t,height:r}=e;return a.createElement(o.A,{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgOCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxwYXRoIGQ9Ik03Ljc5MzM1IDIuOTA0NUw0LjUzMDIxIDAuMTg5NDE0QzQuNDU5NSAwLjEyOTM5NSA0LjM3NTM3IDAuMDgxNzU3MSA0LjI4MjY4IDAuMDQ5MjQ3NEM0LjE4OTk5IDAuMDE2NzM3OCA0LjA5MDU3IDAgMy45OTAxNiAwQzMuODg5NzQgMCAzLjc5MDMyIDAuMDE2NzM3OCAzLjY5NzYzIDAuMDQ5MjQ3NEMzLjYwNDk0IDAuMDgxNzU3MSAzLjUyMDgyIDAuMTI5Mzk1IDMuNDUwMSAwLjE4OTQxNEwwLjIyNDk5NiAyLjkwNDVDMC4xNTM3MDIgMi45NjQwMiAwLjA5NzExNDggMy4wMzQ4NSAwLjA1ODQ5ODIgMy4xMTI4OEMwLjAxOTg4MTYgMy4xOTA5MSAwIDMuMjc0NjEgMCAzLjM1OTE0QzAgMy40NDM2OCAwLjAxOTg4MTYgMy41MjczNyAwLjA1ODQ5ODIgMy42MDU0MUMwLjA5NzExNDggMy42ODM0NCAwLjE1MzcwMiAzLjc1NDI2IDAuMjI0OTk2IDMuODEzNzlDMC4zNjc1MTEgMy45MzMwNiAwLjU2MDI5NiA0IDAuNzYxMjQ2IDRDMC45NjIxOTYgNCAxLjE1NDk4IDMuOTMzMDYgMS4yOTc1IDMuODEzNzlMMy45OTAxNiAxLjU0Njk1TDYuNjgyODIgMy44MTM3OUM2LjgyNDUgMy45MzIwOSA3LjAxNTcyIDMuOTk4NzkgNy4yMTUyNyAzLjk5OTQ5QzcuMzE1MzcgMy45OTk5OCA3LjQxNDYxIDMuOTgzODMgNy41MDcyOCAzLjk1MTk2QzcuNTk5OTUgMy45MjAwOSA3LjY4NDI1IDMuODczMTQgNy43NTUzMiAzLjgxMzc5QzcuODI5MTYgMy43NTY0IDcuODg4NzYgMy42ODcyNyA3LjkzMDY3IDMuNjEwMzhDNy45NzI1OSAzLjUzMzQ5IDcuOTk1OTkgMy40NTAzNyA3Ljk5OTUzID
467MuMzY1ODJDOC4wMDMwNyAzLjI4MTI3IDcuOTg2NjcgMy4xOTY5NyA3Ljk1MTI4IDMuMTE3NzlDNy45MTU4OSAzLjAzODYxIDcuODYyMjEgMi45NjYxMSA3Ljc5MzM1IDIuOTA0NVoiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=",alt:"Chevron Up Icon",width:null!=t?t:24,height:null!=r?r:24,classList:""})};var u=e=>{let{height:t,width:r}=e;return a.createElement(o.A,{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOCIgaGVpZ2h0PSI0IiB2aWV3Qm94PSIwIDAgOCA0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxwYXRoIGQ9Ik03Ljc5MzM1IDEuMDk1NUw0LjUzMDIxIDMuODEwNTlDNC40NTk1IDMuODcwNiA0LjM3NTM3IDMuOTE4MjQgNC4yODI2OCAzLjk1MDc1QzQuMTg5OTkgMy45ODMyNiA0LjA5MDU3IDQgMy45OTAxNiA0QzMuODg5NzQgNCAzLjc5MDMyIDMuOTgzMjYgMy42OTc2MyAzLjk1MDc1QzMuNjA0OTQgMy45MTgyNCAzLjUyMDgyIDMuODcwNiAzLjQ1MDEgMy44MTA1OUwwLjIyNDk5NiAxLjA5NTVDMC4xNTM3MDIgMS4wMzU5OCAwLjA5NzExNDggMC45NjUxNTMgMC4wNTg0OTgyIDAuODg3MTJDMC4wMTk4ODE2IDAuODA5MDg4IDAgMC43MjUzOSAwIDAuNjQwODU3QzAgMC41NTYzMjMgMC4wMTk4ODE2IDAuNDcyNjI2IDAuMDU4NDk4MiAwLjM5NDU5M0MwLjA5NzExNDggMC4zMTY1NjEgMC4xNTM3MDIgMC4yNDU3MzggMC4yMjQ5OTYgMC4xODYyMDlDMC4zNjc1MTEgMC4wNjY5NDI5IDAuNTYwMjk2IDAgMC43NjEyNDYgMEMwLjk2MjE5NiAwIDEuMTU0OTggMC4wNjY5NDI5IDEuMjk3NSAwLjE4NjIwOUwzLjk5MDE2IDIuNDUzMDVMNi42ODI4MiAwLjE4NjIwOUM2LjgyNDUgMC4wNjc5MDc4IDcuMDE1NzIgMC4wMDEyMTQ3NCA3LjIxNTI3IDAuMDAwNTA3MzU1QzcuMzE1MzcgMi4wMDI3MmUtMDUgNy40MTQ2MSAwLjAxNjE3MjYgNy41MDcyOCAwLjA0ODAzOTRDNy41OTk5NSAwLjA3OTkwNjIgNy42ODQyNSAwLjEyNjg2IDcuNzU1MzIgMC4xODYyMDlDNy44MjkxNiAwLjI0MzU5NSA3Ljg4ODc2IDAuMzEyNzMxIDcuOTMwNjcgMC4zODk2MjJDNy45NzI1OSAwLjQ2NjUxMiA3Ljk5NTk5IDAuNTQ5NjMzIDcuOTk5NTMgMC42MzQxODFDOC4wMDMwNyAwLjcxODczIDcuOTg2NjcgMC44MDMwMyA3Ljk1MTI4IDAuODgyMjEyQzcuOTE1ODkgMC45NjEzOTQgNy44NjIyMSAxLjAzMzg5IDcuNzkzMzUgMS4wOTU1WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",alt:"Chevron Down Icon",width:null!=r?r:24,height:null!=t?t:24,classList:""})},c=r(9684),m=r(9785);var g=e=>{let{order:t}=e;const{register:r,handleSubmit:n,formState:{errors:i},reset:l}=(0,m.mN)(),{0:o,1:d}=(0,a.useState)(!1);(0,a.useEffect)((()=>
467{l({orderNumber:null==t?void 0:t.orderNumber,message:""})}),[]);return a.createElement(a.Fragment,null,o?a.createElement("div",{className:"w-full space-y-6 lg:w-full lg:space-y-10"},a.createElement("div",{className:"flex flex-col items-start space-y-4 p-6 rounded border border-dnd-yellow/30 bg-dnd-yellow/10"},a.createElement("div",{className:"flex items-center gap-3"},a.createElement("h2",{className:"text-dnd-yellow font-benguiat font-bold tracking-tighter text-_4848 lg:text-_8080 ml-11"},"Success!")),a.createElement("p",{className:"text-white font-inter text-_2024 ml-11"},"Your enquiry has been submitted successfully. We'll get back to you soon."))):a.createElement(a.Fragment,null,a.createElement("div",{className:"w-full space-y-6 lg:w-1/2 lg:space-y-10"},a.createElement("h2",{className:"text-dnd-red font-benguiat font-bold tracking-tighter text-_4848 lg:text-_8080"},"Make an enquiry")),a.createElement("div",{className:"w-full flex flex-col"},a.createElement("form",{onSubmit:n((async e=>{const t=JSON.stringify({input_1:e.orderNumber,input_2:e.message});(await(0,s.rM)({formId:1,payload:t})).success&&(d(!0),l())}))},a.createElement("div",{className:"space-y-4"},a.createElement("div",{className:"space-y-2"},a.createElement("label",{htmlFor:"orderNumber",className:"text-dnd-yellow font-inter text-_2024 tracking-tight font-medium"},"Order Number*"),a.createElement("input",Object.assign({id:"orderNumber",type:"text",disabled:!0,className:"w-full pointer-events-none select-none rounded placeholder:text-[#526E87] bg-white py-3 px-2.5 text-_1619 font-medium font-inter tracking-tighter",placeholder:"Order Number"},r("orderNumber",{required:"Order number is required"}))),(null==i?void 0:i.orderNumber)&&a.createElement("p",{className:"text-dnd-red text-_1417 font-inter font-medium"},i.orderNumber.message)),a.createElement("div",{className:"space-y-2"},a.createElement("label",{htmlFor:"enquiry-message",className:"text-dnd-yellow font-inter text-_2024 tracking-tight font-medium"},"Message"),a.createElement("textarea",Object.assign({id:"enquiry-message",className:"w-full rounded placeholder:text-[#526E87] bg-white py-3 px-2.5 text-_1619 font-medium font-inter tracking-tighter",placeholder:"Enter your message...",rows:5},r("message",{required:"Message field is required"}))),a.createElement("div",null,a.createElement("p",{className:"text-sm text-dnd-red tracking-32"},i.message&&i.message.message)))),a.createElement("div",{className:"mt-16 lg:mt-auto flex justify-end"},a.createElement("button",{className:"bg-dnd-yellow rounded py-[15px] px-4 text-dnd-darker-grey font-inter text-_1417 font-medium uppercase"},"Submit"))))))};var p=e=>{let{order:t}=e;const{register:r,handleSubmit:n,formState:{errors:i},reset:l}=(0,m.mN)(),{0:o,1:d}=(0,a.useState)(!1);(0,a.useEffect)((()=>
467{l({orderNumber:null==t?void 0:t.orderNumber,message:""})}),[]);return a.createElement(a.Fragment,null,o?a.createElement("div",{className:"w-full space-y-6 lg:w-full lg:space-y-10"},a.createElement("div",{className:"flex flex-col items-start space-y-4 p-6 rounded border border-dnd-yellow/30 bg-dnd-yellow/10"},a.createElement("div",{className:"flex items-center gap-3"},a.createElement("h2",{className:"text-dnd-yellow font-benguiat font-bold tracking-tighter text-_4848 lg:text-_8080 ml-11"},"Success!")),a.createElement("p",{className:"text-white font-inter text-_2024 ml-11"},"Your refund request has been submitted successfully. We'll get back to you soon."))):a.createElement(a.Fragment,null,a.createElement("div",{className:"w-full space-y-6 lg:w-1/2 lg:space-y-10"},a.createElement("h2",{className:"text-dnd-red font-benguiat font-bold tracking-tighter text-_4848 lg:text-_8080"},"Make a refund request")),a.createElement("div",{className:"w-full flex flex-col"},a.createElement("form",{onSubmit:n((async e=>{const t=JSON.stringify({input_1:e.orderNumber,input_3:e.message});(await(0,s.rM)({formId:2,payload:t})).success&&(d(!0),l())}))},a.createElement("div",{className:"space-y-4"},a.createElement("div",{className:"space-y-2"},a.createElement("label",{htmlFor:"orderNumber",className:"text-dnd-yellow font-inter text-_2024 tracking-tight font-medium"},"Order Number"),a.createElement("input",Object.assign({id:"orderNumber",type:"text",disabled:!0,className:"w-full pointer-events-none select-none rounded placeholder:text-[#526E87] bg-white py-3 px-2.5 text-_1619 font-medium font-inter tracking-tighter",placeholder:"Order Number"},r("orderNumber",{required:"Order number is required"}))),(null==i?void 0:i.orderNumber)&&a.createElement("p",{className:"text-dnd-red text-_1417 font-inter font-medium"},i.orderNumber.message)),a.createElement("div",{className:"space-y-2"},a.createElement("label",{htmlFor:"refund-message",className:"text-dnd-yellow font-inter text-_2024 tracking-tight font-medium"},"Message"),a.createElement("textarea",Object.assign({id:"refund-message",className:"w-full rounded placeholder:text-[#526E87] bg-white py-3 px-2.5 text-_1619 font-medium font-inter tracking-tighter",placeholder:"Enter your message...",rows:5},r("message",{required:"Message field is required"}))),a.createElement("div",null,a.createElement("p",{className:"text-sm text-dnd-red tracking-32"},i.message&&i.message.message)))),a.createElement("div",{className:"mt-16 lg:mt-auto flex justify-end"},a.createElement("button",{className:"bg-dnd-yellow rounded py-[15px] px-4 text-dnd-darker-grey font-inter text-_1417 font-medium uppercase"},"Submit"))))))};var N=e=>{let{orders:t}=e;const{0:r,1:n}=(0,a.useState)(null),i=(0,a.useRef)(t.map((()=>a.createRef()))),{0:l,1:o}=(0,a.useState)(!1),{0:m,1:N}=(0,a.useState)(null),{0:M,1:y}=(0,a.useState)(null),f=e=>{N(e),y((e=>t[r])),o(!0)};return a.createElement("div",{className:"w-full border-white border-solid border-t border-b divide-y divide-solid divide-white"},a.createElement(c.A,{showModal:l,handleClose:()=>{o((e=>!1)),y((e=>null))}},"enquire"===m?a.createElement(g,{order:M}):a.createElement(p,{order:M})),t.map(((e,t)=>{var l,o;return a.createElement("div",{key:t,className:"divide-y divide-dnd-darker-grey divide-solid"},a.createElement("div",{className:"flex justify-between items-center py-4 cursor-pointer",onClick:()=>(e=>{n((t=>t===e?null:e))})(t)},a.createElement("h3",{className:"text-white font-inter font-medium text-_1822"},"Order No. #",e.orderNumber),r===t?a.createElement(d,{width:8,height:4}):a.createElement(u,{width:8,height:4})),a.createElement("div",{ref:i.current[t],className:"transition-all duration-300 ease-in-out overflow-hidden divide-y divide-dnd-darker-grey divide-solid",style:{height:r===t?`${null===(l=i.current[t].current)||void 0===l?void 0:l.scrollHeight}px`:"0px"}},a.createElement("div",{className:"divide-y divide-dnd-lighter-grey divide-solid"},null==e||null===(o=e.lineItems)||void 0===o?void 0:o.map(((e,t)=>a.createElement("div",{key:t,className:"py-6"},a.createElement("div",{className:"flex"},a.createElement("div",{className:"mr-6 w-[200px] h-[200px]"},a.createElement("img",{src:e.image,alt:e.name,className:"!w-full !h-full rounded"})),a.createElement("div",{className:"space-y-4"},a.createElement("div",null,a.createElement("h4",{className:"font-benguiat font-normal text-white text-_2429",dangerouslySetInnerHTML:{__html:e.title}}
467),a.createElement("h5",{className:"text-white font-inter font-medium lg:text-_1822"},e.variation),a.createElement("h5",{className:"text-white font-inter font-medium lg:text-_1822"},"QTY: ",e.quantity))),a.createElement("div",{className:"flex flex-col justify-between items-end ml-auto self-end lg:self-auto"},a.createElement("div",{className:"flex gap-2.5"},a.createElement("p",{className:"text-white font-inter font-medium lg:text-_1822"},(0,s.$g)(e.total))))))))),a.createElement("div",{className:"flex flex-col md:flex-row justify-between"},a.createElement("div",{className:"py-4 flex justify-end mt-auto"},a.createElement("table",{className:"table-fixed border-separate border-spacing-y-2"},a.createElement("tbody",null,a.createElement("tr",{className:"text-white font-inter text-_1822 font-medium"},a.createElement("td",null,"Order Date:"),a.createElement("td",{className:"text-right"},(0,s.r6)(e.date))),a.createElement("tr",{className:"text-white font-inter text-_1822 font-medium"},a.createElement("td",null,"Order Status:"),a.createElement("td",{className:"text-right uppercase"},e.status))))),a.createElement("div",{className:"py-4 flex justify-end mt-auto"},a.createElement("table",{className:"table-fixed border-separate border-spacing-y-2"},a.createElement("tbody",null,a.createElement("tr",{className:"text-white font-inter text-_1822 font-medium"},a.createElement("td",null,"Shipping Cost:"),a.createElement("td",{className:"text-right"},(0,s.$g)(e.shippingTotal))),a.createElement("tr",{className:"text-white font-inter text-_1822 font-medium"},a.createElement("td",null,"Order Total:"),a.createElement("td",{className:"text-right"},(0,s.$g)(e.total))))))),a.createElement("div",{className:"flex gap-4 py-4"},a.createElement("button",{className:"bg-dnd-yellow rounded text-dnd-darker-grey text-_1417 uppercase font-inter font-medium p-4",onClick:()=>f("enquire")},"Enquire"),a.createElement("button",{className:"bg-dnd-yellow rounded text-dnd-darker-grey text-_1417 uppercase font-inter font-medium p-4",onClick:()=>f("refund")},"Refund"))))})))};var M=e=>{let{location:t}=e;const{user:r}=(0,i.Ay)(),{orders:s}=null!=r?r:{};return a.createElement(l.A,{location:t},(null==s?void 0:s.length)>0?a.createElement("div",{className:"orders"},a.createElement(N,{orders:s})):a.createElement("div",{className:"flex justify-center items-center w-full h-full"},a.createElement("div",{className:"text-white font-inter text-_1818"},"You have not made any orders yet. Please check out ",a.createElement(n.Link,{to:"/collections",className:"underline"},"our collections")," to make a purchase.")))}},5186:function(e,t,r){r.d(t,{NR:function(){return d},vx:function(){return u}});var a=r(8413),n=r(4194),i=r(888);const l="auth-token",s="auth-refresh-token",o=()=>"undefined"!=typeof window,d=(e,t)=>{o()&&(e&&window.localStorage.setItem(l,e),t&&window.localStorage.setItem(s,t))},u=async()=>{try{o()&&(window.localStorage.removeItem(l),window.localStorage.removeItem(s)),await a.S.resetStore(),(0,n.navigate)("/auth/login"),i.oR.success("Successfully logged out")}catch(e){console.error("Logout error:",e),i.oR.error("Failed to logout. Please try again.")}}},9938:function(e,t,r){r.d(t,{n:function(){return c}});var a=r(5215),n=r(7243),i=r(144),l=r(5381),s=r(5443),o=r(9211),d=r(111),u=r(2619).Sw?n.useLayoutEffect:n.useEffect;function c(e,t){var r=(0,d.m)(null==t?void 0:t.client);(0,s.D$)(e,s.KG.Mutation);var c=n.useState({called:!1,loading:!1,client:r}),m=c[0],g=c[1],p=n.useRef({result:m,mutationId:0,isMounted:!0,client:r,mutation:e,options:t});u((function(){Object.assign(p.current,{client:r,options:t,mutation:e})}));var N=n.useCallback((function(e){void 0===e&&(e={});var t=p.current,r=t.options,n=t.mutation,s=(0,a.Cl)((0,a.Cl)({},r),{mutation:n}),d=e.client||p.current.client;p.current.result.loading||s.ignoreResults||!p.current.isMounted||g(p.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:d});var u=++p.current.mutationId,c=(0,i.l)(s,e);return d.mutate(c).then((function(t){var r,a,n=t.data,i=t.errors,s=i&&i.length>0?new o.K4({graphQLErrors:i}):void 0,m=e.onError||(null===(r=p.current.options)||void 0===r?void 0:r.onError);if(s&&m&&m(s,c),u===p.current.mutationId&&!c.ignoreResults){var N={called:!0,loading:!1,data:n,error:s,client:d};p.current.isMounted&&!(0,l.L)(p.current.result,N)&&g(p.current.result=N)}var M=e.onCompleted||(null===(a=p.current.options)||void 0===a?void 0:a.onCompleted);return s||null==M||M(t.data,c),t})).catch((function(t){var r;if(u===p.current.mutationId&&p.current.isMounted){var a={loading:!1,error:t,data:void 0,called:!0,client:d};(0,l.L)(p.current.result,a)||g(p.current.result=a)}var n=e.onError||(null===(r=p.current.options)||void 0===r?void 0:r.onError);if(n)return n(t,c),{data:void 0,errors:t};throw t}))}),[]),M=n.useCallback((function(){if(p.current.isMounted){var e={called:!1,loading:!1,client:p.current.client};Object.assign(p.current,{mutationId:0,result:e}),g(e)}}),[]);return n.useEffect((function(){var e=p.current;return e.isMounted=!0,function(){e.isMounted=!1}}),[]),[N,(0,a.Cl)({reset:M},m)]}}}]);
468//# sourceMappingURL=component---src-pages-account-past-orders-js-3160658d07ae5bfdfa02.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.