PageSourceSearch

https://reservation.parcasterix.fr/assets/ProductChangeDateReplacementDate.presentation-DuF9tHCh.js

js parcasterix.fr collected 2026-10-01 11:54:23 UTC 20,021 bytes, 205 lines download raw bytes

1import{D as X,q as h,C as ut,a6 as V,c as N,h as le,a,ff as ht,fg as gt,fh as mt,r as s,_ as D,fi as x,fj as q,fk as pt,cN as Ae,fl as se,fm as Fe,fn as Me,fo as Be,j as e,c2 as W,fp as Te,fq as ke,fr as _e,fs as xt,bO as ft,fb as Dt,ft as bt,fu as ue,fv as Re,X as B,bi as Ct,fw as Ie,ct as Ve,c3 as Pt,fx as Ne,e_ as yt,f8 as Et,cz as St,R as T,F as w,fy as vt,fz as Lt,fA as jt,fB as At,fC as Pe,fD as Ft,fE as Mt,fF as Bt,fG as Tt,fH as kt,fI as _t,fJ as Rt,fK as Oe,fL as we,fM as It,fN as Vt,fO as Nt,fP as Ot,fQ as wt,fR as Ut,fS as ye,fT as $t,fU as re,fV as ie,I as k,fW as Ht,fX as Wt,fY as Gt,V as Q,fZ as zt,f_ as Ue,f$ as Yt,g0 as qt,g1 as Xt,g2 as Qt,g3 as Kt,f6 as Jt,g4 as Zt,g5 as Ee,g6 as ea,g7 as ta,c7 as aa,ey as oa,cs as na,ez as sa,g8 as ra,g9 as ia,ga as ca,eA as da,gb as la,b5 as ua,b6 as ha,gc as ga,gd as ma,ge as pa,eL as Se,aI as xa}from"./index-CQaiPqwp.js";import{P as fa}from"./PromoCartImage.component-UJYIeXRQ.js";import{R as Da}from"./ReinsuranceSentence.component-BgWVZq9p.js";import{C as ba}from"./CardLayoutTitle.component-D5IGGxJO.js";import{O as ve}from"./OpenModal.component-DibLuewg.js";import{W as ce}from"./WarningMessage.component-DG2N3Han.js";/* empty css                            */import{S as $e}from"./SingleDatePicker.component-CdaRoQxK.js";import{k as de,E as He,l as Ca,m as Pa,n as ya,o as Ea,N as Sa}from"./SelectionProductList.component-C6KlpcAg.js";import{C as va,u as La}from"./index.esm-DGIHq7I6.js";import{F as ja,g as Aa}from"./input.helper-D1shRJlk.js";import{R as Fa}from"./Recaptcha.component-CLuG1NuO.js";import{B as Ma,a as Ba,b as Ta}from"./form.util-Eihhh5K3.js";import{A as ka,a as _a}from"./ChangeDate.style-JuoFbCGi.js";import{C as Ra}from"./ChangeDateLandingTitleModal.component-C0Ykyv3X.js";import{A as Ia}from"./Alert.style-CMMqopFC.js";import{D as Va}from"./Dropdown.component-BG8PRCFX.js";import{S as Na}from"./SelectedProductDateBlock.component-CfKXs_p9.js";import{M as Oa}from"./MessageAlert.component-BOpbPenV.js";import{A as wa}from"./AppLayout.component-B34jiFc-.js";import{C as Ua,a as $a}from"./CartDrawer.component-xwg0sdVi.js";import{C as Ha}from"./route.type-DDSUoEfB.js";import"./StarRating.component-BQFBN-jS.js";import"./PrivateContent.component-CA0ub5Pl.js";import"./SelectionProduct.style-DzpfFTFo.js";import"./react-select.esm-BTkEaSrm.js";import"./Alert.component-CNprVkDS.js";import"./RichTextLink.component-BuB0fEgt.js";import"./CartDeletion.component-B_yTeshh.js";import"./index-Dv-0yCFp.js";import"./regex.constant-BicOlS9j.js";import"./SelectionBundleList.component-DYeUyWCm.js";const Wa=h.div`
2  padding: 0 20px;
3  
4  @media ${X.TABLET} {
5    padding: 0 30px;
6  }
7  
8  & > * {
9    margin-top: 30px;
10  }
11`;h.div`
12  margin-top: 20px;
13
14  @media ${X.TABLET} {
15    margin-top: 10px;
16  }
17`;const Ga=h.div`
18  position: absolute;
19  .react-datepicker__input-container {
20    width: 0;
21    padding: 0;
22    border: 0;
23    border: none;
24  }
25`,za=h.span`
26  margin-right: 10px;
27`,Ya=h(ut)`
28  display: flex;
29  flex-direction: column;
30  justify-content: center;
31  padding: 30px;
32  min-width: 330px;
33
34  @media ${X.TABLET_AND_MOBILE} {
35    padding: 20px;
36  }
37
38  & > * + * {
39    margin-top: 20px;
40  }
41
42  ${de} + ${de} {
43    margin-top: 10px;
44  }
45
46`,qa=h.div`
47  & > * + * {
48    margin-top: 10px;
49  }
50`,Xa=h.div`
51  display: flex;
52  background-color: ${o=>o.theme.errorBackground};
53  color: ${o=>o.theme.error};
54  padding: 20px;
55  gap: 10px;
56  border-radius: 10px;
57  line-height: 21.15px;
58  font-size: 15px;
59  font-weight: 700;
60`,Qa=h.div`
61`,Le=h.div`
62  display: flex;
63  background-color: ${o=>o.theme.grey1};
64  padding: 20px;
65  gap: 10px;
66  border-radius: 10px;
67  line-height: 21.15px;
68  font-size: 15px;
69  font-weight: 400;
70`;D.extend(ke);D.extend(_e);const Ka=o=>{const{barcodes:r,disabled:i=!1}=o,t=V(),f=N(),{isSmallViewport:c}=le(),g=a(ht()),l=a(gt),b=a(mt),[P,m]=s.useState(),[C,A]=s.useState(b?D(b,x):null),y=s.useMemo(()=>P?D(q(P)):C?C.startOf("month"):g?.length>0?D(g[0],x).startOf("month"):D().startOf("month"),[C,P,g]),F=a(pt),[E]=s.useState(q(y.format(x))||D().format(x)),[n,j]=s.useState(q(y.format(x))),[S,u]=s.useState(!1),_=a(Ae);D.locale(_);const U=s.useCallback(()=>{const L=D(n).add(1,"month");j(L.format(x)),m(L.format(x)),t(se(L.format(x)))},[n,t]),$=s.useCallback(()=>{const L=D(n).subtract(1,"month");j(L.format(x)),m(L.format(x)),t(se(L.format(x)))},[n,t]),K=Fe(D(n)),G=Me(D(n)),J=L=>{const R=L.format("YYYY-MM-DD");return!!g&&!g.includes(R)},Z=s.useCallback(L=>{L&&(A(L),t(Be(f,r,L.format(x),c)),u(!1))},[t,f,r,c]),ee=s.useCallback(L=>{const R=C?y.format(x):E;j(R),m(R),t(se(R)),u(L.focused)},[j,C,t,y,E]),te=()=>{S||u(!0)};return e.jsxs(W,{disabled:i,onClick:te,"data-cy":"allProductChangeCalendarButton",icon:"calendar-products",children:[e.jsx(Ga,{children:e.jsx($e,{hideInput:!0,readOnly:!0,date:C,onDateChange:Z,focused:S,onFocusChange:ee,id:Te(),numberOfMonths:1,hideKeyboardShortcutsPanel:!0,withFullScreenPortal:c,onNextMonthClick:U,onPrevMonthClick:$,isPrevButtonDisabled:K,isNextButtonDisabled:G,initialVisibleMonth:y,dateFormat:D.localeData().longDateFormat("L"),isDayBlocked:J,isCalendarLoading:!l,disabled:!l})}),e.jsx(za,{children:F})]})},Ja=h.form`
71  margin-top: 20px;
72  & > *:first-child {
73    margin-bottom: 10px;
74  }
75`,Za=h.div`
76  padding-top: 20px;
77  margin-top: 20px;
78  border-top: 1px solid;
79  border-color: ${o=>o.theme.grey2};
80  display: flex;
81  justify-content: space-between;
82  
83  & > *:first-child {
84    margin-right: 10px;
85  }
86`,eo=o=>{const{control:r,rules:i,errorMessage:t,setBarcodeAsChange:f}=o,c=l=>t||Aa(l,g),g=a(xt),p=a(ft(g.label,!!i?.required));
86return e.jsx(va,{control:r,name:Dt,rules:i,render:({field:l,fieldState:b})=>e.jsx(ja,{type:"text",help:g.helperText,error:c(b.error),label:p,name:l.name,value:l.value,onChange:P=>{f(!0),l.onChange(P.target?.value)},onBlur:l.onBlur,inputRef:l.ref,required:!!i?.required})})},to="onTouched",ao="error.changeDate.barcodeIssue",oo="error.changeDate.duplicateBarcodeIssue",no=o=>{const{onCancel:r,onSubmit:i,recaptchaRef:t}=o,f=a(bt),c=a(ue),[g,p]=s.useState(!1),l=a(Re),b=a(B(ao)),P=a(B(oo)),m=!a(Ct),C=a(Ie),A=S=>{S.key==="Enter"&&(S.preventDefault(),S.currentTarget.blur())},{control:y,handleSubmit:F,getValues:E}=La({mode:to,defaultValues:{barcode:void 0}}),n=async S=>{p(!1),i(S)},j=()=>{if(l.some(S=>S.barcode===E().barcode))return P;if(!C&&!g)return b};return e.jsxs(Ja,{onSubmit:F(n),onKeyPress:A,"data-cy":"AddBarcodeChangeDateForm",children:[e.jsx(eo,{control:y,rules:{validate:{required:()=>!j()},required:!0,minLength:Ta,maxLength:Ba,pattern:Ma},setBarcodeAsChange:p,errorMessage:j()}),e.jsxs(Za,{children:[e.jsx(W,{"data-cy":"AddBarcodeChangeDateFormCancelButton",onClick:r,variant:Ve.SECONDARY,fullWidth:!0,children:c}),e.jsx(W,{disabled:m,"data-cy":"AddBarcodeChangeDateFormSubmitButton",type:Pt.SUBMIT,fullWidth:!0,children:f})]}),e.jsx(Fa,{ref:t})]})},so=o=>{const{onClose:r}=o,i=V(),t=a(Ne),f=a(yt),c=a(Ie),g=a(Et),p=N(),l=s.useRef(null),[b,P]=s.useState(void 0),m=async C=>{try{i(vt(C,p)),P(C.barcode)}finally{await l.current?.execute()}};return s.useEffect(()=>{g.some(C=>C.id===b)&&c&&r()},[b,g,c,r]),e.jsx(St,{onClose:r,hideFooter:!0,titleLabel:t,children:e.jsxs(ka,{"data-cy":"AddBarcodeModal",children:[e.jsx(_a,{"data-cy":"AddBarcodeModalContent",children:e.jsx(T,{document:f,defaultFontSize:w.TEXT_MD})}),e.jsx(no,{onCancel:r,onSubmit:m,recaptchaRef:l})]})})},ro=h.div`
87
88  ${Ia} {
89    padding: 12px;
90  }
91`,je=h.div`
92  display: flex;
93`,io=h.div`
94  display: flex;
95  justify-content: space-between;
96  align-items: center;
97
98  .SingleDatePickerInput_calendarIcon {
99    svg {
100      vertical-align: text-top;
101    }
102
103    margin: 0;
104    padding-left: 0;
105  }
106
107  .react-datepicker__input-container:hover {
108    border: 1px solid black !important;
109  }
110
111
112  ${({isError:o})=>o&&`
113     .SingleDatePicker .SingleDatePickerInput__withBorder  {
114      border: 1.5px solid red !important;
115      input {color: red;!important;}
116    }
117  `}
118  
119  &.calendar-disabled {
120    pointer-events: none;
121    opacity: 0.5;
122    user-select: none;
123  }
124`,co=h.div`
125  min-width: 90px;
126`,lo=h.div`
127  display: flex;
128  color: var(--color-grey-4);
129
130  .custom__control {
131    font-weight: bold;
132    color: var(--color-grey-4) !important;
133  }
134
135  select {
136    font-weight: bold;
137    color: var(--color-grey-4);
138  }
139`,uo=h.div`
140  display: flex;
141  height: 40px;
142  gap: 10px;
143`,ho=h.div`
144  display: flex;
145  align-items: center;
146  margin-left: 10px;
147`,go=h.div`
148  height: 25px;
149  padding: 4px 6px 4px 0;
150`;D.extend(ke);D.extend(_e);const mo="error.changeDate.requiredNewDatetimeIssue",po="warning.changeDate.unavailableProductAt",We=o=>{const{isProductDatedAndLastOfList:r,productId:i,barcodes:t,isExchangeable:f=!0,isPackageComponent:c=!1,shouldDisplaySessions:g=!1}=o,p=V(),l=N(),{isSmallViewport:b}=le(),P=a(Lt(t[0])),m=a(c?jt(t[0]):At(t[0])),C=a(c?Pe(t[0]):()=>{}),A=a(Pe(t[0])),y=m.finalProduct,F=C?.map(d=>d.finalProduct),E=!c&&(y?.validDateVisit==null||y.validDateVisit)||c&&F?.every(d=>d?.validDateVisit==null||d.validDateVisit),n=a(Ft(t)),j=a(Mt),S=a(Bt(t[0])),u=a(Tt(t)),_=a(kt(t[0]))&&g,U=S||u||_,$=a(_t(t)),K=a(Rt),G=a(c?Oe(t):we(t[0])),J=a(It(t[0])),Z=a(Vt(i)),ee=a(Nt),te=a(B(mo)),L=a(B(po)),R=a(Ot),ae=a(wt),Ye=a(Ae);D.locale(Ye);const[qe,he]=s.useState(!1),[ge,Xe]=s.useState([]),me=a(Ut(t[0])),pe=G||K||me||!E,[M,xe]=s.useState(ye(m.selectedDate)),Qe=r?"top-start":"bottom-start",I=P?.firstAvailableDates,fe=s.useMemo(()=>M||D(I[0],x)||D(),[M,I]),[O,z]=s.useState(q(fe.format(x))),Ke=s.useMemo(()=>Te(),[]),Je=a($t);s.useEffect(()=>{xe(ye(m.selectedDate))},[m]);const Ze=Fe(D(O)),et=Me(D(O)),tt=d=>{const v=d.format("YYYY-MM-DD");return!!I&&!I.includes(v)},at=s.useCallback(()=>{const v=D(O).add(1,"month");z(v.format(x)),p(re(t[0],v.format(x)))},[t,O,p]),ot=s.useCallback(()=>{const v=(I[0]?ie(I[0]):ie(O)).subtract(1,"month");z(v.format(x)),p(re(t[0],v.format(x)))},[I,t,O,p]),De=s.useCallback(d=>{const v=ie(M.format()).format(x);z(v),d.focused&&ae&&p(re(t[0],v)),he(d.focused)},[M,p,z,t,ae]),nt=s.useCallback(d=>{d&&(n!==null&&Xe(n),xe(d),p(Be(l,t,d.format(x),b)),he(!1))},[n,p,l,t,b]),st=()=>Z&&M?e.jsx(Na,{productId:i,onFocusChange:De}):e.jsx(e.Fragment,{}),rt=()=>(n||ge).map(d=>{const v=d.value===Y?d.label.split("-")[0].trim():d.label;return{value:d.value,label:v,disabled:d.disabled}}),oe=A?.find(d=>$.find(v=>v.barcode===d.barcode&&v.hasSessions)),ne=A?.find(d=>$.find(v=>v.barcode===d.barcode&&!v.hasSessions)),Y=c?oe?.finalProduct?.finalDateVisit?.id||oe?.initialProduct?.initialDateVisit?.id:y?.finalDateVisit?.id||m.initialProduct?.initialDateVisit?.id,it=(Y===m.initialProduct?.initialDateVisit?.id||Y===oe?.initialProduct?.initialDateVisit?.id)&&y?.finalDateVisit===null,ct=async d=>{M&&p(c?Wt(l,$,d!==""?d:M.format(x),ne.finalProduct.finalDateVisit&&ne.finalProduct.finalDateVisit.id||ne.initialProduct.initialDateVisit.id):Gt(l,t,d!==""?d:M.format(x)))},dt=()=>(H||!u)&&!E?e.jsx(k,{name:"warning",size:"18",color:"yellow"}):!H||u||E?G?e.jsx(k,{name:"check-mark-circle",size:"18",color:"success"}):e.jsx(k,{name:"warning",size:"18",color:"error"}):"",lt=!n||n.length>0&&n[0].value.startsWith(M.format("YYYY-MM-DD")),H=m.isDatedWithoutSessions||!(S&&n!==void 0),be=!H&&(pe&&!J||me),Ce=R&&ae;return e.jsxs(ro,{children:[f&&e.jsxs(je,{children:[e.jsxs(uo,{children:[e.jsx(io,{"data-cy":"FlexibleProductDatePicker",className:Je?"calendar-disabled":"",isError:be,children:e.jsx($e,{readOnly:!0,date:M,onDateChange:nt,focused:qe,onFocusChange:De,id:Ke,placeholder:ee,numberOfMonths:1,hideKeyboardShortcutsPanel:!0,withFullScreenPortal:b,onNextMonthClick:at,onPrevMonthClick:ot,isPrevButtonDisabled:Ze,isNextButtonDisabled:et,dateFormat:D.localeData().longDateFormat("L"),customInputIcon:Ce?e.jsx(k,{name:"calendar-button",size:"16",color:be?"error":"grey3"}):e.jsx(Ht,{children:e.jsx(k,{name:"mini-loader",size:"16",color:"primary"})}),isDayBlocked:tt,renderCalendarInfo:st(),openDirection:Qe,initialVisibleMonth:fe,isCalendarLoading:!Ce})}),U&&n&&e.jsx(lo,{"data-cy":"SessionDropdown",children:e.jsx(co,{children:e.jsx(Va,{defaultOptionValue:void 0,onChange:ct,optionList:lt?rt():ge,placeholderL
150abel:j,selectedValue:n.length>1?Y:"",disabled:n.length===1||!c&&it,shape:"round",hasError:!E,name:"sessionTime",customPaddingStyle:"0 0 0 14px",customIcon:"clock",customIconColor:E?"grey3":"error",customIconSize:"16"})})})]}),pe&&e.jsx(ho,{children:dt()})]}),H&&!E&&e.jsx(ce,{document:L,placeholderMap:new Map([["%initial_date",M.format("L")||""]])}),!H&&!E&&e.jsx(Oa,{status:"danger",dataCy:"UnavailableDateMessageComponent",document:te,defaultFontSize:w.TEXT_SMD}),!f&&e.jsx(je,{children:m.initialProduct?.initialDateVisit&&e.jsx(go,{"data-cy":"changeDateDateText",children:M.format("L")})})]})},xo=h(zt)`
151  border: ${o=>o.isValid?"1px":"2px"}  solid ${o=>o.isValid?o.theme.grey3:o.theme.grey2};
152  border-radius: 8px;  
153  display: flex;
154  justify-content: space-between;
155  padding: 20px calc(20px - var(--card-border-width));
156  @media ${X.DESKTOP} {
157    padding: 30px calc(30px - var(--card-border-width));
158  }
159  
160  ${Q} {
161    font-size: var(--text-sm);
162    margin-top: 0;
163  }
164`,Ge=h.div`
165  display: flex;
166  justify-content: space-between;
167`,fo=h.span`
168  font-weight: bold;
169`,ze=h.div`
170  font-size: var(--text-sm);
171  color: ${o=>o.theme.grey3};
172`,Do=h.div`
173  width: 100%;
174  ${Ge},${ze} {
175    margin-top: 10px;
176  }
177  color: ${o=>!o.isExchangeable&&o.theme.grey3};
178`,bo=h.div`
179  background-color: ${o=>o.theme.grey1};
180  color: ${o=>o.theme.grey3};
181  white-space: nowrap;
182  height: fit-content;
183  font-style: normal;
184  font-weight: 700;
185  padding: 4px 6px;
186  border-radius: 5px;
187`,Co="info.changeDate.notEditableProduct",Po=o=>{const r=V(),i=N(),{flexiblePackage:t}=o,f=t.productCode,c=t.components.map(n=>n.isExchangeable).reduce((n,j)=>n&&j),g=a(Oe(t.components.map(n=>n.barcode))),p=a(B(Co)),[l,b]=s.useState(t.packageLabel||""),[P,m]=s.useState(t.components[0].initialProduct?.variantLabel||""),C=a(ue);if(s.useEffect(()=>{t.components[0].finalProduct?.validDateVisit?(b(t.packageLabel||""),m(t.components[0].finalProduct?.variantLabel||"")):(b(t.packageLabel||""),m(t.components[0].initialProduct?.variantLabel||""))},[t]),!t.components[0].finalProduct)return null;const A=t.components[0].exchangeFees?.dynamicPriceWithTaxes?.value,y=t.components[0].exchangeFees?.dynamicPriceWithTaxes?.currencyCode,F=()=>{r(Ue(t.components.map(n=>n.barcode),i))},{finalDateVisit:E}=t.components[0].finalProduct;return e.jsxs(xo,{"data-cy":"PackageFlexProduct",isValid:g,children:[e.jsxs(Do,{"data-cy":"ProductChangeDatePicker",isExchangeable:c,children:[t.components[0].initialProduct?.initialDateVisit&&e.jsx(We,{productId:f,barcodes:t.components.map(n=>n.barcode),isExchangeable:c,isPackageComponent:!0}),e.jsxs(Ge,{"data-cy":"changeDateProductDetail",children:[e.jsxs("div",{children:[e.jsx(fo,{children:l}),` - ${P}`]}),A!==void 0&&y&&e.jsx(He,{value:A,currencyCode:y})]}),t.components.map(n=>e.jsx(ze,{children:n.barcode})),E&&e.jsx(Q,{type:"button",onClick:F,"data-cy":"changeDateCancelButton",children:C})]}),!c&&e.jsx(bo,{"data-cy":"notExchangeableLabel",children:e.jsx(T,{document:p})})]})},yo="info.changeDate.notEditableProduct",Eo=o=>{const r=V(),i=N(),{flexibleProduct:t}=o,f=t.finalProduct?.productCode,{isExchangeable:c}=t,g=a(we(t.barcode)),p=a(B(yo)),[l,b]=s.useState(t.initialProduct?.productLabel||""),[P,m]=s.useState(t.initialProduct?.variantLabel||""),[C,A]=s.useState(t.initialProduct?.shouldDisplaySessions||!1),y=a(ue);if(s.useEffect(()=>{t.finalProduct?.validDateVisit?(b(t.finalProduct?.productLabel||""),m(t.finalProduct?.variantLabel||""),A(t.finalProduct?.shouldDisplaySessions||!1)):(b(t.initialProduct?.productLabel||""),m(t.initialProduct?.variantLabel||""),A(t.initialProduct?.shouldDisplaySessions||!1))},[t]),!t.finalProduct)return null;const F=t.exchangeFees?.dynamicPriceWithTaxes?.value,E=t.exchangeFees?.dynamicPriceWithTaxes?.currencyCode,n=()=>{r(Ue([t.barcode],i))},{finalDateVisit:j}=t.finalProduct;return e.jsxs(de,{"data-cy":"Product",isValid:g,children:[e.jsxs(Ca,{"data-cy":"ProductChangeDatePicker",isExchangeable:c,children:[e.jsx(We,{productId:f,barcodes:[t.barcode],isExchangeable:c,shouldDisplaySessions:C}),e.jsxs(Pa,{"data-cy":"changeDateProductDetail",children:[e.jsxs("div",{children:[e.jsx(ya,{children:l}),` - ${P}`]}),F!==void 0&&E&&e.jsx(He,{value:F,currencyCode:E})]}),e.jsx(Ea,{children:t.barcode}),j&&e.jsx(Q,{type:"button",onClick:n,"data-cy":"changeDateCancelButton",children:y})]}),!c&&e.jsx(Sa,{"data-cy":"notExchangeableLabel",children:e.jsx(T,{document:p})})]})},So="error.changeDate.allProductsNotEditable",vo="error.changeDate.allProductsNotEditableRedirectionButton",Lo="error.changeDate.TooMuchProducts",jo="info.changeDate.ChangeProductUnitary",Ao="info.changeDate.ExchangeFees",Fo=()=>{const o=a(Re),r=a(Yt),i=N(),t=a(qt),f=a(Xt),c=a(Qt),g=a(Kt),p=a(Ne),l=a(Jt),b=l!==void 0&&o.length+r.length===l,P=l!==void 0&&o.length+r.length>l,m=a(B(So)),C=a(B(vo)),A=a(B(Lo)),y=a(B(jo)),F=a(B(Ao)),{onBoardingTitle:E,datedProductSubtitle:n,conditionsButton:j}=a(Zt);o.length===0&&r.length===0&&i.replace(Ee);const S=o.filter(u=>!u.isExchangeable).length===o.length&&r.filter(u=>!u.components.map(_=>_.isExchangeable).reduce((_,U)=>_&&U)).length===r.length;return e.jsxs(Ya,{children:[e.jsxs(qa,{children:[e.jsx(ba,{level:2,children:E}),!(S||P)&&e.jsx(T,{document:n,defaultFontSize:w.TEXT_SMD}),e.jsx(ve,{modal:Ra,optionId:"{option.id}",button:Q,children:j})]}),g&&e.jsxs(Le,{"data-cy":"feesWarningMessage",children:[e.jsx("div",{children:e.jsx(k,{size:"20",name:"light-bulb"})}),e.jsx("span",{children:e.jsx(T,{document:F,defaultFontSize:w.TEXT_SMD})})]}),!(S||P)&&e.jsxs(e.Fragment,{children:[e.jsx(Ka,{disabled:f,barcodes:o.filter(u=>u.isExchangeable).map(u=>u.barcode).concat(r.flatMap(u=>u.components).map(u=>u.barcode))}),c&&e.jsx("div",{"data-cy":"notExchangeableProductWarningMessage",children:e.jsx(ce,{document:t})}),o?.map(u=>e.jsx(Eo,{flexibleProduct:u},u.barcode)),r?.map(u=>e.jsx(Po,{flexiblePackage:u},u.packageId)),e.jsx(Qa,{children:e.jsx(ve,{modal:so,isDisabled:b,dataCy:"OpenModalAddBarcode",button:u=>e.jsx(W,{...u,variant:Ve.SECONDARY,icon:"add-ticket",children:p})})})]}),S&&e.jsxs(e.Fragment,{children:[e.jsxs(Xa,{"data-cy":"allProductsNotEditableErrorMessage",children:[e.jsx("div",{children:e.jsx(k,{size:"20",name:"warning",color:"error"})}),e.jsx("span",{children:e.jsx(T,{document:m,defaultFontSize:w.TEXT_SMD})})]}),e.jsx(W,{onClick:()=>i.push(Ee),"data-cy":"allProductsNotEditableRedirectionButton",fullWidth:!0,children:e.jsx(T,{document:C})})]}),P&&!S&&e.jsxs("div",{"data-cy":"tooMuchProductWarningMessage",children:[e.jsx(ce,{document:A}),e.jsx("div",{children:e.jsxs(Le,{"data-cy":"changeProductsUnitaryInfo",children:[e.jsx("div",{children:e.jsx(k,{size:"20",name:"light-bulb"})}),e.jsx("span",{children:e.jsx(T,{document:y,defaultFontSize:w.TEXT_SMD})})]})})]})]})},Mo=h.div`
188  display: flex;
189  align-items: flex-start;
190  justify-content: center;
191  
192  & > *:first-child {
193    flex-grow: 1;
194  }
195`,Bo=h.aside`
196  position: sticky;
197  top: 20px;
198  flex: 0 0 400px;
199  max-width: 50%;
200  margin-left: 20px;
201  
202  & > * + * {
203     margin-top: 20px;
204  }
205`,To=o=>{const{children:r,sidebar:i}=o,t=V(),f=a(ea),{isSmallViewport:c}=le();return s.useEffect(()=>{f&&t(ta())},[t,f]),e.jsxs(e.Fragment,{children:[e.jsxs(Mo,{children:[r,!c&&e.jsxs(Bo,{children:[e.jsx(Ua,{}),i]})]}),c&&e.jsx($a,{})]})};function ko(o,r){return async i=>
205(await i(aa()),i(oa(na.CHANGE_DATE)),await i(sa(r)),await i(ra()),await i(ia(o)),await i(ca()),await i(da()),await i(la()),i(ua(ha.CHANGE_DATE_REPLACEMENT_DATE)),Promise.resolve())}const gn=()=>{const o=V(),r=N(),i=a(ga),{introProductList:t}=a(ma),f=a(pa);return s.useEffect(()=>{const g=new URLSearchParams(r.location.search).get(Ha.isForUndatedProducts)==="true"?Se.EXCHANGE:Se.CHANGE_DATE;o(ko(r,g))},[r,o]),f?e.jsx(xa,{}):e.jsx(wa,{hasBreadcrumb:!0,children:e.jsxs(Wa,{children:[e.jsx(Da,{reinsurance:t}),e.jsx(To,{sidebar:e.jsx(fa,{image:i}),children:e.jsx(Fo,{})})]})})};export{gn as ProductChangeDateReplacementDatePresentation};

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.