@lanaco/lnc-react-ui 4.0.119 → 4.0.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/SalesCampaignsSection.cjs +34 -29
- package/dist/SalesCampaignsSection.js +244 -239
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),u=require("react"),m=require("./emotion-styled.browser.esm-BtEseadx.cjs"),_=require("./utils-CZynEOC_.cjs"),k=require("./consts-goSZX3xP.cjs"),re=require("./motion-B_VPZaJq.cjs"),o=require("./index-BpbMKBf_.cjs"),te=require("./Icon.cjs"),ye=require("./Badge.cjs"),X=require("./emotion-element-f0de968e.browser.esm-B7k6i6lC.cjs"),H=require("./IconButton.cjs"),ne=require("./useDetectMobile-zkbzoOGV.cjs"),we=m.styled.div`
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
display: flex;
|
|
4
4
|
gap: 1rem;
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
border-radius: 20px;
|
|
7
7
|
border: 1px solid var(--gray-95008, #14161a14);
|
|
8
8
|
|
|
9
|
-
@media (max-width: ${
|
|
9
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
padding: 0;
|
|
12
12
|
gap: 0;
|
|
13
13
|
border: none;
|
|
14
14
|
border-radius: 0;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,ve=m.styled.div`
|
|
17
17
|
border-radius: ${e=>_.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
18
18
|
height: 15rem;
|
|
19
19
|
width: 15rem;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
@media (max-width: ${
|
|
40
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
41
41
|
width: 100%;
|
|
42
42
|
max-width: 100dvh;
|
|
43
43
|
height: 23.438rem;
|
|
44
44
|
}
|
|
45
|
-
`,
|
|
45
|
+
`,be=m.styled.div`
|
|
46
46
|
flex: 1;
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
@@ -77,8 +77,14 @@
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
& .timestamp-text {
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
font-size: 0.875rem;
|
|
83
|
+
font-style: normal;
|
|
84
|
+
font-weight: 400;
|
|
85
|
+
line-height: 1.25rem;
|
|
86
|
+
letter-spacing: 0.01563rem;
|
|
87
|
+
gap: 0.25rem;
|
|
82
88
|
padding-top: 0.75rem;
|
|
83
89
|
color: var(--gray-700, #4e555f);
|
|
84
90
|
|
|
@@ -96,7 +102,6 @@
|
|
|
96
102
|
|
|
97
103
|
& .countdown-timer {
|
|
98
104
|
color: var(--primary-500, #f59e0b);
|
|
99
|
-
font-weight: 600;
|
|
100
105
|
}
|
|
101
106
|
}
|
|
102
107
|
|
|
@@ -104,7 +109,7 @@
|
|
|
104
109
|
background-color: transparent;
|
|
105
110
|
}
|
|
106
111
|
|
|
107
|
-
@media (max-width: ${
|
|
112
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
108
113
|
padding: 1.25rem;
|
|
109
114
|
|
|
110
115
|
& .campaign-title {
|
|
@@ -118,13 +123,13 @@
|
|
|
118
123
|
gap: 0.25rem;
|
|
119
124
|
}
|
|
120
125
|
}
|
|
121
|
-
`,
|
|
126
|
+
`,_e={"#ADE3EB":"#76D0DB","#DDD6FE":"#C4B5FD","#FDE68A":"#FCD34D","#A7F3D0":"#6EE7B7","#BADFFF":"#87C6FA","#FECDD3":"#FDA4AF","#EFE2CF":"#EAD2AF","#DDDFE4":"#C4C8CF","#E7E5E4":"#D6D3D1","#FED7AA":"#FDBA74",default:"#C4C8CF"},J=(e=!1,n=!1,a=!1)=>`
|
|
122
127
|
display: flex;
|
|
123
128
|
${n?"flex-wrap: wrap;":""}
|
|
124
129
|
${n?"":"flex-wrap: nowrap;"}
|
|
125
130
|
${e?"align-items: center;":""}
|
|
126
|
-
${
|
|
127
|
-
`,
|
|
131
|
+
${a?"justify-content: center;":""}
|
|
132
|
+
`,Te=m.styled(re.motion.div)`
|
|
128
133
|
text-decoration: none;
|
|
129
134
|
${e=>e.hasPermission===!0&&"cursor: pointer"};
|
|
130
135
|
|
|
@@ -141,7 +146,7 @@
|
|
|
141
146
|
text-decoration: none;
|
|
142
147
|
}
|
|
143
148
|
|
|
144
|
-
${
|
|
149
|
+
${J(!0)}
|
|
145
150
|
gap: 0.5rem;
|
|
146
151
|
padding: 0.5rem;
|
|
147
152
|
color: ${e=>e.isActive===!1?"var(--gray-900)":"var(--primary-600)"};
|
|
@@ -157,11 +162,11 @@
|
|
|
157
162
|
font-weight: 400;
|
|
158
163
|
}
|
|
159
164
|
& .logo-wrapper {
|
|
160
|
-
${
|
|
165
|
+
${J(!0,!1,!0)}
|
|
161
166
|
flex-shrink: 0;
|
|
162
167
|
border-radius: 999px;
|
|
163
168
|
border: 3px solid
|
|
164
|
-
${e=>e.isActive===!1?"var(--gray-300, #c4c8cf)":
|
|
169
|
+
${e=>e.isActive===!1?"var(--gray-300, #c4c8cf)":_e[e.themeColor]??"var(--gray-300, #c4c8cf)"};
|
|
165
170
|
|
|
166
171
|
& img,
|
|
167
172
|
.img-placeholder {
|
|
@@ -204,13 +209,13 @@
|
|
|
204
209
|
background-color: var(--gray-95080, #14161acc);
|
|
205
210
|
color: var(--gray-600, #676e79);
|
|
206
211
|
}
|
|
207
|
-
`,
|
|
212
|
+
`,je=m.styled.div`
|
|
208
213
|
position: absolute;
|
|
209
214
|
top: 0.5rem;
|
|
210
215
|
${e=>e.alignToLeft===!0?"left: 0.5rem;":"right: 0.5rem;"}
|
|
211
216
|
display: flex;
|
|
212
217
|
gap: 0.25rem;
|
|
213
|
-
`,
|
|
218
|
+
`,De=m.styled.div`
|
|
214
219
|
border-radius: ${e=>_.getBorderRadiusValueWithUnits(e.theme,e.borderRadius||"slight")};
|
|
215
220
|
background-color: ${e=>e==null?void 0:e.color};
|
|
216
221
|
color: white;
|
|
@@ -226,7 +231,7 @@
|
|
|
226
231
|
& i {
|
|
227
232
|
font-size: 0.813rem;
|
|
228
233
|
}
|
|
229
|
-
`,
|
|
234
|
+
`,se=e=>{const{uuid:n,hasPermission:a=!0,isUser:l,image:w,name:p,notifications:h=0,color:i="primary",size:c="large",style:d,disabled:S,onClick:v=()=>{},isActive:T,className:j,shopCategory:D,themeData:f}=e,b={theme:X.useTheme(),color:i,size:c,style:d,disabled:S};return u.createElement(Te,{onClick:C=>{C.stopPropagation(),a===!0&&(v==null||v())},...b,key:p,className:`profile-item ${j}`,hasPermission:a,isActive:T,themeColor:(f==null?void 0:f.code)||"transparent"},t.jsx("div",{className:"logo-wrapper",children:w}),t.jsxs("div",{children:[t.jsx("div",{className:"name",children:p}),!l&&t.jsx("div",{className:"description",children:D}),h>0&&t.jsx("div",{className:"notifications-number",children:t.jsx(ye,{className:"badge",color:"danger",size:"small",children:h>99?"99+":h})})]}))};se.propTypes={id:o.PropTypes.any,isUserProfile:o.PropTypes.bool,themeColor:o.PropTypes.string,image:o.PropTypes.any,name:o.PropTypes.string,notifications:o.PropTypes.number,style:o.PropTypes.object,className:o.PropTypes.string,color:o.PropTypes.oneOf(["primary","secondary","success","warning","danger","information","neutral"]),size:o.PropTypes.oneOf(["large"]),onSelect:o.PropTypes.func,hasPermission:o.PropTypes.bool};const K=(e,n)=>{if(!e||!n)return null;const a=e.getTime()-n.getTime(),l=24*60*60*1e3;return a>=0?Math.ceil(a/l):Math.floor(a/l)},Q=e=>{if(e!==void 0){const n=new Date(e),a=n.getFullYear(),l=n.getMonth()+1;return`${String(n.getDate()).padStart(2)}. ${l}. ${a}.`}},ae=u.forwardRef((e,n)=>{var Y;const a=X.useTheme(),{shopUuid:l,title:w="",coverPhoto:p,onSelect:h,startDate:i,endDate:c,salesPackages:d,shopName:S,shopCategory:v,shopImage:T,className:j,onSelectCard:D=()=>{},onSelectShop:f=()=>{},upcoming:P=!1,upcomingCampaignText:b,campaignSingleText:C,salesCampaignTypes:x=[],startsInPrefixTextPlural:E,startsinSuffixTextPlural:M,startsInPrefixTextSingular:F,startsinSuffixTextSingular:B,endsInPrefixTextPlural:s,endsinSuffixTextPlural:g,endsInPrefixTextSingular:R,endsinSuffixTextSingular:r,themeData:q,numberOfListings:W,numberOfListingsTextSingular:ie,numberOfListingsTextPlural:le,...ce}=e,de=i?new Date(i)<=new Date:!1,ge=K(i?new Date(i):null,new Date),z=K(c?new Date(c):null,new Date),ue=z!==null&&z<=3&&z>0,Z=c?new Date(c).getTime():null,me=Date.now(),V=Z!==null?Z-me:null,O=V!==null&&V>0&&V<24*60*60*1e3,G=($,L,y,N,I)=>y===1?`${$} ${y} ${N}`:`${L} ${y} ${I}`,pe=()=>{if(!c)return null;const $=he,y=new Date(c).getTime()-$.getTime();if(y<=0)return null;const N=Math.floor(y/(1e3*60*60)),I=Math.floor(y%(1e3*60*60)/(1e3*60)),xe=Math.floor(y%(1e3*60)/1e3);return{hours:N,minutes:I,seconds:xe}},[he,fe]=u.useState(new Date);u.useEffect(()=>{if(!O)return;const $=setInterval(()=>{fe(new Date)},1e3);return()=>clearInterval($)},[O]);const A=O?pe():null;return t.jsxs(we,{ref:n,theme:a,className:j,onClick:D,...ce,children:[t.jsxs(ve,{theme:a,onClick:()=>h==null?void 0:h(),children:[t.jsx("img",{src:p}),t.jsx(je,{children:d==null?void 0:d.map(($,L)=>{var y,N;return t.jsx(De,{color:(y=x==null?void 0:x.find(I=>I.value===$))==null?void 0:y.color,theme:a,children:t.jsx(te,{icon:(N=x==null?void 0:x.find(I=>I.value===$))==null?void 0:N.icon})},`package__${L}`)})})]}),t.jsxs(be,{theme:a,children:[t.jsx("div",{className:"text-block-wrapper",children:t.jsxs("div",{className:"title-block-wrapper",children:[t.jsx("div",{className:"campaign-title",children:(Y=P?b:C)==null?void 0:Y.toUpperCase()}),t.jsx("div",{className:"campaign-title-text",children:w}),c&&i&&t.jsxs("div",{children:[Q(i)," - ",Q(c)]}),t.jsxs("div",{className:"timestamp-text",children:[W>0&&t.jsxs("span",{className:"listings-text",children:[W," ",W===1?ie:le," ","∙"," "]}),t.jsx("span",{className:`duration-text ${ue?"urgent":""}`,children:O&&A?t.jsxs("div",{className:"countdown-timer",children:[R," ",A.hours.toString().padStart(2,"0"),":",A.minutes.toString().padStart(2,"0"),":",A.seconds.toString().padStart(2,"0")]}):de?G(R,s,z,r,g):G(F,E,ge,B,M)})]})]})}),t.jsx(se,{hasPermission:!0,image:t.jsx("img",{src:T,className:`${T?"":"no-image"}`}),themeData:q,isActive:!0,isUser:!1,name:S,shopCategory:v,onClick:()=>f(l)})]})]})});ae.propTypes={title:o.PropTypes.oneOfType([o.PropTypes.string,o.PropTypes.element]),numberOfListings:o.PropTypes.number,dropdown:o.PropTypes.any,color:o.PropTypes.string};m.styled.div`
|
|
230
235
|
display: flex;
|
|
231
236
|
flex-direction: column;
|
|
232
237
|
gap: 1.5rem;
|
|
@@ -257,25 +262,25 @@
|
|
|
257
262
|
}
|
|
258
263
|
}
|
|
259
264
|
|
|
260
|
-
@media (max-width: ${
|
|
265
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
261
266
|
& .campaign-item {
|
|
262
267
|
min-width: 100%;
|
|
263
268
|
width: 100%;
|
|
264
269
|
margin-right: 0;
|
|
265
270
|
}
|
|
266
271
|
}
|
|
267
|
-
`;const U=
|
|
272
|
+
`;const U=m.styled.div`
|
|
268
273
|
width: ${e=>e.width||"100%"};
|
|
269
274
|
height: ${e=>(e.heightCoeff||1)*1.125}rem;
|
|
270
275
|
background-color: var(--gray-200, #dddfe4);
|
|
271
276
|
|
|
272
277
|
${_.linearGradientAnimation("-90deg")}
|
|
273
|
-
|
|
278
|
+
`,$e=m.styled.div`
|
|
274
279
|
display: flex;
|
|
275
280
|
flex-direction: ${e=>e!=null&&e.row?"row":"column"};
|
|
276
281
|
gap: ${e=>(e==null?void 0:e.gap)??"0.5rem"};
|
|
277
282
|
width: ${e=>(e==null?void 0:e.width)??"100%"};
|
|
278
|
-
`,
|
|
283
|
+
`,ee=m.styled.div`
|
|
279
284
|
border-radius: ${e=>_.getBorderRadiusValueWithUnits(e.theme,(e==null?void 0:e.borderRadius)??"regular")};
|
|
280
285
|
background: var(--gray-200, #dddfe4);
|
|
281
286
|
position: relative;
|
|
@@ -286,7 +291,7 @@
|
|
|
286
291
|
flex-shrink: 0;
|
|
287
292
|
|
|
288
293
|
${_.linearGradientAnimation()}
|
|
289
|
-
`,
|
|
294
|
+
`,Se=m.styled.div`
|
|
290
295
|
background: var(--white, #fff);
|
|
291
296
|
border-radius: ${e=>_.getBorderRadiusValueWithUnits(e.theme,"edged")};
|
|
292
297
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
@@ -315,17 +320,17 @@
|
|
|
315
320
|
gap: 0.5rem;
|
|
316
321
|
}
|
|
317
322
|
|
|
318
|
-
@media (max-width: ${
|
|
323
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
319
324
|
flex-direction: column;
|
|
320
325
|
|
|
321
326
|
& .campaign__user {
|
|
322
327
|
margin-top: 1rem;
|
|
323
328
|
}
|
|
324
329
|
}
|
|
325
|
-
|
|
330
|
+
`,Pe=m.styled.div`
|
|
326
331
|
display: flex;
|
|
327
332
|
gap: 1.5rem;
|
|
328
|
-
`,
|
|
333
|
+
`,Ce=u.forwardRef(({},e)=>{const n=X.useTheme();return t.jsxs(Se,{ref:e,theme:n,children:[t.jsx("div",{className:"campaign__left-section",children:t.jsx(ee,{theme:n,width:"15rem",height:"15rem",borderRadius:"edged"})}),t.jsxs("div",{className:"campaign__right-section",children:[t.jsxs($e,{theme:n,children:[t.jsx(U,{heightCoeff:.75,theme:n,width:"35%"}),t.jsx(U,{heightCoeff:1.25,theme:n}),t.jsx(U,{heightCoeff:3,theme:n})]}),t.jsxs("div",{className:"campaign__user",children:[t.jsx(ee,{theme:n,width:"2.5rem",height:"2.5rem",borderRadius:"curved"}),t.jsx(U,{theme:n,width:"75%"})]})]})]})}),Ie=({itemsCount:e=5,keyPrefix:n})=>t.jsx(Pe,{children:Array.from({length:e},(a,l)=>t.jsx(Ce,{},`${n}-skeleton-campaign-card-${l}`))}),Ee=({children:e,fallbackComponent:n=t.jsx(t.Fragment,{}),isLoading:a=!1,itemsCount:l=5,keyPrefix:w})=>t.jsx(u.Suspense,{fallback:n,children:a===!0?t.jsx(Ie,{itemsCount:l,keyPrefix:w}):e}),Ne=m.styled.div`
|
|
329
334
|
margin: 0 auto;
|
|
330
335
|
display: flex;
|
|
331
336
|
flex-direction: column;
|
|
@@ -366,12 +371,12 @@
|
|
|
366
371
|
top: 0;
|
|
367
372
|
right: 0;
|
|
368
373
|
}
|
|
369
|
-
`,
|
|
374
|
+
`,ke=m.styled(re.motion.div)`
|
|
370
375
|
display: grid;
|
|
371
376
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumns}, 1fr);
|
|
372
377
|
gap: 1.5rem;
|
|
373
378
|
|
|
374
|
-
@media (max-width: ${
|
|
379
|
+
@media (max-width: ${k.MOBILE_SIZE_PX+"px"}) {
|
|
375
380
|
grid-template-columns: repeat(${e=>e==null?void 0:e.numOfColumnsForMobile}, 1fr);
|
|
376
381
|
}
|
|
377
|
-
`,
|
|
382
|
+
`,oe=u.forwardRef(({icon:e,title:n,numOfSlides:a=2,numOfSlidesForMobile:l=1,showNavigation:w=!0,children:p},h)=>{const[i,c]=u.useState(0),[d,S]=u.useState(1),[v,T]=u.useState(null),[j,D]=u.useState(null),f=ne.useDetectMobile(),P=50,b=(p==null?void 0:p.length)??1;u.useEffect(()=>{const s=()=>{S(f?l:a)};return window.addEventListener("resize",s),s(),()=>window.removeEventListener("resize",s)},[]);const C=p==null?void 0:p.slice(i,i+d),x=s=>{var g;(g=s==null?void 0:s.target)==null||g.blur(),i+d<b&&c(i+d)},E=s=>{var g;(g=s==null?void 0:s.target)==null||g.blur(),i-d>=0&&c(i-d)},M=s=>{var g;D(null),T((g=s==null?void 0:s.targetTouches["0"])==null?void 0:g.clientX)},F=s=>{var g;D((g=s==null?void 0:s.targetTouches["0"])==null?void 0:g.clientX)},B=()=>{if(!v||!j)return;const s=v-j;s>P&&x(),s<-P&&E()};return t.jsxs(Ne,{ref:h,...f?{onTouchStart:M,onTouchMove:F,onTouchEnd:B}:{},children:[t.jsx("div",{className:"scrollable-section__header",children:t.jsxs("div",{className:"scrollable-section__title",children:[_.isDefinedNotEmptyString(e)&&t.jsx(te,{icon:e,color:"primary",sizeInUnits:"1.5rem",className:"title__icon"}),_.isDefinedNotEmptyString(n)&&t.jsx("div",{className:"title__text",children:n})]})}),t.jsx(ke,{numOfColumns:a,numOfColumnsForMobile:l,animate:{x:0,opacity:1},initial:{x:10,opacity:0},children:C},`scrollable-section__content-${i}`),w&&b>d&&!f&&t.jsxs("div",{className:"scrollable-section__navigation",children:[t.jsx(H,{icon:"angle-left",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i===0,onClick:E}),t.jsx(H,{icon:"angle-right",borderRadius:"curved",btnType:"tinted",color:"neutral",className:"navigation__arrow",disabled:i+d>=b,onClick:x})]})]})});oe.propTypes={icon:o.PropTypes.string,title:o.PropTypes.string,numOfSlides:o.PropTypes.number,numOfSlidesForMobile:o.PropTypes.number,showNavigation:o.PropTypes.bool};const Me=u.memo(ae),Fe=u.forwardRef(({sellerType:e="Shop",items:n=[],title:a,icon:l,isLoading:w,onSelectCard:p=()=>{},onSelectShop:h=()=>{},getImage:i=()=>{},campaignSingleText:c,upcomingCampaignText:d,salesCampaignTypes:S=[],startsInPrefixTextPlural:v,startsinSuffixTextPlural:T,startsInPrefixTextSingular:j,startsinSuffixTextSingular:D,endsInPrefixTextPlural:f,endsinSuffixTextPlural:P,endsInPrefixTextSingular:b,endsinSuffixTextSingular:C,numOfSlides:x=2,numOfSlidesForMobile:E=1,showNavigation:M=!0,numberOfListingsTextSingular:F,numberOfListingsTextPlural:B},s)=>{const g=ne.useDetectMobile(),R=u.useMemo(()=>n==null?void 0:n.map((r,q)=>t.jsx(Me,{className:"campaign-item",coverPhoto:i(r==null?void 0:r.coverPhoto,(r==null?void 0:r.uuid)||(r==null?void 0:r.campaignUuid)),description:r==null?void 0:r.description,endDate:r==null?void 0:r.endDate,salesPackages:r==null?void 0:r.salesPackages,sellerType:e,shopImage:r==null?void 0:r.profileImage,shopName:r==null?void 0:r.shopName,shopUuid:r==null?void 0:r.shopUuid,shopCategory:r==null?void 0:r.shopCategory,startDate:r==null?void 0:r.startDate,title:r==null?void 0:r.name,uuid:r==null?void 0:r.campaignUuid,onSelectCard:()=>p(r==null?void 0:r.campaignUuid,r==null?void 0:r.shopUuid),onSelectShop:()=>h(r==null?void 0:r.shopUuid),campaignSingleText:c,upcomingCampaignText:d,upcoming:r==null?void 0:r.upcoming,salesCampaignTypes:S,startsInPrefixTextPlural:v,startsinSuffixTextPlural:T,startsInPrefixTextSingular:j,startsinSuffixTextSingular:D,endsInPrefixTextPlural:f,endsinSuffixTextPlural:P,endsInPrefixTextSingular:b,endsinSuffixTextSingular:C,themeData:r==null?void 0:r.themeData,numberOfListings:r==null?void 0:r.numberOfListings,numberOfListingsTextSingular:F,numberOfListingsTextPlural:B},`campaign__item__${q}__${r==null?void 0:r.startDate}___${r==null?void 0:r.endDate}`)),[n]);return t.jsx(Ee,{isLoading:w,itemsCount:g?1:2,keyPrefix:"sales-camp",children:t.jsx(oe,{icon:l,title:a,numOfSlides:x,numOfSlidesForMobile:E,showNavigation:M,children:R})})});module.exports=Fe;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as c, Fragment as
|
|
2
|
-
import { createElement as
|
|
3
|
-
import { s as
|
|
4
|
-
import { a as
|
|
5
|
-
import { M as
|
|
6
|
-
import { m as
|
|
7
|
-
import { P as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { u as
|
|
11
|
-
import
|
|
12
|
-
import { u as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as t, jsxs as c, Fragment as De } from "react/jsx-runtime";
|
|
2
|
+
import { createElement as Ce, forwardRef as V, useState as F, useEffect as ae, Suspense as _e, memo as Se, useMemo as Te } from "react";
|
|
3
|
+
import { s as h } from "./emotion-styled.browser.esm-BNN1dTl3.js";
|
|
4
|
+
import { a as M, o as oe, k as K } from "./utils-BbgAIA9N.js";
|
|
5
|
+
import { M as E } from "./consts-BuFChS64.js";
|
|
6
|
+
import { m as ie } from "./motion-Ckekul_K.js";
|
|
7
|
+
import { P as i } from "./index-CblbdqjE.js";
|
|
8
|
+
import se from "./Icon.js";
|
|
9
|
+
import ke from "./Badge.js";
|
|
10
|
+
import { u as Z } from "./emotion-element-f0de968e.browser.esm-CkCiQliQ.js";
|
|
11
|
+
import Q from "./IconButton.js";
|
|
12
|
+
import { u as le } from "./useDetectMobile-Bkvj0VMa.js";
|
|
13
|
+
const Ne = h.div`
|
|
14
14
|
cursor: pointer;
|
|
15
15
|
display: flex;
|
|
16
16
|
gap: 1rem;
|
|
@@ -18,15 +18,15 @@ const Se = m.div`
|
|
|
18
18
|
border-radius: 20px;
|
|
19
19
|
border: 1px solid var(--gray-95008, #14161a14);
|
|
20
20
|
|
|
21
|
-
@media (max-width: ${
|
|
21
|
+
@media (max-width: ${E + "px"}) {
|
|
22
22
|
flex-direction: column;
|
|
23
23
|
padding: 0;
|
|
24
24
|
gap: 0;
|
|
25
25
|
border: none;
|
|
26
26
|
border-radius: 0;
|
|
27
27
|
}
|
|
28
|
-
`,
|
|
29
|
-
border-radius: ${(e) =>
|
|
28
|
+
`, Ie = h.div`
|
|
29
|
+
border-radius: ${(e) => M(e.theme, "edged")};
|
|
30
30
|
height: 15rem;
|
|
31
31
|
width: 15rem;
|
|
32
32
|
min-width: 15rem;
|
|
@@ -49,12 +49,12 @@ const Se = m.div`
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
@media (max-width: ${
|
|
52
|
+
@media (max-width: ${E + "px"}) {
|
|
53
53
|
width: 100%;
|
|
54
54
|
max-width: 100dvh;
|
|
55
55
|
height: 23.438rem;
|
|
56
56
|
}
|
|
57
|
-
`,
|
|
57
|
+
`, Pe = h.div`
|
|
58
58
|
flex: 1;
|
|
59
59
|
display: flex;
|
|
60
60
|
flex-direction: column;
|
|
@@ -89,8 +89,14 @@ const Se = m.div`
|
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
& .timestamp-text {
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
display: flex;
|
|
93
|
+
align-items: center;
|
|
94
|
+
font-size: 0.875rem;
|
|
95
|
+
font-style: normal;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
line-height: 1.25rem;
|
|
98
|
+
letter-spacing: 0.01563rem;
|
|
99
|
+
gap: 0.25rem;
|
|
94
100
|
padding-top: 0.75rem;
|
|
95
101
|
color: var(--gray-700, #4e555f);
|
|
96
102
|
|
|
@@ -108,7 +114,6 @@ const Se = m.div`
|
|
|
108
114
|
|
|
109
115
|
& .countdown-timer {
|
|
110
116
|
color: var(--primary-500, #f59e0b);
|
|
111
|
-
font-weight: 600;
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
|
|
@@ -116,7 +121,7 @@ const Se = m.div`
|
|
|
116
121
|
background-color: transparent;
|
|
117
122
|
}
|
|
118
123
|
|
|
119
|
-
@media (max-width: ${
|
|
124
|
+
@media (max-width: ${E + "px"}) {
|
|
120
125
|
padding: 1.25rem;
|
|
121
126
|
|
|
122
127
|
& .campaign-title {
|
|
@@ -130,7 +135,7 @@ const Se = m.div`
|
|
|
130
135
|
gap: 0.25rem;
|
|
131
136
|
}
|
|
132
137
|
}
|
|
133
|
-
`,
|
|
138
|
+
`, Ee = {
|
|
134
139
|
"#ADE3EB": "#76D0DB",
|
|
135
140
|
"#DDD6FE": "#C4B5FD",
|
|
136
141
|
"#FDE68A": "#FCD34D",
|
|
@@ -142,13 +147,13 @@ const Se = m.div`
|
|
|
142
147
|
"#E7E5E4": "#D6D3D1",
|
|
143
148
|
"#FED7AA": "#FDBA74",
|
|
144
149
|
default: "#C4C8CF"
|
|
145
|
-
},
|
|
150
|
+
}, ee = (e = !1, n = !1, o = !1) => `
|
|
146
151
|
display: flex;
|
|
147
152
|
${n ? "flex-wrap: wrap;" : ""}
|
|
148
153
|
${n ? "" : "flex-wrap: nowrap;"}
|
|
149
154
|
${e ? "align-items: center;" : ""}
|
|
150
|
-
${
|
|
151
|
-
`,
|
|
155
|
+
${o ? "justify-content: center;" : ""}
|
|
156
|
+
`, Fe = h(ie.div)`
|
|
152
157
|
text-decoration: none;
|
|
153
158
|
${(e) => e.hasPermission === !0 && "cursor: pointer"};
|
|
154
159
|
|
|
@@ -165,14 +170,14 @@ const Se = m.div`
|
|
|
165
170
|
text-decoration: none;
|
|
166
171
|
}
|
|
167
172
|
|
|
168
|
-
${
|
|
173
|
+
${ee(!0)}
|
|
169
174
|
gap: 0.5rem;
|
|
170
175
|
padding: 0.5rem;
|
|
171
176
|
color: ${(e) => e.isActive === !1 ? "var(--gray-900)" : "var(--primary-600)"};
|
|
172
177
|
font-weight: 500;
|
|
173
178
|
font-size: 0.875rem;
|
|
174
179
|
line-height: 1.25rem;
|
|
175
|
-
border-radius: ${(e) =>
|
|
180
|
+
border-radius: ${(e) => M(e.theme, "slight")};
|
|
176
181
|
transition: all 0.25s ease;
|
|
177
182
|
& .description {
|
|
178
183
|
font-size: 0.85rem;
|
|
@@ -181,11 +186,11 @@ const Se = m.div`
|
|
|
181
186
|
font-weight: 400;
|
|
182
187
|
}
|
|
183
188
|
& .logo-wrapper {
|
|
184
|
-
${
|
|
189
|
+
${ee(!0, !1, !0)}
|
|
185
190
|
flex-shrink: 0;
|
|
186
191
|
border-radius: 999px;
|
|
187
192
|
border: 3px solid
|
|
188
|
-
${(e) => e.isActive === !1 ? "var(--gray-300, #c4c8cf)" :
|
|
193
|
+
${(e) => e.isActive === !1 ? "var(--gray-300, #c4c8cf)" : Ee[e.themeColor] ?? "var(--gray-300, #c4c8cf)"};
|
|
189
194
|
|
|
190
195
|
& img,
|
|
191
196
|
.img-placeholder {
|
|
@@ -228,14 +233,14 @@ const Se = m.div`
|
|
|
228
233
|
background-color: var(--gray-95080, #14161acc);
|
|
229
234
|
color: var(--gray-600, #676e79);
|
|
230
235
|
}
|
|
231
|
-
`,
|
|
236
|
+
`, Me = h.div`
|
|
232
237
|
position: absolute;
|
|
233
238
|
top: 0.5rem;
|
|
234
239
|
${(e) => e.alignToLeft === !0 ? "left: 0.5rem;" : "right: 0.5rem;"}
|
|
235
240
|
display: flex;
|
|
236
241
|
gap: 0.25rem;
|
|
237
|
-
`,
|
|
238
|
-
border-radius: ${(e) =>
|
|
242
|
+
`, ze = h.div`
|
|
243
|
+
border-radius: ${(e) => M(e.theme, e.borderRadius || "slight")};
|
|
239
244
|
background-color: ${(e) => e == null ? void 0 : e.color};
|
|
240
245
|
color: white;
|
|
241
246
|
height: 1.5rem;
|
|
@@ -250,17 +255,17 @@ const Se = m.div`
|
|
|
250
255
|
& i {
|
|
251
256
|
font-size: 0.813rem;
|
|
252
257
|
}
|
|
253
|
-
`,
|
|
258
|
+
`, ce = (e) => {
|
|
254
259
|
const {
|
|
255
260
|
uuid: n,
|
|
256
|
-
hasPermission:
|
|
261
|
+
hasPermission: o = !0,
|
|
257
262
|
isUser: l,
|
|
258
|
-
image:
|
|
259
|
-
name:
|
|
260
|
-
notifications:
|
|
263
|
+
image: w,
|
|
264
|
+
name: u,
|
|
265
|
+
notifications: f = 0,
|
|
261
266
|
color: s = "primary",
|
|
262
|
-
size:
|
|
263
|
-
style:
|
|
267
|
+
size: d = "large",
|
|
268
|
+
style: g,
|
|
264
269
|
disabled: S,
|
|
265
270
|
onClick: b = () => {
|
|
266
271
|
},
|
|
@@ -268,45 +273,45 @@ const Se = m.div`
|
|
|
268
273
|
className: D,
|
|
269
274
|
shopCategory: C,
|
|
270
275
|
// new
|
|
271
|
-
themeData:
|
|
276
|
+
themeData: p
|
|
272
277
|
} = e, y = {
|
|
273
|
-
theme:
|
|
278
|
+
theme: Z(),
|
|
274
279
|
color: s,
|
|
275
|
-
size:
|
|
276
|
-
style:
|
|
280
|
+
size: d,
|
|
281
|
+
style: g,
|
|
277
282
|
disabled: S
|
|
278
283
|
};
|
|
279
|
-
return /* @__PURE__ */
|
|
280
|
-
|
|
284
|
+
return /* @__PURE__ */ Ce(
|
|
285
|
+
Fe,
|
|
281
286
|
{
|
|
282
287
|
onClick: (k) => {
|
|
283
|
-
k.stopPropagation(),
|
|
288
|
+
k.stopPropagation(), o === !0 && (b == null || b());
|
|
284
289
|
},
|
|
285
290
|
...y,
|
|
286
|
-
key:
|
|
291
|
+
key: u,
|
|
287
292
|
className: `profile-item ${D}`,
|
|
288
|
-
hasPermission:
|
|
293
|
+
hasPermission: o,
|
|
289
294
|
isActive: $,
|
|
290
|
-
themeColor: (
|
|
295
|
+
themeColor: (p == null ? void 0 : p.code) || "transparent"
|
|
291
296
|
},
|
|
292
|
-
/* @__PURE__ */ t("div", { className: "logo-wrapper", children:
|
|
297
|
+
/* @__PURE__ */ t("div", { className: "logo-wrapper", children: w }),
|
|
293
298
|
/* @__PURE__ */ c("div", { children: [
|
|
294
|
-
/* @__PURE__ */ t("div", { className: "name", children:
|
|
299
|
+
/* @__PURE__ */ t("div", { className: "name", children: u }),
|
|
295
300
|
!l && /* @__PURE__ */ t("div", { className: "description", children: C }),
|
|
296
|
-
|
|
301
|
+
f > 0 && /* @__PURE__ */ t("div", { className: "notifications-number", children: /* @__PURE__ */ t(ke, { className: "badge", color: "danger", size: "small", children: f > 99 ? "99+" : f }) })
|
|
297
302
|
] })
|
|
298
303
|
);
|
|
299
304
|
};
|
|
300
|
-
|
|
301
|
-
id:
|
|
302
|
-
isUserProfile:
|
|
303
|
-
themeColor:
|
|
304
|
-
image:
|
|
305
|
-
name:
|
|
306
|
-
notifications:
|
|
307
|
-
style:
|
|
308
|
-
className:
|
|
309
|
-
color:
|
|
305
|
+
ce.propTypes = {
|
|
306
|
+
id: i.any,
|
|
307
|
+
isUserProfile: i.bool,
|
|
308
|
+
themeColor: i.string,
|
|
309
|
+
image: i.any,
|
|
310
|
+
name: i.string,
|
|
311
|
+
notifications: i.number,
|
|
312
|
+
style: i.object,
|
|
313
|
+
className: i.string,
|
|
314
|
+
color: i.oneOf([
|
|
310
315
|
"primary",
|
|
311
316
|
"secondary",
|
|
312
317
|
"success",
|
|
@@ -315,101 +320,101 @@ se.propTypes = {
|
|
|
315
320
|
"information",
|
|
316
321
|
"neutral"
|
|
317
322
|
]),
|
|
318
|
-
size:
|
|
319
|
-
onSelect:
|
|
320
|
-
hasPermission:
|
|
323
|
+
size: i.oneOf(["large"]),
|
|
324
|
+
onSelect: i.func,
|
|
325
|
+
hasPermission: i.bool
|
|
321
326
|
};
|
|
322
|
-
const
|
|
327
|
+
const re = (e, n) => {
|
|
323
328
|
if (!e || !n) return null;
|
|
324
|
-
|
|
325
|
-
return Math.floor(
|
|
326
|
-
},
|
|
329
|
+
const o = e.getTime() - n.getTime(), l = 24 * 60 * 60 * 1e3;
|
|
330
|
+
return o >= 0 ? Math.ceil(o / l) : Math.floor(o / l);
|
|
331
|
+
}, te = (e) => {
|
|
327
332
|
if (e !== void 0) {
|
|
328
|
-
const n = new Date(e),
|
|
329
|
-
return `${String(n.getDate()).padStart(2)}. ${l}. ${
|
|
333
|
+
const n = new Date(e), o = n.getFullYear(), l = n.getMonth() + 1;
|
|
334
|
+
return `${String(n.getDate()).padStart(2)}. ${l}. ${o}.`;
|
|
330
335
|
}
|
|
331
|
-
},
|
|
332
|
-
var
|
|
333
|
-
const
|
|
336
|
+
}, de = V((e, n) => {
|
|
337
|
+
var J;
|
|
338
|
+
const o = Z(), {
|
|
334
339
|
// uuid,
|
|
335
340
|
shopUuid: l,
|
|
336
|
-
title:
|
|
341
|
+
title: w = "",
|
|
337
342
|
// description,
|
|
338
343
|
// badges,
|
|
339
|
-
coverPhoto:
|
|
340
|
-
onSelect:
|
|
344
|
+
coverPhoto: u,
|
|
345
|
+
onSelect: f,
|
|
341
346
|
// status,
|
|
342
347
|
startDate: s,
|
|
343
|
-
endDate:
|
|
344
|
-
salesPackages:
|
|
348
|
+
endDate: d,
|
|
349
|
+
salesPackages: g,
|
|
345
350
|
shopName: S,
|
|
346
351
|
shopCategory: b,
|
|
347
352
|
shopImage: $,
|
|
348
353
|
className: D,
|
|
349
354
|
onSelectCard: C = () => {
|
|
350
355
|
},
|
|
351
|
-
onSelectShop:
|
|
356
|
+
onSelectShop: p = () => {
|
|
352
357
|
},
|
|
353
358
|
upcoming: T = !1,
|
|
354
359
|
upcomingCampaignText: y,
|
|
355
360
|
campaignSingleText: k,
|
|
356
|
-
salesCampaignTypes:
|
|
357
|
-
startsInPrefixTextPlural:
|
|
358
|
-
startsinSuffixTextPlural:
|
|
359
|
-
startsInPrefixTextSingular:
|
|
360
|
-
startsinSuffixTextSingular:
|
|
361
|
+
salesCampaignTypes: x = [],
|
|
362
|
+
startsInPrefixTextPlural: I,
|
|
363
|
+
startsinSuffixTextPlural: z,
|
|
364
|
+
startsInPrefixTextSingular: A,
|
|
365
|
+
startsinSuffixTextSingular: O,
|
|
361
366
|
endsInPrefixTextPlural: a,
|
|
362
|
-
endsinSuffixTextPlural:
|
|
363
|
-
endsInPrefixTextSingular:
|
|
367
|
+
endsinSuffixTextPlural: m,
|
|
368
|
+
endsInPrefixTextSingular: L,
|
|
364
369
|
endsinSuffixTextSingular: r,
|
|
365
370
|
themeData: X,
|
|
366
371
|
numberOfListings: G,
|
|
367
|
-
numberOfListingsTextSingular:
|
|
368
|
-
numberOfListingsTextPlural:
|
|
369
|
-
...
|
|
370
|
-
} = e,
|
|
372
|
+
numberOfListingsTextSingular: me,
|
|
373
|
+
numberOfListingsTextPlural: he,
|
|
374
|
+
...ue
|
|
375
|
+
} = e, fe = s ? new Date(s) <= /* @__PURE__ */ new Date() : !1, pe = re(
|
|
371
376
|
s ? new Date(s) : null,
|
|
372
377
|
/* @__PURE__ */ new Date()
|
|
373
|
-
),
|
|
374
|
-
|
|
378
|
+
), U = re(
|
|
379
|
+
d ? new Date(d) : null,
|
|
375
380
|
/* @__PURE__ */ new Date()
|
|
376
|
-
),
|
|
377
|
-
if (!
|
|
378
|
-
const _ =
|
|
379
|
-
if (
|
|
380
|
-
const
|
|
381
|
-
return { hours:
|
|
382
|
-
}, [
|
|
383
|
-
|
|
381
|
+
), xe = U !== null && U <= 3 && U > 0, q = d ? new Date(d).getTime() : null, ve = Date.now(), Y = q !== null ? q - ve : null, B = Y !== null && Y > 0 && Y < 24 * 60 * 60 * 1e3, H = (_, j, v, P, N) => v === 1 ? `${_} ${v} ${P}` : `${j} ${v} ${N}`, we = () => {
|
|
382
|
+
if (!d) return null;
|
|
383
|
+
const _ = be, v = new Date(d).getTime() - _.getTime();
|
|
384
|
+
if (v <= 0) return null;
|
|
385
|
+
const P = Math.floor(v / (1e3 * 60 * 60)), N = Math.floor(v % (1e3 * 60 * 60) / (1e3 * 60)), $e = Math.floor(v % (1e3 * 60) / 1e3);
|
|
386
|
+
return { hours: P, minutes: N, seconds: $e };
|
|
387
|
+
}, [be, ye] = F(/* @__PURE__ */ new Date());
|
|
388
|
+
ae(() => {
|
|
384
389
|
if (!B) return;
|
|
385
390
|
const _ = setInterval(() => {
|
|
386
|
-
|
|
391
|
+
ye(/* @__PURE__ */ new Date());
|
|
387
392
|
}, 1e3);
|
|
388
393
|
return () => clearInterval(_);
|
|
389
394
|
}, [B]);
|
|
390
|
-
const R = B ?
|
|
395
|
+
const R = B ? we() : null;
|
|
391
396
|
return /* @__PURE__ */ c(
|
|
392
|
-
|
|
397
|
+
Ne,
|
|
393
398
|
{
|
|
394
399
|
ref: n,
|
|
395
|
-
theme:
|
|
400
|
+
theme: o,
|
|
396
401
|
className: D,
|
|
397
402
|
onClick: C,
|
|
398
|
-
...
|
|
403
|
+
...ue,
|
|
399
404
|
children: [
|
|
400
|
-
/* @__PURE__ */ c(
|
|
401
|
-
/* @__PURE__ */ t("img", { src:
|
|
402
|
-
/* @__PURE__ */ t(
|
|
403
|
-
var
|
|
405
|
+
/* @__PURE__ */ c(Ie, { theme: o, onClick: () => f == null ? void 0 : f(), children: [
|
|
406
|
+
/* @__PURE__ */ t("img", { src: u }),
|
|
407
|
+
/* @__PURE__ */ t(Me, { children: g == null ? void 0 : g.map((_, j) => {
|
|
408
|
+
var v, P;
|
|
404
409
|
return /* @__PURE__ */ t(
|
|
405
|
-
|
|
410
|
+
ze,
|
|
406
411
|
{
|
|
407
|
-
color: (
|
|
408
|
-
theme:
|
|
412
|
+
color: (v = x == null ? void 0 : x.find((N) => N.value === _)) == null ? void 0 : v.color,
|
|
413
|
+
theme: o,
|
|
409
414
|
children: /* @__PURE__ */ t(
|
|
410
|
-
|
|
415
|
+
se,
|
|
411
416
|
{
|
|
412
|
-
icon: (
|
|
417
|
+
icon: (P = x == null ? void 0 : x.find((N) => N.value === _)) == null ? void 0 : P.icon
|
|
413
418
|
}
|
|
414
419
|
)
|
|
415
420
|
},
|
|
@@ -417,20 +422,20 @@ const Q = (e, n) => {
|
|
|
417
422
|
);
|
|
418
423
|
}) })
|
|
419
424
|
] }),
|
|
420
|
-
/* @__PURE__ */ c(
|
|
425
|
+
/* @__PURE__ */ c(Pe, { theme: o, children: [
|
|
421
426
|
/* @__PURE__ */ t("div", { className: "text-block-wrapper", children: /* @__PURE__ */ c("div", { className: "title-block-wrapper", children: [
|
|
422
|
-
/* @__PURE__ */ t("div", { className: "campaign-title", children: (
|
|
423
|
-
/* @__PURE__ */ t("div", { className: "campaign-title-text", children:
|
|
424
|
-
|
|
425
|
-
|
|
427
|
+
/* @__PURE__ */ t("div", { className: "campaign-title", children: (J = T ? y : k) == null ? void 0 : J.toUpperCase() }),
|
|
428
|
+
/* @__PURE__ */ t("div", { className: "campaign-title-text", children: w }),
|
|
429
|
+
d && s && /* @__PURE__ */ c("div", { children: [
|
|
430
|
+
te(s),
|
|
426
431
|
" - ",
|
|
427
|
-
|
|
432
|
+
te(d)
|
|
428
433
|
] }),
|
|
429
434
|
/* @__PURE__ */ c("div", { className: "timestamp-text", children: [
|
|
430
435
|
G > 0 && /* @__PURE__ */ c("span", { className: "listings-text", children: [
|
|
431
436
|
G,
|
|
432
437
|
" ",
|
|
433
|
-
G === 1 ?
|
|
438
|
+
G === 1 ? me : he,
|
|
434
439
|
" ",
|
|
435
440
|
"∙",
|
|
436
441
|
" "
|
|
@@ -438,34 +443,34 @@ const Q = (e, n) => {
|
|
|
438
443
|
/* @__PURE__ */ t(
|
|
439
444
|
"span",
|
|
440
445
|
{
|
|
441
|
-
className: `duration-text ${
|
|
446
|
+
className: `duration-text ${xe ? "urgent" : ""}`,
|
|
442
447
|
children: B && R ? /* @__PURE__ */ c("div", { className: "countdown-timer", children: [
|
|
443
|
-
|
|
448
|
+
L,
|
|
444
449
|
" ",
|
|
445
450
|
R.hours.toString().padStart(2, "0"),
|
|
446
451
|
":",
|
|
447
452
|
R.minutes.toString().padStart(2, "0"),
|
|
448
453
|
":",
|
|
449
454
|
R.seconds.toString().padStart(2, "0")
|
|
450
|
-
] }) :
|
|
451
|
-
|
|
455
|
+
] }) : fe ? H(
|
|
456
|
+
L,
|
|
452
457
|
a,
|
|
453
|
-
|
|
458
|
+
U,
|
|
454
459
|
r,
|
|
455
|
-
|
|
456
|
-
) :
|
|
460
|
+
m
|
|
461
|
+
) : H(
|
|
462
|
+
A,
|
|
463
|
+
I,
|
|
464
|
+
pe,
|
|
457
465
|
O,
|
|
458
|
-
|
|
459
|
-
ue,
|
|
460
|
-
L,
|
|
461
|
-
M
|
|
466
|
+
z
|
|
462
467
|
)
|
|
463
468
|
}
|
|
464
469
|
)
|
|
465
470
|
] })
|
|
466
471
|
] }) }),
|
|
467
472
|
/* @__PURE__ */ t(
|
|
468
|
-
|
|
473
|
+
ce,
|
|
469
474
|
{
|
|
470
475
|
hasPermission: !0,
|
|
471
476
|
image: (
|
|
@@ -488,7 +493,7 @@ const Q = (e, n) => {
|
|
|
488
493
|
isUser: !1,
|
|
489
494
|
name: S,
|
|
490
495
|
shopCategory: b,
|
|
491
|
-
onClick: () =>
|
|
496
|
+
onClick: () => p(l)
|
|
492
497
|
}
|
|
493
498
|
)
|
|
494
499
|
] })
|
|
@@ -496,13 +501,13 @@ const Q = (e, n) => {
|
|
|
496
501
|
}
|
|
497
502
|
);
|
|
498
503
|
});
|
|
499
|
-
|
|
500
|
-
title:
|
|
501
|
-
numberOfListings:
|
|
502
|
-
dropdown:
|
|
503
|
-
color:
|
|
504
|
+
de.propTypes = {
|
|
505
|
+
title: i.oneOfType([i.string, i.element]),
|
|
506
|
+
numberOfListings: i.number,
|
|
507
|
+
dropdown: i.any,
|
|
508
|
+
color: i.string
|
|
504
509
|
};
|
|
505
|
-
|
|
510
|
+
h.div`
|
|
506
511
|
display: flex;
|
|
507
512
|
flex-direction: column;
|
|
508
513
|
gap: 1.5rem;
|
|
@@ -533,7 +538,7 @@ m.div`
|
|
|
533
538
|
}
|
|
534
539
|
}
|
|
535
540
|
|
|
536
|
-
@media (max-width: ${
|
|
541
|
+
@media (max-width: ${E + "px"}) {
|
|
537
542
|
& .campaign-item {
|
|
538
543
|
min-width: 100%;
|
|
539
544
|
width: 100%;
|
|
@@ -541,19 +546,19 @@ m.div`
|
|
|
541
546
|
}
|
|
542
547
|
}
|
|
543
548
|
`;
|
|
544
|
-
const W =
|
|
549
|
+
const W = h.div`
|
|
545
550
|
width: ${(e) => e.width || "100%"};
|
|
546
551
|
height: ${(e) => (e.heightCoeff || 1) * 1.125}rem;
|
|
547
552
|
background-color: var(--gray-200, #dddfe4);
|
|
548
553
|
|
|
549
|
-
${
|
|
550
|
-
`,
|
|
554
|
+
${oe("-90deg")}
|
|
555
|
+
`, Ae = h.div`
|
|
551
556
|
display: flex;
|
|
552
557
|
flex-direction: ${(e) => e != null && e.row ? "row" : "column"};
|
|
553
558
|
gap: ${(e) => (e == null ? void 0 : e.gap) ?? "0.5rem"};
|
|
554
559
|
width: ${(e) => (e == null ? void 0 : e.width) ?? "100%"};
|
|
555
|
-
`,
|
|
556
|
-
border-radius: ${(e) =>
|
|
560
|
+
`, ne = h.div`
|
|
561
|
+
border-radius: ${(e) => M(e.theme, (e == null ? void 0 : e.borderRadius) ?? "regular")};
|
|
557
562
|
background: var(--gray-200, #dddfe4);
|
|
558
563
|
position: relative;
|
|
559
564
|
max-height: ${(e) => (e == null ? void 0 : e.height) ?? "5rem"};
|
|
@@ -562,10 +567,10 @@ const W = m.div`
|
|
|
562
567
|
width: ${(e) => (e == null ? void 0 : e.width) ?? "5rem"};
|
|
563
568
|
flex-shrink: 0;
|
|
564
569
|
|
|
565
|
-
${
|
|
566
|
-
`,
|
|
570
|
+
${oe()}
|
|
571
|
+
`, Oe = h.div`
|
|
567
572
|
background: var(--white, #fff);
|
|
568
|
-
border-radius: ${(e) =>
|
|
573
|
+
border-radius: ${(e) => M(e.theme, "edged")};
|
|
569
574
|
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
570
575
|
border: 1px solid var(--gray-95012, #14161a1f);
|
|
571
576
|
|
|
@@ -592,21 +597,21 @@ const W = m.div`
|
|
|
592
597
|
gap: 0.5rem;
|
|
593
598
|
}
|
|
594
599
|
|
|
595
|
-
@media (max-width: ${
|
|
600
|
+
@media (max-width: ${E + "px"}) {
|
|
596
601
|
flex-direction: column;
|
|
597
602
|
|
|
598
603
|
& .campaign__user {
|
|
599
604
|
margin-top: 1rem;
|
|
600
605
|
}
|
|
601
606
|
}
|
|
602
|
-
`,
|
|
607
|
+
`, Le = h.div`
|
|
603
608
|
display: flex;
|
|
604
609
|
gap: 1.5rem;
|
|
605
|
-
`,
|
|
606
|
-
const n =
|
|
607
|
-
return /* @__PURE__ */ c(
|
|
610
|
+
`, Ue = V(({}, e) => {
|
|
611
|
+
const n = Z();
|
|
612
|
+
return /* @__PURE__ */ c(Oe, { ref: e, theme: n, children: [
|
|
608
613
|
/* @__PURE__ */ t("div", { className: "campaign__left-section", children: /* @__PURE__ */ t(
|
|
609
|
-
|
|
614
|
+
ne,
|
|
610
615
|
{
|
|
611
616
|
theme: n,
|
|
612
617
|
width: "15rem",
|
|
@@ -615,14 +620,14 @@ const W = m.div`
|
|
|
615
620
|
}
|
|
616
621
|
) }),
|
|
617
622
|
/* @__PURE__ */ c("div", { className: "campaign__right-section", children: [
|
|
618
|
-
/* @__PURE__ */ c(
|
|
623
|
+
/* @__PURE__ */ c(Ae, { theme: n, children: [
|
|
619
624
|
/* @__PURE__ */ t(W, { heightCoeff: 0.75, theme: n, width: "35%" }),
|
|
620
625
|
/* @__PURE__ */ t(W, { heightCoeff: 1.25, theme: n }),
|
|
621
626
|
/* @__PURE__ */ t(W, { heightCoeff: 3, theme: n })
|
|
622
627
|
] }),
|
|
623
628
|
/* @__PURE__ */ c("div", { className: "campaign__user", children: [
|
|
624
629
|
/* @__PURE__ */ t(
|
|
625
|
-
|
|
630
|
+
ne,
|
|
626
631
|
{
|
|
627
632
|
theme: n,
|
|
628
633
|
width: "2.5rem",
|
|
@@ -634,17 +639,17 @@ const W = m.div`
|
|
|
634
639
|
] })
|
|
635
640
|
] })
|
|
636
641
|
] });
|
|
637
|
-
}),
|
|
638
|
-
|
|
642
|
+
}), Be = ({ itemsCount: e = 5, keyPrefix: n }) => /* @__PURE__ */ t(Le, { children: Array.from({ length: e }, (o, l) => /* @__PURE__ */ t(
|
|
643
|
+
Ue,
|
|
639
644
|
{},
|
|
640
645
|
`${n}-skeleton-campaign-card-${l}`
|
|
641
|
-
)) }),
|
|
646
|
+
)) }), Re = ({
|
|
642
647
|
children: e,
|
|
643
|
-
fallbackComponent: n = /* @__PURE__ */ t(
|
|
644
|
-
isLoading:
|
|
648
|
+
fallbackComponent: n = /* @__PURE__ */ t(De, {}),
|
|
649
|
+
isLoading: o = !1,
|
|
645
650
|
itemsCount: l = 5,
|
|
646
|
-
keyPrefix:
|
|
647
|
-
}) => /* @__PURE__ */ t(
|
|
651
|
+
keyPrefix: w
|
|
652
|
+
}) => /* @__PURE__ */ t(_e, { fallback: n, children: o === !0 ? /* @__PURE__ */ t(Be, { itemsCount: l, keyPrefix: w }) : e }), je = h.div`
|
|
648
653
|
margin: 0 auto;
|
|
649
654
|
display: flex;
|
|
650
655
|
flex-direction: column;
|
|
@@ -685,56 +690,56 @@ const W = m.div`
|
|
|
685
690
|
top: 0;
|
|
686
691
|
right: 0;
|
|
687
692
|
}
|
|
688
|
-
`,
|
|
693
|
+
`, We = h(ie.div)`
|
|
689
694
|
display: grid;
|
|
690
695
|
grid-template-columns: repeat(${(e) => e == null ? void 0 : e.numOfColumns}, 1fr);
|
|
691
696
|
gap: 1.5rem;
|
|
692
697
|
|
|
693
|
-
@media (max-width: ${
|
|
698
|
+
@media (max-width: ${E + "px"}) {
|
|
694
699
|
grid-template-columns: repeat(${(e) => e == null ? void 0 : e.numOfColumnsForMobile}, 1fr);
|
|
695
700
|
}
|
|
696
|
-
`,
|
|
701
|
+
`, ge = V(
|
|
697
702
|
({
|
|
698
703
|
icon: e,
|
|
699
704
|
title: n,
|
|
700
|
-
numOfSlides:
|
|
705
|
+
numOfSlides: o = 2,
|
|
701
706
|
numOfSlidesForMobile: l = 1,
|
|
702
|
-
showNavigation:
|
|
703
|
-
children:
|
|
704
|
-
},
|
|
705
|
-
const [s,
|
|
706
|
-
|
|
707
|
+
showNavigation: w = !0,
|
|
708
|
+
children: u
|
|
709
|
+
}, f) => {
|
|
710
|
+
const [s, d] = F(0), [g, S] = F(1), [b, $] = F(null), [D, C] = F(null), p = le(), T = 50, y = (u == null ? void 0 : u.length) ?? 1;
|
|
711
|
+
ae(() => {
|
|
707
712
|
const a = () => {
|
|
708
|
-
S(
|
|
713
|
+
S(p ? l : o);
|
|
709
714
|
};
|
|
710
715
|
return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
|
|
711
716
|
}, []);
|
|
712
|
-
const k =
|
|
713
|
-
var
|
|
714
|
-
(
|
|
715
|
-
},
|
|
716
|
-
var
|
|
717
|
-
(
|
|
717
|
+
const k = u == null ? void 0 : u.slice(s, s + g), x = (a) => {
|
|
718
|
+
var m;
|
|
719
|
+
(m = a == null ? void 0 : a.target) == null || m.blur(), s + g < y && d(s + g);
|
|
720
|
+
}, I = (a) => {
|
|
721
|
+
var m;
|
|
722
|
+
(m = a == null ? void 0 : a.target) == null || m.blur(), s - g >= 0 && d(s - g);
|
|
718
723
|
};
|
|
719
724
|
return /* @__PURE__ */ c(
|
|
720
|
-
|
|
725
|
+
je,
|
|
721
726
|
{
|
|
722
|
-
ref:
|
|
723
|
-
...
|
|
724
|
-
var
|
|
725
|
-
C(null), $((
|
|
727
|
+
ref: f,
|
|
728
|
+
...p ? { onTouchStart: (a) => {
|
|
729
|
+
var m;
|
|
730
|
+
C(null), $((m = a == null ? void 0 : a.targetTouches["0"]) == null ? void 0 : m.clientX);
|
|
726
731
|
}, onTouchMove: (a) => {
|
|
727
|
-
var
|
|
728
|
-
C((
|
|
732
|
+
var m;
|
|
733
|
+
C((m = a == null ? void 0 : a.targetTouches["0"]) == null ? void 0 : m.clientX);
|
|
729
734
|
}, onTouchEnd: () => {
|
|
730
735
|
if (!b || !D) return;
|
|
731
736
|
const a = b - D;
|
|
732
|
-
a > T &&
|
|
737
|
+
a > T && x(), a < -T && I();
|
|
733
738
|
} } : {},
|
|
734
739
|
children: [
|
|
735
740
|
/* @__PURE__ */ t("div", { className: "scrollable-section__header", children: /* @__PURE__ */ c("div", { className: "scrollable-section__title", children: [
|
|
736
|
-
|
|
737
|
-
|
|
741
|
+
K(e) && /* @__PURE__ */ t(
|
|
742
|
+
se,
|
|
738
743
|
{
|
|
739
744
|
icon: e,
|
|
740
745
|
color: "primary",
|
|
@@ -742,12 +747,12 @@ const W = m.div`
|
|
|
742
747
|
className: "title__icon"
|
|
743
748
|
}
|
|
744
749
|
),
|
|
745
|
-
|
|
750
|
+
K(n) && /* @__PURE__ */ t("div", { className: "title__text", children: n })
|
|
746
751
|
] }) }),
|
|
747
752
|
/* @__PURE__ */ t(
|
|
748
|
-
|
|
753
|
+
We,
|
|
749
754
|
{
|
|
750
|
-
numOfColumns:
|
|
755
|
+
numOfColumns: o,
|
|
751
756
|
numOfColumnsForMobile: l,
|
|
752
757
|
animate: {
|
|
753
758
|
x: 0,
|
|
@@ -761,9 +766,9 @@ const W = m.div`
|
|
|
761
766
|
},
|
|
762
767
|
`scrollable-section__content-${s}`
|
|
763
768
|
),
|
|
764
|
-
|
|
769
|
+
w && y > g && !p && /* @__PURE__ */ c("div", { className: "scrollable-section__navigation", children: [
|
|
765
770
|
/* @__PURE__ */ t(
|
|
766
|
-
|
|
771
|
+
Q,
|
|
767
772
|
{
|
|
768
773
|
icon: "angle-left",
|
|
769
774
|
borderRadius: "curved",
|
|
@@ -771,19 +776,19 @@ const W = m.div`
|
|
|
771
776
|
color: "neutral",
|
|
772
777
|
className: "navigation__arrow",
|
|
773
778
|
disabled: s === 0,
|
|
774
|
-
onClick:
|
|
779
|
+
onClick: I
|
|
775
780
|
}
|
|
776
781
|
),
|
|
777
782
|
/* @__PURE__ */ t(
|
|
778
|
-
|
|
783
|
+
Q,
|
|
779
784
|
{
|
|
780
785
|
icon: "angle-right",
|
|
781
786
|
borderRadius: "curved",
|
|
782
787
|
btnType: "tinted",
|
|
783
788
|
color: "neutral",
|
|
784
789
|
className: "navigation__arrow",
|
|
785
|
-
disabled: s +
|
|
786
|
-
onClick:
|
|
790
|
+
disabled: s + g >= y,
|
|
791
|
+
onClick: x
|
|
787
792
|
}
|
|
788
793
|
)
|
|
789
794
|
] })
|
|
@@ -792,45 +797,45 @@ const W = m.div`
|
|
|
792
797
|
);
|
|
793
798
|
}
|
|
794
799
|
);
|
|
795
|
-
|
|
796
|
-
icon:
|
|
797
|
-
title:
|
|
798
|
-
numOfSlides:
|
|
799
|
-
numOfSlidesForMobile:
|
|
800
|
-
showNavigation:
|
|
800
|
+
ge.propTypes = {
|
|
801
|
+
icon: i.string,
|
|
802
|
+
title: i.string,
|
|
803
|
+
numOfSlides: i.number,
|
|
804
|
+
numOfSlidesForMobile: i.number,
|
|
805
|
+
showNavigation: i.bool
|
|
801
806
|
};
|
|
802
|
-
const
|
|
807
|
+
const Ve = Se(de), nr = V(
|
|
803
808
|
({
|
|
804
809
|
sellerType: e = "Shop",
|
|
805
810
|
items: n = [],
|
|
806
|
-
title:
|
|
811
|
+
title: o,
|
|
807
812
|
icon: l,
|
|
808
|
-
isLoading:
|
|
809
|
-
onSelectCard:
|
|
813
|
+
isLoading: w,
|
|
814
|
+
onSelectCard: u = () => {
|
|
810
815
|
},
|
|
811
|
-
onSelectShop:
|
|
816
|
+
onSelectShop: f = () => {
|
|
812
817
|
},
|
|
813
818
|
getImage: s = () => {
|
|
814
819
|
},
|
|
815
|
-
campaignSingleText:
|
|
816
|
-
upcomingCampaignText:
|
|
820
|
+
campaignSingleText: d,
|
|
821
|
+
upcomingCampaignText: g,
|
|
817
822
|
salesCampaignTypes: S = [],
|
|
818
823
|
startsInPrefixTextPlural: b,
|
|
819
824
|
startsinSuffixTextPlural: $,
|
|
820
825
|
startsInPrefixTextSingular: D,
|
|
821
826
|
startsinSuffixTextSingular: C,
|
|
822
|
-
endsInPrefixTextPlural:
|
|
827
|
+
endsInPrefixTextPlural: p,
|
|
823
828
|
endsinSuffixTextPlural: T,
|
|
824
829
|
endsInPrefixTextSingular: y,
|
|
825
830
|
endsinSuffixTextSingular: k,
|
|
826
|
-
numOfSlides:
|
|
827
|
-
numOfSlidesForMobile:
|
|
828
|
-
showNavigation:
|
|
829
|
-
numberOfListingsTextSingular:
|
|
830
|
-
numberOfListingsTextPlural:
|
|
831
|
+
numOfSlides: x = 2,
|
|
832
|
+
numOfSlidesForMobile: I = 1,
|
|
833
|
+
showNavigation: z = !0,
|
|
834
|
+
numberOfListingsTextSingular: A,
|
|
835
|
+
numberOfListingsTextPlural: O
|
|
831
836
|
}, a) => {
|
|
832
|
-
const
|
|
833
|
-
|
|
837
|
+
const m = le(), L = Te(() => n == null ? void 0 : n.map((r, X) => /* @__PURE__ */ t(
|
|
838
|
+
Ve,
|
|
834
839
|
{
|
|
835
840
|
className: "campaign-item",
|
|
836
841
|
coverPhoto: s(
|
|
@@ -848,42 +853,42 @@ const Re = De(le), er = V(
|
|
|
848
853
|
startDate: r == null ? void 0 : r.startDate,
|
|
849
854
|
title: r == null ? void 0 : r.name,
|
|
850
855
|
uuid: r == null ? void 0 : r.campaignUuid,
|
|
851
|
-
onSelectCard: () =>
|
|
852
|
-
onSelectShop: () =>
|
|
853
|
-
campaignSingleText:
|
|
854
|
-
upcomingCampaignText:
|
|
856
|
+
onSelectCard: () => u(r == null ? void 0 : r.campaignUuid, r == null ? void 0 : r.shopUuid),
|
|
857
|
+
onSelectShop: () => f(r == null ? void 0 : r.shopUuid),
|
|
858
|
+
campaignSingleText: d,
|
|
859
|
+
upcomingCampaignText: g,
|
|
855
860
|
upcoming: r == null ? void 0 : r.upcoming,
|
|
856
861
|
salesCampaignTypes: S,
|
|
857
862
|
startsInPrefixTextPlural: b,
|
|
858
863
|
startsinSuffixTextPlural: $,
|
|
859
864
|
startsInPrefixTextSingular: D,
|
|
860
865
|
startsinSuffixTextSingular: C,
|
|
861
|
-
endsInPrefixTextPlural:
|
|
866
|
+
endsInPrefixTextPlural: p,
|
|
862
867
|
endsinSuffixTextPlural: T,
|
|
863
868
|
endsInPrefixTextSingular: y,
|
|
864
869
|
endsinSuffixTextSingular: k,
|
|
865
870
|
themeData: r == null ? void 0 : r.themeData,
|
|
866
871
|
numberOfListings: r == null ? void 0 : r.numberOfListings,
|
|
867
|
-
numberOfListingsTextSingular:
|
|
868
|
-
numberOfListingsTextPlural:
|
|
872
|
+
numberOfListingsTextSingular: A,
|
|
873
|
+
numberOfListingsTextPlural: O
|
|
869
874
|
},
|
|
870
875
|
`campaign__item__${X}__${r == null ? void 0 : r.startDate}___${r == null ? void 0 : r.endDate}`
|
|
871
876
|
)), [n]);
|
|
872
877
|
return /* @__PURE__ */ t(
|
|
873
|
-
|
|
878
|
+
Re,
|
|
874
879
|
{
|
|
875
|
-
isLoading:
|
|
876
|
-
itemsCount:
|
|
880
|
+
isLoading: w,
|
|
881
|
+
itemsCount: m ? 1 : 2,
|
|
877
882
|
keyPrefix: "sales-camp",
|
|
878
883
|
children: /* @__PURE__ */ t(
|
|
879
|
-
|
|
884
|
+
ge,
|
|
880
885
|
{
|
|
881
886
|
icon: l,
|
|
882
|
-
title:
|
|
883
|
-
numOfSlides:
|
|
884
|
-
numOfSlidesForMobile:
|
|
885
|
-
showNavigation:
|
|
886
|
-
children:
|
|
887
|
+
title: o,
|
|
888
|
+
numOfSlides: x,
|
|
889
|
+
numOfSlidesForMobile: I,
|
|
890
|
+
showNavigation: z,
|
|
891
|
+
children: L
|
|
887
892
|
}
|
|
888
893
|
)
|
|
889
894
|
}
|
|
@@ -891,5 +896,5 @@ const Re = De(le), er = V(
|
|
|
891
896
|
}
|
|
892
897
|
);
|
|
893
898
|
export {
|
|
894
|
-
|
|
899
|
+
nr as default
|
|
895
900
|
};
|