@redneckz/wildless-cms-uni-blocks 0.2.72 → 0.2.73
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/bundle/bundle.umd.js +30 -14
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/Blocks.d.ts +1 -0
- package/dist/Blocks.js +2 -0
- package/dist/Blocks.js.map +1 -1
- package/dist/Gallery.d.ts +1 -1
- package/dist/Gallery.js +2 -32
- package/dist/Gallery.js.map +1 -1
- package/dist/GalleryInner.d.ts +7 -0
- package/dist/GalleryInner.js +48 -0
- package/dist/GalleryInner.js.map +1 -0
- package/dist/MiniGallery.d.ts +5 -0
- package/dist/MiniGallery.js +7 -0
- package/dist/MiniGallery.js.map +1 -0
- package/dist/model/GalleryVersion.d.ts +1 -0
- package/dist/model/GalleryVersion.js +2 -0
- package/dist/model/GalleryVersion.js.map +1 -0
- package/lib/Blocks.d.ts +1 -0
- package/lib/Blocks.js +2 -0
- package/lib/Blocks.js.map +1 -1
- package/lib/Gallery.d.ts +1 -1
- package/lib/Gallery.js +3 -33
- package/lib/Gallery.js.map +1 -1
- package/lib/GalleryInner.d.ts +7 -0
- package/lib/GalleryInner.js +46 -0
- package/lib/GalleryInner.js.map +1 -0
- package/lib/MiniGallery.d.ts +5 -0
- package/lib/MiniGallery.js +5 -0
- package/lib/MiniGallery.js.map +1 -0
- package/lib/common.css +1 -1
- package/lib/model/GalleryVersion.d.ts +1 -0
- package/lib/model/GalleryVersion.js +2 -0
- package/lib/model/GalleryVersion.js.map +1 -0
- package/package.json +1 -1
- package/src/Blocks.ts +2 -0
- package/src/ContentPage.page.json +75 -0
- package/src/Gallery.tsx +3 -119
- package/src/GalleryInner.tsx +140 -0
- package/src/MiniGallery.fixture.tsx +90 -0
- package/src/MiniGallery.tsx +10 -0
- package/src/model/GalleryVersion.ts +1 -0
package/bundle/bundle.umd.js
CHANGED
|
@@ -367,7 +367,7 @@
|
|
|
367
367
|
const BaseTile = JSX(({ className, context, title, titleSize, description, children, buttons, image, items, version = 'primary', }) => {
|
|
368
368
|
const router = context.useRouter();
|
|
369
369
|
const { handlerDecorator } = context;
|
|
370
|
-
return (jsxs("div", { className: `font-sans flex flex-col grow h-full`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES, children: title })), jsxs("div", { className: "flex grow justify-between", children: [jsxs("div", { className: "flex flex-col justify-between items-start", children: [jsxs("div", { children: [description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mb-5", children: description })) : null, children, items?.length ? renderItems$
|
|
370
|
+
return (jsxs("div", { className: `font-sans flex flex-col grow h-full`, children: [title && (jsx(Title, { size: titleSize || getTitleSizeByClassName(className), className: TITLE_CLASSES, children: title })), jsxs("div", { className: "flex grow justify-between", children: [jsxs("div", { className: "flex flex-col justify-between items-start", children: [jsxs("div", { children: [description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mb-5", children: description })) : null, children, items?.length ? renderItems$1(items, version) : null] }), buttons?.length ? (jsx("div", { className: "flex mt-9 gap-3", children: buttons.map((button, index) => renderButton(useLink({ router, handlerDecorator }, button), index)) })) : null] }), image?.src && jsx(Img, { className: "mt-auto ml-7", image: image })] })] }));
|
|
371
371
|
});
|
|
372
372
|
function getTitleSizeByClassName(className = '') {
|
|
373
373
|
const colSpan = getColSpan(className);
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
return 'L';
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
-
function renderItems$
|
|
384
|
+
function renderItems$1(items = [], version) {
|
|
385
385
|
return (jsx("section", { className: "max-w-[600px]", role: "list", children: items.map((_, i) => (jsx(BlockItem, { className: i ? 'mt-2.5' : '', text: _, version: version }, String(i)))) }));
|
|
386
386
|
}
|
|
387
387
|
function renderButton(button, i) {
|
|
@@ -618,9 +618,19 @@
|
|
|
618
618
|
return (jsx("button", { className: `${className} border-none no-underline w-12 h-12 rounded-3xl bg-white flex text-black hover:text-primary-main`, style: { boxShadow: '0px 4px 25px rgba(0, 0, 0, 0.07)' }, onClick: onClick, "aria-label": ariaLabel, children: jsxs("svg", { className: "m-auto", width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M7 12L3 8L7 4", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }), jsx("path", { d: "M14 9C14.5523 9 15 8.55228 15 8C15 7.44772 14.5523 7 14 7L14 9ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55229 7.44772 9 8 9L8 7ZM14 7L8 7L8 9L14 9L14 7Z", fill: "currentColor" })] }) }));
|
|
619
619
|
});
|
|
620
620
|
|
|
621
|
-
const
|
|
622
|
-
|
|
623
|
-
|
|
621
|
+
const cardStyleMap = {
|
|
622
|
+
normal: 'min-w-[364px] w-[364px]',
|
|
623
|
+
mini: 'min-w-[260px] w-[260px]',
|
|
624
|
+
};
|
|
625
|
+
const cardWidthMap = {
|
|
626
|
+
normal: 380,
|
|
627
|
+
mini: 276,
|
|
628
|
+
};
|
|
629
|
+
const galleryLengthForScrollMap = {
|
|
630
|
+
normal: 3,
|
|
631
|
+
mini: 4,
|
|
632
|
+
};
|
|
633
|
+
const GalleryInner = JSX(({ title, description, context, cards = [], className, version = 'normal' }) => {
|
|
624
634
|
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
625
635
|
function handleNextClick() {
|
|
626
636
|
setActiveCardIndex(activeCardIndex + 1);
|
|
@@ -628,24 +638,27 @@
|
|
|
628
638
|
function handlePrevClick() {
|
|
629
639
|
setActiveCardIndex(activeCardIndex - 1);
|
|
630
640
|
}
|
|
631
|
-
const isGalleryScrollAvailable = cards?.length >
|
|
632
|
-
const showNextButton = isGalleryScrollAvailable &&
|
|
641
|
+
const isGalleryScrollAvailable = cards?.length > galleryLengthForScrollMap[version];
|
|
642
|
+
const showNextButton = isGalleryScrollAvailable &&
|
|
643
|
+
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
633
644
|
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
634
|
-
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [jsx(Title, { className: "font-medium m-0 text-
|
|
645
|
+
return (jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [jsxs("div", { className: "flex flex-col items-center mb-8", children: [title ? jsx(Title, { className: "font-medium m-0 text-center", children: title }) : null, description ? (jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), jsx("div", {
|
|
635
646
|
// Need to place all cards at the center if count of cards less than 4
|
|
636
|
-
className: `flex ${cards?.length <=
|
|
647
|
+
className: `flex ${cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''} duration-1000`,
|
|
637
648
|
// All cards has same width
|
|
638
|
-
style: { transform: `translateX(-${activeCardIndex *
|
|
649
|
+
style: { transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }, role: "list", children: cards?.map((card, i) => renderCard$1(card, i, version)) }), showPrevButton && (jsx(ArrowButton, { className: "absolute top-1/2 left-8", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (jsx(ArrowButton, { className: "absolute top-1/2 right-1 z-20 rotate-180", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px]", style: {
|
|
639
650
|
background: 'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)',
|
|
640
651
|
} })] }));
|
|
641
652
|
});
|
|
642
|
-
function renderCard$1(card,
|
|
643
|
-
return (jsxs("div", { className:
|
|
653
|
+
function renderCard$1(card, i, version) {
|
|
654
|
+
return (jsxs("div", { className: `box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${cardStyleMap[version]} w-full`, role: "listitem", children: [jsxs("div", { children: [card.image?.src ? (jsx("div", { className: "flex justify-center", children: jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? (jsx("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? (jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? (jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: card.items.map(renderItem) })) : null] }), card.href ? (jsx(Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, String(i)));
|
|
644
655
|
}
|
|
645
|
-
function
|
|
646
|
-
return (jsx(
|
|
656
|
+
function renderItem(item, i) {
|
|
657
|
+
return (jsx(BlockItem, { children: jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)));
|
|
647
658
|
}
|
|
648
659
|
|
|
660
|
+
const Gallery$1 = JSX((props) => jsx(GalleryInner, { ...props, version: "normal" }));
|
|
661
|
+
|
|
649
662
|
const HeaderItem = JSX(({ className, text, href, target, active, onClick, children }) => {
|
|
650
663
|
const textStyle = active ? 'text-primary-main' : 'text-primary-text hover:text-primary-main';
|
|
651
664
|
return (jsxs("a", { className: `relative inline-block bg-transparent text-center no-underline ${className || ''}`, href: href, target: target, onClick: onClick, children: [jsx("span", { className: `font-sans font-normal text-base ${textStyle}`, children: text || children }), active ? (jsx("div", { className: "absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main" })) : null] }));
|
|
@@ -687,6 +700,8 @@
|
|
|
687
700
|
return (jsxs("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [jsxs("div", { className: "flex items-center", children: [jsx(Logo, { className: "mr-8" }), topMenu, jsx(HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), jsx("div", { className: "mt-5 h-[1px] bg-main-divider" }), jsx("nav", { className: "mt-5", children: subMenu })] }));
|
|
688
701
|
});
|
|
689
702
|
|
|
703
|
+
const MiniGallery = JSX((props) => (jsx(GalleryInner, { ...props, version: "mini" })));
|
|
704
|
+
|
|
690
705
|
const MobileAppTile = JSX(({ className, context, title = 'Мобильное приложение', qr, buttons = [] }) => {
|
|
691
706
|
return (jsx(Tile, { className: className, context: context, title: title, buttons: buttons, children: jsxs("div", { className: "flex items-center", children: [qr?.src && qr?.href && (jsx("a", { href: qr.href, target: "_blank", children: jsx("img", { src: qr.src, alt: title, title: title, width: "164", height: "164", className: "w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light" }) })), jsx("span", { className: "font-normal text-sm text-secondary-text ml-4", children: "\u041D\u0430\u0432\u0435\u0434\u0438\u0442\u0435 \u043A\u0430\u043C\u0435\u0440\u0443 \u0442\u0435\u043B\u0435\u0444\u043E\u043D\u0430 \u043D\u0430 QR-\u043A\u043E\u0434 \u0438 \u0441\u043A\u0430\u0447\u0430\u0439\u0442\u0435 \u043F\u0440\u0438\u043B\u043E\u0436\u0435\u043D\u0438\u0435" })] }) }));
|
|
692
707
|
});
|
|
@@ -826,6 +841,7 @@
|
|
|
826
841
|
ExchangeRateTile,
|
|
827
842
|
MobileAppTile,
|
|
828
843
|
Gallery: Gallery$1,
|
|
844
|
+
MiniGallery,
|
|
829
845
|
};
|
|
830
846
|
|
|
831
847
|
const Footer = JSX(({ className, context }) => (jsx("footer", { className: `${className} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`, children: jsx(TextInformation, { context: context }) })));
|
package/bundle/bundle.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...a}={})=>{const i=Object.assign({},a,r?{innerHTML:r.__html}:{});return e(t,i,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...a}=t||{},i=n?.slots?.default,l=r||i&&i();return e(Object.assign(a,l&&{children:l}),n)},e._tmpl.inheritAttrs=!1),e._tmpl),i=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},l="likesToken";const s=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,description:l,keywords:s,robots:c,og:o}=t;return r(e,{children:[n("title",{children:i}),n("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&n("meta",{name:"description",content:l}),s&&n("meta",{name:"keywords",content:s.join(",")}),c&&n("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>n("meta",{name:`og:${e}`,content:t},e))):null,a]})})),c=a((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:o()}))),o=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},m=a((({className:e,context:t})=>{const a=t.useLikeService();return r("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[n(c,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(c,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),d=a((({className:e,image:t})=>r("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},r)=>n("source",{srcSet:e,type:h(t)},`${r}_${e}`))):null,n("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function h(e){return e?`image/${String(e)}`:void 0}const x={primary:"bg-primary-main",secondary:"bg-white"},u={primary:"text-primary-text",secondary:"text-white"},p=a((({className:e,text:t,children:a,version:i="primary"})=>r("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[n("div",{className:`inline-block w-[8px] h-[8px] min-w-[8px] min-h-[8px] rounded-full mt-2 ${x[i]}`}),n("span",{className:`text-base font-normal font-sans mx-3 ${u[i]}`,children:t||a})]}))),f={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active"},b={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},g="inline-block rounded-md px-8 py-2 text-center font-sans",N=a((({className:e,text:t,href:r,target:a,onClick:i,children:l,disabled:s,version:c="primary",ariaLabel:o})=>s?n("div",{role:"button","aria-disabled":"true","aria-label":o,tabIndex:"-1",className:`${g} select-none ${b[c]} ${e||""}`,children:n("div",l?{children:l}:{className:"text-sm font-medium py-1.5",children:t})}):n("a",{className:`${g} no-underline ${f[c]} ${e||""}`,href:r,target:a,onClick:i,"aria-label":o,children:n("div",l?{children:l}:{className:"text-sm font-medium py-1.5",children:t})}))),v=a((({className:e,name:t,alt:r=`Icon ${t}`,title:a=r,...l})=>n("img",{className:e,src:`${i.CDN||""}icons/${t}.svg`,alt:r,title:a,...l}))),y=a((e=>n(N,{...e,children:e.icon?r("div",{className:"flex items-center",children:[n("div",{className:"mr-2",children:n(v,{name:e.icon,width:"24",height:"24"})}),r("div",{children:[n("div",{className:"text-xxs text-left",children:e.aboveText}),n("div",{className:"text-sm font-medium text-left",children:e.text})]})]}):null})));var w;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(w||(w={}));const k=a((({size:e="L",className:t,children:r,...a})=>n("XL"===e?"h1":"h2",{className:$(w[e],t),...a,children:r}))),$=(...e)=>e.filter(Boolean).join(" "),S="/mobile",C=e=>e?.includes("//"),_=(e,t,n=((e,t)=>e===t))=>n(L(e),j(L(C(e)?t.href:t.pathname))),L=e=>(e||"").replace(/\/?\?.*/,""),j=e=>(e||"").replace(S,""),D=e=>{if(!C(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t},T=(e,t)=>{if(!e)return e;const n=R(e,t),r=t?.pathname.startsWith(S);return r&&!C(n)?`/mobile${n}`:n},R=(e,t)=>{if(!e)return e;const n=D(t?.href);return n?e.replace(n,"")||"/":e};var A=Object.freeze({__proto__:null,MOBILE_URL_PATH:S,isURL:C,isHrefActive:_,withoutQuery:L,withoutMobilePath:j,getOrigin:D,adjustHref:T,toRelativeHref:R});const I=(e,t)=>e;function B({router:e,handlerDecorator:t=I},n){const r=T(n.href,e);return{...n,href:r,ariaLabel:n.text,onClick:t((t=>{const a=r&&!C(r),i=!n.target||"_self"===n.target;a&&i&&(t.preventDefault(),e.push(r))}),n)}}const O=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12},P=a((({className:e,context:t,title:a,titleSize:i,description:l,children:s,buttons:c,image:o,items:m,version:h="primary"})=>{const x=t.useRouter(),{handlerDecorator:u}=t;return r("div",{className:"font-sans flex flex-col grow h-full",children:[a&&n(k,{size:i||M(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),r("div",{className:"flex grow justify-between",children:[r("div",{className:"flex flex-col justify-between items-start",children:[r("div",{children:[l?n("div",{className:"font-normal text-base max-w-[600px] mb-5",children:l}):null,s,m?.length?Z(m,h):null]}),c?.length?n("div",{className:"flex mt-9 gap-3",children:c.map(((e,t)=>function(e,t){return e?.text?n(y,{...e},String(t)):null}(B({router:x,handlerDecorator:u},e),t)))}):null]}),o?.src&&n(d,{className:"mt-auto ml-7",image:o})]})]})}));function M(e=""){const t=O(e);return t<=4?"S":t<=8?"M":"L"}function Z(e=[],t){return n("section",{className:"max-w-[600px]",role:"list",children:e.map(((e,r)=>n(p,{className:r?"mt-2.5":"",text:e,version:t},String(r))))})}const F={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},H=a((e=>{const{children:t,className:r,version:a="primary"}=e;return n("section",{className:`font-sans p-9 min-h-[320px] box-border ${r||""} ${F[a]} ${V(r)} `,children:n(P,{...e,children:t})})}));function V(e=""){const t=O(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const E=a((({className:e,context:t,title:r})=>n(H,{className:e,context:t,title:r,description:"Блок в разработке...",children:n("figure",{className:"m-0 min-w-[600px]",children:z()})}))),z=(e=3)=>W(100,e).map((e=>Math.floor(e))).map(U),U=(e=100,t)=>n("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),W=(e,t)=>[e].concat(t>0?W(e/1.618,t-1):[]),J=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),G=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,likeControl:s,colorPalette:c="pc"},blockDecorator:o=J})=>r("section",{className:"relative","data-theme":c,children:[n("div",{className:`grid grid-cols-12 gap-1 ${X(i)} ${e||""}`,children:l?.length?l.map((function e(r,i){const{type:l}=r;l in a||console.warn(`No block with "${l}" is registered`);const s=a[l]||E;return o({blockClassName:X(r.style),block:r,render:r=>{const{version:a,content:c,blocks:o}=r.block;return n(s,{className:r.blockClassName,version:a,context:t,...c,children:o?.length?o.map(e):null},`${l}-${i}`)}},`block-${i}`)})):null}),s&&n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(m,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})));function X(e){return e?e.join(" "):""}function Q(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const q=a((({className:e,title:t,benefits:a})=>r("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[n("h2",{className:"font-medium text-title m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(K)}):null]}))),K=(e,t)=>r("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&n(v,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),r("div",{children:[n("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),Y="https://www.cbr-xml-daily.ru/daily_json.js",ee=["USD","EUR"],te={USD:"DollarIcon",EUR:"EuroIcon"},ne=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/"}],re=a((({className:e,context:t,title:a})=>{const{data:i}=t.useAsyncData(Y,le);return n(H,{className:e,context:t,title:a||"Курсы обмена валют",buttons:ne,children:r("table",{children:[n("thead",{children:r("tr",{children:[n(ae,{children:"Валюта"}),n(ae,{className:"pl-11",children:"Курс"})]})}),n("tbody",{children:ee.map((e=>{const t=(i?.Valute||{})[e]?.Value;return r("tr",{children:[n(ie,{className:"pt-4",children:r("div",{className:"flex items-center",children:[n(v,{name:te[e],width:"24",height:"24"}),n("span",{className:"ml-2",children:e})]})}),n(ie,{className:"pt-4 pl-11",children:ce(t)})]},e)}))})]})})})),ae=a((({className:e="",children:t})=>n("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ie=a((({className:e="",children:t})=>n("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function le(){const e=await fetch(Y);return await e.json()}const se=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),ce=e=>e?se.format(e):"",oe=a((({className:e,viewBox:t,fill:r="none",paths:a,...i})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:r,children:a.map((({d:e,fill:t,...r},a)=>n("path",{d:e,fill:t||"currentColor",...i,...r},a)))}))),me=["m13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z","M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z","M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z","M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z","M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z"],de=a((({className:e,href:t,children:a,targetBlank:i})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self",children:[n(oe,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:me.map((e=>({d:e})))}),n("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),he=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return r("form",{className:`relative ${e||""}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:"w-[24px] h-[24px]",children:n(v,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&n("span",{className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),n("input",{className:"pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]",value:a,onChange:e=>i(e.target.value),type:"text",name:"s"}),a&&n("button",{type:"submit",className:"absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 py-2 rounded top-1 right-1 outline-none",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),xe=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(ue):null,a?n(N,{className:"my-4",...B({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),ue=(e,t)=>{const{type:a,text:i,description:l}=e;return r("div",{className:"mb-4",children:[n("div",{children:pe(a,i)}),n("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},pe=(e,t)=>{switch(e){case"tel":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${fe(t)}`,children:t});case"email":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},fe=e=>e.replaceAll(/(\-|\s|\(|\)|\D+)/g,""),be=a((({className:e,links:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`${e||""}`,children:t?.length?n("div",{className:"flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>n(ge,{index:t,...B({router:a,handlerDecorator:i},e)},String(t))))}):null})})),ge=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),Ne=e=>t=>e?.href===t?.href;function ve(e,t){return(r=e,a=t,(r||[]).map((e=>a?.find(Ne(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(Ne(e))))));var n,r,a}function ye(e){const{data:t}=e(ke(),we);return t||{}}async function we(){const e=await fetch(ke());return await e.json()}function ke(){return`/wcms-resources/${i.SITEMAP||"sitemap"}.json`}const $e=a((({className:e,items:t,context:r})=>{const a=ve(ye(r.useAsyncData).topItems,t),i={router:r.useRouter(),handlerDecorator:r.handlerDecorator};return n("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>Se(e,t,i)))})})),Se=(e,t,{router:a,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return r("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[n("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>n(Ce,{...B({router:a,handlerDecorator:i},e)},String(t))))]},String(t))},Ce=a((({text:e,href:t,target:r,index:a})=>n("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:r||"_self",children:e||`Раздел ${a}`}))),_e=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники"}],Le=a((({className:e,media:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>n(je,{...B({router:a,handlerDecorator:i},e)},String(t))))})})),je=a((({href:e})=>{const{icon:t,label:r}=_e.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return n("a",{className:"flex items-center justify-center border-solid border border-main-divider rounded-full no-underline outline-none w-9 h-9",href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:t&&n(v,{className:"block",name:t})})})),De=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return r("div",{className:`${e||""}`,children:[n("div",{className:"pt-5 pb-[5px]",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>n(Te,{index:t,...B({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Te=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),Re=a((({className:e,documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c})=>r("footer",{className:`${e} px-9 py-10 bg-white`,children:[r("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[n(de,{className:"w-[280px] xl:w-[220px]"}),n(he,{context:c,className:"grow"})]}),r("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[n(xe,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),n($e,{className:"pt-[3px]",context:c,items:s})]}),n(Le,{media:l,context:c}),n(be,{links:a,context:c}),n(De,{links:t,context:c})]}))),Ae=a((({className:e,onClick:t,ariaLabel:a})=>n("button",{className:`${e} border-none no-underline w-12 h-12 rounded-3xl bg-white flex text-black hover:text-primary-main`,style:{boxShadow:"0px 4px 25px rgba(0, 0, 0, 0.07)"},onClick:t,"aria-label":a,children:r("svg",{className:"m-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n("path",{d:"M7 12L3 8L7 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n("path",{d:"M14 9C14.5523 9 15 8.55228 15 8C15 7.44772 14.5523 7 14 7L14 9ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55229 7.44772 9 8 9L8 7ZM14 7L8 7L8 9L14 9L14 7Z",fill:"currentColor"})]})}))),Ie=a((({title:e,description:t,context:a,cards:i=[],className:l})=>{const[s,c]=a.useState(0);const o=i?.length>3,m=o&&i?.length-s>3,d=o&&s>0;return r("section",{className:`relative font-sans text-primary-text bg-white p-12 overflow-hidden ${l}`,children:[r("div",{className:"flex flex-col items-center mb-8",children:[n(k,{className:"font-medium m-0 text-centers",children:e}),t?n("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),n("div",{className:`flex ${i?.length<=3?"justify-center":""} duration-1000`,style:{transform:`translateX(-${384*s}px)`},role:"list",children:i?.map(Be)}),d&&n(Ae,{className:"absolute top-1/2 left-8",onClick:function(){c(s-1)},ariaLabel:"Пролистать влево"}),m&&n(Ae,{className:"absolute top-1/2 right-1 z-20 rotate-180",onClick:function(){c(s+1)},ariaLabel:"Пролистать вправо"}),n("div",{className:"absolute top-0 right-0 bottom-0 w-[84px]",style:{background:"linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)"}})]})}));function Be(e,t){return r("div",{className:"box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch min-w-[364px] w-[364px] w-full",role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?Oe(e.items):null]}),e.href?n(N,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function Oe(e=[]){return n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>n(p,{children:n("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const Pe=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[n("span",{className:`font-sans font-normal text-base ${l?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),l?n("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),Me=a((({className:e,text:t,href:r,target:a,active:i,flat:l,onClick:s,children:c,ariaLabel:o})=>n("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${l?"":"px-4 py-2"} ${i?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:r,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:n("span",{className:`font-sans font-normal text-sm ${i?"text-primary-main":(l?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),Ze=a((({className:e,children:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":r,children:t}))),Fe=a((({context:e,className:t,defaultLocation:a=""})=>{const[i,l]=e.useGeolocation(a);return r("div",{className:`flex items-center ${t||""}`,children:[n(Me,{className:"mr-5",flat:!0,href:"#",text:i,ariaLabel:"Местоположение",onClick:l}),n(Me,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),n(Ze,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:n(v,{name:"LoupeIcon","aria-hidden":"true"})}),n(Ze,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:n(v,{name:"ProfileIcon","aria-hidden":"true"})}),n(Ze,{className:"mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]",ariaLabel:"Дополнительные ссылки",children:n(v,{name:"GridIcon","aria-hidden":"true"})})]})}));const He=a((({className:e,defaultLocation:t,context:a,topItems:i})=>{const l=a.useRouter(),s=ye(a.useAsyncData),{handlerDecorator:c}=a,o=ve(s.topItems,i),m=o.find(function(e){return t=>_(t.href,e,((e,t)=>t.startsWith(e)))}(l)),d=m?.items,h=d?.find(function(e){return t=>_(t.href,e)}(l)),x=o.map(((e,t)=>n(Me,{active:e===m,...B({router:l,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),u=d?.map((e=>n(Pe,{className:"mr-8",active:e===h,...B({router:l,handlerDecorator:c},e)},e.href)));return r("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:[r("div",{className:"flex items-center",children:[n(de,{className:"mr-8"}),x,n(Fe,{context:a,className:"ml-auto",defaultLocation:t})]}),n("div",{className:"mt-5 h-[1px] bg-main-divider"}),n("nav",{className:"mt-5",children:u})]})})),Ve=a((({className:e,context:t,title:a="Мобильное приложение",qr:i,buttons:l=[]})=>n(H,{className:e,context:t,title:a,buttons:l,children:r("div",{className:"flex items-center",children:[i?.src&&i?.href&&n("a",{href:i.href,target:"_blank",children:n("img",{src:i.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),n("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Ee=a((({className:e,context:t,title:a,titleSize:i,description:l,benefits:s,buttons:c,image:o,items:m})=>r("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[r("div",{className:"flex flex-col",children:[a&&n(k,{size:i||"XL",className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),n(P,{context:t,description:l,items:m,buttons:c,children:s?.length?n("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(ze)}):null})]}),o?.src&&n(d,{className:"mt-auto",image:o})]})));function ze(e,t){return r("div",{className:"flex gap-4 items-center",children:[e.icon&&n(v,{className:"w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border",name:e.icon,width:"24",height:"24"}),r("div",{className:"flex gap-1 flex-col h-full",children:[n("h4",{className:"font-medium text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const Ue=a((({text:e,href:t,target:r,onClick:a,className:i,children:l})=>t?n("a",{className:`no-underline ${i||""}`,href:t,target:r,onClick:a,children:n("span",{className:`${i||""}`,children:e||l})}):n("span",{className:`${i||""}`,children:e||l})));function We(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])}const Je=a((e=>{const{context:t,className:a,breadcrumbs:i}=e,l=t.useRouter(),{handlerDecorator:s}=t;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${a||""}`,children:[i?.length?n("div",{className:"text-xs mb-6",children:We(n("span",{className:"text-secondary-text mx-2",children:"/"}))(i.map(((e,t)=>n(Ue,{...B({router:l,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,n(Ee,{...e})]})})),Ge=a((({className:e,context:t,duration:a=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return r("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[n("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,r)=>function(e,t,r){return n("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:n("div",{className:"p-10 flex grow",children:n(Ee,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:r,...e})})},String(t))}(e,r,t)))}),n("div",{className:"border-t border-solid border-main-divider flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:i,duration:l}){const s=t===a,c=s?"animate-slide":"";return r("button",{type:"button",onClick:i,className:"group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4 grow basis-0",children:[r("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[n("div",{className:"text-sm font-medium group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),n("div",{className:"text-xs text-secondary-text",children:e.desc})]}),n("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${l}s`}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const Xe=a((e=>{const{benefits:t,version:a}=e;return n(H,{...e,children:r("div",{className:"flex mt-5 mb-1",children:[t?.length?n("div",{className:"mr-8",children:t.map(Qe)}):null,t?.length?n("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,r="primary"){return n("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[r]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function Qe(e,t){return n("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const qe=a((({className:e,context:t,title:a="Акции и спецпредложения",date:i,description:l,buttons:s=[],version:c})=>n(H,{className:e,context:t,title:a,buttons:s,version:c,children:r("div",{children:[i&&n("div",{className:"text-sm mb-2",children:Ke(i)}),n("div",{className:"text-base",children:l})]})})));function Ke(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const Ye=a((({className:e,title:t,steps:a})=>r("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[n(k,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?r("div",{children:[n("div",{className:"flex mt-9 items-center px-[88px]",children:We(n("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>et(e,t))))}),n("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(tt)})]}):null]}))),et=(e,t)=>n("div",{className:"flex flex-col items-center text-center relative",children:n("div",{className:"h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10",children:e.icon&&n(v,{name:e.icon,width:"48",height:"48"})||n("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),tt=(e,t)=>n("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:r("div",{className:"max-w-min",children:[n("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),nt={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-base",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-base",description:"text-secondary-text"}},rt=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s})=>{const c=nt[a];return r("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[i&&"small"===i?at(c.icon):null,i&&"big"===i?it(l):null,r("div",{className:"py-0.5",children:[e&&n("div",{className:`font-medium mb-1 ${c.title}`,children:e}),t&&n("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function at(e){return n("div",{className:"pt-1.5 pr-4",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function it(e){return e?.src?n(d,{className:"pt-0.5 pr-3",image:e}):null}const lt={Header:He,Footer:Re,Placeholder:E,Tile:H,PromoTile:qe,TextBlock:rt,ProductTile:Xe,ProductBlock:Je,StepsBlock:Ye,BenefitsBlock:q,ProductGallery:Ge,ExchangeRateTile:re,MobileAppTile:Ve,Gallery:Ie},st=a((({className:e,context:t})=>n("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:n(De,{context:t})}))),ct=a((({title:e,description:t,cards:a=[],className:i})=>r("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${i}`,children:[r("div",{className:"flex flex-col items-center mb-8",children:[n(k,{className:"font-medium m-0 text-centers",children:e}),t?n("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),n("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(ot)})]})));function ot(e,t){return r("div",{className:"box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch",role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?mt(e.items):null]}),e.href?n(N,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function mt(e=[]){return n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>n(p,{children:n("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const dt=a((({titleSize:e,image:t,benefits:r,...a})=>{const{className:i}=a;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${i||""}`,children:n(Ee,{...a,titleSize:"L"})})})),ht={Header:He,Footer:st,Placeholder:E,Tile:H,ProductTile:Xe,ProductBlock:dt,TextBlock:rt,ExchangeRateTile:re,MobileAppTile:Ve,Gallery:ct};e.Blocks=lt,e.ContentPage=G,e.ContentPageHead=s,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(l)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:r})}),{likes:i}=await n.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=ht,e.joinList=We,e.projectSettings=i,e.setup=t,e.toMobilePage=function(e){const t=e.blocks?.filter((({mobile:e})=>!e?.hidden)).map(Q);return{...e,blocks:t}},e.url=A,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...a}={})=>{const i=Object.assign({},a,r?{innerHTML:r.__html}:{});return e(t,i,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...a}=t||{},i=n?.slots?.default,l=r||i&&i();return e(Object.assign(a,l&&{children:l}),n)},e._tmpl.inheritAttrs=!1),e._tmpl),i=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ENABLE_ASSIST(){return this._.ENABLE_ASSIST}get SITEMAP(){return this._.SITEMAP}get CDN(){return this._.CDN}},l="likesToken";const s=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,description:l,keywords:s,robots:c,og:o}=t;return r(e,{children:[n("title",{children:i}),n("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&n("meta",{name:"description",content:l}),s&&n("meta",{name:"keywords",content:s.join(",")}),c&&n("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>n("meta",{name:`og:${e}`,content:t},e))):null,a]})})),c=a((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:o()}))),o=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},m=a((({className:e,context:t})=>{const a=t.useLikeService();return r("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[n(c,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(c,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),d=a((({className:e,image:t})=>r("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},r)=>n("source",{srcSet:e,type:h(t)},`${r}_${e}`))):null,n("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function h(e){return e?`image/${String(e)}`:void 0}const x={primary:"bg-primary-main",secondary:"bg-white"},u={primary:"text-primary-text",secondary:"text-white"},p=a((({className:e,text:t,children:a,version:i="primary"})=>r("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[n("div",{className:`inline-block w-[8px] h-[8px] min-w-[8px] min-h-[8px] rounded-full mt-2 ${x[i]}`}),n("span",{className:`text-base font-normal font-sans mx-3 ${u[i]}`,children:t||a})]}))),f={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-secondary-light hover:bg-secondary-hover active:bg-secondary-active"},b={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},g="inline-block rounded-md px-8 py-2 text-center font-sans",N=a((({className:e,text:t,href:r,target:a,onClick:i,children:l,disabled:s,version:c="primary",ariaLabel:o})=>s?n("div",{role:"button","aria-disabled":"true","aria-label":o,tabIndex:"-1",className:`${g} select-none ${b[c]} ${e||""}`,children:n("div",l?{children:l}:{className:"text-sm font-medium py-1.5",children:t})}):n("a",{className:`${g} no-underline ${f[c]} ${e||""}`,href:r,target:a,onClick:i,"aria-label":o,children:n("div",l?{children:l}:{className:"text-sm font-medium py-1.5",children:t})}))),v=a((({className:e,name:t,alt:r=`Icon ${t}`,title:a=r,...l})=>n("img",{className:e,src:`${i.CDN||""}icons/${t}.svg`,alt:r,title:a,...l}))),y=a((e=>n(N,{...e,children:e.icon?r("div",{className:"flex items-center",children:[n("div",{className:"mr-2",children:n(v,{name:e.icon,width:"24",height:"24"})}),r("div",{children:[n("div",{className:"text-xxs text-left",children:e.aboveText}),n("div",{className:"text-sm font-medium text-left",children:e.text})]})]}):null})));var w;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(w||(w={}));const k=a((({size:e="L",className:t,children:r,...a})=>n("XL"===e?"h1":"h2",{className:$(w[e],t),...a,children:r}))),$=(...e)=>e.filter(Boolean).join(" "),S="/mobile",C=e=>e?.includes("//"),_=(e,t,n=((e,t)=>e===t))=>n(L(e),j(L(C(e)?t.href:t.pathname))),L=e=>(e||"").replace(/\/?\?.*/,""),j=e=>(e||"").replace(S,""),D=e=>{if(!C(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t},T=(e,t)=>{if(!e)return e;const n=R(e,t),r=t?.pathname.startsWith(S);return r&&!C(n)?`/mobile${n}`:n},R=(e,t)=>{if(!e)return e;const n=D(t?.href);return n?e.replace(n,"")||"/":e};var A=Object.freeze({__proto__:null,MOBILE_URL_PATH:S,isURL:C,isHrefActive:_,withoutQuery:L,withoutMobilePath:j,getOrigin:D,adjustHref:T,toRelativeHref:R});const I=(e,t)=>e;function B({router:e,handlerDecorator:t=I},n){const r=T(n.href,e);return{...n,href:r,ariaLabel:n.text,onClick:t((t=>{const a=r&&!C(r),i=!n.target||"_self"===n.target;a&&i&&(t.preventDefault(),e.push(r))}),n)}}const M=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12},O=a((({className:e,context:t,title:a,titleSize:i,description:l,children:s,buttons:c,image:o,items:m,version:h="primary"})=>{const x=t.useRouter(),{handlerDecorator:u}=t;return r("div",{className:"font-sans flex flex-col grow h-full",children:[a&&n(k,{size:i||P(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),r("div",{className:"flex grow justify-between",children:[r("div",{className:"flex flex-col justify-between items-start",children:[r("div",{children:[l?n("div",{className:"font-normal text-base max-w-[600px] mb-5",children:l}):null,s,m?.length?Z(m,h):null]}),c?.length?n("div",{className:"flex mt-9 gap-3",children:c.map(((e,t)=>function(e,t){return e?.text?n(y,{...e},String(t)):null}(B({router:x,handlerDecorator:u},e),t)))}):null]}),o?.src&&n(d,{className:"mt-auto ml-7",image:o})]})]})}));function P(e=""){const t=M(e);return t<=4?"S":t<=8?"M":"L"}function Z(e=[],t){return n("section",{className:"max-w-[600px]",role:"list",children:e.map(((e,r)=>n(p,{className:r?"mt-2.5":"",text:e,version:t},String(r))))})}const F={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},H=a((e=>{const{children:t,className:r,version:a="primary"}=e;return n("section",{className:`font-sans p-9 min-h-[320px] box-border ${r||""} ${F[a]} ${V(r)} `,children:n(O,{...e,children:t})})}));function V(e=""){const t=M(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const E=a((({className:e,context:t,title:r})=>n(H,{className:e,context:t,title:r,description:"Блок в разработке...",children:n("figure",{className:"m-0 min-w-[600px]",children:z()})}))),z=(e=3)=>W(100,e).map((e=>Math.floor(e))).map(U),U=(e=100,t)=>n("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),W=(e,t)=>[e].concat(t>0?W(e/1.618,t-1):[]),J=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),G=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,likeControl:s,colorPalette:c="pc"},blockDecorator:o=J})=>r("section",{className:"relative","data-theme":c,children:[n("div",{className:`grid grid-cols-12 gap-1 ${X(i)} ${e||""}`,children:l?.length?l.map((function e(r,i){const{type:l}=r;l in a||console.warn(`No block with "${l}" is registered`);const s=a[l]||E;return o({blockClassName:X(r.style),block:r,render:r=>{const{version:a,content:c,blocks:o}=r.block;return n(s,{className:r.blockClassName,version:a,context:t,...c,children:o?.length?o.map(e):null},`${l}-${i}`)}},`block-${i}`)})):null}),s&&n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(m,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})));function X(e){return e?e.join(" "):""}function Q(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const q=a((({className:e,title:t,benefits:a})=>r("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[n("h2",{className:"font-medium text-title m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(K)}):null]}))),K=(e,t)=>r("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&n(v,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),r("div",{children:[n("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),Y="https://www.cbr-xml-daily.ru/daily_json.js",ee=["USD","EUR"],te={USD:"DollarIcon",EUR:"EuroIcon"},ne=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/"}],re=a((({className:e,context:t,title:a})=>{const{data:i}=t.useAsyncData(Y,le);return n(H,{className:e,context:t,title:a||"Курсы обмена валют",buttons:ne,children:r("table",{children:[n("thead",{children:r("tr",{children:[n(ae,{children:"Валюта"}),n(ae,{className:"pl-11",children:"Курс"})]})}),n("tbody",{children:ee.map((e=>{const t=(i?.Valute||{})[e]?.Value;return r("tr",{children:[n(ie,{className:"pt-4",children:r("div",{className:"flex items-center",children:[n(v,{name:te[e],width:"24",height:"24"}),n("span",{className:"ml-2",children:e})]})}),n(ie,{className:"pt-4 pl-11",children:ce(t)})]},e)}))})]})})})),ae=a((({className:e="",children:t})=>n("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ie=a((({className:e="",children:t})=>n("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function le(){const e=await fetch(Y);return await e.json()}const se=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),ce=e=>e?se.format(e):"",oe=a((({className:e,viewBox:t,fill:r="none",paths:a,...i})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:r,children:a.map((({d:e,fill:t,...r},a)=>n("path",{d:e,fill:t||"currentColor",...i,...r},a)))}))),me=["m13.72 25.51 4.42-4.33v-2.95l-4.42 4.32v2.96Zm0-10.98 4.42-4.35V7.41l-4.42 4.31v2.8Zm0 3.63 4.42-4.33v-2.78l-4.42 4.32v2.8ZM12.46 7.44l-.6-.56V0h-.66v6.22l-.58-.57V0h-.67v5l-.59-.58V0H8.7v6.56l4.44 4.33V0h-.67v7.44Zm1.26 14.35 4.42-4.33v-2.78L13.72 19v2.8Zm-5.03-.61 4.44 4.33v-2.96l-4.44-4.32v2.95Zm8.79-16.76-.59.58V0h-.66v5.66l-.6.56V0h-.66v6.87l-.58.57V0h-.67v10.9l4.42-4.34V0h-.66v4.42Zm-8.79 5.76 4.44 4.35v-2.8L8.69 7.4v2.77Zm0 3.65 4.44 4.33v-2.8l-4.44-4.3v2.77Zm0 3.63 4.44 4.33V19l-4.44-4.31v2.78Zm26.37 2.29H24.3a2.25 2.25 0 0 0 .36-1.22 2.32 2.32 0 0 0-2.33-2.31 2.32 2.32 0 0 0-2.31 2.31c0 .5.16.96.43 1.34a.74.74 0 0 0-.33.61c0 .26.14.49.33.62a2.32 2.32 0 0 0-.43 1.34 2.31 2.31 0 0 0 2.31 2.31 2.32 2.32 0 0 0 2.33-2.31c0-.45-.13-.87-.36-1.22h8.01v.49h-.8v.68h.8v.7h-.8v1.3h.8v-.58h1.17v.58h.79v-1.3h-.79v-.7h.79v-.68h-.79v-.5h1.58a.56.56 0 0 0 .56-.56v-.34a.57.57 0 0 0-.56-.56Zm-11.53 2.7a1.2 1.2 0 0 1-2.4 0c0-.24.08-.47.2-.66l.34-.56a.97.97 0 0 1-.34-.75c0-.3.13-.56.33-.74l-.32-.56a1.13 1.13 0 0 1-.2-.66 1.2 1.2 0 0 1 2.4 0c0 .49-.56 1.65-.56 1.65v.62c-.01.01.55 1.17.55 1.66ZM4.67 18.34v2.89c0 2.75 1.2 4.53 1.9 5.21l4.58 4.5c1.28 1.25 1.5 1.66 1.79 2.37v-3.2c0-2.84-1.44-3.94-2.19-4.67-1.73-1.68-2.89-2.8-3.82-3.73a8.98 8.98 0 0 1-2.26-3.37Zm6.08 14.24c-1.73-1.7-2.89-2.8-3.82-3.73a10 10 0 0 1-2.25-2.98v2.49a7.87 7.87 0 0 0 1.89 5.24l4.58 4.47c1.28 1.25 1.5 1.85 1.79 2.55v-3.37c0-2.85-1.45-3.95-2.19-4.67Z","M19.88 5.34c-.32 0-.64 0-.96.02V6.7a18.5 18.5 0 1 1 .95 36.94A18.5 18.5 0 0 1 1.35 25.17c0-5.67 2.55-10.73 6.58-14.13V9.32A19.78 19.78 0 0 0 0 25.17C0 36.12 8.9 45 19.88 45a19.85 19.85 0 0 0 19.86-19.83c0-10.95-8.9-19.83-19.87-19.83Z","M33.93 35.53c.3-.41.6-.85.87-1.3v-2.66h-.87v3.96Zm2.54-4.92c.12-.4.24-.78.34-1.16h-2.88v.7h.43c.77-.02 1.63-.03 2.11.46Zm-19.19-1.27h-.78v7.91h.78v-7.9Z","M14.7 27.83h2.58c.67 0 1.14.14 1.4.4.27.25.4.72.4 1.38v7.4c0 .66-.12 1.12-.4 1.38-.4.41-1.16.41-1.78.41l-.4-.01v3.5l.78.14v-2.88c1.2 0 1.97-.4 2.34-1.22v4.29h.26l.5-.01V29.74c0-.68.13-1.16.4-1.43.25-.27.72-.4 1.37-.4.67 0 1.65-.1 2.16.4.26.27.38.76.38 1.43v3.8h-1.77v-4.06h-.77v12.99c.26-.03.5-.07.77-.12V34.3h1.77v7.64c.36-.1.72-.21 1.08-.34v-7c0-.8.19-1.4 1-1.67l-.9-4.87h1.8l.3 5.31h.22l.3-5.31h1.88l-1.01 4.87c.84.3 1.01.81 1.01 1.66v4.53a16.63 16.63 0 0 0 1.5-1.27v-9.83h5.25l.1-.72H24.93l.17.89c-.38-.72-1.12-1.08-2.2-1.08h-.77c-1.3 0-2.1.52-2.4 1.55-.27-1.08-1.1-1.62-2.46-1.62h-3.36v14.52c.26.09.52.18.78.25V27.84Zm16.29 5.58-.85-.8.85-4.37v5.17Z","M27.66 40.79c.27-.14.55-.28.8-.43v-5.98h-.8v6.4Z"],de=a((({className:e,href:t,children:a,targetBlank:i})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self",children:[n(oe,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:me.map((e=>({d:e})))}),n("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),he=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return r("form",{className:`relative ${e||""}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:"w-[24px] h-[24px]",children:n(v,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&n("span",{className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),n("input",{className:"pl-12 w-full font-sans font-normal text-base text-black border border-solid border-main-divider rounded h-full box-border outline-none pr-[6%]",value:a,onChange:e=>i(e.target.value),type:"text",name:"s"}),a&&n("button",{type:"submit",className:"absolute font-sans font-normal text-sm cursor-pointer bg-transparent hover:bg-primary-hover active:bg-primary-active text-primary-main hover:text-white border-none px-5 py-2 rounded top-1 right-1 outline-none",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),xe=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(ue):null,a?n(N,{className:"my-4",...B({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),ue=(e,t)=>{const{type:a,text:i,description:l}=e;return r("div",{className:"mb-4",children:[n("div",{children:pe(a,i)}),n("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},pe=(e,t)=>{switch(e){case"tel":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${fe(t)}`,children:t});case"email":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},fe=e=>e.replaceAll(/(\-|\s|\(|\)|\D+)/g,""),be=a((({className:e,links:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`${e||""}`,children:t?.length?n("div",{className:"flex justify-between items-center gap-5 py-5 border-solid border-x-0 border-y border-y-main-divider",children:t.map(((e,t)=>n(ge,{index:t,...B({router:a,handlerDecorator:i},e)},String(t))))}):null})})),ge=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),Ne=e=>t=>e?.href===t?.href;function ve(e,t){return(r=e,a=t,(r||[]).map((e=>a?.find(Ne(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(Ne(e))))));var n,r,a}function ye(e){const{data:t}=e(ke(),we);return t||{}}async function we(){const e=await fetch(ke());return await e.json()}function ke(){return`/wcms-resources/${i.SITEMAP||"sitemap"}.json`}const $e=a((({className:e,items:t,context:r})=>{const a=ve(ye(r.useAsyncData).topItems,t),i={router:r.useRouter(),handlerDecorator:r.handlerDecorator};return n("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>Se(e,t,i)))})})),Se=(e,t,{router:a,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return r("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[n("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>n(Ce,{...B({router:a,handlerDecorator:i},e)},String(t))))]},String(t))},Ce=a((({text:e,href:t,target:r,index:a})=>n("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:r||"_self",children:e||`Раздел ${a}`}))),_e=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники"}],Le=a((({className:e,media:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>n(je,{...B({router:a,handlerDecorator:i},e)},String(t))))})})),je=a((({href:e})=>{const{icon:t,label:r}=_e.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return n("a",{className:"flex items-center justify-center border-solid border border-main-divider rounded-full no-underline outline-none w-9 h-9",href:e,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:t&&n(v,{className:"block",name:t})})})),De=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return r("div",{className:`${e||""}`,children:[n("div",{className:"pt-5 pb-[5px]",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>n(Te,{index:t,...B({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Te=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),Re=a((({className:e,documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c})=>r("footer",{className:`${e} px-9 py-10 bg-white`,children:[r("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[n(de,{className:"w-[280px] xl:w-[220px]"}),n(he,{context:c,className:"grow"})]}),r("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[n(xe,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),n($e,{className:"pt-[3px]",context:c,items:s})]}),n(Le,{media:l,context:c}),n(be,{links:a,context:c}),n(De,{links:t,context:c})]}))),Ae=a((({className:e,onClick:t,ariaLabel:a})=>n("button",{className:`${e} border-none no-underline w-12 h-12 rounded-3xl bg-white flex text-black hover:text-primary-main`,style:{boxShadow:"0px 4px 25px rgba(0, 0, 0, 0.07)"},onClick:t,"aria-label":a,children:r("svg",{className:"m-auto",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n("path",{d:"M7 12L3 8L7 4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n("path",{d:"M14 9C14.5523 9 15 8.55228 15 8C15 7.44772 14.5523 7 14 7L14 9ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55229 7.44772 9 8 9L8 7ZM14 7L8 7L8 9L14 9L14 7Z",fill:"currentColor"})]})}))),Ie={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},Be={normal:380,mini:276},Me={normal:3,mini:4},Oe=a((({title:e,description:t,context:a,cards:i=[],className:l,version:s="normal"})=>{const[c,o]=a.useState(0);const m=i?.length>Me[s],h=m&&i?.length-c>Me[s],x=m&&c>0;return r("section",{className:`relative font-sans text-primary-text bg-white p-12 overflow-hidden ${l}`,children:[r("div",{className:"flex flex-col items-center mb-8",children:[e?n(k,{className:"font-medium m-0 text-center",children:e}):null,t?n("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),n("div",{className:`flex ${i?.length<=Me[s]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*Be[s]}px)`},role:"list",children:i?.map(((e,t)=>function(e,t,a){return r("div",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${Ie[a]} w-full`,role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.items.map(Pe)}):null]}),e.href?n(N,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},String(t))}(e,t,s)))}),x&&n(Ae,{className:"absolute top-1/2 left-8",onClick:function(){o(c-1)},ariaLabel:"Пролистать влево"}),h&&n(Ae,{className:"absolute top-1/2 right-1 z-20 rotate-180",onClick:function(){o(c+1)},ariaLabel:"Пролистать вправо"}),n("div",{className:"absolute top-0 right-0 bottom-0 w-[84px]",style:{background:"linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)"}})]})}));function Pe(e,t){return n(p,{children:n("span",{className:"text-sm text-secondary-text",children:e})},String(t))}const Ze=a((e=>n(Oe,{...e,version:"normal"}))),Fe=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[n("span",{className:`font-sans font-normal text-base ${l?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),l?n("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),He=a((({className:e,text:t,href:r,target:a,active:i,flat:l,onClick:s,children:c,ariaLabel:o})=>n("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${l?"":"px-4 py-2"} ${i?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:r,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:n("span",{className:`font-sans font-normal text-sm ${i?"text-primary-main":(l?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),Ve=a((({className:e,children:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 p-0 w-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":r,children:t}))),Ee=a((({context:e,className:t,defaultLocation:a=""})=>{const[i,l]=e.useGeolocation(a);return r("div",{className:`flex items-center ${t||""}`,children:[n(He,{className:"mr-5",flat:!0,href:"#",text:i,ariaLabel:"Местоположение",onClick:l}),n(He,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),n(Ve,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:n(v,{name:"LoupeIcon","aria-hidden":"true"})}),n(Ve,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:n(v,{name:"ProfileIcon","aria-hidden":"true"})}),n(Ve,{className:"mr-5 text-secondary-light hover:text-secondary-active min-w-[32px] min-h-[32px]",ariaLabel:"Дополнительные ссылки",children:n(v,{name:"GridIcon","aria-hidden":"true"})})]})}));const ze=a((({className:e,defaultLocation:t,context:a,topItems:i})=>{const l=a.useRouter(),s=ye(a.useAsyncData),{handlerDecorator:c}=a,o=ve(s.topItems,i),m=o.find(function(e){return t=>_(t.href,e,((e,t)=>t.startsWith(e)))}(l)),d=m?.items,h=d?.find(function(e){return t=>_(t.href,e)}(l)),x=o.map(((e,t)=>n(He,{active:e===m,...B({router:l,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),u=d?.map((e=>n(Fe,{className:"mr-8",active:e===h,...B({router:l,handlerDecorator:c},e)},e.href)));return r("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:[r("div",{className:"flex items-center",children:[n(de,{className:"mr-8"}),x,n(Ee,{context:a,className:"ml-auto",defaultLocation:t})]}),n("div",{className:"mt-5 h-[1px] bg-main-divider"}),n("nav",{className:"mt-5",children:u})]})})),Ue=a((e=>n(Oe,{...e,version:"mini"}))),We=a((({className:e,context:t,title:a="Мобильное приложение",qr:i,buttons:l=[]})=>n(H,{className:e,context:t,title:a,buttons:l,children:r("div",{className:"flex items-center",children:[i?.src&&i?.href&&n("a",{href:i.href,target:"_blank",children:n("img",{src:i.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),n("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Je=a((({className:e,context:t,title:a,titleSize:i,description:l,benefits:s,buttons:c,image:o,items:m})=>r("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[r("div",{className:"flex flex-col",children:[a&&n(k,{size:i||"XL",className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px]",children:a}),n(O,{context:t,description:l,items:m,buttons:c,children:s?.length?n("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(Ge)}):null})]}),o?.src&&n(d,{className:"mt-auto",image:o})]})));function Ge(e,t){return r("div",{className:"flex gap-4 items-center",children:[e.icon&&n(v,{className:"w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border",name:e.icon,width:"24",height:"24"}),r("div",{className:"flex gap-1 flex-col h-full",children:[n("h4",{className:"font-medium text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const Xe=a((({text:e,href:t,target:r,onClick:a,className:i,children:l})=>t?n("a",{className:`no-underline ${i||""}`,href:t,target:r,onClick:a,children:n("span",{className:`${i||""}`,children:e||l})}):n("span",{className:`${i||""}`,children:e||l})));function Qe(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])}const qe=a((e=>{const{context:t,className:a,breadcrumbs:i}=e,l=t.useRouter(),{handlerDecorator:s}=t;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${a||""}`,children:[i?.length?n("div",{className:"text-xs mb-6",children:Qe(n("span",{className:"text-secondary-text mx-2",children:"/"}))(i.map(((e,t)=>n(Xe,{...B({router:l,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,n(Je,{...e})]})})),Ke=a((({className:e,context:t,duration:a=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return r("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[n("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,r)=>function(e,t,r){return n("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:n("div",{className:"p-10 flex grow",children:n(Je,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:r,...e})})},String(t))}(e,r,t)))}),n("div",{className:"border-t border-solid border-main-divider flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:i,duration:l}){const s=t===a,c=s?"animate-slide":"";return r("button",{type:"button",onClick:i,className:"group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 py-4 grow basis-0",children:[r("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[n("div",{className:"text-sm font-medium group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),n("div",{className:"text-xs text-secondary-text",children:e.desc})]}),n("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${l}s`}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const Ye=a((e=>{const{benefits:t,version:a}=e;return n(H,{...e,children:r("div",{className:"flex mt-5 mb-1",children:[t?.length?n("div",{className:"mr-8",children:t.map(et)}):null,t?.length?n("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,r="primary"){return n("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[r]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function et(e,t){return n("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const tt=a((({className:e,context:t,title:a="Акции и спецпредложения",date:i,description:l,buttons:s=[],version:c})=>n(H,{className:e,context:t,title:a,buttons:s,version:c,children:r("div",{children:[i&&n("div",{className:"text-sm mb-2",children:nt(i)}),n("div",{className:"text-base",children:l})]})})));function nt(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const rt=a((({className:e,title:t,steps:a})=>r("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[n(k,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?r("div",{children:[n("div",{className:"flex mt-9 items-center px-[88px]",children:Qe(n("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>at(e,t))))}),n("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(it)})]}):null]}))),at=(e,t)=>n("div",{className:"flex flex-col items-center text-center relative",children:n("div",{className:"h-[100px] w-[100px] min-w-[100px] min-h-[100px] bg-secondary-light rounded-full p-[26px] box-border z-10",children:e.icon&&n(v,{name:e.icon,width:"48",height:"48"})||n("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),it=(e,t)=>n("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:r("div",{className:"max-w-min",children:[n("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),lt={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-base",description:"text-secondary-text"},secondary:{background:"bg-primary-main",icon:"bg-white text-primary-main",title:"text-white",description:"text-white"},"secondary-light":{background:"bg-primary-main/10",icon:"bg-primary-main text-white",title:"text-base",description:"text-secondary-text"}},st=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s})=>{const c=lt[a];return r("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[i&&"small"===i?ct(c.icon):null,i&&"big"===i?ot(l):null,r("div",{className:"py-0.5",children:[e&&n("div",{className:`font-medium mb-1 ${c.title}`,children:e}),t&&n("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function ct(e){return n("div",{className:"pt-1.5 pr-4",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function ot(e){return e?.src?n(d,{className:"pt-0.5 pr-3",image:e}):null}const mt={Header:ze,Footer:Re,Placeholder:E,Tile:H,PromoTile:tt,TextBlock:st,ProductTile:Ye,ProductBlock:qe,StepsBlock:rt,BenefitsBlock:q,ProductGallery:Ke,ExchangeRateTile:re,MobileAppTile:We,Gallery:Ze,MiniGallery:Ue},dt=a((({className:e,context:t})=>n("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:n(De,{context:t})}))),ht=a((({title:e,description:t,cards:a=[],className:i})=>r("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${i}`,children:[r("div",{className:"flex flex-col items-center mb-8",children:[n(k,{className:"font-medium m-0 text-centers",children:e}),t?n("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),n("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(xt)})]})));function xt(e,t){return r("div",{className:"box-border horizontal-list-item border-solid border rounded-md border-main-divider p-4 mx-1 flex flex-col justify-between items-stretch",role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?n("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?ut(e.items):null]}),e.href?n(N,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function ut(e=[]){return n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>n(p,{children:n("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const pt=a((({titleSize:e,image:t,benefits:r,...a})=>{const{className:i}=a;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${i||""}`,children:n(Je,{...a,titleSize:"L"})})})),ft={Header:ze,Footer:dt,Placeholder:E,Tile:H,ProductTile:Ye,ProductBlock:pt,TextBlock:st,ExchangeRateTile:re,MobileAppTile:We,Gallery:ht};e.Blocks=mt,e.ContentPage=G,e.ContentPageHead=s,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(l)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:r})}),{likes:i}=await n.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=ft,e.joinList=Qe,e.projectSettings=i,e.setup=t,e.toMobilePage=function(e){const t=e.blocks?.filter((({mobile:e})=>!e?.hidden)).map(Q);return{...e,blocks:t}},e.url=A,Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/dist/Blocks.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export declare const Blocks: {
|
|
|
13
13
|
ExchangeRateTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ExchangeRateTile").ExchangeRateTileProps, any>, context?: any) => any;
|
|
14
14
|
MobileAppTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MobileAppTile").MobileAppTileProps, any>, context?: any) => any;
|
|
15
15
|
Gallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Gallery").GalleryProps, any>, context?: any) => any;
|
|
16
|
+
MiniGallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MiniGallery").MiniGalleryProps, any>, context?: any) => any;
|
|
16
17
|
};
|
package/dist/Blocks.js
CHANGED
|
@@ -5,6 +5,7 @@ const ExchangeRateTile_1 = require("./ExchangeRateTile");
|
|
|
5
5
|
const Footer_1 = require("./Footer/Footer");
|
|
6
6
|
const Gallery_1 = require("./Gallery");
|
|
7
7
|
const Header_1 = require("./Header/Header");
|
|
8
|
+
const MiniGallery_1 = require("./MiniGallery");
|
|
8
9
|
const MobileAppTile_1 = require("./MobileAppTile");
|
|
9
10
|
const Placeholder_1 = require("./Placeholder");
|
|
10
11
|
const ProductBlock_1 = require("./ProductBlock");
|
|
@@ -29,5 +30,6 @@ exports.Blocks = {
|
|
|
29
30
|
ExchangeRateTile: ExchangeRateTile_1.ExchangeRateTile,
|
|
30
31
|
MobileAppTile: MobileAppTile_1.MobileAppTile,
|
|
31
32
|
Gallery: Gallery_1.Gallery,
|
|
33
|
+
MiniGallery: MiniGallery_1.MiniGallery,
|
|
32
34
|
};
|
|
33
35
|
//# sourceMappingURL=Blocks.js.map
|
package/dist/Blocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":";;AAAA,mDAAgD;AAChD,yDAAsD;AACtD,4CAAyC;AACzC,uCAAoC;AACpC,4CAAyC;AACzC,mDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,qDAAkD;AAClD,+CAA4C;AAC5C,2CAAwC;AACxC,6CAA0C;AAC1C,2CAAwC;AACxC,iCAA8B;AAEjB,QAAA,MAAM,GAAG;IACpB,MAAM,EAAN,eAAM;IACN,MAAM,EAAN,eAAM;IACN,WAAW,EAAX,yBAAW;IACX,IAAI,EAAJ,WAAI;IACJ,SAAS,EAAT,qBAAS;IACT,SAAS,EAAT,qBAAS;IACT,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,aAAa,EAAb,6BAAa;IACb,OAAO,EAAP,iBAAO;
|
|
1
|
+
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":";;AAAA,mDAAgD;AAChD,yDAAsD;AACtD,4CAAyC;AACzC,uCAAoC;AACpC,4CAAyC;AACzC,+CAA4C;AAC5C,mDAAgD;AAChD,+CAA4C;AAC5C,iDAA8C;AAC9C,qDAAkD;AAClD,+CAA4C;AAC5C,2CAAwC;AACxC,6CAA0C;AAC1C,2CAAwC;AACxC,iCAA8B;AAEjB,QAAA,MAAM,GAAG;IACpB,MAAM,EAAN,eAAM;IACN,MAAM,EAAN,eAAM;IACN,WAAW,EAAX,yBAAW;IACX,IAAI,EAAJ,WAAI;IACJ,SAAS,EAAT,qBAAS;IACT,SAAS,EAAT,qBAAS;IACT,WAAW,EAAX,yBAAW;IACX,YAAY,EAAZ,2BAAY;IACZ,UAAU,EAAV,uBAAU;IACV,aAAa,EAAb,6BAAa;IACb,cAAc,EAAd,+BAAc;IACd,gBAAgB,EAAhB,mCAAgB;IAChB,aAAa,EAAb,6BAAa;IACb,OAAO,EAAP,iBAAO;IACP,WAAW,EAAX,yBAAW;CACZ,CAAC"}
|
package/dist/Gallery.d.ts
CHANGED
package/dist/Gallery.js
CHANGED
|
@@ -2,36 +2,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
2
2
|
exports.Gallery = void 0;
|
|
3
3
|
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
4
|
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const BlockItem_1 = require("./ui-kit/BlockItem");
|
|
8
|
-
const Button_1 = require("./ui-kit/Button");
|
|
9
|
-
const Title_1 = require("./ui-kit/Title");
|
|
10
|
-
const CARD_WIDTH = 384;
|
|
11
|
-
const GALLERY_LENGTH_FOR_SCROLL = 3;
|
|
12
|
-
exports.Gallery = (0, uni_jsx_1.JSX)(({ title, description, context, cards = [], className }) => {
|
|
13
|
-
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
14
|
-
function handleNextClick() {
|
|
15
|
-
setActiveCardIndex(activeCardIndex + 1);
|
|
16
|
-
}
|
|
17
|
-
function handlePrevClick() {
|
|
18
|
-
setActiveCardIndex(activeCardIndex - 1);
|
|
19
|
-
}
|
|
20
|
-
const isGalleryScrollAvailable = cards?.length > GALLERY_LENGTH_FOR_SCROLL;
|
|
21
|
-
const showNextButton = isGalleryScrollAvailable && cards?.length - activeCardIndex > GALLERY_LENGTH_FOR_SCROLL;
|
|
22
|
-
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
23
|
-
return ((0, jsx_runtime_1.jsxs)("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center mb-8", children: [(0, jsx_runtime_1.jsx)(Title_1.Title, { className: "font-medium m-0 text-centers", children: title }), description ? ((0, jsx_runtime_1.jsx)("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), (0, jsx_runtime_1.jsx)("div", {
|
|
24
|
-
// Need to place all cards at the center if count of cards less than 4
|
|
25
|
-
className: `flex ${cards?.length <= GALLERY_LENGTH_FOR_SCROLL ? 'justify-center' : ''} duration-1000`,
|
|
26
|
-
// All cards has same width
|
|
27
|
-
style: { transform: `translateX(-${activeCardIndex * CARD_WIDTH}px)` }, role: "list", children: cards?.map(renderCard) }), showPrevButton && ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: "absolute top-1/2 left-8", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: "absolute top-1/2 right-1 z-20 rotate-180", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 right-0 bottom-0 w-[84px]", style: {
|
|
28
|
-
background: 'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)',
|
|
29
|
-
} })] }));
|
|
30
|
-
});
|
|
31
|
-
function renderCard(card, key) {
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: "box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch min-w-[364px] w-[364px] w-full", role: "listitem", children: [(0, jsx_runtime_1.jsxs)("div", { children: [card.image?.src ? ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mb-6", image: card.image }) })) : null, card.title ? ((0, jsx_runtime_1.jsx)("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? ((0, jsx_runtime_1.jsx)("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? renderItems(card.items) : null] }), card.href ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, key));
|
|
33
|
-
}
|
|
34
|
-
function renderItems(items = []) {
|
|
35
|
-
return ((0, jsx_runtime_1.jsx)("section", { className: "max-w-[308px] mt-2", role: "list", children: items.map((item, i) => ((0, jsx_runtime_1.jsx)(BlockItem_1.BlockItem, { children: (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)))) }));
|
|
36
|
-
}
|
|
5
|
+
const GalleryInner_1 = require("./GalleryInner");
|
|
6
|
+
exports.Gallery = (0, uni_jsx_1.JSX)((props) => (0, jsx_runtime_1.jsx)(GalleryInner_1.GalleryInner, { ...props, version: "normal" }));
|
|
37
7
|
//# sourceMappingURL=Gallery.js.map
|
package/dist/Gallery.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gallery.js","sourceRoot":"","sources":["../src/Gallery.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC
|
|
1
|
+
{"version":3,"file":"Gallery.js","sourceRoot":"","sources":["../src/Gallery.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,iDAA8C;AAKjC,QAAA,OAAO,GAAG,IAAA,aAAG,EAAe,CAAC,KAAK,EAAE,EAAE,CAAC,uBAAC,2BAAY,OAAK,KAAK,EAAE,OAAO,EAAC,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GalleryContent } from './GalleryContent';
|
|
2
|
+
import type { GalleryVersion } from './model/GalleryVersion';
|
|
3
|
+
import type { UniBlockProps } from './types';
|
|
4
|
+
export interface GalleryInnerProps extends GalleryContent, UniBlockProps {
|
|
5
|
+
version?: GalleryVersion;
|
|
6
|
+
}
|
|
7
|
+
export declare const GalleryInner: (props: import("@redneckz/uni-jsx").PropsWithChildren<GalleryInnerProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.GalleryInner = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const Img_1 = require("./Img");
|
|
6
|
+
const ArrowButton_1 = require("./ui-kit/ArrowButton");
|
|
7
|
+
const BlockItem_1 = require("./ui-kit/BlockItem");
|
|
8
|
+
const Button_1 = require("./ui-kit/Button");
|
|
9
|
+
const Title_1 = require("./ui-kit/Title");
|
|
10
|
+
const cardStyleMap = {
|
|
11
|
+
normal: 'min-w-[364px] w-[364px]',
|
|
12
|
+
mini: 'min-w-[260px] w-[260px]',
|
|
13
|
+
};
|
|
14
|
+
const cardWidthMap = {
|
|
15
|
+
normal: 380,
|
|
16
|
+
mini: 276,
|
|
17
|
+
};
|
|
18
|
+
const galleryLengthForScrollMap = {
|
|
19
|
+
normal: 3,
|
|
20
|
+
mini: 4,
|
|
21
|
+
};
|
|
22
|
+
exports.GalleryInner = (0, uni_jsx_1.JSX)(({ title, description, context, cards = [], className, version = 'normal' }) => {
|
|
23
|
+
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
24
|
+
function handleNextClick() {
|
|
25
|
+
setActiveCardIndex(activeCardIndex + 1);
|
|
26
|
+
}
|
|
27
|
+
function handlePrevClick() {
|
|
28
|
+
setActiveCardIndex(activeCardIndex - 1);
|
|
29
|
+
}
|
|
30
|
+
const isGalleryScrollAvailable = cards?.length > galleryLengthForScrollMap[version];
|
|
31
|
+
const showNextButton = isGalleryScrollAvailable &&
|
|
32
|
+
cards?.length - activeCardIndex > galleryLengthForScrollMap[version];
|
|
33
|
+
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center mb-8", children: [title ? (0, jsx_runtime_1.jsx)(Title_1.Title, { className: "font-medium m-0 text-center", children: title }) : null, description ? ((0, jsx_runtime_1.jsx)("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), (0, jsx_runtime_1.jsx)("div", {
|
|
35
|
+
// Need to place all cards at the center if count of cards less than 4
|
|
36
|
+
className: `flex ${cards?.length <= galleryLengthForScrollMap[version] ? 'justify-center' : ''} duration-1000`,
|
|
37
|
+
// All cards has same width
|
|
38
|
+
style: { transform: `translateX(-${activeCardIndex * cardWidthMap[version]}px)` }, role: "list", children: cards?.map((card, i) => renderCard(card, i, version)) }), showPrevButton && ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: "absolute top-1/2 left-8", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && ((0, jsx_runtime_1.jsx)(ArrowButton_1.ArrowButton, { className: "absolute top-1/2 right-1 z-20 rotate-180", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), (0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 right-0 bottom-0 w-[84px]", style: {
|
|
39
|
+
background: 'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)',
|
|
40
|
+
} })] }));
|
|
41
|
+
});
|
|
42
|
+
function renderCard(card, i, version) {
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${cardStyleMap[version]} w-full`, role: "listitem", children: [(0, jsx_runtime_1.jsxs)("div", { children: [card.image?.src ? ((0, jsx_runtime_1.jsx)("div", { className: "flex justify-center", children: (0, jsx_runtime_1.jsx)(Img_1.Img, { className: "mb-6", image: card.image }) })) : null, card.title ? ((0, jsx_runtime_1.jsx)("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? ((0, jsx_runtime_1.jsx)("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? ((0, jsx_runtime_1.jsx)("section", { className: "max-w-[308px] mt-2", role: "list", children: card.items.map(renderItem) })) : null] }), card.href ? ((0, jsx_runtime_1.jsx)(Button_1.Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, String(i)));
|
|
44
|
+
}
|
|
45
|
+
function renderItem(item, i) {
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(BlockItem_1.BlockItem, { children: (0, jsx_runtime_1.jsx)("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=GalleryInner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryInner.js","sourceRoot":"","sources":["../src/GalleryInner.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,+BAA4B;AAG5B,sDAAmD;AACnD,kDAA+C;AAC/C,4CAAyC;AACzC,0CAAuC;AAMvC,MAAM,YAAY,GAAmC;IACnD,MAAM,EAAE,yBAAyB;IACjC,IAAI,EAAE,yBAAyB;CAChC,CAAC;AAEF,MAAM,YAAY,GAAmC;IACnD,MAAM,EAAE,GAAG;IACX,IAAI,EAAE,GAAG;CACV,CAAC;AAEF,MAAM,yBAAyB,GAAmC;IAChE,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;CACR,CAAC;AAEW,QAAA,YAAY,GAAG,IAAA,aAAG,EAC7B,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,SAAS,EAAE,OAAO,GAAG,QAAQ,EAAE,EAAE,EAAE;IAC7E,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IAElE,SAAS,eAAe;QACtB,kBAAkB,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,SAAS,eAAe;QACtB,kBAAkB,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,wBAAwB,GAAG,KAAK,EAAE,MAAM,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEpF,MAAM,cAAc,GAClB,wBAAwB;QACxB,KAAK,EAAE,MAAM,GAAG,eAAe,GAAG,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAEvE,MAAM,cAAc,GAAG,wBAAwB,IAAI,eAAe,GAAG,CAAC,CAAC;IAEvE,OAAO,CACL,qCACE,SAAS,EAAE,sEAAsE,SAAS,EAAE,aAE5F,iCAAK,SAAS,EAAC,iCAAiC,aAC7C,KAAK,CAAC,CAAC,CAAC,uBAAC,aAAK,IAAC,SAAS,EAAC,6BAA6B,YAAE,KAAK,GAAS,CAAC,CAAC,CAAC,IAAI,EAC7E,WAAW,CAAC,CAAC,CAAC,CACb,gCAAK,SAAS,EAAC,0CAA0C,YAAE,WAAW,GAAO,CAC9E,CAAC,CAAC,CAAC,IAAI,IACJ,EACN;gBACE,sEAAsE;gBACtE,SAAS,EAAE,QACT,KAAK,EAAE,MAAM,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAC3E,gBAAgB;gBAChB,2BAA2B;gBAC3B,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,eAAe,GAAG,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,EACjF,IAAI,EAAC,MAAM,YAEV,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,GAClD,EACL,cAAc,IAAI,CACjB,uBAAC,yBAAW,IACV,SAAS,EAAC,yBAAyB,EACnC,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,6FAAkB,GAC5B,CACH,EACA,cAAc,IAAI,CACjB,uBAAC,yBAAW,IACV,SAAS,EAAC,0CAA0C,EACpD,OAAO,EAAE,eAAe,EACxB,SAAS,EAAC,mGAAmB,GAC7B,CACH,EACD,gCACE,SAAS,EAAC,0CAA0C,EACpD,KAAK,EAAE;oBACL,UAAU,EAAE,wEAAwE;iBACrF,GACI,IACC,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,UAAU,CAAC,IAAiB,EAAE,CAAS,EAAE,OAAuB;IACvE,OAAO,CACL,iCACE,SAAS,EAAE,sHAAsH,YAAY,CAAC,OAAO,CAAC,SAAS,EAC/J,IAAI,EAAC,UAAU,aAGf,4CACG,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CACjB,gCAAK,SAAS,EAAC,qBAAqB,YAClC,uBAAC,SAAG,IAAC,SAAS,EAAC,MAAM,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,GAAI,GACvC,CACP,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CACZ,+BACE,SAAS,EAAE,2BACT,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAC7D,EAAE,YAED,IAAI,CAAC,KAAK,GACR,CACN,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAClB,gCAAK,SAAS,EAAC,8CAA8C,YAAE,IAAI,CAAC,WAAW,GAAO,CACvF,CAAC,CAAC,CAAC,IAAI,EACP,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CACpB,oCAAS,SAAS,EAAC,oBAAoB,EAAC,IAAI,EAAC,MAAM,YAChD,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,GACnB,CACX,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CACX,uBAAC,eAAM,IAAC,SAAS,EAAC,MAAM,EAAC,IAAI,EAAC,wDAAW,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAI,CAClF,CAAC,CAAC,CAAC,IAAI,KA5BH,MAAM,CAAC,CAAC,CAAC,CA6BV,CACP,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,IAAY,EAAE,CAAS;IACzC,OAAO,CACL,uBAAC,qBAAS,cACR,iCAAM,SAAS,EAAC,6BAA6B,YAAE,IAAI,GAAQ,IAD7C,MAAM,CAAC,CAAC,CAAC,CAEb,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { GalleryContent } from './GalleryContent';
|
|
2
|
+
import { UniBlockProps } from './types';
|
|
3
|
+
export interface MiniGalleryProps extends GalleryContent, UniBlockProps {
|
|
4
|
+
}
|
|
5
|
+
export declare const MiniGallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<MiniGalleryProps, any>, context?: any) => any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2
|
+
exports.MiniGallery = void 0;
|
|
3
|
+
const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
|
|
4
|
+
const uni_jsx_1 = require("@redneckz/uni-jsx");
|
|
5
|
+
const GalleryInner_1 = require("./GalleryInner");
|
|
6
|
+
exports.MiniGallery = (0, uni_jsx_1.JSX)((props) => ((0, jsx_runtime_1.jsx)(GalleryInner_1.GalleryInner, { ...props, version: "mini" })));
|
|
7
|
+
//# sourceMappingURL=MiniGallery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MiniGallery.js","sourceRoot":"","sources":["../src/MiniGallery.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,iDAA8C;AAKjC,QAAA,WAAW,GAAG,IAAA,aAAG,EAAmB,CAAC,KAAK,EAAE,EAAE,CAAC,CAC1D,uBAAC,2BAAY,OAAK,KAAK,EAAE,OAAO,EAAC,MAAM,GAAG,CAC3C,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type GalleryVersion = 'normal' | 'mini';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GalleryVersion.js","sourceRoot":"","sources":["../../src/model/GalleryVersion.ts"],"names":[],"mappings":""}
|
package/lib/Blocks.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ export declare const Blocks: {
|
|
|
13
13
|
ExchangeRateTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./ExchangeRateTile").ExchangeRateTileProps, any>, context?: any) => any;
|
|
14
14
|
MobileAppTile: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MobileAppTile").MobileAppTileProps, any>, context?: any) => any;
|
|
15
15
|
Gallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./Gallery").GalleryProps, any>, context?: any) => any;
|
|
16
|
+
MiniGallery: (props: import("@redneckz/uni-jsx").PropsWithChildren<import("./MiniGallery").MiniGalleryProps, any>, context?: any) => any;
|
|
16
17
|
};
|
package/lib/Blocks.js
CHANGED
|
@@ -3,6 +3,7 @@ import { ExchangeRateTile } from './ExchangeRateTile.js';
|
|
|
3
3
|
import { Footer } from './Footer/Footer.js';
|
|
4
4
|
import { Gallery } from './Gallery.js';
|
|
5
5
|
import { Header } from './Header/Header.js';
|
|
6
|
+
import { MiniGallery } from './MiniGallery.js';
|
|
6
7
|
import { MobileAppTile } from './MobileAppTile.js';
|
|
7
8
|
import { Placeholder } from './Placeholder.js';
|
|
8
9
|
import { ProductBlock } from './ProductBlock.js';
|
|
@@ -27,5 +28,6 @@ export const Blocks = {
|
|
|
27
28
|
ExchangeRateTile,
|
|
28
29
|
MobileAppTile,
|
|
29
30
|
Gallery,
|
|
31
|
+
MiniGallery,
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=Blocks.js.map
|
package/lib/Blocks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM;IACN,MAAM;IACN,WAAW;IACX,IAAI;IACJ,SAAS;IACT,SAAS;IACT,WAAW;IACX,YAAY;IACZ,UAAU;IACV,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,OAAO;
|
|
1
|
+
{"version":3,"file":"Blocks.js","sourceRoot":"","sources":["../src/Blocks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,MAAM;IACN,MAAM;IACN,WAAW;IACX,IAAI;IACJ,SAAS;IACT,SAAS;IACT,WAAW;IACX,YAAY;IACZ,UAAU;IACV,aAAa;IACb,cAAc;IACd,gBAAgB;IAChB,aAAa;IACb,OAAO;IACP,WAAW;CACZ,CAAC"}
|
package/lib/Gallery.d.ts
CHANGED
package/lib/Gallery.js
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { BlockItem } from './ui-kit/BlockItem.js';
|
|
6
|
-
import { Button } from './ui-kit/Button.js';
|
|
7
|
-
import { Title } from './ui-kit/Title.js';
|
|
8
|
-
const CARD_WIDTH = 384;
|
|
9
|
-
const GALLERY_LENGTH_FOR_SCROLL = 3;
|
|
10
|
-
export const Gallery = JSX(({ title, description, context, cards = [], className }) => {
|
|
11
|
-
const [activeCardIndex, setActiveCardIndex] = context.useState(0);
|
|
12
|
-
function handleNextClick() {
|
|
13
|
-
setActiveCardIndex(activeCardIndex + 1);
|
|
14
|
-
}
|
|
15
|
-
function handlePrevClick() {
|
|
16
|
-
setActiveCardIndex(activeCardIndex - 1);
|
|
17
|
-
}
|
|
18
|
-
const isGalleryScrollAvailable = cards?.length > GALLERY_LENGTH_FOR_SCROLL;
|
|
19
|
-
const showNextButton = isGalleryScrollAvailable && cards?.length - activeCardIndex > GALLERY_LENGTH_FOR_SCROLL;
|
|
20
|
-
const showPrevButton = isGalleryScrollAvailable && activeCardIndex > 0;
|
|
21
|
-
return (_jsxs("section", { className: `relative font-sans text-primary-text bg-white p-12 overflow-hidden ${className}`, children: [_jsxs("div", { className: "flex flex-col items-center mb-8", children: [_jsx(Title, { className: "font-medium m-0 text-centers", children: title }), description ? (_jsx("div", { className: "font-normal text-base max-w-[600px] mt-3", children: description })) : null] }), _jsx("div", {
|
|
22
|
-
// Need to place all cards at the center if count of cards less than 4
|
|
23
|
-
className: `flex ${cards?.length <= GALLERY_LENGTH_FOR_SCROLL ? 'justify-center' : ''} duration-1000`,
|
|
24
|
-
// All cards has same width
|
|
25
|
-
style: { transform: `translateX(-${activeCardIndex * CARD_WIDTH}px)` }, role: "list", children: cards?.map(renderCard) }), showPrevButton && (_jsx(ArrowButton, { className: "absolute top-1/2 left-8", onClick: handlePrevClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043B\u0435\u0432\u043E" })), showNextButton && (_jsx(ArrowButton, { className: "absolute top-1/2 right-1 z-20 rotate-180", onClick: handleNextClick, ariaLabel: "\u041F\u0440\u043E\u043B\u0438\u0441\u0442\u0430\u0442\u044C \u0432\u043F\u0440\u0430\u0432\u043E" })), _jsx("div", { className: "absolute top-0 right-0 bottom-0 w-[84px]", style: {
|
|
26
|
-
background: 'linear-gradient(270deg, #FFFFFF 34.89%, rgba(255, 255, 255, 0) 92.52%)',
|
|
27
|
-
} })] }));
|
|
28
|
-
});
|
|
29
|
-
function renderCard(card, key) {
|
|
30
|
-
return (_jsxs("div", { className: "box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch min-w-[364px] w-[364px] w-full", role: "listitem", children: [_jsxs("div", { children: [card.image?.src ? (_jsx("div", { className: "flex justify-center", children: _jsx(Img, { className: "mb-6", image: card.image }) })) : null, card.title ? (_jsx("h4", { className: `font-medium text-xl m-0 ${!card.description && !card.items?.length ? 'text-center' : ''}`, children: card.title })) : null, card.description ? (_jsx("div", { className: "font-normal text-sm text-secondary-text mt-2", children: card.description })) : null, card.items?.length ? renderItems(card.items) : null] }), card.href ? (_jsx(Button, { className: "mt-6", text: "\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435", version: "secondary", href: card.href })) : null] }, key));
|
|
31
|
-
}
|
|
32
|
-
function renderItems(items = []) {
|
|
33
|
-
return (_jsx("section", { className: "max-w-[308px] mt-2", role: "list", children: items.map((item, i) => (_jsx(BlockItem, { children: _jsx("span", { className: "text-sm text-secondary-text", children: item }) }, String(i)))) }));
|
|
34
|
-
}
|
|
3
|
+
import { GalleryInner } from './GalleryInner.js';
|
|
4
|
+
export const Gallery = JSX((props) => _jsx(GalleryInner, { ...props, version: "normal" }));
|
|
35
5
|
//# sourceMappingURL=Gallery.js.map
|