@redneckz/wildless-cms-uni-blocks 0.3.7 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle.umd.js +13 -6
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/components/ContentPage/ContentPageHead.js +13 -6
- package/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/dist/types.d.ts +8 -9
- package/lib/components/ContentPage/ContentPageHead.js +13 -6
- package/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/lib/types.d.ts +8 -9
- package/mobile/bundle/bundle.umd.js +13 -6
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/components/ContentPage/ContentPageHead.js +13 -6
- package/mobile/dist/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/dist/types.d.ts +8 -9
- package/mobile/lib/components/ContentPage/ContentPageHead.js +13 -6
- package/mobile/lib/components/ContentPage/ContentPageHead.js.map +1 -1
- package/mobile/lib/types.d.ts +8 -9
- package/mobile/src/components/ContentPage/ContentPageHead.tsx +20 -17
- package/mobile/src/types.ts +8 -10
- package/package.json +1 -1
- package/src/components/ContentPage/ContentPageHead.tsx +20 -17
- package/src/types.ts +8 -10
package/bundle/bundle.umd.js
CHANGED
|
@@ -1409,13 +1409,20 @@
|
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
1411
|
const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
1412
|
-
const { title, main
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
: null, twitter
|
|
1416
|
-
? Object.entries(twitter).map(([key, value]) => (jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
1417
|
-
: null, canonical && jsx("link", { rel: "canonical", href: canonical }), jsonLd && jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
1412
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
1413
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
1414
|
+
return (jsxs(HeadComponent, { children: [jsx("title", { children: title }), jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && jsx("meta", { name: "description", content: description }), keywords && jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && jsx("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && jsx("link", { rel: "canonical", href: canonical }), jsonLd && jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
1418
1415
|
});
|
|
1416
|
+
function renderOpenGraph(og) {
|
|
1417
|
+
return og
|
|
1418
|
+
? Object.entries(og).map(([key, value]) => (jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
1419
|
+
: null;
|
|
1420
|
+
}
|
|
1421
|
+
function renderTwitter(twitter) {
|
|
1422
|
+
return twitter
|
|
1423
|
+
? Object.entries(twitter).map(([key, value]) => (jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
1424
|
+
: null;
|
|
1425
|
+
}
|
|
1419
1426
|
|
|
1420
1427
|
function isBlockInRegistry(blockType, registry) {
|
|
1421
1428
|
return (blockType || '') in registry;
|
package/bundle/bundle.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniBlocks={})}(this,(function(e){"use strict";const t=(e,r)=>{t._jsx=e,t._jsxs=r||e};t.vue=e=>{t(((t,{children:r,dangerouslySetInnerHTML:a,...n}={})=>{const i=Object.assign({},n,a?{innerHTML:a.__html}:{});return e(t,i,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),a=(...e)=>t._jsxs(...e),n=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:a,...n}=t||{},i=r?.slots?.default,l=a||i&&i();return e(Object.assign(n,l&&{children:l}),r)},e._tmpl.inheritAttrs=!1),e._tmpl);const i="likesToken";const l={h1:"text-title-lg tracking-[-0.3px]",h2:"text-title",h3:"text-title-sm",h4:"text-title-xs",h5:"text-title-2xs tracking-[0.2px]",h6:"text-title-2xs tracking-[0.2px]"},s=n((e=>{const{className:t,headingType:a,title:n}=e;if(!a)return;return r(a,{className:`font-sans font-medium m-0 ${l[a]} ${t||""}`,children:n})})),c=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}},o={none:"",primary:"text-primary-main"},m=n((({className:e="",name:t,alt:n=`Icon ${t}`,title:i=n,asSVG:l,color:s="primary",...m})=>{const d=`${c.CDN||""}icons/${t}.svg`;return l?a("svg",{className:`${o[s]} ${e}`,...m,"aria-hidden":"true",children:[i?r("title",{children:i}):null,n?r("desc",{children:n}):null,r("use",{href:`${d}#icon`,xlinkHref:`${d}#icon`})]}):r("img",{className:e,src:d,alt:n,title:i,...m,"aria-hidden":"true"})})),d={left:"text-left",center:"text-center",right:"text-right"},h=n((({bgColor:e="transparent",align:t="left",className:n="",title:i,description:l})=>{const c=d[t];return a("section",{className:`p-[50px] ${e} ${n}`,children:[i&&r(s,{headingType:"h2",className:`text-primary-text ${c}`,title:i}),l&&r("p",{className:`font-normal text-base mt-4 ${c}`,children:l})]})})),x=n((({className:e,iconClassName:t,textClassName:n,suffixClassName:i,doc:l,icon:s})=>{const{text:c,fileSize:o,...d}=l;return a("a",{className:e,role:"link",...d,children:[s?r(m,{className:t,name:s,width:"24px",height:"24px",asSVG:!0}):null,c?a("span",{className:n,children:[c,r("span",{className:i,children:d?.href&&p(u(d.href),o)})]}):null]})})),p=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),u=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},b=n((({className:e="",doc:t,icon:a})=>r(x,{className:`flex h-full box-border ${e}`,iconClassName:"mr-2.5 min-w-6 min-h-6 text-primary-text",textClassName:"self-center",suffixClassName:"text-secondary-text group-hover:text-primary-main",doc:t,icon:a}))),f=n((({className:e,documents:t,columnsMode:a="double",icon:n})=>t?.length?r("div",{className:e,role:"list",children:t.map(((e,t)=>r("div",{className:"double"===a?"basis-[calc(50%-20px)]":"",role:"listitem",children:r(b,{className:"group flex text-sm align-middle h-fit w-fit text-primary-text no-underline hover:text-primary-main",doc:e,icon:n})},String(t))))}):null)),g={left:"text-left",center:"text-center",right:"text-right"},N={double:"mb-8",single:"mb-[26px]"},v={double:"flex gap-x-5 gap-y-[26px] flex-wrap",single:"flex gap-3.5 flex-col"},y=n((({className:e="",title:t,subtitle:n,align:i,documents:l,icon:c="DocIcon",columnsMode:o="double"})=>a("section",{className:`font-sans p-[50px] bg-white ${e}`,children:[t?r(s,{headingType:"h2",className:`${n?"mb-2.5":N[o]} ${g[i??"center"]}`,title:t}):null,n?r("h3",{className:`text-base ${N[o]} ${g[i??"center"]}`,children:n}):null,r(f,{className:v[o],columnsMode:o,documents:l,icon:c})]}))),w=n((({className:e="",image:{size:t,...n}})=>{const i={width:t?.width?`${t?.width}px`:"100%",height:t?.height?`${t?.height}px`:"100%"};return a("picture",{className:`flex-none ${e}`,children:[n.sources?.length?n.sources.map((({src:e,format:t},a)=>r("source",{srcSet:e,type:k(t)},`${a}_${e}`))):null,r("img",{className:n.className||"",src:n.src,alt:n.alt||n.title,title:n.title,style:i,...t})]})}));function k(e){return e?`image/${String(e)}`:void 0}const $=n((({className:e="",title:t,image:n,benefits:i})=>a("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[r(s,{headingType:"h2",className:"text-center",title:t}),a("div",{className:"flex justify-center mt-9",children:[n?.src&&r(w,{className:"mr-6",image:n}),i?.length?r("div",{className:"flex flex-col",children:i.map(C)}):null]})]})));function C(e,t){return a("div",{className:"flex flex-row mb-8",children:[e.icon&&r(m,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48",asSVG:!0}),a("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 S={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"}},T=n((({title:e,description:t,blockVersion:n="primary",iconVersion:i,image:l,className:s})=>{const c=S[n];return a("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:["small"===i?D(c.icon):null,"big"===i?L(l):null,a("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 D(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 L(e){return e?.src?r(w,{className:"pt-0.5 pr-3",image:e}):null}const I=e=>e?.includes("//"),j=e=>(e||"").replace(/\/?\?.*/,""),_=e=>{if(!e||!I(e))return;const t=e,r=t.indexOf("//"),a=t.indexOf("/",r+"//".length);return-1!==a?t.substring(0,a):t};var R=Object.freeze({__proto__:null,isURL:I,withoutQuery:j,getOrigin:_});const A="/mobile",M=(e,t)=>{if(!e)return e;const r=_(t?.href);return r?e.replace(r,"")||"/":e},B=e=>e;function P({router:e,handlerDecorator:t=B},r){const a=((e,t)=>{if(!e)return e;const r=M(e,t)||"",a=t?.pathname.startsWith(A);return a&&!I(r)?`/mobile${r}`:r})(r.href,e);return{...r,href:a,ariaLabel:r.text,onClick:t((t=>{const n=a&&!I(a),i=!r.target||"_self"===r.target;n&&i&&(t.preventDefault(),e.push(a))}),r)}}const V=n((({text:e,aboveText:t,appendLeft:n,rounded:i,version:l})=>{const s=!e&&!t&&Boolean(n);return function({buttonInnerClasses:e,appendLeft:t,withoutText:n,aboveText:i,text:l}){return a("div",{className:e,children:[t||null,n?null:a("div",{children:[r("div",{className:"text-m-2xs text-left",children:i}),r("div",{className:"text-m-button font-medium text-left",children:l})]})]})}({buttonInnerClasses:"link"!==l?`flex items-center justify-center\n ${s?"h-12 w-12":"px-8 gap-2 "+(t?"py-2":"py-3.5")} ${i?"rounded-full":""}`:null,appendLeft:n,withoutText:s,aboveText:t,text:e})}));const O={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",link:""},F={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},Z="text-center font-sans select-none",H=n((({className:e,text:t,aboveText:a,appendLeft:n,href:i,target:l,onClick:s,children:c,disabled:o,rounded:m,version:d="none",ariaLabel:h,...x})=>{const p=c??r(V,{text:t,aboveText:a,appendLeft:n,rounded:m});return o?function({className:e,buttonInner:t,ariaLabel:a,version:n,rounded:i}){return r("div",{role:"button","aria-disabled":"true","aria-label":a,tabIndex:"-1",className:`inline-block ${Z} ${F[n]||""} ${i?"rounded-full":"rounded-md"} ${e||""}`,children:t})}({buttonInner:p,ariaLabel:h,className:e,version:d,rounded:m}):function({className:e,buttonInner:t,ariaLabel:a,version:n,rounded:i,href:l,target:s,onClick:c,rest:o}){return r("a",{className:`${Z} inline-block cursor-pointer no-underline ${O[n]||""} ${i?"rounded-full":"rounded-md"} ${e||""}`,href:l,target:s,onClick:c,"aria-label":a,role:l?"link":"button",...o,children:t})}({buttonInner:p,ariaLabel:h,className:e,version:d,rounded:m,href:i,target:l,onClick:s,rest:x})}));const G=n((({context:e,className:t="",buttons:a})=>{const{handlerDecorator:n}=e,i=e.useRouter();return a?.length?r("div",{className:`${t}`,children:a.map(((e,t)=>function({icon:e,...t},a){if(!t?.text)return;return r(H,e?{appendLeft:r(m,{name:e,width:"24",height:"24",asSVG:!0}),...t}:{...t},String(a))}(P({router:i,handlerDecorator:n},e),t)))}):null}));const E=n((e=>{const{className:t,description:a}=e;return r("div",{className:`font-normal text-m-md ${t||""}`,children:a})})),W={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text"},z={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},U=n((({className:e="",isDotted:t=!0,children:n,version:i="primary"})=>a("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&r("div",{className:J(i)}),r("span",{className:`text-m-md ${W[i]}`,children:n})]}))),J=e=>`rounded-full inline-block mr-3 mt-2 ${z[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,X=n((e=>{const{className:t="",itemClassName:a,isDotted:n,items:i,version:l}=e;return r("section",{className:`${t}`,role:"list",children:i?.length?i.map(((e,t)=>r(U,{className:a,isDotted:n,version:l,children:e},String(t)))):null})})),Q=n((({className:e="",title:t,children:n,buttons:i,image:l})=>a("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,a("div",{className:"flex grow w-full justify-between",children:[a("div",{className:"flex flex-col justify-between w-full",children:[r("div",{children:n}),r("div",{children:i})]}),l]})]}))),q=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12};function K(e=""){const t=q(e);return t<=4?"h4":t<=8?"h3":"h2"}function Y(e=""){const t=q(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function ee(e=""){const t=q(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const te={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},re=n((e=>{const{context:t,title:n,description:i,items:l,children:c,buttons:o,image:m,className:d="",version:h="primary",role:x}=e;return r("section",{className:`font-sans p-9 box-border ${d} ${te[h]} ${ee(d)} ${Y(d)} `,role:x,children:a(Q,{context:t,title:n&&r(s,{headingType:K(d),title:n,className:`whitespace-pre-wrap max-w-[600px] ${n?"mb-3":""}\n ${"primary"===h?"text-primary-text":""}`}),buttons:o?.length?r(G,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,image:m?.src&&r(w,{className:"mt-auto ml-7",image:m}),children:[i&&r(E,{className:"mt-4 max-w-[600px]",description:i}),c,ae(l,h)]})})}));function ae(e,t){return e?.length?r(X,{items:e,version:t}):null}const ne={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ie=n((({context:e,className:t="",title:n,description:i,benefits:l,buttons:c,image:o,version:m="primary"})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${t} ${ne[m]} ${ee(t)} ${Y(t)} `,children:a(Q,{context:e,title:n&&r(s,{headingType:K(t),title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:c?.length?r(G,{context:e,buttons:c,className:"flex mt-9 gap-3"}):null,image:o?.src&&r(w,{className:"mt-auto ml-7",image:o}),children:[i&&r(E,{className:"mt-4 max-w-[600px]",description:i}),a("div",{className:"flex mt-5 mb-1",children:[l?.length?r("div",{className:"mr-8",children:l.map(le)}):null,l?.length?r("div",{className:"pt-1",children:l.map(((e,t)=>function(e,t,a="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[a]}`,children:e.description},String(t))}(e,t,m)))}):null]})]})})));function le(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.label},String(t))}const se=n((({className:e,viewBox:t,fill:a="none",width:n,height:i,paths:l,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:a,width:n,height:i,children:l.map((({d:e,fill:t,...a},n)=>r("path",{d:e,fill:t||"currentColor",...s,...a},n)))}))),ce=[{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"}],oe=n((({className:e,disabled:t,...a})=>r(H,{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,...a,children:r(se,{paths:ce,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),me={primary:"bg-white text-secondary-text",secondary:"bg-primary-main text-white"},de={normal:3,mini:4},he={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},xe={normal:380,mini:276},pe={primary:"text-secondary-text",secondary:"text-white",gray:"text-secondary-text"},ue={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},be=n((({className:e="",isDotted:t=!0,text:n,children:i,version:l="primary"})=>a("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&r("div",{className:fe(l)}),"!!!!!",r("span",{className:pe[l],children:n||i})]}))),fe=e=>`rounded-full inline-block mr-3 mt-2 ${ue[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,ge=n((({title:e,description:t,image:n,items:i,button:l,version:s})=>{const c=function(e,t,r){return`font-medium text-xl m-0\n ${"secondary"!==e?"text-primary-text":""}\n ${t||r?.length?"":"text-center"}\n `}(s,t,i);return a("div",{children:[a("div",{children:[n?.src?r("div",{className:"flex justify-center",children:r(w,{className:"mb-6",image:n})}):null,e?Ne(e,c):null,t?r("div",{className:"font-normal text-sm "+(e?"mt-2":""),children:t}):null,i?.length?ve(i,s):null]}),l?.text&&r(H,{className:"mt-6",...l})]})}));function Ne(e,t){return r("div",{className:`font-medium text-xl m-0 ${t}`,children:e})}function ve(e,t){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.filter((e=>e?.text)).map(((e,a)=>function(e,t,a){return r(be,{version:a??"primary",children:r("span",{className:"text-sm",children:e})},String(t))}(e.text,a,t)))})}const ye=n((({context:e,title:t,description:n,cards:i=[],version:l="normal",activeCardIndex:c})=>a("div",{children:[r("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),a("div",{className:"flex flex-col items-center mb-8",children:[t?r(s,{headingType:"h2",className:"text-center",title:t}):null,n?r("div",{className:"font-normal text-base max-w-[600px] mt-2.5",children:n}):null]}),r("div",{className:`flex ${i?.length<=de[l]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*xe[l]}px)`},role:"list",children:i?.map(((t,a)=>function({card:e,version:t},a){return r("section",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between\n items-stretch ${he[t]} ${me[e.version??"primary"]} w-full col-span-4`,role:"listitem",children:r(ge,{...e})},String(a))}({card:t,version:l,context:e},a)))})]})));const we=n((({context:e,cards:t=[],className:n="",version:i="normal",...l})=>{const[s,c]=e.useState(0),o=t?.length>de[i],m=o&&t?.length-s>de[i],d=o&&s>0;return a("section",{className:`relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${n}`,children:[r(ye,{context:e,cards:t,version:i,activeCardIndex:s,...l}),d&&r(oe,{className:"absolute top-1/2 left-8 rotate-180",onClick:()=>c(s-1),ariaLabel:"Пролистать влево"}),m&&r(oe,{className:"absolute top-1/2 right-1 z-10",onClick:()=>c(s+1),ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})})),ke=n((e=>r(we,{...e,version:"normal"}))),$e=n((e=>r(we,{...e,version:"mini"}))),Ce={Headline:h,LinkDocs:y,TextBlock:T,PictureText:$,Tile:re,ProductTile:ie,Gallery:ke,MiniGallery:$e},Se=n((({blocks:e,context:t})=>r("div",{className:"transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0",children:e?.length?e.map(Te(t)):null}))),Te=e=>(t,a)=>{const n=t?.accordionBlockType;if(!n||!(n in Ce))return null;return r("div",{className:"mb-5 last:mb-0 pb-5",children:r(Ce[n],{context:e,...t,className:"!p-0"})},`block_${a}`)},De=n((({label:e,blocks:t,context:n})=>{const{hasContent:i,icon:l,handleToggle:s}=(({context:e,blocks:t})=>{const[r,a]=e.useState(!1),n=t?.length;return{isActive:r,hasContent:n,icon:r?"MinusIcon":"PlusIcon",handleToggle:e=>{if(!n)return;a(!r);const t=(({currentTarget:e})=>e.nextSibling)(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`}}})({context:n,blocks:t});return a("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[a("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(i?"group cursor-pointer":""),onClick:s,children:[r("span",{className:"text-xl pr-2.5 font-medium "+(i?"group-hover:text-primary-main":""),children:e}),i?r(m,{name:l,width:"24",height:"24",asSVG:!0}):null]}),i?r(Se,{blocks:t,context:n}):null]})})),Le=n((({title:e,accordionItems:t,context:n,className:i})=>a("section",{className:`p-[50px] font-sans bg-white text-primary-text ${i||""}`,children:[e?r(s,{headingType:"h4",className:"mb-2.5",title:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(De,{...e,context:n},`AccordionItem${t}`)))}):null]}))),Ie=n((({className:e,title:t,benefits:n})=>a("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[t?r(s,{headingType:"h2",className:"max-w-[47rem] text-center",title:t}):null,n?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:n.map(je)}):null]}))),je=(e,t)=>a("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(m,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),a("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)),_e=({colData:e,colsLengthForScroll:t,activeCardIndex:r,setActiveCardIndex:a})=>{const n=e?.length&&e.length>t;return{nextClick:()=>a(r+1),prevClick:()=>a(r-1),isScrollAvailable:n,showNextButton:n&&e?.length-r>t,showPrevButton:n&&r>0}},Re="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Ae="border-main-stroke border-solid border",Me="border-main-divider border border-t-0 border-x-0",Be="w-[200px] mr-6",Pe=n((({icon:e,image:t,title:n,link:i})=>a("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${Ae} ${Re}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(m,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(w,{className:"mb-[18px]",image:t}),n&&r(s,{headingType:"h4",className:"text-center text-white",title:n}),i?.text&&r("div",{className:"mt-auto w-full",children:r(H,{href:i.href,target:i.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:i.text})})})]}))),Ve={comparison:"flex gap-4 duration-1000",tariff:"flex flex-grow duration-1000"},Oe=n((({children:e,activeCardIndex:t,columnWidth:a,version:n="comparison"})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:Ve[n],style:{transform:`translateX(-${t*a}px)`},children:e})}))),Fe=n((({cell:e,isFirstRow:t,isLastRow:a,isFillGradient:n})=>r("div",{className:`w-80 box-border flex flex-col ${Ae} ${a?"border-t-0 rounded-b-md":"border-y-0"} ${n?Re:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${Me} ${n&&t?"border-t":""} ${a?"":"border-solid"}`,children:e.map(((e,t)=>Ze(e,t,n)))})}))),Ze=({label:e,description:t},n,i)=>a("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(i?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(i?"text-white":"text-secondary-text"),children:t})]},String(n)),He=n((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),Ge=n((({row:{header:e,data:t},activeCardIndex:n,isColoredFirstColumn:i,isFirstRow:l,isLastRow:s})=>a(He,{children:[e?.title?r("div",{className:`text-sm py-7 ${Me} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(Oe,{activeCardIndex:n,columnWidth:336,children:t.map(((e,t)=>r(Fe,{cell:e,isFirstRow:l,isLastRow:s,isFillGradient:i&&0===t},String(t))))}):null]}))),Ee=n((({className:e,context:t,title:n,rowHeaders:i,columns:l,visibleRowLength:c=0,isColoredFirstColumn:o=!1})=>{const m=t.useRouter(),{handlerDecorator:d}=t,[h,x]=t.useState(0),[p,u]=t.useState(!c),b=l?.map((({header:e})=>e||{})),f=l?.map((({data:e})=>e))||[],g=i?.map(((e,t)=>({header:e,data:f.map((e=>e?.[t]||[{}]))}))).slice(0,p?i.length:c),{nextClick:N,prevClick:v,isScrollAvailable:y,showNextButton:w,showPrevButton:k}=_e({colData:f,colsLengthForScroll:2,activeCardIndex:h,setActiveCardIndex:x});return a("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center mb-9 mx-auto",title:n}),a("div",{role:"table",children:[b?.length?a(He,{children:[r("div",{className:Be,role:"columnheader",scope:"col"}),r(Oe,{activeCardIndex:h,columnWidth:336,children:b.map(((e,t)=>r(Pe,{...e,link:e.link&&P({router:m,handlerDecorator:d},e.link)},String(t))))})]}):null,g?.length?a("div",{className:"relative",children:[g.map(((e,t,{length:a})=>r(Ge,{row:e,isFirstRow:0===t,isLastRow:t+1===a,activeCardIndex:h,isColoredFirstColumn:o},String(t)))),y?r("div",{children:a("div",{className:"absolute top-7 right-7 z-10",children:[r(oe,{onClick:N,disabled:!w,ariaLabel:"Пролистать вправо"}),r(oe,{className:"mt-4 rotate-180",onClick:v,disabled:!k,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),y?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,c?r("div",{className:"pr-[50px]",children:a("div",{className:"flex w-full",children:[r("div",{className:Be}),r("button",{onClick:()=>u(!p),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:p?"Скрыть":"Показать все параметры"})})]})}):null]})}));function We(e,t){const{data:r}=e(ze(t),(()=>async function(e){const t=await fetch(ze(e));return await t.json()}(t)));return r||{}}function ze(e){return`/wcms-resources/${e||"credit-calculator-data"}.json`}const Ue=[{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"}],Je=n((({text:e,checked:t,onChange:n,className:i})=>r("div",{className:i,children:a("label",{className:"flex items-center cursor-pointer relative",children:[r("input",{className:`peer appearance-none w-5 h-5 border-solid border ${t?"border-black":"border-main-stroke"} rounded checked:bg-primary-main checked:border-primary-main m-0`,type:"checkbox",onChange:e=>{n(e.target.checked)},checked:t}),r(se,{paths:Ue,className:"hidden absolute left-1 ml-px peer-checked:block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"}),e?r("span",{className:"font-sans ml-3 text-sm leading-5 cursor-pointer",children:e}):null]})}))),Xe=e=>new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:3}).format(e),Qe=n((({className:e,title:t,items:n=[],min:i=1,max:l=100,step:s=1,value:c=i,onChange:o})=>{const m=e=>{if(!o)return;const t=Number(e.replace(/\D/g,""));o(t)},d={backgroundSize:`${(100*(c-i)/(l-i)).toFixed(2)}% 100%`};return a("div",{className:e,children:[a("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 border-solid border-main-stroke rounded-md\n outline-none p-0 pl-4 m-0 box-border text-primary-text "+(t?"pt-4":""),value:Xe(c),onChange:e=>m(e.target.value),onBlur:()=>{o&&(c<i&&o(i),c>l&&o(l))}}),r("div",{className:"absolute inset-x-0 top-8 px-4",children:r("input",{className:"box-border w-full m-0 cursor-pointer slider",type:"range",min:i,max:l,step:s,value:c,onChange:e=>m(e.target.value),style:d})})]}),r("div",{className:"flex justify-between my-3",children:n.map(((e,t)=>r("span",{className:"text-xs leading-[14px] text-secondary-text pl-4",children:e},String(t))))})]})})),qe=(e,t,r)=>Math.max(t,Math.min(e,r)),Ke=3e4,Ye=3e6,et=Math.round(41.5),tt=n((({context:e,className:t,directoryName:n})=>{const[i,l]=e.useState(void 0),[s,c]=e.useState(void 0),[o,m]=e.useState(!0),[d,h]=e.useState(!0),x=(e=>{const{tableRows:t,isAnnuity:r=!1}=e;return t&&t.find((e=>e.isAnnuity===r))||{}})({tableRows:We(e.useAsyncData,n).rows,isAnnuity:o}),p=x.maxSum&&x.minSum?(x.maxSum-x.minSum)/2:1485e3,u=x.maxMonths&&x.minMonths?Math.round((x.maxMonths-x.minMonths)/2):et,b=x?.minSum||Ke,f=x?.maxSum||Ye,g=x?.minMonths||1,N=x?.maxMonths||84,v=(e=>{const{calculatorParams:t,isInsurance:r}=e;return t?r?t?.rateWithInsurance||5:t?.rateWithoutInsurance||5:5})({calculatorParams:x,isInsurance:d}),y=(e=>{const{calculatorParams:t,paymentType:r,rate:a,sum:n,months:i}=e;if(!t)return 0;const l=qe(n,t.minSum||Ke,t.maxSum||Ye);if("annuity"===r){const e=Number(a)/1200;return l*(e+e/(Math.pow(1+e,i)-1))}return l/i+l*(Number(a)/12)})({calculatorParams:x,paymentType:"annuity",rate:v,sum:i||p,months:s||u}),w=((e,t)=>{const r=Math.ceil((t-e)/12),a=Math.floor(e/12)+1,n=new Array(Math.min(r-1,5)).fill(0).map(((e,t)=>a+t)),i=r+a-1;return n.concat(i)})(g,N);function k(e){c(qe(12*e,g,N))}return r("section",{className:`font-sans text-primary-text p-10 bg-white ${t||""}`,children:a("div",{className:"box-border p-[49px] pr-[56px] mx-auto w-max border-solid border-[3px] border-primary-main rounded-md",children:[a("div",{className:"flex justify-between ",children:[a("div",{className:"mr-[42px]",children:[r(Qe,{title:"Желаемая сумма кредита, ₽",items:[`От ${Xe(b)} рублей`,`До ${Xe(f)} рублей`],min:b,max:f,step:1e3,value:i||p,onChange:l}),r(Qe,{className:"mt-[23px]",title:"Срок кредита, месяцев",items:["Или выберите из предложенных вариантов ниже"],min:g,max:N,step:1,value:s||u,onChange:c}),r("div",{className:"flex mb-7",children:w.map(((e,t)=>function(e,t,n){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:()=>n(e),children:a("span",{className:"font-semibold text-sm",children:[e," ",1===e?"год":e>4?"лет":"года"]})},String(t))}(e,t,k)))}),r(Je,{text:"Получаю пенсию на карту Россельхозбанка",checked:o,onChange:m}),r(Je,{className:"mt-3 mb-7",text:"Комплексная страховая защита",checked:d,onChange:h})]}),a("div",{className:"box-border h-fit p-9 bg-primary-main rounded-md text-white",children:[r("div",{className:"text-base mb-[18px]",children:"Наше предложение"}),r("div",{className:"text-sm opacity-60",children:"Ежемесячный платёж"}),a("div",{className:"text-lg mb-3",children:[Xe(Math.round(y))," ₽"]}),r("div",{className:"text-sm opacity-60",children:"Ставка"}),a("div",{className:"text-lg",children:[v," %"]})]})]}),a("div",{className:"flex items-center",children:[r(H,{className:"mr-3",text:"Отправить заявку",version:"primary",href:"#"}),r("div",{className:"w-80 text-2xs leading-4 text-secondary-text","aria-label":"Соглашение на обработку персональных данных",children:"Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно требованиям ФЗ «О персональных данных»"})]})]})})}));const rt="https://www.cbr-xml-daily.ru/daily_json.js",at=["USD","EUR"],nt={USD:"DollarIcon",EUR:"EuroIcon"},it=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],lt=n((({className:e="",context:t,title:n="Курсы обмена валют"})=>{const{data:i}=t.useAsyncData(rt,ot);return r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n&&r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px] "+(n?"mb-3":"")}),buttons:it?.length?r(G,{context:t,buttons:it,className:"flex mt-9 gap-3"}):null,children:a("table",{children:[r("thead",{children:a("tr",{children:[r(st,{children:"Валюта"}),r(st,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:at.map(ht(i))})]})})})})),st=n((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ct=n((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function ot(){const e=await fetch(rt);return await e.json()}const mt=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),dt=e=>e?mt.format(e):"",ht=e=>t=>{const n=(e?.Valute||{})[t]?.Value;return a("tr",{children:[r(ct,{className:"pt-4",children:a("div",{className:"flex items-center",children:[r(m,{name:nt[t],width:"24",height:"24"}),r("span",{className:"ml-2",children:t})]})}),r(ct,{className:"pt-4 pl-11",children:dt(n)})]},t)},xt=["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"],pt={"bg-white":"text-primary-main",transparent:"text-white"},ut={"bg-white":"text-black",transparent:"text-white"},bt=n((({className:e,href:t,children:n,targetBlank:i,bgColor:l="bg-white",hideTitle:s})=>a("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self","aria-label":"Россельхозбанк",children:[r(se,{className:`${pt[l]} w-10`,viewBox:"0 0 40 45",paths:xt.map((e=>({d:e})))}),!s&&r("span",{className:`${ut[l]} text-base font-medium ml-2.5`,children:n||"Россельхозбанк"})]}))),ft=n((({className:e,context:t})=>{const{term:n,setTerm:i}=t.useSearch();return a("form",{className:`relative ${e||""}`,children:[a("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(m,{name:"LoupeIcon",width:"24",height:"24"})}),!n&&r("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{id:"search-bar-input",className:"h-12 pl-12 w-full peer font-sans font-normal text-base text-black border border-solid rounded h-full box-border outline-none pr-[6%] border-main-divider focus:border-primary-text",value:n,onChange:e=>i(e.target.value),type:"text",name:"search-bar-input"}),r(H,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e.preventDefault(),console.log("click")},children:r("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),gt=n((({className:e,items:t,hasButton:n,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return a("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(Nt):null,n?r(H,{version:"primary",className:"my-4",...P({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Nt=(e,t)=>{const{type:n,text:i,description:l}=e;return a("div",{className:"mb-4",children:[r("div",{children:vt(n,i)}),r("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},vt=(e,t="")=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${yt(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})}},yt=e=>e.replaceAll(/\D/g,""),wt=n((({links:e,className:t="",context:a})=>{const n=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:t,children:e?.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:e.map(((e,t)=>r(kt,{index:t,...P({router:n,handlerDecorator:i},e)},String(t))))}):null})})),kt=n((({className:e="",index:t,text:a,href:n,target:i,onClick:l})=>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:n,target:i,onClick:l,children:a||`Документ ${t}`}))),$t=e=>t=>e?.href===t?.href,Ct=(e,t)=>{return(a=e,n=t,(a||[]).map((e=>n?.find($t(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find($t(e))))));var r,a,n};function St(e){const{data:t}=e(Dt(),Tt);return t||{}}async function Tt(){const e=await fetch(Dt());return await e.json()}function Dt(){return`/wcms-resources/${c.SITEMAP||"sitemap"}.json`}const Lt=n((({className:e,items:t,context:a})=>{const n=St(a.useAsyncData),i=Ct(n.topItems,t),l={router:a.useRouter(),handlerDecorator:a.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:i?.map(((e,t)=>It(e,t,l)))})})),It=(e,t,{router:n,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return a("div",{className:"flex flex-col gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>r(jt,{...P({router:n,handlerDecorator:i},e),index:t},String(t))))]},String(t))},jt=n((({text:e,href:t,target:a,index:n})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:a||"_self",children:e||`Раздел ${n}`}))),_t=[{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"}],Rt=n((({href:e})=>{const{icon:t,width:a,height:n,label:i}=_t.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,"aria-label":i,target:"_blank",rel:"noopener noreferrer",children:m&&r(m,{name:t,width:a,height:n,asSVG:!0,className:"block"})}):null})),At=n((({className:e,media:t,context:a})=>{const n=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(Rt,{...P({router:n,handlerDecorator:i},e)},String(t))))})})),Mt=n((({className:e,links:t,context:n})=>{const i=n.useRouter(),{handlerDecorator:l}=n;return a("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(Bt,{index:t,...P({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Bt=n((({className:e,index:t,text:a,href:n,target:i,onClick:l})=>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:n,target:i,onClick:l,children:a||`Документ ${t}`}))),Pt=n((({className:e,documents:t,relatedEnterprises:n,contacts:i,socialMedia:l,topItems:s,context:c})=>a("footer",{className:`px-9 py-10 bg-white ${e||""}`,children:[a("div",{className:"flex items-stretch gap-[54px] pb-8 xl:gap-8",children:[r(bt,{className:"w-[280px] xl:w-[220px]"}),r(ft,{context:c,className:"grow"})]}),a("div",{className:"flex items-stretch gap-[54px] xl:gap-8",children:[r(gt,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),r(Lt,{className:"pt-[3px]",context:c,items:s})]}),r(At,{media:l,context:c}),r(wt,{links:n,context:c}),r(Mt,{links:t,context:c})]}))),Vt=(e,t,r=((e,t)=>t.startsWith(e)))=>r(j(e),(e=>(e||"").replace(A,""))(j(I(e)?t.href:t.pathname))),Ot=e=>t=>Vt(t.href,e),Ft=e=>(t=[])=>{const r=t?.filter(Ot(e));var a;return r?.length?(a=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>a(e)>a(t)?e:t)))(r):null},Zt=e=>t=>t.items?.some(Ot(e))||Vt(t.href,e)||((e,t)=>_(e)===_(t.href))(t.href,e),Ht="absolute left-0 -bottom-3 w-full h-[2px]",Gt=n((({className:e,text:t,href:n,target:i,active:l,onClick:s,children:c,bgColor:o="bg-white"})=>a("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:n,target:i,onClick:s,children:[r("span",{className:Et(o,l),children:t||c}),l?r("div",{className:Wt(o,l)}):null]}))),Et=(e,t)=>{let r="text-white";return"bg-white"===e&&(r=t?"text-primary-main":"text-primary-text hover:text-primary-main"),`${r} font-sans font-normal text-base`},Wt=(e,t)=>t?`${"bg-white"===e?"bg-primary-main":e} ${Ht}`:Ht,zt=n((({className:e="",text:t,href:a,target:n,active:i,flat:l,onClick:s,children:c,ariaLabel:o,bgColor:m="bg-white"})=>r("a",{className:`${Ut(m,i,l)} ${e}`,href:a,target:n,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:Jt(m,i,l),children:t||c})}))),Ut=(e,t,r)=>{let a="border-transparent";return t&&(a="rounded-md "+("bg-white"===e?"border-primary-main":"border-white")),`${a} inline-block border border-solid bg-transparent text-center no-underline ${r?"":"px-4 py-2"}`},Jt=(e,t,r)=>{let a="text-white";return"bg-white"===e&&(a=t?"text-primary-main":(r?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"),`${a} font-sans font-normal text-sm`},Xt=n((({className:e="",children:t,ariaLabel:a})=>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":a,children:t}))),Qt={"bg-white":"text-primary-text hover:text-primary-main",transparent:"text-white"},qt={"bg-white":"text-secondary-light hover:text-secondary-hover",transparent:"text-white"},Kt={"bg-white":"GridIcon",transparent:"GridIconWhite"},Yt=n((({context:e,className:t,defaultLocation:n="",bgColor:i="bg-white"})=>{const[l,s]=e.useGeolocation(n);return a("div",{className:`flex items-center ${t||""}`,children:[r(zt,{className:"mr-5",flat:!0,href:"#",text:l,ariaLabel:"Местоположение",onClick:s,bgColor:i}),r(zt,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов",bgColor:i}),r(Xt,{className:`mr-5 ${Qt[i]}`,ariaLabel:"Поиск по сайту",children:r(m,{name:"LoupeIcon",className:"h-full",asSVG:!0,color:"none"})}),r(Xt,{className:`mr-5 ${Qt[i]}`,ariaLabel:"Профиль",children:r(m,{name:"ProfileIcon",className:"h-full",asSVG:!0,color:"none"})}),r(Xt,{className:`${qt[i]} min-w-[32px] min-h-[32px]`,ariaLabel:"Дополнительные ссылки",children:r(m,{name:Kt[i],className:"h-full",asSVG:!0,color:"none"})})]})})),er={"bg-white":"bg-main-divider",transparent:"bg-main-divider opacity-30"},tr=n((({className:e,defaultLocation:t,bgColor:n="bg-white",context:i,topItems:l})=>{const s=i.useRouter(),c=St(i.useAsyncData),{handlerDecorator:o}=i,m=Ct(c.topItems,l),d=m.find(Zt(s)),h=d?.items,x=Ft(s)(h),p=m.map(((e,t)=>r(zt,{active:e===d,...P({router:s,handlerDecorator:o},e),ariaLabel:e.text,bgColor:n},String(t)))),u=h?.map((e=>r(Gt,{className:"mr-8",active:e===x,...P({router:s,handlerDecorator:o},e),bgColor:n},e.href)));return r("header",{className:`pt-5 pb-8 px-20 ${n} ${e||""}`,children:a("div",{className:"container",children:[a("div",{className:"flex items-center",children:[r(bt,{className:"mr-8",bgColor:n}),p,r(Yt,{context:i,className:"ml-auto",defaultLocation:t,bgColor:n})]}),r("div",{className:`mt-5 h-[1px] ${er[n]}`}),r("nav",{className:"mt-5",children:u})]})})})),rr=n((({className:e="",context:t,title:n="Мобильное приложение",qr:i,buttons:l=[]})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n&&r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:l?.length?r(G,{context:t,buttons:l,className:"flex mt-9 gap-3"}):null,children:a("div",{className:"flex items-center",children:[i?.src&&i?.href&&r("a",{href:i.href,target:"_blank",children:r("img",{src:i.src,alt:n,title:n,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-код и скачайте приложение"})]})})}))),ar=n((({className:e,text:t,onClick:a,href:n,target:i,isActive:l})=>r("a",{className:`bg-inherit no-underline px-4 py-2.5 cursor-pointer rounded text-sm border border-solid hover:text-primary-main ${e||""} ${l?"border-primary-main text-primary-main":"border-white text-secondary-text"}`,onClick:a,href:n,target:i,children:t}))),nr=n((({className:e,context:t,title:n,buttons:i})=>{const l=t.useRouter(),{handlerDecorator:s}=t,c=Ft(l)(i);return a("section",{className:`font-sans text-primary-text rounded-[40px] flex items-center justify-between ${e||""}`,children:[r("h2",{className:"font-medium text-xl m-0",children:n}),i?.length?r("div",{className:"flex rounded-md overflow-hidden bg-white",children:i.filter((({text:e})=>e)).map(((e,t)=>r(ar,{className:"first:rounded-tl-md first:rounded-bl-md last:rounded-tr-md last:rounded-br-md",isActive:e===c,...P({router:l,handlerDecorator:s},e)},String(t))))}):null]})})),ir=n((({text:e,href:t,target:a,onClick:n,className:i="",children:l})=>t?r("a",{className:`no-underline ${i}`,href:t,target:a,onClick:n,children:r("span",{className:i,children:e||l})}):r("span",{className:i,children:e||l})));function lr(e){return t=>t.reduce(((t,r,a)=>t.length?t.concat({...e,key:a},r):[r]),[])}const sr={primary:"bg-main",secondary:"bg-white/30"},cr={primary:"text-primary-text",secondary:"text-white"},or={primary:"text-secondary-text",secondary:"text-white"};const mr=n((({className:e="",context:t,title:n,headingType:i="h2",description:l,benefits:c,buttons:o,image:d,items:h,version:x="primary"})=>a("div",{className:`flex grow justify-between items-stretch text-primary-text ${e}`,children:[r("div",{className:"flex flex-col",children:a(Q,{context:t,title:n&&r(s,{headingType:i,title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:o?.length?r(G,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,children:[l&&r(E,{className:"mt-4 max-w-[600px]",description:l}),c?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:c.map(((e,t)=>function(e,t,n){return a("div",{className:"flex gap-4 items-center",children:[e.icon&&r(m,{className:`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${sr[n]}`,name:e.icon,width:"24",height:"24",asSVG:!0}),a("div",{className:"flex gap-1 flex-col h-full max-w-[149px]",children:[r("div",{className:`font-medium text-xl m-0 ${cr[n]}`,children:e.label}),e.description&&r("div",{className:`font-normal text-sm ${or[n]}`,children:e.description})]})]},String(t))}(e,t,x)))}):null,h?.length?r(X,{className:"mt-5",items:h}):null]})}),d?.src&&r(w,{className:"mt-auto",image:d})]}))),dr={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},hr={primary:"text-secondary-text",secondary:"text-white/80"},xr=n((e=>{const{context:t,className:n,breadcrumbs:i,version:l="primary"}=e,s=t.useRouter(),{handlerDecorator:c}=t;return a("section",{className:`font-sans pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${n||""} ${dr[l]}`,children:[i?.length?r("div",{className:"text-xs mb-6",children:lr(r("span",{className:`mx-2 ${hr[l]}`,children:"/"}))(i.map(((e,t)=>r(ir,{...P({router:s,handlerDecorator:c},{className:hr[l],...e})},String(t)))))}):null,r(mr,{...e})]})})),pr=n((({className:e,context:t,duration:n=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return a("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,a)=>function(e,t,a){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(mr,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:a,...e})})},String(t))}(e,a,t)))}),r("div",{className:"flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:n,onClick:i,duration:l}){const s=t===n,c=s?"animate-slide":"",o=s?"text-primary-text":"text-secondary-text";return a("button",{type:"button",onClick:i,"aria-label":e?.title,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:[a("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 ${o}`,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:`${l}s`,animationFillMode:"forwards"}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:n})))})]})}));const ur={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},br=n((({className:e="",context:t,title:n="Акции и спецпредложения",date:i,description:l,buttons:c=[],version:o="primary"})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ur[o]} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n?r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}):null,buttons:c?.length?r(G,{context:t,buttons:c,className:"flex mt-9 gap-3"}):null,children:a("div",{className:"mt-1.5",children:[i?r("div",{className:"text-sm mb-2",children:fr(i)}):null,r("div",{className:"text-base",children:l})]})})})));function fr(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const gr=n((({className:e,title:t,showLines:n=!0,steps:i})=>a("section",{className:`box-border font-sans text-primary-text bg-white px-20 py-[50px] flex flex-col items-center ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center",title:t}),i?.length?a("div",{className:"box-border py-0.5 mb-0.5 "+(t?"mt-9":""),children:[r("div",{className:"flex items-center px-[88px]",children:lr(r("div",{className:"h-0.5 w-full bg-secondary-light "+(n?"":"opacity-0")}))(i.map(((e,t)=>Nr(e,t))))}),r("div",{className:"flex justify-between gap-x-[101px]",children:i.map(vr)})]}):null]}))),Nr=(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(m,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),vr=(e,t)=>a("div",{className:"flex flex-col items-center text-center relative w-[276px] whitespace-pre-line overflow-hidden",children:[e.label&&r("div",{className:"font-medium text-xl m-0 mt-4",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text "+(e.label?"mt-2":"mt-4"),children:e.description})]},String(t)),yr=n((({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",{children:e.map(((e,t)=>wr(e,t)))})}))),wr=({label:e,description:t,list:n,image:i,buttons:l},s)=>a("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}),n?.items?.length?r("div",{className:"flex flex-col justify-between items-start",children:r("div",{role:"list",children:n.items.map(((e,t)=>r(be,{className:"text-sm",text:e,version:"gray",isDotted:n.isDotted??!0},String(t))))})}):null,i&&r(w,{image:i}),l?.length?l.map((({icon:e,...t},a)=>r(H,{className:(a>0?"ml-3":"")+" w-12 h-12",appendLeft:e&&r(m,{name:e,width:"24px",height:"24px",asSVG:!0}),...t},String(a)))):null]},String(s)),kr=n((({row:{header:e,data:t},activeCardIndex:n,isLastRow:i})=>a(He,{children:[r("div",{className:"text-sm py-5 w-[354px] flex-shrink-0 border-main-divider border border-t-0 border-x-0 "+(i?"":"border-solid"),children:a("div",{className:"flex items-center text-primary-text",children:[e?.icon&&r(m,{className:"mr-[14px] max-w-6 max-h-6",name:e.icon,width:"24px",height:"24px",asSVG:!0}),e?.title]})}),t?.length?r(Oe,{activeCardIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>r(yr,{cell:e,isLastRow:i},String(t))))}):null]}))),$r={Accordion:Le,BenefitsBlock:Ie,ComparisonTable:Ee,CreditCalculator:tt,ExchangeRateTile:lt,Footer:Pt,Gallery:ke,Header:tr,Headline:h,LinkDocs:y,MiniGallery:$e,MobileAppTile:rr,PictureText:$,ProductBlock:xr,ProductGallery:pr,ProductTile:ie,PromoTile:br,StepsBlock:gr,TariffsTable:n((({className:e,context:t,title:n,rowHeaders:i,columns:l})=>{const[c,o]=t.useState(0),m=l?.map((({data:e})=>e))||[],d=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[{}]))}))),{nextClick:h,prevClick:x,isScrollAvailable:p,showNextButton:u,showPrevButton:b}=_e({colData:m,colsLengthForScroll:2,activeCardIndex:c,setActiveCardIndex:o});return a("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center mb-9 mx-auto",title:n}),a("div",{role:"table",children:[d?.length?a("div",{className:"relative",children:[d.map(((e,t,{length:a})=>r(kr,{row:e,isLastRow:t+1===a,activeCardIndex:c},String(t)))),p?r("div",{children:a("div",{className:"absolute top-7 right-7 z-10",children:[r(oe,{onClick:h,disabled:!u,ariaLabel:"Пролистать вправо"}),r(oe,{className:"mt-4 rotate-180",onClick:x,disabled:!b,ariaLabel:"Пролистать влево"})]})}):null]}):null,p?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null]})]})})),TextBlock:T,Tile:re,Navigation:nr},Cr=n((({className:e,onClick:t,ariaLabel:a})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":a,children:Sr()}))),Sr=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return a("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"})]})},Tr=n((({className:e,context:t})=>{const n=t.useLikeService();return a("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(Cr,{onClick:n.like,ariaLabel:"Поставить отметку «лайк»"}),r(Cr,{onClick:n.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:n.likeCount})]})})),Dr=n((({className:e,context:t,title:n,description:i="Блок в разработке..."})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:a(Q,{context:t,title:n?r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}):null,children:[i?r(E,{className:"mt-4 max-w-[600px]",description:i}):null,r("figure",{className:"m-0 min-w-[600px]",children:Lr()})]})}))),Lr=(e=3)=>jr(100,e).map((e=>Math.floor(e))).map(Ir),Ir=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),jr=(e,t)=>[e].concat(t>0?jr(e/1.618,t-1):[]),_r=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),Rr=n((({className:e,context:t,blocksRegistry:n,data:{style:i,blocks:l,slots:s={},likeControl:c,colorPalette:o="pc"},blockDecorator:m=_r})=>{const{header:d}=s;return a("section",{className:`relative ${Mr(i)} ${e||""}`,"data-theme":o,children:[d?.blocks?.length?r("div",{className:`${Mr(d?.style)}`,children:d.blocks.map(((e,r)=>Ar({block:e,blockDecorator:m,blocksRegistry:n,context:t},r)))}):null,l?.length?r("div",{className:"container grid grid-cols-12 gap-1",children:l.map(((e,r)=>Ar({block:e,blockDecorator:m,blocksRegistry:n,context:t},r)))}):null,c&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(Tr,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})}));function Ar({block:e,blockDecorator:t,blocksRegistry:a,context:n},i){const{type:l}=e;l&&l in a||console.warn(`No block with "${l}" is registered`);const s=a[l||"Placeholder"]||Dr;return t({blockClassName:Mr(e.style),block:e,render:e=>{const{version:t,content:a}=e.block;return r(s,{className:e.blockClassName,version:t,context:n,...a},`${l}-${i}`)}},`block-${i}`)}function Mr(e){return e?e.join(" "):""}const Br=n((({HeadComponent:e,data:t,children:n})=>{const{title:i,main:{description:l,keywords:s,canonical:c,robots:o},og:m,twitter:d,jsonLd:h}=t;return a(e,{children:[r("title",{children:i}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&r("meta",{name:"description",content:l}),s&&r("meta",{name:"keywords",content:s.join(",")}),o&&r("meta",{name:"robots",content:o.join(",")}),m?Object.entries(m).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null,d?Object.entries(d).map((([e,t])=>r("meta",{name:`twitter:${e}`,content:t},e))):null,c&&r("link",{rel:"canonical",href:c}),h&&r("script",{type:"application/ld+json",children:h}),n]})}));function Pr(e){const{mobile:t,...r}=e;return r}function Vr(e){return e?.filter((e=>{return t=e?.type,(t||"")in $r;var t})).map(Pr)}e.Blocks=$r,e.ContentPage=Rr,e.ContentPageHead=Br,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.Header=tr,e.Icon=m,e.LikeAPI=function(e,t=""){async function r(){try{const e=JSON.parse(globalThis.localStorage.getItem(i)||"");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:a}=await e.json();return globalThis.localStorage.setItem(i,JSON.stringify({token:r,name:a})),{token:r,name:a}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...a){if(!a.length)return[];const{token:n}=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:n},body:JSON.stringify({node_ids:a})}),{likes:i}=await r.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(a){if(!a)return 0;const{token:n,name:i}=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:n,UserID:i},body:JSON.stringify({node_id:a,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(a){if(!a)return 0;const{token:n,name:i}=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:n,UserID:i},body:JSON.stringify({node_id:a,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}}}},e.joinList=lr,e.normalizePage=function(e){if(!e)return;const{blocks:t,slots:r}=e;return{...e,blocks:Vr(t),slots:r&&Object.keys(r).reduce(((e,t)=>({...e,[t]:{...r[t],blocks:Vr(r[t].blocks)}})),{})}},e.projectSettings=c,e.setup=t,e.url=R,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:a,...n}={})=>{const i=Object.assign({},n,a?{innerHTML:a.__html}:{});return e(t,i,"string"!=typeof t?()=>r:r)}))};const r=(...e)=>t._jsx(...e),a=(...e)=>t._jsxs(...e),n=e=>(e._tmpl||(e._tmpl=function(t,r){const{children:a,...n}=t||{},i=r?.slots?.default,l=a||i&&i();return e(Object.assign(n,l&&{children:l}),r)},e._tmpl.inheritAttrs=!1),e._tmpl);const i="likesToken";const l={h1:"text-title-lg tracking-[-0.3px]",h2:"text-title",h3:"text-title-sm",h4:"text-title-xs",h5:"text-title-2xs tracking-[0.2px]",h6:"text-title-2xs tracking-[0.2px]"},s=n((e=>{const{className:t,headingType:a,title:n}=e;if(!a)return;return r(a,{className:`font-sans font-medium m-0 ${l[a]} ${t||""}`,children:n})})),c=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}},o={none:"",primary:"text-primary-main"},m=n((({className:e="",name:t,alt:n=`Icon ${t}`,title:i=n,asSVG:l,color:s="primary",...m})=>{const d=`${c.CDN||""}icons/${t}.svg`;return l?a("svg",{className:`${o[s]} ${e}`,...m,"aria-hidden":"true",children:[i?r("title",{children:i}):null,n?r("desc",{children:n}):null,r("use",{href:`${d}#icon`,xlinkHref:`${d}#icon`})]}):r("img",{className:e,src:d,alt:n,title:i,...m,"aria-hidden":"true"})})),d={left:"text-left",center:"text-center",right:"text-right"},h=n((({bgColor:e="transparent",align:t="left",className:n="",title:i,description:l})=>{const c=d[t];return a("section",{className:`p-[50px] ${e} ${n}`,children:[i&&r(s,{headingType:"h2",className:`text-primary-text ${c}`,title:i}),l&&r("p",{className:`font-normal text-base mt-4 ${c}`,children:l})]})})),x=n((({className:e,iconClassName:t,textClassName:n,suffixClassName:i,doc:l,icon:s})=>{const{text:c,fileSize:o,...d}=l;return a("a",{className:e,role:"link",...d,children:[s?r(m,{className:t,name:s,width:"24px",height:"24px",asSVG:!0}):null,c?a("span",{className:n,children:[c,r("span",{className:i,children:d?.href&&p(u(d.href),o)})]}):null]})})),p=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),u=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},b=n((({className:e="",doc:t,icon:a})=>r(x,{className:`flex h-full box-border ${e}`,iconClassName:"mr-2.5 min-w-6 min-h-6 text-primary-text",textClassName:"self-center",suffixClassName:"text-secondary-text group-hover:text-primary-main",doc:t,icon:a}))),f=n((({className:e,documents:t,columnsMode:a="double",icon:n})=>t?.length?r("div",{className:e,role:"list",children:t.map(((e,t)=>r("div",{className:"double"===a?"basis-[calc(50%-20px)]":"",role:"listitem",children:r(b,{className:"group flex text-sm align-middle h-fit w-fit text-primary-text no-underline hover:text-primary-main",doc:e,icon:n})},String(t))))}):null)),g={left:"text-left",center:"text-center",right:"text-right"},N={double:"mb-8",single:"mb-[26px]"},v={double:"flex gap-x-5 gap-y-[26px] flex-wrap",single:"flex gap-3.5 flex-col"},y=n((({className:e="",title:t,subtitle:n,align:i,documents:l,icon:c="DocIcon",columnsMode:o="double"})=>a("section",{className:`font-sans p-[50px] bg-white ${e}`,children:[t?r(s,{headingType:"h2",className:`${n?"mb-2.5":N[o]} ${g[i??"center"]}`,title:t}):null,n?r("h3",{className:`text-base ${N[o]} ${g[i??"center"]}`,children:n}):null,r(f,{className:v[o],columnsMode:o,documents:l,icon:c})]}))),w=n((({className:e="",image:{size:t,...n}})=>{const i={width:t?.width?`${t?.width}px`:"100%",height:t?.height?`${t?.height}px`:"100%"};return a("picture",{className:`flex-none ${e}`,children:[n.sources?.length?n.sources.map((({src:e,format:t},a)=>r("source",{srcSet:e,type:k(t)},`${a}_${e}`))):null,r("img",{className:n.className||"",src:n.src,alt:n.alt||n.title,title:n.title,style:i,...t})]})}));function k(e){return e?`image/${String(e)}`:void 0}const $=n((({className:e="",title:t,image:n,benefits:i})=>a("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[r(s,{headingType:"h2",className:"text-center",title:t}),a("div",{className:"flex justify-center mt-9",children:[n?.src&&r(w,{className:"mr-6",image:n}),i?.length?r("div",{className:"flex flex-col",children:i.map(C)}):null]})]})));function C(e,t){return a("div",{className:"flex flex-row mb-8",children:[e.icon&&r(m,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48",asSVG:!0}),a("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 S={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"}},T=n((({title:e,description:t,blockVersion:n="primary",iconVersion:i,image:l,className:s})=>{const c=S[n];return a("section",{className:`font-sans px-9 py-4 flex ${c.background} ${s||""}`,children:["small"===i?D(c.icon):null,"big"===i?L(l):null,a("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 D(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 L(e){return e?.src?r(w,{className:"pt-0.5 pr-3",image:e}):null}const I=e=>e?.includes("//"),j=e=>(e||"").replace(/\/?\?.*/,""),_=e=>{if(!e||!I(e))return;const t=e,r=t.indexOf("//"),a=t.indexOf("/",r+"//".length);return-1!==a?t.substring(0,a):t};var R=Object.freeze({__proto__:null,isURL:I,withoutQuery:j,getOrigin:_});const A="/mobile",M=(e,t)=>{if(!e)return e;const r=_(t?.href);return r?e.replace(r,"")||"/":e},B=e=>e;function P({router:e,handlerDecorator:t=B},r){const a=((e,t)=>{if(!e)return e;const r=M(e,t)||"",a=t?.pathname.startsWith(A);return a&&!I(r)?`/mobile${r}`:r})(r.href,e);return{...r,href:a,ariaLabel:r.text,onClick:t((t=>{const n=a&&!I(a),i=!r.target||"_self"===r.target;n&&i&&(t.preventDefault(),e.push(a))}),r)}}const V=n((({text:e,aboveText:t,appendLeft:n,rounded:i,version:l})=>{const s=!e&&!t&&Boolean(n);return function({buttonInnerClasses:e,appendLeft:t,withoutText:n,aboveText:i,text:l}){return a("div",{className:e,children:[t||null,n?null:a("div",{children:[r("div",{className:"text-m-2xs text-left",children:i}),r("div",{className:"text-m-button font-medium text-left",children:l})]})]})}({buttonInnerClasses:"link"!==l?`flex items-center justify-center\n ${s?"h-12 w-12":"px-8 gap-2 "+(t?"py-2":"py-3.5")} ${i?"rounded-full":""}`:null,appendLeft:n,withoutText:s,aboveText:t,text:e})}));const O={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",link:""},F={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},Z="text-center font-sans select-none",H=n((({className:e,text:t,aboveText:a,appendLeft:n,href:i,target:l,onClick:s,children:c,disabled:o,rounded:m,version:d="none",ariaLabel:h,...x})=>{const p=c??r(V,{text:t,aboveText:a,appendLeft:n,rounded:m});return o?function({className:e,buttonInner:t,ariaLabel:a,version:n,rounded:i}){return r("div",{role:"button","aria-disabled":"true","aria-label":a,tabIndex:"-1",className:`inline-block ${Z} ${F[n]||""} ${i?"rounded-full":"rounded-md"} ${e||""}`,children:t})}({buttonInner:p,ariaLabel:h,className:e,version:d,rounded:m}):function({className:e,buttonInner:t,ariaLabel:a,version:n,rounded:i,href:l,target:s,onClick:c,rest:o}){return r("a",{className:`${Z} inline-block cursor-pointer no-underline ${O[n]||""} ${i?"rounded-full":"rounded-md"} ${e||""}`,href:l,target:s,onClick:c,"aria-label":a,role:l?"link":"button",...o,children:t})}({buttonInner:p,ariaLabel:h,className:e,version:d,rounded:m,href:i,target:l,onClick:s,rest:x})}));const G=n((({context:e,className:t="",buttons:a})=>{const{handlerDecorator:n}=e,i=e.useRouter();return a?.length?r("div",{className:`${t}`,children:a.map(((e,t)=>function({icon:e,...t},a){if(!t?.text)return;return r(H,e?{appendLeft:r(m,{name:e,width:"24",height:"24",asSVG:!0}),...t}:{...t},String(a))}(P({router:i,handlerDecorator:n},e),t)))}):null}));const E=n((e=>{const{className:t,description:a}=e;return r("div",{className:`font-normal text-m-md ${t||""}`,children:a})})),W={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text"},z={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},U=n((({className:e="",isDotted:t=!0,children:n,version:i="primary"})=>a("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&r("div",{className:J(i)}),r("span",{className:`text-m-md ${W[i]}`,children:n})]}))),J=e=>`rounded-full inline-block mr-3 mt-2 ${z[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,X=n((e=>{const{className:t="",itemClassName:a,isDotted:n,items:i,version:l}=e;return r("section",{className:`${t}`,role:"list",children:i?.length?i.map(((e,t)=>r(U,{className:a,isDotted:n,version:l,children:e},String(t)))):null})})),Q=n((({className:e="",title:t,children:n,buttons:i,image:l})=>a("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,a("div",{className:"flex grow w-full justify-between",children:[a("div",{className:"flex flex-col justify-between w-full",children:[r("div",{children:n}),r("div",{children:i})]}),l]})]}))),q=e=>{const t="col-span-",r=e.split(/\s+/).find((e=>e.startsWith(t)));return r?parseInt(r.substring(t.length),10):12};function K(e=""){const t=q(e);return t<=4?"h4":t<=8?"h3":"h2"}function Y(e=""){const t=q(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function ee(e=""){const t=q(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const te={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},re=n((e=>{const{context:t,title:n,description:i,items:l,children:c,buttons:o,image:m,className:d="",version:h="primary",role:x}=e;return r("section",{className:`font-sans p-9 box-border ${d} ${te[h]} ${ee(d)} ${Y(d)} `,role:x,children:a(Q,{context:t,title:n&&r(s,{headingType:K(d),title:n,className:`whitespace-pre-wrap max-w-[600px] ${n?"mb-3":""}\n ${"primary"===h?"text-primary-text":""}`}),buttons:o?.length?r(G,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,image:m?.src&&r(w,{className:"mt-auto ml-7",image:m}),children:[i&&r(E,{className:"mt-4 max-w-[600px]",description:i}),c,ae(l,h)]})})}));function ae(e,t){return e?.length?r(X,{items:e,version:t}):null}const ne={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ie=n((({context:e,className:t="",title:n,description:i,benefits:l,buttons:c,image:o,version:m="primary"})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${t} ${ne[m]} ${ee(t)} ${Y(t)} `,children:a(Q,{context:e,title:n&&r(s,{headingType:K(t),title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:c?.length?r(G,{context:e,buttons:c,className:"flex mt-9 gap-3"}):null,image:o?.src&&r(w,{className:"mt-auto ml-7",image:o}),children:[i&&r(E,{className:"mt-4 max-w-[600px]",description:i}),a("div",{className:"flex mt-5 mb-1",children:[l?.length?r("div",{className:"mr-8",children:l.map(le)}):null,l?.length?r("div",{className:"pt-1",children:l.map(((e,t)=>function(e,t,a="primary"){return r("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[a]}`,children:e.description},String(t))}(e,t,m)))}):null]})]})})));function le(e,t){return r("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.label},String(t))}const se=n((({className:e,viewBox:t,fill:a="none",width:n,height:i,paths:l,...s})=>r("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:a,width:n,height:i,children:l.map((({d:e,fill:t,...a},n)=>r("path",{d:e,fill:t||"currentColor",...s,...a},n)))}))),ce=[{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"}],oe=n((({className:e,disabled:t,...a})=>r(H,{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,...a,children:r(se,{paths:ce,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),me={primary:"bg-white text-secondary-text",secondary:"bg-primary-main text-white"},de={normal:3,mini:4},he={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},xe={normal:380,mini:276},pe={primary:"text-secondary-text",secondary:"text-white",gray:"text-secondary-text"},ue={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},be=n((({className:e="",isDotted:t=!0,text:n,children:i,version:l="primary"})=>a("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&r("div",{className:fe(l)}),"!!!!!",r("span",{className:pe[l],children:n||i})]}))),fe=e=>`rounded-full inline-block mr-3 mt-2 ${ue[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,ge=n((({title:e,description:t,image:n,items:i,button:l,version:s})=>{const c=function(e,t,r){return`font-medium text-xl m-0\n ${"secondary"!==e?"text-primary-text":""}\n ${t||r?.length?"":"text-center"}\n `}(s,t,i);return a("div",{children:[a("div",{children:[n?.src?r("div",{className:"flex justify-center",children:r(w,{className:"mb-6",image:n})}):null,e?Ne(e,c):null,t?r("div",{className:"font-normal text-sm "+(e?"mt-2":""),children:t}):null,i?.length?ve(i,s):null]}),l?.text&&r(H,{className:"mt-6",...l})]})}));function Ne(e,t){return r("div",{className:`font-medium text-xl m-0 ${t}`,children:e})}function ve(e,t){return r("section",{className:"max-w-[308px] mt-2",role:"list",children:e.filter((e=>e?.text)).map(((e,a)=>function(e,t,a){return r(be,{version:a??"primary",children:r("span",{className:"text-sm",children:e})},String(t))}(e.text,a,t)))})}const ye=n((({context:e,title:t,description:n,cards:i=[],version:l="normal",activeCardIndex:c})=>a("div",{children:[r("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),a("div",{className:"flex flex-col items-center mb-8",children:[t?r(s,{headingType:"h2",className:"text-center",title:t}):null,n?r("div",{className:"font-normal text-base max-w-[600px] mt-2.5",children:n}):null]}),r("div",{className:`flex ${i?.length<=de[l]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*xe[l]}px)`},role:"list",children:i?.map(((t,a)=>function({card:e,version:t},a){return r("section",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between\n items-stretch ${he[t]} ${me[e.version??"primary"]} w-full col-span-4`,role:"listitem",children:r(ge,{...e})},String(a))}({card:t,version:l,context:e},a)))})]})));const we=n((({context:e,cards:t=[],className:n="",version:i="normal",...l})=>{const[s,c]=e.useState(0),o=t?.length>de[i],m=o&&t?.length-s>de[i],d=o&&s>0;return a("section",{className:`relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${n}`,children:[r(ye,{context:e,cards:t,version:i,activeCardIndex:s,...l}),d&&r(oe,{className:"absolute top-1/2 left-8 rotate-180",onClick:()=>c(s-1),ariaLabel:"Пролистать влево"}),m&&r(oe,{className:"absolute top-1/2 right-1 z-10",onClick:()=>c(s+1),ariaLabel:"Пролистать вправо"}),r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})})),ke=n((e=>r(we,{...e,version:"normal"}))),$e=n((e=>r(we,{...e,version:"mini"}))),Ce={Headline:h,LinkDocs:y,TextBlock:T,PictureText:$,Tile:re,ProductTile:ie,Gallery:ke,MiniGallery:$e},Se=n((({blocks:e,context:t})=>r("div",{className:"transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0",children:e?.length?e.map(Te(t)):null}))),Te=e=>(t,a)=>{const n=t?.accordionBlockType;if(!n||!(n in Ce))return null;return r("div",{className:"mb-5 last:mb-0 pb-5",children:r(Ce[n],{context:e,...t,className:"!p-0"})},`block_${a}`)},De=n((({label:e,blocks:t,context:n})=>{const{hasContent:i,icon:l,handleToggle:s}=(({context:e,blocks:t})=>{const[r,a]=e.useState(!1),n=t?.length;return{isActive:r,hasContent:n,icon:r?"MinusIcon":"PlusIcon",handleToggle:e=>{if(!n)return;a(!r);const t=(({currentTarget:e})=>e.nextSibling)(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`}}})({context:n,blocks:t});return a("li",{className:"border-0 border-b border-solid border-main-divider last:border-b-0",children:[a("button",{className:"border-none bg-transparent px-0 py-5 flex justify-between text-left w-full font-sans text-primary-text\n "+(i?"group cursor-pointer":""),onClick:s,children:[r("span",{className:"text-xl pr-2.5 font-medium "+(i?"group-hover:text-primary-main":""),children:e}),i?r(m,{name:l,width:"24",height:"24",asSVG:!0}):null]}),i?r(Se,{blocks:t,context:n}):null]})})),Le=n((({title:e,accordionItems:t,context:n,className:i})=>a("section",{className:`p-[50px] font-sans bg-white text-primary-text ${i||""}`,children:[e?r(s,{headingType:"h4",className:"mb-2.5",title:e}):null,t?.length?r("ul",{className:"list-none m-0 p-0",children:t.map(((e,t)=>r(De,{...e,context:n},`AccordionItem${t}`)))}):null]}))),Ie=n((({className:e,title:t,benefits:n})=>a("section",{className:`font-sans text-primary-text bg-white p-12 pb-2 flex flex-col items-center ${e||""}`,children:[t?r(s,{headingType:"h2",className:"max-w-[47rem] text-center",title:t}):null,n?.length?r("div",{className:"grid grid-cols-2 gap-5 mt-9",children:n.map(je)}):null]}))),je=(e,t)=>a("div",{className:"flex items-center p-10 gap-5 max-w-[580px]",children:[e.icon&&r(m,{className:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",name:e.icon,width:"70",height:"70"}),a("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)),_e=({colData:e,colsLengthForScroll:t,activeCardIndex:r,setActiveCardIndex:a})=>{const n=e?.length&&e.length>t;return{nextClick:()=>a(r+1),prevClick:()=>a(r-1),isScrollAvailable:n,showNextButton:n&&e?.length-r>t,showPrevButton:n&&r>0}},Re="bg-gradient-to-r from-main-gradient-start to-main-gradient-end",Ae="border-main-stroke border-solid border",Me="border-main-divider border border-t-0 border-x-0",Be="w-[200px] mr-6",Pe=n((({icon:e,image:t,title:n,link:i})=>a("div",{className:`w-80 box-border flex flex-col items-center rounded-t-md border-b-0 px-7 pt-7 pb-[46px] ${Ae} ${Re}`,role:"columnheader",scope:"col",children:[e&&!t?.src&&r(m,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",name:e,width:"63",height:"63"}),t?.src&&r(w,{className:"mb-[18px]",image:t}),n&&r(s,{headingType:"h4",className:"text-center text-white",title:n}),i?.text&&r("div",{className:"mt-auto w-full",children:r(H,{href:i.href,target:i.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:i.text})})})]}))),Ve={comparison:"flex gap-4 duration-1000",tariff:"flex flex-grow duration-1000"},Oe=n((({children:e,activeCardIndex:t,columnWidth:a,version:n="comparison"})=>r("div",{className:"flex flex-1 overflow-hidden",children:r("div",{className:Ve[n],style:{transform:`translateX(-${t*a}px)`},children:e})}))),Fe=n((({cell:e,isFirstRow:t,isLastRow:a,isFillGradient:n})=>r("div",{className:`w-80 box-border flex flex-col ${Ae} ${a?"border-t-0 rounded-b-md":"border-y-0"} ${n?Re:""}`,role:"cell",children:r("div",{className:`mx-7 h-full ${Me} ${n&&t?"border-t":""} ${a?"":"border-solid"}`,children:e.map(((e,t)=>Ze(e,t,n)))})}))),Ze=({label:e,description:t},n,i)=>a("div",{className:"first:pt-7 pt-6 last:pb-7",children:[e&&r("h5",{className:"text-xl font-medium m-0 "+(i?"text-white":""),children:e}),t&&r("div",{className:"text-sm opacity-80 "+(i?"text-white":"text-secondary-text"),children:t})]},String(n)),He=n((({children:e})=>r("div",{className:"self-start flex flex-col",role:"row",children:r("div",{className:"flex",children:e})}))),Ge=n((({row:{header:e,data:t},activeCardIndex:n,isColoredFirstColumn:i,isFirstRow:l,isLastRow:s})=>a(He,{children:[e?.title?r("div",{className:`text-sm py-7 ${Me} w-[200px] mr-6 ${s?"":"border-solid"}`,children:e.title}):null,t?.length?r(Oe,{activeCardIndex:n,columnWidth:336,children:t.map(((e,t)=>r(Fe,{cell:e,isFirstRow:l,isLastRow:s,isFillGradient:i&&0===t},String(t))))}):null]}))),Ee=n((({className:e,context:t,title:n,rowHeaders:i,columns:l,visibleRowLength:c=0,isColoredFirstColumn:o=!1})=>{const m=t.useRouter(),{handlerDecorator:d}=t,[h,x]=t.useState(0),[p,u]=t.useState(!c),b=l?.map((({header:e})=>e||{})),f=l?.map((({data:e})=>e))||[],g=i?.map(((e,t)=>({header:e,data:f.map((e=>e?.[t]||[{}]))}))).slice(0,p?i.length:c),{nextClick:N,prevClick:v,isScrollAvailable:y,showNextButton:w,showPrevButton:k}=_e({colData:f,colsLengthForScroll:2,activeCardIndex:h,setActiveCardIndex:x});return a("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center mb-9 mx-auto",title:n}),a("div",{role:"table",children:[b?.length?a(He,{children:[r("div",{className:Be,role:"columnheader",scope:"col"}),r(Oe,{activeCardIndex:h,columnWidth:336,children:b.map(((e,t)=>r(Pe,{...e,link:e.link&&P({router:m,handlerDecorator:d},e.link)},String(t))))})]}):null,g?.length?a("div",{className:"relative",children:[g.map(((e,t,{length:a})=>r(Ge,{row:e,isFirstRow:0===t,isLastRow:t+1===a,activeCardIndex:h,isColoredFirstColumn:o},String(t)))),y?r("div",{children:a("div",{className:"absolute top-7 right-7 z-10",children:[r(oe,{onClick:N,disabled:!w,ariaLabel:"Пролистать вправо"}),r(oe,{className:"mt-4 rotate-180",onClick:v,disabled:!k,ariaLabel:"Пролистать влево"})]})}):null]}):null]}),y?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null,c?r("div",{className:"pr-[50px]",children:a("div",{className:"flex w-full",children:[r("div",{className:Be}),r("button",{onClick:()=>u(!p),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:p?"Скрыть":"Показать все параметры"})})]})}):null]})}));function We(e,t){const{data:r}=e(ze(t),(()=>async function(e){const t=await fetch(ze(e));return await t.json()}(t)));return r||{}}function ze(e){return`/wcms-resources/${e||"credit-calculator-data"}.json`}const Ue=[{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"}],Je=n((({text:e,checked:t,onChange:n,className:i})=>r("div",{className:i,children:a("label",{className:"flex items-center cursor-pointer relative",children:[r("input",{className:`peer appearance-none w-5 h-5 border-solid border ${t?"border-black":"border-main-stroke"} rounded checked:bg-primary-main checked:border-primary-main m-0`,type:"checkbox",onChange:e=>{n(e.target.checked)},checked:t}),r(se,{paths:Ue,className:"hidden absolute left-1 ml-px peer-checked:block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"}),e?r("span",{className:"font-sans ml-3 text-sm leading-5 cursor-pointer",children:e}):null]})}))),Xe=e=>new Intl.NumberFormat("ru-RU",{maximumSignificantDigits:3}).format(e),Qe=n((({className:e,title:t,items:n=[],min:i=1,max:l=100,step:s=1,value:c=i,onChange:o})=>{const m=e=>{if(!o)return;const t=Number(e.replace(/\D/g,""));o(t)},d={backgroundSize:`${(100*(c-i)/(l-i)).toFixed(2)}% 100%`};return a("div",{className:e,children:[a("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 border-solid border-main-stroke rounded-md\n outline-none p-0 pl-4 m-0 box-border text-primary-text "+(t?"pt-4":""),value:Xe(c),onChange:e=>m(e.target.value),onBlur:()=>{o&&(c<i&&o(i),c>l&&o(l))}}),r("div",{className:"absolute inset-x-0 top-8 px-4",children:r("input",{className:"box-border w-full m-0 cursor-pointer slider",type:"range",min:i,max:l,step:s,value:c,onChange:e=>m(e.target.value),style:d})})]}),r("div",{className:"flex justify-between my-3",children:n.map(((e,t)=>r("span",{className:"text-xs leading-[14px] text-secondary-text pl-4",children:e},String(t))))})]})})),qe=(e,t,r)=>Math.max(t,Math.min(e,r)),Ke=3e4,Ye=3e6,et=Math.round(41.5),tt=n((({context:e,className:t,directoryName:n})=>{const[i,l]=e.useState(void 0),[s,c]=e.useState(void 0),[o,m]=e.useState(!0),[d,h]=e.useState(!0),x=(e=>{const{tableRows:t,isAnnuity:r=!1}=e;return t&&t.find((e=>e.isAnnuity===r))||{}})({tableRows:We(e.useAsyncData,n).rows,isAnnuity:o}),p=x.maxSum&&x.minSum?(x.maxSum-x.minSum)/2:1485e3,u=x.maxMonths&&x.minMonths?Math.round((x.maxMonths-x.minMonths)/2):et,b=x?.minSum||Ke,f=x?.maxSum||Ye,g=x?.minMonths||1,N=x?.maxMonths||84,v=(e=>{const{calculatorParams:t,isInsurance:r}=e;return t?r?t?.rateWithInsurance||5:t?.rateWithoutInsurance||5:5})({calculatorParams:x,isInsurance:d}),y=(e=>{const{calculatorParams:t,paymentType:r,rate:a,sum:n,months:i}=e;if(!t)return 0;const l=qe(n,t.minSum||Ke,t.maxSum||Ye);if("annuity"===r){const e=Number(a)/1200;return l*(e+e/(Math.pow(1+e,i)-1))}return l/i+l*(Number(a)/12)})({calculatorParams:x,paymentType:"annuity",rate:v,sum:i||p,months:s||u}),w=((e,t)=>{const r=Math.ceil((t-e)/12),a=Math.floor(e/12)+1,n=new Array(Math.min(r-1,5)).fill(0).map(((e,t)=>a+t)),i=r+a-1;return n.concat(i)})(g,N);function k(e){c(qe(12*e,g,N))}return r("section",{className:`font-sans text-primary-text p-10 bg-white ${t||""}`,children:a("div",{className:"box-border p-[49px] pr-[56px] mx-auto w-max border-solid border-[3px] border-primary-main rounded-md",children:[a("div",{className:"flex justify-between ",children:[a("div",{className:"mr-[42px]",children:[r(Qe,{title:"Желаемая сумма кредита, ₽",items:[`От ${Xe(b)} рублей`,`До ${Xe(f)} рублей`],min:b,max:f,step:1e3,value:i||p,onChange:l}),r(Qe,{className:"mt-[23px]",title:"Срок кредита, месяцев",items:["Или выберите из предложенных вариантов ниже"],min:g,max:N,step:1,value:s||u,onChange:c}),r("div",{className:"flex mb-7",children:w.map(((e,t)=>function(e,t,n){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:()=>n(e),children:a("span",{className:"font-semibold text-sm",children:[e," ",1===e?"год":e>4?"лет":"года"]})},String(t))}(e,t,k)))}),r(Je,{text:"Получаю пенсию на карту Россельхозбанка",checked:o,onChange:m}),r(Je,{className:"mt-3 mb-7",text:"Комплексная страховая защита",checked:d,onChange:h})]}),a("div",{className:"box-border h-fit p-9 bg-primary-main rounded-md text-white",children:[r("div",{className:"text-base mb-[18px]",children:"Наше предложение"}),r("div",{className:"text-sm opacity-60",children:"Ежемесячный платёж"}),a("div",{className:"text-lg mb-3",children:[Xe(Math.round(y))," ₽"]}),r("div",{className:"text-sm opacity-60",children:"Ставка"}),a("div",{className:"text-lg",children:[v," %"]})]})]}),a("div",{className:"flex items-center",children:[r(H,{className:"mr-3",text:"Отправить заявку",version:"primary",href:"#"}),r("div",{className:"w-80 text-2xs leading-4 text-secondary-text","aria-label":"Соглашение на обработку персональных данных",children:"Отправляя заявку, вы соглашаетесь на обработку персональных данных соответственно требованиям ФЗ «О персональных данных»"})]})]})})}));const rt="https://www.cbr-xml-daily.ru/daily_json.js",at=["USD","EUR"],nt={USD:"DollarIcon",EUR:"EuroIcon"},it=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],lt=n((({className:e="",context:t,title:n="Курсы обмена валют"})=>{const{data:i}=t.useAsyncData(rt,ot);return r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n&&r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px] "+(n?"mb-3":"")}),buttons:it?.length?r(G,{context:t,buttons:it,className:"flex mt-9 gap-3"}):null,children:a("table",{children:[r("thead",{children:a("tr",{children:[r(st,{children:"Валюта"}),r(st,{className:"pl-11",children:"Курс"})]})}),r("tbody",{children:at.map(ht(i))})]})})})})),st=n((({className:e="",children:t})=>r("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ct=n((({className:e="",children:t})=>r("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function ot(){const e=await fetch(rt);return await e.json()}const mt=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),dt=e=>e?mt.format(e):"",ht=e=>t=>{const n=(e?.Valute||{})[t]?.Value;return a("tr",{children:[r(ct,{className:"pt-4",children:a("div",{className:"flex items-center",children:[r(m,{name:nt[t],width:"24",height:"24"}),r("span",{className:"ml-2",children:t})]})}),r(ct,{className:"pt-4 pl-11",children:dt(n)})]},t)},xt=["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"],pt={"bg-white":"text-primary-main",transparent:"text-white"},ut={"bg-white":"text-black",transparent:"text-white"},bt=n((({className:e,href:t,children:n,targetBlank:i,bgColor:l="bg-white",hideTitle:s})=>a("a",{className:`inline-flex items-center font-sans no-underline ${e||""}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self","aria-label":"Россельхозбанк",children:[r(se,{className:`${pt[l]} w-10`,viewBox:"0 0 40 45",paths:xt.map((e=>({d:e})))}),!s&&r("span",{className:`${ut[l]} text-base font-medium ml-2.5`,children:n||"Россельхозбанк"})]}))),ft=n((({className:e,context:t})=>{const{term:n,setTerm:i}=t.useSearch();return a("form",{className:`relative ${e||""}`,children:[a("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(m,{name:"LoupeIcon",width:"24",height:"24"})}),!n&&r("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-base text-secondary-text",children:"Поиск по сайту"})]}),r("input",{id:"search-bar-input",className:"h-12 pl-12 w-full peer font-sans font-normal text-base text-black border border-solid rounded h-full box-border outline-none pr-[6%] border-main-divider focus:border-primary-text",value:n,onChange:e=>i(e.target.value),type:"text",name:"search-bar-input"}),r(H,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e.preventDefault(),console.log("click")},children:r("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),gt=n((({className:e,items:t,hasButton:n,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return a("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(Nt):null,n?r(H,{version:"primary",className:"my-4",...P({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),Nt=(e,t)=>{const{type:n,text:i,description:l}=e;return a("div",{className:"mb-4",children:[r("div",{children:vt(n,i)}),r("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},vt=(e,t="")=>{switch(e){case"tel":return r("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${yt(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})}},yt=e=>e.replaceAll(/\D/g,""),wt=n((({links:e,className:t="",context:a})=>{const n=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:t,children:e?.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:e.map(((e,t)=>r(kt,{index:t,...P({router:n,handlerDecorator:i},e)},String(t))))}):null})})),kt=n((({className:e="",index:t,text:a,href:n,target:i,onClick:l})=>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:n,target:i,onClick:l,children:a||`Документ ${t}`}))),$t=e=>t=>e?.href===t?.href,Ct=(e,t)=>{return(a=e,n=t,(a||[]).map((e=>n?.find($t(e))||e))).concat((r=e,(t||[]).filter((e=>!r?.find($t(e))))));var r,a,n};function St(e){const{data:t}=e(Dt(),Tt);return t||{}}async function Tt(){const e=await fetch(Dt());return await e.json()}function Dt(){return`/wcms-resources/${c.SITEMAP||"sitemap"}.json`}const Lt=n((({className:e,items:t,context:a})=>{const n=St(a.useAsyncData),i=Ct(n.topItems,t),l={router:a.useRouter(),handlerDecorator:a.handlerDecorator};return r("div",{className:`flex items-start justify-start gap-11 xl:gap-5 ${e||""}`,children:i?.map(((e,t)=>It(e,t,l)))})})),It=(e,t,{router:n,handlerDecorator:i})=>{const{text:l,href:s,items:c,target:o}=e;return a("div",{className:"flex flex-col gap-[14px]",children:[r("a",{className:"block font-sans font-medium text-base text-primary-text no-underline",href:s,target:o||"_self",children:l||`Раздел ${t}`}),c?.map(((e,t)=>r(jt,{...P({router:n,handlerDecorator:i},e),index:t},String(t))))]},String(t))},jt=n((({text:e,href:t,target:a,index:n})=>r("a",{className:"block font-sans font-normal text-base text-secondary-text hover:text-primary-main no-underline",href:t,target:a||"_self",children:e||`Раздел ${n}`}))),_t=[{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"}],Rt=n((({href:e})=>{const{icon:t,width:a,height:n,label:i}=_t.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,"aria-label":i,target:"_blank",rel:"noopener noreferrer",children:m&&r(m,{name:t,width:a,height:n,asSVG:!0,className:"block"})}):null})),At=n((({className:e,media:t,context:a})=>{const n=a.useRouter(),{handlerDecorator:i}=a;return r("div",{className:`flex items-end justify-end gap-2 pt-[30px] pb-7 ${e||""}`,children:t?.map(((e,t)=>r(Rt,{...P({router:n,handlerDecorator:i},e)},String(t))))})})),Mt=n((({className:e,links:t,context:n})=>{const i=n.useRouter(),{handlerDecorator:l}=n;return a("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(Bt,{index:t,...P({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),Bt=n((({className:e,index:t,text:a,href:n,target:i,onClick:l})=>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:n,target:i,onClick:l,children:a||`Документ ${t}`}))),Pt=n((({className:e,documents:t,relatedEnterprises:n,contacts:i,socialMedia:l,topItems:s,context:c})=>a("footer",{className:`px-9 py-10 bg-white ${e||""}`,children:[a("div",{className:"flex items-stretch gap-[54px] pb-8 xl:gap-8",children:[r(bt,{className:"w-[280px] xl:w-[220px]"}),r(ft,{context:c,className:"grow"})]}),a("div",{className:"flex items-stretch gap-[54px] xl:gap-8",children:[r(gt,{className:"w-[280px] shrink-0 overflow-hidden xl:w-[220px]",items:i,context:c,hasButton:!0}),r(Lt,{className:"pt-[3px]",context:c,items:s})]}),r(At,{media:l,context:c}),r(wt,{links:n,context:c}),r(Mt,{links:t,context:c})]}))),Vt=(e,t,r=((e,t)=>t.startsWith(e)))=>r(j(e),(e=>(e||"").replace(A,""))(j(I(e)?t.href:t.pathname))),Ot=e=>t=>Vt(t.href,e),Ft=e=>(t=[])=>{const r=t?.filter(Ot(e));var a;return r?.length?(a=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>a(e)>a(t)?e:t)))(r):null},Zt=e=>t=>t.items?.some(Ot(e))||Vt(t.href,e)||((e,t)=>_(e)===_(t.href))(t.href,e),Ht="absolute left-0 -bottom-3 w-full h-[2px]",Gt=n((({className:e,text:t,href:n,target:i,active:l,onClick:s,children:c,bgColor:o="bg-white"})=>a("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:n,target:i,onClick:s,children:[r("span",{className:Et(o,l),children:t||c}),l?r("div",{className:Wt(o,l)}):null]}))),Et=(e,t)=>{let r="text-white";return"bg-white"===e&&(r=t?"text-primary-main":"text-primary-text hover:text-primary-main"),`${r} font-sans font-normal text-base`},Wt=(e,t)=>t?`${"bg-white"===e?"bg-primary-main":e} ${Ht}`:Ht,zt=n((({className:e="",text:t,href:a,target:n,active:i,flat:l,onClick:s,children:c,ariaLabel:o,bgColor:m="bg-white"})=>r("a",{className:`${Ut(m,i,l)} ${e}`,href:a,target:n,onClick:s,rel:"noopener noreferrer","aria-label":o,children:r("span",{className:Jt(m,i,l),children:t||c})}))),Ut=(e,t,r)=>{let a="border-transparent";return t&&(a="rounded-md "+("bg-white"===e?"border-primary-main":"border-white")),`${a} inline-block border border-solid bg-transparent text-center no-underline ${r?"":"px-4 py-2"}`},Jt=(e,t,r)=>{let a="text-white";return"bg-white"===e&&(a=t?"text-primary-main":(r?"text-primary-text":"text-secondary-text")+" hover:text-primary-main"),`${a} font-sans font-normal text-sm`},Xt=n((({className:e="",children:t,ariaLabel:a})=>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":a,children:t}))),Qt={"bg-white":"text-primary-text hover:text-primary-main",transparent:"text-white"},qt={"bg-white":"text-secondary-light hover:text-secondary-hover",transparent:"text-white"},Kt={"bg-white":"GridIcon",transparent:"GridIconWhite"},Yt=n((({context:e,className:t,defaultLocation:n="",bgColor:i="bg-white"})=>{const[l,s]=e.useGeolocation(n);return a("div",{className:`flex items-center ${t||""}`,children:[r(zt,{className:"mr-5",flat:!0,href:"#",text:l,ariaLabel:"Местоположение",onClick:s,bgColor:i}),r(zt,{className:"mr-7",flat:!0,href:"#",text:"Офисы и банкоматы",ariaLabel:"Список всех доступных офисов и банкоматов",bgColor:i}),r(Xt,{className:`mr-5 ${Qt[i]}`,ariaLabel:"Поиск по сайту",children:r(m,{name:"LoupeIcon",className:"h-full",asSVG:!0,color:"none"})}),r(Xt,{className:`mr-5 ${Qt[i]}`,ariaLabel:"Профиль",children:r(m,{name:"ProfileIcon",className:"h-full",asSVG:!0,color:"none"})}),r(Xt,{className:`${qt[i]} min-w-[32px] min-h-[32px]`,ariaLabel:"Дополнительные ссылки",children:r(m,{name:Kt[i],className:"h-full",asSVG:!0,color:"none"})})]})})),er={"bg-white":"bg-main-divider",transparent:"bg-main-divider opacity-30"},tr=n((({className:e,defaultLocation:t,bgColor:n="bg-white",context:i,topItems:l})=>{const s=i.useRouter(),c=St(i.useAsyncData),{handlerDecorator:o}=i,m=Ct(c.topItems,l),d=m.find(Zt(s)),h=d?.items,x=Ft(s)(h),p=m.map(((e,t)=>r(zt,{active:e===d,...P({router:s,handlerDecorator:o},e),ariaLabel:e.text,bgColor:n},String(t)))),u=h?.map((e=>r(Gt,{className:"mr-8",active:e===x,...P({router:s,handlerDecorator:o},e),bgColor:n},e.href)));return r("header",{className:`pt-5 pb-8 px-20 ${n} ${e||""}`,children:a("div",{className:"container",children:[a("div",{className:"flex items-center",children:[r(bt,{className:"mr-8",bgColor:n}),p,r(Yt,{context:i,className:"ml-auto",defaultLocation:t,bgColor:n})]}),r("div",{className:`mt-5 h-[1px] ${er[n]}`}),r("nav",{className:"mt-5",children:u})]})})})),rr=n((({className:e="",context:t,title:n="Мобильное приложение",qr:i,buttons:l=[]})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n&&r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:l?.length?r(G,{context:t,buttons:l,className:"flex mt-9 gap-3"}):null,children:a("div",{className:"flex items-center",children:[i?.src&&i?.href&&r("a",{href:i.href,target:"_blank",children:r("img",{src:i.src,alt:n,title:n,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-код и скачайте приложение"})]})})}))),ar=n((({className:e,text:t,onClick:a,href:n,target:i,isActive:l})=>r("a",{className:`bg-inherit no-underline px-4 py-2.5 cursor-pointer rounded text-sm border border-solid hover:text-primary-main ${e||""} ${l?"border-primary-main text-primary-main":"border-white text-secondary-text"}`,onClick:a,href:n,target:i,children:t}))),nr=n((({className:e,context:t,title:n,buttons:i})=>{const l=t.useRouter(),{handlerDecorator:s}=t,c=Ft(l)(i);return a("section",{className:`font-sans text-primary-text rounded-[40px] flex items-center justify-between ${e||""}`,children:[r("h2",{className:"font-medium text-xl m-0",children:n}),i?.length?r("div",{className:"flex rounded-md overflow-hidden bg-white",children:i.filter((({text:e})=>e)).map(((e,t)=>r(ar,{className:"first:rounded-tl-md first:rounded-bl-md last:rounded-tr-md last:rounded-br-md",isActive:e===c,...P({router:l,handlerDecorator:s},e)},String(t))))}):null]})})),ir=n((({text:e,href:t,target:a,onClick:n,className:i="",children:l})=>t?r("a",{className:`no-underline ${i}`,href:t,target:a,onClick:n,children:r("span",{className:i,children:e||l})}):r("span",{className:i,children:e||l})));function lr(e){return t=>t.reduce(((t,r,a)=>t.length?t.concat({...e,key:a},r):[r]),[])}const sr={primary:"bg-main",secondary:"bg-white/30"},cr={primary:"text-primary-text",secondary:"text-white"},or={primary:"text-secondary-text",secondary:"text-white"};const mr=n((({className:e="",context:t,title:n,headingType:i="h2",description:l,benefits:c,buttons:o,image:d,items:h,version:x="primary"})=>a("div",{className:`flex grow justify-between items-stretch text-primary-text ${e}`,children:[r("div",{className:"flex flex-col",children:a(Q,{context:t,title:n&&r(s,{headingType:i,title:n,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:o?.length?r(G,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,children:[l&&r(E,{className:"mt-4 max-w-[600px]",description:l}),c?.length?r("div",{className:"flex gap-6 mt-6 mb-3.5",children:c.map(((e,t)=>function(e,t,n){return a("div",{className:"flex gap-4 items-center",children:[e.icon&&r(m,{className:`w-[50px] h-[50px] min-w-[50px] min-h-[50px] rounded-full p-[10px] box-border ${sr[n]}`,name:e.icon,width:"24",height:"24",asSVG:!0}),a("div",{className:"flex gap-1 flex-col h-full max-w-[149px]",children:[r("div",{className:`font-medium text-xl m-0 ${cr[n]}`,children:e.label}),e.description&&r("div",{className:`font-normal text-sm ${or[n]}`,children:e.description})]})]},String(t))}(e,t,x)))}):null,h?.length?r(X,{className:"mt-5",items:h}):null]})}),d?.src&&r(w,{className:"mt-auto",image:d})]}))),dr={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},hr={primary:"text-secondary-text",secondary:"text-white/80"},xr=n((e=>{const{context:t,className:n,breadcrumbs:i,version:l="primary"}=e,s=t.useRouter(),{handlerDecorator:c}=t;return a("section",{className:`font-sans pt-10 pl-[50px] pb-[50px] pr-[7.5rem] box-border min-h-[420px] ${n||""} ${dr[l]}`,children:[i?.length?r("div",{className:"text-xs mb-6",children:lr(r("span",{className:`mx-2 ${hr[l]}`,children:"/"}))(i.map(((e,t)=>r(ir,{...P({router:s,handlerDecorator:c},{className:hr[l],...e})},String(t)))))}):null,r(mr,{...e})]})})),pr=n((({className:e,context:t,duration:n=0,slides:i=[]})=>{const l=i.map((e=>e.nav)),s=i.map((e=>e.productBlock)),[c,o]=t.useState(0);return a("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,a)=>function(e,t,a){return r("section",{className:"flex grow-0 shrink-0 basis-full",role:"listitem",children:r("div",{className:"p-10 flex grow",children:r(mr,{className:"pl-2.5 pt-2.5 pb-1.5 pr-[6.25rem]",context:a,...e})})},String(t))}(e,a,t)))}),r("div",{className:"flex",children:l.map(((e,t)=>function({slide:e,i:t,activeSlideIndex:n,onClick:i,duration:l}){const s=t===n,c=s?"animate-slide":"",o=s?"text-primary-text":"text-secondary-text";return a("button",{type:"button",onClick:i,"aria-label":e?.title,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:[a("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 ${o}`,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:`${l}s`,animationFillMode:"forwards"}})]},String(t))}({slide:e,i:t,activeSlideIndex:c,onClick:()=>o(t),duration:n})))})]})}));const ur={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},br=n((({className:e="",context:t,title:n="Акции и спецпредложения",date:i,description:l,buttons:c=[],version:o="primary"})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ur[o]} ${ee(e)} ${Y(e)} `,children:r(Q,{context:t,title:n?r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}):null,buttons:c?.length?r(G,{context:t,buttons:c,className:"flex mt-9 gap-3"}):null,children:a("div",{className:"mt-1.5",children:[i?r("div",{className:"text-sm mb-2",children:fr(i)}):null,r("div",{className:"text-base",children:l})]})})})));function fr(e){return new Date(e).toLocaleString("ru-RU",{day:"numeric",month:"long",year:"numeric"}).replace("г.","")}const gr=n((({className:e,title:t,showLines:n=!0,steps:i})=>a("section",{className:`box-border font-sans text-primary-text bg-white px-20 py-[50px] flex flex-col items-center ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center",title:t}),i?.length?a("div",{className:"box-border py-0.5 mb-0.5 "+(t?"mt-9":""),children:[r("div",{className:"flex items-center px-[88px]",children:lr(r("div",{className:"h-0.5 w-full bg-secondary-light "+(n?"":"opacity-0")}))(i.map(((e,t)=>Nr(e,t))))}),r("div",{className:"flex justify-between gap-x-[101px]",children:i.map(vr)})]}):null]}))),Nr=(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(m,{name:e.icon,width:"48",height:"48"})||r("span",{className:"font-medium text-title-sm text-secondary-text",children:t+1})})},String(t)),vr=(e,t)=>a("div",{className:"flex flex-col items-center text-center relative w-[276px] whitespace-pre-line overflow-hidden",children:[e.label&&r("div",{className:"font-medium text-xl m-0 mt-4",children:e.label}),e.description&&r("div",{className:"font-normal text-sm text-secondary-text "+(e.label?"mt-2":"mt-4"),children:e.description})]},String(t)),yr=n((({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",{children:e.map(((e,t)=>wr(e,t)))})}))),wr=({label:e,description:t,list:n,image:i,buttons:l},s)=>a("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}),n?.items?.length?r("div",{className:"flex flex-col justify-between items-start",children:r("div",{role:"list",children:n.items.map(((e,t)=>r(be,{className:"text-sm",text:e,version:"gray",isDotted:n.isDotted??!0},String(t))))})}):null,i&&r(w,{image:i}),l?.length?l.map((({icon:e,...t},a)=>r(H,{className:(a>0?"ml-3":"")+" w-12 h-12",appendLeft:e&&r(m,{name:e,width:"24px",height:"24px",asSVG:!0}),...t},String(a)))):null]},String(s)),kr=n((({row:{header:e,data:t},activeCardIndex:n,isLastRow:i})=>a(He,{children:[r("div",{className:"text-sm py-5 w-[354px] flex-shrink-0 border-main-divider border border-t-0 border-x-0 "+(i?"":"border-solid"),children:a("div",{className:"flex items-center text-primary-text",children:[e?.icon&&r(m,{className:"mr-[14px] max-w-6 max-h-6",name:e.icon,width:"24px",height:"24px",asSVG:!0}),e?.title]})}),t?.length?r(Oe,{activeCardIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>r(yr,{cell:e,isLastRow:i},String(t))))}):null]}))),$r={Accordion:Le,BenefitsBlock:Ie,ComparisonTable:Ee,CreditCalculator:tt,ExchangeRateTile:lt,Footer:Pt,Gallery:ke,Header:tr,Headline:h,LinkDocs:y,MiniGallery:$e,MobileAppTile:rr,PictureText:$,ProductBlock:xr,ProductGallery:pr,ProductTile:ie,PromoTile:br,StepsBlock:gr,TariffsTable:n((({className:e,context:t,title:n,rowHeaders:i,columns:l})=>{const[c,o]=t.useState(0),m=l?.map((({data:e})=>e))||[],d=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[{}]))}))),{nextClick:h,prevClick:x,isScrollAvailable:p,showNextButton:u,showPrevButton:b}=_e({colData:m,colsLengthForScroll:2,activeCardIndex:c,setActiveCardIndex:o});return a("section",{className:`bg-white font-sans py-[50px] pl-[50px] overflow-hidden text-primary-text relative ${e||""}`,children:[r(s,{headingType:"h2",className:"max-w-[47rem] text-center mb-9 mx-auto",title:n}),a("div",{role:"table",children:[d?.length?a("div",{className:"relative",children:[d.map(((e,t,{length:a})=>r(kr,{row:e,isLastRow:t+1===a,activeCardIndex:c},String(t)))),p?r("div",{children:a("div",{className:"absolute top-7 right-7 z-10",children:[r(oe,{onClick:h,disabled:!u,ariaLabel:"Пролистать вправо"}),r(oe,{className:"mt-4 rotate-180",onClick:x,disabled:!b,ariaLabel:"Пролистать влево"})]})}):null]}):null,p?r("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"}):null]})]})})),TextBlock:T,Tile:re,Navigation:nr},Cr=n((({className:e,onClick:t,ariaLabel:a})=>r("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":a,children:Sr()}))),Sr=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return a("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"})]})},Tr=n((({className:e,context:t})=>{const n=t.useLikeService();return a("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(Cr,{onClick:n.like,ariaLabel:"Поставить отметку «лайк»"}),r(Cr,{onClick:n.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),r("span",{className:"select-none",children:n.likeCount})]})})),Dr=n((({className:e,context:t,title:n,description:i="Блок в разработке..."})=>r("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${ee(e)} ${Y(e)} `,children:a(Q,{context:t,title:n?r(s,{headingType:K(e),title:n,className:"whitespace-pre-wrap max-w-[600px]"}):null,children:[i?r(E,{className:"mt-4 max-w-[600px]",description:i}):null,r("figure",{className:"m-0 min-w-[600px]",children:Lr()})]})}))),Lr=(e=3)=>jr(100,e).map((e=>Math.floor(e))).map(Ir),Ir=(e=100,t)=>r("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),jr=(e,t)=>[e].concat(t>0?jr(e/1.618,t-1):[]),_r=({blockClassName:e,block:t,render:r})=>r({blockClassName:e,block:t}),Rr=n((({className:e,context:t,blocksRegistry:n,data:{style:i,blocks:l,slots:s={},likeControl:c,colorPalette:o="pc"},blockDecorator:m=_r})=>{const{header:d}=s;return a("section",{className:`relative ${Mr(i)} ${e||""}`,"data-theme":o,children:[d?.blocks?.length?r("div",{className:`${Mr(d?.style)}`,children:d.blocks.map(((e,r)=>Ar({block:e,blockDecorator:m,blocksRegistry:n,context:t},r)))}):null,l?.length?r("div",{className:"container grid grid-cols-12 gap-1",children:l.map(((e,r)=>Ar({block:e,blockDecorator:m,blocksRegistry:n,context:t},r)))}):null,c&&r("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:r(Tr,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})}));function Ar({block:e,blockDecorator:t,blocksRegistry:a,context:n},i){const{type:l}=e;l&&l in a||console.warn(`No block with "${l}" is registered`);const s=a[l||"Placeholder"]||Dr;return t({blockClassName:Mr(e.style),block:e,render:e=>{const{version:t,content:a}=e.block;return r(s,{className:e.blockClassName,version:t,context:n,...a},`${l}-${i}`)}},`block-${i}`)}function Mr(e){return e?e.join(" "):""}const Br=n((({HeadComponent:e,data:t,children:n})=>{const{title:i,main:l,og:s,twitter:c,jsonLd:o}=t,{description:m,keywords:d,canonical:h,robots:x}=l||{};return a(e,{children:[r("title",{children:i}),r("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),m&&r("meta",{name:"description",content:m}),d&&r("meta",{name:"keywords",content:d.join(",")}),x&&r("meta",{name:"robots",content:x.join(",")}),Pr(s),Vr(c),h&&r("link",{rel:"canonical",href:h}),o&&r("script",{type:"application/ld+json",children:o}),n]})}));function Pr(e){return e?Object.entries(e).map((([e,t])=>r("meta",{name:`og:${e}`,content:t},e))):null}function Vr(e){return e?Object.entries(e).map((([e,t])=>r("meta",{name:`twitter:${e}`,content:t},e))):null}function Or(e){const{mobile:t,...r}=e;return r}function Fr(e){return e?.filter((e=>{return t=e?.type,(t||"")in $r;var t})).map(Or)}e.Blocks=$r,e.ContentPage=Rr,e.ContentPageHead=Br,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.Header=tr,e.Icon=m,e.LikeAPI=function(e,t=""){async function r(){try{const e=JSON.parse(globalThis.localStorage.getItem(i)||"");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:a}=await e.json();return globalThis.localStorage.setItem(i,JSON.stringify({token:r,name:a})),{token:r,name:a}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...a){if(!a.length)return[];const{token:n}=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:n},body:JSON.stringify({node_ids:a})}),{likes:i}=await r.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(a){if(!a)return 0;const{token:n,name:i}=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:n,UserID:i},body:JSON.stringify({node_id:a,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(a){if(!a)return 0;const{token:n,name:i}=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:n,UserID:i},body:JSON.stringify({node_id:a,user_name:i})}),{likes:l}=await r.json();return l||0}catch(e){return console.error(e),0}}}},e.joinList=lr,e.normalizePage=function(e){if(!e)return;const{blocks:t,slots:r}=e;return{...e,blocks:Fr(t),slots:r&&Object.keys(r).reduce(((e,t)=>({...e,[t]:{...r[t],blocks:Fr(r[t].blocks)}})),{})}},e.projectSettings=c,e.setup=t,e.url=R,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -3,11 +3,18 @@ exports.ContentPageHead = 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
5
|
exports.ContentPageHead = (0, uni_jsx_1.JSX)(({ HeadComponent, data, children }) => {
|
|
6
|
-
const { title, main
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
: null, twitter
|
|
10
|
-
? Object.entries(twitter).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
11
|
-
: null, canonical && (0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }), jsonLd && (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
6
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
7
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(HeadComponent, { children: [(0, jsx_runtime_1.jsx)("title", { children: title }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && (0, jsx_runtime_1.jsx)("meta", { name: "description", content: description }), keywords && (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: keywords.join(',') }), robots && (0, jsx_runtime_1.jsx)("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && (0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }), jsonLd && (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
12
9
|
});
|
|
10
|
+
function renderOpenGraph(og) {
|
|
11
|
+
return og
|
|
12
|
+
? Object.entries(og).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `og:${key}`, content: value }, key)))
|
|
13
|
+
: null;
|
|
14
|
+
}
|
|
15
|
+
function renderTwitter(twitter) {
|
|
16
|
+
return twitter
|
|
17
|
+
? Object.entries(twitter).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
18
|
+
: null;
|
|
19
|
+
}
|
|
13
20
|
//# sourceMappingURL=ContentPageHead.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAQ3B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,
|
|
1
|
+
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAQ3B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAChE,OAAO,CACL,wBAAC,aAAa,eACZ,4CAAQ,KAAK,GAAS,EACtB,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,WAAW,IAAI,iCAAM,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,GAAI,EAChE,QAAQ,IAAI,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EACjE,MAAM,IAAI,iCAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EAC3D,eAAe,CAAC,EAAE,CAAC,EACnB,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,IAAI,iCAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,SAAS,GAAI,EACtD,MAAM,IAAI,mCAAQ,IAAI,EAAC,qBAAqB,YAAE,MAAM,GAAU,EAC9D,QAAQ,IACK,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,EAAsC;IAC7D,OAAO,EAAE;QACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACvC,iCAAgB,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAAtC,GAAG,CAAuC,CACtD,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,iCAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,19 +20,18 @@ export interface SlotsMap {
|
|
|
20
20
|
header?: Slot;
|
|
21
21
|
}
|
|
22
22
|
export interface ContentPageMeta {
|
|
23
|
-
title
|
|
24
|
-
slug
|
|
25
|
-
main
|
|
23
|
+
title?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
main?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
canonical?: string;
|
|
29
|
+
robots?: string[];
|
|
30
|
+
};
|
|
26
31
|
og?: Record<string, string>;
|
|
27
32
|
twitter?: Record<string, string>;
|
|
28
33
|
jsonLd?: string;
|
|
29
34
|
}
|
|
30
|
-
export interface ContentPageMetaMain {
|
|
31
|
-
description?: string;
|
|
32
|
-
keywords?: string[];
|
|
33
|
-
canonical?: string;
|
|
34
|
-
robots?: string[];
|
|
35
|
-
}
|
|
36
35
|
export interface ContentPageDef extends ContentPageMeta {
|
|
37
36
|
style?: string[];
|
|
38
37
|
blocks?: BlockDef[];
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
export const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
4
|
-
const { title, main
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
: null, twitter
|
|
8
|
-
? Object.entries(twitter).map(([key, value]) => (_jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
9
|
-
: null, canonical && _jsx("link", { rel: "canonical", href: canonical }), jsonLd && _jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
4
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
5
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
6
|
+
return (_jsxs(HeadComponent, { children: [_jsx("title", { children: title }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && _jsx("meta", { name: "description", content: description }), keywords && _jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && _jsx("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && _jsx("link", { rel: "canonical", href: canonical }), jsonLd && _jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
10
7
|
});
|
|
8
|
+
function renderOpenGraph(og) {
|
|
9
|
+
return og
|
|
10
|
+
? Object.entries(og).map(([key, value]) => (_jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
11
|
+
: null;
|
|
12
|
+
}
|
|
13
|
+
function renderTwitter(twitter) {
|
|
14
|
+
return twitter
|
|
15
|
+
? Object.entries(twitter).map(([key, value]) => (_jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
16
|
+
: null;
|
|
17
|
+
}
|
|
11
18
|
//# sourceMappingURL=ContentPageHead.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,
|
|
1
|
+
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAChE,OAAO,CACL,MAAC,aAAa,eACZ,0BAAQ,KAAK,GAAS,EACtB,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,WAAW,IAAI,eAAM,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,GAAI,EAChE,QAAQ,IAAI,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EACjE,MAAM,IAAI,eAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EAC3D,eAAe,CAAC,EAAE,CAAC,EACnB,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,IAAI,eAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,SAAS,GAAI,EACtD,MAAM,IAAI,iBAAQ,IAAI,EAAC,qBAAqB,YAAE,MAAM,GAAU,EAC9D,QAAQ,IACK,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,EAAsC;IAC7D,OAAO,EAAE;QACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACvC,eAAgB,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAAtC,GAAG,CAAuC,CACtD,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,eAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/lib/types.d.ts
CHANGED
|
@@ -20,19 +20,18 @@ export interface SlotsMap {
|
|
|
20
20
|
header?: Slot;
|
|
21
21
|
}
|
|
22
22
|
export interface ContentPageMeta {
|
|
23
|
-
title
|
|
24
|
-
slug
|
|
25
|
-
main
|
|
23
|
+
title?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
main?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
canonical?: string;
|
|
29
|
+
robots?: string[];
|
|
30
|
+
};
|
|
26
31
|
og?: Record<string, string>;
|
|
27
32
|
twitter?: Record<string, string>;
|
|
28
33
|
jsonLd?: string;
|
|
29
34
|
}
|
|
30
|
-
export interface ContentPageMetaMain {
|
|
31
|
-
description?: string;
|
|
32
|
-
keywords?: string[];
|
|
33
|
-
canonical?: string;
|
|
34
|
-
robots?: string[];
|
|
35
|
-
}
|
|
36
35
|
export interface ContentPageDef extends ContentPageMeta {
|
|
37
36
|
style?: string[];
|
|
38
37
|
blocks?: BlockDef[];
|
|
@@ -1189,13 +1189,20 @@
|
|
|
1189
1189
|
}
|
|
1190
1190
|
|
|
1191
1191
|
const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
1192
|
-
const { title, main
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
: null, twitter
|
|
1196
|
-
? Object.entries(twitter).map(([key, value]) => (jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
1197
|
-
: null, canonical && jsx("link", { rel: "canonical", href: canonical }), jsonLd && jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
1192
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
1193
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
1194
|
+
return (jsxs(HeadComponent, { children: [jsx("title", { children: title }), jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && jsx("meta", { name: "description", content: description }), keywords && jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && jsx("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && jsx("link", { rel: "canonical", href: canonical }), jsonLd && jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
1198
1195
|
});
|
|
1196
|
+
function renderOpenGraph(og) {
|
|
1197
|
+
return og
|
|
1198
|
+
? Object.entries(og).map(([key, value]) => (jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
1199
|
+
: null;
|
|
1200
|
+
}
|
|
1201
|
+
function renderTwitter(twitter) {
|
|
1202
|
+
return twitter
|
|
1203
|
+
? Object.entries(twitter).map(([key, value]) => (jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
1204
|
+
: null;
|
|
1205
|
+
}
|
|
1199
1206
|
|
|
1200
1207
|
function isBlockInRegistry(blockType, registry) {
|
|
1201
1208
|
return (blockType || '') in registry;
|
|
@@ -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).UniMobileBlocks={})}(this,(function(e){"use strict";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...a}={})=>{const i=Object.assign({},a,r?{innerHTML:r.__html}:{});return e(t,i,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...a}=t||{},i=n?.slots?.default,l=r||i&&i();return e(Object.assign(a,l&&{children:l}),n)},e._tmpl.inheritAttrs=!1),e._tmpl);const i="likesToken";const l={h1:"text-m-title",h2:"text-m-title",h3:"text-m-title-md",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},s=a((e=>{const{className:t,headingType:r,title:a}=e;if(!r)return;return n(r,{className:`font-sans font-medium m-0 ${l[r]} ${t||""}`,children:a})})),c=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}},o={none:"",primary:"text-primary-main"},m=a((({className:e="",name:t,alt:a=`Icon ${t}`,title:i=a,asSVG:l,color:s="primary",...m})=>{const d=`${c.CDN||""}icons/${t}.svg`;return l?r("svg",{className:`${o[s]} ${e}`,...m,"aria-hidden":"true",children:[i?n("title",{children:i}):null,a?n("desc",{children:a}):null,n("use",{href:`${d}#icon`,xlinkHref:`${d}#icon`})]}):n("img",{className:e,src:d,alt:a,title:i,...m,"aria-hidden":"true"})})),d=a((({className:e="",image:t})=>{if(!t)return null;const a={width:t.size?.width?`${t.size?.width}px`:"100%",height:t.size?.height?`${t.size?.height}px`:"100%"};return r("picture",{className:e,children:[t.sources?.length?t.sources.map((({src:e,format:t},r)=>n("source",{srcSet:e,type:h(t)},`${r}_${e}`))):null,n("img",{src:t.src,className:`m-auto ${t.className||""}`,alt:t.alt||t.title,title:t.title,style:a,...t.size})]})}));function h(e){return e?`image/${String(e)}`:void 0}const x=a((({bgColor:e="transparent",className:t="",title:a,description:i,image:l})=>r("section",{className:`px-4 py-6 ${e} ${t}`,children:[a&&n(s,{headingType:"h2",className:"text-primary-text",title:a}),i&&n("p",{className:"font-normal text-m-md "+(a?"mt-2.5":""),children:i}),l?.src&&n("div",{className:"mt-5 mx-auto flex justify-center",children:n(d,{image:l})})]}))),u=a((({className:e="",children:t,...r})=>n("div",{className:`snap-center snap-always min-w-full box-border ${e}`,role:"listitem",...r,children:t}))),p=e=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e}px`}),f=a((({className:e="",children:t,activeIndex:r,onScroll:a,gap:i=14,padding:l=16})=>n("div",{className:`overflow-auto flex horizontal-list no-scrollbar ${e}`,style:{...p(l),gap:`${i}px`},role:"list",onScroll:a,children:t?.length?t?.map(((e,t)=>n(u,{style:p(l/4),"aria-current":Boolean(r===t),children:e},String(t)))):n(u,{children:t})}))),b=a((({children:e,activeIndex:t,indexFraction:r,showDots:a})=>a&&e?.length?n("div",{className:"flex gap-2 mx-auto mt-5 w-fit",children:e?.map(((e,a)=>n("div",{className:"bg-primary-main opacity-30 w-1.5 h-1.5 min-w-1.5 min-h-1.5 rounded-full",style:g(a,t,r),"aria-hidden":!0},String(a))))}):null)),g=(e,t,n)=>{if(e<t||e>t+1)return null;const r=1-n;return e===t?{opacity:""+(.3+.7*r),width:6+16*r+"px"}:{opacity:""+(.3+.7*n),width:6+16*n+"px"}},N=a((({className:e,context:t,children:a,gap:i=14,padding:l=16,showDots:s=!0})=>{const[c,o]=t.useState(0),[m,d]=t.useState(0);return r("div",{className:e,children:[n(f,{gap:i,padding:l,activeIndex:c,onScroll:e=>{const{scrollLeft:t,clientWidth:n,childElementCount:r,scrollWidth:a,children:s}=e.currentTarget,c=s[0].offsetWidth-l/2,m=(({gap:e,padding:t,clientWidth:n,scrollWidth:r,childElementCount:a,itemWidth:i})=>{const l=i+e,s=r-n,c=n-e-t,o=a-2,m=new Array(a).fill(0).map(((e,t)=>0===t||t===o?[t>0?s-c:0,t>0?s:c]:[(t-1)*l+c,t*l+c]));return m[a-1]=[s,r],m})({gap:i,padding:l,clientWidth:n,scrollWidth:a,childElementCount:r,itemWidth:c}),{index:h,fraction:x}=((e,t)=>{const n=t.findIndex((([t,n])=>t<=e&&e<n));if(n<0)return{index:n,fraction:0};const[r,a]=t[n];return{index:n,fraction:(e-r)/(a-r)}})(t,m);o(h),d(x)},children:a}),n(b,{activeIndex:c,indexFraction:m,showDots:s,children:a})]})})),y=a((({className:e,iconClassName:t,textClassName:a,suffixClassName:i,doc:l,icon:s})=>{const{text:c,fileSize:o,...d}=l;return r("a",{className:e,role:"link",...d,children:[s?n(m,{className:t,name:s,width:"24px",height:"24px",asSVG:!0}):null,c?r("span",{className:a,children:[c,n("span",{className:i,children:d?.href&&v(w(d.href),o)})]}):null]})})),v=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),w=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},k=a((({className:e="",doc:t,icon:r})=>n(y,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:r}))),$=a((({context:e,hasBorder:t=!0,documents:r,icon:a})=>n(N,{context:e,className:"text-m-sm text-primary-main",children:r?.length?r.map(((e,r)=>n(k,{className:t?"rounded-md border-main-stroke border p-4":"",doc:e,icon:a},String(r)))):null}))),C=a((({hasBorder:e=!0,documents:t,icon:r})=>n("div",{className:"text-m-sm text-primary-main flex flex-col "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,a)=>n("div",{role:"listitem",children:n(k,{className:e?"rounded-md border-main-stroke border p-4":"",doc:t,icon:r})},String(a)))):null}))),S=a((({className:e="",context:t,title:a,subtitle:i,icon:l="DocIconMonoColor",documents:c,listMode:o="vertical",hasBorder:m=!0})=>r("section",{className:`font-sans py-6 px-4 bg-white ${e}`,children:[a?n(s,{headingType:"h2",className:"text-center "+(i?"mb-2":"mb-5"),title:a}):null,i?n("h3",{className:"mb-5 text-center text-m-md",children:i}):null,"vertical"===o?n(C,{hasBorder:m,documents:c,icon:l}):n($,{context:t,hasBorder:m,documents:c,icon:l})]}))),T=a((({className:e="",title:t,image:a,benefits:i})=>r("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[n(s,{headingType:"h2",className:"text-center",title:t}),r("div",{className:"flex justify-center mt-9",children:[a?.src&&n(d,{className:"mr-6",image:a}),i?.length?n("div",{className:"flex flex-col",children:i.map(j)}):null]})]})));function j(e,t){return r("div",{className:"flex flex-row mb-8",children:[e.icon&&n(m,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48",asSVG:!0}),r("div",{className:"flex gap-1 flex-col h-full ml-5 max-w-[490px]",children:[e.label&&n("div",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const _={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text"},D={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},I=a((({className:e="",isDotted:t=!0,children:a,version:i="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&n("div",{className:L(i)}),n("span",{className:`text-m-md ${_[i]}`,children:a})]}))),L=e=>`rounded-full inline-block mr-3 mt-2 ${D[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,B=a((e=>{const{className:t="",itemClassName:r,isDotted:a,items:i,version:l}=e;return n("section",{className:`${t}`,role:"list",children:i?.length?i.map(((e,t)=>n(I,{className:r,isDotted:a,version:l,children:e},String(t)))):null})})),R={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"}},A=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s="",items:c,isDotted:o=!0})=>{const m=R[a];return r("section",{className:`font-sans px-4 py-[18px] flex flex-col ${m.background} ${s}`,children:["small"===i?O(m.icon):null,"big"===i?V(l):null,r("div",{className:"py-0.5",children:[e?n("div",{className:`font-medium text-base mb-1 ${m.title}`,children:e}):null,t?n("div",{className:`text-sm ${m.description}`,children:t}):null,c?.length?n(B,{items:c,isDotted:o,version:"gray",className:"mt-1 text-m-sm text-secondary-text"}):null]})]})}));function O(e){return n("div",{className:"mb-3",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function V(e){return e?.src?n(d,{className:"pb-3 mr-auto",image:e}):null}const M=e=>e?.includes("//"),P=e=>(e||"").replace(/\/?\?.*/,""),Z=e=>{if(!e||!M(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t};var H=Object.freeze({__proto__:null,isURL:M,withoutQuery:P,getOrigin:Z});const z="/mobile",E=(e,t)=>{if(!e)return e;const n=Z(t?.href);return n?e.replace(n,"")||"/":e},G=e=>e;function W({router:e,handlerDecorator:t=G},n){const r=((e,t)=>{if(!e)return e;const n=E(e,t)||"",r=t?.pathname.startsWith(z);return r&&!M(n)?`/mobile${n}`:n})(n.href,e);return{...n,href:r,ariaLabel:n.text,onClick:t((t=>{const a=r&&!M(r),i=!n.target||"_self"===n.target;a&&i&&(t.preventDefault(),e.push(r))}),n)}}const F=a((({text:e,aboveText:t,appendLeft:a,rounded:i,version:l})=>{const s=!e&&!t&&Boolean(a);return function({buttonInnerClasses:e,appendLeft:t,withoutText:a,aboveText:i,text:l}){return r("div",{className:e,children:[t||null,a?null:r("div",{children:[n("div",{className:"text-m-2xs text-left",children:i}),n("div",{className:"text-m-button font-medium text-left",children:l})]})]})}({buttonInnerClasses:"link"!==l?`flex items-center justify-center\n ${s?"h-12 w-12":"px-8 gap-2 "+(t?"py-2":"py-3.5")} ${i?"rounded-full":""}`:null,appendLeft:a,withoutText:s,aboveText:t,text:e})}));const U={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",link:"text-primary-main"},J={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},K="w-full text-center font-sans select-none",Q=a((({className:e,text:t,aboveText:r,appendLeft:a,href:i,target:l,onClick:s,children:c,disabled:o,rounded:m,version:d="primary",ariaLabel:h,...x})=>{const u=c??n(F,{text:t,aboveText:r,appendLeft:a,rounded:m,version:d});return o?n("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`inline-block ${K} ${J[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,children:u}):n("a",{className:`${K} inline-block cursor-pointer no-underline ${U[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,href:i,target:l,onClick:s,"aria-label":h,role:i?"link":"button",...x,children:u})})),X=a((({context:e,className:t="",buttons:r})=>{const{handlerDecorator:a}=e,i=e.useRouter();return r?.length?n("div",{className:`${t}`,children:r.map(((e,t)=>function({icon:e,...t},r){if(!t?.text)return;return n(Q,e?{appendLeft:n(m,{name:e,width:"24",height:"24",asSVG:!0}),...t}:{...t},String(r))}(W({router:i,handlerDecorator:a},e),t)))}):null}));const Y=a((e=>{const{className:t,description:r}=e;return n("div",{className:`font-normal text-m-md ${t||""}`,children:r})})),q=a((({className:e="",title:t,children:a,buttons:i,image:l})=>r("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,r("div",{className:"flex grow w-full justify-between",children:[r("div",{className:"flex flex-col justify-between w-full",children:[n("div",{children:a}),n("div",{children:i})]}),l]})]}))),ee=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function te(e=""){const t=ee(e);return t<=4?"h4":t<=8?"h3":"h2"}function ne(e=""){const t=ee(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function re(e=""){const t=ee(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const ae={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ie=a((e=>{const{context:t,title:a,description:i,items:l,children:c,buttons:o,image:m,className:h="",version:x="primary",role:u}=e;return n("section",{className:`font-sans p-9 box-border ${h} ${ae[x]} ${re(h)} ${ne(h)} `,role:u,children:r(q,{context:t,title:a&&n(s,{headingType:te(h),title:a,className:`whitespace-pre-wrap max-w-[600px] ${a?"mb-3":""}\n ${"primary"===x?"text-primary-text":""}`}),buttons:o?.length?n(X,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,image:m?.src&&n(d,{className:"mt-auto ml-7",image:m}),children:[i&&n(Y,{className:"mt-4 max-w-[600px]",description:i}),c,le(l,x)]})})}));function le(e,t){return e?.length?n(B,{items:e,version:t}):null}const se={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ce=a((({context:e,className:t="",title:a,description:i,benefits:l,buttons:c,image:o,version:m="primary"})=>n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${t} ${se[m]} ${re(t)} ${ne(t)} `,children:r(q,{context:e,title:a&&n(s,{headingType:te(t),title:a,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:c?.length?n(X,{context:e,buttons:c,className:"flex mt-9 gap-3"}):null,image:o?.src&&n(d,{className:"mt-auto ml-7",image:o}),children:[i&&n(Y,{className:"mt-4 max-w-[600px]",description:i}),r("div",{className:"flex mt-5 mb-1",children:[l?.length?n("div",{className:"mr-8",children:l.map(oe)}):null,l?.length?n("div",{className:"pt-1",children:l.map(((e,t)=>function(e,t,r="primary"){return n("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[r]}`,children:e.description},String(t))}(e,t,m)))}):null]})]})})));function oe(e,t){return n("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.label},String(t))}const me={primary:"bg-white",secondary:"bg-primary-main text-white"},de=a((({context:e,title:t,description:a,cards:i=[],className:l,isScroll:c=!0})=>r("section",{className:`relative font-sans text-primary-text bg-white px-4 py-6 overflow-hidden ${l}`,children:[r("div",{className:"flex flex-col items-center mb-5",children:[n(s,{headingType:"h2",className:"text-center",title:t}),a?n("div",{className:"font-normal text-m-md max-w-[600px] mt-2",children:a}):null]}),he(c,i,e)]})));function he(e,t,r){return e?n(N,{context:r,children:t?.map(xe)}):n("div",{className:"grid gap-[14px]",children:t?.map(xe)})}function xe(e,t){return r("div",{className:`box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col\n ${me[e.version??"primary"]}`,role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-m-title-xs m-0",children:e.title}):null,e.description?ue(e):null,e.items?.length?(a=e.items,n("section",{className:"mt-3",children:a.map((e=>r("div",{children:[n("span",{className:"text-m-md font-medium",children:e.title}),n("span",{className:"text-m-sm text-secondary-text pl-2",children:e.text})]})))})):null]}),e?.button?.href?n(Q,{className:"mt-3",...e.button}):null]},t);var a}function ue(e){return n("div",{className:"text-secondary-text mt-2 "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}const pe=a((({className:e,viewBox:t,fill:r="none",width:a,height:i,paths:l,...s})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:r,width:a,height:i,children:l.map((({d:e,fill:t,...r},a)=>n("path",{d:e,fill:t||"currentColor",...s,...r},a)))}))),fe=[{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"}],be=a((({className:e,disabled:t,...r})=>n(Q,{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,...r,children:n(pe,{paths:fe,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),ge={primary:"bg-white text-secondary-text",secondary:"bg-primary-main text-white"},Ne={normal:3,mini:4},ye={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},ve={normal:380,mini:276},we={primary:"text-secondary-text",secondary:"text-white",gray:"text-secondary-text"},ke={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},$e=a((({className:e="",isDotted:t=!0,text:a,children:i,version:l="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&n("div",{className:Ce(l)}),"!!!!!",n("span",{className:we[l],children:a||i})]}))),Ce=e=>`rounded-full inline-block mr-3 mt-2 ${ke[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,Se=a((({title:e,description:t,image:a,items:i,button:l,version:s})=>{const c=function(e,t,n){return`font-medium text-xl m-0\n ${"secondary"!==e?"text-primary-text":""}\n ${t||n?.length?"":"text-center"}\n `}(s,t,i);return r("div",{children:[r("div",{children:[a?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:a})}):null,e?Te(e,c):null,t?n("div",{className:"font-normal text-sm "+(e?"mt-2":""),children:t}):null,i?.length?je(i,s):null]}),l?.text&&n(Q,{className:"mt-6",...l})]})}));function Te(e,t){return n("div",{className:`font-medium text-xl m-0 ${t}`,children:e})}function je(e,t){return n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.filter((e=>e?.text)).map(((e,r)=>function(e,t,r){return n($e,{version:r??"primary",children:n("span",{className:"text-sm",children:e})},String(t))}(e.text,r,t)))})}const _e=a((({context:e,title:t,description:a,cards:i=[],version:l="normal",activeCardIndex:c})=>r("div",{children:[n("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),r("div",{className:"flex flex-col items-center mb-8",children:[t?n(s,{headingType:"h2",className:"text-center",title:t}):null,a?n("div",{className:"font-normal text-base max-w-[600px] mt-2.5",children:a}):null]}),n("div",{className:`flex ${i?.length<=Ne[l]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*ve[l]}px)`},role:"list",children:i?.map(((t,r)=>function({card:e,version:t},r){return n("section",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between\n items-stretch ${ye[t]} ${ge[e.version??"primary"]} w-full col-span-4`,role:"listitem",children:n(Se,{...e})},String(r))}({card:t,version:l,context:e},r)))})]})));const De=a((({context:e,cards:t=[],className:a="",version:i="normal",...l})=>{const[s,c]=e.useState(0),o=t?.length>Ne[i],m=o&&t?.length-s>Ne[i],d=o&&s>0;return r("section",{className:`relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${a}`,children:[n(_e,{context:e,cards:t,version:i,activeCardIndex:s,...l}),d&&n(be,{className:"absolute top-1/2 left-8 rotate-180",onClick:()=>c(s-1),ariaLabel:"Пролистать влево"}),m&&n(be,{className:"absolute top-1/2 right-1 z-10",onClick:()=>c(s+1),ariaLabel:"Пролистать вправо"}),n("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})})),Ie={Headline:x,LinkDocs:S,TextBlock:A,PictureText:T,Tile:ie,ProductTile:ce,Gallery:de,MiniGallery:a((e=>n(De,{...e,version:"mini"})))},Le=a((({blocks:e,context:t})=>n("div",{className:"transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:e?.length?e.map(Be(t)):null}))),Be=e=>(t,r)=>{const a=t?.accordionBlockType;if(!a||!(a in Ie))return null;return n("div",{className:"mb-5 last:mb-0 py-2.5",children:n(Ie[a],{context:e,...t,className:"!p-0"})},`block_${r}`)},Re=a((({label:e,blocks:t,bordered:a,context:i})=>{const{hasContent:l,icon:s,handleToggle:c}=(({context:e,blocks:t})=>{const[n,r]=e.useState(!1),a=t?.length;return{isActive:n,hasContent:a,icon:n?"MinusIcon":"PlusIcon",handleToggle:e=>{if(!a)return;r(!n);const t=(({currentTarget:e})=>e.nextSibling)(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`}}})({context:i,blocks:t});return r("li",{className:(a?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0 py-[14px]")+" border-solid border-main-divider",children:[r("button",{className:"border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text\n "+(l?"group cursor-pointer":""),onClick:c,children:[n("span",{className:"text-m-title-xs pr-2.5 font-medium "+(l?"group-hover:text-primary-main":""),children:e}),l?n(m,{name:s,width:"24",height:"24",asSVG:!0}):null]}),l?n(Le,{blocks:t,context:i}):null]})})),Ae=a((({title:e,description:t,accordionItems:a,context:i,className:l="",bordered:c})=>r("section",{className:`py-6 font-sans bg-white text-primary-text ${c?"px-4":""} ${l}`,children:[e?n(s,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?n("div",{className:"mb-5 text-m-md text-center",children:t}):null,a?.length?n("ul",{className:"list-none m-0 p-0",children:a.map(((e,t)=>n(Re,{...e,context:i,bordered:c},`AccordionItem${t}`)))}):null]}))),Oe="https://www.cbr-xml-daily.ru/daily_json.js",Ve=["USD","EUR"],Me={USD:"DollarIcon",EUR:"EuroIcon"},Pe=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],Ze=a((({className:e="",context:t,title:a="Курсы обмена валют"})=>{const{data:i}=t.useAsyncData(Oe,Ee);return n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${re(e)} ${ne(e)} `,children:n(q,{context:t,title:a&&n(s,{headingType:te(e),title:a,className:"whitespace-pre-wrap max-w-[600px] "+(a?"mb-3":"")}),buttons:Pe?.length?n(X,{context:t,buttons:Pe,className:"flex mt-9 gap-3"}):null,children:r("table",{children:[n("thead",{children:r("tr",{children:[n(He,{children:"Валюта"}),n(He,{className:"pl-11",children:"Курс"})]})}),n("tbody",{children:Ve.map(Fe(i))})]})})})})),He=a((({className:e="",children:t})=>n("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ze=a((({className:e="",children:t})=>n("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function Ee(){const e=await fetch(Oe);return await e.json()}const Ge=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),We=e=>e?Ge.format(e):"",Fe=e=>t=>{const a=(e?.Valute||{})[t]?.Value;return r("tr",{children:[n(ze,{className:"pt-4",children:r("div",{className:"flex items-center",children:[n(m,{name:Me[t],width:"24",height:"24"}),n("span",{className:"ml-2",children:t})]})}),n(ze,{className:"pt-4 pl-11",children:We(a)})]},t)},Ue=["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"],Je={"bg-white":"text-primary-main",transparent:"text-white"},Ke={"bg-white":"text-black",transparent:"text-white"},Qe=a((({className:e="",href:t,children:a,targetBlank:i,bgColor:l="bg-white",hideTitle:s})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self","aria-label":"Россельхозбанк",children:[n(pe,{className:`${Je[l]} w-10 h-[38px]`,viewBox:"0 0 40 45",paths:Ue.map((e=>({d:e})))}),!s&&n("span",{className:`${Ke[l]} text-sm font-medium ml-2.5`,children:a||"Россельхозбанк"})]}))),Xe=a((({className:e,title:t="Мобильное приложение",description:a,href:i="#"})=>n("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light ${e||""}`,children:i?r("div",{className:"flex",children:[n("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-[50px] h-[50px]",children:n(Qe,{className:"w-[33px]",bgColor:"transparent",hideTitle:!0})}),r("a",{href:i,target:"_blank",className:"flex flex-col justify-center pl-3",children:[n("div",{className:"text-sm font-medium",children:t}),n("div",{className:"text-xs text-secondary-text",children:a})]})]}):null}))),Ye=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(qe):null,a?n(Q,{version:"primary",className:"my-4",...W({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),qe=(e,t)=>{const{type:a,text:i,description:l}=e;return r("div",{className:"mb-4",children:[n("div",{children:et(a,i)}),n("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},et=(e,t="")=>{switch(e){case"tel":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${tt(t)}`,children:t});case"email":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},tt=e=>e.replaceAll(/\D/g,""),nt=a((({title:e,links:t,className:a="",context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:a,children:[n("span",{className:"text-primary-text font-sans font-medium text-sm",children:e}),t?.length?n("div",{className:"flex flex-col gap-5 py-5",children:t.map(((e,t)=>n(rt,{index:t,...W({router:l,handlerDecorator:s},e)},String(t))))}):null]})})),rt=a((({className:e="",index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),at=[{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"}],it=a((({href:e})=>{const{icon:t,width:r,height:a,label:i}=at.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?n("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,"aria-label":i,target:"_blank",rel:"noopener noreferrer",children:m&&n(m,{name:t,width:r,height:a,asSVG:!0,className:"block"})}):null})),lt=a((({className:e,media:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e||""}`,children:t?.map(((e,t)=>n(it,{...W({router:a,handlerDecorator:i},e)},String(t))))})})),st=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return r("div",{className:`${e||""}`,children:[n("div",{className:"pt-5 pb-[5px]",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex flex-col justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>n(ct,{index:t,...W({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),ct=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),ot=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return r("form",{className:`relative ${e||""}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:"w-[20px] h-[20px]",children:n(m,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&n("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-sm text-secondary-text",children:"Поиск по сайту"})]}),n("input",{id:"search-bar-input",className:"h-12 pl-12 w-full peer font-sans font-normal text-base text-black border border-solid rounded h-full box-border outline-none pr-[6%] border-main-divider focus:border-primary-text",value:a,onChange:e=>i(e.target.value),type:"text",name:"search-bar-input"}),n(Q,{version:"primary",text:"Найти",className:"w-auto invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e.preventDefault(),console.log("click")},children:n("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),mt=e=>e?.map((e=>({label:e.text||"",blocks:[{accordionBlockType:"LinkDocs",documents:e.items||[]}]}))),dt=a((({className:e="",documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c,horizontalNavigationTitle:o,subMenu:m})=>{const d={context:c,accordionItems:mt(s)};return r("footer",{className:`px-4 py-[26px] bg-white ${e}`,children:[n(Ye,{className:"overflow-hidden",items:i,context:c,hasButton:!0}),n(Ae,{className:"p-0 pt-0 pb-0 mb-4",...d}),n("div",{children:m?.map(ht)}),n(Xe,{context:c,title:"Мобильное приложение",description:"Загрузить для IOS и Android"}),n(ot,{context:c,className:"grow"}),n(lt,{className:"pb-4",media:l,context:c}),n(nt,{title:o,links:a,context:c}),n(st,{links:t,context:c})]})})),ht=(e,t)=>{const{icon:a,href:i,text:l}=e;return r(Q,{href:i,className:"flex text-sm mb-4",children:[a?n(m,{className:"pr-1",name:a,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:l})]},`footer-${t}`)},xt=(e,t,n=((e,t)=>t.startsWith(e)))=>n(P(e),(e=>(e||"").replace(z,""))(P(M(e)?t.href:t.pathname))),ut=e=>t=>xt(t.href,e),pt=e=>t=>t.items?.some(ut(e))||xt(t.href,e)||((e,t)=>Z(e)===Z(t.href))(t.href,e),ft=e=>t=>e?.href===t?.href,bt=(e,t)=>{return(r=e,a=t,(r||[]).map((e=>a?.find(ft(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(ft(e))))));var n,r,a};async function gt(){const e=await fetch(Nt());return await e.json()}function Nt(){return`/wcms-resources/${c.SITEMAP||"sitemap"}.json`}const yt="absolute left-0 -bottom-3 w-full h-[2px]",vt=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c,bgColor:o="bg-white"})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[n("span",{className:wt(o,l),children:t||c}),l?n("div",{className:kt(o,l)}):null]}))),wt=(e,t)=>{let n="text-white";return"bg-white"===e&&(n=t?"text-primary-main":"text-secondary-text hover:text-primary-main"),`${n} font-sans font-normal text-sm`},kt=(e,t)=>t?`${"bg-white"===e?"bg-primary-main":e} ${yt}`:yt,$t=a((({context:e,burgerSubMenu:t,onClick:a,defaultLocation:i="",children:l})=>{const[s,c]=e.useGeolocation(i);return r("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[n("button",{className:"absolute top-4 right-4 border-none bg-transparent",onClick:a,children:n(m,{name:"CloseIcon",width:"24",height:"24",asSVG:!0})}),r(Q,{onClick:c,className:"flex items-center text-sm text-secondary-text mb-4",children:[n(m,{name:"GeolocationIcon",width:"24",height:"24",className:"box-border mr-2",asSVG:!0}),s]}),l,n("div",{className:"mb-7",children:t?.map(Ct)}),n(ot,{context:e,className:"grow"})]})})),Ct=(e,t)=>{const{icon:a,href:i,text:l}=e;return r(Q,{href:i,className:"flex text-sm mb-4",children:[a?n(m,{className:"pr-1",name:a,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:l})]},`headerSubMenu-${t}`)},St=a((({onClick:e,bgColor:t})=>r("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-[50px]",children:[r("div",{className:"flex items-center",children:[n("button",{className:"pr-4 border-0 bg-transparent",onClick:e,"aria-label":"Открыть меню",children:n(m,{name:"bg-white"===t?"BurgerIcon":"BurgerIconWhite",width:"24",height:"24",asSVG:!0})}),n(Qe,{bgColor:t})]}),n("button",{className:("bg-white"===t?"text-primary-main":"text-white")+" text-sm border-0 bg-transparent",children:"Войти"})]}))),Tt=a((({className:e="",defaultLocation:t,bgColor:a="bg-white",context:i,topItems:l,burgerSubMenu:s})=>{const c=i.useRouter(),o=function(e){const{data:t}=e(Nt(),gt);return t||{}}(i.useAsyncData),{handlerDecorator:m}=i,d=bt(o.topItems,l).find(pt(c))?.items,h=(e=>(t=[])=>{const n=t?.filter(ut(e));var r;return n?.length?(r=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>r(e)>r(t)?e:t)))(n):null})(c)(d),[x,u]=i.useState(!1),p=()=>u(!x);return r("header",{className:`${a} ${e}`,children:[r("div",{className:"container px-4 py-0 box-border",children:[n(St,{onClick:p,bgColor:a}),n("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]",children:n("div",{className:"flex",children:d?.map(((e,t)=>jt({...W({router:c,handlerDecorator:m},e),active:e===h,bgColor:a},t)))})})]}),x?n($t,{context:i,onClick:p,burgerSubMenu:s,defaultLocation:t,children:n(Ae,{context:i,accordionItems:mt(l),className:"p-0 pt-0 pb-0 mb-4"})}):null]})})),jt=(e,t)=>n(vt,{className:"mr-8 whitespace-nowrap text-sm",...e},String(t)),_t={primary:"text-primary-text",secondary:"text-white"},Dt={primary:"text-secondary-text",secondary:"text-white"};const It=a((({className:e="",context:t,title:a,headingType:i="h2",description:l,benefits:c,buttons:o,image:d,items:h,version:x="primary"})=>r("div",{className:`w-full text-primary-text ${e}`,children:[n("div",{children:r(q,{context:t,title:a&&n(s,{headingType:i,title:a,className:"whitespace-pre-wrap max-w-[600px] "+(a?"mb-3":"")}),buttons:o?.length?n(X,{context:t,buttons:o,className:"flex flex-col mt-5 gap-2.5"}):null,children:[l&&n(Y,{description:l}),c?.length?n("div",{className:"mt-5",children:c.map(((e,t)=>function(e,t,a){return r("div",{className:"flex gap-3 items-center mb-2.5 last:mb-0",children:[e.icon&&n(m,{className:"w-6 h-6 rounded-full box-border",name:e.icon,width:"24",height:"24",asSVG:!0}),n("div",{className:`font-medium text-m-title-xs m-0 ${_t[a]}`,children:e.label}),e.description&&n("div",{className:`font-normal text-m-sm ${Dt[a]}`,children:e.description})]},String(t))}(e,t,x)))}):null,h?.length?n(B,{items:h}):null]})}),Lt(d)]})));function Lt(e){return e?.src?n("div",{className:"mt-5",children:n(d,{image:{className:"block",...e}})}):null}const Bt=a((e=>{const{className:t}=e;return n("section",{className:`font-sans bg-white px-4 py-6 ${t||""}`,children:n(It,{...e})})})),Rt=a((({block:e,headingType:t,context:r})=>n("section",{className:"flex grow-0 shrink-0 basis-full px-4 pt-6",role:"listitem",children:n("div",{className:"flex grow",children:n(It,{context:r,headingType:t||"h2",...e})})}))),At=a((({className:e,context:t,slides:r=[]})=>{const a=r.map((e=>e.productBlock));return n("section",{className:`font-sans bg-white overflow-hidden w-100 pb-6 ${e||""}`,children:n(N,{context:t,children:a.map(((e,r)=>n(Rt,{block:e,context:t},String(r))))})})})),Ot=a((({className:e,title:t,description:a,steps:i,size:l="normal"})=>r("section",{className:`box-border font-sans text-primary-text bg-white px-4 py-6 flex flex-col ${e||""}`,children:[t&&n(s,{headingType:"h3",className:"text-center",title:t}),a&&n("p",{className:`text-m-md text-center ${t&&"mt-2"}`,children:a}),i?.length?n("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:n("div",{className:"flex flex-col justify-between gap-x-[101px]",children:i.map(((e,t)=>Vt({step:e,size:l,i:t,length:i.length})))})}):null]}))),Vt=e=>{const{step:t,size:a,i:i,length:l}=e,s=l-1===i,c="normal"===a?"ml-[34px]":"ml-[24px]";return n("div",{children:r("div",{className:"flex flex-row text-center relative",children:[r("div",{children:[Mt(t,a,i),!s&&n("div",{className:`min-h-8 h-full w-[2px] bg-secondary-light ${c}`})]}),r("div",{className:"flex flex-col justify-start relative",children:[t.label&&n("div",{className:"font-medium text-m-title-xs m-0 text-left",children:t.label}),t.description&&n("div",{className:"font-normal text-sm text-secondary-text text-left "+(t.label?"mt-1":""),children:t.description})]})]},String(i))},String(i))},Mt=(e,t,r)=>{const a="normal"===t?"38":"27";return n("div",{className:`${"normal"===t?"h-[70px] w-[70px] min-w-[70px] min-h-[70px]":"h-[50px] w-[50px] min-w-[50px] min-h-[50px]"} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`,children:n("span",{className:`font-medium text-secondary-text self-center ${"normal"===t?"text-m-title":"text-m-title-xs"}`,children:e.icon&&n(m,{name:e.icon,width:a,height:a})||r+1})})},Pt={Accordion:Ae,ExchangeRateTile:Ze,Footer:dt,Gallery:de,Header:Tt,Headline:x,LinkDocs:S,MobileAppTile:Xe,ProductBlock:Bt,ProductGallery:At,StepsBlock:Ot,TextBlock:A},Zt=a((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:Ht()}))),Ht=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},zt=a((({className:e,context:t})=>{const a=t.useLikeService();return r("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[n(Zt,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(Zt,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),Et=a((({className:e,context:t,title:a,description:i="Блок в разработке..."})=>n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${re(e)} ${ne(e)} `,children:r(q,{context:t,title:a?n(s,{headingType:te(e),title:a,className:"whitespace-pre-wrap max-w-[600px]"}):null,children:[i?n(Y,{className:"mt-4 max-w-[600px]",description:i}):null,n("figure",{className:"m-0 min-w-[600px]",children:Gt()})]})}))),Gt=(e=3)=>Ft(100,e).map((e=>Math.floor(e))).map(Wt),Wt=(e=100,t)=>n("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),Ft=(e,t)=>[e].concat(t>0?Ft(e/1.618,t-1):[]),Ut=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),Jt=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,slots:s={},likeControl:c,colorPalette:o="pc"},blockDecorator:m=Ut})=>{const{header:d}=s;return r("section",{className:`relative ${Qt(i)} ${e||""}`,"data-theme":o,children:[d?.blocks?.length?n("div",{className:`${Qt(d?.style)}`,children:d.blocks.map(((e,n)=>Kt({block:e,blockDecorator:m,blocksRegistry:a,context:t},n)))}):null,l?.length?n("div",{className:"container grid grid-cols-12 gap-1",children:l.map(((e,n)=>Kt({block:e,blockDecorator:m,blocksRegistry:a,context:t},n)))}):null,c&&n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(zt,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})}));function Kt({block:e,blockDecorator:t,blocksRegistry:r,context:a},i){const{type:l}=e;l&&l in r||console.warn(`No block with "${l}" is registered`);const s=r[l||"Placeholder"]||Et;return t({blockClassName:Qt(e.style),block:e,render:e=>{const{version:t,content:r}=e.block;return n(s,{className:e.blockClassName,version:t,context:a,...r},`${l}-${i}`)}},`block-${i}`)}function Qt(e){return e?e.join(" "):""}const Xt=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,main:{description:l,keywords:s,canonical:c,robots:o},og:m,twitter:d,jsonLd:h}=t;return r(e,{children:[n("title",{children:i}),n("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),l&&n("meta",{name:"description",content:l}),s&&n("meta",{name:"keywords",content:s.join(",")}),o&&n("meta",{name:"robots",content:o.join(",")}),m?Object.entries(m).map((([e,t])=>n("meta",{name:`og:${e}`,content:t},e))):null,d?Object.entries(d).map((([e,t])=>n("meta",{name:`twitter:${e}`,content:t},e))):null,c&&n("link",{rel:"canonical",href:c}),h&&n("script",{type:"application/ld+json",children:h}),a]})}));function Yt(e){const{mobile:t,...n}=e;return t?{...n,...t,content:{...n.content,...t.content}}:e}function qt(e){return e?.filter((e=>(e?.type||e?.mobile?.type||"")in Pt&&!e.mobile?.hidden)).map(Yt)}e.Blocks=Pt,e.ContentPage=Jt,e.ContentPageHead=Xt,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.Header=Tt,e.Icon=m,e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(i)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(i,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:r})}),{likes:i}=await n.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}}}},e.joinList=function(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])},e.normalizePage=function(e){if(!e)return;const{blocks:t,slots:n}=e;return{...e,blocks:qt(t),slots:n&&Object.keys(n).reduce(((e,t)=>({...e,[t]:{...n[t],blocks:qt(n[t].blocks)}})),{})}},e.projectSettings=c,e.setup=t,e.url=H,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).UniMobileBlocks={})}(this,(function(e){"use strict";const t=(e,n)=>{t._jsx=e,t._jsxs=n||e};t.vue=e=>{t(((t,{children:n,dangerouslySetInnerHTML:r,...a}={})=>{const i=Object.assign({},a,r?{innerHTML:r.__html}:{});return e(t,i,"string"!=typeof t?()=>n:n)}))};const n=(...e)=>t._jsx(...e),r=(...e)=>t._jsxs(...e),a=e=>(e._tmpl||(e._tmpl=function(t,n){const{children:r,...a}=t||{},i=n?.slots?.default,l=r||i&&i();return e(Object.assign(a,l&&{children:l}),n)},e._tmpl.inheritAttrs=!1),e._tmpl);const i="likesToken";const l={h1:"text-m-title",h2:"text-m-title",h3:"text-m-title-md",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},s=a((e=>{const{className:t,headingType:r,title:a}=e;if(!r)return;return n(r,{className:`font-sans font-medium m-0 ${l[r]} ${t||""}`,children:a})})),c=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}},o={none:"",primary:"text-primary-main"},m=a((({className:e="",name:t,alt:a=`Icon ${t}`,title:i=a,asSVG:l,color:s="primary",...m})=>{const d=`${c.CDN||""}icons/${t}.svg`;return l?r("svg",{className:`${o[s]} ${e}`,...m,"aria-hidden":"true",children:[i?n("title",{children:i}):null,a?n("desc",{children:a}):null,n("use",{href:`${d}#icon`,xlinkHref:`${d}#icon`})]}):n("img",{className:e,src:d,alt:a,title:i,...m,"aria-hidden":"true"})})),d=a((({className:e="",image:t})=>{if(!t)return null;const a={width:t.size?.width?`${t.size?.width}px`:"100%",height:t.size?.height?`${t.size?.height}px`:"100%"};return r("picture",{className:e,children:[t.sources?.length?t.sources.map((({src:e,format:t},r)=>n("source",{srcSet:e,type:h(t)},`${r}_${e}`))):null,n("img",{src:t.src,className:`m-auto ${t.className||""}`,alt:t.alt||t.title,title:t.title,style:a,...t.size})]})}));function h(e){return e?`image/${String(e)}`:void 0}const x=a((({bgColor:e="transparent",className:t="",title:a,description:i,image:l})=>r("section",{className:`px-4 py-6 ${e} ${t}`,children:[a&&n(s,{headingType:"h2",className:"text-primary-text",title:a}),i&&n("p",{className:"font-normal text-m-md "+(a?"mt-2.5":""),children:i}),l?.src&&n("div",{className:"mt-5 mx-auto flex justify-center",children:n(d,{image:l})})]}))),u=a((({className:e="",children:t,...r})=>n("div",{className:`snap-center snap-always min-w-full box-border ${e}`,role:"listitem",...r,children:t}))),p=e=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e}px`}),f=a((({className:e="",children:t,activeIndex:r,onScroll:a,gap:i=14,padding:l=16})=>n("div",{className:`overflow-auto flex horizontal-list no-scrollbar ${e}`,style:{...p(l),gap:`${i}px`},role:"list",onScroll:a,children:t?.length?t?.map(((e,t)=>n(u,{style:p(l/4),"aria-current":Boolean(r===t),children:e},String(t)))):n(u,{children:t})}))),b=a((({children:e,activeIndex:t,indexFraction:r,showDots:a})=>a&&e?.length?n("div",{className:"flex gap-2 mx-auto mt-5 w-fit",children:e?.map(((e,a)=>n("div",{className:"bg-primary-main opacity-30 w-1.5 h-1.5 min-w-1.5 min-h-1.5 rounded-full",style:g(a,t,r),"aria-hidden":!0},String(a))))}):null)),g=(e,t,n)=>{if(e<t||e>t+1)return null;const r=1-n;return e===t?{opacity:""+(.3+.7*r),width:6+16*r+"px"}:{opacity:""+(.3+.7*n),width:6+16*n+"px"}},N=a((({className:e,context:t,children:a,gap:i=14,padding:l=16,showDots:s=!0})=>{const[c,o]=t.useState(0),[m,d]=t.useState(0);return r("div",{className:e,children:[n(f,{gap:i,padding:l,activeIndex:c,onScroll:e=>{const{scrollLeft:t,clientWidth:n,childElementCount:r,scrollWidth:a,children:s}=e.currentTarget,c=s[0].offsetWidth-l/2,m=(({gap:e,padding:t,clientWidth:n,scrollWidth:r,childElementCount:a,itemWidth:i})=>{const l=i+e,s=r-n,c=n-e-t,o=a-2,m=new Array(a).fill(0).map(((e,t)=>0===t||t===o?[t>0?s-c:0,t>0?s:c]:[(t-1)*l+c,t*l+c]));return m[a-1]=[s,r],m})({gap:i,padding:l,clientWidth:n,scrollWidth:a,childElementCount:r,itemWidth:c}),{index:h,fraction:x}=((e,t)=>{const n=t.findIndex((([t,n])=>t<=e&&e<n));if(n<0)return{index:n,fraction:0};const[r,a]=t[n];return{index:n,fraction:(e-r)/(a-r)}})(t,m);o(h),d(x)},children:a}),n(b,{activeIndex:c,indexFraction:m,showDots:s,children:a})]})})),y=a((({className:e,iconClassName:t,textClassName:a,suffixClassName:i,doc:l,icon:s})=>{const{text:c,fileSize:o,...d}=l;return r("a",{className:e,role:"link",...d,children:[s?n(m,{className:t,name:s,width:"24px",height:"24px",asSVG:!0}):null,c?r("span",{className:a,children:[c,n("span",{className:i,children:d?.href&&v(w(d.href),o)})]}):null]})})),v=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),w=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},k=a((({className:e="",doc:t,icon:r})=>n(y,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:r}))),$=a((({context:e,hasBorder:t=!0,documents:r,icon:a})=>n(N,{context:e,className:"text-m-sm text-primary-main",children:r?.length?r.map(((e,r)=>n(k,{className:t?"rounded-md border-main-stroke border p-4":"",doc:e,icon:a},String(r)))):null}))),C=a((({hasBorder:e=!0,documents:t,icon:r})=>n("div",{className:"text-m-sm text-primary-main flex flex-col "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,a)=>n("div",{role:"listitem",children:n(k,{className:e?"rounded-md border-main-stroke border p-4":"",doc:t,icon:r})},String(a)))):null}))),S=a((({className:e="",context:t,title:a,subtitle:i,icon:l="DocIconMonoColor",documents:c,listMode:o="vertical",hasBorder:m=!0})=>r("section",{className:`font-sans py-6 px-4 bg-white ${e}`,children:[a?n(s,{headingType:"h2",className:"text-center "+(i?"mb-2":"mb-5"),title:a}):null,i?n("h3",{className:"mb-5 text-center text-m-md",children:i}):null,"vertical"===o?n(C,{hasBorder:m,documents:c,icon:l}):n($,{context:t,hasBorder:m,documents:c,icon:l})]}))),T=a((({className:e="",title:t,image:a,benefits:i})=>r("section",{className:`relative font-sans text-primary-text bg-white p-14 ${e}`,children:[n(s,{headingType:"h2",className:"text-center",title:t}),r("div",{className:"flex justify-center mt-9",children:[a?.src&&n(d,{className:"mr-6",image:a}),i?.length?n("div",{className:"flex flex-col",children:i.map(j)}):null]})]})));function j(e,t){return r("div",{className:"flex flex-row mb-8",children:[e.icon&&n(m,{className:"w-[48px] h-[48px] bg-main rounded-full box-border p-[12px]",name:e.icon,width:"48",height:"48",asSVG:!0}),r("div",{className:"flex gap-1 flex-col h-full ml-5 max-w-[490px]",children:[e.label&&n("div",{className:"font-medium text-primary-text text-xl m-0",children:e.label}),e.description&&n("div",{className:"font-normal text-sm text-secondary-text",children:e.description})]})]},String(t))}const _={primary:"text-primary-text",secondary:"text-white",gray:"text-secondary-text"},D={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},I=a((({className:e="",isDotted:t=!0,children:a,version:i="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&n("div",{className:L(i)}),n("span",{className:`text-m-md ${_[i]}`,children:a})]}))),L=e=>`rounded-full inline-block mr-3 mt-2 ${D[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,B=a((e=>{const{className:t="",itemClassName:r,isDotted:a,items:i,version:l}=e;return n("section",{className:`${t}`,role:"list",children:i?.length?i.map(((e,t)=>n(I,{className:r,isDotted:a,version:l,children:e},String(t)))):null})})),R={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"}},A=a((({title:e,description:t,blockVersion:a="primary",iconVersion:i,image:l,className:s="",items:c,isDotted:o=!0})=>{const m=R[a];return r("section",{className:`font-sans px-4 py-[18px] flex flex-col ${m.background} ${s}`,children:["small"===i?O(m.icon):null,"big"===i?V(l):null,r("div",{className:"py-0.5",children:[e?n("div",{className:`font-medium text-base mb-1 ${m.title}`,children:e}):null,t?n("div",{className:`text-sm ${m.description}`,children:t}):null,c?.length?n(B,{items:c,isDotted:o,version:"gray",className:"mt-1 text-m-sm text-secondary-text"}):null]})]})}));function O(e){return n("div",{className:"mb-3",children:n("div",{className:`rounded-full h-4 w-4 text-center text-xs ${e}`,children:"i"})})}function V(e){return e?.src?n(d,{className:"pb-3 mr-auto",image:e}):null}const M=e=>e?.includes("//"),P=e=>(e||"").replace(/\/?\?.*/,""),Z=e=>{if(!e||!M(e))return;const t=e,n=t.indexOf("//"),r=t.indexOf("/",n+"//".length);return-1!==r?t.substring(0,r):t};var H=Object.freeze({__proto__:null,isURL:M,withoutQuery:P,getOrigin:Z});const z="/mobile",E=(e,t)=>{if(!e)return e;const n=Z(t?.href);return n?e.replace(n,"")||"/":e},G=e=>e;function W({router:e,handlerDecorator:t=G},n){const r=((e,t)=>{if(!e)return e;const n=E(e,t)||"",r=t?.pathname.startsWith(z);return r&&!M(n)?`/mobile${n}`:n})(n.href,e);return{...n,href:r,ariaLabel:n.text,onClick:t((t=>{const a=r&&!M(r),i=!n.target||"_self"===n.target;a&&i&&(t.preventDefault(),e.push(r))}),n)}}const F=a((({text:e,aboveText:t,appendLeft:a,rounded:i,version:l})=>{const s=!e&&!t&&Boolean(a);return function({buttonInnerClasses:e,appendLeft:t,withoutText:a,aboveText:i,text:l}){return r("div",{className:e,children:[t||null,a?null:r("div",{children:[n("div",{className:"text-m-2xs text-left",children:i}),n("div",{className:"text-m-button font-medium text-left",children:l})]})]})}({buttonInnerClasses:"link"!==l?`flex items-center justify-center\n ${s?"h-12 w-12":"px-8 gap-2 "+(t?"py-2":"py-3.5")} ${i?"rounded-full":""}`:null,appendLeft:a,withoutText:s,aboveText:t,text:e})}));const U={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",link:"text-primary-main"},J={primary:"bg-secondary-dark text-secondary-text",secondary:"bg-secondary-light text-secondary-text",link:""},K="w-full text-center font-sans select-none",Q=a((({className:e,text:t,aboveText:r,appendLeft:a,href:i,target:l,onClick:s,children:c,disabled:o,rounded:m,version:d="primary",ariaLabel:h,...x})=>{const u=c??n(F,{text:t,aboveText:r,appendLeft:a,rounded:m,version:d});return o?n("div",{role:"button","aria-disabled":"true","aria-label":h,tabIndex:"-1",className:`inline-block ${K} ${J[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,children:u}):n("a",{className:`${K} inline-block cursor-pointer no-underline ${U[d]||""} ${m?"rounded-full":"rounded-md"} ${e||""}`,href:i,target:l,onClick:s,"aria-label":h,role:i?"link":"button",...x,children:u})})),X=a((({context:e,className:t="",buttons:r})=>{const{handlerDecorator:a}=e,i=e.useRouter();return r?.length?n("div",{className:`${t}`,children:r.map(((e,t)=>function({icon:e,...t},r){if(!t?.text)return;return n(Q,e?{appendLeft:n(m,{name:e,width:"24",height:"24",asSVG:!0}),...t}:{...t},String(r))}(W({router:i,handlerDecorator:a},e),t)))}):null}));const Y=a((e=>{const{className:t,description:r}=e;return n("div",{className:`font-normal text-m-md ${t||""}`,children:r})})),q=a((({className:e="",title:t,children:a,buttons:i,image:l})=>r("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,r("div",{className:"flex grow w-full justify-between",children:[r("div",{className:"flex flex-col justify-between w-full",children:[n("div",{children:a}),n("div",{children:i})]}),l]})]}))),ee=e=>{const t="col-span-",n=e.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function te(e=""){const t=ee(e);return t<=4?"h4":t<=8?"h3":"h2"}function ne(e=""){const t=ee(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function re(e=""){const t=ee(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const ae={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ie=a((e=>{const{context:t,title:a,description:i,items:l,children:c,buttons:o,image:m,className:h="",version:x="primary",role:u}=e;return n("section",{className:`font-sans p-9 box-border ${h} ${ae[x]} ${re(h)} ${ne(h)} `,role:u,children:r(q,{context:t,title:a&&n(s,{headingType:te(h),title:a,className:`whitespace-pre-wrap max-w-[600px] ${a?"mb-3":""}\n ${"primary"===x?"text-primary-text":""}`}),buttons:o?.length?n(X,{context:t,buttons:o,className:"flex mt-9 gap-3"}):null,image:m?.src&&n(d,{className:"mt-auto ml-7",image:m}),children:[i&&n(Y,{className:"mt-4 max-w-[600px]",description:i}),c,le(l,x)]})})}));function le(e,t){return e?.length?n(B,{items:e,version:t}):null}const se={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white"},ce=a((({context:e,className:t="",title:a,description:i,benefits:l,buttons:c,image:o,version:m="primary"})=>n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${t} ${se[m]} ${re(t)} ${ne(t)} `,children:r(q,{context:e,title:a&&n(s,{headingType:te(t),title:a,className:"whitespace-pre-wrap max-w-[600px]"}),buttons:c?.length?n(X,{context:e,buttons:c,className:"flex mt-9 gap-3"}):null,image:o?.src&&n(d,{className:"mt-auto ml-7",image:o}),children:[i&&n(Y,{className:"mt-4 max-w-[600px]",description:i}),r("div",{className:"flex mt-5 mb-1",children:[l?.length?n("div",{className:"mr-8",children:l.map(oe)}):null,l?.length?n("div",{className:"pt-1",children:l.map(((e,t)=>function(e,t,r="primary"){return n("div",{className:`text-sm ${t?"mt-4":""} ${{primary:"text-secondary-text",secondary:"text-white"}[r]}`,children:e.description},String(t))}(e,t,m)))}):null]})]})})));function oe(e,t){return n("div",{className:"text-xl font-medium "+(t?"mt-2.5":""),children:e.label},String(t))}const me={primary:"bg-white",secondary:"bg-primary-main text-white"},de=a((({context:e,title:t,description:a,cards:i=[],className:l,isScroll:c=!0})=>r("section",{className:`relative font-sans text-primary-text bg-white px-4 py-6 overflow-hidden ${l}`,children:[r("div",{className:"flex flex-col items-center mb-5",children:[n(s,{headingType:"h2",className:"text-center",title:t}),a?n("div",{className:"font-normal text-m-md max-w-[600px] mt-2",children:a}):null]}),he(c,i,e)]})));function he(e,t,r){return e?n(N,{context:r,children:t?.map(xe)}):n("div",{className:"grid gap-[14px]",children:t?.map(xe)})}function xe(e,t){return r("div",{className:`box-border horizontal-list-item border-solid border rounded-md border-main-stroke p-4 flex flex-col\n ${me[e.version??"primary"]}`,role:"listitem",children:[r("div",{children:[e.image?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:e.image})}):null,e.title?n("h4",{className:"font-medium text-m-title-xs m-0",children:e.title}):null,e.description?ue(e):null,e.items?.length?(a=e.items,n("section",{className:"mt-3",children:a.map((e=>r("div",{children:[n("span",{className:"text-m-md font-medium",children:e.title}),n("span",{className:"text-m-sm text-secondary-text pl-2",children:e.text})]})))})):null]}),e?.button?.href?n(Q,{className:"mt-3",...e.button}):null]},t);var a}function ue(e){return n("div",{className:"text-secondary-text mt-2 "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}const pe=a((({className:e,viewBox:t,fill:r="none",width:a,height:i,paths:l,...s})=>n("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:r,width:a,height:i,children:l.map((({d:e,fill:t,...r},a)=>n("path",{d:e,fill:t||"currentColor",...s,...r},a)))}))),fe=[{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"}],be=a((({className:e,disabled:t,...r})=>n(Q,{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,...r,children:n(pe,{paths:fe,viewBox:"0 0 16 16",fill:"none",width:"16",height:"16"})}))),ge={primary:"bg-white text-secondary-text",secondary:"bg-primary-main text-white"},Ne={normal:3,mini:4},ye={normal:"min-w-[364px] w-[364px]",mini:"min-w-[260px] w-[260px]"},ve={normal:380,mini:276},we={primary:"text-secondary-text",secondary:"text-white",gray:"text-secondary-text"},ke={primary:"bg-primary-main",secondary:"bg-white",gray:"bg-secondary-text"},$e=a((({className:e="",isDotted:t=!0,text:a,children:i,version:l="primary"})=>r("div",{className:`font-sans flex items-start ${e}`,role:"listitem",children:[t&&n("div",{className:Ce(l)}),"!!!!!",n("span",{className:we[l],children:a||i})]}))),Ce=e=>`rounded-full inline-block mr-3 mt-2 ${ke[e]} ${"gray"===e?"w-[6px] h-[6px] min-w-[6px] min-h-[6px]":"w-2 h-2 min-w-2 min-h-2"}`,Se=a((({title:e,description:t,image:a,items:i,button:l,version:s})=>{const c=function(e,t,n){return`font-medium text-xl m-0\n ${"secondary"!==e?"text-primary-text":""}\n ${t||n?.length?"":"text-center"}\n `}(s,t,i);return r("div",{children:[r("div",{children:[a?.src?n("div",{className:"flex justify-center",children:n(d,{className:"mb-6",image:a})}):null,e?Te(e,c):null,t?n("div",{className:"font-normal text-sm "+(e?"mt-2":""),children:t}):null,i?.length?je(i,s):null]}),l?.text&&n(Q,{className:"mt-6",...l})]})}));function Te(e,t){return n("div",{className:`font-medium text-xl m-0 ${t}`,children:e})}function je(e,t){return n("section",{className:"max-w-[308px] mt-2",role:"list",children:e.filter((e=>e?.text)).map(((e,r)=>function(e,t,r){return n($e,{version:r??"primary",children:n("span",{className:"text-sm",children:e})},String(t))}(e.text,r,t)))})}const _e=a((({context:e,title:t,description:a,cards:i=[],version:l="normal",activeCardIndex:c})=>r("div",{children:[n("div",{className:"absolute top-0 left-0 bottom-0 w-[84px] bg-gradient-to-r from-white to-transparent"}),r("div",{className:"flex flex-col items-center mb-8",children:[t?n(s,{headingType:"h2",className:"text-center",title:t}):null,a?n("div",{className:"font-normal text-base max-w-[600px] mt-2.5",children:a}):null]}),n("div",{className:`flex ${i?.length<=Ne[l]?"justify-center":""} duration-1000`,style:{transform:`translateX(-${c*ve[l]}px)`},role:"list",children:i?.map(((t,r)=>function({card:e,version:t},r){return n("section",{className:`box-border border-solid border rounded-md border-main-divider p-7 mx-2 flex flex-col justify-between\n items-stretch ${ye[t]} ${ge[e.version??"primary"]} w-full col-span-4`,role:"listitem",children:n(Se,{...e})},String(r))}({card:t,version:l,context:e},r)))})]})));const De=a((({context:e,cards:t=[],className:a="",version:i="normal",...l})=>{const[s,c]=e.useState(0),o=t?.length>Ne[i],m=o&&t?.length-s>Ne[i],d=o&&s>0;return r("section",{className:`relative font-sans text-primary-text bg-white p-[50px] overflow-hidden ${a}`,children:[n(_e,{context:e,cards:t,version:i,activeCardIndex:s,...l}),d&&n(be,{className:"absolute top-1/2 left-8 rotate-180",onClick:()=>c(s-1),ariaLabel:"Пролистать влево"}),m&&n(be,{className:"absolute top-1/2 right-1 z-10",onClick:()=>c(s+1),ariaLabel:"Пролистать вправо"}),n("div",{className:"absolute top-0 right-0 bottom-0 w-[84px] bg-opacity-to-white"})]})})),Ie={Headline:x,LinkDocs:S,TextBlock:A,PictureText:T,Tile:ie,ProductTile:ce,Gallery:de,MiniGallery:a((e=>n(De,{...e,version:"mini"})))},Le=a((({blocks:e,context:t})=>n("div",{className:"transition-all duration-300 max-h-0 overflow-hidden group-last:last:pb-0 ",children:e?.length?e.map(Be(t)):null}))),Be=e=>(t,r)=>{const a=t?.accordionBlockType;if(!a||!(a in Ie))return null;return n("div",{className:"mb-5 last:mb-0 py-2.5",children:n(Ie[a],{context:e,...t,className:"!p-0"})},`block_${r}`)},Re=a((({label:e,blocks:t,bordered:a,context:i})=>{const{hasContent:l,icon:s,handleToggle:c}=(({context:e,blocks:t})=>{const[n,r]=e.useState(!1),a=t?.length;return{isActive:n,hasContent:a,icon:n?"MinusIcon":"PlusIcon",handleToggle:e=>{if(!a)return;r(!n);const t=(({currentTarget:e})=>e.nextSibling)(e);t.style.maxHeight=t.style.maxHeight?null:`${t.scrollHeight}px`}}})({context:i,blocks:t});return r("li",{className:(a?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0 py-[14px]")+" border-solid border-main-divider",children:[r("button",{className:"border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text\n "+(l?"group cursor-pointer":""),onClick:c,children:[n("span",{className:"text-m-title-xs pr-2.5 font-medium "+(l?"group-hover:text-primary-main":""),children:e}),l?n(m,{name:s,width:"24",height:"24",asSVG:!0}):null]}),l?n(Le,{blocks:t,context:i}):null]})})),Ae=a((({title:e,description:t,accordionItems:a,context:i,className:l="",bordered:c})=>r("section",{className:`py-6 font-sans bg-white text-primary-text ${c?"px-4":""} ${l}`,children:[e?n(s,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?n("div",{className:"mb-5 text-m-md text-center",children:t}):null,a?.length?n("ul",{className:"list-none m-0 p-0",children:a.map(((e,t)=>n(Re,{...e,context:i,bordered:c},`AccordionItem${t}`)))}):null]}))),Oe="https://www.cbr-xml-daily.ru/daily_json.js",Ve=["USD","EUR"],Me={USD:"DollarIcon",EUR:"EuroIcon"},Pe=[{text:"Все показатели",href:"https://cbr.ru/currency_base/daily/",version:"secondary"}],Ze=a((({className:e="",context:t,title:a="Курсы обмена валют"})=>{const{data:i}=t.useAsyncData(Oe,Ee);return n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${re(e)} ${ne(e)} `,children:n(q,{context:t,title:a&&n(s,{headingType:te(e),title:a,className:"whitespace-pre-wrap max-w-[600px] "+(a?"mb-3":"")}),buttons:Pe?.length?n(X,{context:t,buttons:Pe,className:"flex mt-9 gap-3"}):null,children:r("table",{children:[n("thead",{children:r("tr",{children:[n(He,{children:"Валюта"}),n(He,{className:"pl-11",children:"Курс"})]})}),n("tbody",{children:Ve.map(Fe(i))})]})})})})),He=a((({className:e="",children:t})=>n("th",{className:`text-left font-normal text-sm text-secondary-text ${e}`,children:t}))),ze=a((({className:e="",children:t})=>n("td",{className:`text-left font-normal text-base text-primary-text ${e}`,children:t})));async function Ee(){const e=await fetch(Oe);return await e.json()}const Ge=new Intl.NumberFormat("ru",{style:"currency",currency:"RUB"}),We=e=>e?Ge.format(e):"",Fe=e=>t=>{const a=(e?.Valute||{})[t]?.Value;return r("tr",{children:[n(ze,{className:"pt-4",children:r("div",{className:"flex items-center",children:[n(m,{name:Me[t],width:"24",height:"24"}),n("span",{className:"ml-2",children:t})]})}),n(ze,{className:"pt-4 pl-11",children:We(a)})]},t)},Ue=["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"],Je={"bg-white":"text-primary-main",transparent:"text-white"},Ke={"bg-white":"text-black",transparent:"text-white"},Qe=a((({className:e="",href:t,children:a,targetBlank:i,bgColor:l="bg-white",hideTitle:s})=>r("a",{className:`inline-flex items-center font-sans no-underline ${e}`,href:t||"https://rshb.ru/",target:i?"_blank":"_self","aria-label":"Россельхозбанк",children:[n(pe,{className:`${Je[l]} w-10 h-[38px]`,viewBox:"0 0 40 45",paths:Ue.map((e=>({d:e})))}),!s&&n("span",{className:`${Ke[l]} text-sm font-medium ml-2.5`,children:a||"Россельхозбанк"})]}))),Xe=a((({className:e,title:t="Мобильное приложение",description:a,href:i="#"})=>n("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light ${e||""}`,children:i?r("div",{className:"flex",children:[n("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-[50px] h-[50px]",children:n(Qe,{className:"w-[33px]",bgColor:"transparent",hideTitle:!0})}),r("a",{href:i,target:"_blank",className:"flex flex-col justify-center pl-3",children:[n("div",{className:"text-sm font-medium",children:t}),n("div",{className:"text-xs text-secondary-text",children:a})]})]}):null}))),Ye=a((({className:e,items:t,hasButton:a,context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:`flex flex-col ${e||""}`,children:[t?.length?t.map(qe):null,a?n(Q,{version:"primary",className:"my-4",...W({router:l,handlerDecorator:s},{text:"Обратная связь",href:"/",target:"_blank"})}):null]})})),qe=(e,t)=>{const{type:a,text:i,description:l}=e;return r("div",{className:"mb-4",children:[n("div",{children:et(a,i)}),n("div",{className:"font-sans text-sm text-secondary-text",children:l})]},String(t))},et=(e,t="")=>{switch(e){case"tel":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`tel:${tt(t)}`,children:t});case"email":return n("a",{className:"font-sans font-medium text-xl text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return n("span",{children:t})}},tt=e=>e.replaceAll(/\D/g,""),nt=a((({title:e,links:t,className:a="",context:i})=>{const l=i.useRouter(),{handlerDecorator:s}=i;return r("div",{className:a,children:[n("span",{className:"text-primary-text font-sans font-medium text-sm",children:e}),t?.length?n("div",{className:"flex flex-col gap-5 py-5",children:t.map(((e,t)=>n(rt,{index:t,...W({router:l,handlerDecorator:s},e)},String(t))))}):null]})})),rt=a((({className:e="",index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-sm text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),at=[{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"}],it=a((({href:e})=>{const{icon:t,width:r,height:a,label:i}=at.find((({origins:t})=>t.some((t=>e?.includes(t)))))||{};return t?n("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,"aria-label":i,target:"_blank",rel:"noopener noreferrer",children:m&&n(m,{name:t,width:r,height:a,asSVG:!0,className:"block"})}):null})),lt=a((({className:e,media:t,context:r})=>{const a=r.useRouter(),{handlerDecorator:i}=r;return n("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e||""}`,children:t?.map(((e,t)=>n(it,{...W({router:a,handlerDecorator:i},e)},String(t))))})})),st=a((({className:e,links:t,context:a})=>{const i=a.useRouter(),{handlerDecorator:l}=a;return r("div",{className:`${e||""}`,children:[n("div",{className:"pt-5 pb-[5px]",children:n("span",{className:"font-sans font-normal text-xs text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?n("div",{className:"flex flex-col justify-start items-start gap-5 pt-[5px]",children:t.map(((e,t)=>n(ct,{index:t,...W({router:i,handlerDecorator:l},e)},String(t))))}):null]})})),ct=a((({className:e,index:t,text:r,href:a,target:i,onClick:l})=>n("a",{className:`font-sans font-normal text-xs text-secondary-text visited:text-secondary-text hover:text-primary-text inline-block no-underline max-w-[292px] ${e||""}`,href:a,target:i,onClick:l,children:r||`Документ ${t}`}))),ot=a((({className:e,context:t})=>{const{term:a,setTerm:i}=t.useSearch();return r("form",{className:`relative ${e||""}`,children:[r("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[n("div",{className:"w-[20px] h-[20px]",children:n(m,{name:"LoupeIcon",width:"24",height:"24"})}),!a&&n("label",{htmlFor:"search-bar-input",className:"font-sans font-normal text-sm text-secondary-text",children:"Поиск по сайту"})]}),n("input",{id:"search-bar-input",className:"h-12 pl-12 w-full peer font-sans font-normal text-base text-black border border-solid rounded h-full box-border outline-none pr-[6%] border-main-divider focus:border-primary-text",value:a,onChange:e=>i(e.target.value),type:"text",name:"search-bar-input"}),n(Q,{version:"primary",text:"Найти",className:"w-auto invisible peer-focus:visible absolute top-1 right-1",onClick:e=>{e.preventDefault(),console.log("click")},children:n("div",{className:"font-normal text-sm px-9 py-[9px]",children:"Найти"})})]})})),mt=e=>e?.map((e=>({label:e.text||"",blocks:[{accordionBlockType:"LinkDocs",documents:e.items||[]}]}))),dt=a((({className:e="",documents:t,relatedEnterprises:a,contacts:i,socialMedia:l,topItems:s,context:c,horizontalNavigationTitle:o,subMenu:m})=>{const d={context:c,accordionItems:mt(s)};return r("footer",{className:`px-4 py-[26px] bg-white ${e}`,children:[n(Ye,{className:"overflow-hidden",items:i,context:c,hasButton:!0}),n(Ae,{className:"p-0 pt-0 pb-0 mb-4",...d}),n("div",{children:m?.map(ht)}),n(Xe,{context:c,title:"Мобильное приложение",description:"Загрузить для IOS и Android"}),n(ot,{context:c,className:"grow"}),n(lt,{className:"pb-4",media:l,context:c}),n(nt,{title:o,links:a,context:c}),n(st,{links:t,context:c})]})})),ht=(e,t)=>{const{icon:a,href:i,text:l}=e;return r(Q,{href:i,className:"flex text-sm mb-4",children:[a?n(m,{className:"pr-1",name:a,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:l})]},`footer-${t}`)},xt=(e,t,n=((e,t)=>t.startsWith(e)))=>n(P(e),(e=>(e||"").replace(z,""))(P(M(e)?t.href:t.pathname))),ut=e=>t=>xt(t.href,e),pt=e=>t=>t.items?.some(ut(e))||xt(t.href,e)||((e,t)=>Z(e)===Z(t.href))(t.href,e),ft=e=>t=>e?.href===t?.href,bt=(e,t)=>{return(r=e,a=t,(r||[]).map((e=>a?.find(ft(e))||e))).concat((n=e,(t||[]).filter((e=>!n?.find(ft(e))))));var n,r,a};async function gt(){const e=await fetch(Nt());return await e.json()}function Nt(){return`/wcms-resources/${c.SITEMAP||"sitemap"}.json`}const yt="absolute left-0 -bottom-3 w-full h-[2px]",vt=a((({className:e,text:t,href:a,target:i,active:l,onClick:s,children:c,bgColor:o="bg-white"})=>r("a",{className:`relative inline-block bg-transparent text-center no-underline ${e||""}`,href:a,target:i,onClick:s,children:[n("span",{className:wt(o,l),children:t||c}),l?n("div",{className:kt(o,l)}):null]}))),wt=(e,t)=>{let n="text-white";return"bg-white"===e&&(n=t?"text-primary-main":"text-secondary-text hover:text-primary-main"),`${n} font-sans font-normal text-sm`},kt=(e,t)=>t?`${"bg-white"===e?"bg-primary-main":e} ${yt}`:yt,$t=a((({context:e,burgerSubMenu:t,onClick:a,defaultLocation:i="",children:l})=>{const[s,c]=e.useGeolocation(i);return r("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[n("button",{className:"absolute top-4 right-4 border-none bg-transparent",onClick:a,children:n(m,{name:"CloseIcon",width:"24",height:"24",asSVG:!0})}),r(Q,{onClick:c,className:"flex items-center text-sm text-secondary-text mb-4",children:[n(m,{name:"GeolocationIcon",width:"24",height:"24",className:"box-border mr-2",asSVG:!0}),s]}),l,n("div",{className:"mb-7",children:t?.map(Ct)}),n(ot,{context:e,className:"grow"})]})})),Ct=(e,t)=>{const{icon:a,href:i,text:l}=e;return r(Q,{href:i,className:"flex text-sm mb-4",children:[a?n(m,{className:"pr-1",name:a,width:"24",height:"24",asSVG:!0}):null,n("span",{className:"pl-0.5 font-medium",children:l})]},`headerSubMenu-${t}`)},St=a((({onClick:e,bgColor:t})=>r("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-[50px]",children:[r("div",{className:"flex items-center",children:[n("button",{className:"pr-4 border-0 bg-transparent",onClick:e,"aria-label":"Открыть меню",children:n(m,{name:"bg-white"===t?"BurgerIcon":"BurgerIconWhite",width:"24",height:"24",asSVG:!0})}),n(Qe,{bgColor:t})]}),n("button",{className:("bg-white"===t?"text-primary-main":"text-white")+" text-sm border-0 bg-transparent",children:"Войти"})]}))),Tt=a((({className:e="",defaultLocation:t,bgColor:a="bg-white",context:i,topItems:l,burgerSubMenu:s})=>{const c=i.useRouter(),o=function(e){const{data:t}=e(Nt(),gt);return t||{}}(i.useAsyncData),{handlerDecorator:m}=i,d=bt(o.topItems,l).find(pt(c))?.items,h=(e=>(t=[])=>{const n=t?.filter(ut(e));var r;return n?.length?(r=e=>e.href?.length||0,e=>e.reduceRight(((e,t)=>r(e)>r(t)?e:t)))(n):null})(c)(d),[x,u]=i.useState(!1),p=()=>u(!x);return r("header",{className:`${a} ${e}`,children:[r("div",{className:"container px-4 py-0 box-border",children:[n(St,{onClick:p,bgColor:a}),n("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-[50px]",children:n("div",{className:"flex",children:d?.map(((e,t)=>jt({...W({router:c,handlerDecorator:m},e),active:e===h,bgColor:a},t)))})})]}),x?n($t,{context:i,onClick:p,burgerSubMenu:s,defaultLocation:t,children:n(Ae,{context:i,accordionItems:mt(l),className:"p-0 pt-0 pb-0 mb-4"})}):null]})})),jt=(e,t)=>n(vt,{className:"mr-8 whitespace-nowrap text-sm",...e},String(t)),_t={primary:"text-primary-text",secondary:"text-white"},Dt={primary:"text-secondary-text",secondary:"text-white"};const It=a((({className:e="",context:t,title:a,headingType:i="h2",description:l,benefits:c,buttons:o,image:d,items:h,version:x="primary"})=>r("div",{className:`w-full text-primary-text ${e}`,children:[n("div",{children:r(q,{context:t,title:a&&n(s,{headingType:i,title:a,className:"whitespace-pre-wrap max-w-[600px] "+(a?"mb-3":"")}),buttons:o?.length?n(X,{context:t,buttons:o,className:"flex flex-col mt-5 gap-2.5"}):null,children:[l&&n(Y,{description:l}),c?.length?n("div",{className:"mt-5",children:c.map(((e,t)=>function(e,t,a){return r("div",{className:"flex gap-3 items-center mb-2.5 last:mb-0",children:[e.icon&&n(m,{className:"w-6 h-6 rounded-full box-border",name:e.icon,width:"24",height:"24",asSVG:!0}),n("div",{className:`font-medium text-m-title-xs m-0 ${_t[a]}`,children:e.label}),e.description&&n("div",{className:`font-normal text-m-sm ${Dt[a]}`,children:e.description})]},String(t))}(e,t,x)))}):null,h?.length?n(B,{items:h}):null]})}),Lt(d)]})));function Lt(e){return e?.src?n("div",{className:"mt-5",children:n(d,{image:{className:"block",...e}})}):null}const Bt=a((e=>{const{className:t}=e;return n("section",{className:`font-sans bg-white px-4 py-6 ${t||""}`,children:n(It,{...e})})})),Rt=a((({block:e,headingType:t,context:r})=>n("section",{className:"flex grow-0 shrink-0 basis-full px-4 pt-6",role:"listitem",children:n("div",{className:"flex grow",children:n(It,{context:r,headingType:t||"h2",...e})})}))),At=a((({className:e,context:t,slides:r=[]})=>{const a=r.map((e=>e.productBlock));return n("section",{className:`font-sans bg-white overflow-hidden w-100 pb-6 ${e||""}`,children:n(N,{context:t,children:a.map(((e,r)=>n(Rt,{block:e,context:t},String(r))))})})})),Ot=a((({className:e,title:t,description:a,steps:i,size:l="normal"})=>r("section",{className:`box-border font-sans text-primary-text bg-white px-4 py-6 flex flex-col ${e||""}`,children:[t&&n(s,{headingType:"h3",className:"text-center",title:t}),a&&n("p",{className:`text-m-md text-center ${t&&"mt-2"}`,children:a}),i?.length?n("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:n("div",{className:"flex flex-col justify-between gap-x-[101px]",children:i.map(((e,t)=>Vt({step:e,size:l,i:t,length:i.length})))})}):null]}))),Vt=e=>{const{step:t,size:a,i:i,length:l}=e,s=l-1===i,c="normal"===a?"ml-[34px]":"ml-[24px]";return n("div",{children:r("div",{className:"flex flex-row text-center relative",children:[r("div",{children:[Mt(t,a,i),!s&&n("div",{className:`min-h-8 h-full w-[2px] bg-secondary-light ${c}`})]}),r("div",{className:"flex flex-col justify-start relative",children:[t.label&&n("div",{className:"font-medium text-m-title-xs m-0 text-left",children:t.label}),t.description&&n("div",{className:"font-normal text-sm text-secondary-text text-left "+(t.label?"mt-1":""),children:t.description})]})]},String(i))},String(i))},Mt=(e,t,r)=>{const a="normal"===t?"38":"27";return n("div",{className:`${"normal"===t?"h-[70px] w-[70px] min-w-[70px] min-h-[70px]":"h-[50px] w-[50px] min-w-[50px] min-h-[50px]"} bg-secondary-light rounded-full z-10 mr-3 flex justify-center content-center`,children:n("span",{className:`font-medium text-secondary-text self-center ${"normal"===t?"text-m-title":"text-m-title-xs"}`,children:e.icon&&n(m,{name:e.icon,width:a,height:a})||r+1})})},Pt={Accordion:Ae,ExchangeRateTile:Ze,Footer:dt,Gallery:de,Header:Tt,Headline:x,LinkDocs:S,MobileAppTile:Xe,ProductBlock:Bt,ProductGallery:At,StepsBlock:Ot,TextBlock:A},Zt=a((({className:e,onClick:t,ariaLabel:r})=>n("button",{type:"button",className:`border-0 w-[36px] bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":r,children:Ht()}))),Ht=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return r("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[n("path",{...e,strokeMiterlimit:"10",d:"M21.48 11.95c.5-1.4-.4-2.6-1.9-2.6h-4c-.6 0-1.1-.5-1-1.2l.5-3.2c.2-.9-.4-1.9-1.3-2.2-.8-.3-1.8.1-2.2.7l-4.1 6.1M7.48 18.35l3.1 2.4c.4.4 1.3.6 1.9.6h3.8c1.2 0 2.5-.9 2.8-2.1l1.24-3.77"}),n("path",{...e,d:"M2.38 18.35v-9.8c0-1.4.6-1.9 2-1.9h1c1.4 0 2 .5 2 1.9v9.8c0 1.4-.6 1.9-2 1.9h-1c-1.4 0-2-.5-2-1.9Z"})]})},zt=a((({className:e,context:t})=>{const a=t.useLikeService();return r("div",{className:`border-main border-2 border-solid bg-white flex w-[125px] items-center justify-center gap-3 p-2 font-sans ${e||""}`,children:[n(Zt,{onClick:a.like,ariaLabel:"Поставить отметку «лайк»"}),n(Zt,{onClick:a.dislike,className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),n("span",{className:"select-none",children:a.likeCount})]})})),Et=a((({className:e,context:t,title:a,description:i="Блок в разработке..."})=>n("section",{className:`bg-white text-primary-text font-sans p-9 box-border ${e} ${re(e)} ${ne(e)} `,children:r(q,{context:t,title:a?n(s,{headingType:te(e),title:a,className:"whitespace-pre-wrap max-w-[600px]"}):null,children:[i?n(Y,{className:"mt-4 max-w-[600px]",description:i}):null,n("figure",{className:"m-0 min-w-[600px]",children:Gt()})]})}))),Gt=(e=3)=>Ft(100,e).map((e=>Math.floor(e))).map(Wt),Wt=(e=100,t)=>n("div",{style:{width:`${e}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),Ft=(e,t)=>[e].concat(t>0?Ft(e/1.618,t-1):[]),Ut=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),Jt=a((({className:e,context:t,blocksRegistry:a,data:{style:i,blocks:l,slots:s={},likeControl:c,colorPalette:o="pc"},blockDecorator:m=Ut})=>{const{header:d}=s;return r("section",{className:`relative ${Qt(i)} ${e||""}`,"data-theme":o,children:[d?.blocks?.length?n("div",{className:`${Qt(d?.style)}`,children:d.blocks.map(((e,n)=>Kt({block:e,blockDecorator:m,blocksRegistry:a,context:t},n)))}):null,l?.length?n("div",{className:"container grid grid-cols-12 gap-1",children:l.map(((e,n)=>Kt({block:e,blockDecorator:m,blocksRegistry:a,context:t},n)))}):null,c&&n("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:n(zt,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto",context:t})})]})}));function Kt({block:e,blockDecorator:t,blocksRegistry:r,context:a},i){const{type:l}=e;l&&l in r||console.warn(`No block with "${l}" is registered`);const s=r[l||"Placeholder"]||Et;return t({blockClassName:Qt(e.style),block:e,render:e=>{const{version:t,content:r}=e.block;return n(s,{className:e.blockClassName,version:t,context:a,...r},`${l}-${i}`)}},`block-${i}`)}function Qt(e){return e?e.join(" "):""}const Xt=a((({HeadComponent:e,data:t,children:a})=>{const{title:i,main:l,og:s,twitter:c,jsonLd:o}=t,{description:m,keywords:d,canonical:h,robots:x}=l||{};return r(e,{children:[n("title",{children:i}),n("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),m&&n("meta",{name:"description",content:m}),d&&n("meta",{name:"keywords",content:d.join(",")}),x&&n("meta",{name:"robots",content:x.join(",")}),Yt(s),qt(c),h&&n("link",{rel:"canonical",href:h}),o&&n("script",{type:"application/ld+json",children:o}),a]})}));function Yt(e){return e?Object.entries(e).map((([e,t])=>n("meta",{name:`og:${e}`,content:t},e))):null}function qt(e){return e?Object.entries(e).map((([e,t])=>n("meta",{name:`twitter:${e}`,content:t},e))):null}function en(e){const{mobile:t,...n}=e;return t?{...n,...t,content:{...n.content,...t.content}}:e}function tn(e){return e?.filter((e=>(e?.type||e?.mobile?.type||"")in Pt&&!e.mobile?.hidden)).map(en)}e.Blocks=Pt,e.ContentPage=Jt,e.ContentPageHead=Xt,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.Header=Tt,e.Icon=m,e.LikeAPI=function(e,t=""){async function n(){try{const e=JSON.parse(globalThis.localStorage.getItem(i)||"");if(e?.token)return e}catch(e){}try{const e=await fetch(`${t}/assist/v1/public/auth`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:n,name:r}=await e.json();return globalThis.localStorage.setItem(i,JSON.stringify({token:n,name:r})),{token:n,name:r}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...r){if(!r.length)return[];const{token:a}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a},body:JSON.stringify({node_ids:r})}),{likes:i}=await n.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}},dislike:async function(r){if(!r)return 0;const{token:a,name:i}=await n();try{const n=await fetch(`${t}/assist/v1/public/projects/${e}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:a,UserID:i},body:JSON.stringify({node_id:r,user_name:i})}),{likes:l}=await n.json();return l||0}catch(e){return console.error(e),0}}}},e.joinList=function(e){return t=>t.reduce(((t,n,r)=>t.length?t.concat({...e,key:r},n):[n]),[])},e.normalizePage=function(e){if(!e)return;const{blocks:t,slots:n}=e;return{...e,blocks:tn(t),slots:n&&Object.keys(n).reduce(((e,t)=>({...e,[t]:{...n[t],blocks:tn(n[t].blocks)}})),{})}},e.projectSettings=c,e.setup=t,e.url=H,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -3,11 +3,18 @@ exports.ContentPageHead = 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
5
|
exports.ContentPageHead = (0, uni_jsx_1.JSX)(({ HeadComponent, data, children }) => {
|
|
6
|
-
const { title, main
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
: null, twitter
|
|
10
|
-
? Object.entries(twitter).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
11
|
-
: null, canonical && (0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }), jsonLd && (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
6
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
7
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
8
|
+
return ((0, jsx_runtime_1.jsxs)(HeadComponent, { children: [(0, jsx_runtime_1.jsx)("title", { children: title }), (0, jsx_runtime_1.jsx)("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && (0, jsx_runtime_1.jsx)("meta", { name: "description", content: description }), keywords && (0, jsx_runtime_1.jsx)("meta", { name: "keywords", content: keywords.join(',') }), robots && (0, jsx_runtime_1.jsx)("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && (0, jsx_runtime_1.jsx)("link", { rel: "canonical", href: canonical }), jsonLd && (0, jsx_runtime_1.jsx)("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
12
9
|
});
|
|
10
|
+
function renderOpenGraph(og) {
|
|
11
|
+
return og
|
|
12
|
+
? Object.entries(og).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `og:${key}`, content: value }, key)))
|
|
13
|
+
: null;
|
|
14
|
+
}
|
|
15
|
+
function renderTwitter(twitter) {
|
|
16
|
+
return twitter
|
|
17
|
+
? Object.entries(twitter).map(([key, value]) => ((0, jsx_runtime_1.jsx)("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
18
|
+
: null;
|
|
19
|
+
}
|
|
13
20
|
//# sourceMappingURL=ContentPageHead.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAQ3B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,
|
|
1
|
+
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAQ3B,QAAA,eAAe,GAAG,IAAA,aAAG,EAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAChE,OAAO,CACL,wBAAC,aAAa,eACZ,4CAAQ,KAAK,GAAS,EACtB,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,WAAW,IAAI,iCAAM,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,GAAI,EAChE,QAAQ,IAAI,iCAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EACjE,MAAM,IAAI,iCAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EAC3D,eAAe,CAAC,EAAE,CAAC,EACnB,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,IAAI,iCAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,SAAS,GAAI,EACtD,MAAM,IAAI,mCAAQ,IAAI,EAAC,qBAAqB,YAAE,MAAM,GAAU,EAC9D,QAAQ,IACK,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,EAAsC;IAC7D,OAAO,EAAE;QACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACvC,iCAAgB,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAAtC,GAAG,CAAuC,CACtD,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,iCAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/mobile/dist/types.d.ts
CHANGED
|
@@ -20,19 +20,18 @@ export interface SlotsMap {
|
|
|
20
20
|
header?: Slot;
|
|
21
21
|
}
|
|
22
22
|
export interface ContentPageMeta {
|
|
23
|
-
title
|
|
24
|
-
slug
|
|
25
|
-
main
|
|
23
|
+
title?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
main?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
canonical?: string;
|
|
29
|
+
robots?: string[];
|
|
30
|
+
};
|
|
26
31
|
og?: Record<string, string>;
|
|
27
32
|
twitter?: Record<string, string>;
|
|
28
33
|
jsonLd?: string;
|
|
29
34
|
}
|
|
30
|
-
export interface ContentPageMetaMain {
|
|
31
|
-
description?: string;
|
|
32
|
-
keywords?: string[];
|
|
33
|
-
canonical?: string;
|
|
34
|
-
robots?: string[];
|
|
35
|
-
}
|
|
36
35
|
export interface ContentPageDef extends ContentPageMeta {
|
|
37
36
|
style?: string[];
|
|
38
37
|
blocks?: BlockDef[];
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
|
|
2
2
|
import { JSX } from '@redneckz/uni-jsx';
|
|
3
3
|
export const ContentPageHead = JSX(({ HeadComponent, data, children }) => {
|
|
4
|
-
const { title, main
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
: null, twitter
|
|
8
|
-
? Object.entries(twitter).map(([key, value]) => (_jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
9
|
-
: null, canonical && _jsx("link", { rel: "canonical", href: canonical }), jsonLd && _jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
4
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
5
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
6
|
+
return (_jsxs(HeadComponent, { children: [_jsx("title", { children: title }), _jsx("meta", { name: "viewport", content: "width=device-width, initial-scale=1" }), description && _jsx("meta", { name: "description", content: description }), keywords && _jsx("meta", { name: "keywords", content: keywords.join(',') }), robots && _jsx("meta", { name: "robots", content: robots.join(',') }), renderOpenGraph(og), renderTwitter(twitter), canonical && _jsx("link", { rel: "canonical", href: canonical }), jsonLd && _jsx("script", { type: "application/ld+json", children: jsonLd }), children] }));
|
|
10
7
|
});
|
|
8
|
+
function renderOpenGraph(og) {
|
|
9
|
+
return og
|
|
10
|
+
? Object.entries(og).map(([key, value]) => (_jsx("meta", { name: `og:${key}`, content: value }, key)))
|
|
11
|
+
: null;
|
|
12
|
+
}
|
|
13
|
+
function renderTwitter(twitter) {
|
|
14
|
+
return twitter
|
|
15
|
+
? Object.entries(twitter).map(([key, value]) => (_jsx("meta", { name: `twitter:${key}`, content: value }, key)))
|
|
16
|
+
: null;
|
|
17
|
+
}
|
|
11
18
|
//# sourceMappingURL=ContentPageHead.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,
|
|
1
|
+
{"version":3,"file":"ContentPageHead.js","sourceRoot":"","sources":["../../../src/components/ContentPage/ContentPageHead.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAQxC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAuB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAClD,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;IAChE,OAAO,CACL,MAAC,aAAa,eACZ,0BAAQ,KAAK,GAAS,EACtB,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAC,qCAAqC,GAAG,EACrE,WAAW,IAAI,eAAM,IAAI,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,GAAI,EAChE,QAAQ,IAAI,eAAM,IAAI,EAAC,UAAU,EAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EACjE,MAAM,IAAI,eAAM,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,GAAI,EAC3D,eAAe,CAAC,EAAE,CAAC,EACnB,aAAa,CAAC,OAAO,CAAC,EACtB,SAAS,IAAI,eAAM,GAAG,EAAC,WAAW,EAAC,IAAI,EAAE,SAAS,GAAI,EACtD,MAAM,IAAI,iBAAQ,IAAI,EAAC,qBAAqB,YAAE,MAAM,GAAU,EAC9D,QAAQ,IACK,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,EAAsC;IAC7D,OAAO,EAAE;QACP,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CACvC,eAAgB,IAAI,EAAE,MAAM,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAAtC,GAAG,CAAuC,CACtD,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,SAAS,aAAa,CAAC,OAA2C;IAChE,OAAO,OAAO;QACZ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAC5C,eAAgB,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,IAA3C,GAAG,CAA4C,CAC3D,CAAC;QACJ,CAAC,CAAC,IAAI,CAAC;AACX,CAAC"}
|
package/mobile/lib/types.d.ts
CHANGED
|
@@ -20,19 +20,18 @@ export interface SlotsMap {
|
|
|
20
20
|
header?: Slot;
|
|
21
21
|
}
|
|
22
22
|
export interface ContentPageMeta {
|
|
23
|
-
title
|
|
24
|
-
slug
|
|
25
|
-
main
|
|
23
|
+
title?: string;
|
|
24
|
+
slug?: string;
|
|
25
|
+
main?: {
|
|
26
|
+
description?: string;
|
|
27
|
+
keywords?: string[];
|
|
28
|
+
canonical?: string;
|
|
29
|
+
robots?: string[];
|
|
30
|
+
};
|
|
26
31
|
og?: Record<string, string>;
|
|
27
32
|
twitter?: Record<string, string>;
|
|
28
33
|
jsonLd?: string;
|
|
29
34
|
}
|
|
30
|
-
export interface ContentPageMetaMain {
|
|
31
|
-
description?: string;
|
|
32
|
-
keywords?: string[];
|
|
33
|
-
canonical?: string;
|
|
34
|
-
robots?: string[];
|
|
35
|
-
}
|
|
36
35
|
export interface ContentPageDef extends ContentPageMeta {
|
|
37
36
|
style?: string[];
|
|
38
37
|
blocks?: BlockDef[];
|
|
@@ -7,13 +7,8 @@ export interface ContentPageHeadProps {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data, children }) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
main: { description, keywords, canonical, robots },
|
|
13
|
-
og,
|
|
14
|
-
twitter,
|
|
15
|
-
jsonLd,
|
|
16
|
-
} = data;
|
|
10
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
11
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
17
12
|
return (
|
|
18
13
|
<HeadComponent>
|
|
19
14
|
<title>{title}</title>
|
|
@@ -21,19 +16,27 @@ export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data,
|
|
|
21
16
|
{description && <meta name="description" content={description} />}
|
|
22
17
|
{keywords && <meta name="keywords" content={keywords.join(',')} />}
|
|
23
18
|
{robots && <meta name="robots" content={robots.join(',')} />}
|
|
24
|
-
{og
|
|
25
|
-
|
|
26
|
-
<meta key={key} name={`og:${key}`} content={value} />
|
|
27
|
-
))
|
|
28
|
-
: null}
|
|
29
|
-
{twitter
|
|
30
|
-
? Object.entries(twitter).map(([key, value]) => (
|
|
31
|
-
<meta key={key} name={`twitter:${key}`} content={value} />
|
|
32
|
-
))
|
|
33
|
-
: null}
|
|
19
|
+
{renderOpenGraph(og)}
|
|
20
|
+
{renderTwitter(twitter)}
|
|
34
21
|
{canonical && <link rel="canonical" href={canonical} />}
|
|
35
22
|
{jsonLd && <script type="application/ld+json">{jsonLd}</script>}
|
|
36
23
|
{children}
|
|
37
24
|
</HeadComponent>
|
|
38
25
|
);
|
|
39
26
|
});
|
|
27
|
+
|
|
28
|
+
function renderOpenGraph(og: Record<string, string> | undefined) {
|
|
29
|
+
return og
|
|
30
|
+
? Object.entries(og).map(([key, value]) => (
|
|
31
|
+
<meta key={key} name={`og:${key}`} content={value} />
|
|
32
|
+
))
|
|
33
|
+
: null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function renderTwitter(twitter: Record<string, string> | undefined) {
|
|
37
|
+
return twitter
|
|
38
|
+
? Object.entries(twitter).map(([key, value]) => (
|
|
39
|
+
<meta key={key} name={`twitter:${key}`} content={value} />
|
|
40
|
+
))
|
|
41
|
+
: null;
|
|
42
|
+
}
|
package/mobile/src/types.ts
CHANGED
|
@@ -26,21 +26,19 @@ export interface SlotsMap {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface ContentPageMeta {
|
|
29
|
-
title
|
|
30
|
-
slug
|
|
31
|
-
main
|
|
29
|
+
title?: string;
|
|
30
|
+
slug?: string;
|
|
31
|
+
main?: {
|
|
32
|
+
description?: string;
|
|
33
|
+
keywords?: string[];
|
|
34
|
+
canonical?: string;
|
|
35
|
+
robots?: string[];
|
|
36
|
+
};
|
|
32
37
|
og?: Record<string, string>;
|
|
33
38
|
twitter?: Record<string, string>;
|
|
34
39
|
jsonLd?: string;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
export interface ContentPageMetaMain {
|
|
38
|
-
description?: string;
|
|
39
|
-
keywords?: string[];
|
|
40
|
-
canonical?: string;
|
|
41
|
-
robots?: string[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
42
|
export interface ContentPageDef extends ContentPageMeta {
|
|
45
43
|
style?: string[];
|
|
46
44
|
blocks?: BlockDef[]; //! for compatibility
|
package/package.json
CHANGED
|
@@ -7,13 +7,8 @@ export interface ContentPageHeadProps {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data, children }) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
main: { description, keywords, canonical, robots },
|
|
13
|
-
og,
|
|
14
|
-
twitter,
|
|
15
|
-
jsonLd,
|
|
16
|
-
} = data;
|
|
10
|
+
const { title, main, og, twitter, jsonLd } = data;
|
|
11
|
+
const { description, keywords, canonical, robots } = main || {};
|
|
17
12
|
return (
|
|
18
13
|
<HeadComponent>
|
|
19
14
|
<title>{title}</title>
|
|
@@ -21,19 +16,27 @@ export const ContentPageHead = JSX<ContentPageHeadProps>(({ HeadComponent, data,
|
|
|
21
16
|
{description && <meta name="description" content={description} />}
|
|
22
17
|
{keywords && <meta name="keywords" content={keywords.join(',')} />}
|
|
23
18
|
{robots && <meta name="robots" content={robots.join(',')} />}
|
|
24
|
-
{og
|
|
25
|
-
|
|
26
|
-
<meta key={key} name={`og:${key}`} content={value} />
|
|
27
|
-
))
|
|
28
|
-
: null}
|
|
29
|
-
{twitter
|
|
30
|
-
? Object.entries(twitter).map(([key, value]) => (
|
|
31
|
-
<meta key={key} name={`twitter:${key}`} content={value} />
|
|
32
|
-
))
|
|
33
|
-
: null}
|
|
19
|
+
{renderOpenGraph(og)}
|
|
20
|
+
{renderTwitter(twitter)}
|
|
34
21
|
{canonical && <link rel="canonical" href={canonical} />}
|
|
35
22
|
{jsonLd && <script type="application/ld+json">{jsonLd}</script>}
|
|
36
23
|
{children}
|
|
37
24
|
</HeadComponent>
|
|
38
25
|
);
|
|
39
26
|
});
|
|
27
|
+
|
|
28
|
+
function renderOpenGraph(og: Record<string, string> | undefined) {
|
|
29
|
+
return og
|
|
30
|
+
? Object.entries(og).map(([key, value]) => (
|
|
31
|
+
<meta key={key} name={`og:${key}`} content={value} />
|
|
32
|
+
))
|
|
33
|
+
: null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function renderTwitter(twitter: Record<string, string> | undefined) {
|
|
37
|
+
return twitter
|
|
38
|
+
? Object.entries(twitter).map(([key, value]) => (
|
|
39
|
+
<meta key={key} name={`twitter:${key}`} content={value} />
|
|
40
|
+
))
|
|
41
|
+
: null;
|
|
42
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -26,21 +26,19 @@ export interface SlotsMap {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export interface ContentPageMeta {
|
|
29
|
-
title
|
|
30
|
-
slug
|
|
31
|
-
main
|
|
29
|
+
title?: string;
|
|
30
|
+
slug?: string;
|
|
31
|
+
main?: {
|
|
32
|
+
description?: string;
|
|
33
|
+
keywords?: string[];
|
|
34
|
+
canonical?: string;
|
|
35
|
+
robots?: string[];
|
|
36
|
+
};
|
|
32
37
|
og?: Record<string, string>;
|
|
33
38
|
twitter?: Record<string, string>;
|
|
34
39
|
jsonLd?: string;
|
|
35
40
|
}
|
|
36
41
|
|
|
37
|
-
export interface ContentPageMetaMain {
|
|
38
|
-
description?: string;
|
|
39
|
-
keywords?: string[];
|
|
40
|
-
canonical?: string;
|
|
41
|
-
robots?: string[];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
42
|
export interface ContentPageDef extends ContentPageMeta {
|
|
45
43
|
style?: string[];
|
|
46
44
|
blocks?: BlockDef[]; //! for compatibility
|