@redneckz/wildless-cms-uni-blocks 0.2.93 → 0.2.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/bundle/bundle.umd.js +41 -27
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/dist/components/ContentPage/ContentPage.d.ts +9 -1
  4. package/dist/components/ContentPage/ContentPage.js +20 -17
  5. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  6. package/dist/components/ContentPage/toMobilePage.js +13 -2
  7. package/dist/components/ContentPage/toMobilePage.js.map +1 -1
  8. package/dist/components/Header/Header.js +3 -3
  9. package/dist/components/Header/Header.js.map +1 -1
  10. package/dist/components/LinkDocs/LinkDocs.js +3 -3
  11. package/dist/components/LinkDocs/LinkDocs.js.map +1 -1
  12. package/dist/components/ProductBlock/ProductBlock.js +1 -1
  13. package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
  14. package/dist/components/ProductBlock/ProductBlockInner.js +1 -1
  15. package/dist/components/ProductBlock/ProductBlockInner.js.map +1 -1
  16. package/dist/types.d.ts +8 -0
  17. package/lib/common.css +1 -1
  18. package/lib/components/ContentPage/ContentPage.d.ts +9 -1
  19. package/lib/components/ContentPage/ContentPage.js +20 -17
  20. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  21. package/lib/components/ContentPage/toMobilePage.js +13 -2
  22. package/lib/components/ContentPage/toMobilePage.js.map +1 -1
  23. package/lib/components/Header/Header.js +3 -3
  24. package/lib/components/Header/Header.js.map +1 -1
  25. package/lib/components/LinkDocs/LinkDocs.fixture.d.ts +3 -3
  26. package/lib/components/LinkDocs/LinkDocs.js +3 -3
  27. package/lib/components/LinkDocs/LinkDocs.js.map +1 -1
  28. package/lib/components/ProductBlock/ProductBlock.js +1 -1
  29. package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
  30. package/lib/components/ProductBlock/ProductBlockInner.js +1 -1
  31. package/lib/components/ProductBlock/ProductBlockInner.js.map +1 -1
  32. package/lib/types.d.ts +8 -0
  33. package/package.json +1 -1
  34. package/src/components/ContentPage/ContentPage.page.json +31 -49
  35. package/src/components/ContentPage/ContentPage.tsx +71 -36
  36. package/src/components/ContentPage/toMobilePage.ts +19 -2
  37. package/src/components/Header/Header.tsx +14 -12
  38. package/src/components/LinkDocs/LinkDocs.example.json +26 -0
  39. package/src/components/LinkDocs/LinkDocs.fixture.tsx +5 -5
  40. package/src/components/LinkDocs/LinkDocs.tsx +3 -3
  41. package/src/components/ProductBlock/ProductBlock.fixture.tsx +1 -0
  42. package/src/components/ProductBlock/ProductBlock.tsx +3 -1
  43. package/src/components/ProductBlock/ProductBlockInner.tsx +1 -1
  44. package/src/types.ts +11 -1
@@ -397,18 +397,18 @@
397
397
  };
398
398
  const titleMarginsStyleMap = {
399
399
  double: 'mb-8',
400
- single: '',
400
+ single: 'mb-[26px]',
401
401
  };
402
402
  const linkColumnsModeStyleMap = {
403
403
  double: 'gap-x-5 gap-y-[26px] flex-wrap',
404
404
  single: 'gap-3.5 flex-col',
405
405
  };
406
- const LinkDocs = JSX(({ className, title, align, documents, icon, columnsMode = 'single' }) => {
406
+ const LinkDocs = JSX(({ className, title, align, documents, icon, columnsMode = 'double' }) => {
407
407
  const containerClasses = linkColumnsModeStyleMap[columnsMode];
408
408
  return (jsxs("section", { className: `font-sans p-[50px] bg-white ${className}`, children: [title && (jsx(Title, { className: `font-medium mt-0 ${titleMarginsStyleMap[columnsMode]} ${titleAlignStyleMap[align ?? 'center']}`, children: title })), jsx("div", { className: `flex ${containerClasses}`, role: "list", children: documents?.length
409
409
  ? documents.map(({ text, fileSize, ...linkProps }, i) => (jsxs("a", { className: `group flex text-sm align-middle h-fit
410
410
  text-primary-text no-underline hover:text-primary-main
411
- ${columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}`, role: "listitem", ...linkProps, children: [icon && jsx(Icon, { className: "mr-3.5", name: icon, width: "24px", height: "24px" }), jsxs("span", { className: "self-center", children: [text, jsx("span", { className: "text-secondary-text group-hover:text-primary-main", children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })] }, String(i))))
411
+ ${columnsMode === 'double' ? 'basis-[calc(50%-20px)]' : ''}`, role: "listitem", ...linkProps, children: [icon && jsx(Icon, { className: "mr-2.5", name: icon, width: "24px", height: "24px" }), jsxs("span", { className: "self-center", children: [text, jsx("span", { className: "text-secondary-text group-hover:text-primary-main", children: linkProps?.href && formatSuffix(getExtFromHref(linkProps.href), fileSize) })] })] }, String(i))))
412
412
  : null })] }));
413
413
  });
414
414
  const getExtFromHref = (href) => {
@@ -486,9 +486,9 @@
486
486
  : `${contentBlock.scrollHeight}px`;
487
487
  };
488
488
  return (jsxs("li", { className: "border-0 border-b border-solid border-main-divider last:border-b-0", children: [jsxs("button", { className: `border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text
489
- ${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map((block, i) => renderBlock(block, i, context)) : null })) : null] }));
489
+ ${hasContent ? 'group cursor-pointer' : ''}`, onClick: handleToggle, children: [jsx("span", { className: `m-0 text-xl pr-2.5 font-medium ${hasContent ? 'group-hover:text-primary-main' : ''}`, children: label }), hasContent ? jsx(Icon, { name: icon, width: "24", height: "24" }) : null] }), hasContent ? (jsx("div", { className: `${isActive ? 'pb-5' : ''} text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 `, children: blocks?.length ? blocks.map((block, i) => renderBlock$1(block, i, context)) : null })) : null] }));
490
490
  });
491
- const renderBlock = (block, i, context) => {
491
+ const renderBlock$1 = (block, i, context) => {
492
492
  const type = block?.accordionBlockType;
493
493
  if (!type || !(type in AccordionBlocks)) {
494
494
  return null;
@@ -990,7 +990,7 @@
990
990
  const activeSubItem = subItems?.find(isSubItemActive(router));
991
991
  const topMenu = mergedItems.map((_, i) => (jsx(TopItem, { active: _ === activeTopItem, ...useLink({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
992
992
  const subMenu = subItems?.map((_) => (jsx(HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...useLink({ router, handlerDecorator }, _) }, _.href)));
993
- 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 })] }));
993
+ return (jsx("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: jsxs("div", { className: "container", 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 })] }) }));
994
994
  });
995
995
 
996
996
  const MiniGallery = JSX((props) => (jsx(GalleryInner, { ...props, version: "mini" })));
@@ -1013,7 +1013,7 @@
1013
1013
  return (jsxs("div", { className: `flex grow justify-between items-stretch ${className || ''}`, children: [jsx("div", { className: 'flex flex-col', children: jsx(BaseTile, { context: context, title: title, titleSize: titleSize || 'XL', description: description, items: items, buttons: buttons, children: benefits?.length ? (jsx("div", { className: "flex gap-6 mt-6 mb-3.5", children: benefits.map(renderBenefit) })) : null }) }), image?.src && jsx(Img, { className: "mt-auto", image: image })] }));
1014
1014
  });
1015
1015
  function renderBenefit(benefit, i) {
1016
- return (jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (jsx(Icon, { className: "w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border", name: benefit.icon, width: "24", height: "24" })), jsxs("div", { className: "flex gap-1 flex-col h-full", children: [jsx("h4", { className: "font-medium text-primary-text text-xl m-0", children: benefit.label }), benefit.description && (jsx("div", { className: "font-normal text-sm text-secondary-text", children: benefit.description }))] })] }, String(i)));
1016
+ return (jsxs("div", { className: "flex gap-4 items-center", children: [benefit.icon && (jsx(Icon, { className: "w-[50px] h-[50px] min-w-[50px] min-h-[50px] bg-main rounded-full p-[10px] box-border", name: benefit.icon, width: "24", height: "24" })), jsxs("div", { className: "flex gap-1 flex-col h-full max-w-[149px]", children: [jsx("h4", { className: "font-medium text-primary-text text-xl m-0", children: benefit.label }), benefit.description && (jsx("div", { className: "font-normal text-sm text-secondary-text", children: benefit.description }))] })] }, String(i)));
1017
1017
  }
1018
1018
 
1019
1019
  const Breadcrumb = JSX(({ text, href, target, onClick, className, children }) => {
@@ -1033,7 +1033,7 @@
1033
1033
  const { context, className, breadcrumbs } = props;
1034
1034
  const router = context.useRouter();
1035
1035
  const { handlerDecorator } = context;
1036
- return (jsxs("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${className || ''}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: "text-secondary-text mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: 'text-secondary-text', ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
1036
+ return (jsxs("section", { className: `font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${className || ''}`, children: [breadcrumbs?.length ? (jsx("div", { className: "text-xs mb-6", children: joinList(jsx("span", { className: "text-secondary-text mx-2", children: "/" }))(breadcrumbs.map((breadcrumb, i) => (jsx(Breadcrumb, { ...useLink({ router, handlerDecorator }, { className: 'text-secondary-text', ...breadcrumb }) }, String(i))))) })) : null, jsx(ProductBlockInner, { ...props })] }));
1037
1037
  });
1038
1038
 
1039
1039
  const ProductGallery = JSX(({ className, context, duration = 0, slides = [] }) => {
@@ -1172,24 +1172,27 @@
1172
1172
  });
1173
1173
 
1174
1174
  const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
1175
- const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
1176
- return (jsxs("section", { className: "relative", "data-theme": colorPalette, children: [jsx("div", { className: `grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className || ''}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
1177
- function renderBlock(block, i) {
1178
- const { type } = block;
1179
- if (!(type in blocksRegistry)) {
1180
- console.warn(`No block with "${type}" is registered`);
1181
- }
1182
- const BlockComponent = blocksRegistry[type] || Placeholder;
1183
- return blockDecorator({
1184
- blockClassName: style2className(block.style),
1185
- block,
1186
- render: (props) => {
1187
- const { version, content, blocks } = props.block;
1188
- return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
1189
- },
1190
- }, `block-${i}`);
1191
- }
1175
+ const ContentPage = JSX(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
1176
+ const { header } = slots;
1177
+ return (jsxs("section", { className: `relative ${style2className(pageStyle)} ${className || ''}`, "data-theme": colorPalette, children: [header?.blocks?.length ? (jsx("div", { className: `${style2className(header?.style)}`, children: header.blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, blocks?.length ? (jsx("div", { className: "container grid grid-cols-12 gap-1", children: blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, likeControl && (jsx("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: jsx(LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
1192
1178
  });
1179
+ function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
1180
+ const { type } = block;
1181
+ if (!(type in blocksRegistry)) {
1182
+ console.warn(`No block with "${type}" is registered`);
1183
+ }
1184
+ const BlockComponent = blocksRegistry[type] || Placeholder;
1185
+ return blockDecorator({
1186
+ blockClassName: style2className(block.style),
1187
+ block,
1188
+ render: (props) => {
1189
+ const { version, content, blocks } = props.block;
1190
+ return (jsx(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length
1191
+ ? blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i))
1192
+ : null }, `${type}-${i}`));
1193
+ },
1194
+ }, `block-${i}`);
1195
+ }
1193
1196
  function style2className(style) {
1194
1197
  return style ? style.join(' ') : '';
1195
1198
  }
@@ -1202,12 +1205,23 @@
1202
1205
  });
1203
1206
 
1204
1207
  function toMobilePage(contentPage) {
1205
- const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
1208
+ const { blocks, slots } = contentPage;
1206
1209
  return {
1207
1210
  ...contentPage,
1208
- blocks,
1211
+ blocks: getMobileBlocks(blocks),
1212
+ slots: slots &&
1213
+ Object.keys(slots).reduce((res, key) => ({
1214
+ ...res,
1215
+ [key]: {
1216
+ ...slots[key],
1217
+ blocks: getMobileBlocks(slots[key].blocks),
1218
+ },
1219
+ }), {}),
1209
1220
  };
1210
1221
  }
1222
+ function getMobileBlocks(blocks) {
1223
+ return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
1224
+ }
1211
1225
  function toMobileBlock(block) {
1212
1226
  const { mobile } = block;
1213
1227
  if (mobile) {
@@ -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,r)=>{t._jsx=e,t._jsxs=r||e};t.vue=e=>{t(((t,{children:r,dangerouslySetInnerHTML:n,...a}={})=>{const l=Object.assign({},a,n?{innerHTML:n.__html}:{});return e(t,l,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),n=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:n,...a}=t||{},l=r?.slots?.default,i=n||l&&l();return e(Object.assign(a,i&&{children:i}),r)},e._tmpl.inheritAttrs=!1),e._tmpl);const l="likesToken";var i;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(i||(i={}));const s=a((({size:e="L",className:t,children:n,...a})=>r("XL"===e?"h1":"h2",{className:c(i[e],t),...a,children:n}))),c=(...e)=>e.filter(Boolean).join(" "),o=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}},d=a((({className:e,name:t,alt:a=`Icon ${t}`,title:l=a,asSVG:i,...s})=>{const c=`${o.CDN||""}icons/${t}.svg`;return i?n("svg",{className:e,...s,"aria-hidden":"true",children:[l?r("title",{children:l}):null,a?r("desc",{children:a}):null,r("use",{href:`${c}#icon`,xlinkHref:`${c}#icon`})]}):r("img",{className:e,src:c,alt:a,title:l,...s,"aria-hidden":"true"})})),m="/mobile",h=e=>e?.includes("//"),x=(e,t,r=((e,t)=>e===t))=>r(u(e),p(u(h(e)?t.href:t.pathname))),u=e=>(e||"").replace(/\/?\?.*/,""),p=e=>(e||"").replace(m,""),f=e=>{if(!h(e))return;const t=e,r=t.indexOf("//"),n=t.indexOf("/",r+"//".length);return-1!==n?t.substring(0,n):t},b=(e,t)=>{if(!e)return e;const r=g(e,t),n=t?.pathname.startsWith(m);return n&&!h(r)?`/mobile${r}`:r},g=(e,t)=>{if(!e)return e;const r=f(t?.href);return r?e.replace(r,"")||"/":e};var v=Object.freeze({__proto__:null,MOBILE_URL_PATH:m,isURL:h,isHrefActive:x,withoutQuery:u,withoutMobilePath:p,getOrigin:f,adjustHref:b,toRelativeHref:g});const N=e=>e;function y({router:e,handlerDecorator:t=N},r){const n=b(r.href,e);return{...r,href:n,ariaLabel:r.text,onClick:t((t=>{const a=n&&!h(n),l=!r.target||"_self"===r.target;a&&l&&(t.preventDefault(),e.push(n))}),r)}}const w={primary:"bg-primary-main w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2 rounded-full",secondary:"bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full"},k={primary:"text-primary-text",secondary:"text-secondary-text"},$=a((({className:e,isDotted:t=!0,text:a,children:l,version:i="primary"})=>n("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[t&&r("div",{className:`inline-block mr-3 ${w[i]}`}),r("span",{className:`text-base font-normal font-sans mr-3 ${k[i]}`,children:a||l})]}))),S={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"},C={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},L="inline-block text-center font-sans select-none",D=a((({className:e,text:t,aboveText:n,appendLeft:a,href:l,target:i,onClick:s,children:c,disabled:o,rounded:d,version:m="none",ariaLabel:h,...x})=>{const u=c??r(j,{text:t,aboveText:n,appendLeft:a,rounded:d});return o?r("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`${L} ${C[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,children:u}):r("a",{className:`${L} cursor-pointer no-underline ${S[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,href:l,target:i,onClick:s,"aria-label":h,role:l?"link":"button",...x,children:u})})),j=a((({text:e,aboveText:t,appendLeft:a,rounded:l})=>{const i=!e&&!t&&Boolean(a);return n("div",{className:`flex items-center justify-center ${i?"h-12 w-12 min-h-12 min-w-12":"px-8 gap-2 "+(t?"py-2":"py-[13px]")} ${l?"rounded-full":""}`,children:[a||null,i?null:n("div",{children:[r("div",{className:"text-xxs text-left",children:t}),r("div",{className:"text-sm font-medium text-left",children:e})]})]})})),_=a((({className:e,image:t})=>n("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},n)=>r("source",{srcSet:e,type:T(t)},`${n}_${e}`))):null,r("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function T(e){return e?`image/${String(e)}`:void 0}const R=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12},I={left:"items-start",center:"items-center",right:"items-end"},M={left:"text-left",center:"text-center",right:"text-right"},A=a((({className:e,context:t,title:a,titleSize:l,description:i,children:c,buttons:o,image:m,items:h,version:x="primary",align:u="left"})=>{const p=t.useRouter(),{handlerDecorator:f}=t;return n("div",{className:`font-sans flex flex-col grow h-full ${I[u]}`,children:[a&&r(s,{size:l||B(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px] "+("primary"===x?"text-primary-text":""),children:a}),n("div",{className:"flex grow justify-between w-full",children:[n("div",{className:`flex flex-col justify-between ${I[u]}`,children:[n("div",{children:[i?r("div",{className:`font-normal text-base max-w-[600px] ${M[u]}`,children:i}):null,c,h?.length?P(h,x):null]}),o?.length?r("div",{className:"flex mt-9 gap-3",children:o.map(((e,t)=>function({icon:e,...t},n){if(!t?.text)return;return r(D,e?{appendLeft:r(d,{name:e,width:"24",height:"24"}),...t}:{...t},String(n))}(y({router:p,handlerDecorator:f},e),t)))}):null]}),m?.src&&r(_,{className:"mt-auto ml-7",image:m})]})]})}));function B(e=""){const t=R(e);return t<=4?"S":t<=8?"M":"L"}function P(e=[],t){return r("section",{className:"max-w-[600px] mt-5",role:"list",children:e.map(((e,n)=>r($,{className:n?"mt-2.5":"",text:e,version:t},String(n))))})}const O=a((({bgColor:e="bg-white",className:t,...n})=>r("section",{className:`p-10 ${e} ${t||""} `,children:r(A,{...n})}))),F={left:"text-left",center:"text-center",right:"text-right"},H={double:"mb-8",single:""},V={double:"gap-x-5 gap-y-[26px] flex-wrap",single:"gap-3.5 flex-col"},Z=a((({className:e,title:t,align:a,documents:l,icon:i,columnsMode:c="single"})=>{const o=V[c];return n("section",{className:`font-sans p-[50px] bg-white ${e}`,children:[t&&r(s,{className:`font-medium mt-0 ${H[c]} ${F[a??"center"]}`,children:t}),r("div",{className:`flex ${o}`,role:"list",children:l?.length?l.map((({text:e,fileSize:t,...a},l)=>n("a",{className:"group flex text-sm align-middle h-fit\n text-primary-text no-underline hover:text-primary-main\n "+("double"===c?"basis-[calc(50%-20px)]":""),role:"listitem",...a,children:[i&&r(d,{className:"mr-3.5",name:i,width:"24px",height:"24px"}),n("span",{className:"self-center",children:[e,r("span",{className:"text-secondary-text group-hover:text-primary-main",children:a?.href&&E(z(a.href),t)})]})]},String(l)))):null})]})})),z=e=>{if(!e)return"";const t=e.split(".").pop();return!t||t.includes("/")?"":t},E=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),W=a((({className:e,title:t,image:a,benefits:l})=>n("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[r(s,{className:"font-medium m-0 text-center",children:t}),n("div",{className:"flex justify-center mt-9",children:[a?.src&&r(_,{className:"mr-6",image:a}),l?.length?r("div",{className:"flex flex-col",children:l.map(G)}):null]})]})));function G(e,t){return n("div",{className:"flex flex-row mb-8",children:[e.icon&&r(d,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48"}),n("div",{className:"flex gap-1 flex-col h-full ml-5 max-w-[490px]",children:[e.label&&r("div",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const U={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",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-primary-text",description:"text-secondary-text"}},J=a((({title:e,description:t,blockVersion:a="primary",iconVersion:l,image:i,className:s})=>{const c=U[a];return n("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[l&&"small"===l?X(c.icon):null,l&&"big"===l?Q(i):null,n("div",{className:"py-0.5",children:[e&&r("div",{className:`font-medium text-base mb-1 ${c.title}`,children:e}),t&&r("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function X(e){return r("div",{className:"pt-1.5 pl-1 pr-4",children:r("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function Q(e){return e?.src?r(_,{className:"pt-0.5 pr-3",image:e}):null}const q={Headline:O,LinkDocs:Z,TextBlock:J,PictureText:W},K=a((({label:e,blocks:t,context:a})=>{const[l,i]=a.useState(!1),s=t?.length,c=l?"MinusIcon":"PlusIcon";return n("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[n("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(s?"group cursor-pointer":""),onClick:e=>{if(!s)return;i(!l);const t=ee(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`},children:[r("span",{className:"m-0 text-xl pr-2.5 font-medium "+(s?"group-hover:text-primary-main":""),children:e}),s?r(d,{name:c,width:"24",height:"24"}):null]}),s?r("div",{className:(l?"pb-5":"")+" text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:t?.length?t.map(((e,t)=>Y(e,t,a))):null}):null]})})),Y=(e,t,n)=>{const a=e?.accordionBlockType;if(!a||!(a in q))return null;return r("div",{className:"mb-5 last:mb-0",children:r(q[a],{context:n,...e})},`block_${t}`)},ee=({target:e})=>"BUTTON"===e.tagName?e.nextSibling:e.parentNode.nextSibling,te=a((({title:e,accordionItems:t,context:a,className:l})=>n("section",{className:`p-[50px] font-sans bg-white text-primary-text ${l||""}`,children:[e?r(s,{className:"m-0 mb-2.5",children:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(K,{...e,context:a},`AccordionItem${t}`)))}):null]}))),re=a((({className:e,title:t,benefits:a})=>n("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[t?r(s,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}):null,a?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(ne)}):null]}))),ne=(e,t)=>n("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(d,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),n("div",{children:[r("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),ae=({colData:e,colsLengthForScroll:t,activeCardIndex:r,setActiveCardIndex:n})=>{const a=e?.length&&e.length>t;return{nextClick:()=>n(r+1),prevClick:()=>n(r-1),isScrollAvailable:a,showNextButton:a&&e?.length-r>t,showPrevButton:a&&r>0}},le=a((({className:e,viewBox:t,fill:n="none",width:a,height:l,paths:i,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:l,children:i.map((({d:e,fill:t,...n},a)=>r("path",{d:e,fill:t||"currentColor",...s,...n},a)))}))),ie=[{d:"m9 12 4-4-4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"},{d:"M2 9a1 1 0 0 1 0-2v2Zm6-2a1 1 0 0 1 0 2V7ZM2 7h6v2H2V7Z"}],se=a((({className:e,disabled:t,...n})=>r(D,{rounded:!0,className:`shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main"} ${e||""}`,disabled:t,...n,children:r(le,{paths:ie,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),ce="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",oe="border-main-stroke border-solid border",de="border-main-divider border border-t-0 border-x-0",me="w-[200px] mr-6",he=a((({icon:e,image:t,title:a,link:l})=>n("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${oe} ${ce}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(d,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(_,{className:"mb-[18px]",image:t}),a&&r(s,{size:"S",className:"font-medium m-0 text-center text-white",children:a}),l?.text&&r("div",{className:"mt-auto w-full",children:r(D,{href:l.href,target:l.target,className:"mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:r("div",{className:"font-medium text-xs py-[11px]",children:l.text})})})]}))),xe={comparison:"flex gap-4 duration-1000",tariff:"flex flex-grow duration-1000"},ue=a((({children:e,activeCardIndex:t,columnWidth:n,version:a="comparison"})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:xe[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),pe=a((({cell:e,isFirstRow:t,isLastRow:n,isFillGradient:a})=>r("div",{className:`w-80 box-border flex flex-col ${oe} ${n?"border-t-0 rounded-b-md":"border-y-0"} ${a?ce:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${de} ${a&&t?"border-t":""} ${n?"":"border-solid"}`,children:e.map(((e,t)=>fe(e,t,a)))})}))),fe=({label:e,description:t},a,l)=>n("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(l?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(l?"text-white":"text-secondary-text"),children:t})]},String(a)),be=a((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),ge=a((({row:{header:e,data:t},activeCardIndex:a,isColoredFirstColumn:l,isFirstRow:i,isLastRow:s})=>n(be,{children:[e?.title?r("div",{className:`text-sm py-7 ${de} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(ue,{activeCardIndex:a,columnWidth:336,children:t.map(((e,t)=>r(pe,{cell:e,isFirstRow:i,isLastRow:s,isFillGradient:l&&0===t},String(t))))}):null]}))),ve=a((({className:e,context:t,title:a,rowHeaders:l,columns:i,visibleRowLength:c=0,isColoredFirstColumn:o=!1})=>{const d=t.useRouter(),{handlerDecorator:m}=t,[h,x]=t.useState(0),[u,p]=t.useState(!c),f=i?.map((({header:e})=>e||{})),b=i?.map((({data:e})=>e))||[],g=l?.map(((e,t)=>({header:e,data:b.map((e=>e?.[t]||[{}]))}))).slice(0,u?l.length:c),{nextClick:v,prevClick:N,isScrollAvailable:w,showNextButton:k,showPrevButton:$}=ae({colData:b,colsLengthForScroll:2,activeCardIndex:h,setActiveCardIndex:x});return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[f?.length?n(be,{children:[r("div",{className:me,role:"columnheader",scope:"col"}),r(ue,{activeCardIndex:h,columnWidth:336,children:f.map(((e,t)=>r(he,{...e,link:e.link&&y({router:d,handlerDecorator:m},e.link)},String(t))))})]}):null,g?.length?n("div",{className:"relative",children:[g.map(((e,t,{length:n})=>r(ge,{row:e,isFirstRow:0===t,isLastRow:t+1===n,activeCardIndex:h,isColoredFirstColumn:o},String(t)))),w?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(se,{onClick:v,disabled:!k,ariaLabel:"Пролистать вправо"}),r(se,{className:"mt-4 rotate-180",onClick:N,disabled:!$,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),w?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,c?r("div",{className:"pr-[50px]",children:n("div",{className:"flex w-full",children:[r("div",{className:me}),r("button",{onClick:()=>p(!u),className:"mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:r("div",{className:"font-sans font-medium text-xs py-[11px]",children:u?"Скрыть":"Показать все параметры"})})]})}):null]})}));function Ne(e,t){const{data:r}=e(ye(t),(()=>async function(e){const t=await fetch(ye(e));return await t.json()}(t)));return r||{}}function ye(e){return`/wcms-resources/${e||"credit-calculator-data"}.json`}const we=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],ke=a((({text:e,checked:t,onChange:a,className:l})=>r("div",{className:l,children:n("label",{className:"flex items-center cursor-pointer relative",children:[r("input",{className:"peer appearance-none w-5 h-5 border-solid border rounded border-black checked:bg-primary-main checked:border-primary-main",type:"checkbox",onChange:e=>{a(e.target.checked)},checked:t}),r(le,{paths:we,className:"hidden absolute left-2 ml-px peer-checked:block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"}),e?r("span",{className:"font-sans ml-2 text-sm cursor-pointer",children:e}):null]})}))),$e=e=>new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:3}).format(e),Se=a((({className:e,title:t,items:a=[],min:l=1,max:i=100,step:s=1,value:c=l,onChange:o})=>{const d=e=>{if(!o)return;const t=Number(e.replace(/\D/g,""));o(t)},m={backgroundSize:`${(100*(c-l)/(i-l)).toFixed(2)}% 100%`};return n("div",{className:e,children:[n("label",{className:"block relative",children:[t?r("span",{className:"absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5",children:t}):null,r("input",{className:"m-0 font-sans text-sm w-full h-12 border-2 border-solid border-main-divider rounded-md outline-none p-0 pl-4 m-0 box-border text-primary-text "+(t?"pt-4":""),value:$e(c),onChange:e=>d(e.target.value),onBlur:()=>{o&&(c<l&&o(l),c>i&&o(i))}}),r("div",{className:"absolute inset-x-0 mt-0.5 top-8 px-4",children:r("input",{className:"box-border w-full m-0 cursor-pointer slider",type:"range",min:l,max:i,step:s,value:c,onChange:e=>d(e.target.value),style:m})})]}),r("div",{className:"flex justify-between mt-3 mb-4",children:a.map(((e,t)=>r("span",{className:"text-xs text-secondary-text pl-4",children:e},String(t))))})]})})),Ce=(e,t,r)=>Math.max(t,Math.min(e,r)),Le=3e4,De=3e6,je=Math.round(41.5),_e=a((({context:e,className:t,directoryName:a})=>{const[l,i]=e.useState(void 0),[s,c]=e.useState(void 0),[o,d]=e.useState(!0),[m,h]=e.useState(!0),x=(e=>{const{tableRows:t,isAnnuity:r=!1}=e;return t&&t.find((e=>e.isAnnuity===r))||{}})({tableRows:Ne(e.useAsyncData,a).rows,isAnnuity:o}),u=x.maxSum&&x.minSum?(x.maxSum-x.minSum)/2:1485e3,p=x.maxMonths&&x.minMonths?Math.round((x.maxMonths-x.minMonths)/2):je,f=x?.minSum||Le,b=x?.maxSum||De,g=x?.minMonths||1,v=x?.maxMonths||84,N=(e=>{const{calculatorParams:t,isInsurance:r}=e;return t?r?t?.rateWithInsurance||5:t?.rateWithoutInsurance||5:5})({calculatorParams:x,isInsurance:m}),y=(e=>{const{calculatorParams:t,paymentType:r,rate:n,sum:a,months:l}=e;if(!t)return 0;const i=Ce(a,t.minSum||Le,t.maxSum||De);if("annuity"===r){const e=Number(n)/1200;return i*(e+e/(Math.pow(1+e,l)-1))}return i/l+i*(Number(n)/12)})({calculatorParams:x,paymentType:"annuity",rate:N,sum:l||u,months:s||p}),w=((e,t)=>{const r=Math.ceil((t-e)/12),n=Math.floor(e/12)+1,a=new Array(Math.min(r-1,5)).fill(0).map(((e,t)=>n+t)),l=r+n-1;return a.concat(l)})(g,v);function k(e){c(Ce(12*e,g,v))}return r("section",{className:`font-sans text-primary-text bg-white p-4 ${t}`,children:n("div",{className:"box-border p-12 flex flex-col justify-between border-solid border-3 border-primary-main rounded-md",children:[n("div",{className:"flex justify-between",children:[n("div",{className:"grow mr-11",children:[r(Se,{title:"Желаемая сумма кредита, ₽",items:[`От ${$e(f)} рублей`,`До ${$e(b)} рублей`],min:f,max:b,step:1e3,value:l||u,onChange:i}),r(Se,{title:"Срок кредита, месяцев",items:["Или выберите из предложенных вариантов ниже"],min:g,max:v,step:1,value:s||p,onChange:c}),r("div",{className:"flex mb-7",children:w.map(((e,t)=>function(e,t,a){return r("button",{className:"bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none",onClick:()=>a(e),children:n("span",{className:"font-semibold text-sm",children:[e," ",1===e?"год":e>4?"лет":"года"]})},String(t))}(e,t,k)))}),r(ke,{text:"Получаю пенсию на карту Россельхозбанка",checked:o,onChange:d}),r(ke,{className:"mb-4",text:"Комплексная страховая защита",checked:m,onChange:h})]}),n("div",{className:"p-9 bg-primary-main rounded-md text-white",children:[r("div",{className:"text-base mb-5",children:"Наше предложение"}),r("div",{className:"text-sm opacity-60",children:"Ежемесячный платёж"}),n("div",{className:"text-lg mb-3",children:[$e(Math.round(y))," ₽"]}),r("div",{className:"text-sm opacity-60",children:"Ставка"}),n("div",{className:"text-lg",children:[N," %"]})]})]}),n("div",{className:"flex items-center",children:[r(D,{className:"mr-3",text:"Отправить заявку",version:"primary",href:"#"}),r("div",{className:"w-80 text-xxs leading-4 text-secondary-text","aria-label":"Соглашение на обработку персональных данных",children:"Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно требованиям ФЗ «О персональных данных»"})]})]})})}));const Te={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},Re=a((e=>{const{children:t,className:n,version:a="primary"}=e;return r("section",{className:`font-sans p-9 box-border ${n||""} ${Te[a]} ${Ie(n)} ${Me(n)} `,children:r(A,{...e,children:t})})}));function Ie(e=""){const t=R(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}function Me(e=""){const t=R(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}const Ae="https://www.cbr-xml-daily.ru/daily_json.js",Be=["USD","EUR"],Pe={USD:"DollarIcon",EUR:"EuroIcon"},Oe=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],Fe=a((({className:e,context:t,title:a})=>{const{data:l}=t.useAsyncData(Ae,Ze);return r(Re,{className:e,context:t,title:a||"Курсы обмена валют",buttons:Oe,children:n("table",{children:[r("thead",{children:n("tr",{children:[r(He,{children:"Валюта"}),r(He,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:Be.map((e=>{const t=(l?.Valute||{})[e]?.Value;return n("tr",{children:[r(Ve,{className:"pt-4",children:n("div",{className:"flex items-center",children:[r(d,{name:Pe[e],width:"24",height:"24"}),r("span",{className:"ml-2",children:e})]})}),r(Ve,{className:"pt-4 pl-11",children:Ee(t)})]},e)}))})]})})})),He=a((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),Ve=a((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function Ze(){const e=await fetch(Ae);return await e.json()}const ze=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),Ee=e=>e?ze.format(e):"",We=["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"],Ge=a((({className:e,href:t,children:a,targetBlank:l})=>n("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:l?"_blank":"_self",children:[r(le,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:We.map((e=>({d:e})))}),r("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),Ue=a((({className:e,context:t})=>{const{term:a,setTerm:l}=t.useSearch(),[i,s]=t.useState(!1);return n("form",{className:`relative ${e||""}`,children:[n("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[r("div",{className:"w-[24px] h-[24px]",children:r(d,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&r("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{id:"search-bar-input",className:(i?"border-primary-text":"")+" pr-32 h-12 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=>l(e.target.value),onFocus:e=>s(!0),onBlur:e=>s(!1),type:"text",name:"search-bar-input"}),i&&r("button",{type:"submit",version:"primary",className:"absolute font-sans font-normal cursor-pointer text-sm hover:bg-primary-hover active:bg-primary-active border-none px-9 py-[9px] rounded top-1 right-1 outline-none text-secondary-text text-white bg-primary-main",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),Je=a((({className:e,items:t,hasButton:a,context:l})=>{const i=l.useRouter(),{handlerDecorator:s}=l;return n("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(Xe):null,a?r(D,{version:"primary",className:"my-4",...y({router:i,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Xe=(e,t)=>{const{type:a,text:l,description:i}=e;return n("div",{className:"mb-4",children:[r("div",{children:Qe(a,l)}),r("div",{className:"font-sans text-sm text-secondary-text",children:i})]},String(t))},Qe=(e,t="")=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${qe(t)}`,children:t});case"email":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return r("span",{children:t})}},qe=e=>e.replaceAll(/\D/g,""),Ke=a((({className:e,links:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:l}=n;return r("div",{className:`${e||""}`,children:t?.length?r("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)=>r(Ye,{index:t,...y({router:a,handlerDecorator:l},e)},String(t))))}):null})})),Ye=a((({className:e,index:t,text:n,href:a,target:l,onClick:i})=>r("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:l,onClick:i,children:n||`Документ ${t}`})));function et(e){const{data:t}=e(rt(),tt);return t||{}}async function tt(){const e=await fetch(rt());return await e.json()}function rt(){return`/wcms-resources/${o.SITEMAP||"sitemap"}.json`}const nt=e=>t=>e?.href===t?.href;function at(e,t){return(n=e,a=t,(n||[]).map((e=>a?.find(nt(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find(nt(e))))));var r,n,a}const lt=a((({className:e,items:t,context:n})=>{const a=at(et(n.useAsyncData).topItems,t),l={router:n.useRouter(),handlerDecorator:n.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>it(e,t,l)))})})),it=(e,t,{router:a,handlerDecorator:l})=>{const{text:i,href:s,items:c,target:o}=e;return n("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:i||`Раздел ${t}`}),c?.map(((e,t)=>r(st,{...y({router:a,handlerDecorator:l},e)},String(t))))]},String(t))},st=a((({text:e,href:t,target:n,index:a})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:n||"_self",children:e||`Раздел ${a}`}))),ct=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм",width:"20px",height:"16px"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте",width:"24px",height:"12px"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники",width:"12px",height:"20px"}],ot=a((({className:e,media:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:l}=n;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(dt,{...y({router:a,handlerDecorator:l},e)},String(t))))})})),dt=a((({href:e})=>{const{icon:t,label:n,width:a,height:l}=ct.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?r("a",{className:"flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[38px] h-[38px] hover:fill-primary-main",href:e,target:"_blank",rel:"noopener noreferrer",children:d&&r(d,{name:t,width:a,height:l,asSVG:!0,className:"block"})}):null})),mt=a((({className:e,links:t,context:a})=>{const l=a.useRouter(),{handlerDecorator:i}=a;return n("div",{className:`${e||""}`,children:[r("div",{className:"pt-5 pb-[5px]",children:r("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?r("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>r(ht,{index:t,...y({router:l,handlerDecorator:i},e)},String(t))))}):null]})})),ht=a((({className:e,index:t,text:n,href:a,target:l,onClick:i})=>r("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:l,onClick:i,children:n||`Документ ${t}`}))),xt=a((({className:e,documents:t,relatedEnterprises:a,contacts:l,socialMedia:i,topItems:s,context:c})=>n("footer",{className:`${e} px-9 py-10 bg-white`,children:[n("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[r(Ge,{className:"w-[280px] xl:w-[220px]"}),r(Ue,{context:c,className:"grow"})]}),n("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[r(Je,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:l,context:c,hasButton:!0}),r(lt,{className:"pt-[3px]",context:c,items:s})]}),r(ot,{media:i,context:c}),r(Ke,{links:a,context:c}),r(mt,{links:t,context:c})]}))),ut={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},pt={normal:380,mini:276},ft={normal:3,mini:4},bt=a((({title:e,description:t,context:a,cards:l=[],className:i,version:c="normal"})=>{const[o,d]=a.useState(0);const m=l?.length>ft[c],h=m&&l?.length-o>ft[c],x=m&&o>0;return n("section",{className:`relative font-sans text-primary-text bg-white p-12 py-[50px] overflow-hidden ${i}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[e?r(s,{className:"font-medium m-0 text-center",children:e}):null,t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:`flex ${l?.length<=ft[c]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${o*pt[c]}px)`},role:"list",children:l?.map(((e,t)=>function(e,t,a){return n("div",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${ut[a]} w-full`,role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(_,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.items.map(gt)}):null]}),e.href?r(D,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},String(t))}(e,t,c)))}),r("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),x&&r(se,{className:"absolute top-1/2 left-8 rotate-180",onClick:function(){d(o-1)},ariaLabel:"Пролистать влево"}),h&&r(se,{className:"absolute top-1/2 right-1 z-10",onClick:function(){d(o+1)},ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})}));function gt(e,t){return r($,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))}const vt=a((e=>r(bt,{...e,version:"normal"}))),Nt=a((({className:e,text:t,href:a,target:l,active:i,onClick:s,children:c})=>n("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:l,onClick:s,children:[r("span",{className:`font-sans font-normal text-base ${i?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),i?r("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),yt=a((({className:e,text:t,href:n,target:a,active:l,flat:i,onClick:s,children:c,ariaLabel:o})=>r("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${i?"":"px-4 py-2"} ${l?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:n,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:`font-sans font-normal text-sm ${l?"text-primary-main":(i?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),wt=a((({className:e,children:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":n,children:t}))),kt=a((({context:e,className:t,defaultLocation:a=""})=>{const[l,i]=e.useGeolocation(a);return n("div",{className:`flex items-center ${t||""}`,children:[r(yt,{className:"mr-5",flat:!0,href:"#",text:l,ariaLabel:"Местоположение",onClick:i}),r(yt,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),r(wt,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:r(d,{name:"LoupeIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(wt,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:r(d,{name:"ProfileIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(wt,{className:"min-w-[32px] min-h-[32px] fill-secondary-light hover:fill-secondary-hover",ariaLabel:"Дополнительные ссылки",children:r(d,{name:"GridIcon","aria-hidden":"true",className:"h-full",asSVG:!0})})]})}));const $t=a((({className:e,defaultLocation:t,context:a,topItems:l})=>{const i=a.useRouter(),s=et(a.useAsyncData),{handlerDecorator:c}=a,o=at(s.topItems,l),d=o.find(function(e){return t=>x(t.href,e,((e,t)=>t.startsWith(e)))}(i)),m=d?.items,h=m?.find(function(e){return t=>x(t.href,e)}(i)),u=o.map(((e,t)=>r(yt,{active:e===d,...y({router:i,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),p=m?.map((e=>r(Nt,{className:"mr-8",active:e===h,...y({router:i,handlerDecorator:c},e)},e.href)));return n("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:[n("div",{className:"flex items-center",children:[r(Ge,{className:"mr-8"}),u,r(kt,{context:a,className:"ml-auto",defaultLocation:t})]}),r("div",{className:"mt-5 h-[1px] bg-main-divider"}),r("nav",{className:"mt-5",children:p})]})})),St=a((e=>r(bt,{...e,version:"mini"}))),Ct=a((({className:e,context:t,title:a="Мобильное приложение",qr:l,buttons:i=[]})=>r(Re,{className:e,context:t,title:a,buttons:i,children:n("div",{className:"flex items-center",children:[l?.src&&l?.href&&r("a",{href:l.href,target:"_blank",children:r("img",{src:l.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),r("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Lt=a((({className:e,context:t,title:n})=>r(Re,{className:e,context:t,title:n,description:"Блок в разработке...",children:r("figure",{className:"m-0 min-w-[600px]",children:Dt()})}))),Dt=(e=3)=>_t(100,e).map((e=>Math.floor(e))).map(jt),jt=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),_t=(e,t)=>[e].concat(t>0?_t(e/1.618,t-1):[]),Tt=a((({className:e,context:t,title:a,titleSize:l,description:i,benefits:s,buttons:c,image:o,items:d})=>n("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[r("div",{className:"flex flex-col",children:r(A,{context:t,title:a,titleSize:l||"XL",description:i,items:d,buttons:c,children:s?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(Rt)}):null})}),o?.src&&r(_,{className:"mt-auto",image:o})]})));function Rt(e,t){return n("div",{className:"flex gap-4 items-center",children:[e.icon&&r(d,{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"}),n("div",{className:"flex gap-1 flex-col h-full",children:[r("h4",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const It=a((({text:e,href:t,target:n,onClick:a,className:l,children:i})=>t?r("a",{className:`no-underline ${l||""}`,href:t,target:n,onClick:a,children:r("span",{className:`${l||""}`,children:e||i})}):r("span",{className:`${l||""}`,children:e||i})));function Mt(e){return t=>t.reduce(((t,r,n)=>t.length?t.concat({...e,key:n},r):[r]),[])}const At=a((e=>{const{context:t,className:a,breadcrumbs:l}=e,i=t.useRouter(),{handlerDecorator:s}=t;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${a||""}`,children:[l?.length?r("div",{className:"text-xs mb-6",children:Mt(r("span",{className:"text-secondary-text mx-2",children:"/"}))(l.map(((e,t)=>r(It,{...y({router:i,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,r(Tt,{...e})]})})),Bt=a((({className:e,context:t,duration:a=0,slides:l=[]})=>{const i=l.map((e=>e.nav)),s=l.map((e=>e.productBlock)),[c,o]=t.useState(0);return n("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[r("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,n)=>function(e,t,n){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(Tt,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:n,...e})})},String(t))}(e,n,t)))}),r("div",{className:"flex",children:i.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:l,duration:i}){const s=t===a,c=s?"animate-slide":"";return n("button",{type:"button",onClick:l,className:"font-sans group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 pt-4 pb-5 grow basis-0",children:[n("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[r("div",{className:"text-sm font-medium pb-1 group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),r("div",{className:"text-xs text-secondary-text pb-[2px]",children:e.desc})]}),r("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${i}s`,animationFillMode:"forwards"}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const Pt=a((e=>{const{benefits:t,version:a}=e;return r(Re,{...e,children:n("div",{className:"flex mt-5 mb-1",children:[t?.length?r("div",{className:"mr-8",children:t.map(Ot)}):null,t?.length?r("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,n="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[n]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function Ot(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const Ft=a((({className:e,context:t,title:a="Акции и спецпредложения",date:l,description:i,buttons:s=[],version:c})=>r(Re,{className:e,context:t,title:a,buttons:s,version:c,children:n("div",{className:"mt-1.5",children:[l&&r("div",{className:"text-sm mb-2",children:Ht(l)}),r("div",{className:"text-base",children:i})]})})));function Ht(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const Vt=a((({className:e,title:t,steps:a})=>n("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{children:[r("div",{className:"flex mt-9 items-center px-[88px]",children:Mt(r("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>Zt(e,t))))}),r("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(zt)})]}):null]}))),Zt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative",children:r("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&&r(d,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),zt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:n("div",{className:"max-w-min",children:[r("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),Et="border-main-divider border border-t-0 border-x-0",Wt=a((({cell:e,isLastRow:t})=>r("div",{className:"first:pl-0 pl-10 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0 "+(t?"border-t-0 rounded-b-md":""),role:"cell",children:r("div",{className:`h-full ${Et}`,children:e.map(((e,t)=>Gt(e,t)))})}))),Gt=({label:e,description:t,list:a,image:l,buttons:i},s)=>n("div",{className:"first:pt-5 last:pb-5",children:[s>0&&r("div",{className:"border-main-divider border border-solid border-t-0 border-x-0 my-4"}),e&&r("div",{className:"text-xl font-medium m-0",children:e}),t&&r("div",{className:"text-sm text-secondary-text",children:t}),a?.items?.length?r("div",{className:"flex flex-col justify-between items-start",children:r("div",{role:"list",children:a.items.map(((e,t)=>r($,{text:e,version:a.version??"secondary",isDotted:a.isDotted??!0},String(t))))})}):null,l&&r(_,{image:l}),i?.length?i.map((({icon:e,...t},n)=>r(D,{className:(n>0?"ml-3":"")+" w-12 h-12",appendLeft:e&&r(d,{name:e,width:"24px",height:"24px"}),...t},String(n)))):null]},String(s)),Ut=a((({row:{header:e,data:t},activeCardIndex:a,isLastRow:l})=>n(be,{children:[r("div",{className:`text-sm py-5 w-[354px] flex-shrink-0 ${Et} ${l?"":"border-solid"}`,children:n("div",{className:"flex items-center text-primary-text",children:[e?.icon&&r(d,{className:"pr-[14px]",name:e.icon,width:"24px",height:"24px"}),e?.title]})}),t?.length?r(ue,{activeCardIndex:a,columnWidth:360,version:"tariff",children:t.map(((e,t)=>r(Wt,{cell:e,isLastRow:l},String(t))))}):null]}))),Jt=a((({className:e,context:t,title:a,rowHeaders:l,columns:i})=>{const[c,o]=t.useState(0),d=i?.map((({data:e})=>e))||[],m=l?.map(((e,t)=>({header:e,data:d.map((e=>e?.[t]||[{}]))}))),{nextClick:h,prevClick:x,isScrollAvailable:u,showNextButton:p,showPrevButton:f}=ae({colData:d,colsLengthForScroll:2,activeCardIndex:c,setActiveCardIndex:o});return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[m?.length?n("div",{className:"relative",children:[m.map(((e,t,{length:n})=>r(Ut,{row:e,isLastRow:t+1===n,activeCardIndex:c},String(t)))),u?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(se,{onClick:h,disabled:!p,ariaLabel:"Пролистать вправо"}),r(se,{className:"mt-4 rotate-180",onClick:x,disabled:!f,ariaLabel:"Пролистать влево"})]})}):null]}):null,u?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null]})]})})),Xt={Accordion:te,BenefitsBlock:re,ComparisonTable:ve,CreditCalculator:_e,ExchangeRateTile:Fe,Footer:xt,Gallery:vt,Header:$t,Headline:O,LinkDocs:Z,MiniGallery:St,MobileAppTile:Ct,PictureText:W,Placeholder:Lt,ProductBlock:At,ProductGallery:Bt,ProductTile:Pt,PromoTile:Ft,StepsBlock:Vt,TariffsTable:Jt,TextBlock:J,Tile:Re},Qt=a((({className:e,onClick:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:qt()}))),qt=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r("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"}),r("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"})]})},Kt=a((({className:e,context:t})=>{const a=t.useLikeService();return n("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:[r(Qt,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),r(Qt,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:a.likeCount})]})})),Yt=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),er=a((({className:e,context:t,blocksRegistry:a,data:{style:l,blocks:i,likeControl:s,colorPalette:c="pc"},blockDecorator:o=Yt})=>n("section",{className:"relative","data-theme":c,children:[r("div",{className:`grid grid-cols-12 gap-1 ${tr(l)} ${e||""}`,children:i?.length?i.map((function e(n,l){const{type:i}=n;i in a||console.warn(`No block with "${i}" is registered`);const s=a[i]||Lt;return o({blockClassName:tr(n.style),block:n,render:n=>{const{version:a,content:c,blocks:o}=n.block;return r(s,{className:n.blockClassName,version:a,context:t,...c,children:o?.length?o.map(e):null},`${i}-${l}`)}},`block-${l}`)})):null}),s&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(Kt,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})));function tr(e){return e?e.join(" "):""}const rr=a((({HeadComponent:e,data:t,children:a})=>{const{title:l,description:i,keywords:s,robots:c,og:o}=t;return n(e,{children:[r("title",{children:l}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),i&&r("meta",{name:"description",content:i}),s&&r("meta",{name:"keywords",content:s.join(",")}),c&&r("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null,a]})}));function nr(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const ar=a((({className:e,context:t})=>r("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:r(mt,{context:t})}))),lr=a((({title:e,description:t,cards:a=[],className:l})=>n("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${l}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[r(s,{className:"font-medium m-0 text-centers",children:e}),t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(ir)})]})));function ir(e,t){return n("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:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(_,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?sr(e.items):null]}),e.href?r(D,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function sr(e=[]){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>r($,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const cr=a((({titleSize:e,image:t,benefits:n,...a})=>{const{className:l}=a;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${l||""}`,children:r(Tt,{...a,titleSize:"L"})})})),or={ExchangeRateTile:Fe,Footer:ar,Gallery:lr,Header:$t,Headline:O,MobileAppTile:Ct,PictureText:W,Placeholder:Lt,ProductBlock:cr,ProductTile:Pt,TextBlock:J,Tile:Re};e.Blocks=Xt,e.ContentPage=er,e.ContentPageHead=rr,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))))))(),r=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await r.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function r(){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:r,name:n}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:r,name:n})),{token:r,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...n){if(!n.length)return[];const{token:a}=await r();try{const r=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:n})}),{likes:l}=await r.json();return l||[]}catch(e){return console.error(e),[]}},like:async function(n){if(!n)return 0;const{token:a,name:l}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:l},body:JSON.stringify({node_id:n,user_name:l})}),{likes:i}=await r.json();return i||0}catch(e){return console.error(e),0}},dislike:async function(n){if(!n)return 0;const{token:a,name:l}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:l},body:JSON.stringify({node_id:n,user_name:l})}),{likes:i}=await r.json();return i||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=or,e.joinList=Mt,e.projectSettings=o,e.setup=t,e.toMobilePage=function(e){const t=e.blocks?.filter((({mobile:e})=>!e?.hidden)).map(nr);return{...e,blocks:t}},e.url=v,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,r)=>{t._jsx=e,t._jsxs=r||e};t.vue=e=>{t(((t,{children:r,dangerouslySetInnerHTML:n,...a}={})=>{const l=Object.assign({},a,n?{innerHTML:n.__html}:{});return e(t,l,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),n=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:n,...a}=t||{},l=r?.slots?.default,i=n||l&&l();return e(Object.assign(a,i&&{children:i}),r)},e._tmpl.inheritAttrs=!1),e._tmpl);const l="likesToken";var i;!function(e){e.XL="text-title-lg",e.L="text-title",e.M="text-title-sm",e.S="text-title-xs"}(i||(i={}));const s=a((({size:e="L",className:t,children:n,...a})=>r("XL"===e?"h1":"h2",{className:c(i[e],t),...a,children:n}))),c=(...e)=>e.filter(Boolean).join(" "),o=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}},d=a((({className:e,name:t,alt:a=`Icon ${t}`,title:l=a,asSVG:i,...s})=>{const c=`${o.CDN||""}icons/${t}.svg`;return i?n("svg",{className:e,...s,"aria-hidden":"true",children:[l?r("title",{children:l}):null,a?r("desc",{children:a}):null,r("use",{href:`${c}#icon`,xlinkHref:`${c}#icon`})]}):r("img",{className:e,src:c,alt:a,title:l,...s,"aria-hidden":"true"})})),m="/mobile",h=e=>e?.includes("//"),x=(e,t,r=((e,t)=>e===t))=>r(u(e),p(u(h(e)?t.href:t.pathname))),u=e=>(e||"").replace(/\/?\?.*/,""),p=e=>(e||"").replace(m,""),f=e=>{if(!h(e))return;const t=e,r=t.indexOf("//"),n=t.indexOf("/",r+"//".length);return-1!==n?t.substring(0,n):t},b=(e,t)=>{if(!e)return e;const r=g(e,t),n=t?.pathname.startsWith(m);return n&&!h(r)?`/mobile${r}`:r},g=(e,t)=>{if(!e)return e;const r=f(t?.href);return r?e.replace(r,"")||"/":e};var v=Object.freeze({__proto__:null,MOBILE_URL_PATH:m,isURL:h,isHrefActive:x,withoutQuery:u,withoutMobilePath:p,getOrigin:f,adjustHref:b,toRelativeHref:g});const N=e=>e;function y({router:e,handlerDecorator:t=N},r){const n=b(r.href,e);return{...r,href:n,ariaLabel:r.text,onClick:t((t=>{const a=n&&!h(n),l=!r.target||"_self"===r.target;a&&l&&(t.preventDefault(),e.push(n))}),r)}}const w={primary:"bg-primary-main w-[8px] h-[8px] min-w-[8px] min-h-[8px] mt-2 rounded-full",secondary:"bg-secondary-text w-[6px] h-[6px] min-w-[6px] min-h-[6px] mt-2.5 rounded-full"},k={primary:"text-primary-text",secondary:"text-secondary-text"},$=a((({className:e,isDotted:t=!0,text:a,children:l,version:i="primary"})=>n("div",{className:`inline-block flex ${e||""}`,role:"listitem",children:[t&&r("div",{className:`inline-block mr-3 ${w[i]}`}),r("span",{className:`text-base font-normal font-sans mr-3 ${k[i]}`,children:a||l})]}))),S={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"},C={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text"},L="inline-block text-center font-sans select-none",D=a((({className:e,text:t,aboveText:n,appendLeft:a,href:l,target:i,onClick:s,children:c,disabled:o,rounded:d,version:m="none",ariaLabel:h,...x})=>{const u=c??r(j,{text:t,aboveText:n,appendLeft:a,rounded:d});return o?r("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`${L} ${C[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,children:u}):r("a",{className:`${L} cursor-pointer no-underline ${S[m]||""} ${d?"rounded-full":"rounded-md"} ${e||""}`,href:l,target:i,onClick:s,"aria-label":h,role:l?"link":"button",...x,children:u})})),j=a((({text:e,aboveText:t,appendLeft:a,rounded:l})=>{const i=!e&&!t&&Boolean(a);return n("div",{className:`flex items-center justify-center ${i?"h-12 w-12 min-h-12 min-w-12":"px-8 gap-2 "+(t?"py-2":"py-[13px]")} ${l?"rounded-full":""}`,children:[a||null,i?null:n("div",{children:[r("div",{className:"text-xxs text-left",children:t}),r("div",{className:"text-sm font-medium text-left",children:e})]})]})})),_=a((({className:e,image:t})=>n("picture",{className:`${e||""}`,children:[t.sources?.length?t.sources.map((({src:e,format:t},n)=>r("source",{srcSet:e,type:R(t)},`${n}_${e}`))):null,r("img",{src:t.src,alt:t.alt||t.title,title:t.title,...t?.size})]})));function R(e){return e?`image/${String(e)}`:void 0}const T=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12},I={left:"items-start",center:"items-center",right:"items-end"},M={left:"text-left",center:"text-center",right:"text-right"},A=a((({className:e,context:t,title:a,titleSize:l,description:i,children:c,buttons:o,image:m,items:h,version:x="primary",align:u="left"})=>{const p=t.useRouter(),{handlerDecorator:f}=t;return n("div",{className:`font-sans flex flex-col grow h-full ${I[u]}`,children:[a&&r(s,{size:l||B(e),className:"font-medium m-0 mb-4 whitespace-pre-wrap max-w-[600px] "+("primary"===x?"text-primary-text":""),children:a}),n("div",{className:"flex grow justify-between w-full",children:[n("div",{className:`flex flex-col justify-between ${I[u]}`,children:[n("div",{children:[i?r("div",{className:`font-normal text-base max-w-[600px] ${M[u]}`,children:i}):null,c,h?.length?P(h,x):null]}),o?.length?r("div",{className:"flex mt-9 gap-3",children:o.map(((e,t)=>function({icon:e,...t},n){if(!t?.text)return;return r(D,e?{appendLeft:r(d,{name:e,width:"24",height:"24"}),...t}:{...t},String(n))}(y({router:p,handlerDecorator:f},e),t)))}):null]}),m?.src&&r(_,{className:"mt-auto ml-7",image:m})]})]})}));function B(e=""){const t=T(e);return t<=4?"S":t<=8?"M":"L"}function P(e=[],t){return r("section",{className:"max-w-[600px] mt-5",role:"list",children:e.map(((e,n)=>r($,{className:n?"mt-2.5":"",text:e,version:t},String(n))))})}const O=a((({bgColor:e="bg-white",className:t,...n})=>r("section",{className:`p-10 ${e} ${t||""} `,children:r(A,{...n})}))),F={left:"text-left",center:"text-center",right:"text-right"},H={double:"mb-8",single:"mb-[26px]"},V={double:"gap-x-5 gap-y-[26px] flex-wrap",single:"gap-3.5 flex-col"},Z=a((({className:e,title:t,align:a,documents:l,icon:i,columnsMode:c="double"})=>{const o=V[c];return n("section",{className:`font-sans p-[50px] bg-white ${e}`,children:[t&&r(s,{className:`font-medium mt-0 ${H[c]} ${F[a??"center"]}`,children:t}),r("div",{className:`flex ${o}`,role:"list",children:l?.length?l.map((({text:e,fileSize:t,...a},l)=>n("a",{className:"group flex text-sm align-middle h-fit\n text-primary-text no-underline hover:text-primary-main\n "+("double"===c?"basis-[calc(50%-20px)]":""),role:"listitem",...a,children:[i&&r(d,{className:"mr-2.5",name:i,width:"24px",height:"24px"}),n("span",{className:"self-center",children:[e,r("span",{className:"text-secondary-text group-hover:text-primary-main",children:a?.href&&E(z(a.href),t)})]})]},String(l)))):null})]})})),z=e=>{if(!e)return"";const t=e.split(".").pop();return!t||t.includes("/")?"":t},E=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),W=a((({className:e,title:t,image:a,benefits:l})=>n("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[r(s,{className:"font-medium m-0 text-center",children:t}),n("div",{className:"flex justify-center mt-9",children:[a?.src&&r(_,{className:"mr-6",image:a}),l?.length?r("div",{className:"flex flex-col",children:l.map(G)}):null]})]})));function G(e,t){return n("div",{className:"flex flex-row mb-8",children:[e.icon&&r(d,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48"}),n("div",{className:"flex gap-1 flex-col h-full ml-5 max-w-[490px]",children:[e.label&&r("div",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const U={primary:{background:"bg-white",icon:"bg-primary-main text-white",title:"text-primary-text",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-primary-text",description:"text-secondary-text"}},J=a((({title:e,description:t,blockVersion:a="primary",iconVersion:l,image:i,className:s})=>{const c=U[a];return n("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:[l&&"small"===l?X(c.icon):null,l&&"big"===l?Q(i):null,n("div",{className:"py-0.5",children:[e&&r("div",{className:`font-medium text-base mb-1 ${c.title}`,children:e}),t&&r("div",{className:`text-sm ${c.description}`,children:t})]})]})}));function X(e){return r("div",{className:"pt-1.5 pl-1 pr-4",children:r("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function Q(e){return e?.src?r(_,{className:"pt-0.5 pr-3",image:e}):null}const q={Headline:O,LinkDocs:Z,TextBlock:J,PictureText:W},K=a((({label:e,blocks:t,context:a})=>{const[l,i]=a.useState(!1),s=t?.length,c=l?"MinusIcon":"PlusIcon";return n("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[n("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(s?"group cursor-pointer":""),onClick:e=>{if(!s)return;i(!l);const t=ee(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`},children:[r("span",{className:"m-0 text-xl pr-2.5 font-medium "+(s?"group-hover:text-primary-main":""),children:e}),s?r(d,{name:c,width:"24",height:"24"}):null]}),s?r("div",{className:(l?"pb-5":"")+" text-sm transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:t?.length?t.map(((e,t)=>Y(e,t,a))):null}):null]})})),Y=(e,t,n)=>{const a=e?.accordionBlockType;if(!a||!(a in q))return null;return r("div",{className:"mb-5 last:mb-0",children:r(q[a],{context:n,...e})},`block_${t}`)},ee=({target:e})=>"BUTTON"===e.tagName?e.nextSibling:e.parentNode.nextSibling,te=a((({title:e,accordionItems:t,context:a,className:l})=>n("section",{className:`p-[50px] font-sans bg-white text-primary-text ${l||""}`,children:[e?r(s,{className:"m-0 mb-2.5",children:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(K,{...e,context:a},`AccordionItem${t}`)))}):null]}))),re=a((({className:e,title:t,benefits:a})=>n("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[t?r(s,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}):null,a?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:a.map(ne)}):null]}))),ne=(e,t)=>n("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(d,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),n("div",{children:[r("h3",{className:"font-medium text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm mt-2",children:e.description})]})]},String(t)),ae=({colData:e,colsLengthForScroll:t,activeCardIndex:r,setActiveCardIndex:n})=>{const a=e?.length&&e.length>t;return{nextClick:()=>n(r+1),prevClick:()=>n(r-1),isScrollAvailable:a,showNextButton:a&&e?.length-r>t,showPrevButton:a&&r>0}},le=a((({className:e,viewBox:t,fill:n="none",width:a,height:l,paths:i,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:l,children:i.map((({d:e,fill:t,...n},a)=>r("path",{d:e,fill:t||"currentColor",...s,...n},a)))}))),ie=[{d:"m9 12 4-4-4-4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none"},{d:"M2 9a1 1 0 0 1 0-2v2Zm6-2a1 1 0 0 1 0 2V7ZM2 7h6v2H2V7Z"}],se=a((({className:e,disabled:t,...n})=>r(D,{rounded:!0,className:`shadow-[0_4px_25px_rgba(0,0,0,0.07)] w-12 h-12 min-h-12 max-h-12 flex items-center justify-center ${t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main"} ${e||""}`,disabled:t,...n,children:r(le,{paths:ie,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),ce="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",oe="border-main-stroke border-solid border",de="border-main-divider border border-t-0 border-x-0",me="w-[200px] mr-6",he=a((({icon:e,image:t,title:a,link:l})=>n("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${oe} ${ce}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(d,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(_,{className:"mb-[18px]",image:t}),a&&r(s,{size:"S",className:"font-medium m-0 text-center text-white",children:a}),l?.text&&r("div",{className:"mt-auto w-full",children:r(D,{href:l.href,target:l.target,className:"mt-4 w-full text-primary-main bg-white hover:bg-secondary-hover active:bg-secondary-active",children:r("div",{className:"font-medium text-xs py-[11px]",children:l.text})})})]}))),xe={comparison:"flex gap-4 duration-1000",tariff:"flex flex-grow duration-1000"},ue=a((({children:e,activeCardIndex:t,columnWidth:n,version:a="comparison"})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:xe[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),pe=a((({cell:e,isFirstRow:t,isLastRow:n,isFillGradient:a})=>r("div",{className:`w-80 box-border flex flex-col ${oe} ${n?"border-t-0 rounded-b-md":"border-y-0"} ${a?ce:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${de} ${a&&t?"border-t":""} ${n?"":"border-solid"}`,children:e.map(((e,t)=>fe(e,t,a)))})}))),fe=({label:e,description:t},a,l)=>n("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(l?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(l?"text-white":"text-secondary-text"),children:t})]},String(a)),be=a((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),ge=a((({row:{header:e,data:t},activeCardIndex:a,isColoredFirstColumn:l,isFirstRow:i,isLastRow:s})=>n(be,{children:[e?.title?r("div",{className:`text-sm py-7 ${de} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(ue,{activeCardIndex:a,columnWidth:336,children:t.map(((e,t)=>r(pe,{cell:e,isFirstRow:i,isLastRow:s,isFillGradient:l&&0===t},String(t))))}):null]}))),ve=a((({className:e,context:t,title:a,rowHeaders:l,columns:i,visibleRowLength:c=0,isColoredFirstColumn:o=!1})=>{const d=t.useRouter(),{handlerDecorator:m}=t,[h,x]=t.useState(0),[u,p]=t.useState(!c),f=i?.map((({header:e})=>e||{})),b=i?.map((({data:e})=>e))||[],g=l?.map(((e,t)=>({header:e,data:b.map((e=>e?.[t]||[{}]))}))).slice(0,u?l.length:c),{nextClick:v,prevClick:N,isScrollAvailable:w,showNextButton:k,showPrevButton:$}=ae({colData:b,colsLengthForScroll:2,activeCardIndex:h,setActiveCardIndex:x});return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[f?.length?n(be,{children:[r("div",{className:me,role:"columnheader",scope:"col"}),r(ue,{activeCardIndex:h,columnWidth:336,children:f.map(((e,t)=>r(he,{...e,link:e.link&&y({router:d,handlerDecorator:m},e.link)},String(t))))})]}):null,g?.length?n("div",{className:"relative",children:[g.map(((e,t,{length:n})=>r(ge,{row:e,isFirstRow:0===t,isLastRow:t+1===n,activeCardIndex:h,isColoredFirstColumn:o},String(t)))),w?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(se,{onClick:v,disabled:!k,ariaLabel:"Пролистать вправо"}),r(se,{className:"mt-4 rotate-180",onClick:N,disabled:!$,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),w?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,c?r("div",{className:"pr-[50px]",children:n("div",{className:"flex w-full",children:[r("div",{className:me}),r("button",{onClick:()=>p(!u),className:"mt-5 flex-1 border-main-stroke border-solid border text-primary-text bg-white hover:border-primary-main hover:text-primary-main",children:r("div",{className:"font-sans font-medium text-xs py-[11px]",children:u?"Скрыть":"Показать все параметры"})})]})}):null]})}));function Ne(e,t){const{data:r}=e(ye(t),(()=>async function(e){const t=await fetch(ye(e));return await t.json()}(t)));return r||{}}function ye(e){return`/wcms-resources/${e||"credit-calculator-data"}.json`}const we=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],ke=a((({text:e,checked:t,onChange:a,className:l})=>r("div",{className:l,children:n("label",{className:"flex items-center cursor-pointer relative",children:[r("input",{className:"peer appearance-none w-5 h-5 border-solid border rounded border-black checked:bg-primary-main checked:border-primary-main",type:"checkbox",onChange:e=>{a(e.target.checked)},checked:t}),r(le,{paths:we,className:"hidden absolute left-2 ml-px peer-checked:block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"}),e?r("span",{className:"font-sans ml-2 text-sm cursor-pointer",children:e}):null]})}))),$e=e=>new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:3}).format(e),Se=a((({className:e,title:t,items:a=[],min:l=1,max:i=100,step:s=1,value:c=l,onChange:o})=>{const d=e=>{if(!o)return;const t=Number(e.replace(/\D/g,""));o(t)},m={backgroundSize:`${(100*(c-l)/(i-l)).toFixed(2)}% 100%`};return n("div",{className:e,children:[n("label",{className:"block relative",children:[t?r("span",{className:"absolute text-xs text-secondary-text top-1 mt-0.5 pl-4 ml-0.5",children:t}):null,r("input",{className:"m-0 font-sans text-sm w-full h-12 border-2 border-solid border-main-divider rounded-md outline-none p-0 pl-4 m-0 box-border text-primary-text "+(t?"pt-4":""),value:$e(c),onChange:e=>d(e.target.value),onBlur:()=>{o&&(c<l&&o(l),c>i&&o(i))}}),r("div",{className:"absolute inset-x-0 mt-0.5 top-8 px-4",children:r("input",{className:"box-border w-full m-0 cursor-pointer slider",type:"range",min:l,max:i,step:s,value:c,onChange:e=>d(e.target.value),style:m})})]}),r("div",{className:"flex justify-between mt-3 mb-4",children:a.map(((e,t)=>r("span",{className:"text-xs text-secondary-text pl-4",children:e},String(t))))})]})})),Ce=(e,t,r)=>Math.max(t,Math.min(e,r)),Le=3e4,De=3e6,je=Math.round(41.5),_e=a((({context:e,className:t,directoryName:a})=>{const[l,i]=e.useState(void 0),[s,c]=e.useState(void 0),[o,d]=e.useState(!0),[m,h]=e.useState(!0),x=(e=>{const{tableRows:t,isAnnuity:r=!1}=e;return t&&t.find((e=>e.isAnnuity===r))||{}})({tableRows:Ne(e.useAsyncData,a).rows,isAnnuity:o}),u=x.maxSum&&x.minSum?(x.maxSum-x.minSum)/2:1485e3,p=x.maxMonths&&x.minMonths?Math.round((x.maxMonths-x.minMonths)/2):je,f=x?.minSum||Le,b=x?.maxSum||De,g=x?.minMonths||1,v=x?.maxMonths||84,N=(e=>{const{calculatorParams:t,isInsurance:r}=e;return t?r?t?.rateWithInsurance||5:t?.rateWithoutInsurance||5:5})({calculatorParams:x,isInsurance:m}),y=(e=>{const{calculatorParams:t,paymentType:r,rate:n,sum:a,months:l}=e;if(!t)return 0;const i=Ce(a,t.minSum||Le,t.maxSum||De);if("annuity"===r){const e=Number(n)/1200;return i*(e+e/(Math.pow(1+e,l)-1))}return i/l+i*(Number(n)/12)})({calculatorParams:x,paymentType:"annuity",rate:N,sum:l||u,months:s||p}),w=((e,t)=>{const r=Math.ceil((t-e)/12),n=Math.floor(e/12)+1,a=new Array(Math.min(r-1,5)).fill(0).map(((e,t)=>n+t)),l=r+n-1;return a.concat(l)})(g,v);function k(e){c(Ce(12*e,g,v))}return r("section",{className:`font-sans text-primary-text bg-white p-4 ${t}`,children:n("div",{className:"box-border p-12 flex flex-col justify-between border-solid border-3 border-primary-main rounded-md",children:[n("div",{className:"flex justify-between",children:[n("div",{className:"grow mr-11",children:[r(Se,{title:"Желаемая сумма кредита, ₽",items:[`От ${$e(f)} рублей`,`До ${$e(b)} рублей`],min:f,max:b,step:1e3,value:l||u,onChange:i}),r(Se,{title:"Срок кредита, месяцев",items:["Или выберите из предложенных вариантов ниже"],min:g,max:v,step:1,value:s||p,onChange:c}),r("div",{className:"flex mb-7",children:w.map(((e,t)=>function(e,t,a){return r("button",{className:"bg-secondary-light rounded-3xl h-10 w-[75px] box-border mr-2 flex items-center justify-center cursor-pointer border-none",onClick:()=>a(e),children:n("span",{className:"font-semibold text-sm",children:[e," ",1===e?"год":e>4?"лет":"года"]})},String(t))}(e,t,k)))}),r(ke,{text:"Получаю пенсию на карту Россельхозбанка",checked:o,onChange:d}),r(ke,{className:"mb-4",text:"Комплексная страховая защита",checked:m,onChange:h})]}),n("div",{className:"p-9 bg-primary-main rounded-md text-white",children:[r("div",{className:"text-base mb-5",children:"Наше предложение"}),r("div",{className:"text-sm opacity-60",children:"Ежемесячный платёж"}),n("div",{className:"text-lg mb-3",children:[$e(Math.round(y))," ₽"]}),r("div",{className:"text-sm opacity-60",children:"Ставка"}),n("div",{className:"text-lg",children:[N," %"]})]})]}),n("div",{className:"flex items-center",children:[r(D,{className:"mr-3",text:"Отправить заявку",version:"primary",href:"#"}),r("div",{className:"w-80 text-xxs leading-4 text-secondary-text","aria-label":"Соглашение на обработку персональных данных",children:"Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно требованиям ФЗ «О персональных данных»"})]})]})})}));const Re={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},Te=a((e=>{const{children:t,className:n,version:a="primary"}=e;return r("section",{className:`font-sans p-9 box-border ${n||""} ${Re[a]} ${Ie(n)} ${Me(n)} `,children:r(A,{...e,children:t})})}));function Ie(e=""){const t=T(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}function Me(e=""){const t=T(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}const Ae="https://www.cbr-xml-daily.ru/daily_json.js",Be=["USD","EUR"],Pe={USD:"DollarIcon",EUR:"EuroIcon"},Oe=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],Fe=a((({className:e,context:t,title:a})=>{const{data:l}=t.useAsyncData(Ae,Ze);return r(Te,{className:e,context:t,title:a||"Курсы обмена валют",buttons:Oe,children:n("table",{children:[r("thead",{children:n("tr",{children:[r(He,{children:"Валюта"}),r(He,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:Be.map((e=>{const t=(l?.Valute||{})[e]?.Value;return n("tr",{children:[r(Ve,{className:"pt-4",children:n("div",{className:"flex items-center",children:[r(d,{name:Pe[e],width:"24",height:"24"}),r("span",{className:"ml-2",children:e})]})}),r(Ve,{className:"pt-4 pl-11",children:Ee(t)})]},e)}))})]})})})),He=a((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),Ve=a((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function Ze(){const e=await fetch(Ae);return await e.json()}const ze=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),Ee=e=>e?ze.format(e):"",We=["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"],Ge=a((({className:e,href:t,children:a,targetBlank:l})=>n("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:l?"_blank":"_self",children:[r(le,{className:"text-primary-main w-10",viewBox:"0 0 40 45",paths:We.map((e=>({d:e})))}),r("span",{className:"text-black text-base font-medium ml-2.5",children:a||"Россельхозбанк"})]}))),Ue=a((({className:e,context:t})=>{const{term:a,setTerm:l}=t.useSearch(),[i,s]=t.useState(!1);return n("form",{className:`relative ${e||""}`,children:[n("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[r("div",{className:"w-[24px] h-[24px]",children:r(d,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&r("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{id:"search-bar-input",className:(i?"border-primary-text":"")+" pr-32 h-12 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=>l(e.target.value),onFocus:e=>s(!0),onBlur:e=>s(!1),type:"text",name:"search-bar-input"}),i&&r("button",{type:"submit",version:"primary",className:"absolute font-sans font-normal cursor-pointer text-sm hover:bg-primary-hover active:bg-primary-active border-none px-9 py-[9px] rounded top-1 right-1 outline-none text-secondary-text text-white bg-primary-main",onClick:e=>{e.preventDefault(),console.log("click")},children:"Найти"})]})})),Je=a((({className:e,items:t,hasButton:a,context:l})=>{const i=l.useRouter(),{handlerDecorator:s}=l;return n("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(Xe):null,a?r(D,{version:"primary",className:"my-4",...y({router:i,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Xe=(e,t)=>{const{type:a,text:l,description:i}=e;return n("div",{className:"mb-4",children:[r("div",{children:Qe(a,l)}),r("div",{className:"font-sans text-sm text-secondary-text",children:i})]},String(t))},Qe=(e,t="")=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${qe(t)}`,children:t});case"email":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return r("span",{children:t})}},qe=e=>e.replaceAll(/\D/g,""),Ke=a((({className:e,links:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:l}=n;return r("div",{className:`${e||""}`,children:t?.length?r("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)=>r(Ye,{index:t,...y({router:a,handlerDecorator:l},e)},String(t))))}):null})})),Ye=a((({className:e,index:t,text:n,href:a,target:l,onClick:i})=>r("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:l,onClick:i,children:n||`Документ ${t}`})));function et(e){const{data:t}=e(rt(),tt);return t||{}}async function tt(){const e=await fetch(rt());return await e.json()}function rt(){return`/wcms-resources/${o.SITEMAP||"sitemap"}.json`}const nt=e=>t=>e?.href===t?.href;function at(e,t){return(n=e,a=t,(n||[]).map((e=>a?.find(nt(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find(nt(e))))));var r,n,a}const lt=a((({className:e,items:t,context:n})=>{const a=at(et(n.useAsyncData).topItems,t),l={router:n.useRouter(),handlerDecorator:n.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:a?.map(((e,t)=>it(e,t,l)))})})),it=(e,t,{router:a,handlerDecorator:l})=>{const{text:i,href:s,items:c,target:o}=e;return n("div",{className:"flex flex-col w-[235px] gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:i||`Раздел ${t}`}),c?.map(((e,t)=>r(st,{...y({router:a,handlerDecorator:l},e)},String(t))))]},String(t))},st=a((({text:e,href:t,target:n,index:a})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:n||"_self",children:e||`Раздел ${a}`}))),ct=[{origins:["t.me","telegram.org"],icon:"TelegramIcon",label:"Телеграм",width:"20px",height:"16px"},{origins:["vk.com"],icon:"VKIcon",label:"ВКонтакте",width:"24px",height:"12px"},{origins:["ok.ru"],icon:"OkIcon",label:"Одноклассники",width:"12px",height:"20px"}],ot=a((({className:e,media:t,context:n})=>{const a=n.useRouter(),{handlerDecorator:l}=n;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(dt,{...y({router:a,handlerDecorator:l},e)},String(t))))})})),dt=a((({href:e})=>{const{icon:t,label:n,width:a,height:l}=ct.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?r("a",{className:"flex items-center justify-center border border-solid border-main-divider rounded-full no-underline outline-none w-[38px] h-[38px] hover:fill-primary-main",href:e,target:"_blank",rel:"noopener noreferrer",children:d&&r(d,{name:t,width:a,height:l,asSVG:!0,className:"block"})}):null})),mt=a((({className:e,links:t,context:a})=>{const l=a.useRouter(),{handlerDecorator:i}=a;return n("div",{className:`${e||""}`,children:[r("div",{className:"pt-5 pb-[5px]",children:r("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?r("div",{className:"flex justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>r(ht,{index:t,...y({router:l,handlerDecorator:i},e)},String(t))))}):null]})})),ht=a((({className:e,index:t,text:n,href:a,target:l,onClick:i})=>r("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:l,onClick:i,children:n||`Документ ${t}`}))),xt=a((({className:e,documents:t,relatedEnterprises:a,contacts:l,socialMedia:i,topItems:s,context:c})=>n("footer",{className:`${e} px-9 py-10 bg-white`,children:[n("div",{className:"flex items-stretch gap-32 pb-8 xl:gap-8",children:[r(Ge,{className:"w-[280px] xl:w-[220px]"}),r(Ue,{context:c,className:"grow"})]}),n("div",{className:"flex items-stretch gap-32 xl:gap-8",children:[r(Je,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:l,context:c,hasButton:!0}),r(lt,{className:"pt-[3px]",context:c,items:s})]}),r(ot,{media:i,context:c}),r(Ke,{links:a,context:c}),r(mt,{links:t,context:c})]}))),ut={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},pt={normal:380,mini:276},ft={normal:3,mini:4},bt=a((({title:e,description:t,context:a,cards:l=[],className:i,version:c="normal"})=>{const[o,d]=a.useState(0);const m=l?.length>ft[c],h=m&&l?.length-o>ft[c],x=m&&o>0;return n("section",{className:`relative font-sans text-primary-text bg-white p-12 py-[50px] overflow-hidden ${i}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[e?r(s,{className:"font-medium m-0 text-center",children:e}):null,t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:`flex ${l?.length<=ft[c]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${o*pt[c]}px)`},role:"list",children:l?.map(((e,t)=>function(e,t,a){return n("div",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between items-stretch ${ut[a]} w-full`,role:"listitem",children:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(_,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.items.map(gt)}):null]}),e.href?r(D,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},String(t))}(e,t,c)))}),r("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),x&&r(se,{className:"absolute top-1/2 left-8 rotate-180",onClick:function(){d(o-1)},ariaLabel:"Пролистать влево"}),h&&r(se,{className:"absolute top-1/2 right-1 z-10",onClick:function(){d(o+1)},ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})}));function gt(e,t){return r($,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))}const vt=a((e=>r(bt,{...e,version:"normal"}))),Nt=a((({className:e,text:t,href:a,target:l,active:i,onClick:s,children:c})=>n("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:l,onClick:s,children:[r("span",{className:`font-sans font-normal text-base ${i?"text-primary-main":"text-primary-text hover:text-primary-main"}`,children:t||c}),i?r("div",{className:"absolute left-0 -bottom-2 w-full h-[2px] bg-primary-main"}):null]}))),yt=a((({className:e,text:t,href:n,target:a,active:l,flat:i,onClick:s,children:c,ariaLabel:o})=>r("a",{className:`inline-block border border-solid bg-transparent text-center no-underline ${i?"":"px-4 py-2"} ${l?"border-primary-main rounded-md":"border-transparent"} ${e||""}`,href:n,target:a,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:`font-sans font-normal text-sm ${l?"text-primary-main":(i?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"}`,children:t||c})}))),wt=a((({className:e,children:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 p-0 w-[24px] h-[24px] flex items-center bg-inherit cursor-pointer ${e||""}`,disabled:!0,"aria-label":n,children:t}))),kt=a((({context:e,className:t,defaultLocation:a=""})=>{const[l,i]=e.useGeolocation(a);return n("div",{className:`flex items-center ${t||""}`,children:[r(yt,{className:"mr-5",flat:!0,href:"#",text:l,ariaLabel:"Местоположение",onClick:i}),r(yt,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов"}),r(wt,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Поиск по сайту",children:r(d,{name:"LoupeIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(wt,{className:"mr-5 text-primary-text hover:text-primary-main",ariaLabel:"Профиль",children:r(d,{name:"ProfileIcon","aria-hidden":"true",className:"h-full",asSVG:!0})}),r(wt,{className:"min-w-[32px] min-h-[32px] fill-secondary-light hover:fill-secondary-hover",ariaLabel:"Дополнительные ссылки",children:r(d,{name:"GridIcon","aria-hidden":"true",className:"h-full",asSVG:!0})})]})}));const $t=a((({className:e,defaultLocation:t,context:a,topItems:l})=>{const i=a.useRouter(),s=et(a.useAsyncData),{handlerDecorator:c}=a,o=at(s.topItems,l),d=o.find(function(e){return t=>x(t.href,e,((e,t)=>t.startsWith(e)))}(i)),m=d?.items,h=m?.find(function(e){return t=>x(t.href,e)}(i)),u=o.map(((e,t)=>r(yt,{active:e===d,...y({router:i,handlerDecorator:c},e),ariaLabel:e.text},String(t)))),p=m?.map((e=>r(Nt,{className:"mr-8",active:e===h,...y({router:i,handlerDecorator:c},e)},e.href)));return r("header",{className:`pt-5 pb-8 px-20 bg-white ${e||""}`,children:n("div",{className:"container",children:[n("div",{className:"flex items-center",children:[r(Ge,{className:"mr-8"}),u,r(kt,{context:a,className:"ml-auto",defaultLocation:t})]}),r("div",{className:"mt-5 h-[1px] bg-main-divider"}),r("nav",{className:"mt-5",children:p})]})})})),St=a((e=>r(bt,{...e,version:"mini"}))),Ct=a((({className:e,context:t,title:a="Мобильное приложение",qr:l,buttons:i=[]})=>r(Te,{className:e,context:t,title:a,buttons:i,children:n("div",{className:"flex items-center",children:[l?.src&&l?.href&&r("a",{href:l.href,target:"_blank",children:r("img",{src:l.src,alt:a,title:a,width:"164",height:"164",className:"w-[90px] h-[90px] min-w-[90px] min-h-[90px] bg-secondary-light"})}),r("span",{className:"font-normal text-sm text-secondary-text ml-4",children:"Наведите камеру телефона на QR-код и скачайте приложение"})]})}))),Lt=a((({className:e,context:t,title:n})=>r(Te,{className:e,context:t,title:n,description:"Блок в разработке...",children:r("figure",{className:"m-0 min-w-[600px]",children:Dt()})}))),Dt=(e=3)=>_t(100,e).map((e=>Math.floor(e))).map(jt),jt=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),_t=(e,t)=>[e].concat(t>0?_t(e/1.618,t-1):[]),Rt=a((({className:e,context:t,title:a,titleSize:l,description:i,benefits:s,buttons:c,image:o,items:d})=>n("div",{className:`flex grow justify-between items-stretch ${e||""}`,children:[r("div",{className:"flex flex-col",children:r(A,{context:t,title:a,titleSize:l||"XL",description:i,items:d,buttons:c,children:s?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:s.map(Tt)}):null})}),o?.src&&r(_,{className:"mt-auto",image:o})]})));function Tt(e,t){return n("div",{className:"flex gap-4 items-center",children:[e.icon&&r(d,{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"}),n("div",{className:"flex gap-1 flex-col h-full max-w-[149px]",children:[r("h4",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const It=a((({text:e,href:t,target:n,onClick:a,className:l,children:i})=>t?r("a",{className:`no-underline ${l||""}`,href:t,target:n,onClick:a,children:r("span",{className:`${l||""}`,children:e||i})}):r("span",{className:`${l||""}`,children:e||i})));function Mt(e){return t=>t.reduce(((t,r,n)=>t.length?t.concat({...e,key:n},r):[r]),[])}const At=a((e=>{const{context:t,className:a,breadcrumbs:l}=e,i=t.useRouter(),{handlerDecorator:s}=t;return n("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${a||""}`,children:[l?.length?r("div",{className:"text-xs mb-6",children:Mt(r("span",{className:"text-secondary-text mx-2",children:"/"}))(l.map(((e,t)=>r(It,{...y({router:i,handlerDecorator:s},{className:"text-secondary-text",...e})},String(t)))))}):null,r(Rt,{...e})]})})),Bt=a((({className:e,context:t,duration:a=0,slides:l=[]})=>{const i=l.map((e=>e.nav)),s=l.map((e=>e.productBlock)),[c,o]=t.useState(0);return n("section",{className:`font-sans bg-white overflow-hidden w-100 ${e||""}`,children:[r("div",{className:"flex duration-1000",style:{transform:`translateX(-${c}00%)`},role:"list",children:s.map(((e,n)=>function(e,t,n){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(Rt,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:n,...e})})},String(t))}(e,n,t)))}),r("div",{className:"flex",children:i.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:a,onClick:l,duration:i}){const s=t===a,c=s?"animate-slide":"";return n("button",{type:"button",onClick:l,className:"font-sans group relative overflow-hidden border-0 bg-inherit cursor-pointer text-left px-0 pt-4 pb-5 grow basis-0",children:[n("div",{className:"border-0 border-r border-solid border-main-divider px-6",children:[r("div",{className:"text-sm font-medium pb-1 group-hover:text-primary-text "+(s?"text-primary-text":"text-secondary-text"),children:e?.title}),r("div",{className:"text-xs text-secondary-text pb-[2px]",children:e.desc})]}),r("div",{className:`absolute bottom-0 left-0 w-full h-[3px] bg-primary-main -translate-x-full ${c}`,style:{animationDuration:`${i}s`,animationFillMode:"forwards"}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:a})))})]})}));const Pt=a((e=>{const{benefits:t,version:a}=e;return r(Te,{...e,children:n("div",{className:"flex mt-5 mb-1",children:[t?.length?r("div",{className:"mr-8",children:t.map(Ot)}):null,t?.length?r("div",{className:"pt-1",children:t.map(((e,t)=>function(e,t,n="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[n]}`,children:e.label},String(t))}(e,t,a)))}):null]})})}));function Ot(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.description},String(t))}const Ft=a((({className:e,context:t,title:a="Акции и спецпредложения",date:l,description:i,buttons:s=[],version:c})=>r(Te,{className:e,context:t,title:a,buttons:s,version:c,children:n("div",{className:"mt-1.5",children:[l&&r("div",{className:"text-sm mb-2",children:Ht(l)}),r("div",{className:"text-base",children:i})]})})));function Ht(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const Vt=a((({className:e,title:t,steps:a})=>n("section",{className:`font-sans text-primary-text bg-white px-12 py-12 flex flex-col items-center ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center",children:t}),a?.length?n("div",{children:[r("div",{className:"flex mt-9 items-center px-[88px]",children:Mt(r("div",{className:"h-0.5 w-full bg-secondary-light"}))(a.map(((e,t)=>Zt(e,t))))}),r("div",{className:"flex mt-9 justify-between gap-x-24",children:a.map(zt)})]}):null]}))),Zt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative",children:r("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&&r(d,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),zt=(e,t)=>r("div",{className:"flex flex-col items-center text-center relative w-[276px]",children:n("div",{className:"max-w-min",children:[r("h5",{className:"font-medium text-xl m-0 mt-4 whitespace-nowrap px-3",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description})]})},String(t)),Et="border-main-divider border border-t-0 border-x-0",Wt=a((({cell:e,isLastRow:t})=>r("div",{className:"first:pl-0 pl-10 w-80 flex-grow flex flex-col border-solid border-main-divider border border-t-0 border-x-0 "+(t?"border-t-0 rounded-b-md":""),role:"cell",children:r("div",{className:`h-full ${Et}`,children:e.map(((e,t)=>Gt(e,t)))})}))),Gt=({label:e,description:t,list:a,image:l,buttons:i},s)=>n("div",{className:"first:pt-5 last:pb-5",children:[s>0&&r("div",{className:"border-main-divider border border-solid border-t-0 border-x-0 my-4"}),e&&r("div",{className:"text-xl font-medium m-0",children:e}),t&&r("div",{className:"text-sm text-secondary-text",children:t}),a?.items?.length?r("div",{className:"flex flex-col justify-between items-start",children:r("div",{role:"list",children:a.items.map(((e,t)=>r($,{text:e,version:a.version??"secondary",isDotted:a.isDotted??!0},String(t))))})}):null,l&&r(_,{image:l}),i?.length?i.map((({icon:e,...t},n)=>r(D,{className:(n>0?"ml-3":"")+" w-12 h-12",appendLeft:e&&r(d,{name:e,width:"24px",height:"24px"}),...t},String(n)))):null]},String(s)),Ut=a((({row:{header:e,data:t},activeCardIndex:a,isLastRow:l})=>n(be,{children:[r("div",{className:`text-sm py-5 w-[354px] flex-shrink-0 ${Et} ${l?"":"border-solid"}`,children:n("div",{className:"flex items-center text-primary-text",children:[e?.icon&&r(d,{className:"pr-[14px]",name:e.icon,width:"24px",height:"24px"}),e?.title]})}),t?.length?r(ue,{activeCardIndex:a,columnWidth:360,version:"tariff",children:t.map(((e,t)=>r(Wt,{cell:e,isLastRow:l},String(t))))}):null]}))),Jt=a((({className:e,context:t,title:a,rowHeaders:l,columns:i})=>{const[c,o]=t.useState(0),d=i?.map((({data:e})=>e))||[],m=l?.map(((e,t)=>({header:e,data:d.map((e=>e?.[t]||[{}]))}))),{nextClick:h,prevClick:x,isScrollAvailable:u,showNextButton:p,showPrevButton:f}=ae({colData:d,colsLengthForScroll:2,activeCardIndex:c,setActiveCardIndex:o});return n("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{className:"font-medium m-0 max-w-[47rem] text-center mb-9 mx-auto",children:a}),n("div",{role:"table",children:[m?.length?n("div",{className:"relative",children:[m.map(((e,t,{length:n})=>r(Ut,{row:e,isLastRow:t+1===n,activeCardIndex:c},String(t)))),u?r("div",{children:n("div",{className:"absolute top-7 right-7 z-10",children:[r(se,{onClick:h,disabled:!p,ariaLabel:"Пролистать вправо"}),r(se,{className:"mt-4 rotate-180",onClick:x,disabled:!f,ariaLabel:"Пролистать влево"})]})}):null]}):null,u?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null]})]})})),Xt={Accordion:te,BenefitsBlock:re,ComparisonTable:ve,CreditCalculator:_e,ExchangeRateTile:Fe,Footer:xt,Gallery:vt,Header:$t,Headline:O,LinkDocs:Z,MiniGallery:St,MobileAppTile:Ct,PictureText:W,Placeholder:Lt,ProductBlock:At,ProductGallery:Bt,ProductTile:Pt,PromoTile:Ft,StepsBlock:Vt,TariffsTable:Jt,TextBlock:J,Tile:Te},Qt=a((({className:e,onClick:t,ariaLabel:n})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:qt()}))),qt=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return n("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[r("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"}),r("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"})]})},Kt=a((({className:e,context:t})=>{const a=t.useLikeService();return n("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:[r(Qt,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),r(Qt,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:a.likeCount})]})})),Yt=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),er=a((({className:e,context:t,blocksRegistry:a,data:{style:l,blocks:i,slots:s={},likeControl:c,colorPalette:o="pc"},blockDecorator:d=Yt})=>{const{header:m}=s;return n("section",{className:`relative ${rr(l)} ${e||""}`,"data-theme":o,children:[m?.blocks?.length?r("div",{className:`${rr(m?.style)}`,children:m.blocks.map(((e,r)=>tr({block:e,blockDecorator:d,blocksRegistry:a,context:t},r)))}):null,i?.length?r("div",{className:"container grid grid-cols-12 gap-1",children:i.map(((e,r)=>tr({block:e,blockDecorator:d,blocksRegistry:a,context:t},r)))}):null,c&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(Kt,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})}));function tr({block:e,blockDecorator:t,blocksRegistry:n,context:a},l){const{type:i}=e;i in n||console.warn(`No block with "${i}" is registered`);const s=n[i]||Lt;return t({blockClassName:rr(e.style),block:e,render:e=>{const{version:c,content:o,blocks:d}=e.block;return r(s,{className:e.blockClassName,version:c,context:a,...o,children:d?.length?d.map(((e,r)=>tr({block:e,blockDecorator:t,blocksRegistry:n,context:a},r))):null},`${i}-${l}`)}},`block-${l}`)}function rr(e){return e?e.join(" "):""}const nr=a((({HeadComponent:e,data:t,children:a})=>{const{title:l,description:i,keywords:s,robots:c,og:o}=t;return n(e,{children:[r("title",{children:l}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),i&&r("meta",{name:"description",content:i}),s&&r("meta",{name:"keywords",content:s.join(",")}),c&&r("meta",{name:"robots",content:c.join(",")}),o?Object.entries(o).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null,a]})}));function ar(e){return e?.filter((({mobile:e})=>!e?.hidden)).map(lr)}function lr(e){const{mobile:t}=e;return t?{...e,style:t.style?.length?t.style:e.style}:e}const ir=a((({className:e,context:t})=>r("footer",{className:`${e} px-9 py-2 bg-white rounded-bl-3xl rounded-br-3xl`,children:r(mt,{context:t})}))),sr=a((({title:e,description:t,cards:a=[],className:l})=>n("section",{className:`relative font-sans text-primary-text bg-white p-4 overflow-hidden ${l}`,children:[n("div",{className:"flex flex-col items-center mb-8",children:[r(s,{className:"font-medium m-0 text-centers",children:e}),t?r("div",{className:"font-normal text-base max-w-[600px] mt-3",children:t}):null]}),r("div",{className:"horizontal-list no-scrollbar",role:"list",children:a?.map(cr)})]})));function cr(e,t){return n("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:[n("div",{children:[e.image?.src?r("div",{className:"flex justify-center",children:r(_,{className:"mb-6",image:e.image})}):null,e.title?r("h4",{className:"font-medium text-xl m-0 "+(e.description||e.items?.length?"":"text-center"),children:e.title}):null,e.description?r("div",{className:"font-normal text-sm text-secondary-text mt-2",children:e.description}):null,e.items?.length?or(e.items):null]}),e.href?r(D,{className:"mt-6",text:"Подробнее",version:"secondary",href:e.href}):null]},t)}function or(e=[]){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.map(((e,t)=>r($,{children:r("span",{className:"text-sm text-secondary-text",children:e})},String(t))))})}const dr=a((({titleSize:e,image:t,benefits:n,...a})=>{const{className:l}=a;return r("section",{className:`font-sans bg-white pt-10 pl-[50px] pb-[50px] pr-[7.5rem] ${l||""}`,children:r(Rt,{...a,titleSize:"L"})})})),mr={ExchangeRateTile:Fe,Footer:ir,Gallery:sr,Header:$t,Headline:O,MobileAppTile:Ct,PictureText:W,Placeholder:Lt,ProductBlock:dr,ProductTile:Pt,TextBlock:J,Tile:Te};e.Blocks=Xt,e.ContentPage=er,e.ContentPageHead=nr,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))))))(),r=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await r.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=function(e,t=""){async function r(){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:r,name:n}=await e.json();return globalThis.localStorage.setItem(l,JSON.stringify({token:r,name:n})),{token:r,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...n){if(!n.length)return[];const{token:a}=await r();try{const r=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:n})}),{likes:l}=await r.json();return l||[]}catch(e){return console.error(e),[]}},like:async function(n){if(!n)return 0;const{token:a,name:l}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:l},body:JSON.stringify({node_id:n,user_name:l})}),{likes:i}=await r.json();return i||0}catch(e){return console.error(e),0}},dislike:async function(n){if(!n)return 0;const{token:a,name:l}=await r();try{const r=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:l},body:JSON.stringify({node_id:n,user_name:l})}),{likes:i}=await r.json();return i||0}catch(e){return console.error(e),0}}}},e.MobileBlocks=mr,e.joinList=Mt,e.projectSettings=o,e.setup=t,e.toMobilePage=function(e){const{blocks:t,slots:r}=e;return{...e,blocks:ar(t),slots:r&&Object.keys(r).reduce(((e,t)=>({...e,[t]:{...r[t],blocks:ar(r[t].blocks)}})),{})}},e.url=v,Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,6 +1,7 @@
1
1
  import { PropsWithChildren } from '@redneckz/uni-jsx';
2
2
  import type { BlockDef, ContentPageDef, UniBlockProps } from '../../types';
3
3
  import type { BlockContent } from '../BlockContent';
4
+ import { ContentPageContext } from './ContentPageContext';
4
5
  interface BlockDecoratorProps<VNode> {
5
6
  blockClassName: string;
6
7
  block: BlockDef;
@@ -11,10 +12,17 @@ interface BlockDecoratorProps<VNode> {
11
12
  }
12
13
  export declare type BlockDecorator<VNode = any> = (props: BlockDecoratorProps<VNode>, index?: number | string) => any;
13
14
  export declare type JSXBlock = (props: PropsWithChildren<UniBlockProps & BlockContent, any>, context?: any) => any;
15
+ export declare type BlocksRegistry = Record<string, JSXBlock>;
14
16
  export interface ContentPageProps extends UniBlockProps {
15
- blocksRegistry: Record<string, JSXBlock>;
17
+ blocksRegistry: BlocksRegistry;
16
18
  data: ContentPageDef;
17
19
  blockDecorator?: BlockDecorator;
18
20
  }
21
+ export interface RenderBlockFunc {
22
+ block: BlockDef;
23
+ blockDecorator: BlockDecorator;
24
+ blocksRegistry: BlocksRegistry;
25
+ context: ContentPageContext;
26
+ }
19
27
  export declare const ContentPage: (props: PropsWithChildren<ContentPageProps, any>, context?: any) => any;
20
28
  export {};
@@ -5,24 +5,27 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const LikeControl_1 = require("../LikeControl/LikeControl");
6
6
  const Placeholder_1 = require("../Placeholder/Placeholder");
7
7
  const defaultBlockDecorator = ({ blockClassName, block, render }) => render({ blockClassName, block });
8
- exports.ContentPage = (0, uni_jsx_1.JSX)(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
9
- return ((0, jsx_runtime_1.jsxs)("section", { className: "relative", "data-theme": colorPalette, children: [(0, jsx_runtime_1.jsx)("div", { className: `grid grid-cols-12 gap-1 ${style2className(pageStyle)} ${className || ''}`, children: blocks?.length ? blocks.map(renderBlock) : null }), likeControl && ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: (0, jsx_runtime_1.jsx)(LikeControl_1.LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
10
- function renderBlock(block, i) {
11
- const { type } = block;
12
- if (!(type in blocksRegistry)) {
13
- console.warn(`No block with "${type}" is registered`);
14
- }
15
- const BlockComponent = blocksRegistry[type] || Placeholder_1.Placeholder;
16
- return blockDecorator({
17
- blockClassName: style2className(block.style),
18
- block,
19
- render: (props) => {
20
- const { version, content, blocks } = props.block;
21
- return ((0, jsx_runtime_1.jsx)(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length ? blocks.map(renderBlock) : null }, `${type}-${i}`));
22
- },
23
- }, `block-${i}`);
24
- }
8
+ exports.ContentPage = (0, uni_jsx_1.JSX)(({ className, context, blocksRegistry, data: { style: pageStyle, blocks, slots = {}, likeControl, colorPalette = 'pc' }, blockDecorator = defaultBlockDecorator, }) => {
9
+ const { header } = slots;
10
+ return ((0, jsx_runtime_1.jsxs)("section", { className: `relative ${style2className(pageStyle)} ${className || ''}`, "data-theme": colorPalette, children: [header?.blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: `${style2className(header?.style)}`, children: header.blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, blocks?.length ? ((0, jsx_runtime_1.jsx)("div", { className: "container grid grid-cols-12 gap-1", children: blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i)) })) : null, likeControl && ((0, jsx_runtime_1.jsx)("div", { className: "flex items-end absolute bottom-0 right-0 h-full pointer-events-none", children: (0, jsx_runtime_1.jsx)(LikeControl_1.LikeControl, { className: "rounded-tl-lg sticky bottom-0 pointer-events-auto", context: context }) }))] }));
25
11
  });
12
+ function renderBlock({ block, blockDecorator, blocksRegistry, context }, i) {
13
+ const { type } = block;
14
+ if (!(type in blocksRegistry)) {
15
+ console.warn(`No block with "${type}" is registered`);
16
+ }
17
+ const BlockComponent = blocksRegistry[type] || Placeholder_1.Placeholder;
18
+ return blockDecorator({
19
+ blockClassName: style2className(block.style),
20
+ block,
21
+ render: (props) => {
22
+ const { version, content, blocks } = props.block;
23
+ return ((0, jsx_runtime_1.jsx)(BlockComponent, { className: props.blockClassName, version: version, context: context, ...content, children: blocks?.length
24
+ ? blocks.map((block, i) => renderBlock({ block, blockDecorator, blocksRegistry, context }, i))
25
+ : null }, `${type}-${i}`));
26
+ },
27
+ }, `block-${i}`);
28
+ }
26
29
  function style2className(style) {
27
30
  return style ? style.join(' ') : '';
28
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAA2D;AAG3D,4DAAyD;AACzD,4DAAyD;AAwBzD,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvB,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,EACpE,cAAc,GAAG,qBAAqB,GACvC,EAAE,EAAE;IACH,OAAO,CACL,qCAAS,SAAS,EAAC,UAAU,gBAAa,YAAY,aACpD,gCAAK,SAAS,EAAE,2BAA2B,eAAe,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,EAAE,EAAE,YACvF,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,GAC5C,EACL,WAAW,IAAI,CACd,gCAAK,SAAS,EAAC,qEAAqE,YAClF,uBAAC,yBAAW,IACV,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAO,GAChB,GACE,CACP,IACO,CACX,CAAC;IAEF,SAAS,WAAW,CAAC,KAAe,EAAE,CAAS;QAC7C,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,EAAE;YAC7B,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;SACvD;QAED,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,yBAAW,CAAC;QAC3D,OAAO,cAAc,CACnB;YACE,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC;YAC5C,KAAK;YACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;gBAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;gBACjD,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,KACZ,OAAO,YAEV,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAN3C,GAAG,IAAI,IAAI,CAAC,EAAE,CAOJ,CAClB,CAAC;YACJ,CAAC;SACF,EACD,SAAS,CAAC,EAAE,CACb,CAAC;IACJ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
1
+ {"version":3,"file":"ContentPage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPage.tsx"],"names":[],"mappings":";;;AAAA,+CAA2D;AAG3D,4DAAyD;AACzD,4DAAyD;AAkCzD,MAAM,qBAAqB,GAAmB,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,CAClF,MAAM,CAAC,EAAE,cAAc,EAAE,KAAK,EAAE,CAAC,CAAC;AAEvB,QAAA,WAAW,GAAG,IAAA,aAAG,EAC5B,CAAC,EACC,SAAS,EACT,OAAO,EACP,cAAc,EACd,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,WAAW,EAAE,YAAY,GAAG,IAAI,EAAE,EAChF,cAAc,GAAG,qBAAqB,GACvC,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEzB,OAAO,CACL,qCACE,SAAS,EAAE,YAAY,eAAe,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,EAAE,EAAE,gBAC1D,YAAY,aAEvB,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CACxB,gCAAK,SAAS,EAAE,GAAG,eAAe,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,YAChD,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAC9B,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CACnE,GACG,CACP,CAAC,CAAC,CAAC,IAAI,EAEP,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAChB,gCAAK,SAAS,EAAC,mCAAmC,YAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CACvB,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CACnE,GACG,CACP,CAAC,CAAC,CAAC,IAAI,EAEP,WAAW,IAAI,CACd,gCAAK,SAAS,EAAC,qEAAqE,YAClF,uBAAC,yBAAW,IACV,SAAS,EAAC,mDAAmD,EAC7D,OAAO,EAAE,OAAO,GAChB,GACE,CACP,IACO,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,WAAW,CAClB,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAmB,EACnE,CAAS;IAET,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IACvB,IAAI,CAAC,CAAC,IAAI,IAAI,cAAc,CAAC,EAAE;QAC7B,OAAO,CAAC,IAAI,CAAC,kBAAkB,IAAI,iBAAiB,CAAC,CAAC;KACvD;IAED,MAAM,cAAc,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,yBAAW,CAAC;IAC3D,OAAO,cAAc,CACnB;QACE,cAAc,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,CAAC;QAC5C,KAAK;QACL,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;YAChB,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC;YACjD,OAAO,CACL,uBAAC,cAAc,IAEb,SAAS,EAAE,KAAK,CAAC,cAAc,EAC/B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,KACZ,OAAO,YAEV,MAAM,EAAE,MAAM;oBACb,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CACtB,WAAW,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC,CACnE;oBACH,CAAC,CAAC,IAAI,IAVH,GAAG,IAAI,IAAI,CAAC,EAAE,CAWJ,CAClB,CAAC;QACJ,CAAC;KACF,EACD,SAAS,CAAC,EAAE,CACb,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,KAAkC;IACzD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACtC,CAAC"}
@@ -1,13 +1,24 @@
1
1
  Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.toMobilePage = void 0;
3
3
  function toMobilePage(contentPage) {
4
- const blocks = contentPage.blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
4
+ const { blocks, slots } = contentPage;
5
5
  return {
6
6
  ...contentPage,
7
- blocks,
7
+ blocks: getMobileBlocks(blocks),
8
+ slots: slots &&
9
+ Object.keys(slots).reduce((res, key) => ({
10
+ ...res,
11
+ [key]: {
12
+ ...slots[key],
13
+ blocks: getMobileBlocks(slots[key].blocks),
14
+ },
15
+ }), {}),
8
16
  };
9
17
  }
10
18
  exports.toMobilePage = toMobilePage;
19
+ function getMobileBlocks(blocks) {
20
+ return blocks?.filter(({ mobile }) => !mobile?.hidden).map(toMobileBlock);
21
+ }
11
22
  function toMobileBlock(block) {
12
23
  const { mobile } = block;
13
24
  if (mobile) {
@@ -1 +1 @@
1
- {"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/toMobilePage.ts"],"names":[],"mappings":";;AAEA,SAAgB,YAAY,CAAC,WAA2B;IACtD,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC9F,OAAO;QACL,GAAG,WAAW;QACd,MAAM;KACP,CAAC;AACJ,CAAC;AAND,oCAMC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
1
+ {"version":3,"file":"toMobilePage.js","sourceRoot":"","sources":["../../../src/components/ContentPage/toMobilePage.ts"],"names":[],"mappings":";;AAEA,SAAgB,YAAY,CAAC,WAA2B;IACtD,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAAC;IAEtC,OAAO;QACL,GAAG,WAAW;QACd,MAAM,EAAE,eAAe,CAAC,MAAM,CAAC;QAC/B,KAAK,EACH,KAAK;YACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;gBACb,GAAG,GAAG;gBACN,CAAC,GAAG,CAAC,EAAE;oBACL,GAAG,KAAK,CAAC,GAAG,CAAC;oBACb,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;iBAC3C;aACF,CAAC,EACF,EAAE,CACH;KACJ,CAAC;AACJ,CAAC;AAnBD,oCAmBC;AAED,SAAS,eAAe,CAAC,MAAmB;IAC1C,OAAO,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,aAAa,CAAC,KAAe;IACpC,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzB,IAAI,MAAM,EAAE;QACV,OAAO;YACL,GAAG,KAAK;YACR,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK;SACzD,CAAC;KACH;SAAM;QACL,OAAO,KAAK,CAAC;KACd;AACH,CAAC"}
@@ -2,12 +2,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
2
2
  exports.Header = 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 useLink_1 = require("../../hooks/useLink");
6
+ const useSitemap_1 = require("../../hooks/useSitemap");
5
7
  const mergeTopItems_1 = require("../../mergeTopItems");
6
8
  const HeaderItem_1 = require("../../ui-kit/HeaderItem/HeaderItem");
7
9
  const Logo_1 = require("../../ui-kit/Logo/Logo");
8
10
  const TopItem_1 = require("../../ui-kit/TopItem/TopItem");
9
- const useLink_1 = require("../../hooks/useLink");
10
- const useSitemap_1 = require("../../hooks/useSitemap");
11
11
  const HeaderSecondaryMenu_1 = require("./HeaderSecondaryMenu");
12
12
  const isSubItemActive_1 = require("./isSubItemActive");
13
13
  const isTopItemActive_1 = require("./isTopItemActive");
@@ -21,6 +21,6 @@ exports.Header = (0, uni_jsx_1.JSX)(({ className, defaultLocation, context, topI
21
21
  const activeSubItem = subItems?.find((0, isSubItemActive_1.isSubItemActive)(router));
22
22
  const topMenu = mergedItems.map((_, i) => ((0, jsx_runtime_1.jsx)(TopItem_1.TopItem, { active: _ === activeTopItem, ...(0, useLink_1.useLink)({ router, handlerDecorator }, _), ariaLabel: _.text }, String(i))));
23
23
  const subMenu = subItems?.map((_) => ((0, jsx_runtime_1.jsx)(HeaderItem_1.HeaderItem, { className: "mr-8", active: _ === activeSubItem, ...(0, useLink_1.useLink)({ router, handlerDecorator }, _) }, _.href)));
24
- return ((0, jsx_runtime_1.jsxs)("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(Logo_1.Logo, { className: "mr-8" }), topMenu, (0, jsx_runtime_1.jsx)(HeaderSecondaryMenu_1.HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-5 h-[1px] bg-main-divider" }), (0, jsx_runtime_1.jsx)("nav", { className: "mt-5", children: subMenu })] }));
24
+ return ((0, jsx_runtime_1.jsx)("header", { className: `pt-5 pb-8 px-20 bg-white ${className || ''}`, children: (0, jsx_runtime_1.jsxs)("div", { className: "container", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center", children: [(0, jsx_runtime_1.jsx)(Logo_1.Logo, { className: "mr-8" }), topMenu, (0, jsx_runtime_1.jsx)(HeaderSecondaryMenu_1.HeaderSecondaryMenu, { context: context, className: "ml-auto", defaultLocation: defaultLocation })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-5 h-[1px] bg-main-divider" }), (0, jsx_runtime_1.jsx)("nav", { className: "mt-5", children: subMenu })] }) }));
25
25
  });
26
26
  //# sourceMappingURL=Header.js.map