@lanaco/lnc-react-ui 4.0.200 → 4.0.201

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/BannerSectionCarousel.cjs +4 -4
  2. package/dist/BannerSectionCarousel.js +51 -542
  3. package/dist/BlogCardsSponsoredSection.cjs +1 -1
  4. package/dist/BlogCardsSponsoredSection.js +1 -1
  5. package/dist/BlogListSection.cjs +1 -1
  6. package/dist/BlogListSection.js +1 -1
  7. package/dist/BlogsSectionDetailed.cjs +1 -1
  8. package/dist/BlogsSectionDetailed.js +1 -1
  9. package/dist/BlogsSectionSimple.cjs +1 -1
  10. package/dist/BlogsSectionSimple.js +1 -1
  11. package/dist/BlogsSectionWithFilters.cjs +1 -1
  12. package/dist/BlogsSectionWithFilters.js +1 -1
  13. package/dist/DetailedProductsSection.cjs +1 -1
  14. package/dist/DetailedProductsSection.js +1 -1
  15. package/dist/GiftCardsSection.cjs +1 -1
  16. package/dist/GiftCardsSection.js +1 -1
  17. package/dist/PartnerBrandsSection.cjs +62 -0
  18. package/dist/PartnerBrandsSection.js +154 -0
  19. package/dist/PartnerStatsSection.cjs +100 -0
  20. package/dist/PartnerStatsSection.js +124 -0
  21. package/dist/ProductsWithBannerSection.cjs +1 -1
  22. package/dist/ProductsWithBannerSection.js +1 -1
  23. package/dist/SalesCampaignsSection.cjs +36 -26
  24. package/dist/SalesCampaignsSection.js +226 -213
  25. package/dist/SimpleCategoriesSection.cjs +1 -1
  26. package/dist/SimpleCategoriesSection.js +1 -1
  27. package/dist/index-BppfjY8h.js +497 -0
  28. package/dist/index-DeS-oqJB.cjs +1 -0
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +23 -19
  31. package/dist/{style-CkcozOY6.cjs → style-B4kAj6YU.cjs} +38 -8
  32. package/dist/{style-Cmlod7oq.js → style-neMbLWE6.js} +42 -11
  33. package/package.json +4 -2
  34. package/vite.config.js +8 -0
@@ -1,23 +1,30 @@
1
- "use strict";const r=require("react/jsx-runtime"),c=require("react"),b=require("./emotion-styled.browser.esm-BtEseadx.cjs"),w=require("./utils-RnrgDDZP.cjs"),T=require("./consts-goSZX3xP.cjs"),me=require("./Icon.cjs"),ce=require("./ShopAvatar-CV3lj34D.cjs"),ye=require("./Badge.cjs"),ue=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),de=require("./IconButton.cjs"),pe=require("./useDetectMobile-zkbzoOGV.cjs"),_e=require("./index-CX2A-q39.cjs"),$e=require("./motion-B_VPZaJq.cjs"),a=require("./style-BAcV7F53.cjs"),ke=b.styled.a`
1
+ "use strict";const r=require("react/jsx-runtime"),c=require("react"),S=require("./emotion-styled.browser.esm-BtEseadx.cjs"),w=require("./utils-RnrgDDZP.cjs"),L=require("./consts-goSZX3xP.cjs"),pe=require("./Icon.cjs"),ce=require("./ShopAvatar-CV3lj34D.cjs"),_e=require("./Badge.cjs"),ue=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),de=require("./IconButton.cjs"),me=require("./useDetectMobile-zkbzoOGV.cjs"),$e=require("./index-CX2A-q39.cjs"),ke=require("./motion-B_VPZaJq.cjs"),a=require("./style-BAcV7F53.cjs"),Ie=S.styled.a`
2
2
  text-decoration: none;
3
3
  color: var(--gray-950);
4
4
  cursor: pointer;
5
5
  display: flex;
6
+ flex-direction: column;
6
7
  gap: 1rem;
7
- padding: 1.25rem;
8
+ padding: 1rem;
8
9
  border-radius: 1.25rem;
9
- border: 1px solid var(--gray-200, #e4e9f0);
10
-
11
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
12
- flex-direction: column;
13
- padding: 1rem;
10
+ box-shadow: 0px 1px 2px 0px rgba(0, 0, 0, 0.05);
11
+
12
+ ${n=>n!=null&&n.sponsored?`
13
+ border: 1px solid transparent;
14
+ background:
15
+ linear-gradient(#ffffff, #ffffff) padding-box,
16
+ linear-gradient(to bottom, #fcd34d, #fef3c7) border-box;
17
+ `:`
18
+ border: 1px solid var(--gray-200, #e4e9f0);
19
+ background: #ffffff;
20
+ `}
21
+
22
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
23
+ width: 100%;
14
24
  gap: 0;
15
25
  }
16
- `,Ie=b.styled.div`
26
+ `,Ce=S.styled.div`
17
27
  border-radius: ${n=>w.getBorderRadiusValueWithUnits(n.theme,"edged")};
18
- height: 13.75rem;
19
- width: 13.75rem;
20
- min-width: 13.75rem;
21
28
  cursor: pointer;
22
29
 
23
30
  position: relative;
@@ -36,7 +43,11 @@
36
43
  transform: scale(1.25);
37
44
  }
38
45
  }
39
- `,Ce=b.styled.div`
46
+
47
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
48
+ width: 14.5rem;
49
+ }
50
+ `,Pe=S.styled.div`
40
51
  flex: 1;
41
52
  display: flex;
42
53
  flex-direction: column;
@@ -119,7 +130,7 @@
119
130
  color: var(--gray-600, #676e79);
120
131
  }
121
132
 
122
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
133
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
123
134
  padding: 1rem 0 0 0;
124
135
 
125
136
  & .campaign-title-text {
@@ -150,7 +161,7 @@
150
161
  ${t?"":"flex-wrap: nowrap;"}
151
162
  ${n?"align-items: center;":""}
152
163
  ${s?"justify-content: center;":""}
153
- `,Pe=b.styled.a`
164
+ `,De=S.styled.a`
154
165
  text-decoration: none;
155
166
  color: var(--gray-950);
156
167
  ${n=>n.hasPermission===!0&&"cursor: pointer"};
@@ -170,7 +181,6 @@
170
181
 
171
182
  ${ge(!0)}
172
183
  gap: 0.5rem;
173
- padding: 0.5rem;
174
184
  color: var(--gray-950, #14161a);
175
185
  font-weight: 500;
176
186
  font-size: 1rem;
@@ -223,17 +233,17 @@
223
233
  background-color: var(--gray-95080, #14161acc);
224
234
  }
225
235
 
226
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
236
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
227
237
  padding: 0;
228
238
  font-size: 0.875rem;
229
239
  }
230
- `,De=b.styled.div`
240
+ `,Le=S.styled.div`
231
241
  position: absolute;
232
242
  top: 0.5rem;
233
243
  ${n=>n.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
234
244
  display: flex;
235
245
  gap: 0.25rem;
236
- `,Ne=b.styled.div`
246
+ `,Ne=S.styled.div`
237
247
  border-radius: ${n=>w.getBorderRadiusValueWithUnits(n.theme,n.borderRadius||"slight")};
238
248
  background-color: ${n=>n==null?void 0:n.color};
239
249
  color: white;
@@ -249,7 +259,7 @@
249
259
  & i {
250
260
  font-size: 0.813rem;
251
261
  }
252
- `,Le=c.forwardRef(({src:n,...t},s)=>{const o=c.useRef();return c.useEffect(()=>{var m;const d=i=>{i.target.src=ce.DefaultShopImage,i.onerror=null};return(m=o==null?void 0:o.current)==null||m.addEventListener("error",d),()=>{var i;(i=o==null?void 0:o.current)==null||i.removeEventListener("error",d)}},[]),r.jsx(c.Fragment,{ref:s,children:w.isDefinedNotEmptyString(n)?r.jsx("img",{ref:o,src:n,...t}):r.jsx("img",{src:ce.DefaultShopImage,...t})})}),Ee=n=>{const{uuid:t,hasPermission:s=!0,isUser:o,image:d,imageComponent:m,name:i,notifications:_=0,color:g="primary",size:u="large",style:h,disabled:k,onClick:f=()=>{},isActive:S,className:I,shopCategory:C,themeData:j,LinkComponent:l}=n,x=l||"a",z={theme:ue.useTheme(),color:g,size:u,style:h,disabled:k};return c.createElement(Pe,{onClick:p=>{p==null||p.preventDefault(),p.stopPropagation(),s===!0&&(f==null||f())},...z,key:i,className:`profile-item ${I}`,hasPermission:s,isActive:S,themeColor:(j==null?void 0:j.code)||"transparent",as:x,...l?{to:`/${o?"user":"shop"}/${t}`}:{href:`/${o?"user":"shop"}/${t}`}},r.jsx("div",{className:"logo-wrapper",children:w.isDefined(m)?m:d}),r.jsxs("div",{children:[r.jsx("div",{className:"name",children:i}),!o&&r.jsx("div",{className:"description",children:C}),_>0&&r.jsx("div",{className:"notifications-number",children:r.jsx(ye,{className:"badge",color:"danger",size:"small",children:_>99?"99+":_})})]}))},he=n=>{if(n!==void 0){const t=new Date(n),s=t.getFullYear(),o=t.getMonth()+1;return`${String(t.getDate()).padStart(2)}. ${o}. ${s}.`}},Te=c.forwardRef((n,t)=>{var le;const s=ue.useTheme(),{uuid:o,shopUuid:d,title:m="",coverPhoto:i,onSelect:_,startDate:g,endDate:u,salesPackages:h,shopName:k,shopCategory:f,shopImage:S,shopImageComponent:I,className:C,onSelectCard:j=()=>{},onSelectShop:l=()=>{},upcoming:x=!1,upcomingCampaignText:P,campaignSingleText:z,salesCampaignTypes:p=[],startsInPrefixTextPlural:O,startsinSuffixTextPlural:V,startsInPrefixTextSingular:Z,startsinSuffixTextSingular:re,endsInPrefixTextPlural:X,endsinSuffixTextPlural:G,endsInPrefixTextSingular:M,endsinSuffixTextSingular:F,endedText:A,themeData:ne,numberOfListings:N,numberOfListingsTextSingular:H,numberOfListingsTextPlural:U,metadata:e,LinkComponent:q,...te}=n,Y=q||"a",oe=c.useRef(),R=w.getDayNumberPrecise(g,u),J=R!==-1&&(R==null?void 0:R.isEnded)===!0,K=R!==-1&&!J,Q=w.calcDaysUntil(g),L=w.calcDaysRemaining(u),fe=L!==null&&L<=2&&L>0,se=w.normalizeDate(u),ae=se?new Date(se):null,xe=new Date,ee=ae?ae.getTime()-xe.getTime():null,B=ee!==null&&ee>0&&ee<24*60*60*1e3,ie=(v,E,$,y,D)=>$===1?`${v} ${$} ${y}`:`${E} ${$} ${D}`,we=()=>{if(!u)return null;const v=w.normalizeDate(u),E=v?new Date(v):null;if(!E)return null;const $=ve,y=E.getTime()-$.getTime();if(y<=0)return null;const D=Math.floor(y/(1e3*60*60)),be=Math.floor(y%(1e3*60*60)/(1e3*60)),je=Math.floor(y%(1e3*60)/1e3);return{hours:D,minutes:be,seconds:je}},[ve,Se]=c.useState(new Date);c.useEffect(()=>{if(!B)return;const v=setInterval(()=>{Se(new Date)},1e3);return()=>clearInterval(v)},[B]);const W=B?we():null;return r.jsxs(ke,{ref:oe,theme:s,className:C,name:e==null?void 0:e.name,"data-accessor":e==null?void 0:e.accessor,onClick:v=>j(v,oe),as:Y,...q?{to:`/shop/${d}/campaign/${o}`}:{href:`/shop/${d}/campaign/${o}`},...te,children:[r.jsxs(Ie,{theme:s,children:[r.jsx("img",{src:i}),r.jsx(De,{children:h==null?void 0:h.map((v,E)=>{var $,y;return r.jsx(Ne,{color:($=p==null?void 0:p.find(D=>D.value===v))==null?void 0:$.color,theme:s,children:r.jsx(me,{icon:(y=p==null?void 0:p.find(D=>D.value===v))==null?void 0:y.icon})},`package__${E}`)})})]}),r.jsxs(Ce,{theme:s,children:[r.jsx("div",{className:"text-block-wrapper",children:r.jsxs("div",{className:"title-block-wrapper",children:[r.jsx("div",{className:"campaign-title",children:(le=x?P:z)==null?void 0:le.toUpperCase()}),r.jsx("div",{className:"campaign-title-text",children:m}),u&&g&&r.jsxs("div",{className:"campaign-date",children:[he(g)," - ",he(u)]}),r.jsxs("div",{className:"timestamp-text",children:[N>0&&r.jsxs("span",{className:"listings-text",children:[N," ",N===1?H:U," ","∙"," "]}),r.jsx("span",{className:`duration-text ${fe?"urgent":""} ${K?"":"starts-in"}`,children:B&&W?r.jsxs("div",{className:"countdown-timer",children:[M," ",W.hours.toString().padStart(2,"0"),":",W.minutes.toString().padStart(2,"0"),":",W.seconds.toString().padStart(2,"0")]}):K&&!J&&L!==null&&L>0?ie(M,X,L,F,G):J?A||"Završena":!K&&Q!==null&&Q>0?ie(Z,O,Q,re,V):null})]})]})}),r.jsx(Ee,{hasPermission:!0,image:r.jsx(Le,{src:S}),imageComponent:I,themeData:ne,isActive:!0,isUser:!1,name:k,shopCategory:f,uuid:d,onClick:()=>l(d)})]})]})}),ze=b.styled.div`
262
+ `,Ee=c.forwardRef(({src:n,...t},s)=>{const o=c.useRef();return c.useEffect(()=>{var p;const d=i=>{i.target.src=ce.DefaultShopImage,i.onerror=null};return(p=o==null?void 0:o.current)==null||p.addEventListener("error",d),()=>{var i;(i=o==null?void 0:o.current)==null||i.removeEventListener("error",d)}},[]),r.jsx(c.Fragment,{ref:s,children:w.isDefinedNotEmptyString(n)?r.jsx("img",{ref:o,src:n,...t}):r.jsx("img",{src:ce.DefaultShopImage,...t})})}),Te=n=>{const{uuid:t,hasPermission:s=!0,isUser:o,image:d,imageComponent:p,name:i,notifications:_=0,color:g="primary",size:u="large",style:h,disabled:k,onClick:f=()=>{},isActive:v,className:I,shopCategory:C,themeData:j,LinkComponent:l}=n,x=l||"a",z={theme:ue.useTheme(),color:g,size:u,style:h,disabled:k};return c.createElement(De,{onClick:m=>{m==null||m.preventDefault(),m.stopPropagation(),s===!0&&(f==null||f())},...z,key:i,className:`profile-item ${I}`,hasPermission:s,isActive:v,themeColor:(j==null?void 0:j.code)||"transparent",as:x,...l?{to:`/${o?"user":"shop"}/${t}`}:{href:`/${o?"user":"shop"}/${t}`}},r.jsx("div",{className:"logo-wrapper",children:w.isDefined(p)?p:d}),r.jsxs("div",{children:[r.jsx("div",{className:"name",children:i}),!o&&r.jsx("div",{className:"description",children:C}),_>0&&r.jsx("div",{className:"notifications-number",children:r.jsx(_e,{className:"badge",color:"danger",size:"small",children:_>99?"99+":_})})]}))},he=n=>{if(n!==void 0){const t=new Date(n),s=t.getFullYear(),o=t.getMonth()+1;return`${String(t.getDate()).padStart(2)}. ${o}. ${s}.`}},ze=c.forwardRef((n,t)=>{var le;const s=ue.useTheme(),{uuid:o,shopUuid:d,title:p="",coverPhoto:i,onSelect:_,startDate:g,endDate:u,salesPackages:h,shopName:k,shopCategory:f,shopImage:v,shopImageComponent:I,className:C,onSelectCard:j=()=>{},onSelectShop:l=()=>{},upcoming:x=!1,upcomingCampaignText:P,campaignSingleText:z,salesCampaignTypes:m=[],startsInPrefixTextPlural:W,startsinSuffixTextPlural:Z,startsInPrefixTextSingular:V,startsinSuffixTextSingular:re,endsInPrefixTextPlural:X,endsinSuffixTextPlural:G,endsInPrefixTextSingular:M,endsinSuffixTextSingular:F,endedText:A,themeData:ne,numberOfListings:N,numberOfListingsTextSingular:H,numberOfListingsTextPlural:U,metadata:e,LinkComponent:q,sponsored:te,...Y}=n,fe=q||"a",oe=c.useRef(),R=w.getDayNumberPrecise(g,u),J=R!==-1&&(R==null?void 0:R.isEnded)===!0,K=R!==-1&&!J,Q=w.calcDaysUntil(g),E=w.calcDaysRemaining(u),xe=E!==null&&E<=2&&E>0,se=w.normalizeDate(u),ae=se?new Date(se):null,we=new Date,ee=ae?ae.getTime()-we.getTime():null,B=ee!==null&&ee>0&&ee<24*60*60*1e3,ie=(b,T,$,y,D)=>$===1?`${b} ${$} ${y}`:`${T} ${$} ${D}`,be=()=>{if(!u)return null;const b=w.normalizeDate(u),T=b?new Date(b):null;if(!T)return null;const $=ve,y=T.getTime()-$.getTime();if(y<=0)return null;const D=Math.floor(y/(1e3*60*60)),je=Math.floor(y%(1e3*60*60)/(1e3*60)),ye=Math.floor(y%(1e3*60)/1e3);return{hours:D,minutes:je,seconds:ye}},[ve,Se]=c.useState(new Date);c.useEffect(()=>{if(!B)return;const b=setInterval(()=>{Se(new Date)},1e3);return()=>clearInterval(b)},[B]);const O=B?be():null;return r.jsxs(Ie,{ref:oe,theme:s,className:C,name:e==null?void 0:e.name,"data-accessor":e==null?void 0:e.accessor,onClick:b=>j(b,oe),as:fe,...q?{to:`/shop/${d}/campaign/${o}`}:{href:`/shop/${d}/campaign/${o}`},sponsored:te,...Y,children:[r.jsxs(Ce,{theme:s,children:[r.jsx("img",{src:i}),r.jsx(Le,{children:h==null?void 0:h.map((b,T)=>{var $,y;return r.jsx(Ne,{color:($=m==null?void 0:m.find(D=>D.value===b))==null?void 0:$.color,theme:s,children:r.jsx(pe,{icon:(y=m==null?void 0:m.find(D=>D.value===b))==null?void 0:y.icon})},`package__${T}`)})})]}),r.jsxs(Pe,{theme:s,children:[r.jsx("div",{className:"text-block-wrapper",children:r.jsxs("div",{className:"title-block-wrapper",children:[r.jsx("div",{className:"campaign-title",children:(le=x?P:z)==null?void 0:le.toUpperCase()}),r.jsx("div",{className:"campaign-title-text",children:p}),u&&g&&r.jsxs("div",{className:"campaign-date",children:[he(g)," - ",he(u)]}),r.jsxs("div",{className:"timestamp-text",children:[N>0&&r.jsxs("span",{className:"listings-text",children:[N," ",N===1?H:U," ","∙"," "]}),r.jsx("span",{className:`duration-text ${xe?"urgent":""} ${K?"":"starts-in"}`,children:B&&O?r.jsxs("div",{className:"countdown-timer",children:[M," ",O.hours.toString().padStart(2,"0"),":",O.minutes.toString().padStart(2,"0"),":",O.seconds.toString().padStart(2,"0")]}):K&&!J&&E!==null&&E>0?ie(M,X,E,F,G):J?A||"Završena":!K&&Q!==null&&Q>0?ie(V,W,Q,re,Z):null})]})]})}),r.jsx(Te,{hasPermission:!0,image:r.jsx(Ee,{src:v}),imageComponent:I,themeData:ne,isActive:!0,isUser:!1,name:k,shopCategory:f,uuid:d,onClick:()=>l(d)})]})]})}),Re=S.styled.div`
253
263
  margin: 0 auto;
254
264
  display: flex;
255
265
  flex-direction: column;
@@ -288,7 +298,7 @@
288
298
  right: 0;
289
299
  }
290
300
 
291
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
301
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
292
302
  gap: 1.25rem;
293
303
 
294
304
  & .scrollable-section__header {
@@ -300,13 +310,13 @@
300
310
  }
301
311
  }
302
312
  }
303
- `,Re=b.styled($e.motion.div)`
313
+ `,Me=S.styled(ke.motion.div)`
304
314
  display: grid;
305
315
  grid-template-columns: repeat(${n=>n==null?void 0:n.numOfColumns}, 1fr);
306
316
  gap: 1.5rem;
307
317
  width: 100%;
308
318
 
309
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
319
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
310
320
  display: flex;
311
321
  flex-wrap: nowrap;
312
322
  overflow-x: scroll;
@@ -328,7 +338,7 @@
328
338
  /* Safari and Chrome */
329
339
  }
330
340
  }
331
- `,Me=c.forwardRef(({icon:n,title:t,numOfSlides:s=2,showNavigation:o=!0,hasNextPage:d=!1,handleFetchNextPage:m=()=>{},children:i},_)=>{const[g,u]=c.useState(0),[h,k]=c.useState(1),f=pe.useDetectMobile(),S=(i==null?void 0:i.length)??1;c.useEffect(()=>{const l=()=>{k(s)};return window.addEventListener("resize",l),l(),()=>window.removeEventListener("resize",l)},[]);const I=f?i:i==null?void 0:i.slice(g,g+h),C=l=>{var P;(P=l==null?void 0:l.target)==null||P.blur();const x=g+h;x<S&&u(x),x+h>=S&&d&&m()},j=l=>{var x;(x=l==null?void 0:l.target)==null||x.blur(),g-h>=0&&u(g-h)};return r.jsxs(ze,{ref:_,children:[r.jsx("div",{className:"scrollable-section__header",children:r.jsxs("div",{className:"scrollable-section__title",children:[w.isDefinedNotEmptyString(n)&&r.jsx(me,{icon:n,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),w.isDefinedNotEmptyString(t)&&r.jsxs("div",{className:"title__text",children:[" ",t]})]})}),r.jsxs(Re,{numOfColumns:s,...!f&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:[I,f&&d&&r.jsx(_e.InfiniteScrollEndElement,{onIsVisible:m})]},`scrollable-section__content-${g}`),o&&S>h&&!f&&r.jsxs("div",{className:"scrollable-section__navigation",children:[r.jsx(de,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g===0,onClick:j}),r.jsx(de,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g+h>=S,onClick:C})]})]})}),Ue=b.styled.div`
341
+ `,Ue=c.forwardRef(({icon:n,title:t,numOfSlides:s=4,showNavigation:o=!0,hasNextPage:d=!1,handleFetchNextPage:p=()=>{},children:i},_)=>{const[g,u]=c.useState(0),[h,k]=c.useState(1),f=me.useDetectMobile(),v=(i==null?void 0:i.length)??1;c.useEffect(()=>{const l=()=>{k(s)};return window.addEventListener("resize",l),l(),()=>window.removeEventListener("resize",l)},[]);const I=f?i:i==null?void 0:i.slice(g,g+h),C=l=>{var P;(P=l==null?void 0:l.target)==null||P.blur();const x=g+h;x<v&&u(x),x+h>=v&&d&&p()},j=l=>{var x;(x=l==null?void 0:l.target)==null||x.blur(),g-h>=0&&u(g-h)};return r.jsxs(Re,{ref:_,children:[r.jsx("div",{className:"scrollable-section__header",children:r.jsxs("div",{className:"scrollable-section__title",children:[w.isDefinedNotEmptyString(n)&&r.jsx(pe,{icon:n,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),w.isDefinedNotEmptyString(t)&&r.jsxs("div",{className:"title__text",children:[" ",t]})]})}),r.jsxs(Me,{numOfColumns:s,...!f&&{animate:{x:0,opacity:1},initial:{x:10,opacity:0}},children:[I,f&&d&&r.jsx($e.InfiniteScrollEndElement,{onIsVisible:p})]},`scrollable-section__content-${g}`),o&&v>h&&!f&&r.jsxs("div",{className:"scrollable-section__navigation",children:[r.jsx(de,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g===0,onClick:j}),r.jsx(de,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:g+h>=v,onClick:C})]})]})}),qe=S.styled.div`
332
342
  display: flex;
333
343
  flex: 1;
334
344
  width: 100%;
@@ -345,8 +355,8 @@
345
355
  border-radius: 1.25rem;
346
356
  object-fit: cover;
347
357
  }
348
- `,qe=c.forwardRef(({sectionName:n,imageUrl:t,maxHeight:s="16.25rem",className:o="",handleClick:d=()=>{}},m)=>r.jsx(Ue,{ref:m,maxHeight:s,onClick:d,className:`itemless-banner ${o}`,children:r.jsx("img",{src:t,alt:`itemless-banner__${n}`})})),Be=b.styled(a.SkeletonRowWrapper)`
349
- @media (max-width: ${T.MOBILE_SIZE_PX+"px"}) {
358
+ `,Be=c.forwardRef(({sectionName:n,imageUrl:t,maxHeight:s="16.25rem",className:o="",handleClick:d=()=>{}},p)=>r.jsx(qe,{ref:p,maxHeight:s,onClick:d,className:`itemless-banner ${o}`,children:r.jsx("img",{src:t,alt:`itemless-banner__${n}`})})),Oe=S.styled(a.SkeletonRowWrapper)`
359
+ @media (max-width: ${L.MOBILE_SIZE_PX+"px"}) {
350
360
  flex-direction: column;
351
361
 
352
362
  & .skeleton__image {
@@ -360,4 +370,4 @@
360
370
  }
361
371
  }
362
372
  }
363
- `,We=({keyPrefix:n})=>r.jsxs(Be,{children:[r.jsxs(a.SkeletonRowWrapper,{children:[r.jsx(a.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-1`),r.jsxs(a.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(a.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(a.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(a.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]}),r.jsxs(a.SkeletonRowWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-2`),r.jsxs(a.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(a.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(a.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(a.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]})]}),Oe=({keyPrefix:n,isLoading:t=!1,fallbackComponent:s=r.jsx(r.Fragment,{}),children:o})=>r.jsx(c.Suspense,{fallbackComponent:s,children:t===!0?r.jsx(We,{keyPrefix:n}):o}),Ve=c.memo(Te),Ze=c.forwardRef(({sellerType:n="Shop",items:t=[],title:s,icon:o,isLoading:d,onSelectCard:m=()=>{},onSelectShop:i=()=>{},getImage:_=()=>{},campaignSingleText:g,upcomingCampaignText:u,salesCampaignTypes:h=[],startsInPrefixTextPlural:k,startsinSuffixTextPlural:f,startsInPrefixTextSingular:S,startsinSuffixTextSingular:I,endsInPrefixTextPlural:C,endsinSuffixTextPlural:j,endsInPrefixTextSingular:l,endsinSuffixTextSingular:x,endedText:P,numOfSlides:z=2,showNavigation:p=!0,numberOfListingsTextSingular:O,numberOfListingsTextPlural:V,itemlessImageUrl:Z,itemlessLink:re,handleItemlessLink:X=()=>{},componentName:G,hasNextPage:M=!1,handleFetchNextPage:F=()=>{},LinkComponent:A},ne)=>{const N=pe.useDetectMobile(),H=c.useMemo(()=>{let U=t==null?void 0:t.map((e,q)=>r.jsx(Ve,{className:"campaign-item",coverPhoto:_(e==null?void 0:e.coverPhoto,(e==null?void 0:e.uuid)||(e==null?void 0:e.campaignUuid)),description:e==null?void 0:e.description,endDate:e==null?void 0:e.endDate,salesPackages:e==null?void 0:e.salesPackages,sellerType:n,shopImage:e==null?void 0:e.profileImage,shopImageComponent:e==null?void 0:e.profileImageComponent,shopName:e==null?void 0:e.shopName,shopUuid:e==null?void 0:e.shopUuid,shopCategory:e==null?void 0:e.shopCategory,startDate:e==null?void 0:e.startDate,title:e==null?void 0:e.name,uuid:e==null?void 0:e.campaignUuid,onSelectCard:(te,Y)=>m(e==null?void 0:e.campaignUuid,e==null?void 0:e.shopUuid,Y),onSelectShop:()=>i(e==null?void 0:e.shopUuid),campaignSingleText:g,upcomingCampaignText:u,upcoming:e==null?void 0:e.upcoming,salesCampaignTypes:h,startsInPrefixTextPlural:k,startsinSuffixTextPlural:f,startsInPrefixTextSingular:S,startsinSuffixTextSingular:I,endsInPrefixTextPlural:C,endsinSuffixTextPlural:j,endsInPrefixTextSingular:l,endsinSuffixTextSingular:x,endedText:P,themeData:e==null?void 0:e.themeData,numberOfListings:e==null?void 0:e.numberOfListings,numberOfListingsTextSingular:O,numberOfListingsTextPlural:V,metadata:{name:G,accessor:e==null?void 0:e.accessor},LinkComponent:A},`campaign__item__${q}__${e==null?void 0:e.startDate}___${e==null?void 0:e.endDate}`));return(t==null?void 0:t.length)<2&&!N?[...U,r.jsx(qe,{imageUrl:Z,className:"campaign-item",handleClick:X},"itemless-campaign-section-banner")]:U},[t]);return r.jsx(Oe,{isLoading:d,keyPrefix:"sales-campaign-skeleton",children:r.jsx(Me,{icon:o,title:s,numOfSlides:z,showNavigation:p,hasNextPage:M,handleFetchNextPage:F,children:H},`sales-campaign-section__${N}`)})});module.exports=Ze;
373
+ `,We=({keyPrefix:n})=>r.jsxs(Oe,{children:[r.jsxs(a.SkeletonRowWrapper,{children:[r.jsx(a.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-1`),r.jsxs(a.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(a.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(a.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(a.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]}),r.jsxs(a.SkeletonRowWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonSquarePlaceholder,{width:"13.75rem",height:"13.75rem",className:"skeleton__image"},`${n}-2`),r.jsxs(a.SkeletonColumnWrapper,{noGradient:!0,children:[r.jsx(a.SkeletonLinePlaceholder,{height:"1rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.75rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"1.25rem"}),r.jsx(a.SkeletonLinePlaceholder,{height:"2rem"}),r.jsxs(a.SkeletonRowWrapper,{alignItems:"center",noGradient:!0,children:[r.jsx(a.SkeletonCirclePlaceholder,{width:"2.5rem",height:"2.5rem"}),r.jsx(a.SkeletonLinePlaceholder,{width:"5rem",height:"1.25rem"})]})]})]})]}),Ze=({keyPrefix:n,isLoading:t=!1,fallbackComponent:s=r.jsx(r.Fragment,{}),children:o})=>r.jsx(c.Suspense,{fallbackComponent:s,children:t===!0?r.jsx(We,{keyPrefix:n}):o}),Ve=c.memo(ze),Xe=c.forwardRef(({sellerType:n="Shop",items:t=[],title:s,icon:o,isLoading:d,onSelectCard:p=()=>{},onSelectShop:i=()=>{},getImage:_=()=>{},campaignSingleText:g,upcomingCampaignText:u,salesCampaignTypes:h=[],startsInPrefixTextPlural:k,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:I,endsInPrefixTextPlural:C,endsinSuffixTextPlural:j,endsInPrefixTextSingular:l,endsinSuffixTextSingular:x,endedText:P,numOfSlides:z=4,showNavigation:m=!0,numberOfListingsTextSingular:W,numberOfListingsTextPlural:Z,itemlessImageUrl:V,itemlessLink:re,handleItemlessLink:X=()=>{},componentName:G,hasNextPage:M=!1,handleFetchNextPage:F=()=>{},LinkComponent:A},ne)=>{const N=me.useDetectMobile(),H=c.useMemo(()=>{let U=t==null?void 0:t.map((e,q)=>r.jsx(Ve,{className:"campaign-item",coverPhoto:_(e==null?void 0:e.coverPhoto,(e==null?void 0:e.uuid)||(e==null?void 0:e.campaignUuid)),description:e==null?void 0:e.description,endDate:e==null?void 0:e.endDate,salesPackages:e==null?void 0:e.salesPackages,sellerType:n,shopImage:e==null?void 0:e.profileImage,shopImageComponent:e==null?void 0:e.profileImageComponent,shopName:e==null?void 0:e.shopName,shopUuid:e==null?void 0:e.shopUuid,shopCategory:e==null?void 0:e.shopCategory,startDate:e==null?void 0:e.startDate,title:e==null?void 0:e.name,uuid:e==null?void 0:e.campaignUuid,onSelectCard:(te,Y)=>p(e==null?void 0:e.campaignUuid,e==null?void 0:e.shopUuid,Y),onSelectShop:()=>i(e==null?void 0:e.shopUuid),campaignSingleText:g,upcomingCampaignText:u,upcoming:e==null?void 0:e.upcoming,salesCampaignTypes:h,startsInPrefixTextPlural:k,startsinSuffixTextPlural:f,startsInPrefixTextSingular:v,startsinSuffixTextSingular:I,endsInPrefixTextPlural:C,endsinSuffixTextPlural:j,endsInPrefixTextSingular:l,endsinSuffixTextSingular:x,endedText:P,themeData:e==null?void 0:e.themeData,numberOfListings:e==null?void 0:e.numberOfListings,numberOfListingsTextSingular:W,numberOfListingsTextPlural:Z,metadata:{name:G,accessor:e==null?void 0:e.accessor},LinkComponent:A,sponsored:e==null?void 0:e.sponsored},`campaign__item__${q}__${e==null?void 0:e.startDate}___${e==null?void 0:e.endDate}`));return(t==null?void 0:t.length)<4&&!N?[...U,r.jsx(Be,{imageUrl:V,className:"campaign-item",handleClick:X},"itemless-campaign-section-banner")]:U},[t]);return r.jsx(Ze,{isLoading:d,keyPrefix:"sales-campaign-skeleton",children:r.jsx(Ue,{icon:o,title:s,numOfSlides:z,showNavigation:m,hasNextPage:M,handleFetchNextPage:F,children:H},`sales-campaign-section__${N}`)})});module.exports=Xe;