PageSourceSearch

https://estore.cannonmt.com/static/js/common-d84e0239.1f46669be4a4b7e6.js

js cannonmt.com collected 2026-10-02 08:35:41 UTC 100,200 bytes, 1,345 lines download raw bytes

1"use strict";(globalThis.webpackChunkentabeni_ecommerce||=[]).push([[5786],{65496(e,t,r){r.d(t,{A:()=>C});var n=r(74848),o=r(96540),i=r(79056),a=r(52079),d=r(11693),s=r(82702),l=r(20324),c=r(21480),u=r(28048),m=r(97235),p=r(91850),g=r(35861),h=r(26882),y=r(6421),I=r(23978);const f=i.default.div`
2  width: 100%;
3  height: 100%;
4  display: grid;
5  grid-template-rows: auto 1fr auto auto;
6
7  .info-mssg {
8    padding: 0.5rem 1.3rem;
9    margin-bottom: 1rem;
10    border: 1px solid #e65100;
11    background-color: #fff3e0;
12    color: #e65100;
13    line-height: 1.4;
14  }
15`,v=i.default.div`
16  margin: 0 auto;
17  padding: 0 ${e=>e.theme.spacingMed};
18  width: 100%;
19  max-width: ${e=>e.theme.maxWidth};
20  color: ${e=>e.theme.greyDarkShade};
21  background-color: ${e=>e.theme.white};
22
23  & > h5 {
24    text-align: right;
25    padding: 0.6rem 0;
26    border-top: 1px solid ${e=>e.theme.greyShade};
27  }
28`,S=y.Ay`
29  query AuthAccount {
30    ecommerce {
31      authAccount {
32        assignGuestNoun
33      }
34    }
35  }
36`,C=e=>{let{order:t,handleChangeQuantity:r,handleUpsellQuantityChange:i,handleCheckoutClick:y,handleRemoveProduct:C,handleRemoveUpsellItem:x,checkingOut:b,itemsDeleted:A,applyOrderUpdate:j}=e;const[P,O]=(0,o.useState)("Guest"),[w]=(0,I._l)(S,{onCompleted:e=>{O(e.ecommerce.authAccount.assignGuestNoun)},onError:e=>{(0,s.tj)("CartContent: Failed to load account data",e,{mode:"Cart",component:"CartContent"})}});(0,o.useEffect)(()=>{l.A.isAuthenticated()&&w()},[]);const k=(0,d.$y)(t.orderLineItems),$=t.orderLineItems.some(e=>Array.isArray(e.voucherCodes)?e.voucherCodes.length>0:!!e.voucherCodes)&&0===Number(t.subTotal)?"Tendered":t.subTotal;return(0,n.jsx)(p.HD,{height:"100%",children:(0,n.jsxs)(f,{rows:"auto 1fr auto auto",children:[(0,n.jsx)(p.gO,{padding:"spacingMed",children:(0,n.jsx)(c.o,{title:`${(0,d.ZH)(P)} Cart`,count:k})}),(0,n.jsxs)(p.gO,{padding:"spacingMed",children:[A&&(0,n.jsx)("p",{className:"info-mssg",children:"Your cart has been updated and the timed out items removed. Please review again."}),t.orderLineItems.map((e,t)=>(0,n.jsx)(m.x,{itemNum:t,applyOrderUpdate:j,orderLineItem:e,onChangeQuantity:r,onUpsellQuantityChange:i,onRemove:C,onRemoveUpsellItem:x},e.id))]}),(0,n.jsx)(v,{children:(0,n.jsxs)(a.Km,{id:"totalOrderPrice",size:"1.4rem",regular:!0,marginBottom:"0",children:["Subtotal:  ",(0,n.jsx)("b",{children:"Tendered"===$.toString()?$:(0,d.vv)(+$)})]})}),(0,n.jsx)(h.I,{children:(0,n.jsxs)("div",{className:"footerWarpper",children:[(0,n.jsx)(u.v,{className:"shoppingBtn",linkTo:"",type:"teriary",linkTitle:"Continue Shopping",small:!0,split:"true"}),(0,n.jsx)(g.S,{title:"Checkout",kind:"primary",small:!0,split:!0,loading:b,handleOnClick:()=>y()})]})})]})})}},63044(e,t,r){r.d(t,{A:()=>c});var n=r(74848),o=(r(96540),r(79056)),i=r(67554),a=r(52079),d=r(28048),s=r(66420);const l=o.default.div`
37  align-items: center;
38  display: flex;
39  flex-direction: column;
40  height: 100%;
41  justify-content: center;
42  margin: 0 auto;
43  max-width: 50vw;
44  padding: 0 1rem;
45  width: 100%;
46
47  @media screen and (max-width: ${i.A.breakpoints.phone}px) {
48    max-width: 100% !important;
49  }
50
51  .info-mssg {
52    background-color: #fff3e0;
53    border: 1px solid #e65100;
54    color: #e65100;
55    line-height: 1.4;
56    margin: 2rem auto 0;
57    padding: 0.5rem 1.3rem;
58  }
59`,c=e=>{let{itemsDeleted:t}=e;return(0,n.jsxs)(l,{children:[t&&(0,n.jsx)("p",{className:"info-mssg",children:"Your cart has been updated and the timed out items removed. Please review again."}),(0,n.jsx)(s.i,{}),(0,n.jsx)(a.DK,{marginBottom:"spacingTiny",children:"Your cart is empty"}),(0,n.jsx)(a.u_,{marginBottom:"spacingSml",textAlign:"center",color:"greyShade",children:"Looks like you have not added any products yet."}),(0,n.jsx)(d.v,{linkTo:"",linkTitle:"Add items to your cart",small:!0,type:"green",solid:"green",margin:"0 auto 4rem"})]})}},13696(e,t,r){r.d(t,{A:()=>d});var n=r(74848),o=(r(96540),r(21480)),i=r(91850),a=r(62577);const d=e=>{let{updateOrderLineItem:t,currentOrderId:r,handleQuantitySelect:d}=e;const s=t.maxQuantity&&t.maxQuantity<=8?t.maxQuantity:8;return(0,n.jsxs)(i.gO,{padding:"spacingMed",children:[(0,n.jsx)(o.K,{title:"Update product quantity",subtitle:"Select the amount you desire"}),(0,n.jsx)(i.Db,{size:"spacingMed",top:!0,bottom:!0,children:Array(s).fill(!0).map((e,o)=>(0,n.jsx)(a.A,{quantity:o+1,updateOrderLineItem:t,currentOrderId:r,onQuantitySelect:d},o))})]})}},52063(e,t,r){r.d(t,{A:()=>s});var n=r(74848),o=(r(96540),r(21480)),i=r(91850),a=r(19430),d=r(49138);const s=e=>{let{currentOrderId:t,updateUpsellLineItem:r,min:s,max:l,onUpsellItemQtySeleted:c}=e;const u=(0,d.GR)(l).slice(s-1);return(0,n.jsxs)(i.gO,{padding:"spacingMed",children:[(0,n.jsx)(o.K,{title:"Update product quantity",subtitle:"The quantity options are set from the minimum to maximum required amounts."}),(0,n.jsx)(i.Db,{size:"spacingMed",top:!0,bottom:!0,children:u.map(e=>(0,n.jsx)(a.A,{quantity:+e,baseAmount:Number(r.price),currentOrderId:t,onQuantitySelect:c},r.id))})]})}},46654(e,t,r){r.d(t,{A:()=>T});var n=r(74848),o=r(96540),i=r(66967),a=r(60799),d=r(23978),s=r(56073),l=r(81388),c=r(74590),u=r(46019),m=r(9825),p=r(35861),g=r(91850),h=r(86222),y=r(39238),I=r(11693),f=r(89001),v=r(82702),S=r(68385),C=r(6421);const x=C.Ay`
60  mutation CreateUser(
61    $firstName: String!
62    $lastName: String!
63    $email: String!
64    $dateOfBirth: String
65    $parentId: String!
66    $phone: String
67    $checkDuplicates: Boolean!
68    $level: String
69    $stance: String
70    $discipline: String
71    $weight: Float
72    $height: Float
73    $shoeSize: Float
74    $shoeSizeType: String
75    $checkLinkedDuplicates: Boolean
76  ) {
77    ecommerce {
78      createUser(
79        firstName: $firstName
80        lastName: $lastName
81        email: $email
82        dateOfBirth: $dateOfBirth
83        parentId: $parentId
84        active: false
85        phone: $phone
86        checkDuplicates: $checkDuplicates
87        level: $level
88        stance: $stance
89        discipline: $discipline
90        weight: $weight
91        height: $height
92        shoeSize: $shoeSize
93        shoeSizeType: $shoeSizeType
94        checkLinkedDuplicates: $checkLinkedDuplicates
95      ) {
96        user {
97          id
98          age
99          firstName
100          lastName
101          dateOfBirth
102          phone
103          hasLinkedGuest
104          level
105          customerNumber
106          stance
107          discipline
108          weight
109          height
110          shoeSize
111          shoeSizeType
112        }
113        matchingUsers {
114          customerNumber
115          email
116          fullName
117          phone
118          profilePictureUrl
119        }
120      }
121    }
122  }
123`,b=C.Ay`
124  mutation Updateuser(
125    $userId: String!
126    $level: String
127    $stance: String
128    $discipline: String
129    $weight: Float
130    $height: Float
131    $shoeSize: Float
132    $shoeSizeType: String
133    $dateOfBirth: String
134  ) {
135    ecommerce {
136      updateUser(
137        id: $userId
138        level: $level
139        stance: $stance
140        discipline: $discipline
141        weight: $weight
142        height: $height
143        shoeSize: $shoeSize
144        shoeSizeType: $shoeSizeType
145        dateOfBirth: $dateOfBirth
146      ) {
147        id
148        age
149        firstName
150        lastName
151        dateOfBirth
152        phone
153        level
154        customerNumber
155        stance
156        discipline
157        weight
158        height
159        shoeSize
160        shoeSizeType
161      }
162    }
163  }
164`,A=C.Ay`
165  query GetUser($customerNumber: String!, $productId: String!, $ageVariantId: String, $forDate: String) {
166    ecommerce {
167      user(customerNumber: $customerNumber, productId: $productId, ageVariantId: $ageVariantId, forDate: $forDate) {
168        id
169        age
170        firstName
171        lastName
172        dateOfBirth
173        profilePictureUrl
174        canBeSelected
175        cannotBeSelectedReason
176        level
177        stance
178        hasLinkedGuest
179        discipline
180        weight
181        height
182        shoeSize
183        shoeSizeType
184        parent {
185          id
186        }
187      }
188    }
189  }
190`,j=C.Ay`
191  query Order($id: String!) {
192    ecommerce {
193      order(id: $id) {
194        id
195        orderLineItems {
196          id
197          product {
198            id
199            description
200            productItems {
201              productItemId
202              itemType
203            }
204            eligibleDisciplines
205            partnerAccountRedemptionLevel
206            requireDependentProducts
207          }
208          upsellOrderLineItems {
209            id
210            needsGuest
211            guestLineItems {
212              id
213              guest {
214                id
215                firstName
216                lastName
217                age
218                canBeSelected
219                hasLinkedGuest
220                level
221                stance
222                discipline
223                weight
224                height
225                shoeSize
226                shoeSizeType
227              }
228              guestOptions {
229                id
230                firstName
231                lastName
232                age
233                hasLinkedGuest
234                redemptionsAvailable
235                dateOfBirth
236                profilePictureUrl
237                canBeSelected
238                cannotBeSelectedReason
239                level
240                stance
241                discipline
242                weight
243                height
244                shoeSize
245                shoeSizeType
246              }
247            }
248          }
249          guestLineItems {
250            id
251            guest {
252              id
253              firstName
254              lastName
255              age
256              level
257              stance
258              canBeSelected
259              hasLinkedGuest
260              discipline
261              weight
262              height
263              shoeSize
264              shoeSizeType
265            }
266            guestOptions {
267              id
268              firstName
269              lastName
270              redemptionsAvailable
271              age
272              dateOfBirth
273              profilePictureUrl
274              hasLinkedGuest
275              canBeSelected
276              cannotBeSelectedReason
277              level
278              stance
279              discipline
280              weight
281              height
282              shoeSize
283              shoeSizeType
284            }
285          }
286        }
287      }
288    }
289  }
290`,P=C.Ay`
291  query Order($id: String!) {
292    ecommerce {
293      user {
294        id
295        age
296        firstName
297        lastName
298        dateOfBirth
299        phone
300      }
301      authAccount {
302        ageCalculationMethod
303        ageCalculationDate
304        disciplinesAvailable
305        endOfWinterSeasonMonth
306        linkedGuestCopy
307        existingGuestCopy
308        hasPartnerships
309        measurement
310        newGuestCopy
311        assignGuestNoun
312      }
313      order(id: $id) {
314        id
315        orderLineItems {
316          id
317          name
318          description
319          guestId
320          quantity
321          needsGuest
322          forDate
323          product {
324            id
325            productItems {
326              productItemId
327              itemType
328            }
329            partnerAccountRedemptionLevel
330            eligibleDisciplines
331            requireDependentProducts
332            productType
333            description
334            questionnaire {
335              id
336              name
337              description
338              questionnaireSteps {
339                id
340                name
341                description
342                stepNumber
343                questions {
344                  id
345                  questionText
346                  formElement
347                  ranking
348                  required
349                  description
350                  options {
351                    id
352                    optionText
353                    followUpQuestion {
354                      id
355                      required
356                      description
357                      formElement
358                      questionText
359                      options {
360                        id
361                        optionText
362                        followUpQuestion {
363                          id
364                          required
365                          description
366                          formElement
367                          questionText
368                          options {
369                            id
370                            optionText
371                            followUpQuestionId
372                          }
373                        }
374                      }
375                    }
376                    ranking
377                  }
378                }
379              }
380            }
381          }
382          eventLineItems {
383            id
384            eventId
385            eventGroupId
386            productItemId
387            requestedInstructorId
388            requestedIntructorName
389            event {
390              startTime
391              endTime
392              day
393            }
394          }
395          upsellOrderLineItems {
396            id
397            name
398            price
399            quantity
400            needsGuest
401            total
402            needsGuestObject {
403              ageVariant {
404                id
405                ageTo
406                ageFrom
407                title
408                range
409              }
410              guestOptions {
411                id
412                firstName
413                redemptionsAvailable
414                lastName
415                age
416                dateOfBirth
417                profilePictureUrl
418                level
419                hasLinkedGuest
420                stance
421                discipline
422                weight
423                height
424                shoeSize
425                shoeSizeType
426              }
427            }
428            product {
429              id
430              productItems {
431                productItemId
432                itemType
433              }
434              productType
435              description
436              eligibleDisciplines
437              partnerAccountRedemptionLevel
438              questionnaire {
439                id
440                name
441                description
442                questionnaireSteps {
443                  id
444                  name
445                  description
446                  stepNumber
447                  questions {
448                    id
449                    questionText
450                    formElement
451                    ranking
452                    required
453                    description
454                    options {
455                      id
456                      optionText
457                      followUpQuestion {
458                        id
459                        required
460                        description
461                        formElement
462                        questionText
463                        options {
464                          id
465                          optionText
466                          followUpQuestionId
467                        }
468                      }
469                      ranking
470                    }
471                  }
472                }
473              }
474            }
475            guestLineItems {
476              id
477              guestOptions {
478                id
479                firstName
480                lastName
481                redemptionsAvailable
482                age
483                hasLinkedGuest
484                dateOfBirth
485                profilePictureUrl
486                level
487                stance
488                discipline
489                weight
490                height
491                shoeSize
492                shoeSizeType
493              }
494              guest {
495                id
496                firstName
497                lastName
498                age
499                level
500                stance
501                canBeSelected
502                hasLinkedGuest
503                discipline
504                weight
505                height
506                shoeSize
507                shoeSizeType
508              }
509              ageVariant {
510                id
511                ageTo
512                ageFrom
513                title
514                range
515              }
516              answers {
517                id
518                questionnaireId
519                questionId
520                answerJsonb
521                userId
522              }
523            }
524            productAddOn {
525              minQuantity
526              maxQuantity
527              addAutomatically
528              requireGuest
529              upsellProductId
530            }
531          }
532          guestLineItems {
533            id
534            guestOptions {
535              id
536              firstName
537              lastName
538              redemptionsAvailable
539              age
540              hasLinkedGuest
541              dateOfBirth
542              profilePictureUrl
543              canBeSelected
544              cannotBeSelectedReason
545              level
546              stance
547              discipline
548              weight
549              height
550              shoeSize
551              shoeSizeType
552            }
553            guest {
554              id
555              firstName
556              lastName
557              age
558              level
559              canBeSelected
560              hasLinkedGuest
561              stance
562              discipline
563              weight
564              height
565              shoeSize
566              shoeSizeType
567            }
568            ageVariant {
569              id
570              ageTo
571              ageFrom
572              title
573              range
574            }
575            answers {
576              id
577              questionnaireId
578              questionId
579              answerJsonb
580              userId
581            }
582          }
583        }
584      }
585    }
586  }
587`,O=C.Ay`
588  mutation UpdateOrder($orderId: String!, $orderLineItems: [EcommerceOrderLineItemInput!]) {
589    ecommerce {
590      updateOrder(id: $orderId, orderLineItems: $orderLineItems) {
591        id
592        orderLineItems {
593          id
594          name
595          description
596          guestId
597          quantity
598          needsGuest
599          forDate
600          product {
601            id
602            productItems {
603              productItemId
604              itemType
605            }
606            productType
607            description
608            eligibleDisciplines
609            partnerAccountRedemptionLevel
610            questionnaire {
611              id
612              name
613              description
614              questionnaireSteps {
615                id
616                name
617                description
618                stepNumber
619                questions {
620                  id
621                  questionText
622                  formElement
623                  ranking
624                  required
625                  description
626                  options {
627                    id
628                    optionText
629                    followUpQuestion {
630                      id
631                      required
632                      description
633                      formElement
634                      questionText
635                      options {
636                        id
637                        optionText
638                        followUpQuestionId
639                      }
640                    }
641                    ranking
642                  }
643                }
644              }
645            }
646          }
647          eventLineItems {
648            id
649            eventId
650            eventGroupId
651            productItemId
652            requestedInstructorId
653            requestedIntructorName
654            event {
655              startTime
656              endTime
657              day
658            }
659          }
660          upsellOrderLineItems {
661            id
662            name
663            needsGuest
664            price
665            quantity
666            total
667            needsGuestObject {
668              ageVariant {
669                id
670                ageTo
671                ageFrom
672                range
673                title
674              }
675              guestOptions {
676                id
677                firstName
678                redemptionsAvailable
679                hasLinkedGuest
680                lastName
681                age
682              }
683            }
684            product {
685              id
686              productItems {
687                productItemId
688                itemType
689              }
690              productType
691              description
692              eligibleDisciplines
693              partnerAccountRedemptionLevel
694              questionnaire {
695                id
696                name
697                description
698                questionnaireSteps {
699                  id
700                  name
701                  description
702                  stepNumber
703                  questions {
704                    id
705                    questionText
706                    formElement
707                    ranking
708                    required
709                    description
710                    options {
711                      id
712                      optionText
713                      followUpQuestion {
714                        id
715                        required
716                        description
717                        formElement
718                        questionText
719                        options {
720                          id
721                          optionText
722                          followUpQuestionId
723                        }
724                      }
725                      ranking
726                    }
727                  }
728                }
729              }
730            }
731            guestLineItems {
732              id
733              guestOptions {
734                id
735                firstName
736                redemptionsAvailable
737                lastName
738                cannotBeSelectedReason
739                age
740              }
741              guest {
742                id
743                firstName
744                canBeSelected
745                hasLinkedGuest
746                lastName
747                age
748              }
749              ageVariant {
750                id
751                ageTo
752                ageFrom
753                title
754                range
755              }
756              answers {
757                id
758                questionnaireId
759                questionId
760                answerJsonb
761                userId
762              }
763            }
764            productAddOn {
765              minQuantity
766              maxQuantity
767              addAutomatically
768              requireGuest
769              upsellProductId
770            }
771          }
772          guestLineItems {
773            id
774            guestOptions {
775              id
776              firstName
777              redemptionsAvailable
778              lastName
779              age
780              dateOfBirth
781              profilePictureUrl
782              canBeSelected
783              cannotBeSelectedReason
784            }
785            guest {
786              id
787              firstName
788              canBeSelected
789              hasLinkedGuest
790              lastName
791              age
792            }
793            ageVariant {
794              id
795              ageTo
796              ageFrom
797              title
798              range
799            }
800            answers {
801              id
802              questionnaireId
803              questionId
804              answerJsonb
805              userId
806            }
807          }
808        }
809      }
810    }
811  }
812`,w=C.Ay`
813  query Account {
814    ecommerce {
815      account {
816        cardName
817        cardImage
818      }
819    }
820  }
821`,k=C.Ay`
822  mutation UpdateGuestParent($customerNumber: String!, $userID: String!) {
823    ecommerce {
824      updateParentUser(customerNumber: $customerNumber, id: $userID) {
825        id
826      }
827    }
828  }
829`,$=C.Ay`
830  mutation createPartnershipGuestLink($accountPartnershipGuestCustomerNumber: String!, $guestId: String, $guestLineItemId: String!) {
831    ecommerce {
832      createPartnershipGuestLink(
833        accountPartnershipGuestCustomerNumber: $accountPartnershipGuestCustomerNumber
834        guestId: $guestId
835        guestLineItemId: $guestLineItemId
836      ) {
837        partnershipGuestLinkId
838        success
839        reason
840      }
841    }
842  }
843`,E=C.Ay`
844  mutation updatePartnershipGuestLink($partnershipGuestLinkId: String!, $guestId: String, $verificationCode: String, $guestLineItemId: String!) {
845    ecommerce {
846      updatePartnershipGuestLink(
847        partnershipGuestLinkId: $partnershipGuestLinkId
848        guestId: $guestId
849        verificationCode: $verificationCode
850        guestLineItemId: $guestLineItemId
851      ) {
852        success
853        guest
854      }
855    }
856  }
857`,L=C.Ay`
858  mutation UpdateOrder($orderId: String!, $orderLineItemId: String!) {
859    ecommerce {
860      updateOrder(id: $orderId, orderLineItems: [{ id: $orderLineItemId, _destroy: true }], reset: true) {
861        id
862      }
863    }
864  }
865`,T=e=>{let{reverseStep:t,updateStep:r,updatingStep:C,onErrorAction:T}=e;const[N]=(0,i.A)([(0,I.i0)()]),D=(0,o.useContext)(s.A),M=(0,f.So)(N[(0,I.i0)()]),[B,R]=(0,o.useState)(!1),[F,G]=(0,o.useState)(!1),[q,U]=(0,o.useState)(null),[z,_]=(0,o.useState)(!1),[V,H]=(0,o.useState)(null),[W,Q]=(0,o.useState)(!1),[K,Y]=(0,o.useState)(!1),[J,Z]=(0,o.useState)(null),[X,ee]=(0,o.useState)(null),[te,re]=(0,o.useState)(null),[ne,oe]=(0,o.useState)(null),[ie,ae]=(0,o.useState)(null),[de,se]=(0,o.useState)(!1),[le,ce]=(0,o.useState)(null),[ue,me]=(0,o.useState)(null),[pe,ge]=(0,o.useState)([]),[he,ye]=(0,o.useState)([]),Ie=(0,o.useRef)(performance.now()),{data:fe,loading:ve,error:Se}=(0,d.IT)(P,{variables:{id:M},fetchPolicy:"no-cache",onCompleted:e=>{var t,r;const n=Math.round(performance.now()-Ie.current);(0,v.y9)("assign_guests",n,{orderId:M,guestCount:(null===(t=e.ecommerce.order.orderLineItems)||void 0===t?void 0:t.filter(e=>e.needsGuest).length)||0,lineItemsCount:(null===(r=e.ecommerce.order.orderLineItems)||void 0===r?void 0:r.length)||0})},onError:e=>{(0,v.tj)("AssignGuests: Failed to load order",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M}})}}),{data:Ce}=(0,d.IT)(w,{onError:e=>{(0,v.tj)("AssignGuests: Failed to load card details",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M}})}}),[xe,{data:be,error:Ae}]=(0,d._l)(A),[je,{data:Pe,loading:Oe}]=(0,d._l)(j,{variables:{id:M},fetchPolicy:"no-cache",onError:e=>{(0,v.tj)("AssignGuests: Failed to reload order info",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M}}),se(!1)}}),[we]=(0,d.n_)(L,{fetchPolicy:"no-cache"}),[ke]=(0,d.n_)(x,{fetchPolicy:"no-cache"}),[$e]=(0,d.n_)(b,{fetchPolicy:"no-cache"}),[Ee]=(0,d.n_)(O,{fetchPolicy:"no-cache"}),[Le]=(0,d.n_)(k,{fetchPolicy:"no-cache"}),[Te]=(0,d.n_)($),[Ne]=(0,d.n_)(E),De=()=>{ae(null),se(!0),je()},Me=(e,t)=>{var r;(0,v.tj)("AssignGuests: Order update error",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,orderLineItemId:t}}),"Order line items base You need 1 permission code"===(null===(r=null==e?void 0:e.graphQLErrors[0])||void 0===r?void 0:r.message)&&we({variables:{orderId:M,orderLineItemId:t}}).then(()=>{T()}).catch(e=>{(0,v.tj)("AssignGuests: Failed to remove order line item",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,orderLineItemId:t}})})},Be=(e,t,r,n,o,i)=>{Y(!0);const d={orderId:M,orderLineItems:{id:e}};n?d.orderLineItems.upsellOrderLineItems=[{id:n,guestLineItems:[{id:r,guestId:o,ageVariantId:t}]}]:d.orderLineItems.guestLineItems=[{id:r,guestId:o,ageVariantId:t}],Ee({variables:d}).then(e=>{oe(e.data),Y(!1),ce(null),me(null),a.oR.success(`${(0,I.ZH)(fe.ecommerce.authAccount.assignGuestNoun)} account successfully created!`,(0,I.CE)()),De(),i&&i()}).catch(t=>Me(t,e))},Re=()=>{Z(null),ee(null),G(!1),re(null)},Fe=function(e){let{orderLineItemId:t,ageVariantId:r,firstName:n,lastName:o,email:i,dateOfBirth:d,phone:s,parentId:l,guestLineItemId:c,upsellLineItemId:u,level:m,stance:p,discipline:g,weight:h,height:y,shoeSize:f,shoeSizeType:C,updateGuestLinkAfterCreation:x,redemptionLevel:b,checkLinkedDuplicates:A}=e,j=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,P=arguments.length>2&&void 0!==arguments[2]&&arguments[2],O=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const w=(0,S.j2)(d);w?(g="other"===g?null:g,R(!0),ke({variables:{firstName:n,lastName:o,email:i,dateOfBirth:w,phone:s,parentId:l,checkDuplicates:A,level:m,stance:p,discipline:g,weight:h,height:y,shoeSize:f,shoeSizeType:C,checkLinkedDuplicates:A}}).then(e=>{var l,S,A;R(!1),(null===(S=null===(l=e.data.ecommerce.createUser)||void 0===l?void 0:l.matchingUsers)||void 0===S?void 0:S.length)>0&&null==(null===(A=e.data.ecommerce.createUser)||void 0===A?void 0:A.user)?(ce(e.data.ecommerce.createUser.matchingUsers),me({firstName:n,lastName:o,email:i,dateOfBirth:d,phone:s,level:m,stance:p,discipline:g,weight:h,height:y,shoeSize:f,shoeSizeType:C})):(re(null),Z(null),x?Ne({variables:{guestId:e.data.ecommerce.createUser.user.id,guestLineItemId:c,partnershipGuestLinkId:J}}).then(n=>{a.oR.success("Guest Link updated successfully!",(0,I.CE)());const{success:o,guest:i}=n.data.ecommerce.updatePartnershipGuestLink;if(o){const n=JSON.parse(i).guest;let o=null;n&&(re(n),o=n.redemptionObject&&b&&n.redemptionObject.table.redemption_available===b),o?Be(t,r,c,u,e.data.ecommerce.createUser.user.id,j):(Re(),a.oR.error("No available redemptions, please select a new guest!",(0,I.CE)()),je(),j(!0))}}).catch(t=>{(0,v.tj)("AssignGuests: Failed to update partnership guest link",t,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,guestId:e.data.ecommerce.createUser.user.id,guestLineItemId:c,partnershipGuestLinkId:J}}),Re(),a.oR.error("Failed to update guest link. Please try again.",(0,I.CE)())}):P?(De(),O(e.data.ecommerce.createUser.user),j()):Be(t,r,c,u,e.data.ecommerce.createUser.user.id,j))}).catch(e=>{R(!1),(0,v.tj)("AssignGuests: Failed to create guest",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,orderLineItemId:t,guestLineItemId:c,email:i}}),a.oR.error("Failed to create guest. Please try again.",(0,I.CE)())})):a.oR.error("Please provide a valid date of birth.",(0,I.CE)())},Ge=function(e){let{orderLineItemId:t,upsellLineItemId:r,guestLineItemId:n,guestId:o,ageVariantId:i,verificationCode:d,redemptionLevel:s}=e,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;G(!0),d=d.trim(),Ne({variables:{verificationCode:d,guestId:o,guestLineItemId:n,partnershipGuestLinkId:J}}).then(e=>{G(!1);const{success:d,guest:u}=e.data.ecommerce.updatePartnershipGuestLink;if(d){const e=JSON.parse(u).guest;re(e);const d=e.redemptionObject&&s&&e.redemptionObject.table.redemption_available===s;
865o&&d&&Be(t,i,n,r,o,l),!d&&o&&(Re(),De(),a.oR.error("No available redemptions, please select a new guest!",(0,I.CE)()),c&&c())}}).catch(e=>{(0,v.tj)("AssignGuests: Error adding link",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M}}),De(),a.oR.error("Error link adding",(0,I.CE)()),ee("Wrong verification code."),G(!1)})},qe=e=>{let{guestId:t,guestLineItemId:r,partnerAccountCustomerCode:n,guestDetails:o}=e;const i=pe.find(e=>e.partnerAccountCustomerCode===n);if(n=n.trim(),null==i)G(!0),Te({variables:{accountPartnershipGuestCustomerNumber:n,guestId:t,guestLineItemId:r}}).then(e=>{G(!1);const{success:t,reason:r,partnershipGuestLinkId:i}=e.data.ecommerce.createPartnershipGuestLink;t?(a.oR.success("Guest found. Please check your email for message with verification code!",(0,I.CE)()),ge([...pe,{partnerAccountCustomerCode:n,guestDetails:o}]),Z(i),ee(null)):(ee(r||"Guest not found."),a.oR.error(r||"Guest not found.",(0,I.CE)()))}).catch(e=>{(0,v.tj)("AssignGuests: Partnership verification failed",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M}}),ee("Something went wrong."),a.oR.error("Something went wrong.",(0,I.CE)()),G(!1)});else{const e=`Indy Pass guest already linked to ${i.guestDetails.firstName} ${i.guestDetails.lastName}`;ee(e),a.oR.error(e,(0,I.CE)())}},Ue=e=>{let{orderLineItemId:t,ageVariantId:r,guestId:n,dateOfBirth:o,guestLineItemId:i,upsellLineItemId:d,breakOnSuccess:s,level:l,stance:c,discipline:u,weight:m,height:p,shoeSize:g,shoeSizeType:h,onSuccess:y,onOrderSuccess:f}=e;const C=(0,S.j2)(o);C?(G(!0),u="other"===u?null:u,$e({variables:{userId:n,dateOfBirth:C,level:l,stance:c,discipline:u,weight:m,height:p,shoeSize:g,shoeSizeType:h}}).then(()=>{if(G(!1),y&&y(),s)return;Y(!0);const e={orderId:M,orderLineItems:{id:t}};d?e.orderLineItems.upsellOrderLineItems=[{id:d,guestLineItems:[{id:i,guestId:n,ageVariantId:r}]}]:e.orderLineItems.guestLineItems=[{id:i,guestId:n,ageVariantId:r}],Ee({variables:e}).then(e=>{a.oR.success("Guest data successfully updated!",(0,I.CE)()),oe(e.data),Y(!1),De(),f&&f()}).catch(e=>Me(e,t))}).catch(e=>{G(!1),(0,v.tj)("AssignGuests: Failed to update guest",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,guestId:n,orderLineItemId:t,guestLineItemId:i}}),a.oR.error("Failed to update guest. Please try again.",(0,I.CE)())})):a.oR.error("Please provide a valid date of birth.",(0,I.CE)())},ze=(e,t,r,n)=>{_(!1),H(null),Q(!0);const o={customerNumber:e,productId:t};n&&(o.ageVariantId=n),r&&"Invalid date"!==r&&(o.forDate=r),xe({variables:o})},_e=()=>U(null),Ve=(e,t)=>{let{customerNumber:r,userID:n,onSuccess:o}=e;Le({variables:{customerNumber:r,userID:n}}).then(()=>{o&&o(),a.oR.success("Guest successfully added to your account!",(0,I.CE)()),t&&He.apply(null,t)}).catch(e=>{(0,v.tj)("AssignGuests: Failed to update guest parent",e,{mode:"Checkout",component:"AssignGuests",context:{orderId:M,customerNumber:r,userID:n}}),a.oR.error("Failed to add guest to your account. Please try again.",(0,I.CE)())})},He=(e,t,r,n,o,i)=>{const d={orderId:M,orderLineItems:{id:e,upsellOrderLineItems:[]}};n.upsellLineItemId?d.orderLineItems.upsellOrderLineItems=[{id:n.upsellLineItemId,guestLineItems:[{id:n.guestLineItemId,guestId:r,ageVariantId:t}]}]:d.orderLineItems.guestLineItems=[{id:n.guestLineItemId,guestId:r,ageVariantId:t}],Y(!0),Ee({variables:d}).then(e=>{if(a.oR.success("Guest successfully assigned to product!",(0,I.CE)()),oe(e.data),Y(!1),n&&n.partnerAccountRedemptionLevel&&o){const e=he.find(e=>e.guestLineItemId===n.guestLineItemId),t=n.partnerAccountRedemptionLevel,i=[];i[t]=o[t],e?(e.guestId=r,e.availRedemptionsCount=i,e.forDate=(0,S.SH)(n.forDate),ye(he)):ye([...he,{guestId:r,forDate:(0,S.SH)(n.forDate),guestLineItemId:n.guestLineItemId,availRedemptionsCount:i}])}De(),i&&i()}).catch(t=>Me(t,e))},We=function(e){let{orderLineItemId:t,ageVariantId:r,guestId:n,answers:o,guestLineItemId:i,upsellLineItemId:d}=e,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const l={orderId:M,orderLineItems:{id:t,upsellOrderLineItems:[]}};d?l.orderLineItems.upsellOrderLineItems=[{id:d,guestLineItems:[{id:i,guestId:n,ageVariantId:r,answers:o}]}]:l.orderLineItems.guestLineItems=[{id:i,guestId:n,ageVariantId:r,answers:o}],Y(!0),Ee({variables:l}).then(e=>{a.oR.success("Data successfully saved!",(0,I.CE)()),oe(e.data),Y(!1),De(),s&&s()}).catch(e=>Me(e,t))},Qe=e=>{let t=!1;
865return e.orderLineItems.forEach(e=>{if(e.needsGuest){const r=e.guestLineItems;for(const e of r)if(e&&null===e.guest){t=!0;break}}e.upsellOrderLineItems.forEach(e=>{var r;if(null===(r=null==e?void 0:e.productAddOn)||void 0===r?void 0:r.requireGuest)for(let r=0;r<e.quantity;r++){const n=e.guestLineItems[r];if(n&&null===n.guest){t=!0;break}}})}),t};(0,o.useEffect)(()=>{de&&!Oe&&null!=Pe&&ae(Pe)},[ie,Pe]);return(0,o.useEffect)(()=>{if(be&&be.ecommerce&&be.ecommerce.user)Q(!1),U(be.ecommerce.user);else if(Ae||be&&be.ecommerce&&null===be.ecommerce.user){let e=Ae&&Ae.graphQLErrors?Ae.graphQLErrors.map(e=>e.message):"";Q(!1),_(!0),Ae||(e="It seems the account you're looking for doesn't exist in our records. Please review  and try again."),H(e)}},[be,Ae]),(0,n.jsxs)(g.HD,{padding:"spacingMed",height:"100%",children:[ve&&(0,n.jsx)(y.A,{show:ve}),!ve&&(Se||null==fe)&&(0,n.jsx)(h.$,{}),!ve&&null!=fe&&(()=>{const e=fe.ecommerce.order;return ie&&fe.ecommerce.order.orderLineItems.forEach(e=>{e.upsellOrderLineItems&&e.upsellOrderLineItems.forEach(e=>{e.guestLineItems&&e.guestLineItems.forEach(t=>{let r=null;if(ie.ecommerce.order.orderLineItems.forEach(t=>{if(t.upsellOrderLineItems){const n=t.upsellOrderLineItems.find(t=>t.id===e.id);n&&(r=n)}}),r){const e=r.guestLineItems.find(e=>e.id===t.id);e&&(t.guest=e.guest,t.guestOptions=e.guestOptions)}})}),e.guestLineItems&&e.guestLineItems.forEach(t=>{const r=ie.ecommerce.order.orderLineItems.find(t=>t.id===e.id);if(r){const e=r.guestLineItems.find(e=>e.id===t.id);e&&(t.guest=e.guest,t.guestOptions=e.guestOptions)}})}),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.K,{title:`Assign ${fe.ecommerce.authAccount.assignGuestNoun}s to products`,subtitle:`${(0,I.ZH)(fe.ecommerce.authAccount.assignGuestNoun)} information is required for the following products.`,border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(0,n.jsx)(c.A,{order:e,cardInfo:Ce?Ce.ecommerce.account:null,authAccount:fe.ecommerce.authAccount,user:fe.ecommerce.user,onSendPartnerShipCustomerCode:qe,onSendPartnershipAuthCode:Ge,onCreateGuest:Fe,onUpdateGuest:Ue,onSearchGuest:ze,onClearSearchGuestResult:_e,onUpdateGuestParent:Ve,alreadyUsedRedemptionsForGuests:he,setAlreadyUsedRedemptionsForGuests:ye,onSelectGuest:He,onAddAnswers:We,setPartnershipFoundGuest:re,partnershipFoundGuest:te,resetSetPartnershipData:Re,partnershipCustomerCodeSent:J,partnershipCustomerCodeErr:X,creatingGuest:B,updatingGuest:F,searchGuestResult:q,searchingGuest:W,searchGuestError:z,searchGuestErrorMssg:V,updatingOrder:K,matchingUsers:le,setMatchingUsers:ce,newUserDataForCreating:ue,allowCardLookup:D&&D.allowCardLookup}),(0,n.jsxs)(u.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(m.o,{handleOnClick:t}),(0,n.jsx)(p.S,{title:"Continue",kind:"secondary",medium:!0,loading:C,loaderColor:"white",disabled:Qe(ne?ne.ecommerce.updateOrder:fe.ecommerce.order)||C,handleOnClick:()=>{var e,t;const n=ne?ne.ecommerce.updateOrder:fe.ecommerce.order;(0,v.IN)("Assign guests step completed successfully",{mode:"Checkout",component:"AssignGuests",context:{orderId:M,guestsAssigned:(null===(e=n.orderLineItems)||void 0===e?void 0:e.filter(e=>e.guestId).length)||0,totalLineItems:(null===(t=n.orderLineItems)||void 0===t?void 0:t.length)||0}}),r()}})]})]})})()]})}},88050(e,t,r){r.d(t,{A:()=>P});var n=r(74848),o=r(96540),i=r(60799),a=r(66967),d=r(6421),s=r(23978),l=r(39238),c=r(42047),u=r(46019),m=r(86222),p=r(35861),g=r(91850),h=r(81388),y=r(83849),I=r(9825),f=r(33689),v=r(11693),S=r(82702),C=r(89001);const x=d.Ay`
866  mutation UpdateOrder($orderId: String!, $address1: String!, $address2: String, $city: String!, $state: String!, $country: String!, $zip: String!) {
867    ecommerce {
868      updateOrder(id: $orderId, billingAddress: { address1: $address1, address2: $address2, city: $city, state: $state, country: $country, zip: $zip }) {
869        id
870        guest {
871          id
872          addresses {
873            id
874            address1
875            address2
876            city
877            zip
878            state
879            country
880          }
881        }
882      }
883    }
884  }
885`,b=d.Ay`
886  mutation UpdateOrder($orderId: String!, $billingAddressId: String!) {
887    ecommerce {
888      updateOrder(id: $orderId, billingAddressId: $billingAddressId) {
889        id
890        guest {
891          id
892          addresses {
893            id
894            address1
895            address2
896            city
897            zip
898            state
899            country
900          }
901        }
902      }
903    }
904  }
905`,A=d.Ay`
906  query UserAddresses($orderId: String!) {
907    ecommerce {
908      user {
909        id
910        addresses {
911          id
912          address1
913          address2
914          city
915          zip
916          state
917          country
918        }
919      }
920      order(id: $orderId) {
921        id
922        billingAddress {
923          id
924          address1
925        }
926      }
927    }
928  }
929`,j=e=>{let{billingOption:t,user:r,updateStep:d,reverseStep:l,updatingStep:m}=e;const[g]=(0,a.A)([(0,v.i0)()]),A=(0,C.So)(g[(0,v.i0)()]),[j,{loading:P}]=(0,s.n_)(x,{onError:e=>{(0,S.tj)("BillingInformation: Failed to update billing address (new address)",e,{mode:"Checkout",component:"BillingInformation",context:{orderId:A,mutationType:"createNewAddress"}})}}),[O,{loading:w}]=(0,s.n_)(b,{onError:e=>{(0,S.tj)("BillingInformation: Failed to update billing address (existing address)",e,{mode:"Checkout",component:"BillingInformation",context:{orderId:A,mutationType:"selectExistingAddress"}})}});let k="Add a new address",$="add";r.addresses.length>0&&(k=r.addresses[0].address1,$=r.addresses[0].id);const[E,L]=o.useState({label:k,value:$});(0,o.useEffect)(()=>{L(t)},[]);const T=E&&"add"===E.value?j:O;return(0,n.jsx)(c.w,{id:"billing-information",initialValues:{billingOption:{label:k,value:$}},onSubmit:e=>{const t={orderId:A};e.billingOption&&"add"!==e.billingOption.value?t.billingAddressId=e.billingOption.value:(t.address1=e.address1||document.getElementById("address1").value,t.address2=e.address2,t.country=e.country.value,t.state="CA"===e.country.value||"US"===e.country.value?e.state.value:e.stateInput,t.city=e.city,t.zip=e.zip),T({variables:t}).then(()=>{(0,S.IN)("Billing information step completed successfully",{mode:"Checkout",component:"BillingInformation",context:{orderId:A,isNewAddress:e.billingOption&&"add"===e.billingOption.value,hasBillingAddressId:!!t.billingAddressId}}),i.oR.success("Billing address saved successfully.",(0,v.CE)()),d()}).catch(r=>{var n;(0,S.tj)("BillingInformation: Billing address update failed",r,{mode:"Checkout",component:"BillingInformation",context:{orderId:A,isNewAddress:"add"===(null===(n=e.billingOption)||void 0===n?void 0:n.value),billingAddressId:t.billingAddressId,country:t.country,state:t.state,city:t.city}}),i.oR.error("Failed to save billing address.",(0,v.CE)())})},children:e=>{let{formState:t}=e;return(0,n.jsxs)(n.Fragment,{children:[r.addresses.length>0&&(0,n.jsx)(y.A,{id:"billingOptions",field:"billingOption",placeholder:"Select an option",options:[...r.addresses.map(e=>({label:e.address1,value:e.id})),{label:"Add a new address",value:"add"}],onChange:e=>L(e)}),E&&"add"===E.value&&(0,n.jsxs)("div",{children:[(0,n.jsx)(h.K,{title:"Create a new address",border:!0,paddingBottom:"spacingTiny",marginBottom:"spacingMed"}),(0,n.jsx)(f.p,{formState:t}),(0,n.jsx)(u.e,{borderTop:!0,justify:"flex-end",children:(0,n.jsx)(p.S,{title:"Create Address",kind:"secondary",medium:!0,loading:P||w||m,loaderColor:"white"})})]}),(0,n.jsxs)(u.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(I.o,{handleOnClick:l}),t.values.billingOption&&"add"!==t.values.billingOption.value&&(0,n.jsx)(p.S,{title:"Select Address",kind:"secondary",medium:!0,loading:P||w||m,loaderColor:"white"})]})]})}})},P=e=>{let{updateStep:t,updatingStep:r,reverseStep:i}=e;const[d]=(0,a.A)([(0,v.i0)()]),c=(0,C.So)(d[(0,v.i0)()]),u=(0,o.useRef)(performance.now()),{data:p,loading:y,error:I}=(0,s.IT)(A,{variables:{orderId:c},onCompleted:e=>{var t;const r=Math.round(performance.now()-u.current);(0,S.y9)("billing_information",r,{orderId:c,addressCount:(null===(t=e.ecommerce.user.addresses)||void 0===t?void 0:t.length)||0,hasBillingAddress:!!e.ecommerce.order.billingAddress})},onError:e=>{(0,S.tj)("BillingInformation: Failed to load user addresses",e,{mode:"Checkout",component:"BillingInformation",context:{orderId:c}})}});return(0,n.jsxs)(g.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(h.K,{title:"Billing Information",subtitle:"Enter your billing information by selecting a current address or creating a new one.",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),y&&(0,n.jsx)(l.A,{show:y}),!y&&(I||null==p)&&(0,n.jsx)(m.$,{}),!y&&null!=p&&(()=>{const{user:e,order:o}=p.ecommerce;let a=null;return null!==o.billingAddress?a={label:o.billingAddress.address1,value:o.billingAddress.id}:0===e.addresses.length&&(a={label:"Add a new address",value:"add"}),(0,n.jsx)(j,{billingOption:a,updateStep:t,reverseStep:i,updatingStep:r,user:e,order:o})})()]})}},18162(e,t,r){r.d(t,{A:()=>d});var n=r(74848),o=(r(96540),r(52079)),i=r(91850),a=r(48065);const d=e=>
929{let{currentStep:t,steps:r}=e;const d=r.length,s=r.findIndex(e=>e===t)+1;return(0,n.jsx)(i.HD,{backgroundColor:"white",children:(0,n.jsxs)(a.$,{children:[(0,n.jsxs)(o.Km,{size:"1.1rem",textAlign:"center",children:["Checkout Step ",s," of ",d]}),(0,n.jsx)(a.R,{children:r.map((e,t)=>{const r=((e,t)=>{let r="";return r=e<t?"step completedStep":e===t?"step activeStep":"step",r})(t+1,s);return(0,n.jsx)("li",{className:r},t)})})]})})}},37123(e,t,r){r.d(t,{A:()=>F});var n=r(74848),o=r(96540),i=r(60799),a=r(66967),d=r(6421),s=r(23978),l=r(39238),c=r(86222),u=r(82407),m=r(42047),p=r(46019),g=r(94128),h=r(7350),y=r(6690),I=r(35861),f=r(91850),v=r(72367),S=r(8918),C=r(81388),x=r(48132),b=r(9825),A=r(67900),j=r(11693),P=r(82702),O=r(71246),w=r(89001),k=r(90291),$=r(31407),E=r(63752),L=r(37999),T=r(98675),N=r(27352),D=r(29970),M=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function d(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,d)}s((n=n.apply(e,t||[])).next())})};const B=d.Ay`
930  mutation CollectPayment($orderId: String!, $token: String, $cardData: String, $validRequestToken: String, $payments: [EcommercePaymentInput!]) {
931    ecommerce {
932      collectPayment(payments: $payments, orderId: $orderId, token: $token, cardData: $cardData, validRequestToken: $validRequestToken) {
933        success
934        reason
935        message
936        order {
937          id
938          status
939          currentStep
940        }
941      }
942    }
943  }
944`,R=d.Ay`
945  query Order($id: String!) {
946    ecommerce {
947      account {
948        hcaptchaSiteKey
949      }
950      order(id: $id) {
951        id
952        subTotal
953        taxTotal
954        total
955        guestId
956        status
957        number
958        shippingOption {
959          title
960          price
961        }
962        shippingAddress {
963          id
964          address1
965          address2
966          city
967          state
968          zip
969          country
970        }
971        payments {
972          id
973          amount
974          collectedAt
975          orderId
976          saleId
977          scheduledAt
978          status
979        }
980        orderLineItems {
981          id
982          productId
983          voucherCodes
984          forDate
985          eventLineItems {
986            id
987            eventId
988            eventGroupId
989            productItemId
990            requestedInstructorId
991            requestedIntructorName
992            event {
993              startTime
994              endTime
995              day
996            }
997          }
998          upsellOrderLineItems {
999            id
1000            name
1001            quantity
1002            price
1003            subTotal
1004          }
1005          orderDiscountLineItems {
1006            id
1007            price
1008            quantity
1009            subTotal
1010            taxTotal
1011            total
1012          }
1013          name
1014          guestId
1015          price
1016          quantity
1017          subTotal
1018          taxTotal
1019          total
1020        }
1021      }
1022    }
1023  }
1024`,F=e=>{let{updatingStep:t,reverseStep:r,useCardData:d,authAccount:F,updateStep:G}=e;var q,U;const z=(0,s.mK)(),[_,V]=(0,a.A)([(0,j.i0)(),"creditCardToken","creditCardLast4Digits","creditCardId","expirationDate"]),{checkForTimeOut:H}=(0,o.useContext)(N.A),W=(0,w.So)(_[(0,j.i0)()]),Q=_.creditCardToken,K=_.expirationDate,Y=_.creditCardLast4Digits,J=_.creditCardId,[Z,X]=(0,o.useState)(null),[ee,te]=(0,o.useState)(!1),[re,ne]=(0,o.useState)(!1),[oe,ie]=(0,o.useState)(null),[ae,de]=(0,o.useState)(!1),se=(0,o.useRef)(0),le=(0,o.useRef)(null),ce=(0,O.j)(window.sessionStorage.getItem("payments"),null),{data:ue,loading:me,error:pe}=(0,s.IT)(R,{variables:{id:W},fetchPolicy:"no-cache",onError:e=>{(0,P.tj)("ConfirmOrder: Failed to load order data",e,{mode:"Checkout",component:"ConfirmOrder",context:{orderId:W}})}}),[ge,{loading:he}]=(0,s.n_)(B),ye=e=>{const t=e?(0,O.j)(e,null):null;return t?Object.keys(t).sort((e,t)=>e.localeCompare(t)):[]},Ie=e=>({orderId:W,paymentProvider:null==F?void 0:F.paymentProvider,hasToken:!!Q,hasExpirationDate:!!K,expirationDateFormatValid:!!(0,k.nR)(K),cardDataKeys:ye(e)}),fe=()=>d||(0,k.Ku)(K)||void 0,ve=e=>(e=>{var t,r;const n=null!=Z?Z:null===(r=null===(t=null==ue?void 0:ue.ecommerce)||void 0===t?void 0:t.order)||void 0===r?void 0:r.total;return!(!n||Number(n)<=0)&&(!e.length||e.some(e=>!e.paymentTypeId))})(e)?Q?"multipass"!==(null==F?void 0:F.paymentProvider)||d?null:(0,k.bu)({token:Q,expirationDate:K,requireExpirationDate:!0}):(0,k.bu)({token:Q}):null,Se=(e,t)=>{const r=fe(),n={orderId:W,token:Q||null,cardData:r};return e&&(n.validRequestToken=e),t.length>0&&(n.payments=t),n},Ce=()=>M(void 0,void 0,void 0,function*(){var e;de(!0),ie(null);try{D.Ay.event("purchase",{value:ue.ecommerce.order.total,currency:(0,j.Fx)(),guest_id:ue.ecommerce.order.guestId,payment_type:null===d?"With resort credit":"Credit card",items:(0,j.JD)(ue.ecommerce.order)})}catch(e){(0,P.eE)("ConfirmOrder: GTM event failed after successful payment",e,{mode:"System",component:"ConfirmOrder",context:{orderId:W}})}try{H(null===(e=null==ue?void 0:ue.ecommerce)||void 0===e?void 0:e.order,!0)}catch(e){(0,P.eE)("ConfirmOrder: checkForTimeOut failed after successful payment",e,{mode:"System",component:"ConfirmOrder",context:{orderId:W}})}try{yield G()}catch(e){(0,P.tj)("ConfirmOrder: updateStep failed after successful payment",e,{mode:"Checkout",component:"ConfirmOrder",context:{orderId:W}})}i.oR.success(Z>0?"Payment Processed Successfully.":"Order Completed Successfully.",(0,j.CE)())}),xe=(0,T.o)({attemptKey:(0,E.xR)({surface:"checkout",orderId:W}),surface:"checkout",checkStatus:()=>(0,L.I)(z,W),onConfirmedSuccess:Ce}),be=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];return M(void 0,[e,...n],void 0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function*(){var n,o;if(e)return void ne(!0);if(ae||ee||xe.isPaymentBlocked)return;const a=(()=>{const e=[];return ce&&ce.length>0&&ce.forEach(t=>{const{paymentTypeId:r,amount:n}=t;"card"===r?e.push({amount:Number(n)}):e.push({amount:Number(n),paymentTypeId:r})}),e})(),d=fe(),s=ve(a);if(s)return(0,P.AC)("ConfirmOrder: Invalid saved card payload before payment collection",{mode:"Payment",component:"ConfirmOrder",context:Object.assign(Object.assign({}
1024,Ie(d)),{handled:!0,source:"client_validation",userImpact:"blocking",errorMessage:s})}),void i.oR.error(s,(0,j.CE)());const l=xe.beginAttempt();if(!l)return;te(!0),ie(null);const c=se.current+1;se.current=c;const u=Date.now();let m=null,p=!1;try{m=(0,P.Ip)("payment_collection",{orderId:W,total:Z});const e=yield ge({variables:Se(t,a)}),s=null===(o=null===(n=null==e?void 0:e.data)||void 0===n?void 0:n.ecommerce)||void 0===o?void 0:o.collectPayment,g=(0,$.xo)(s);if(g.requiresReconciliation){try{m.fail(new globalThis.Error("CollectPayment requires reconciliation"),{orderId:W})}catch(e){}return ie(g),void xe.markIndeterminate()}const h="success"===g.kind;try{const e=m.stop({success:h});(0,P.En)("credit_card",e,h,{orderId:W})}catch(e){(0,P.eE)("ConfirmOrder: Payment timing tracking failed",e,{mode:"System",component:"ConfirmOrder",context:{orderId:W}})}if(h)p=!0,xe.clearAttempt(),yield Ce();else{if(xe.clearAttempt(),J&&(0,k.d7)(null==s?void 0:s.message,null==s?void 0:s.reason))return(0,k.Mq)(window.sessionStorage,W,J),V("creditCardLast4Digits",{path:`/${(0,j.VD)()}`}),V("creditCardToken",{path:`/${(0,j.VD)()}`}),V("creditCardId",{path:`/${(0,j.VD)()}`}),V("expirationDate",{path:`/${(0,j.VD)()}`}),i.oR.error(g.userMessage,(0,j.CE)()),void r();(0,P.AC)("ConfirmOrder: Payment rejected by gateway",{mode:"Payment",component:"ConfirmOrder",tags:{source:"payment_gateway",handled:"true",userImpact:"blocking"},context:Object.assign(Object.assign({source:"payment_gateway",handled:!0,userImpact:"blocking"},Ie(d)),{surface:"checkout",outcomeKind:g.kind,clientAttemptId:l.clientAttemptId,attemptNumber:c,durationMs:Date.now()-u,reason:null==s?void 0:s.reason,message:null==s?void 0:s.message,errorMessage:(null==s?void 0:s.message)||"Payment Failed"})}),i.oR.error(g.userMessage,(0,j.CE)())}}catch(e){if(p)(0,P.eE)("ConfirmOrder: Post-payment logic error (payment was successful)",e,{mode:"Checkout",component:"ConfirmOrder",context:{orderId:W,total:Z}});else{try{null==m||m.fail(e,{orderId:W}),(0,P.En)("credit_card",0,!1,{orderId:W,error:"mutation_failed"})}catch(e){}const t=(0,$.xo)(null,e);(0,P.tj)("ConfirmOrder: Payment mutation failed",e,{mode:"Payment",component:"ConfirmOrder",context:Object.assign(Object.assign({},Ie(d)),{surface:"checkout",total:Z,outcomeKind:t.kind,clientAttemptId:l.clientAttemptId,statusCode:t.statusCode,errorName:t.errorName,attemptNumber:c,durationMs:Date.now()-u})}),ie(t),xe.markIndeterminate()}}finally{ne(!1),te(!1)}}()})};return(0,n.jsxs)(f.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(C.K,{title:"Confirm Order Step",subtitle:"Please confirm your order.",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{var e;if(me)return(0,n.jsx)(l.A,{show:me});if(!me&&(pe||null===ue))return(0,n.jsx)(c.$,{});if(!me&&null!=ue){const{orderLineItems:o,payments:i,id:a,shippingAddress:d,shippingOption:s,number:l,taxTotal:c}=ue.ecommerce.order;let f=0,v=0;o.forEach(e=>{f+=e.quantity,e.upsellOrderLineItems.forEach(e=>{v+=+e.quantity})});const C=o.some(e=>Array.isArray(e.voucherCodes)?e.voucherCodes.length>0:!!e.voucherCodes),P=C&&0===Number(ue.ecommerce.order.total)?"Tendered":ue.ecommerce.order.total,O=C&&0===Number(ue.ecommerce.order.subTotal)?"Tendered":ue.ecommerce.order.subTotal;return null===Z&&X(Number(ue.ecommerce.order.total)),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.I,{orderLineItems:o}),ce&&(0,n.jsx)(x.N,{creditCardLast4Digits:Y,resortBalancePayments:ce.map(e=>Object.assign(Object.assign({},e),{paymentTypeId:e.paymentTypeId||"card",amount:Number(e.amount)}))}),s?(0,n.jsx)(S.R,{shippingOption:s,shippingAddress:d}):null,(0,n.jsx)(g.B,{orderNumber:l.toString().padStart(10,"0"),items:f,addOns:v,subTotal:O,tax:c,total:P}),i&&i.length?(0,n.jsx)(h.n,{payments:i,orderId:a,showTwoColumns:!0}):null,(oe||xe.requiresReconciliation)&&(0,n.jsx)(A.A,{message:(null==oe?void 0:oe.userMessage)||$.PT,showPurchasesLink:null===(e=null==oe?void 0:oe.showPurchasesLink)||void 0===e||e,checking:"checking"===xe.status,onCheckStatus:xe.checkStatusAgain}),(0,n.jsx)(m.w,{className:"waiverForm",id:"waiver-form",children:e=>{let{formState:o}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y.P,{id:"acceptTerms",field:"signed",label:"I understand all products are non-refundable and non-transferable."}),(0,n.jsxs)(p.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(b.o,{handleOnClick:()=>{V("creditCardLast4Digits",{path:`/${(0,j.VD)()}`}),V("creditCardToken",{path:`/${(0,j.VD)()}`}),V("creditCardId",{path:`/${(0,j.VD)()}`}),V("expirationDate",{path:`/${(0,j.VD)()}`}),window.sessionStorage.removeItem("payments"),r()}}),(0,n.jsx)(I.S,{title:Number(P)>0?"Pay Now":"Complete Order",kind:"secondary",medium:!0,disabled:ae||xe.isPaymentBlocked||ee||!o.values.signed||t,loading:he||t,loaderColor:"white",handleOnClick:()=>{var e,t;return be(F.recaptchaEnabled&&null!=(null===(t=null===(e=null==ue?void 0:ue.ecommerce)||void 0===e?void 0:e.account)||void 0===t?void 0:t.hcaptchaSiteKey))}})]})]})}})]})}})(),F.recaptchaEnabled&&re&&null!=(null===(U=null===(q=null==ue?void 0:ue.ecommerce)||void 0===q?void 0:q.account)||void 0===U?void 0:U.hcaptchaSiteKey)&&(0,n.jsx)(v.A,{recaptchaKey:ue.ecommerce.account.hcaptchaSiteKey,gReCaptchaRef:le,handleReCaptchaChange:e=>{e&&be(!1,e)},onCaptchaError:e=>{ne(!1),te(!1),(0,P.eE)("ConfirmOrder: Captcha failed to load or verify",new globalThis.Error(`captcha_${e}`),{mode:"Payment",component:"ConfirmOrder",context:{orderId:W,reason:e}}),i.oR.error("Security verification couldn't load. Please disable any ad or privacy blockers, or try a different browser, then try again.",(0,j.CE)())},text:"We need to confirm you're not an evil Bot before you pay this order. Please complete the verification below."})]})}},86426(e,t,r){r.d(t,{A:()=>$});var n=r(74848),o=r(96540),i=r(60799),a=r(66967),d=r(6421),s=r(23978),l=r(56073),c=r(27352),u=r(86222),m=r(69799),p=r(33274),g=r(83279),h=r(84749),y=r(91850),I=r(33435),f=r(39238),v=r(67554),S=r(52079),C=r(11693),x=r(76335),b=r(82702),A=r(78965),j=r(89001),P=r(20324),O=function(e,t,r,n){return new(r||(r=Promise))(function(o,i){function a(e){try{s(n.next(e))}catch(e){i(e)}}function d(e){try{s(n.throw(e))}catch(e){i(e)}}function s(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(a,d)}s((n=n.apply(e,t||[])).next())})};const w=d.Ay`
1025  query Order($id: String!) {
1026    ecommerce {
1027      order(id: $id) {
1028        id
1029        total
1030        number
1031        orderRunOutTime
1032        guestOrderVerifications {
1033          id
1034          guest {
1035            id
1036            firstName
1037            lastName
1038          }
1039          images {
1040            id
1041            image
1042            preSignedUrl
1043          }
1044          status
1045          verification {
1046            copyText
1047            maxAmountOfPhotos
1048            minAmountOfPhotos
1049            title
1050          }
1051        }
1052        orderLineItems {
1053          id
1054          ecommerceProduct {
1055            id
1056            successPageCopy
1057          }
1058          product {
1059            id
1060            needPicture
1061          }
1062          guests {
1063            id
1064            firstName
1065            lastName
1066            profilePictureUrl
1067          }
1068          upsellOrderLineItems {
1069            id
1070            ecommerceProduct {
1071              id
1072              successPageCopy
1073            }
1074            product {
1075              id
1076              needPicture
1077            }
1078            guests {
1079              id
1080              firstName
1081              lastName
1082              profilePictureUrl
1083            }
1084            productAddOn {
1085              addAutomatically
1086              requireGuest
1087            }
1088          }
1089        }
1090      }
1091    }
1092  }
1093`,k=d.Ay`
1094  query Account {
1095    ecommerce {
1096      account {
1097        facebookId
1098        analyticsId
1099        currency
1100        analyticsId2
1101        successfulPaymentCopyForEstore
1102        theme {
1103          confirmationImage
1104        }
1105      }
1106    }
1107  }
1108`,$=()=>{var e;const{data:t,loading:r}=(0,s.IT)(k,{onError:e=>{(0,b.tj)("OrderComplete: Failed to load account data",e,{mode:"System",component:"OrderComplete",context:{section:"accountQuery"}})}}),d=null===(e=null==t?void 0:t.ecommerce)||void 0===e?void 0:e.account,[$,E,L]=(0,a.A)([(0,C.i0)(),"creditCardToken",(0,C.Eq)(),"pastOrderId","pastOrderNumber","creditCardLast4Digits"]),T=(0,j.So)($[(0,C.i0)()]),N=(0,j.So)($.pastOrderId),D=T||N,{checkForTimeOut:M}=o.useContext(c.A),{canUseHtmlParsing:B}=(0,o.useContext)(l.A),[R,F]=o.useState(!1),[G,q]=(0,o.useState)(!1),[U,z]=(0,o.useState)(!1),[_,V]=o.useState(!1),[H,W]=o.useState(null),[Q,K]=(0,o.useState)(void 0),[Y,J]=(0,o.useState)(!1),{data:Z,loading:X,error:ee}=(0,s.IT)(w,{variables:{id:D||""},skip:!D,fetchPolicy:"no-cache",onError:e=>{(0,b.tj)("OrderComplete: Failed to load order data",e,{mode:"Checkout",component:"OrderComplete",context:{orderId:D}})}}),[te,{loading:re}]=(0,s.n_)(x.B9,{onError:e=>{(0,b.tj)("OrderComplete: Failed to update user picture",e,{mode:"Account",component:"OrderComplete",context:{guestId:H,orderId:D}})}});(0,o.useEffect)(()=>{T&&E("pastOrderId",T,{path:`/${(0,C.VD)()}`}),(0,j.a6)(L),L("creditCardLast4Digits",{path:`/${(0,C.VD)()}`}),L("creditCardToken",{path:`/${(0,C.VD)()}`}),L("expirationDate",{path:`/${(0,C.VD)()}`}),window.sessionStorage.removeItem("payments");const e=window.matchMedia("screen and (orientation: landscape) and (max-height: 480px)"),t=e=>J(e.matches);return e.addListener(t),t(e),()=>{e.removeListener(t)}},[]),(0,o.useEffect)(()=>{!X&&null!=Z&&Z.ecommerce&&Z.ecommerce.order&&Z.ecommerce.order.orderLineItems&&(M(Z.ecommerce.order,!0),E("pastOrderNumber",Z.ecommerce.order.number,{path:`/${(0,C.VD)()}`}),d&&d.facebookId&&window.fbq("track","Purchase",{value:Z.ecommerce.order.total,currency:t.ecommerce.account.currency}))},[Z]);const ne=e=>{V(!_),W(e),_&&q(!1)},oe=e=>{q(e)},ie=(e,t)=>{z(e),null==Q&&K(t)},ae=()=>{const e=Q.getImageFromCanvas();e&&fetch(e).then(e=>e.blob()).then(e=>{const t="avatar.jpg";e.name=t;const r=new File([e],t,{type:e.type});var n;n=r,O(void 0,void 0,void 0,function*(){F(!0);try{const e=yield(0,C.F4)(H,n);(yield te({variables:{userId:H,profilePictureUrl:e}}))&&(F(!1),ne(),document.getElementById("userProfilePicture").click(),i.oR.success("Image uploaded successfully.",(0,C.CE)()))}catch(e){(0,b.eE)("OrderComplete: Image upload failed",e,{mode:"Account",component:"OrderComplete",context:{guestId:H,orderId:D,hasFile:!!n,hasBaseUrl:!!P.A.getBaseUrl(),errorMessage:e.message}}),F(!1),i.oR.error("Image upload failed. Please try again.",(0,C.CE)())}})}).catch(e=>{(0,b.eE)("OrderComplete: Failed to process image from canvas",e,{mode:"Account",component:"OrderComplete",context:{guestId:H,orderId:D,action:"imageProcessing"}}),i.oR.error("Failed to process image. Please try again.",(0,C.CE)())})};return(0,n.jsx)(y.ff,{children:(0,n.jsx)(y.gO,{children:(0,n.jsx)(y.HD,{padding:"spacingMed",children:(()=>
1108{if(X||r)return(0,n.jsx)(f.A,{show:X});if(!X&&(ee||null===Z||!D))return(0,n.jsx)(u.$,{});if(!X&&null!=Z){const e=(e=>{const t=[];return e.forEach(e=>{e.ecommerceProduct&&-1===t.findIndex(t=>t===e.ecommerceProduct.successPageCopy)&&t.push(e.ecommerceProduct.successPageCopy),e.upsellOrderLineItems.forEach(e=>{e.ecommerceProduct&&-1===t.findIndex(t=>t===e.ecommerceProduct.successPageCopy)&&t.push(e.ecommerceProduct.successPageCopy)})}),t})(Z.ecommerce.order.orderLineItems),r=(e=>{const t=[];return e.forEach(e=>{e.product.needPicture&&e.guests.forEach(e=>{null===e.profilePictureUrl&&-1===t.findIndex(t=>t.id===e.id)&&t.push(e)}),e.upsellOrderLineItems.forEach(e=>{var r;(null===(r=null==e?void 0:e.productAddOn)||void 0===r?void 0:r.requireGuest)&&e.product.needPicture&&e.guests.forEach(e=>{null===e.profilePictureUrl&&-1===t.findIndex(t=>t.id===e.id)&&t.push(e)})})}),t})(Z.ecommerce.order.orderLineItems),o={clickHandler:()=>q(!1),show:G,styling:{marginRight:"auto"},title:Y?"":window.innerWidth>v.A.breakpoints.phone?"Choose another file":"Restart",icon:Y?"FaFileImage":void 0},i={title:Y?"":window.innerWidth>v.A.breakpoints.phone?"Upload Image":"Done",icon:Y?"MdDone":void 0};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(m.A,{confirmationImage:null==t?void 0:t.ecommerce.account.theme.confirmationImage,successfulPaymentCopyForEstore:null==t?void 0:t.ecommerce.account.successfulPaymentCopyForEstore}),e.map((e,t)=>B?(0,n.jsx)(S.u_,{marginBottom:"spacingSml",textAlign:"center",color:"greyShade",dangerouslySetInnerHTML:(0,A.zA)(e)},t):(0,n.jsx)(S.u_,{marginBottom:"spacingSml",textAlign:"center",color:"greyShade",children:e},t)),r.map(e=>(0,n.jsx)(g.q,{guest:e,uploadImageModalHandler:ne},e.id)),Z.ecommerce.order.guestOrderVerifications.length>0&&Z.ecommerce.order.guestOrderVerifications.map((e,t)=>(0,n.jsx)(h.i,{guestOrderVerification:e,orderId:Z.ecommerce.order.id},t)),_&&(0,n.jsx)(p.A,{className:"with-picture-editor"+(G?" showing-editor":""),autoHeight:!0,centerContent:!0,title:"Upload an Image",subtitle:"Please upload a clear picture of your face (No sunglasses, no hats).",onLoading:re||R,showCloseIcon:!G&&Y,padding:!G&&Y?"1rem 1rem":void 0,onCancelModalHandler:ne,onSubmitModalHandler:ae,extraActionBtn:o,mainActionBtn:i,submitBtnDisabled:!U,children:(0,n.jsx)(I.A,{editorMode:G,onEditorModeUpdate:oe,onPreviewImageHandler:ie})})]})}})()})})})}},6363(e,t,r){r.d(t,{A:()=>P});var n=r(74848),o=r(96540),i=r(60799),a=r(66967),d=r(6421),s=r(23978),l=r(52079),c=r(86222),u=r(42047),m=r(46019),p=r(91850),g=r(35861),h=r(81388),y=r(84532),I=r(9825),f=r(39238),v=r(90781),S=r(11693),C=r(68385),x=r(82702),b=r(89001);const A=d.Ay`
1109  mutation SelectPaymentPlan($orderId: String!, $paymentPlanSelected: Boolean!, $installmentsTaken: Boolean) {
1110    ecommerce {
1111      paymentPlanSelection(orderId: $orderId, paymentPlanSelected: $paymentPlanSelected, installmentsTaken: $installmentsTaken) {
1112        id
1113        installmentsTaken
1114        payments {
1115          id
1116          amount
1117        }
1118      }
1119    }
1120  }
1121`,j=d.Ay`
1122  query PaymentPlans($orderId: String!) {
1123    ecommerce {
1124      paymentPlan(orderId: $orderId) {
1125        onceOffPayment {
1126          amount
1127          scheduledAt
1128        }
1129        paymentPlanPayments {
1130          amount
1131          scheduledAt
1132        }
1133      }
1134      order(id: $orderId) {
1135        allowInstallments
1136        allowPaymentPlan
1137      }
1138    }
1139  }
1140`,P=e=>{let{updateStep:t,updatingStep:r,reverseStep:d}=e;const[P]=(0,a.A)([(0,S.i0)()]),O=(0,b.So)(P[(0,S.i0)()]),w=(0,o.useRef)(performance.now()),{data:k,loading:$,error:E}=(0,s.IT)(j,{variables:{orderId:O},fetchPolicy:"no-cache",onCompleted:e=>{const t=Math.round(performance.now()-w.current);(0,x.y9)("payment_information",t,{orderId:O,allowInstallments:e.ecommerce.order.allowInstallments,allowPaymentPlan:e.ecommerce.order.allowPaymentPlan})},onError:e=>{(0,x.tj)("PaymentInformation: Failed to load payment plans",e,{mode:"Checkout",component:"PaymentInformation",context:{orderId:O}})}}),[L,{loading:T}]=(0,s.n_)(A,{onError:e=>{(0,x.tj)("PaymentInformation: Failed to select payment plan",e,{mode:"Checkout",component:"PaymentInformation",context:{orderId:O}})}}),N=()=>
1140{if($)return(0,n.jsx)(f.A,{show:$});if(!$&&(E||null===k))return(0,n.jsx)(c.$,{});if(!$&&null!=k){const{paymentPlan:e}=k.ecommerce;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.K,{title:"Pay in Full",border:!0,paddingBottom:"spacingTiny",marginBottom:"spacingMed"}),e.onceOffPayment&&(0,n.jsxs)(l.u_,{marginBottom:"spacingMed",children:[(0,C.SH)(e.onceOffPayment.scheduledAt)," ",(0,n.jsx)("b",{children:(0,S.vv)(e.onceOffPayment.amount)})]}),(0,n.jsx)(h.K,{title:"Payment Plan",border:!0,paddingBottom:"spacingTiny",marginTop:"spacingMed",marginBottom:"spacingMed"}),(0,S.Lt)(e.paymentPlanPayments).map((e,t)=>{const r=0===t?(0,n.jsx)("span",{children:" - Due today, which includes applicable, full-price items, shipping, and taxes."}):"";return(0,n.jsxs)(l.u_,{children:[(0,C.SH)(e.scheduledAt)," ",(0,n.jsx)("b",{children:(0,S.vv)(e.amount)})," ",r]},e.scheduledAt)})]})}};return(0,n.jsxs)(p.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(h.K,{title:"Payment Information",subtitle:"Some items are eligible for a Payment Plan.",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(0,n.jsx)(u.w,{id:"login-form",initialValues:{paymentPlan:"no"},onSubmit:e=>{const{order:r}=k.ecommerce,n={orderId:O,paymentPlanSelected:!1};r.allowInstallments&&(n.installmentsTaken="yes"===e.paymentPlan),r.allowPaymentPlan&&(n.paymentPlanSelected="yes"===e.paymentPlan),L({variables:n}).then(()=>{(0,x.IN)("Payment information step completed successfully",{mode:"Checkout",component:"PaymentInformation",context:{orderId:O,paymentPlanSelected:"yes"===e.paymentPlan,installmentsTaken:!!n.installmentsTaken}}),"yes"===e.paymentPlan?i.oR.success("Payment Plan selected.",(0,S.CE)()):i.oR.error("Payment Plan declined.",(0,S.CE)()),t()}).catch(t=>{(0,x.tj)("PaymentInformation: Payment plan selection failed",t,{mode:"Checkout",component:"PaymentInformation",context:{orderId:O,paymentPlanSelected:"yes"===e.paymentPlan,allowInstallments:r.allowInstallments,allowPaymentPlan:r.allowPaymentPlan}}),i.oR.error("Failed to process payment plan selection. Please try again.",(0,S.CE)())})},children:()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)(l.u_,{marginBottom:"spacingSml",children:["Would you like to opt in to a ",(0,n.jsx)("b",{children:"Payment Plan"}),"?"]}),(0,n.jsxs)(y.P,{mobileRow:!0,fieldGroup:"paymentPlan",validate:v.Kf,validateOnChange:!0,children:[(0,n.jsx)(y.r,{id:"radio-yes",label:"Yes",radioValue:"yes"}),(0,n.jsx)(y.r,{id:"radio-no",label:"No",radioValue:"no"})]})]}),(0,n.jsx)("div",{children:N()}),(0,n.jsxs)(m.e,{borderTop:!0,marginTop:"1em",justify:"space-between",children:[(0,n.jsx)(I.o,{handleOnClick:d}),(0,n.jsx)(g.S,{title:"Continue",kind:"secondary",medium:!0,loading:T||r,loaderColor:"white"})]})]})})]})}},61828(e,t,r){r.d(t,{A:()=>I});var n=r(74848),o=r(96540),i=r(23978),a=r(39238),d=r(86222),s=r(91850),l=r(348),c=r(81388),u=r(27282),m=r(11693),p=r(76335),g=r(82702),h=r(89001),y=r(66967);const I=e=>{let{updateStep:t,updatingStep:r,reverseStep:I,setCardData:f,authAccount:v}=e;const[S,C]=(0,o.useState)(""),[x,b]=(0,o.useState)(!1),[A,j]=(0,o.useState)([]),[P,O]=(0,o.useState)(!1),[w,k]=(0,o.useState)(null),[$]=(0,y.A)([(0,m.i0)(),"creditCardToken"]),[E,L]=(0,o.useState)(!1),T=(0,h.So)($[(0,m.i0)()]),N="true"===v.resortCreditEnabled&&(0,m.S7)(w),{data:D,loading:M,error:B}=(0,i.IT)(p.ut,{variables:{orderId:T},onError:e=>{(0,g.tj)("PaymentMethodMultiPass: Failed to load credit cards",e,{mode:"Payment",component:"PaymentMethodMultiPass",context:{orderId:T}})}}),[R,{loading:F}]=(0,i.n_)(p._C,{onError:e=>{(0,g.tj)("PaymentMethodMultiPass: Failed to create credit card",e,{mode:"Payment",component:"PaymentMethodMultiPass",context:{orderId:T}})}}),G=e=>{C(e)},[q,{error:U}]=(0,i._l)(p.Q1,{onCompleted:e=>{U||null===e||null===e.ecommerce.user||k(e.ecommerce.user)},onError:e=>{(0,g.tj)("PaymentMethodMultiPass: Failed to load resort credit data",e,{mode:"Payment",component:"PaymentMethodMultiPass",context:{orderId:T,resortCreditEnabled:v.resortCreditEnabled}})}});(0,o.useEffect)(()=>{"true"===v.resortCreditEnabled&&q()},[]);return(0,n.jsxs)(s.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(c.K,{title:"Payment Method",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{if(M)return(0,n.jsx)(a.A,{show:M});if(!M&&(B||null===D))return(0,n.jsx)(d.$,{});if(!M&&null!=D){const{creditCards:i,order:a}=D.ecommerce,d=(0,m.z5)(a),s={order:a,reverseStep:I,paymentPlanSelected:d,updateStep:t,updatingStep:r,credit
1140Cards:i,setCardData:f,onHandlePaymentMethodChange:G,resortCreditEnabled:N,setCardAddingError:b,createCreditCard:R,mutationLoading:F,paymentMethodDefined:P,handlePaymentMethodDefined:()=>O(!0),paymentMethod:S,checkoutFlow:!0,payments:A,setFormIsValid:L,withResortBalance:!1};return N?(s.withResortBalance=!0,(0,n.jsx)(l.A,{checkoutFlow:!0,onCardAddingError:x,formIsValid:E,onSubmit:e=>j(e),userResortCreditData:w,paymentIds:(e=d,o=a.payments,e&&o[0]?[o[0].id]:null),processing:r||F,order:a,reverseStep:I,children:(0,n.jsx)(u.A,Object.assign({},s,{paymentSurface:"checkout"}))})):(0,n.jsx)(u.A,Object.assign({},s,{paymentSurface:"checkout"}))}var e,o})()]})}},6156(e,t,r){r.d(t,{A:()=>I});var n=r(74848),o=r(96540),i=r(23978),a=r(39238),d=r(86222),s=r(51738),l=r(91850),c=r(348),u=r(81388),m=r(11693),p=r(76335),g=r(82702),h=r(89001),y=r(66967);const I=e=>{let{updateStep:t,updatingStep:r,reverseStep:I,setCardData:f,authAccount:v}=e;const[S,C]=(0,o.useState)(""),[x,b]=(0,o.useState)(!1),[A,j]=(0,o.useState)(null),[P,O]=(0,o.useState)(!1),[w,k]=(0,o.useState)([]),[$,E]=(0,o.useState)(!1),[L]=(0,y.A)([(0,m.i0)(),"creditCardToken"]),T=(0,h.So)(L[(0,m.i0)()]),N="true"===v.resortCreditEnabled&&(0,m.S7)(A),{data:D,loading:M,error:B}=(0,i.IT)(p.ut,{variables:{orderId:T},onError:e=>{(0,g.tj)("PaymentMethodPayroc: Failed to load credit cards",e,{mode:"Payment",component:"PaymentMethodPayroc",context:{orderId:T}})}}),[R,{loading:F}]=(0,i.n_)(p._C,{onError:e=>{(0,g.tj)("PaymentMethodPayroc: Failed to create credit card",e,{mode:"Payment",component:"PaymentMethodPayroc",context:{orderId:T}})}}),G=e=>{C(e)};if("true"===v.resortCreditEnabled){const{data:e,error:t}=(0,i.IT)(p.Q1,{onError:e=>{(0,g.tj)("PaymentMethodPayroc: Failed to load resort credit data",e,{mode:"Payment",component:"PaymentMethodPayroc",context:{orderId:T,resortCreditEnabled:v.resortCreditEnabled}})}});t||null==e||null==e.ecommerce.user||null!==A||j(e.ecommerce.user)}return(0,n.jsxs)(l.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(u.K,{title:"Payment Method",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{if(M)return(0,n.jsx)(a.A,{show:M});if(!M&&(B||null===D))return(0,n.jsx)(d.$,{});if(!M&&null!=D){const{creditCards:i,order:a}=D.ecommerce,d=(0,m.z5)(a),l={order:a,paymentPlanSelected:d,updateStep:t,updatingStep:r,reverseStep:I,creditCards:i,setCardData:f,createCreditCard:R,mutationLoading:F,paymentMethodDefined:x,handlePaymentMethodDefined:()=>b(!0),paymentMethod:S,onHandlePaymentMethodChange:G,resortCreditEnabled:N,setCardAddingError:O,checkoutFlow:!0,payments:w,setFormIsValid:E,withResortBalance:!1};return N?(l.withResortBalance=!0,(0,n.jsx)(c.A,{checkoutFlow:!0,onCardAddingError:P,formIsValid:$,paymentIds:(e=d,o=a.payments,e&&o[0]?[o[0].id]:null),processing:r||F,onSubmit:e=>k(e),userResortCreditData:A,order:a,reverseStep:I,children:(0,n.jsx)(s.A,Object.assign({},l))})):(0,n.jsx)(s.A,Object.assign({},l))}var e,o})()]})}},1458(e,t,r){r.d(t,{A:()=>f});var n=r(74848),o=r(96540),i=r(23978),a=r(39238),d=r(86222),s=r(1492),l=r(91850),c=r(348),u=r(81388),m=r(11693),p=r(76335),g=r(19121),h=r(82702),y=r(89001),I=r(66967);const f=e=>{let{updateStep:t,updatingStep:r,reverseStep:f,authAccount:v}=e;var S,C;const[x,b]=(0,o.useState)(null),[A,j]=(0,o.useState)(""),[P,O]=(0,o.useState)(""),[w,k]=(0,o.useState)(""),[$,E]=(0,o.useState)(""),[L,T]=(0,o.useState)(!1),[N,D]=(0,o.useState)(!1),[M,B]=(0,o.useState)(!1),[R,F]=(0,o.useState)(null),[G]=(0,I.A)([(0,m.i0)(),"creditCardToken"]),q=(0,y.So)(G[(0,m.i0)()]),[U,z]=(0,o.useState)(!1),[_,V]=(0,o.useState)([]),H="true"===v.resortCreditEnabled&&(0,m.S7)(R),{data:W,loading:Q,error:K}=(0,i.IT)(p.ut,{variables:{orderId:q},onError:e=>{(0,h.tj)("PaymentMethodSpreedly: Failed to load credit cards",e,{mode:"Payment",component:"PaymentMethodSpreedly",context:{orderId:q}})}}),[Y,{loading:J}]=(0,i.n_)(p._C,{onError:e=>{(0,h.tj)("PaymentMethodSpreedly: Failed to create credit card",e,{mode:"Payment",component:"PaymentMethodSpreedly",context:{orderId:q}})}});if("true"===v.resortCreditEnabled){const{data:e,error:t}=(0,i.IT)(p.Q1,{onError:e=>{(0,h.tj)("PaymentMethodSpreedly: Failed to load resort credit data",e,{mode:"Payment",component:"PaymentMethodSpreedly",context:{orderId:q,resortCreditEnabled:v.resortCreditEnabled}})}});t||null==e||null==e.ecommerce.user||null!==R||F(e.ecommerce.user)}const Z=!!W&&(x&&x.value&&"add"===x.value||!W.ecommerce.creditCards.length),{spreedlyStatus:X,retrySpreedly:ee}=(0,g.B_)({enabled:N&&Z,paymentGatewayKey:null===(C=null===(S=null==W?void 0:W.ecommerce)||void 0===S?void 0:S.authAccount)||void 0===C?void 0:C.paymentGatewayKey,setSpreedlyNumber
1140Error:j,setSpreedlyCvvError:O,setSpreedlyYearError:k,setSpreedlyMonthError:E,setCardAddingError:B,component:"PaymentMethodSpreedly(checkout)"});return(0,n.jsxs)(l.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(u.K,{title:"Payment Method",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{if(Q)return(0,n.jsx)(a.A,{show:Q});if(!Q&&(K||null===W))return(0,n.jsx)(d.$,{});if(!Q&&null!=W){const{creditCards:i,order:a}=W.ecommerce,d=(0,m.z5)(a),l={createCreditCard:Y,mutationLoading:J,spreedlyNumberError:A,spreedlyCvvError:P,spreedlyYearError:w,spreedlyMonthError:$,paymentMethodDefined:L,handlePaymentMethodDefined:()=>T(!0),paymentMethod:x,order:a,paymentPlanSelected:d,payments:_,updateStep:t,updatingStep:r,withResortBalance:!1,reverseStep:f,creditCards:i,onHandlePaymentMethodChange:e=>b(e),onMounting:D,checkoutFlow:!0,setFormIsValid:z,resortCreditEnabled:H,spreedlyStatus:X,onRetrySpreedly:ee};return H?(l.withResortBalance=!0,(0,n.jsx)(c.A,{checkoutFlow:!0,onCardAddingError:M,processing:r||J,onSubmit:e=>{V(e),B(!1)},userResortCreditData:R,order:a,formIsValid:U,paymentIds:(e=d,o=a.payments,e&&o[0]?[o[0].id]:null),reverseStep:f,children:(0,n.jsx)(s.Ay,Object.assign({},l))})):(0,n.jsx)(s.Ay,Object.assign({},l))}var e,o})()]})}},56303(e,t,r){r.d(t,{A:()=>I});var n=r(74848),o=r(96540),i=r(23978),a=r(39238),d=r(86222),s=r(39011),l=r(91850),c=r(348),u=r(81388),m=r(11693),p=r(76335),g=r(82702),h=r(89001),y=r(66967);const I=e=>{let{updateStep:t,updatingStep:r,reverseStep:I,setCardData:f,authAccount:v}=e;const[S,C]=(0,o.useState)(""),[x,b]=(0,o.useState)(!1),{data:A,loading:j}=(0,i.IT)(p.IP,{onError:e=>{(0,g.tj)("PaymentMethodWorldNet: Failed to load user data",e,{mode:"Payment",component:"PaymentMethodWorldNet",context:{orderId:B}})}}),[P,O]=(0,o.useState)(!1),[w,k]=(0,o.useState)(null),[$,E]=(0,o.useState)(!1),[L,T]=(0,o.useState)([]),[N,D]=(0,o.useState)([]),[M]=(0,y.A)([(0,m.i0)(),"creditCardToken"]),B=(0,h.So)(M[(0,m.i0)()]),R="true"===v.resortCreditEnabled&&(0,m.S7)(w),{data:F,loading:G,error:q}=(0,i.IT)(p.ut,{variables:{orderId:B},onError:e=>{(0,g.tj)("PaymentMethodWorldNet: Failed to load credit cards",e,{mode:"Payment",component:"PaymentMethodWorldNet",context:{orderId:B}})}}),[U,{loading:z}]=(0,i.n_)(p._C,{onError:e=>{(0,g.tj)("PaymentMethodWorldNet: Failed to create credit card",e,{mode:"Payment",component:"PaymentMethodWorldNet",context:{orderId:B}})}}),_=e=>{C(e)};if("true"===v.resortCreditEnabled){const{data:e,error:t}=(0,i.IT)(p.Q1,{onError:e=>{(0,g.tj)("PaymentMethodWorldNet: Failed to load resort credit data",e,{mode:"Payment",component:"PaymentMethodWorldNet",context:{orderId:B,resortCreditEnabled:v.resortCreditEnabled}})}});t||null==e||null==e.ecommerce.user||null!==w||k(e.ecommerce.user)}return(0,n.jsxs)(l.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(u.K,{title:"Payment Method",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{var e,o,i,l;if(G||j)return(0,n.jsx)(a.A,{show:G});if(!G&&(q||null===F))return(0,n.jsx)(d.$,{});if(!G&&null!=F&&(N.length||N.length===F.ecommerce.creditCards.length||D(F.ecommerce.creditCards),!G&&null!=F)){const{creditCards:a,order:d}=F.ecommerce,u=(null===(o=null===(e=null==A?void 0:A.ecommerce)||void 0===e?void 0:e.user)||void 0===o?void 0:o.email)||"",p=(0,m.z5)(d),g={order:d,paymentPlanSelected:p,updateStep:t,updatingStep:r,reverseStep:I,creditCards:0===N.length?a:N,setCardData:f,createCreditCard:U,mutationLoading:z,paymentMethodDefined:x,handlePaymentMethodDefined:()=>b(!0),paymentMethod:S,onHandlePaymentMethodChange:_,resortCreditEnabled:R,setCardAddingError:E,checkoutFlow:!0,email:u,payments:L,setFormIsValid:O,withResortBalance:!1,onAddCreditCard:e=>(e=>{D([e,...N])})(e)};return R?(g.withResortBalance=!0,(0,n.jsx)(c.A,{checkoutFlow:!0,onCardAddingError:$,formIsValid:P,paymentIds:(i=p,l=d.payments,i&&l[0]?[l[0].id]:null),processing:r||z,onSubmit:e=>T(e),userResortCreditData:w,order:d,reverseStep:I,children:(0,n.jsx)(s.A,Object.assign({},g))})):(0,n.jsx)(s.A,Object.assign({},g))}})()]})}},5495(e,t,r){r.d(t,{A:()=>E});var n=r(74848),o=r(96540),i=r(66967),a=r(60799),d=r(56347),s=r(6421),l=r(23978),c=r(52079),u=r(39238),m=r(86222),p=r(46019),g=r(42047),h=r(17010),y=r(35861),I=r(91850),f=r(81388),v=r(80026),S=r(9825),C=r(90781),x=r(11693),b=r(68385),A=r(82702),j=r(89001),P=r(20324);const O=s.Ay`
1141  query Details {
1142    ecommerce {
1143      user {
1144        id
1145        firstName
1146        lastName
1147        dateOfBirth
1148        age
1149        children {
1150          id
1151          firstName
1152          lastName
1153        }
1154      }
1155      authAccount {
1156        ageCalculationMethod
1157        ageCalculationDate
1158        ageOfMajority
1159        endOfWinterSeasonMonth
1160      }
1161    }
1162  }
1163`,w=s.Ay`
1164  mutation UpdateUser($userId: String!, $dateOfBirth: String) {
1165    ecommerce {
1166      updateUser(id: $userId, dateOfBirth: $dateOfBirth) {
1167        id
1168        dateOfBirth
1169        age
1170      }
1171    }
1172  }
1173`,k=s.Ay`
1174  query Waivers($orderId: String!) {
1175    ecommerce {
1176      allCompletedWaivers(orderId: $orderId) {
1177        id
1178        signingString
1179        guestId
1180        waiver {
1181          id
1182          title
1183          intro
1184          part1
1185          part2
1186          part3
1187          part4
1188          part5
1189        }
1190      }
1191    }
1192  }
1193`,$=s.Ay`
1194  query Order($id: String!) {
1195    ecommerce {
1196      order(id: $id) {
1197        hasOtherWaivers
1198      }
1199    }
1200  }
1201`,E=e=>{let{updateStep:t,updatingStep:r,reverseStep:s}=e;var E,L,T;const[N]=(0,i.A)([(0,x.i0)()]),D=(0,j.So)(N[(0,x.i0)()]),M=(0,o.useRef)(performance.now()),[B,R]=(0,o.useState)(0),[F,G]=(0,o.useState)([]),[q,U]=(0,o.useState)(0),[z,_]=(0,o.useState)(!1),[V,H]=(0,o.useState)(!1),[W,Q]=(0,o.useState)(void 0),{data:K}=(0,l.IT)($,{variables:{id:D},fetchPolicy:"no-cache",onCompleted:e=>{const t=Math.round(performance.now()-M.current);(0,A.y9)("release_agreements",t,{orderId:D,hasOtherWaivers:e.ecommerce.order.hasOtherWaivers})},onError:e=>{(0,A.tj)("ReleaseAgreements: Failed to load waivers status",e,{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D}})}}),Y=null===(L=null===(E=null==K?void 0:K.ecommerce)||void 0===E?void 0:E.order)||void 0===L?void 0:L.hasOtherWaivers,{data:J,loading:Z,error:X}=(0,l.IT)(O,{onError:e=>{(0,A.tj)("ReleaseAgreements: Failed to load user details",e,{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D}})}}),[ee,{data:te,loading:re}]=(0,l._l)(k,{onError:e=>{(0,A.tj)("ReleaseAgreements: Failed to load completed waivers",e,{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D}}),H(!1)}}),[ne,{loading:oe}]=(0,l.n_)(w,{onError:e=>{(0,A.tj)("ReleaseAgreements: Failed to update user date of birth",e,{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D,userId:P.A.getAuthenticatedUserId()}})}});null==W&&V&&null!=te&&!re&&(H(!1),Q(te));(0,o.useEffect)(()=>{0!==q&&B===q&&_(!0)},[q]),(0,o.useEffect)(()=>{var e,n;Y||0!==(null===(n=null===(e=null==W?void 0:W.ecommerce)||void 0===e?void 0:e.allCompletedWaivers)||void 0===n?void 0:n.length)||r||((0,A.IN)("Release agreements step completed successfully (no waivers)",{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D,hasOtherWaivers:!1,waiversCount:0,autoSkipped:!0}}),t(),a.oR.success("All waivers signed.",(0,x.CE)()))},[Y,null===(T=null==W?void 0:W.ecommerce)||void 0===T?void 0:T.allCompletedWaivers,r]);const ie=()=>{q+1===B&&_(!0),U(q+1)},ae=()=>{var e,o,i;return V?(0,n.jsx)(u.A,{show:V}):V||null!=W?V||null==W?void 0:((null==B||0===B)&&W.ecommerce.allCompletedWaivers&&W.ecommerce.allCompletedWaivers.length&&(i=W.ecommerce.allCompletedWaivers.length,R(i)),(0,n.jsxs)(n.Fragment,{children:[(null===(o=null===(e=null==W?void 0:W.ecommerce)||void 0===e?void 0:e.allCompletedWaivers)||void 0===o?void 0:o.length)>0&&W.ecommerce.allCompletedWaivers.map(e=>{const t=F.find(t=>
1201t.id===e.guestId)||null;return(0,n.jsx)(v.A,{completedWaiverID:e.id,guest:t,signingLocation:"online",data:e.waiver,signingString:e.signingString,handleCompletedWaiver:ie},e.id)}),0===W.ecommerce.allCompletedWaivers.length&&(0,n.jsx)(c.u_,{children:"Agreements have already been signed previously this season"}),Y&&(0,n.jsx)(c.u_,{children:"Other adults assigned to products in this order must complete their own Agreements. Once this order is finalized, they will receive an email to sign their Agreements."}),(0,n.jsxs)(p.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(S.o,{handleOnClick:s}),(0,n.jsx)(y.S,{title:"Continue",kind:"secondary",medium:!0,loading:r,loaderColor:"white",handleOnClick:()=>{(0,A.IN)("Release agreements step completed successfully",{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D,waiversCount:W.ecommerce.allCompletedWaivers.length,allWaiversCompleted:z}}),t()},disabled:!z&&W.ecommerce.allCompletedWaivers.length>0})]})]})):(0,n.jsx)(m.$,{})};return(0,n.jsxs)(I.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(f.K,{title:"Agreements",subtitle:"Pass products have Agreements that must be signed.",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{if(Z)return(0,n.jsx)(u.A,{show:Z});if(!Z&&(X||null==J))return(0,n.jsx)(m.$,{});if(!Z&&null!=J){const e=J.ecommerce.authAccount.ageCalculationMethod,t=J.ecommerce.authAccount.ageCalculationDate,r=J.ecommerce.authAccount.ageOfMajority,o=J.ecommerce.authAccount.endOfWinterSeasonMonth,{children:i,dateOfBirth:s,lastName:l,firstName:u}=J.ecommerce.user;if(i&&0===F.length){const e=[...i];G(e)}return null==s||null!=W||V||(H(!0),ee({variables:{orderId:D}})),null===s?(0,n.jsxs)(g.w,{id:"personal-information-form",onSubmit:e=>{const t=(0,b.j2)(e.dateOfBirth);t?ne({variables:Object.assign(Object.assign({},e),{dateOfBirth:t,userId:P.A.getAuthenticatedUserId()})}).then(()=>{a.oR.success("Date of birth updated successfully.",(0,x.CE)())}).catch(e=>{(0,A.tj)("ReleaseAgreements: Date of birth update failed",e,{mode:"Checkout",component:"ReleaseAgreements",context:{orderId:D,userId:P.A.getAuthenticatedUserId()}}),a.oR.error("Failed to update date of birth. Please try again.",(0,x.CE)())}):a.oR.error("Please provide a valid date of birth.",(0,x.CE)())},children:[(0,n.jsx)(c.u_,{children:`Please enter the date of birth for ${u} ${l}`}),(0,n.jsx)(h.pd,{id:"dobInput",type:"mask",inputMask:(0,b.QR)(),maskPlaceHolder:(0,b.eW)(),field:"dateOfBirth",label:"Date of Birth*",icon:"MdEvent",backgroundColor:"white",placeholderText:(0,b.eW)(),inputHelperText:`Eg.(${(0,b.eW)()})`,validate:(0,C.HM)({ageFrom:1,ageTo:100},e,o,t),validateOnChange:!0}),(0,n.jsx)(p.e,{justify:"space-between",children:(0,n.jsx)(y.S,{title:"Update",kind:"secondary",medium:!0,loading:oe,loaderColor:"white"})})]}):+J.ecommerce.user.age<r?(a.oR.error(`Unfortunately you have to be at least ${r} to complete the transaction.`,(0,x.CE)()),(0,n.jsx)(d.rd,{to:(0,x.Au)("")})):ae()}})()]})}},47535(e,t,r){r.d(t,{A:()=>O});var n=r(74848),o=r(96540),i=r(60799),a=r(66967),d=r(6421),s=r(23978),l=r(52079),c=r(39238),u=r(86222),m=r(42047),p=r(46019),g=r(91850),h=r(35861),y=r(84532),I=r(81388),f=r(83849),v=r(9825),S=r(33689),C=r(11693),x=r(82702),b=r(89001);const A=d.Ay`
1202  mutation UpdateOrder(
1203    $orderId: String!
1204    $address1: String!
1205    $address2: String
1206    $city: String!
1207    $state: String!
1208    $country: String!
1209    $zip: String!
1210    $shippingOptionId: String!
1211  ) {
1212    ecommerce {
1213      updateOrder(
1214        id: $orderId
1215        shippingOptionId: $shippingOptionId
1216        shippingAddress: { address1: $address1, address2: $address2, city: $city, state: $state, country: $country, zip: $zip }
1217      ) {
1218        id
1219        guest {
1220          id
1221          addresses {
1222            id
1223            address1
1224            address2
1225            city
1226            zip
1227            state
1228            country
1229          }
1230        }
1231      }
1232    }
1233  }
1234`,j=d.Ay`
1235  mutation UpdateOrder($orderId: String!, $shippingOptionId: String!, $shippingAddressId: String) {
1236    ecommerce {
1237      updateOrder(id: $orderId, shippingAddressId: $shippingAddressId, shippingOptionId: $shippingOptionId) {
1238        id
1239        guest {
1240          id
1241          addresses {
1242            id
1243            address1
1244            address2
1245            city
1246            zip
1247            state
1248            country
1249          }
1250        }
1251      }
1252    }
1253  }
1254`,P=d.Ay`
1255  query ShippingOptions {
1256    ecommerce {
1257      allShippingOptions {
1258        id
1259        title
1260        price
1261        needAddress
1262      }
1263      user {
1264        id
1265        addresses {
1266          id
1267          address1
1268          address2
1269          city
1270          zip
1271          state
1272          country
1273        }
1274      }
1275    }
1276  }
1277`,O=e=>{let{updateStep:t,updatingStep:r,reverseStep:d,manualLoading:O}=e;const[w,k]=o.useState({label:"Add a new address",value:"add"}),[$,E]=o.useState(!0),[L,T]=o.useState(!1),[N,D]=o.useState(!1),[M]=(0,a.A)([(0,C.i0)(),"creditCardToken"]),B=(0,b.So)(M[(0,C.i0)()]),R=(0,o.useRef)(performance.now()),F=e=>{k(e)},{data:G,loading:q,error:U}=(0,s.IT)(P,{onCompleted:e=>{var t,r;const n=Math.round(performance.now()-R.current);(0,x.y9)("shipping_options",n,{orderId:B,shippingOptionsCount:(null===(t=e.ecommerce.allShippingOptions)||void 0===t?void 0:t.length)||0,addressCount:(null===(r=e.ecommerce.user.addresses)||void 0===r?void 0:r.length)||0})},onError:e=>{(0,x.tj)("ShippingOptions: Failed to load shipping options",e,{mode:"Checkout",component:"ShippingOptions",context:{orderId:B}})}}),[z,{loading:_}]=(0,s.n_)(A,{onError:e=>{(0,x.tj)("ShippingOptions: Failed to update shipping address (new address)",e,{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,mutationType:"createNewAddress"}})}}),[V,{loading:H}]=(0,s.n_)(j,{onError:e=>{(0,x.tj)("ShippingOptions: Failed to update shipping address (existing address)",e,{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,mutationType:"selectExistingAddress"}})}}),W=_||H;return(0,n.jsxs)(g.HD,{padding:"spacingMed",height:"100%",children:[(0,n.jsx)(I.K,{title:"Shipping Options",subtitle:"Some items can be shipped.",border:!0,paddingBottom:"spacingSml",marginBottom:"spacingMed"}),(()=>{if(q||O)return(0,n.jsx)(c.A,{show:q||O});if(!q&&(U||null===G))return(0,n.jsx)(u.$,{});if(!q&&null!=G){const{allShippingOptions:e,user:o}=G.ecommerce;if(1!==e.length||e[0].needAddress||W||L){let a="Add a new address",s="add";return o.addresses.length>0&&$&&(a=o.addresses[0].address1,s=o.addresses[0].id,k({label:a,value:s}),E(!1)),(0,n.jsx)(m.w,{id:"shipping-options",initialValues:{shippingOption:w},onSubmit:r=>{const n=r.shipping||e[0].id,o=e.find(e=>e.id===n).needAddress,a=w&&"add"===w.value&&o?z:V,d={orderId:B,shippingOptionId:n};w&&"add"!==w.value&&o?d.shippingAddressId=w.value:w&&"add"===w.value&&o&&(d.address1=r.address1||document.getElementById("address1").value,d.address2=r.address2,d.country=r.country.value,d.state="CA"===r.country.value||"US"===r.country.value?r.state.value:r.stateInput,d.city=r.city,d.zip=r.zip),a({variables:d}).then(()=>{(0,x.IN)("Shipping options step completed successfully",{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,shippingOptionId:n,isNewAddress:"add"===(null==w?void 0:w.value),needAddress:o,hasShippingAddressId:!!d.shippingAddressId}}),i.oR.success("Shipping information saved successfully.",(0,C.CE)()),t()}).catch(e=>{(0,x.tj)("ShippingOptions: Shipping address update failed",e,{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,shippingOptionId:n,isNewAddress:"add"===(null==w?void 0:w.value),needAddress:o,shippingAddressId:d.shippingAddressId,country:d.country,state:d.state}}),i.oR.error("Failed to save shipping information.",(0,C.CE)())})},children:t=>{let{formState:i}=t;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(l.u_,{marginBottom:"spacingSml",children:e.length>1?"Select a shipping option":"Selected shipping option:"}),(0,n.jsx)(y.P,{stack:!0,fieldGroup:"shipping",children:e.length>1?e.map((e,t)=>(0,n.jsx)(y.r,{id:`radio-collect-${t}`,label:`${e.title} - ${(0,C.vv)(e.price)}`,radioValue:e.id},e.id)):(0,n.jsx)("h3",{children:1===e.length&&`${e[0].title} - ${(0,C.vv)(e[0].price)}`})})]}),(i.values.shipping||1===e.length)&&!N&&D(!0),(1===e.length&&e[0].needAddress||i.values.shipping&&e.find(e=>e.id===i.values.shipping).needAddress)&&(0,n.jsxs)("div",{children:[o.addresses.length>0&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(f.A,{field:"shippingOption",id:"selectAddressInputDropdown",placeholder:"Select an option",value:w,onChange:F,options:[...o.addresses.map(e=>({label:e.address1,value:e.id})),{label:"Add a new address",value:"add"}]})}),w&&"add"===w.value&&(0,n.jsxs)(g.Db,{size:"spacingMed",top:!0,bottom:!0,children:[(0,n.jsx)(I.K,{title:"Create a new address",border:!0,paddingBottom:"spacingTiny",marginBottom:"spacingMed"}),(0,n.jsx)(S.p,{formState:i}),(0,n.jsxs)(p.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(v.o,{handleOnClick:d}),(0,n.jsx)(h.S,{title:"Create Address",kind:"secondary",medium:!0,loading:W,loaderColor:"white"})]})]})]}),(w&&"add"!==w.value||1===e.length&&!e[0].needAddress||i.values.shipping&&!e.find(e=>e.id===i.values.shipping).needAddress)&&(0,n.jsxs)(p.e,{borderTop:!0,justify:"space-between",children:[(0,n.jsx)(v.o,{handleOnClick:d}),N&&(0,n.jsx)(h.S,{title:1===e.length&&!e[0].needAddress||i.values.shipping&&!e.find(e=>e.id===i.values.shipping).needAddress?"Select Shipping Option":"Select Address",kind:"secondary",medium:!0,loading:W||r,loaderColor:"white"})]})]})}})}{const r={orderId:B,shippingOptionId:e[0].id};return T(!0),V({variables:r}).then(()=>{(0,x.IN)("Shipping options step completed successfully",{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,shippingOptionId:e[0].id,shippingTitle:e[0].title,autoUpdate:!0,needAddress:!1}}),i.oR.success("Shipping information saved successfully.",(0,C.CE)()),t()}).catch(t=>{(0,x.tj)("ShippingOptions: Auto-update shipping option failed",t,{mode:"Checkout",component:"ShippingOptions",context:{orderId:B,shippingOptionId:e[0].id,autoUpdate:!0}}),T(!1),i.oR.error("Failed to save shipping information.",(0,C.CE)())}),(0,n.jsx)(c.A,{show:!0})}}})()]})}},50997(e,t,r){r.d(t,{A:()=>p});var n=r(74848),o=r(96540),i=r(4586),a=r(35861),d=r(46392),s=r(2711),l=r(55127),c=r.n(l),u={};r.r(u),r.d(u,{AddressDisplay:()=>s.Vh,AddressForm:()=>s.X7,ContactDisplay:()=>s.nc,ContactForm:()=>s.DH,LinkedGuestsDisplay:()=>s.Z4,PersonalDisplay:()=>s.Fe,PersonalForm:()=>s.pT});const m=Object.assign({},u),p=e=>{let{card:t,cardTitle:r,queryData:s,noEditLink:l,multiple:u,onClickAction:p,editButtonId:g,defaultAddress:h,setDefaultAddress:y,footerContent:I}=e;const[f,v]=(0,o.useState)(null),[S,C]=(0,o.useState)(!1),[x,b]=(0,o.useState)("Personal"===t&&!Array.isArray(s)&&(null==s?void 0:s.daysUntilNameChangeAllowed)?null==s?void 0:s.daysUntilNameChangeAllowed:0);(0,o.useEffect)(()=>{b("Personal"===t&&!Array.isArray(s)&&(null==s?void 0:s.daysUntilNameChangeAllowed)?null==s?void 0:s.daysUntilNameChangeAllowed:0)},[t,s]);const[A,j]=u?(0,o.useState)(!!Array.isArray(s)&&s.reduce((e,t)=>
1277(e[t.id]=!0,e),{})):(0,o.useState)(!0),P=e=>{if(null===f||f===e)v(null===f?e:null);else if(f!==e)return null;j(t=>{const r=Object.assign({},t);return r[e]=!r[e],r})},O=()=>{j(e=>!e)},w=m[`${t}Form`],k=m[`${t}Display`];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(i.F,{editButtonId:g,multiple:u,title:r,displayElement:Boolean(A),setElementHandler:l?null:O,children:u?(0,n.jsxs)(n.Fragment,{children:[Array.isArray(s)&&s.map((e,t)=>A[e.id]?(0,n.jsx)(k,{multiple:u,queryData:[e],addressId:e.id,elemIndex:t,displayElement:A,addressInEditMode:f,setElementHandler:P,defaultAddress:h,setDefaultAddress:y}):(0,n.jsx)(w,{addressId:e.id,elemIndex:t,displayElement:A,setElementHandler:P})),S?(0,n.jsx)(w,{addNewAddress:!0,setElementHandler:e=>{C(!1),e&&j(t=>{const r=Object.assign({},t);return r[e]=!0,r})}},"addNewAddressForm"):(0,n.jsx)("div",{children:(0,n.jsx)(a.S,{title:"Add New Address",kind:"primary",loaderColor:"white",medium:!0,handleOnClick:()=>C(!0)})})]}):(0,n.jsxs)(n.Fragment,{children:[A||x>0&&"Personal"===t?(0,n.jsx)(k,{queryData:s,onClickAction:p}):(0,n.jsx)(w,{setElementHandler:O,queryData:s}),I]})}),x>0&&!A&&"Personal"===t&&(0,n.jsx)(d.A,{onClose:()=>j(!0),title:"Changes not allowed at this time",contentText:`Changes not allowed at this time. You may make the requested change in ${x} ${c()("day",x)}`})]})}},69134(e,t,r){r.d(t,{A:()=>k});var n=r(74848),o=r(96540),i=r(66967),a=r(6421),d=r(23978),s=r(56073),l=r(92383),c=r(27352),u=r(11693),m=r(20324),p=r(82702),g=r(89001),h=r(60561),y=r(66197),I=r(98878),f=r(24816),v=r(39058),S=r(27303),C=r(53383),x=r(79056),b=r(67554),A=r(42192);const j=x.default.nav`
1278  display: flex;
1279  align-items: center;
1280  justify-content: flex-end;
1281  padding-left: 4em;
1282
1283  ${b.A.desktop`
1284    padding-left: 2em;
1285  `}
1286
1287  ${b.A.tablet`
1288    padding-left: 0;
1289  `}
1290`,P=x.default.div`
1291  display: flex;
1292
1293  @media screen and (max-width: ${b.A.breakpoints.desktop}px) {
1294    background-color: ${e=>e.theme.primaryShade};
1295    bottom: 0;
1296    position: fixed;
1297    right: ${e=>e.showNavigation?0:"-100%"};
1298    top: 60px;
1299    transition: all 0.6s ease-out;
1300    width: 40%;
1301    z-index: 99999;
1302  }
1303`,O=e=>{let{authStatus:t,navStatus:r,history:o,location:i,match:a}=e;const d=(0,u.lb)();return(0,n.jsxs)(j,{"aria-label":"Main navigation",children:[!d&&(0,n.jsx)(P,{showNavigation:r,"aria-hidden":"true"}),(0,n.jsxs)(I.kx,{children:[!t&&(0,n.jsx)(A._,{history:o,location:i,match:a}),t&&(0,n.jsx)(C.B,{linkPath:"account"})]})]})},w=a.Ay`
1304  mutation UpdateOrder($orderId: String!) {
1305    ecommerce {
1306      updateOrder(id: $orderId, reset: true) {
1307        id
1308      }
1309    }
1310  }
1311`,k=e=>{let{history:t,location:r,match:a}=e;const[x,,b]=(0,i.A)([(0,u.i0)(),(0,u.Eq)()]),{orderTimeOutMin:A}=(0,o.useContext)(s.A),{mainMenuOpen:j,toggleMainMenuHandler:P,dashboardMenuOpen:k,toggleDashboardMenuHandler:$}=(0,o.useContext)(l.A),{hasTimeOut:E,orderID:L,timeOutDate:T}=(0,o.useContext)(c.A),N=m.A.isAuthenticated(),[D]=(0,d.n_)(w,{onError:e=>{(0,p.tj)("MainHeader: Update order mutation failed",e,{mode:"Cart",component:"MainHeader",context:{orderId:L}})}}),M=x[(0,u.Eq)()],B=k?"MdClose":"MdMenu",R=r.pathname.toString().includes("/account"),F=()=>{(0,g.a6)(b);const e=(0,u.Au)("cart");t.location.pathname===e||"/cart"===t.location.pathname?(t.push((0,u.Au)("reloadPage")),t.replace(e,{itemsDeleted:!0})):t.push(e,{itemsDeleted:!0})};return(0,n.jsxs)(y.D,{className:E&&A?" with-count-down-timer":"",children:[(0,n.jsxs)(y.Q,{SearchCart:!1,children:[(0,n.jsx)(h.hY,{}),(0,n.jsx)(I.wL,{onClick:P,"aria-hidden":"true"}),(0,n.jsx)(O,{history:t,location:r,match:a,authStatus:N,navStatus:j})]}),(0,n.jsxs)(y.Q,{SearchCart:!0,children:[R&&(0,n.jsx)(f.k3,{linkPath:"",linkLabel:"Go back to Store"}),N&&R&&(0,n.jsx)(v.W,{IconName:B,handleOnClick:$}),E&&A&&(0,n.jsx)(S.J,{className:R?"on-dashboard-pages":"",customTimeUpMssg:"We're sorry but the time for this cart's reservation is up",onTimeOut:()=>{L?D({variables:{orderId:L}}).then(F).catch(e=>{(0,p.tj)("MainHeader: Order cleanup failed",e,{mode:"Cart",component:"MainHeader",context:{orderId:L,reason:"timeout"}}),F()}):F()},timeOut:T||A,timerID:L,timerMssg:"Items reserved in cart for",timerType:"ORDER"}),(0,n.jsx)(C.m,{linkPath:(0,u.Au)("cart"),count:M})]})]})}},15066(e,t,r){r.d(t,{A:()=>p});var n=r(74848),o=(r(96540),r(89916)),i=r(23978),a=r(6421),d=r(79056),s=r(67554),l=r(24816),c=r(82702);const u=d.default.nav`
1312  font-family: ${e=>e.useIndyFont?e.theme.fontFamilyIndy:e.theme.fontFamily} !important;
1313  background-color: ${e=>e.theme.primaryShade};
1314  bottom: 0;
1315  display: flex;
1316  flex-direction: column;
1317  height: 100%;
1318  left: 0;
1319  overflow-x: hidden;
1320  overflow-y: scroll;
1321  position: absolute;
1322  top: 0;
1323  transition: all 0.6s ease-out;
1324  width: 200px;
1325  z-index: 9999;
1326
1327  /* Media Queries */
1328  @media screen and (max-width: ${s.A.breakpoints.phone}px) {
1329    left: ${e=>e.showNavigation?0:"-100%"};
1330    width: 100%;
1331    ${e=>e.showNavigation&&d.css`
1332    bottom: auto;
1333    position: relative;
1334    top: auto;
1335  `}
1336  }
1337`,m=a.Ay`
1338  {
1339    ecommerce {
1340      account {
1341        resortCreditEnabled
1342      }
1343    }
1344  }
1345`,p=e=>{let{authStatus:t,navStatus:r,handleOnClick:a}=e;var d,s;const{data:p}=(0,i.IT)(m,{onError:e=>{(0,c.tj)("DashboardNav: Failed to load resort credit status",e,{mode:"System",component:"DashboardNav"})}}),g=!!(null===(s=null===(d=null==p?void 0:p.ecommerce)||void 0===d?void 0:d.account)||void 0===s?void 0:s.resortCreditEnabled)&&p.ecommerce.account.resortCreditEnabled;let h=o.j;"false"===g&&(h=h.filter(e=>"credit"!==e.id));const y=window.localStorage.getItem("renewalEnabled");window.localStorage.setItem("resortCreditEnabled",g.toString()),"false"===y&&(h=h.filter(e=>"renew"!==e.id));const I=window.localStorage.getItem("easyRenewalEnabled");"false"!==I&&null!==I||(h=h.filter(e=>"subscription"!==e.id));const f="true"===I;return t&&(0,n.jsx)(u,{showNavigation:r,useIndyFont:f,onClick:a,"aria-label":"Account navigation",children:h.map(e=>(0,n.jsx)(l.c3,{linkPath:e.path,linkLabel:e.label},e.id))})}},89916(e,t,r){r.d(t,["j",0,[{id:"account01",label:"Profile",path:"account"},{id:"subscription",label:"Subscription",path:"account/subscription"},{id:"purchases02",label:"Purchases",path:"account/purchases"},{id:"redemptions",label:"Redemptions",path:"account/redemptions"},{id:"vouchers",label:"Vouchers",path:"account/vouchers"},{id:"accessRecords",label:"Lift Access",path:"account/accessRecords"},{id:"events",label:"Events",path:"account/events"},{id:"credit",label:"Resort Credit",path:"account/credit"},{id:"renew",label:"Renew",path:"account/renew"},{id:"logout04",label:"Logout",path:"logout"}]])},65143(e,t,r){r.d(t,{a:()=>s,b:()=>l});var n=r(74848),o=(r(96540),r(6690)),i=r(83849),a=r(11693),d=r(49138);const s=e=>{if(!e.maxQuantity||!e.minQuantity)return(0,n.jsx)(o.P,{field:e.id,label:`${e.name} - ${(0,a.vv)(e.price)}`})},l=e=>{const t=(0,d.mn)(e,a.vv);return(0,n.jsx)(i.A,{id:`addonProductSelect_${e.selectId}`,setClearable:!0,field:e.fieldName,placeholder:`Add ${e.name}`,options:t})}}}]);

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.