@redneckz/wildless-cms-uni-blocks 0.7.2 → 0.7.3
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 +9 -4
- package/bundle/bundle.umd.min.js +1 -1
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -3
- package/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/common.css +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -3
- package/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/lib/ui-kit/SwipeListControl/SwipeListControl.fixture.d.ts +12 -0
- package/mobile/bundle/bundle.umd.js +9 -4
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js +8 -3
- package/mobile/dist/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js +8 -3
- package/mobile/lib/ui-kit/SwipeListControl/SwipeListContainer.js.map +1 -1
- package/mobile/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +9 -4
- package/package.json +1 -1
- package/src/components/SwipeListControlBlock/SwipeListControlBlock.fixture.tsx +1 -1
- package/src/ui-kit/SwipeListControl/SwipeListContainer.tsx +9 -4
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.mobile.tsx +2 -2
- package/src/ui-kit/SwipeListControl/SwipeListControl.fixture.tsx +53 -0
|
@@ -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";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),r=n("useEffect"),l=n("useCallback"),a=n("useMemo"),s=n("useRef");const o=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get FOOTER(){return this._.FOOTER}get CDN(){return this._.CDN}get BASE_PATH(){return this._.BASE_PATH&&!this._.BASE_PATH.endsWith("/")?`${this._.BASE_PATH}/`:this._.BASE_PATH}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},c="likesToken";function d(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(c)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:n}=await e.json();return globalThis.localStorage?.setItem(c,JSON.stringify({token:t,name:n})),{token:t,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify({node_ids:t})}),{likes:i}=await e.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:n,name:i}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:i},body:JSON.stringify({node_id:t,user_name:i})}),{likes:r}=await e.json();return r||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:n,name:i}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:i},body:JSON.stringify({node_id:t,user_name:i})}),{likes:r}=await e.json();return r||0}catch(e){return console.error(e),0}}}}const m=(...e)=>globalThis._uni._jsx(...e),h=(...e)=>globalThis._uni._jsxs(...e),u=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:p(e)),t._tmpl},p=e=>{function t(t,n){const{children:i,...r}=t||{},l=n?.slots?.default,a=i||l&&l();return e(Object.assign(r,a&&{children:a}),n)}return t.inheritAttrs=!1,t},g=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),b=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),x=[];function f(e,t){const{key:n,blockDecorator:i=b,blocksRegistry:r={},ancestors:l=x,className:a=""}=t,{type:s}=e;s&&s in r||console.warn(`No block with "${s}" is registered`);const o=s&&r[s];return i({blockClassName:g("scroll-mt-12",a,e.style||"col-span-12"),block:e,ancestors:l,render:({block:i,blockClassName:r})=>{const{content:l}=i;return o?m(o,{className:r,block:e,options:t,...l},n):null}},n)}const N=[],y=(e,{key:t,ancestors:n=N,slotName:i=null,renderChild:r=f,...l})=>(e||[]).map(((e,a)=>r(e,{...l,key:`${t||e.type}-${a}`,ancestors:l.parent?[...n||N,[l.parent,i]]:n})));function v({children:e,block:t,options:n,renderChild:i}){return e||(t&&n?y(t.blocks,{...n,parent:t,renderChild:i}):null)}class w{static inst=new w;subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}}function k(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=a((()=>({threshold:C(t),root:n?.current})),[t,n?.current]);return r((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}function C(e=0){const t=Math.round(10*e);return new Array(t).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const S=e=>e?.replace("#",""),T=e=>`${globalThis.location?.pathname}#${S(e)}`;class ${static inst=new $;eventBus=new w;constructor(){const e=S(globalThis.location?.hash);e&&this.eventBus.subject("goto",{anchor:e})}goto(e){const t=S(e);t&&(this.push(t),this.eventBus.fire("goto",{anchor:t}))}push(e){globalThis.history?.pushState(null,"",T(e))}replace(e){globalThis.history?.replaceState(null,"",T(e))}reset(){globalThis.history?.replaceState(null,"",T())}}const _={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},I=u((({className:e="",version:t="primary",block:n,tag:a="section",role:s,children:o})=>{const c=a,d=function(e,t=$.inst){const n=k(l((n=>{if(!e||!n?.length)return;const i=n[n.length-1];t.eventBus.fire("intersection",{block:e,intersection:i})}),[e,t]),{sensitivity:1});return r((()=>{if(n.current)return t.eventBus.subscribe("goto",(({anchor:t})=>{n.current&&e?.anchor===t&&n.current.scrollIntoView({behavior:"smooth",block:"start"})}))}),[e,t]),n}(n),[h,u]=i(!0);return r((()=>w.inst.subscribe("tab",(e=>{if("group"===e.type){const t=n?.labels?.length||n?.anchor;u(!e.label||(!t||Boolean(n?.labels?.includes(e.label))))}else u(!0)}))),[n]),h?m(c,{className:g("group",_[t],e),...t?{"data-ver":t}:{},...n?.anchor?{id:n.anchor,ref:d}:{},role:s,children:o}):null})),A={h0:"text-m-title",h1:"text-m-title",h2:"text-m-title",h3:"text-h6",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},j=u((e=>{const{className:t,headingType:n="h3",title:i,as:r="h3"}=e;return m(r,{className:`font-sans font-medium m-0 ${A[n]} ${t||""}`,children:i})})),R=u((({children:e,...t})=>m("p",{className:["font-sans",...Object.values(t)].join(" "),children:e}))),B=u((({children:e})=>m("ul",{className:"list-none m-0 p-0",children:e}))),D=u((({title:e,description:t,className:n="",...i})=>h(I,{className:`py-6 px-4 ${n}`,...i,children:[e?m(j,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?m("div",{className:"mb-5",children:m(R,{size:"text-m",font:"font-light",align:"text-center",children:t})}):null,m(B,{children:v(i)})]})));D.childrenTypes=["AccordionItem"];const O=u((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:r,renderFoldButton:a})=>{const[s,o]=i(n),c=l((()=>{o((e=>!e))}),[]),d=r({isUnfolded:s,onToggle:c}),m=a?a({isUnfolded:s,onToggle:c}):null;return h("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})})),V=u((({className:e="",isUnfolded:t,children:n})=>{const i=s(null);return r((()=>{i.current&&(i.current.style.maxHeight=t?`${i.current.scrollHeight}px`:"")}),[t,n?.length]),m("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} ${e}`,children:n})})),L={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},M=u((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:r=i,iconVersion:l="color",asSVG:a,...s})=>{const c=`${o.CDN||""}icons/${n}.svg`;return a&&"normal"!==l?m(z,{className:e,children:h("svg",{className:g(P(s.width),L[l],"white"===l?"invert":"",t),...s,"aria-hidden":"true",children:[r?m("title",{children:r}):null,i?m("desc",{children:i}):null,m("use",{href:`${c}#icon`,xlinkHref:`${c}#icon`})]})}):m("img",{className:e,src:c,alt:i,title:r,...s,"aria-hidden":"true"})})),P=e=>e?"":"w-full h-full",z=u((({className:e,children:t})=>e?m("div",{className:e,children:t}):t)),E=(e,t)=>e.media&&t.media?e.media-t.media:0,F=u((({className:e="",image:t,imageClassName:n="",isMobile:i=!1,pathPrefix:r})=>{if(!t||!t?.sources&&!t?.src)return null;return h("picture",{className:`${i?"flex":"flex-none"} ${e}`,children:[t?.sources?.length?t.sources.sort(E).map((({src:e,format:n,media:i},l)=>m("source",{srcSet:J(e,r),type:W(n),media:i?`(max-width: ${i}px)`:"",...t.size},`${l}_${e}`))):null,H({...t,src:G(t.src,r)},n,i)]})})),H=(e,t="",n=!1)=>{const i={width:e.size?.width?`${e.size?.width}px`:"100%",height:e.size?.height?`${e.size?.height}px`:"100%"},r=e.title||"",l=e.alt||e.title,a=n?"m-auto":"m-0";return m("img",{src:e.src,className:`${a} ${t}`,alt:l,title:r,style:i,...e.size})},G=(e,t)=>!e||e?.startsWith("data:image")?e:`${((e="")=>e&&!e.endsWith("/")?`${e}/`:e)(t)}${e}`,J=(e,t)=>e?.split(",").map((e=>G(e.trim(),t))).join(", ");function W(e){return e?`image/${String(e)}`:void 0}const U=u((({className:e="",image:t,imageClassName:n="",isMobile:i,pathPrefix:r,...l})=>t?.src||t?.icon?t.icon?m(M,{className:e,imageClassName:n,iconVersion:t?.iconVersion||"normal",name:t.icon,...l}):m(F,{className:e,imageClassName:n,image:t,isMobile:i,pathPrefix:r}):null)),Y=u((e=>m(U,{...e,isMobile:!0}))),X=u((({children:e,...t})=>m("span",{className:["font-sans",...Object.values(t)].join(" "),children:e}))),K=(e,t="primary")=>({...e,iconVersion:e?.iconVersion??("secondary"===t?"white":"color")}),q=["PlusIcon","MinusIcon"],Q=u((({className:e="",label:t="",labelIcon:n,isExpanded:i,...r})=>{const{bordered:l}=function(e,t){const{content:n}=function(e){return e?.parent||{}}(e);return n||t}(r.options,{});return m("li",{className:`${l?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0"} border-solid border-main-divider ${e}`,children:m(O,{isFoldButtonOnTop:!0,unfoldedByDefault:i,renderFoldableSection:({isUnfolded:e})=>m(V,{className:"flex flex-wrap group-last:last:pb-0 gap-5 [&>*]:p-0",isUnfolded:e,children:v(r)}),renderFoldButton:({isUnfolded:e,onToggle:i})=>m(Z,{className:l?"":"py-3.5 px-0",label:t,icon:q[Number(e)],primaryIcon:n,onClick:i})})})}));Q.childrenTypes=[];const Z=u((({className:e,icon:t,label:n,primaryIcon:i,onClick:r})=>h("button",{className:`border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text group cursor-pointer ${e}`,onClick:r,children:[h("div",{className:"flex group-hover:text-primary-main",children:[i?m(Y,{image:K(i),className:"mr-3 flex-shrink-0",width:"24",height:"24",asSVG:!0}):null,m(X,{size:"text-m-title-xs",font:"font-medium",children:n})]}),m(Y,{className:"flex-shrink-0",image:K({icon:t}),width:"24",height:"24",asSVG:!0})]}))),ee=u((({className:e="",style:t,idx:n,activeIndex:i,observerOptions:r,children:a,onIntersection:s})=>{const o=k(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),r);return m("div",{className:`inline-block snap-always box-border ${e}`,style:t,role:"listitem","aria-current":Boolean(n===i),ref:o,children:a})})),te=["min-w-[100%]","min-w-[50%]","min-w-[33.33%]","min-w-[25%]"],ne=u((({className:e="",containerRef:t,activeIndex:n,visibleItemCount:i=0,gap:r=0,padding:a=0,listType:o="horizontal-list",snapAlign:c="snap-center",children:d,onVisibleItemsChange:h,onVisibleIndicesChange:u})=>{const p={sensitivity:1,rootRef:t},b=s([]),x=l(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,h&&h(n),u&&u(re(n))}),[h,u]),f=i>0?r*Number(i)-1:0,N="horizontal-list"===o,y={...N?ie(a,f):{},gap:`${r}px`};return m("div",{className:g("box-border overflow-auto no-scrollbar",o,e),style:y,role:"list",ref:t,children:(v=(e,t)=>m(ee,{className:g(c,i?te[i-1]:"","vertical-list"===o?"h-full":""),style:N?ie(a/4):{},activeIndex:n,idx:t,observerOptions:p,onIntersection:x,children:e},String(t)),e=>null==e?e:Array.isArray(e)?e.map(v):v(e,0))(d)});var v})),ie=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),re=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),le={"horizontal-list":"mx-auto mt-5 w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},ae={"horizontal-list":"w-6","vertical-list":"h-6"},se=u((({containerRef:e,activeIndex:t,dotCount:n=0,listType:i="horizontal-list"})=>n?m("div",{className:`flex gap-2 ${le[i]}`,children:new Array(n).fill(null).map(((n,r)=>m("div",{className:`cursor-pointer bg-primary-main rounded-full transition-width duration-300 ${r===t?ae[i]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(n=>{n!==t&&e?.current&&e.current.children[n]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(r)},String(r))))}):null)),oe=e=>e,ce=(e=oe)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),de=(e=oe)=>ce((t=>-e(t))),me=e=>t=>e.scrollWidth/t,he=e=>(t,n)=>{e.scrollBy({left:n*me(e)(t),behavior:"smooth"})},ue=({itemCount:e,isCyclic:t,onVisibleIndicesChange:n})=>{const r=s(null),[a,o]=i([]),c=l((e=>{o((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),n&&n(e)}),[e]),[d,m]=a.length?[de()(a),ce()(a)]:[-1,-1],h=d>0,u=m<e-1,p=l((()=>{var n;r.current&&(t&&!h?(n=r.current).scrollTo({left:n.scrollWidth,behavior:"smooth"}):he(r.current)(e,-1))}),[t,e,h]),g=l((()=>{r.current&&(t&&!u?r.current.scrollTo({left:0,behavior:"smooth"}):he(r.current)(e,1))}),[e,t,u]);return[r,{scrollLeft:p,scrollRight:g,canScrollLeft:t||h,canScrollRight:t||u,visibleIndicesRange:[d,m],handleVisibleIndicesChange:c}]},pe=u((({className:e="",gap:t=14,padding:n=16,showDots:i=!0,children:r,onVisibleIndicesChange:l,listType:a="horizontal-list"})=>{const s=Array.isArray(r)?r.length:0,[o,c]=ue({itemCount:s,onVisibleIndicesChange:l}),[d]=c.visibleIndicesRange;return h("div",{className:g(e,"vertical-list"===a?"relative h-full":""),children:[m(ne,{containerRef:o,activeIndex:d,visibleItemCount:1,gap:t,padding:n,onVisibleIndicesChange:c.handleVisibleIndicesChange,listType:a,children:r}),i?m(se,{containerRef:o,activeIndex:d,dotCount:s,listType:a}):null]})}));const ge=e=>e?.includes("//"),be=e=>(e||"").replace(/\/?\?.*/,""),xe=e=>{if(!e||!ge(e))return;const t=e,n=t.indexOf("//"),i=t.indexOf("/",n+"//".length);return-1!==i?t.substring(0,i):t},fe=e=>{if(!e||!ge(e))return;return new URL(e).pathname},Ne=e=>e?.startsWith("#");var ye=Object.freeze({__proto__:null,isURL:ge,withoutQuery:be,getOrigin:xe,getPathname:fe,getHash:e=>{if(!e||!ge(e))return;const t=e.indexOf("#");return-1!==t?e.substring(t,e.length):void 0},isHash:Ne});const ve=(e,t)=>ve._impl(e,t);function we(){return we._impl()}function ke(){const e=we(),t=$.inst;return n=>{const i=((e,t)=>{if(!e)return e;const n=xe(t?.href);return n?e.replace(n,"")||"/":e})(n.href,e);return{...n,href:i,"aria-label":n.text,onClick:ve((r=>{n.onClick&&n.onClick(r),Ce(i,n.target)||(r?.preventDefault(),Ne(i)?t.goto(i):i&&e.push(i))}),n)}}}ve._impl=e=>e,ve.setup=e=>{ve._impl=e},we._impl=()=>({href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{}}),we.setup=e=>{we._impl=e};const Ce=(e,t)=>ge(e)||t&&"_self"!==t||e?.startsWith("/"),Se={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"",transparent:"","":""},Te="bg-main-divider text-main-disabled",$e={primary:Te,secondary:Te,white:Te,link:"",transparent:"","":""},_e="text-center font-sans select-none",Ie={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"",transparent:"","":""},Ae=u((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:r,version:l="primary"}=e;return h("div",{className:je(e),children:[i?m("div",{className:Ie[l],children:i}):null,Re(e)?h("div",{children:[n?m("div",{className:"text-xs-light text-left",children:n}):null,m("div",{className:"text-left "+(n?"text-s -mt-0.5":"text-l"),children:t})]}):null,r?m("div",{className:Ie[l],children:r}):null]})})),je=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const r="gap-2 "+(n?"py-2.5 px-7":"py-4 px-4");return["group/btn flex items-center justify-center",Re(e)?r:"h-12 w-12",i?"rounded-full":""].join(" ")},Re=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),Be=({className:e,rounded:t,version:n})=>["inline-block",_e,n?$e[n]:"",t?"rounded-full":"rounded-md",e].join(" "),De=({className:e,rounded:t,version:n})=>[_e,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border",n?Se[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Oe=u((({disabled:e,children:t,...n})=>{const i=ke()(n),r=t??m(Ae,{...i});return m(e?Le:Ve,{...i,children:r})})),Ve=u((({className:e="",href:t,rel:n,target:i,ariaLabel:r,version:l,rounded:a,onClick:s,children:o})=>m("a",{className:De({className:e,version:l,rounded:a}),href:t,rel:n,target:i,"aria-label":r,role:t?"link":"button",onClick:s,children:o}))),Le=u((({className:e,ariaLabel:t,version:n,rounded:i,children:r})=>m("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:Be({className:e,rounded:i,version:n}),children:r}))),Me=(e=!1)=>e?"text-white":"",Pe=(e=!1)=>"text-s mb-3.5 "+(e?"text-white":"text-secondary-text/80"),ze=u((({icon:e,image:t,title:n,subtitle:i,isFillGradient:r})=>h("div",{role:"columnheader",children:[e?m(Y,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",image:e,width:"63",height:"63"}):null,t?.src&&m("div",{className:"mb-3.5",children:m(Y,{image:t})}),n?m(j,{headingType:"h4",className:Me(r),title:n}):null,i?m("div",{className:Pe(r),children:i}):null]}))),Ee=u((({cell:e,rowHeader:t,isFillGradient:n=!1})=>m("div",{className:"box-border flex flex-col",role:"cell",children:m("div",{className:"h-full border-main-divider border border-t-0 border-x-0",children:e.map(Fe(n,t))})}))),Fe=(e,t)=>({label:n,description:i},r)=>h("div",{className:"flex justify-between text-s py-3.5",children:[m("div",{className:""+(e?"text-white/80":"text-secondary-text"),children:t}),h("div",{className:"basis-1/2",children:[n?m("div",{className:"text-right "+(e?"text-white":""),children:n}):null,i?m("div",{className:"text-right "+(e?"text-white/80":"text-secondary-text"),children:i}):null]})]},String(r)),He=u((({header:e,columnData:t,visibleRowLength:n=0,isFillGradient:i,showRow:r,onToggleColumn:l})=>{const a=t?.slice(0,r?t.length:n),s=i?"secondary":"primary";return h("div",{className:`border border-gray rounded-md p-4 mb-3.5 ${i?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""}`,role:"row",children:[m(ze,{...e,isFillGradient:i}),a?.length?a.map((({rowHeader:e,cell:t},n)=>m(Ee,{cell:t,rowHeader:e,isFillGradient:i},String(n)))):null,r&&e?.link?m(Oe,{href:e.link.href,target:e.link.target,version:s,className:"text-s font-medium mt-4 py-[11px]",children:e.link.text}):null,Ge({onToggleColumn:l,isFillGradient:i,showRow:r})]})})),Ge=({onToggleColumn:e,isFillGradient:t,showRow:n})=>m("div",{className:"mt-5",role:"cell",children:m("a",{role:"link",onClick:e,className:"text-s font-medium cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:n?"Скрыть":"Показать описание"})}),Je=u((e=>{const{className:t,title:n}=e;return h("section",{className:`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${t||""}`,children:[n?m(j,{headingType:"h3",className:"font-medium text-center m-0 mb-5",title:n}):null,m("div",{role:"table",children:m(We,{...e})})]})})),We=u((({columns:e=[],rowHeaders:t,isColoredFirstColumn:n,visibleRowLength:r,orientation:a,...s})=>{const[o,c]=i(new Array(e.length).fill(!r)),d=l((e=>{const t=(t,n)=>n===e?!t:t;c((e=>e.map(t)))}),[]),h=l((()=>c((e=>new Array(e.length).fill(!1)))),[]),u=e?.map((({data:e,header:i},l)=>{return m(He,{visibleRowLength:r,showRow:o[l],header:i,columnData:(a=e,a?.map(((e,n)=>({cell:e,rowHeader:t?.[n]?.title})))),isFillGradient:0===l&&n,onToggleColumn:()=>d(l),...s},String(l));var a}));return"horizontal"===a?m(pe,{onVisibleIndicesChange:h,children:u}):u})),Ue=new Map;function Ye(e,t,{fallback:n}={}){const l=a((()=>Xe(e)),[e]),[s,o]=i(),[c,d]=i(),m=e=>{o(e),d(void 0)},h=e=>{o(void 0),d(e)};r((()=>{if(!l.every((e=>null===e)))try{const e=t(...l);"then"in e?(e=>{e.then((e=>Ue.get(l)||e)).then(m).catch(h)})(e):m(e)}catch(e){h(e)}}),[t,...l]);const u=l[0],p=n&&"string"==typeof u&&n[u];return{data:s||c||!p?s:p,error:c,mutate:()=>Promise.resolve(void 0),isValidating:!1}}function Xe(e){return e?Array.isArray(e)?e:e instanceof Function?Xe(e()):[e]:[e]}async function Ke(e,t){const n=await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}});return await n.json()}function qe(e,t={}){const{data:n}=Ye(`/wcms-resources/${e}.json`,Ke,{fallback:t});return n||{}}const Qe=u((({className:e,isMobile:t=!1})=>{const{term:n,setTerm:r}=(()=>{const[e,t]=i("");return{term:e,setTerm:e=>t(e)}})(),l=t?"text-s":"text-l-light",a=t?" placeholder-transparent":"h-full",s=t?"some search":void 0;return h("form",{className:`font-sans relative ${e}`,children:[h("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[m("div",{className:t?"w-5 h-5":"w-6 h-6",children:m(Y,{image:{icon:"LoupeIcon"},width:"24",height:"24"})}),n?null:m("label",{htmlFor:"search-bar-input",className:`text-secondary-text ${l}`,children:"Поиск по сайту"})]}),m("input",{id:"search-bar-input",className:`h-12 pl-12 w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none pr-[6%] border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text ${a}`,value:n,onChange:e=>r(e.target.value),type:"text",name:"search-bar-input",placeholder:s}),t?m("button",{className:"visible peer-placeholder-shown:invisible absolute top-2 right-3 w-6 h-6 p-1 bg-transparent cursor-pointer border-none",onClick:e=>{e.preventDefault(),r("")},children:m(Y,{image:{icon:"CloseIcon"},width:"24",height:"24"})}):m(Oe,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-[3px] right-1",onClick:e=>{e?.preventDefault(),console.log("click")},children:m("div",{className:"text-s px-9 py-2.5",children:"Найти"})})]})})),Ze=u((e=>m(Qe,{...e,isMobile:!0}))),et=u((({className:e="",documents:t,...n})=>m(I,{className:`mt-2.5 ${e}`,...n,children:m("ul",{className:"flex flex-col text-s text-secondary-text p-0",children:t?.length?tt(t):null})}))),tt=e=>e.map(((e,t)=>{const{text:n,...i}=e;return m("li",{className:"mb-4 list-none",children:m("a",{className:"hover:text-primary-main",role:"link",...i,children:n||null})},`list_item_${String(t)}`)})),nt={"bg-white":"color",transparent:"white"},it={"bg-white":"text-primary-main",transparent:"text-white"},rt=(e,t,n)=>m(Y,t?.src?{image:t,className:it[e],width:n?.width,height:n?.height,pathPrefix:"/wcms-resources/",asSVG:!0}:{image:{icon:t?.icon||"LogoIcon",iconVersion:nt[e]},className:it[e],width:n?.width,height:n?.height,asSVG:!0}),lt={"bg-white":"text-primary-text",transparent:"text-white"},at=(e,t,n)=>m("span",{className:`${lt[t]} ml-2.5 font-medium ${n||""}`,children:e||"Россельхозбанк"}),st=u((({bgColor:e="bg-white",children:t,className:n="",href:i,logo:r,showTitle:l=!0,targetBlank:a})=>h("a",{className:`inline-flex items-center font-sans no-underline ${n}`,href:i||"https://rshb.ru/",target:a?"_blank":"_self","aria-label":r?.title||"Россельхозбанк",children:[rt(e,r?.image,{width:"34",height:"34"}),l?at(t||r?.title,e,"text-s"):null]}))),ot=u((({className:e="",title:t="Мобильное приложение",description:n,href:i="#"})=>m("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light font-sans ${e}`,children:i?h("div",{className:"flex",children:[m("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-12 h-12",children:m(st,{className:"w-8",bgColor:"transparent",showTitle:!0})}),h("a",{href:i,target:"_blank",className:"flex flex-col justify-center pl-3",children:[m("div",{className:"text-s font-medium mb-[3px]",children:t}),m("div",{className:"text-s text-secondary-text",children:n})]})]}):null}))),ct=u((({className:e="",items:t,hasButton:n})=>h("div",{className:e,children:[t?.length?t.map(dt):null,n?m(Oe,{version:"primary",className:"mb-6 w-full",href:"/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"}):null]}))),dt=(e,t)=>{const{type:n,text:i,description:r}=e;return h("div",{className:"mb-4",children:[m("div",{children:mt(n,i)}),m("div",{className:"mt-1 text-s-light text-secondary-text",children:r})]},String(t))},mt=(e,t="")=>{switch(e){case"tel":return m("a",{className:"text-h6 text-primary-text hover:text-primary-main no-underline",href:`tel:${ht(t)}`,children:t});case"email":return m("a",{className:"text-xl-light text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return m("span",{children:t})}},ht=e=>e.replaceAll(/\D/g,""),ut=u((({className:e="",index:t,text:n,...i})=>{const r=ke(),{href:l,target:a,onClick:s}=r(i);return m("a",{className:`text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:l,target:a,onClick:s,children:n||`Документ ${t}`})})),pt=u((({title:e,links:t,className:n=""})=>h("div",{className:n,children:[m("span",{className:"text-primary-text text-s font-medium",children:e}),t?.length?m("div",{className:"flex flex-col gap-2 pt-3",children:t.map(((e,t)=>m(ut,{index:t,className:"text-s",...e},String(t))))}):null]}))),gt=[{origins:["t.me","telegram.org"],icon:{icon:"TelegramIcon"},label:"Телеграм"},{origins:["vk.com"],icon:{icon:"VKIcon"},label:"ВКонтакте"},{origins:["ok.ru"],icon:{icon:"OkIcon"},label:"Одноклассники"},{origins:["apps.apple.com"],icon:{icon:"AppleIcon"},label:"App Store"},{origins:["play.google.com"],icon:{icon:"PlayMarketIcon"},label:"Google Play"},{origins:["youtube.com"],icon:{icon:"YoutubeIcon"},label:"Youtube"}],bt={default:"w-14 h-14",small:"w-12 h-12"},xt=u((({isRounded:e=!1,buttonSize:t="default",iconVersion:n="color",...i})=>{const r=ke(),{href:l,onClick:a}=r(i),{icon:s,label:o}=gt.find((({origins:e})=>e.some((e=>l?.includes(e)))))||{},c=s?{...K(s),iconVersion:n}:null;return s?m("a",{className:g("group/media flex items-center justify-center box-border",bt[t],e?"rounded-full":"rounded-md","border-solid border border-main-divider hover:border-transparent","hover:bg-primary-main hover:text-black","group-data-secondary:bg-white group-data-secondary:hover:bg-secondary-hover"),href:l,"aria-label":o,target:"_blank",rel:"noopener noreferrer",onClick:a,children:c?m(Y,{image:c,imageClassName:"group-hover/media:text-white",width:"24",height:"24",asSVG:!0}):null}):null})),ft=u((({className:e="",media:t})=>m("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e}`,children:t?.map(((e,t)=>m(xt,{...e},String(t))))}))),Nt=u((({className:e="",index:t,...n})=>{const i=ke(),{href:r,target:l,text:a,onClick:s}=i(n);return m("a",{className:`text-xs-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:r,target:l,onClick:s,children:a||`Документ ${t}`})})),yt=u((({className:e="",links:t})=>h("div",{className:e,children:[m("div",{className:"py-6",children:m("span",{className:"text-xs-light text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?m("div",{className:"flex flex-col justify-start items-start gap-2",children:t.map(((e,t)=>m(Nt,{index:t,...e},String(t))))}):null]}))),vt=u((({className:e="",...t})=>{const n=t.options?.page?.fallback,i=qe(o.SITEMAP||"sitemap",n),{documents:r,relatedEnterprises:l,contacts:a,socialMedia:s,horizontalNavigationTitle:c}=qe(o.FOOTER||"footer",n);return h("footer",{className:`font-sans px-4 py-[26px] bg-white ${e}`,children:[m(ct,{className:"overflow-hidden",items:a,hasButton:!0}),m(B,{children:i.topItems?.map(((e,t)=>m(Q,{label:e.text,children:m(et,{documents:e.items})},String(t))))}),m("div",{children:i?.dispositions?.map(wt)}),m(ot,{title:"Мобильное приложение",description:"Загрузить для IOS и Android",...t}),m(Ze,{className:"grow"}),m(ft,{className:"pb-4",media:s}),m(pt,{title:c,links:l}),m(yt,{links:r})]})})),wt=(e,t)=>{const{icon:n,href:i,text:r}=e;return h(Oe,{version:"link",href:i,className:"flex text-s mb-4 w-6",children:[n?m(Y,{className:"pr-1",image:K(n),width:"24",height:"24",asSVG:!0}):null,m("span",{className:"pl-2.5 font-medium text-primary-text",children:r})]},`footer-${t}`)},kt=u((({className:e="",title:t,description:n,cards:i=[],orientation:r="horizontal",...l})=>h(I,{className:`relative px-4 py-6 overflow-hidden ${e}`,...l,children:[h("div",{className:"flex flex-col items-center mb-5",children:[t?m(j,{headingType:"h3",className:"text-center "+(n?"mb-2":"mb-5"),title:t}):null,n?m("div",{className:"text-m max-w-[600px] text-center mb-5",children:n}):null]}),Ct(r,i)]})));function Ct(e,t){return"horizontal"===e?m(pe,{children:t?.map(St)}):m("div",{className:"grid gap-3.5",children:t?.map(St)})}function St(e,t){return h("div",{className:`w-full h-full flex flex-col justify-between shrink-0 box-border snap-start snap-always border-solid border rounded-md border-gray p-4\n ${_[e.version??"primary"]}`,children:[h("div",{children:[Tt(e.icon),e.title?m("h3",{className:"text-m-title-xs font-medium m-0",children:e.title}):null,e.description?$t(e):null,e.items?.length?It(e.items,e.isDotted,e.version):null]}),e?.button?.text?(n=e.button,m(Oe,{className:"mt-3",...n})):null]},t);var n}const Tt=e=>e?.src||e?.icon?m("div",{className:"flex justify-center",children:m(Y,{className:"mb-3.5",image:e})}):null;function $t(e){return m("div",{className:"text-secondary-text mt-1 text-s "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}const _t={primary:"bg-primary-text",secondary:"bg-white",gray:"bg-primary-text",transparent:"","":""};function It(e,t,n="primary"){return m("section",{className:"mt-3",children:e.map(((e,i)=>h("div",{children:[t?m("div",{className:`rounded-full inline-block mr-3 mt-2 w-2 h-2 min-w-2 min-h-2 ${_t[n]}`}):null,m("span",{className:"text-m font-medium",children:e.title}),m("span",{className:"text-s pl-2 "+("primary"===n?"text-secondary-text":""),children:e.text})]},String(i))))})}const At=(e,t,n=((e,t)=>t.startsWith(e)))=>n(be((e=>ge(e)||e?.startsWith("/")?e:`${o.BASE_PATH||""}${e}`)(e)),be(ge(e)?t.href:fe(t.href))),jt=e=>t=>At(t.href,e),Rt=e=>t=>t.items?.some(jt(e))||At(t.href,e)||((e,t)=>[xe(e),xe(t.href)].every(((e,t,n)=>Boolean(e)&&e===n[0])))(t.href,e)||Boolean(o.BASE_PATH?.startsWith(t.href||"/")),Bt=u((({className:e="",active:t,dataItemName:n,children:i,...r})=>{const l=ke(),{href:a,target:s,text:o,onClick:c}=l(r);return h("a",{className:`relative inline-block bg-transparent text-center no-underline ${e}`,href:a,target:s,"data-item-name":n,onClick:c,children:[m("span",{className:Dt(t),children:o||i}),t?m("div",{className:Ot(t)}):null]})})),Dt=(e=!1)=>g("font-sans text-s",e?"text-primary-main":"text-secondary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Ot=(e=!1)=>g("absolute left-0 -bottom-3 w-full h-0.5",e?"bg-primary-main group-data-transparent:bg-transparent":""),Vt=864e5;function Lt(e,t,n=globalThis?.localStorage){const i=l((async(...i)=>{const r=`async:${e}`,l=function(e){const{data:t=null,timestamp:n=null}=e?JSON.parse(e):{};return t&&Date.now()-n<Vt?t:void 0}(n.getItem(r));if(l)return l;const a=await t(...i);return n.setItem(r,JSON.stringify({data:a,timestamp:Date.now()})),a}),[e,t]);return Ye(e,i)}const Mt=()=>{const e=globalThis.localStorage?.getItem("location");try{return e?JSON.parse(e):null}catch(e){return null}},Pt=u((({burgerSubMenu:e,onClick:t,defaultLocation:n="",children:a})=>{const[s]=function(e){const t=Mt(),[n,a]=i(t?.region??{name:e}),{data:s}=Lt("/api/v1/region",Ke);return r((()=>{a(t?.region&&t?.manual?t.region:s||{name:e})}),[s]),[n,l((e=>{globalThis.localStorage?.setItem("location",JSON.stringify({manual:!0,region:e})),a(e)}),[a])]}(n);return h("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[m("button",{className:"absolute top-4 right-4 border-none bg-transparent cursor-pointer",onClick:t,children:m(Y,{image:{icon:"CloseIcon"},width:"24",height:"24",asSVG:!0})}),h("button",{className:"flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer",children:[m(Y,{image:{icon:"GeolocationIcon"},width:"20",height:"20",className:"text-primary-main box-border mr-2",asSVG:!0}),m(X,{color:"text-secondary-text",children:s.name})]}),a,m("div",{className:"mb-7",children:e?.map(zt)}),m(Ze,{className:"grow"})]})})),zt=(e,t)=>{const{icon:n,href:i,text:r}=e;return h("a",{href:i,className:"flex text-s mb-4 hover:text-primary-main",children:[n?m(Y,{className:"text-primary-main pr-1",image:n,width:"24",height:"24",asSVG:!0}):null,m("span",{className:"font-medium pl-0.5",children:r})]},`headerSubMenu-${t}`)},Et=u((({onClick:e,bgColor:t,logo:n})=>h("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-12",children:[h("div",{className:"flex items-center",children:[m("button",{className:"pl-0 pr-4 border-0 bg-transparent cursor-pointer",onClick:e,"aria-label":"Открыть меню",children:m(Y,{image:{icon:"BurgerIcon",iconVersion:"bg-white"===t?"black":"white"},className:"text-primary-text w-6 h-6",width:"24",height:"24",asSVG:!0})}),m(st,{className:"mr-8",bgColor:t,logo:n})]}),m("button",{className:"text-primary-main group-data-transparent:text-white group-data-transparent:hover:text-primary-hover text-s border-0 bg-transparent",children:"Войти"})]}))),Ft={"bg-white":"primary",transparent:"transparent"},Ht=u((({bgColor:e="bg-white",version:t=Ft[e],...n})=>{const r=we(),a=n.options?.page?.fallback,{topItems:s,dispositions:c,defaultLocation:d,logo:u}=qe(o.SITEMAP||"sitemap",a),p=s?.find(Rt(r)),g=p?.items,b=(e=>(t=[])=>{const n=t?.filter(jt(e));return n?.length?ce((e=>e.href?.length||0))(n):void 0})(r)(g),[x,f]=i(!1),N=l((()=>f((e=>!e))),[]);return h(I,{tag:"header",version:t,...n,children:[h("div",{className:"container px-4 py-0 box-border",children:[m(Et,{onClick:N,bgColor:e,logo:u}),m("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-12",children:m("div",{className:"flex no-scrollbar horizontal-list h-full items-center",children:g?.map(((e,t)=>m(Bt,{className:"mr-8 whitespace-nowrap text-s",active:e===b,...e},String(t))))})})]}),x?m(Pt,{onClick:N,burgerSubMenu:c,defaultLocation:d,children:m(B,{children:s?.map(((e,t)=>m(Q,{label:e.text,children:m(et,{documents:e.items})},String(t))))})}):null]})})),Gt={XXL:{wrapper:"gap-[18px]",title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5"},XL:{wrapper:"gap-4",title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl-light"},L:{wrapper:"gap-4",title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl-light"},M:{wrapper:"gap-3",title:{headingType:"h3",as:"h3"},descriptionSize:"text-xl-light"},S:{wrapper:"gap-2",title:{headingType:"h4",as:"h4"},descriptionSize:"text-xl-light"},XS:{wrapper:"gap-2",title:{headingType:"h5",as:"h5"},descriptionSize:"text-l-light"}},Jt=u((({className:e,title:t,description:n,headlineVersion:i="XL",align:r="text-center",as:l,version:a="",...s})=>{const o=Gt[i];return h(I,{className:g("flex flex-col p-12",o.wrapper,e),version:a,...s,children:[t?m(j,{className:g("whitespace-pre-wrap",r),...o?.title,as:l||o?.title.as,title:t}):null,n?m(R,{color:"group-data-secondary:text-white/80",size:o.descriptionSize,align:r,children:n}):null]})})),Wt=u((({className:e,iconClassName:t,textClassName:n,suffixClassName:i,doc:r,icon:l})=>{const{text:a,fileSize:s,...o}=r;return h("a",{className:e,role:"link",...o,children:[l?m(Y,{className:t,image:K(l),width:"24px",height:"24px",asSVG:!0}):null,a?h("span",{className:n,children:[a,m("span",{className:i,children:o?.href&&Ut(Yt(o.href),s)})]}):null]})})),Ut=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),Yt=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Xt=u((({className:e="",doc:t,icon:n})=>m(Wt,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:n}))),Kt=u((({hasBorder:e=!0,documents:t,icon:n})=>m(pe,{className:"text-s text-primary-main mt-5",children:t?.length?t.map(((t,i)=>m(Xt,{className:e?"rounded-md border-gray border border-solid p-4":"",doc:t,icon:n},String(i)))):null}))),qt=u((({hasBorder:e=!0,documents:t,icon:n})=>m("div",{className:"text-s text-primary-main flex flex-col mt-5 "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,i)=>m("div",{role:"listitem",children:m(Xt,{className:e?"rounded-md border-gray border border-solid p-4":"",doc:t,icon:n})},String(i)))):null}))),Qt=u((({className:e="",title:t,description:n,icon:i={icon:"DocIconMonoColor"},documents:r,orientation:l="vertical",hasBorder:a=!0,align:s,...o})=>h(I,{className:g("py-6 px-4 overflow-x-hidden",e),...o,children:[m(Jt,{className:"!p-0 "+(n?"gap-2":"gap-5"),title:t,description:n,align:s,headlineVersion:"M",as:"h2"}),m("vertical"===l?qt:Kt,{hasBorder:a,documents:r,icon:i})]}))),Zt=e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function en(e=""){const t=Zt(e);return t<=4?"S":t<=8?"M":"L"}function tn(e=""){const t=Zt(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function nn(e=""){const t=Zt(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const rn=u((({className:e,title:t,description:n="Блок в разработке...",...i})=>h(I,{className:g("p-9 box-border",e,nn(e),tn(e)),...i,children:[m(Jt,{className:"!p-0 max-w-[600px]",title:t,description:n,headlineVersion:en(e)}),m("figure",{className:"m-0 min-w-[80%]",children:ln()})]}))),ln=(e=3)=>sn(100,e).map((e=>Math.floor(e))).map(an),an=(e,t)=>m("div",{style:{width:`${e||100}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),sn=(e,t)=>[e].concat(t>0?sn(e/1.618,t-1):[]),on=(e,{className:t="",buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text))?m("div",{className:g("flex",i?"flex-col gap-2":"gap-4",t),children:e.map(cn(n))}):null,cn=(e="")=>(t,n)=>{const{text:i,icon:r,iconRight:l,version:a,...s}=t||{},o="secondary"===a?"color":"white";return i?m(Oe,{className:e,appendLeft:dn({...r,iconVersion:o}),appendRight:dn({...l,iconVersion:o}),version:a,text:i,...s},n?String(n):""):null},dn=e=>e?.icon||e?.src?m(Y,{image:e,width:String(e?.size?.width||24),height:String(24),asSVG:!0}):null,mn={L:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4",M:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3",S:"w-1 h-1 min-w-1 min-h-1 mr-2"},hn=u((({className:e="",isDotted:t=!0,children:n,size:i="M"})=>h("div",{className:`font-sans flex items-baseline ${e}`,role:"listitem",children:[t?m("div",{children:m("div",{className:`rounded-full align-middle inline-block bg-primary-text group-data-secondary:bg-white ${mn[i]}`})}):null,m("span",{children:n})]}))),un={S:"text-l-light",M:"text-h6",L:"text-h5"},pn={S:"ml-2",M:"ml-3",L:"ml-4"},gn=u((({className:e="",hasIndent:t,isDotted:n,itemClassName:i="",items:r,listItemSize:l="M"})=>r?.length?m("section",{className:`text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text ${un[l]} ${t?pn[l]:""} ${e}`,role:"list",children:r.map(((e,t)=>m(hn,{className:`${i} mb-1.5`,isDotted:n,size:l,children:e},String(t))))}):null)),bn=u((({className:e="",title:t="",buttons:n,image:i,children:r})=>h("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,h("div",{className:"flex grow w-full justify-between",children:[h("div",{className:"flex flex-col justify-between w-full",children:[m("div",{className:"h-full",children:r}),n?m("div",{className:"mt-auto pt-8",children:n}):null]}),i]})]}))),xn=u((e=>{const{className:t="",icon:n,label:i,description:r,version:l="primary",benefitsVersion:a="normal"}=e,s="white"===a?"secondary":"primary";return h("div",{className:`flex gap-5 ${r?"items-start":"items-center"} ${t}`,children:[n?m("div",{className:fn(l,a),children:m(Y,{className:"w-6 h-6",image:K(n,s),asSVG:!0})}):null,h("div",{className:"gap-0.5",children:[i?m("div",{className:"text-h6 text-primary-text group-data-secondary:text-white",children:i}):null,r?m("div",{className:"text-m-light text-secondary-text group-data-secondary:text-white",children:r}):null]})]})}));function fn(e,t){let n="bg-primary-main text-black";return"secondary"===e?n="bg-white/30 text-black":"normal"===t&&(n="bg-secondary-light text-primary-main"),`w-12 h-12 min-w-12 rounded-full p-2.5 box-border flex items-center justify-center ${n}`}const Nn=(e="primary",t="normal")=>({icon:n,label:i,description:r},l)=>m(xn,{icon:n,label:i,description:r,version:e,benefitsVersion:t},String(l)),yn=u((({className:e="",headlineVersion:t="L",benefits:n,benefitsVersion:i="normal",buttons:r,image:l,items:a,version:s="primary",isDotted:o=!0,label:c,title:d,description:u,...p})=>h(I,{className:`w-full ${e}`,version:s,...p,children:[h("div",{children:[c?wn(c):null,m(Jt,{className:"!p-0 max-w-[600px]",title:d,description:u,headlineVersion:t,align:"text-left"}),h(bn,{buttons:on(r,{className:"mt-5",isVertical:!0}),children:[n?.filter((e=>e.label))?.length?m("div",{className:"mt-3",children:n.map(Nn(s,i))}):null,a?.length?m(gn,{className:"mt-3 text-m",items:a,isDotted:o}):null]})]}),vn(l)]})));function vn(e){return e?.src?m(Y,{imageClassName:"mt-5 mx-auto block",image:{className:"block",...e}}):null}const wn=e=>m("div",{className:"w-fit px-2.5 py-1.5 mb-5 rounded-md border-2 border-solid border-secondary-hover",children:m(X,{color:"text-primary-main group-data-secondary:text-white/80",children:e})}),kn=u((e=>{const{className:t="",...n}=e;return m(I,{className:`px-4 py-6 ${t}`,...n,children:m(yn,{...e})})})),Cn={primary:{description:"!text-secondary-text text-l-light",iconText:"text-secondary-text",iconBackground:"bg-main-divider",iconConnector:"bg-secondary-light",dot:"bg-secondary-text"},secondary:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},gray:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},transparent:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},"":{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"}},Sn={normal:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",small:"h-12 w-12 min-w-12 min-h-12"},Tn={normal:"min-h-[70px]",small:"min-h-12"},$n=u((({className:e="",title:t,description:n,showLines:i=!0,steps:r,size:l="normal",version:a="primary",...s})=>{const o=Cn[a];return h(I,{className:`box-border px-4 py-6 flex flex-col ${e}`,version:a,...s,children:[t?m(j,{headingType:"h3",className:"text-center",title:t}):null,n?m("p",{className:`text-m-light text-center ${o.description} ${t?"mt-2":""}`,children:n}):null,r?.length?m("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:m("div",{className:"flex flex-col justify-between gap-x-[101px]",children:r.map(_n(l,a,i))})}):null]})})),_n=(e,t,n)=>(i,r,l)=>{const a=l.length-1===r,s="normal"===e?"ml-[34px]":"ml-6",o=Cn[t];return m("div",{children:h("div",{className:"flex flex-row text-center relative",children:[h("div",{className:"overflow-hidden flex-shrink-0",children:[In(e,t)(i,r),a?null:m("div",{className:`min-h-8 h-full w-0.5 ${n?o.iconConnector:""} ${s}`})]}),h("div",{className:`flex flex-col justify-center h-fit ${Tn[e]}`,children:[i.label?m("div",{className:"text-m-title-xs font-medium m-0 text-left mb-1",children:i.label}):null,i.description?m("div",{className:`text-s ${o.description} text-left`,children:i.description}):null]})]})},String(r))},In=(e,t)=>(n,i)=>{const r="normal"===e?"38":"27",l="normal"===e?"text-m-title":"text-m-title-xs";return m("div",{className:`${Sn[e]} ${Cn[t].iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`,children:m("span",{className:`font-medium flex self-center ${l}`,children:(a=n?.icon,Boolean(a?.icon||a?.src)?m(Y,{image:K({...n.icon},t),width:r,height:r,asSVG:!0}):m("span",{children:i+1}))})});var a},An={Buttons:({buttons:e})=>on(e,{className:"mt-3",buttonClassName:"w-12 h-12"}),Img:({image:e})=>e?.src?m(Y,{image:{...e,className:"m-0"}}):null,List:({isDotted:e,...t})=>m(gn,{className:"flex flex-col justify-between items-start text-m",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>h("div",{children:[e?m("div",{className:"text-xl font-medium m-0 "+(t?"mb-1":""),children:e}):null,t?m("div",{className:"text-s text-secondary-text",children:t}):null]})},jn=u((({title:e,icon:t})=>h("div",{className:"flex gap-2.5 mb-2",children:[e?m(j,{headingType:"h3",className:"font-medium",title:e}):null,t?m(Y,{className:"ml-auto max-w-6 max-h-6",image:t,width:"24px",height:"24px"}):null]}))),Rn=u((({tile:e,...t})=>h("div",{className:"rounded-md border-gray h-full box-border border p-4",children:[m(jn,{...e?.header}),e?.data?.length?e.data.map(((e,n)=>h("div",{children:[n>0?m("div",{className:"h-5"}):null,Bn(e,t)]},String(n)))):null]})));function Bn(e,t){if(!e||!e.tableCellType||!(e.tableCellType in An))return null;const n=An[e.tableCellType];return m(n,{displayTable:()=>null,isVisible:!0,...e,...t})}const Dn=u((({tiles:e,...t})=>e?.length?m(pe,{...t,children:e.map(((e,n)=>m(Rn,{tile:e,...t},String(n))))}):null)),On=u((({tiles:e,...t})=>e?.length?m("div",{className:"flex flex-col gap-3.5",children:e.map(((e,n)=>m(Rn,{tile:e,...t},String(n))))}):null)),Vn=u((({className:e,title:t,description:n,tariffsColumns:i,rowHeaders:r,orientation:l="vertical",...a})=>{const s=Ln(i),o=Mn(r,s);return h("section",{className:`px-4 py-6 bg-white font-sans text-primary-text overflow-x-hidden ${e}`,children:[t?m(j,{headingType:"h2",className:`text-center ${n?"mb-2":"mb-5"}`,title:t}):null,n?m("div",{className:"mb-5 text-center text-m",children:n}):null,m("vertical"===l?On:Dn,{tiles:o,...a})]})})),Ln=e=>e?.[0]?.data?e[0].data:[],Mn=(e,t)=>e?.map(((e,n)=>({header:e,data:t?.[n]||[{}]}))),Pn={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"}},zn=u((({title:e,description:t,blockVersion:n="primary",iconVersion:i,image:r,className:l="",items:a,isDotted:s=!0})=>{const o=Pn[n];return h("section",{className:`font-sans px-4 py-[18px] flex flex-col ${o.background} ${l}`,children:["small"===i?En(o.icon):null,"big"===i?Fn(r):null,h("div",{className:"py-0.5",children:[e?m("div",{className:`text-l font-medium mb-1 ${o.title}`,children:e}):null,t?m("div",{className:`text-s ${o.description}`,children:t}):null,a?.length?m(gn,{className:"mt-1 text-m",items:a,isDotted:s}):null]})]})}));function En(e){return m("div",{className:"mb-3",children:m("div",{className:`rounded-full h-4 w-4 text-center text-xs-light ${e}`,children:"i"})})}function Fn(e){return e?.src?m(Y,{className:"pb-3 mr-auto",image:e}):null}const Hn={Accordion:D,AccordionItem:Q,ComparisonTable:Je,Footer:vt,Gallery:kt,Header:Ht,Headline:Jt,LinkDocs:Qt,LinkList:et,MobileAppTile:ot,ProductBlock:kn,StepsBlock:$n,TariffsTable:Vn,TextBlock:zn,Placeholder:rn},Gn=["Header","Footer"],Jn=([,{target:e}])=>Math.abs(e.getBoundingClientRect().top);function Wn(e=$.inst,t=globalThis){const n=s(new Map);r((()=>e.eventBus.subscribe("intersection",(({block:e,intersection:t})=>{n.current&&n.current.set(e,t)}))),[e]),r((()=>{const i=((e,t=600)=>{let n;const i=(...r)=>{i.dispose(),n=setTimeout((()=>{e(...r)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})((()=>{if(!(globalThis.scrollY>3*globalThis.innerHeight/4))return void e.reset();const t=function(e){const t=e.filter((([e])=>!Gn.includes(e.type||""))).filter((([,{intersectionRatio:e}])=>e>.01)),[n]=t.length>0?de(Jn)(t):[];return n}([...n.current||[]]);t?.anchor?e.replace(t.anchor):t||e.reset()}),100);return t.addEventListener("scroll",i),()=>{i.dispose(),t.removeEventListener("scroll",i)}}),[e,t])}const Un=d();const Yn=u((({className:e,onClick:t,ariaLabel:n})=>m("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:Xn()}))),Xn=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[m("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"}),m("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"})]})},Kn=u((({className:e=""})=>{const t=function(e){const[t,n]=i(0);return r((()=>{(async()=>{const[t]=await Un.getLikeCount(e);n(t?.value||0)})()}),[e]),{likeCount:t,like:l((async()=>{n(await Un.like(e))}),[e]),dislike:l((async()=>{n(await Un.dislike(e))}),[e])}}(we().pathname);return h("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:[m(Yn,{onClick:ve(t.like),ariaLabel:"Поставить отметку «лайк»"}),m(Yn,{onClick:ve(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),m("span",{className:"select-none",children:t.likeCount})]})})),qn=u((e=>{const{className:t="",blocksRegistry:n,blockDecorator:i,data:r={}}=e,{style:l,blocks:a,slots:s,likeControl:o,colorPalette:c="pc"}=r,d={key:"",page:r,blocksRegistry:n,blockDecorator:i,parent:r};return Wn(),h("section",{className:g("relative",l,t),"data-theme":c,children:[s?.header?m("div",{className:"mb-5 shadow-[0_8px_32px_0px_#00000014]",children:y(s?.header,{...d,slotName:"header"})}):null,h("div",{className:"container grid grid-cols-12 gap-1",children:[y(a,d),s?.footer?y(s?.footer,{...d,slotName:"footer"}):null]}),o?m("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:m(Kn,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto"})}):null]})}));qn.childrenTypes=[],qn.slots=()=>["header","footer"];e.Blocks=Hn,e.ContentPage=qn,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=d,e.handlerDecorator=ve,e.joinList=function(e){return t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:i},n):[n]),[])},e.packageVersion="0.7.2",e.projectSettings=o,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=ye,e.useRouter=we,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";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),r=n("useEffect"),l=n("useCallback"),a=n("useMemo"),s=n("useRef");const o=new class{_={PROD_BRANCH:"master",FORCED_DRAFT_FLOW:!1};setup(e){this._=e}get TEST_BRANCH(){return this._.TEST_BRANCH}get RC_BRANCH(){return this._.RC_BRANCH}get PROD_BRANCH(){return this._.PROD_BRANCH}get FORCED_DRAFT_FLOW(){return this._.FORCED_DRAFT_FLOW}get ASSIST_PROJECT_ID(){return this._.ASSIST_PROJECT_ID}get SITEMAP(){return this._.SITEMAP}get FOOTER(){return this._.FOOTER}get CDN(){return this._.CDN}get BASE_PATH(){return this._.BASE_PATH&&!this._.BASE_PATH.endsWith("/")?`${this._.BASE_PATH}/`:this._.BASE_PATH}get YANDEX_MAP_API_KEY(){return this._.YANDEX_MAP_API_KEY}get YANDEX_METRIKA_ID(){return this._.YANDEX_METRIKA_ID}},c="likesToken";function d(){async function e(){try{const e=JSON.parse(globalThis.localStorage?.getItem(c)||"");if(e?.token)return e}catch(e){}try{const e=await fetch("/assist/v1/public/auth",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({prefix:"guest"})}),{token:t,name:n}=await e.json();return globalThis.localStorage?.setItem(c,JSON.stringify({token:t,name:n})),{token:t,name:n}}catch(e){return console.error(e),{}}}return{getLikeCount:async function(...t){if(!t.length)return[];const{token:n}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/likes`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify({node_ids:t})}),{likes:i}=await e.json();return i||[]}catch(e){return console.error(e),[]}},like:async function(t){if(!t)return 0;const{token:n,name:i}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/like`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:i},body:JSON.stringify({node_id:t,user_name:i})}),{likes:r}=await e.json();return r||0}catch(e){return console.error(e),0}},dislike:async function(t){if(!t)return 0;const{token:n,name:i}=await e();try{const e=await fetch(`/assist/v1/public/projects/${o.ASSIST_PROJECT_ID}/nodes/unlike`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json",Authorization:n,UserID:i},body:JSON.stringify({node_id:t,user_name:i})}),{likes:r}=await e.json();return r||0}catch(e){return console.error(e),0}}}}const m=(...e)=>globalThis._uni._jsx(...e),h=(...e)=>globalThis._uni._jsxs(...e),u=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:p(e)),t._tmpl},p=e=>{function t(t,n){const{children:i,...r}=t||{},l=n?.slots?.default,a=i||l&&l();return e(Object.assign(r,a&&{children:a}),n)}return t.inheritAttrs=!1,t},g=(...e)=>e.flatMap((e=>e)).filter(Boolean).join(" "),b=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),x=[];function f(e,t){const{key:n,blockDecorator:i=b,blocksRegistry:r={},ancestors:l=x,className:a=""}=t,{type:s}=e;s&&s in r||console.warn(`No block with "${s}" is registered`);const o=s&&r[s];return i({blockClassName:g("scroll-mt-12",a,e.style||"col-span-12"),block:e,ancestors:l,render:({block:i,blockClassName:r})=>{const{content:l}=i;return o?m(o,{className:r,block:e,options:t,...l},n):null}},n)}const N=[],y=(e,{key:t,ancestors:n=N,slotName:i=null,renderChild:r=f,...l})=>(e||[]).map(((e,a)=>r(e,{...l,key:`${t||e.type}-${a}`,ancestors:l.parent?[...n||N,[l.parent,i]]:n})));function v({children:e,block:t,options:n,renderChild:i}){return e||(t&&n?y(t.blocks,{...n,parent:t,renderChild:i}):null)}class w{static inst=new w;subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}}function k(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=a((()=>({threshold:C(t),root:n?.current})),[t,n?.current]);return r((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}function C(e=0){const t=Math.round(10*e);return new Array(t).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const S=e=>e?.replace("#",""),T=e=>`${globalThis.location?.pathname}#${S(e)}`;class ${static inst=new $;eventBus=new w;constructor(){const e=S(globalThis.location?.hash);e&&this.eventBus.subject("goto",{anchor:e})}goto(e){const t=S(e);t&&(this.push(t),this.eventBus.fire("goto",{anchor:t}))}push(e){globalThis.history?.pushState(null,"",T(e))}replace(e){globalThis.history?.replaceState(null,"",T(e))}reset(){globalThis.history?.replaceState(null,"",T())}}const _={primary:"bg-white text-primary-text",secondary:"bg-primary-main text-white",gray:"bg-main-divider text-primary-text",transparent:"bg-transparent text-primary-text","":""},I=u((({className:e="",version:t="primary",block:n,tag:a="section",role:s,children:o})=>{const c=a,d=function(e,t=$.inst){const n=k(l((n=>{if(!e||!n?.length)return;const i=n[n.length-1];t.eventBus.fire("intersection",{block:e,intersection:i})}),[e,t]),{sensitivity:1});return r((()=>{if(n.current)return t.eventBus.subscribe("goto",(({anchor:t})=>{n.current&&e?.anchor===t&&n.current.scrollIntoView({behavior:"smooth",block:"start"})}))}),[e,t]),n}(n),[h,u]=i(!0);return r((()=>w.inst.subscribe("tab",(e=>{if("group"===e.type){const t=n?.labels?.length||n?.anchor;u(!e.label||(!t||Boolean(n?.labels?.includes(e.label))))}else u(!0)}))),[n]),h?m(c,{className:g("group",_[t],e),...t?{"data-ver":t}:{},...n?.anchor?{id:n.anchor,ref:d}:{},role:s,children:o}):null})),A={h0:"text-m-title",h1:"text-m-title",h2:"text-m-title",h3:"text-h6",h4:"text-m-title-xs",h5:"text-m-title-xs",h6:"text-m-title-xs"},j=u((e=>{const{className:t,headingType:n="h3",title:i,as:r="h3"}=e;return m(r,{className:`font-sans font-medium m-0 ${A[n]} ${t||""}`,children:i})})),R=u((({children:e,...t})=>m("p",{className:["font-sans",...Object.values(t)].join(" "),children:e}))),B=u((({children:e})=>m("ul",{className:"list-none m-0 p-0",children:e}))),D=u((({title:e,description:t,className:n="",...i})=>h(I,{className:`py-6 px-4 ${n}`,...i,children:[e?m(j,{headingType:"h3",className:"mb-2 text-center",title:e}):null,t?m("div",{className:"mb-5",children:m(R,{size:"text-m",font:"font-light",align:"text-center",children:t})}):null,m(B,{children:v(i)})]})));D.childrenTypes=["AccordionItem"];const O=u((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:r,renderFoldButton:a})=>{const[s,o]=i(n),c=l((()=>{o((e=>!e))}),[]),d=r({isUnfolded:s,onToggle:c}),m=a?a({isUnfolded:s,onToggle:c}):null;return h("div",t?{className:e,children:[m,d]}:{className:e,children:[d,m]})})),V=u((({className:e="",isUnfolded:t,children:n})=>{const i=s(null);return r((()=>{i.current&&(i.current.style.maxHeight=t?`${i.current.scrollHeight}px`:"")}),[t,n?.length]),m("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} ${e}`,children:n})})),L={normal:"",color:"text-primary-main",black:"text-black",white:"text-black"},M=u((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:r=i,iconVersion:l="color",asSVG:a,...s})=>{const c=`${o.CDN||""}icons/${n}.svg`;return a&&"normal"!==l?m(z,{className:e,children:h("svg",{className:g(P(s.width),L[l],"white"===l?"invert":"",t),...s,"aria-hidden":"true",children:[r?m("title",{children:r}):null,i?m("desc",{children:i}):null,m("use",{href:`${c}#icon`,xlinkHref:`${c}#icon`})]})}):m("img",{className:e,src:c,alt:i,title:r,...s,"aria-hidden":"true"})})),P=e=>e?"":"w-full h-full",z=u((({className:e,children:t})=>e?m("div",{className:e,children:t}):t)),E=(e,t)=>e.media&&t.media?e.media-t.media:0,F=u((({className:e="",image:t,imageClassName:n="",isMobile:i=!1,pathPrefix:r})=>{if(!t||!t?.sources&&!t?.src)return null;return h("picture",{className:`${i?"flex":"flex-none"} ${e}`,children:[t?.sources?.length?t.sources.sort(E).map((({src:e,format:n,media:i},l)=>m("source",{srcSet:J(e,r),type:W(n),media:i?`(max-width: ${i}px)`:"",...t.size},`${l}_${e}`))):null,H({...t,src:G(t.src,r)},n,i)]})})),H=(e,t="",n=!1)=>{const i={width:e.size?.width?`${e.size?.width}px`:"100%",height:e.size?.height?`${e.size?.height}px`:"100%"},r=e.title||"",l=e.alt||e.title,a=n?"m-auto":"m-0";return m("img",{src:e.src,className:`${a} ${t}`,alt:l,title:r,style:i,...e.size})},G=(e,t)=>!e||e?.startsWith("data:image")?e:`${((e="")=>e&&!e.endsWith("/")?`${e}/`:e)(t)}${e}`,J=(e,t)=>e?.split(",").map((e=>G(e.trim(),t))).join(", ");function W(e){return e?`image/${String(e)}`:void 0}const U=u((({className:e="",image:t,imageClassName:n="",isMobile:i,pathPrefix:r,...l})=>t?.src||t?.icon?t.icon?m(M,{className:e,imageClassName:n,iconVersion:t?.iconVersion||"normal",name:t.icon,...l}):m(F,{className:e,imageClassName:n,image:t,isMobile:i,pathPrefix:r}):null)),Y=u((e=>m(U,{...e,isMobile:!0}))),X=u((({children:e,...t})=>m("span",{className:["font-sans",...Object.values(t)].join(" "),children:e}))),K=(e,t="primary")=>({...e,iconVersion:e?.iconVersion??("secondary"===t?"white":"color")}),q=["PlusIcon","MinusIcon"],Q=u((({className:e="",label:t="",labelIcon:n,isExpanded:i,...r})=>{const{bordered:l}=function(e,t){const{content:n}=function(e){return e?.parent||{}}(e);return n||t}(r.options,{});return m("li",{className:`${l?"border p-4 rounded mb-4":"border-0 border-b last:border-b-0"} border-solid border-main-divider ${e}`,children:m(O,{isFoldButtonOnTop:!0,unfoldedByDefault:i,renderFoldableSection:({isUnfolded:e})=>m(V,{className:"flex flex-wrap group-last:last:pb-0 gap-5 [&>*]:p-0",isUnfolded:e,children:v(r)}),renderFoldButton:({isUnfolded:e,onToggle:i})=>m(Z,{className:l?"":"py-3.5 px-0",label:t,icon:q[Number(e)],primaryIcon:n,onClick:i})})})}));Q.childrenTypes=[];const Z=u((({className:e,icon:t,label:n,primaryIcon:i,onClick:r})=>h("button",{className:`border-none bg-transparent flex justify-between text-left w-full font-sans text-primary-text group cursor-pointer ${e}`,onClick:r,children:[h("div",{className:"flex group-hover:text-primary-main",children:[i?m(Y,{image:K(i),className:"mr-3 flex-shrink-0",width:"24",height:"24",asSVG:!0}):null,m(X,{size:"text-m-title-xs",font:"font-medium",children:n})]}),m(Y,{className:"flex-shrink-0",image:K({icon:t}),width:"24",height:"24",asSVG:!0})]}))),ee=u((({className:e="",style:t,idx:n,activeIndex:i,observerOptions:r,children:a,onIntersection:s})=>{const o=k(l((e=>{e.length&&s&&s(n||0,e[e.length-1])}),[s,n]),r);return m("div",{className:`inline-block snap-always box-border ${e}`,style:t,role:"listitem","aria-current":Boolean(n===i),ref:o,children:a})})),te=["min-w-[100%]","min-w-[50%]","min-w-[33.33%]","min-w-[25%]"],ne=u((({className:e="",containerRef:t,activeIndex:n,visibleItemCount:i=0,gap:r=0,padding:a=0,listType:o="horizontal-list",snapAlign:c="snap-center",children:d,onVisibleItemsChange:h,onVisibleIndicesChange:u})=>{const p={sensitivity:1,rootRef:t},b=s([]),x=l(((e,t)=>{const n=[...b.current||[]];n[e]=t,b.current=n,h&&h(n),u&&u(re(n))}),[h,u]),f=i>0?r*Number(i)-1:0,N="vertical-list"===o,y="horizontal-list"===o,v={...y?ie(a,f):{},...N?le(t):{},gap:`${r}px`};return m("div",{className:g("box-border overflow-auto no-scrollbar",o,e),style:v,role:"list",ref:t,children:(w=(e,t)=>m(ee,{className:g(c,i?te[i-1]:""),style:y?ie(a/4):{},activeIndex:n,idx:t,observerOptions:p,onIntersection:x,children:e},String(t)),e=>null==e?e:Array.isArray(e)?e.map(w):w(e,0))(d)});var w})),ie=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),re=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),le=e=>({height:e?.current?.firstElementChild?.clientHeight||0}),ae={"horizontal-list":"mx-auto mt-5 w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},se={"horizontal-list":"w-6","vertical-list":"h-6"},oe=u((({containerRef:e,activeIndex:t,dotCount:n=0,listType:i="horizontal-list"})=>n?m("div",{className:`flex gap-2 ${ae[i]}`,children:new Array(n).fill(null).map(((n,r)=>m("div",{className:`cursor-pointer bg-primary-main rounded-full transition-width duration-300 ${r===t?se[i]:"w-2 h-2 opacity-30"}`,role:"button","aria-hidden":!0,onClick:()=>(n=>{n!==t&&e?.current&&e.current.children[n]?.scrollIntoView({behavior:"smooth",block:"nearest"})})(r)},String(r))))}):null)),ce=e=>e,de=(e=ce)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),me=(e=ce)=>de((t=>-e(t))),he=e=>t=>e.scrollWidth/t,ue=e=>(t,n)=>{e.scrollBy({left:n*he(e)(t),behavior:"smooth"})},pe=({itemCount:e,isCyclic:t,onVisibleIndicesChange:n})=>{const r=s(null),[a,o]=i([]),c=l((e=>{o((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),n&&n(e)}),[e]),[d,m]=a.length?[me()(a),de()(a)]:[-1,-1],h=d>0,u=m<e-1,p=l((()=>{var n;r.current&&(t&&!h?(n=r.current).scrollTo({left:n.scrollWidth,behavior:"smooth"}):ue(r.current)(e,-1))}),[t,e,h]),g=l((()=>{r.current&&(t&&!u?r.current.scrollTo({left:0,behavior:"smooth"}):ue(r.current)(e,1))}),[e,t,u]);return[r,{scrollLeft:p,scrollRight:g,canScrollLeft:t||h,canScrollRight:t||u,visibleIndicesRange:[d,m],handleVisibleIndicesChange:c}]},ge=u((({className:e="",gap:t=14,padding:n=16,showDots:i=!0,children:r,onVisibleIndicesChange:l,listType:a="horizontal-list"})=>{const s=Array.isArray(r)?r.length:0,[o,c]=pe({itemCount:s,onVisibleIndicesChange:l}),[d]=c.visibleIndicesRange;return h("div",{className:g(e,"vertical-list"===a?"relative h-full":""),children:[m(ne,{containerRef:o,activeIndex:d,visibleItemCount:1,gap:t,padding:n,onVisibleIndicesChange:c.handleVisibleIndicesChange,listType:a,children:r}),i?m(oe,{containerRef:o,activeIndex:d,dotCount:s,listType:a}):null]})}));const be=e=>e?.includes("//"),xe=e=>(e||"").replace(/\/?\?.*/,""),fe=e=>{if(!e||!be(e))return;const t=e,n=t.indexOf("//"),i=t.indexOf("/",n+"//".length);return-1!==i?t.substring(0,i):t},Ne=e=>{if(!e||!be(e))return;return new URL(e).pathname},ye=e=>e?.startsWith("#");var ve=Object.freeze({__proto__:null,isURL:be,withoutQuery:xe,getOrigin:fe,getPathname:Ne,getHash:e=>{if(!e||!be(e))return;const t=e.indexOf("#");return-1!==t?e.substring(t,e.length):void 0},isHash:ye});const we=(e,t)=>we._impl(e,t);function ke(){return ke._impl()}function Ce(){const e=ke(),t=$.inst;return n=>{const i=((e,t)=>{if(!e)return e;const n=fe(t?.href);return n?e.replace(n,"")||"/":e})(n.href,e);return{...n,href:i,"aria-label":n.text,onClick:we((r=>{n.onClick&&n.onClick(r),Se(i,n.target)||(r?.preventDefault(),ye(i)?t.goto(i):i&&e.push(i))}),n)}}}we._impl=e=>e,we.setup=e=>{we._impl=e},ke._impl=()=>({href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{}}),ke.setup=e=>{ke._impl=e};const Se=(e,t)=>be(e)||t&&"_self"!==t||e?.startsWith("/"),Te={primary:"text-white bg-primary-main hover:bg-primary-hover active:bg-primary-active",secondary:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active",white:"text-primary-main bg-white hover:text-white hover:bg-primary-hover active:bg-white active:text-primary-main",link:"",transparent:"","":""},$e="bg-main-divider text-main-disabled",_e={primary:$e,secondary:$e,white:$e,link:"",transparent:"","":""},Ie="text-center font-sans select-none",Ae={primary:"group-hover/btn:brightness-0 group-hover/btn:invert",secondary:"group-hover/btn:brightness-0 group-hover/btn:invert",white:"group-hover/btn:brightness-0 group-hover/btn:invert",link:"",transparent:"","":""},je=u((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:r,version:l="primary"}=e;return h("div",{className:Re(e),children:[i?m("div",{className:Ae[l],children:i}):null,Be(e)?h("div",{children:[n?m("div",{className:"text-xs-light text-left",children:n}):null,m("div",{className:"text-left "+(n?"text-s -mt-0.5":"text-l"),children:t})]}):null,r?m("div",{className:Ae[l],children:r}):null]})})),Re=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const r="gap-2 "+(n?"py-2.5 px-7":"py-4 px-4");return["group/btn flex items-center justify-center",Be(e)?r:"h-12 w-12",i?"rounded-full":""].join(" ")},Be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),De=({className:e,rounded:t,version:n})=>["inline-block",Ie,n?_e[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Oe=({className:e,rounded:t,version:n})=>[Ie,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border",n?Te[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ve=u((({disabled:e,children:t,...n})=>{const i=Ce()(n),r=t??m(je,{...i});return m(e?Me:Le,{...i,children:r})})),Le=u((({className:e="",href:t,rel:n,target:i,ariaLabel:r,version:l,rounded:a,onClick:s,children:o})=>m("a",{className:Oe({className:e,version:l,rounded:a}),href:t,rel:n,target:i,"aria-label":r,role:t?"link":"button",onClick:s,children:o}))),Me=u((({className:e,ariaLabel:t,version:n,rounded:i,children:r})=>m("div",{role:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:De({className:e,rounded:i,version:n}),children:r}))),Pe=(e=!1)=>e?"text-white":"",ze=(e=!1)=>"text-s mb-3.5 "+(e?"text-white":"text-secondary-text/80"),Ee=u((({icon:e,image:t,title:n,subtitle:i,isFillGradient:r})=>h("div",{role:"columnheader",children:[e?m(Y,{className:"h-[63px] w-[63px] min-w-[63px] min-h-[63px] mb-4",image:e,width:"63",height:"63"}):null,t?.src&&m("div",{className:"mb-3.5",children:m(Y,{image:t})}),n?m(j,{headingType:"h4",className:Pe(r),title:n}):null,i?m("div",{className:ze(r),children:i}):null]}))),Fe=u((({cell:e,rowHeader:t,isFillGradient:n=!1})=>m("div",{className:"box-border flex flex-col",role:"cell",children:m("div",{className:"h-full border-main-divider border border-t-0 border-x-0",children:e.map(He(n,t))})}))),He=(e,t)=>({label:n,description:i},r)=>h("div",{className:"flex justify-between text-s py-3.5",children:[m("div",{className:""+(e?"text-white/80":"text-secondary-text"),children:t}),h("div",{className:"basis-1/2",children:[n?m("div",{className:"text-right "+(e?"text-white":""),children:n}):null,i?m("div",{className:"text-right "+(e?"text-white/80":"text-secondary-text"),children:i}):null]})]},String(r)),Ge=u((({header:e,columnData:t,visibleRowLength:n=0,isFillGradient:i,showRow:r,onToggleColumn:l})=>{const a=t?.slice(0,r?t.length:n),s=i?"secondary":"primary";return h("div",{className:`border border-gray rounded-md p-4 mb-3.5 ${i?"bg-gradient-to-r from-main-gradient-start to-main-gradient-end":""}`,role:"row",children:[m(Ee,{...e,isFillGradient:i}),a?.length?a.map((({rowHeader:e,cell:t},n)=>m(Fe,{cell:t,rowHeader:e,isFillGradient:i},String(n)))):null,r&&e?.link?m(Ve,{href:e.link.href,target:e.link.target,version:s,className:"text-s font-medium mt-4 py-[11px]",children:e.link.text}):null,Je({onToggleColumn:l,isFillGradient:i,showRow:r})]})})),Je=({onToggleColumn:e,isFillGradient:t,showRow:n})=>m("div",{className:"mt-5",role:"cell",children:m("a",{role:"link",onClick:e,className:"text-s font-medium cursor-pointer "+(t?"text-white/80":"text-primary-main"),children:n?"Скрыть":"Показать описание"})}),We=u((e=>{const{className:t,title:n}=e;return h("section",{className:`bg-white font-sans px-4 py-6 overflow-hidden text-primary-text relative ${t||""}`,children:[n?m(j,{headingType:"h3",className:"font-medium text-center m-0 mb-5",title:n}):null,m("div",{role:"table",children:m(Ue,{...e})})]})})),Ue=u((({columns:e=[],rowHeaders:t,isColoredFirstColumn:n,visibleRowLength:r,orientation:a,...s})=>{const[o,c]=i(new Array(e.length).fill(!r)),d=l((e=>{const t=(t,n)=>n===e?!t:t;c((e=>e.map(t)))}),[]),h=l((()=>c((e=>new Array(e.length).fill(!1)))),[]),u=e?.map((({data:e,header:i},l)=>{return m(Ge,{visibleRowLength:r,showRow:o[l],header:i,columnData:(a=e,a?.map(((e,n)=>({cell:e,rowHeader:t?.[n]?.title})))),isFillGradient:0===l&&n,onToggleColumn:()=>d(l),...s},String(l));var a}));return"horizontal"===a?m(ge,{onVisibleIndicesChange:h,children:u}):u})),Ye=new Map;function Xe(e,t,{fallback:n}={}){const l=a((()=>Ke(e)),[e]),[s,o]=i(),[c,d]=i(),m=e=>{o(e),d(void 0)},h=e=>{o(void 0),d(e)};r((()=>{if(!l.every((e=>null===e)))try{const e=t(...l);"then"in e?(e=>{e.then((e=>Ye.get(l)||e)).then(m).catch(h)})(e):m(e)}catch(e){h(e)}}),[t,...l]);const u=l[0],p=n&&"string"==typeof u&&n[u];return{data:s||c||!p?s:p,error:c,mutate:()=>Promise.resolve(void 0),isValidating:!1}}function Ke(e){return e?Array.isArray(e)?e:e instanceof Function?Ke(e()):[e]:[e]}async function qe(e,t){const n=await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}});return await n.json()}function Qe(e,t={}){const{data:n}=Xe(`/wcms-resources/${e}.json`,qe,{fallback:t});return n||{}}const Ze=u((({className:e,isMobile:t=!1})=>{const{term:n,setTerm:r}=(()=>{const[e,t]=i("");return{term:e,setTerm:e=>t(e)}})(),l=t?"text-s":"text-l-light",a=t?" placeholder-transparent":"h-full",s=t?"some search":void 0;return h("form",{className:`font-sans relative ${e}`,children:[h("div",{className:"absolute rounded h-full flex items-center justify-center pl-4 max-w-[170px] gap-3.5 pointer-events-none",children:[m("div",{className:t?"w-5 h-5":"w-6 h-6",children:m(Y,{image:{icon:"LoupeIcon"},width:"24",height:"24"})}),n?null:m("label",{htmlFor:"search-bar-input",className:`text-secondary-text ${l}`,children:"Поиск по сайту"})]}),m("input",{id:"search-bar-input",className:`h-12 pl-12 w-full peer text-l text-black border border-solid rounded-md box-border\n outline-none pr-[6%] border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text ${a}`,value:n,onChange:e=>r(e.target.value),type:"text",name:"search-bar-input",placeholder:s}),t?m("button",{className:"visible peer-placeholder-shown:invisible absolute top-2 right-3 w-6 h-6 p-1 bg-transparent cursor-pointer border-none",onClick:e=>{e.preventDefault(),r("")},children:m(Y,{image:{icon:"CloseIcon"},width:"24",height:"24"})}):m(Ve,{version:"primary",text:"Найти",className:"invisible peer-focus:visible absolute top-[3px] right-1",onClick:e=>{e?.preventDefault(),console.log("click")},children:m("div",{className:"text-s px-9 py-2.5",children:"Найти"})})]})})),et=u((e=>m(Ze,{...e,isMobile:!0}))),tt=u((({className:e="",documents:t,...n})=>m(I,{className:`mt-2.5 ${e}`,...n,children:m("ul",{className:"flex flex-col text-s text-secondary-text p-0",children:t?.length?nt(t):null})}))),nt=e=>e.map(((e,t)=>{const{text:n,...i}=e;return m("li",{className:"mb-4 list-none",children:m("a",{className:"hover:text-primary-main",role:"link",...i,children:n||null})},`list_item_${String(t)}`)})),it={"bg-white":"color",transparent:"white"},rt={"bg-white":"text-primary-main",transparent:"text-white"},lt=(e,t,n)=>m(Y,t?.src?{image:t,className:rt[e],width:n?.width,height:n?.height,pathPrefix:"/wcms-resources/",asSVG:!0}:{image:{icon:t?.icon||"LogoIcon",iconVersion:it[e]},className:rt[e],width:n?.width,height:n?.height,asSVG:!0}),at={"bg-white":"text-primary-text",transparent:"text-white"},st=(e,t,n)=>m("span",{className:`${at[t]} ml-2.5 font-medium ${n||""}`,children:e||"Россельхозбанк"}),ot=u((({bgColor:e="bg-white",children:t,className:n="",href:i,logo:r,showTitle:l=!0,targetBlank:a})=>h("a",{className:`inline-flex items-center font-sans no-underline ${n}`,href:i||"https://rshb.ru/",target:a?"_blank":"_self","aria-label":r?.title||"Россельхозбанк",children:[lt(e,r?.image,{width:"34",height:"34"}),l?st(t||r?.title,e,"text-s"):null]}))),ct=u((({className:e="",title:t="Мобильное приложение",description:n,href:i="#"})=>m("div",{className:`col-span-12 rounded-md cursor-pointer p-4 mt-6 mb-6 bg-secondary-light font-sans ${e}`,children:i?h("div",{className:"flex",children:[m("div",{className:"flex justify-center align-middle rounded-md bg-primary-main w-12 h-12",children:m(ot,{className:"w-8",bgColor:"transparent",showTitle:!0})}),h("a",{href:i,target:"_blank",className:"flex flex-col justify-center pl-3",children:[m("div",{className:"text-s font-medium mb-[3px]",children:t}),m("div",{className:"text-s text-secondary-text",children:n})]})]}):null}))),dt=u((({className:e="",items:t,hasButton:n})=>h("div",{className:e,children:[t?.length?t.map(mt):null,n?m(Ve,{version:"primary",className:"mb-6 w-full",href:"/",target:"_blank",ariaLabel:"Обратная связь",text:"Обратная связь"}):null]}))),mt=(e,t)=>{const{type:n,text:i,description:r}=e;return h("div",{className:"mb-4",children:[m("div",{children:ht(n,i)}),m("div",{className:"mt-1 text-s-light text-secondary-text",children:r})]},String(t))},ht=(e,t="")=>{switch(e){case"tel":return m("a",{className:"text-h6 text-primary-text hover:text-primary-main no-underline",href:`tel:${ut(t)}`,children:t});case"email":return m("a",{className:"text-xl-light text-primary-text no-underline",href:`mailto:${t}`,children:t});default:return m("span",{children:t})}},ut=e=>e.replaceAll(/\D/g,""),pt=u((({className:e="",index:t,text:n,...i})=>{const r=Ce(),{href:l,target:a,onClick:s}=r(i);return m("a",{className:`text-secondary-text hover:text-primary-main inline-block no-underline ${e}`,href:l,target:a,onClick:s,children:n||`Документ ${t}`})})),gt=u((({title:e,links:t,className:n=""})=>h("div",{className:n,children:[m("span",{className:"text-primary-text text-s font-medium",children:e}),t?.length?m("div",{className:"flex flex-col gap-2 pt-3",children:t.map(((e,t)=>m(pt,{index:t,className:"text-s",...e},String(t))))}):null]}))),bt=[{origins:["t.me","telegram.org"],icon:{icon:"TelegramIcon"},label:"Телеграм"},{origins:["vk.com"],icon:{icon:"VKIcon"},label:"ВКонтакте"},{origins:["ok.ru"],icon:{icon:"OkIcon"},label:"Одноклассники"},{origins:["apps.apple.com"],icon:{icon:"AppleIcon"},label:"App Store"},{origins:["play.google.com"],icon:{icon:"PlayMarketIcon"},label:"Google Play"},{origins:["youtube.com"],icon:{icon:"YoutubeIcon"},label:"Youtube"}],xt={default:"w-14 h-14",small:"w-12 h-12"},ft=u((({isRounded:e=!1,buttonSize:t="default",iconVersion:n="color",...i})=>{const r=Ce(),{href:l,onClick:a}=r(i),{icon:s,label:o}=bt.find((({origins:e})=>e.some((e=>l?.includes(e)))))||{},c=s?{...K(s),iconVersion:n}:null;return s?m("a",{className:g("group/media flex items-center justify-center box-border",xt[t],e?"rounded-full":"rounded-md","border-solid border border-main-divider hover:border-transparent","hover:bg-primary-main hover:text-black","group-data-secondary:bg-white group-data-secondary:hover:bg-secondary-hover"),href:l,"aria-label":o,target:"_blank",rel:"noopener noreferrer",onClick:a,children:c?m(Y,{image:c,imageClassName:"group-hover/media:text-white",width:"24",height:"24",asSVG:!0}):null}):null})),Nt=u((({className:e="",media:t})=>m("div",{className:`flex gap-2 items-start justify-start pt-6 pb-6 ${e}`,children:t?.map(((e,t)=>m(ft,{...e},String(t))))}))),yt=u((({className:e="",index:t,...n})=>{const i=Ce(),{href:r,target:l,text:a,onClick:s}=i(n);return m("a",{className:`text-xs-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px] ${e}`,href:r,target:l,onClick:s,children:a||`Документ ${t}`})})),vt=u((({className:e="",links:t})=>h("div",{className:e,children:[m("div",{className:"py-6",children:m("span",{className:"text-xs-light text-secondary-text",children:`© 2000-${(new Date).getFullYear()} АО «Россельхозбанк» Генеральная лицензия Банка России № 3349 от 12.08.2015 г.`})}),t?.length?m("div",{className:"flex flex-col justify-start items-start gap-2",children:t.map(((e,t)=>m(yt,{index:t,...e},String(t))))}):null]}))),wt=u((({className:e="",...t})=>{const n=t.options?.page?.fallback,i=Qe(o.SITEMAP||"sitemap",n),{documents:r,relatedEnterprises:l,contacts:a,socialMedia:s,horizontalNavigationTitle:c}=Qe(o.FOOTER||"footer",n);return h("footer",{className:`font-sans px-4 py-[26px] bg-white ${e}`,children:[m(dt,{className:"overflow-hidden",items:a,hasButton:!0}),m(B,{children:i.topItems?.map(((e,t)=>m(Q,{label:e.text,children:m(tt,{documents:e.items})},String(t))))}),m("div",{children:i?.dispositions?.map(kt)}),m(ct,{title:"Мобильное приложение",description:"Загрузить для IOS и Android",...t}),m(et,{className:"grow"}),m(Nt,{className:"pb-4",media:s}),m(gt,{title:c,links:l}),m(vt,{links:r})]})})),kt=(e,t)=>{const{icon:n,href:i,text:r}=e;return h(Ve,{version:"link",href:i,className:"flex text-s mb-4 w-6",children:[n?m(Y,{className:"pr-1",image:K(n),width:"24",height:"24",asSVG:!0}):null,m("span",{className:"pl-2.5 font-medium text-primary-text",children:r})]},`footer-${t}`)},Ct=u((({className:e="",title:t,description:n,cards:i=[],orientation:r="horizontal",...l})=>h(I,{className:`relative px-4 py-6 overflow-hidden ${e}`,...l,children:[h("div",{className:"flex flex-col items-center mb-5",children:[t?m(j,{headingType:"h3",className:"text-center "+(n?"mb-2":"mb-5"),title:t}):null,n?m("div",{className:"text-m max-w-[600px] text-center mb-5",children:n}):null]}),St(r,i)]})));function St(e,t){return"horizontal"===e?m(ge,{children:t?.map(Tt)}):m("div",{className:"grid gap-3.5",children:t?.map(Tt)})}function Tt(e,t){return h("div",{className:`w-full h-full flex flex-col justify-between shrink-0 box-border snap-start snap-always border-solid border rounded-md border-gray p-4\n ${_[e.version??"primary"]}`,children:[h("div",{children:[$t(e.icon),e.title?m("h3",{className:"text-m-title-xs font-medium m-0",children:e.title}):null,e.description?_t(e):null,e.items?.length?At(e.items,e.isDotted,e.version):null]}),e?.button?.text?(n=e.button,m(Ve,{className:"mt-3",...n})):null]},t);var n}const $t=e=>e?.src||e?.icon?m("div",{className:"flex justify-center",children:m(Y,{className:"mb-3.5",image:e})}):null;function _t(e){return m("div",{className:"text-secondary-text mt-1 text-s "+("secondary"===e.version?"text-white opacity-80":""),children:e.description})}const It={primary:"bg-primary-text",secondary:"bg-white",gray:"bg-primary-text",transparent:"","":""};function At(e,t,n="primary"){return m("section",{className:"mt-3",children:e.map(((e,i)=>h("div",{children:[t?m("div",{className:`rounded-full inline-block mr-3 mt-2 w-2 h-2 min-w-2 min-h-2 ${It[n]}`}):null,m("span",{className:"text-m font-medium",children:e.title}),m("span",{className:"text-s pl-2 "+("primary"===n?"text-secondary-text":""),children:e.text})]},String(i))))})}const jt=(e,t,n=((e,t)=>t.startsWith(e)))=>n(xe((e=>be(e)||e?.startsWith("/")?e:`${o.BASE_PATH||""}${e}`)(e)),xe(be(e)?t.href:Ne(t.href))),Rt=e=>t=>jt(t.href,e),Bt=e=>t=>t.items?.some(Rt(e))||jt(t.href,e)||((e,t)=>[fe(e),fe(t.href)].every(((e,t,n)=>Boolean(e)&&e===n[0])))(t.href,e)||Boolean(o.BASE_PATH?.startsWith(t.href||"/")),Dt=u((({className:e="",active:t,dataItemName:n,children:i,...r})=>{const l=Ce(),{href:a,target:s,text:o,onClick:c}=l(r);return h("a",{className:`relative inline-block bg-transparent text-center no-underline ${e}`,href:a,target:s,"data-item-name":n,onClick:c,children:[m("span",{className:Ot(t),children:o||i}),t?m("div",{className:Vt(t)}):null]})})),Ot=(e=!1)=>g("font-sans text-s",e?"text-primary-main":"text-secondary-text hover:text-primary-main","group-data-transparent:text-white group-data-transparent:hover:text-primary-hover"),Vt=(e=!1)=>g("absolute left-0 -bottom-3 w-full h-0.5",e?"bg-primary-main group-data-transparent:bg-transparent":""),Lt=864e5;function Mt(e,t,n=globalThis?.localStorage){const i=l((async(...i)=>{const r=`async:${e}`,l=function(e){const{data:t=null,timestamp:n=null}=e?JSON.parse(e):{};return t&&Date.now()-n<Lt?t:void 0}(n.getItem(r));if(l)return l;const a=await t(...i);return n.setItem(r,JSON.stringify({data:a,timestamp:Date.now()})),a}),[e,t]);return Xe(e,i)}const Pt=()=>{const e=globalThis.localStorage?.getItem("location");try{return e?JSON.parse(e):null}catch(e){return null}},zt=u((({burgerSubMenu:e,onClick:t,defaultLocation:n="",children:a})=>{const[s]=function(e){const t=Pt(),[n,a]=i(t?.region??{name:e}),{data:s}=Mt("/api/v1/region",qe);return r((()=>{a(t?.region&&t?.manual?t.region:s||{name:e})}),[s]),[n,l((e=>{globalThis.localStorage?.setItem("location",JSON.stringify({manual:!0,region:e})),a(e)}),[a])]}(n);return h("div",{className:"absolute top-0 left-0 w-full h-full bg-white p-4 box-border z-20",children:[m("button",{className:"absolute top-4 right-4 border-none bg-transparent cursor-pointer",onClick:t,children:m(Y,{image:{icon:"CloseIcon"},width:"24",height:"24",asSVG:!0})}),h("button",{className:"flex items-center text-s p-0 mb-4 bg-transparent cursor-pointer",children:[m(Y,{image:{icon:"GeolocationIcon"},width:"20",height:"20",className:"text-primary-main box-border mr-2",asSVG:!0}),m(X,{color:"text-secondary-text",children:s.name})]}),a,m("div",{className:"mb-7",children:e?.map(Et)}),m(et,{className:"grow"})]})})),Et=(e,t)=>{const{icon:n,href:i,text:r}=e;return h("a",{href:i,className:"flex text-s mb-4 hover:text-primary-main",children:[n?m(Y,{className:"text-primary-main pr-1",image:n,width:"24",height:"24",asSVG:!0}):null,m("span",{className:"font-medium pl-0.5",children:r})]},`headerSubMenu-${t}`)},Ft=u((({onClick:e,bgColor:t,logo:n})=>h("div",{className:"flex items-center justify-between border-0 border-b border-main-divider h-12",children:[h("div",{className:"flex items-center",children:[m("button",{className:"pl-0 pr-4 border-0 bg-transparent cursor-pointer",onClick:e,"aria-label":"Открыть меню",children:m(Y,{image:{icon:"BurgerIcon",iconVersion:"bg-white"===t?"black":"white"},className:"text-primary-text w-6 h-6",width:"24",height:"24",asSVG:!0})}),m(ot,{className:"mr-8",bgColor:t,logo:n})]}),m("button",{className:"text-primary-main group-data-transparent:text-white group-data-transparent:hover:text-primary-hover text-s border-0 bg-transparent",children:"Войти"})]}))),Ht={"bg-white":"primary",transparent:"transparent"},Gt=u((({bgColor:e="bg-white",version:t=Ht[e],...n})=>{const r=ke(),a=n.options?.page?.fallback,{topItems:s,dispositions:c,defaultLocation:d,logo:u}=Qe(o.SITEMAP||"sitemap",a),p=s?.find(Bt(r)),g=p?.items,b=(e=>(t=[])=>{const n=t?.filter(Rt(e));return n?.length?de((e=>e.href?.length||0))(n):void 0})(r)(g),[x,f]=i(!1),N=l((()=>f((e=>!e))),[]);return h(I,{tag:"header",version:t,...n,children:[h("div",{className:"container px-4 py-0 box-border",children:[m(Ft,{onClick:N,bgColor:e,logo:u}),m("nav",{className:"flex items-center m-0 p-0 overflow-y-hidden w-full h-12",children:m("div",{className:"flex no-scrollbar horizontal-list h-full items-center",children:g?.map(((e,t)=>m(Dt,{className:"mr-8 whitespace-nowrap text-s",active:e===b,...e},String(t))))})})]}),x?m(zt,{onClick:N,burgerSubMenu:c,defaultLocation:d,children:m(B,{children:s?.map(((e,t)=>m(Q,{label:e.text,children:m(tt,{documents:e.items})},String(t))))})}):null]})})),Jt={XXL:{wrapper:"gap-[18px]",title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5"},XL:{wrapper:"gap-4",title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl-light"},L:{wrapper:"gap-4",title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl-light"},M:{wrapper:"gap-3",title:{headingType:"h3",as:"h3"},descriptionSize:"text-xl-light"},S:{wrapper:"gap-2",title:{headingType:"h4",as:"h4"},descriptionSize:"text-xl-light"},XS:{wrapper:"gap-2",title:{headingType:"h5",as:"h5"},descriptionSize:"text-l-light"}},Wt=u((({className:e,title:t,description:n,headlineVersion:i="XL",align:r="text-center",as:l,version:a="",...s})=>{const o=Jt[i];return h(I,{className:g("flex flex-col p-12",o.wrapper,e),version:a,...s,children:[t?m(j,{className:g("whitespace-pre-wrap",r),...o?.title,as:l||o?.title.as,title:t}):null,n?m(R,{color:"group-data-secondary:text-white/80",size:o.descriptionSize,align:r,children:n}):null]})})),Ut=u((({className:e,iconClassName:t,textClassName:n,suffixClassName:i,doc:r,icon:l})=>{const{text:a,fileSize:s,...o}=r;return h("a",{className:e,role:"link",...o,children:[l?m(Y,{className:t,image:K(l),width:"24px",height:"24px",asSVG:!0}):null,a?h("span",{className:n,children:[a,m("span",{className:i,children:o?.href&&Yt(Xt(o.href),s)})]}):null]})})),Yt=(e,t)=>(e||t?",":"")+(e?` ${e}`:"")+(t?` (${t})`:""),Xt=e=>{if(!e)return"";const t=e.lastIndexOf(".");return-1!==t?e.substring(t+1):""},Kt=u((({className:e="",doc:t,icon:n})=>m(Ut,{className:`flex h-full box-border ${e}`,iconClassName:"mr-3 min-w-6 min-h-6",doc:t,icon:n}))),qt=u((({hasBorder:e=!0,documents:t,icon:n})=>m(ge,{className:"text-s text-primary-main mt-5",children:t?.length?t.map(((t,i)=>m(Kt,{className:e?"rounded-md border-gray border border-solid p-4":"",doc:t,icon:n},String(i)))):null}))),Qt=u((({hasBorder:e=!0,documents:t,icon:n})=>m("div",{className:"text-s text-primary-main flex flex-col mt-5 "+(e?"gap-3.5":"gap-2"),role:"list",children:t?.length?t.map(((t,i)=>m("div",{role:"listitem",children:m(Kt,{className:e?"rounded-md border-gray border border-solid p-4":"",doc:t,icon:n})},String(i)))):null}))),Zt=u((({className:e="",title:t,description:n,icon:i={icon:"DocIconMonoColor"},documents:r,orientation:l="vertical",hasBorder:a=!0,align:s,...o})=>h(I,{className:g("py-6 px-4 overflow-x-hidden",e),...o,children:[m(Wt,{className:"!p-0 "+(n?"gap-2":"gap-5"),title:t,description:n,align:s,headlineVersion:"M",as:"h2"}),m("vertical"===l?Qt:qt,{hasBorder:a,documents:r,icon:i})]}))),en=e=>{const t="col-span-",n=e?.split(/\s+/).find((e=>e.startsWith(t)));return n?parseInt(n.substring(t.length),10):12};function tn(e=""){const t=en(e);return t<=4?"S":t<=8?"M":"L"}function nn(e=""){const t=en(e);return t<=6?"min-h-[300px]":t<=8?"min-h-[320px]":"min-h-[360px]"}function rn(e=""){const t=en(e);return t<=6?"pr-9":t<=8?"pr-[4.75rem]":"pr-[9.4rem]"}const ln=u((({className:e,title:t,description:n="Блок в разработке...",...i})=>h(I,{className:g("p-9 box-border",e,rn(e),nn(e)),...i,children:[m(Wt,{className:"!p-0 max-w-[600px]",title:t,description:n,headlineVersion:tn(e)}),m("figure",{className:"m-0 min-w-[80%]",children:an()})]}))),an=(e=3)=>on(100,e).map((e=>Math.floor(e))).map(sn),sn=(e,t)=>m("div",{style:{width:`${e||100}%`},className:"h-4 mt-2 bg-secondary-light"},String(t)),on=(e,t)=>[e].concat(t>0?on(e/1.618,t-1):[]),cn=(e,{className:t="",buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text))?m("div",{className:g("flex",i?"flex-col gap-2":"gap-4",t),children:e.map(dn(n))}):null,dn=(e="")=>(t,n)=>{const{text:i,icon:r,iconRight:l,version:a,...s}=t||{},o="secondary"===a?"color":"white";return i?m(Ve,{className:e,appendLeft:mn({...r,iconVersion:o}),appendRight:mn({...l,iconVersion:o}),version:a,text:i,...s},n?String(n):""):null},mn=e=>e?.icon||e?.src?m(Y,{image:e,width:String(e?.size?.width||24),height:String(24),asSVG:!0}):null,hn={L:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-4",M:"w-1.5 h-1.5 min-w-1.5 min-h-1.5 mr-3",S:"w-1 h-1 min-w-1 min-h-1 mr-2"},un=u((({className:e="",isDotted:t=!0,children:n,size:i="M"})=>h("div",{className:`font-sans flex items-baseline ${e}`,role:"listitem",children:[t?m("div",{children:m("div",{className:`rounded-full align-middle inline-block bg-primary-text group-data-secondary:bg-white ${hn[i]}`})}):null,m("span",{children:n})]}))),pn={S:"text-l-light",M:"text-h6",L:"text-h5"},gn={S:"ml-2",M:"ml-3",L:"ml-4"},bn=u((({className:e="",hasIndent:t,isDotted:n,itemClassName:i="",items:r,listItemSize:l="M"})=>r?.length?m("section",{className:`text-primary-text group-data-secondary:text-white group-data-gray:text-secondary-text ${pn[l]} ${t?gn[l]:""} ${e}`,role:"list",children:r.map(((e,t)=>m(un,{className:`${i} mb-1.5`,isDotted:n,size:l,children:e},String(t))))}):null)),xn=u((({className:e="",title:t="",buttons:n,image:i,children:r})=>h("div",{className:`font-sans flex flex-col grow h-full items-start ${e}`,children:[t,h("div",{className:"flex grow w-full justify-between",children:[h("div",{className:"flex flex-col justify-between w-full",children:[m("div",{className:"h-full",children:r}),n?m("div",{className:"mt-auto pt-8",children:n}):null]}),i]})]}))),fn=u((e=>{const{className:t="",icon:n,label:i,description:r,version:l="primary",benefitsVersion:a="normal"}=e,s="white"===a?"secondary":"primary";return h("div",{className:`flex gap-5 ${r?"items-start":"items-center"} ${t}`,children:[n?m("div",{className:Nn(l,a),children:m(Y,{className:"w-6 h-6",image:K(n,s),asSVG:!0})}):null,h("div",{className:"gap-0.5",children:[i?m("div",{className:"text-h6 text-primary-text group-data-secondary:text-white",children:i}):null,r?m("div",{className:"text-m-light text-secondary-text group-data-secondary:text-white",children:r}):null]})]})}));function Nn(e,t){let n="bg-primary-main text-black";return"secondary"===e?n="bg-white/30 text-black":"normal"===t&&(n="bg-secondary-light text-primary-main"),`w-12 h-12 min-w-12 rounded-full p-2.5 box-border flex items-center justify-center ${n}`}const yn=(e="primary",t="normal")=>({icon:n,label:i,description:r},l)=>m(fn,{icon:n,label:i,description:r,version:e,benefitsVersion:t},String(l)),vn=u((({className:e="",headlineVersion:t="L",benefits:n,benefitsVersion:i="normal",buttons:r,image:l,items:a,version:s="primary",isDotted:o=!0,label:c,title:d,description:u,...p})=>h(I,{className:`w-full ${e}`,version:s,...p,children:[h("div",{children:[c?kn(c):null,m(Wt,{className:"!p-0 max-w-[600px]",title:d,description:u,headlineVersion:t,align:"text-left"}),h(xn,{buttons:cn(r,{className:"mt-5",isVertical:!0}),children:[n?.filter((e=>e.label))?.length?m("div",{className:"mt-3",children:n.map(yn(s,i))}):null,a?.length?m(bn,{className:"mt-3 text-m",items:a,isDotted:o}):null]})]}),wn(l)]})));function wn(e){return e?.src?m(Y,{imageClassName:"mt-5 mx-auto block",image:{className:"block",...e}}):null}const kn=e=>m("div",{className:"w-fit px-2.5 py-1.5 mb-5 rounded-md border-2 border-solid border-secondary-hover",children:m(X,{color:"text-primary-main group-data-secondary:text-white/80",children:e})}),Cn=u((e=>{const{className:t="",...n}=e;return m(I,{className:`px-4 py-6 ${t}`,...n,children:m(vn,{...e})})})),Sn={primary:{description:"!text-secondary-text text-l-light",iconText:"text-secondary-text",iconBackground:"bg-main-divider",iconConnector:"bg-secondary-light",dot:"bg-secondary-text"},secondary:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},gray:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},transparent:{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"},"":{description:"!text-white/80 text-l-light",iconText:"text-white",iconBackground:"bg-white/30",iconConnector:"bg-white",dot:"bg-white/80"}},Tn={normal:"h-[70px] w-[70px] min-w-[70px] min-h-[70px]",small:"h-12 w-12 min-w-12 min-h-12"},$n={normal:"min-h-[70px]",small:"min-h-12"},_n=u((({className:e="",title:t,description:n,showLines:i=!0,steps:r,size:l="normal",version:a="primary",...s})=>{const o=Sn[a];return h(I,{className:`box-border px-4 py-6 flex flex-col ${e}`,version:a,...s,children:[t?m(j,{headingType:"h3",className:"text-center",title:t}):null,n?m("p",{className:`text-m-light text-center ${o.description} ${t?"mt-2":""}`,children:n}):null,r?.length?m("div",{className:"box-border py-0.5 mb-0.5 mt-5",children:m("div",{className:"flex flex-col justify-between gap-x-[101px]",children:r.map(In(l,a,i))})}):null]})})),In=(e,t,n)=>(i,r,l)=>{const a=l.length-1===r,s="normal"===e?"ml-[34px]":"ml-6",o=Sn[t];return m("div",{children:h("div",{className:"flex flex-row text-center relative",children:[h("div",{className:"overflow-hidden flex-shrink-0",children:[An(e,t)(i,r),a?null:m("div",{className:`min-h-8 h-full w-0.5 ${n?o.iconConnector:""} ${s}`})]}),h("div",{className:`flex flex-col justify-center h-fit ${$n[e]}`,children:[i.label?m("div",{className:"text-m-title-xs font-medium m-0 text-left mb-1",children:i.label}):null,i.description?m("div",{className:`text-s ${o.description} text-left`,children:i.description}):null]})]})},String(r))},An=(e,t)=>(n,i)=>{const r="normal"===e?"38":"27",l="normal"===e?"text-m-title":"text-m-title-xs";return m("div",{className:`${Tn[e]} ${Sn[t].iconBackground} rounded-full z-10 mr-3 flex justify-center content-center`,children:m("span",{className:`font-medium flex self-center ${l}`,children:(a=n?.icon,Boolean(a?.icon||a?.src)?m(Y,{image:K({...n.icon},t),width:r,height:r,asSVG:!0}):m("span",{children:i+1}))})});var a},jn={Buttons:({buttons:e})=>cn(e,{className:"mt-3",buttonClassName:"w-12 h-12"}),Img:({image:e})=>e?.src?m(Y,{image:{...e,className:"m-0"}}):null,List:({isDotted:e,...t})=>m(bn,{className:"flex flex-col justify-between items-start text-m",isDotted:e??!0,...t}),LabelDescription:({label:e,description:t})=>h("div",{children:[e?m("div",{className:"text-xl font-medium m-0 "+(t?"mb-1":""),children:e}):null,t?m("div",{className:"text-s text-secondary-text",children:t}):null]})},Rn=u((({title:e,icon:t})=>h("div",{className:"flex gap-2.5 mb-2",children:[e?m(j,{headingType:"h3",className:"font-medium",title:e}):null,t?m(Y,{className:"ml-auto max-w-6 max-h-6",image:t,width:"24px",height:"24px"}):null]}))),Bn=u((({tile:e,...t})=>h("div",{className:"rounded-md border-gray h-full box-border border p-4",children:[m(Rn,{...e?.header}),e?.data?.length?e.data.map(((e,n)=>h("div",{children:[n>0?m("div",{className:"h-5"}):null,Dn(e,t)]},String(n)))):null]})));function Dn(e,t){if(!e||!e.tableCellType||!(e.tableCellType in jn))return null;const n=jn[e.tableCellType];return m(n,{displayTable:()=>null,isVisible:!0,...e,...t})}const On=u((({tiles:e,...t})=>e?.length?m(ge,{...t,children:e.map(((e,n)=>m(Bn,{tile:e,...t},String(n))))}):null)),Vn=u((({tiles:e,...t})=>e?.length?m("div",{className:"flex flex-col gap-3.5",children:e.map(((e,n)=>m(Bn,{tile:e,...t},String(n))))}):null)),Ln=u((({className:e,title:t,description:n,tariffsColumns:i,rowHeaders:r,orientation:l="vertical",...a})=>{const s=Mn(i),o=Pn(r,s);return h("section",{className:`px-4 py-6 bg-white font-sans text-primary-text overflow-x-hidden ${e}`,children:[t?m(j,{headingType:"h2",className:`text-center ${n?"mb-2":"mb-5"}`,title:t}):null,n?m("div",{className:"mb-5 text-center text-m",children:n}):null,m("vertical"===l?Vn:On,{tiles:o,...a})]})})),Mn=e=>e?.[0]?.data?e[0].data:[],Pn=(e,t)=>e?.map(((e,n)=>({header:e,data:t?.[n]||[{}]}))),zn={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"}},En=u((({title:e,description:t,blockVersion:n="primary",iconVersion:i,image:r,className:l="",items:a,isDotted:s=!0})=>{const o=zn[n];return h("section",{className:`font-sans px-4 py-[18px] flex flex-col ${o.background} ${l}`,children:["small"===i?Fn(o.icon):null,"big"===i?Hn(r):null,h("div",{className:"py-0.5",children:[e?m("div",{className:`text-l font-medium mb-1 ${o.title}`,children:e}):null,t?m("div",{className:`text-s ${o.description}`,children:t}):null,a?.length?m(bn,{className:"mt-1 text-m",items:a,isDotted:s}):null]})]})}));function Fn(e){return m("div",{className:"mb-3",children:m("div",{className:`rounded-full h-4 w-4 text-center text-xs-light ${e}`,children:"i"})})}function Hn(e){return e?.src?m(Y,{className:"pb-3 mr-auto",image:e}):null}const Gn={Accordion:D,AccordionItem:Q,ComparisonTable:We,Footer:wt,Gallery:Ct,Header:Gt,Headline:Wt,LinkDocs:Zt,LinkList:tt,MobileAppTile:ct,ProductBlock:Cn,StepsBlock:_n,TariffsTable:Ln,TextBlock:En,Placeholder:ln},Jn=["Header","Footer"],Wn=([,{target:e}])=>Math.abs(e.getBoundingClientRect().top);function Un(e=$.inst,t=globalThis){const n=s(new Map);r((()=>e.eventBus.subscribe("intersection",(({block:e,intersection:t})=>{n.current&&n.current.set(e,t)}))),[e]),r((()=>{const i=((e,t=600)=>{let n;const i=(...r)=>{i.dispose(),n=setTimeout((()=>{e(...r)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})((()=>{if(!(globalThis.scrollY>3*globalThis.innerHeight/4))return void e.reset();const t=function(e){const t=e.filter((([e])=>!Jn.includes(e.type||""))).filter((([,{intersectionRatio:e}])=>e>.01)),[n]=t.length>0?me(Wn)(t):[];return n}([...n.current||[]]);t?.anchor?e.replace(t.anchor):t||e.reset()}),100);return t.addEventListener("scroll",i),()=>{i.dispose(),t.removeEventListener("scroll",i)}}),[e,t])}const Yn=d();const Xn=u((({className:e,onClick:t,ariaLabel:n})=>m("button",{type:"button",className:`border-0 w-9 bg-inherit cursor-pointer ${e||""}`,onClick:t,"aria-label":n,children:Kn()}))),Kn=()=>{const e={stroke:"#292D32",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"};return h("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[m("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"}),m("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"})]})},qn=u((({className:e=""})=>{const t=function(e){const[t,n]=i(0);return r((()=>{(async()=>{const[t]=await Yn.getLikeCount(e);n(t?.value||0)})()}),[e]),{likeCount:t,like:l((async()=>{n(await Yn.like(e))}),[e]),dislike:l((async()=>{n(await Yn.dislike(e))}),[e])}}(ke().pathname);return h("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:[m(Xn,{onClick:we(t.like),ariaLabel:"Поставить отметку «лайк»"}),m(Xn,{onClick:we(t.dislike),className:"rotate-180",ariaLabel:"Поставить отметку «дизлайк»"}),m("span",{className:"select-none",children:t.likeCount})]})})),Qn=u((e=>{const{className:t="",blocksRegistry:n,blockDecorator:i,data:r={}}=e,{style:l,blocks:a,slots:s,likeControl:o,colorPalette:c="pc"}=r,d={key:"",page:r,blocksRegistry:n,blockDecorator:i,parent:r};return Un(),h("section",{className:g("relative",l,t),"data-theme":c,children:[s?.header?m("div",{className:"mb-5 shadow-[0_8px_32px_0px_#00000014]",children:y(s?.header,{...d,slotName:"header"})}):null,h("div",{className:"container grid grid-cols-12 gap-1",children:[y(a,d),s?.footer?y(s?.footer,{...d,slotName:"footer"}):null]}),o?m("div",{className:"flex items-end absolute bottom-0 right-0 h-full pointer-events-none",children:m(qn,{className:"rounded-tl-lg sticky bottom-0 pointer-events-auto"})}):null]})}));Qn.childrenTypes=[],Qn.slots=()=>["header","footer"];e.Blocks=Gn,e.ContentPage=Qn,e.DaDataAPI=function(e=""){return{getFetcherAddress:async function(){if(!("geolocation"in navigator))return null;try{const t=await(async()=>new Promise((e=>navigator.geolocation.getCurrentPosition((({coords:t})=>e(t))))))(),n=await fetch(`${e}/geolocate`,{method:"POST",mode:"cors",body:JSON.stringify({lat:t.latitude,lon:t.longitude,count:1})});return(await n.json())?.suggestions?.[0]?.data?.city}catch(e){return console.error(e),null}}}},e.LikeAPI=d,e.handlerDecorator=we,e.joinList=function(e){return t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:i},n):[n]),[])},e.packageVersion="0.7.3",e.projectSettings=o,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=ve,e.useRouter=ke,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
@@ -21,15 +21,17 @@ exports.SwipeListContainer = (0, uni_jsx_1.JSX)(({ className = '', containerRef,
|
|
|
21
21
|
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
22
22
|
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
23
23
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
24
|
+
const isVerticalList = listType === 'vertical-list';
|
|
24
25
|
const isHorizontalList = listType === 'horizontal-list';
|
|
25
26
|
const containerStyle = {
|
|
26
|
-
...(isHorizontalList ?
|
|
27
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
28
|
+
...(isVerticalList ? getContainerHeight(containerRef) : {}),
|
|
27
29
|
gap: `${gap}px`,
|
|
28
30
|
};
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: (0, mapChildren_1.mapChildren)((child, idx) => ((0, jsx_runtime_1.jsx)(SwipeListItem_1.SwipeListItem, { className: (0, style_1.style)(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : ''
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, style_1.style)('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: (0, mapChildren_1.mapChildren)((child, idx) => ((0, jsx_runtime_1.jsx)(SwipeListItem_1.SwipeListItem, { className: (0, style_1.style)(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
30
32
|
});
|
|
31
33
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
32
|
-
const
|
|
34
|
+
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
33
35
|
marginLeft: `${-padding}px`,
|
|
34
36
|
marginRight: `${-padding}px`,
|
|
35
37
|
paddingLeft: `${padding}px`,
|
|
@@ -39,4 +41,7 @@ const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
|
39
41
|
.map((_, i) => [_, i])
|
|
40
42
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
41
43
|
.map(([, i]) => i);
|
|
44
|
+
const getContainerHeight = (ref) => ({
|
|
45
|
+
height: ref?.current?.firstElementChild?.clientHeight || 0,
|
|
46
|
+
});
|
|
42
47
|
//# sourceMappingURL=SwipeListContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAkE;AAElE,yDAAsD;AACtD,6CAA0C;AAE1C,mDAAgD;AAoBhD,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAE1E,QAAA,kBAAkB,GAAG,IAAA,aAAG,EACnC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,GAAG,CAAC,EACpB,GAAG,GAAG,CAAC,EACP,OAAO,GAAG,CAAC,EACX,QAAQ,GAAG,iBAAiB,EAC5B,SAAS,GAAG,aAAa,EACzB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,EAAE;IACH,MAAM,eAAe,GAAgC;QACnD,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,YAAY;KACtB,CAAC;IAEF,MAAM,sBAAsB,GAAG,IAAA,cAAM,EAAsB,EAAE,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,IAAA,mBAAW,EACpC,CAAC,GAAW,EAAE,KAAgC,EAAE,EAAE;QAChD,MAAM,mBAAmB,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;QACxE,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjC,sBAAsB,CAAC,OAAO,GAAG,mBAAmB,CAAC;QAErD,oBAAoB,IAAI,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;QAClE,sBAAsB,IAAI,sBAAsB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC3F,CAAC,EACD,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAC/C,CAAC;IAEF,MAAM,eAAe,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtF,MAAM,gBAAgB,GAAG,QAAQ,KAAK,iBAAiB,CAAC;IACxD,MAAM,cAAc,GAAG;QACrB,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":"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"}
|
|
@@ -19,15 +19,17 @@ export const SwipeListContainer = JSX(({ className = '', containerRef, activeInd
|
|
|
19
19
|
onVisibleIndicesChange && onVisibleIndicesChange(getVisibleIndices(itemsVisibilityList));
|
|
20
20
|
}, [onVisibleItemsChange, onVisibleIndicesChange]);
|
|
21
21
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
22
|
+
const isVerticalList = listType === 'vertical-list';
|
|
22
23
|
const isHorizontalList = listType === 'horizontal-list';
|
|
23
24
|
const containerStyle = {
|
|
24
|
-
...(isHorizontalList ?
|
|
25
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
26
|
+
...(isVerticalList ? getContainerHeight(containerRef) : {}),
|
|
25
27
|
gap: `${gap}px`,
|
|
26
28
|
};
|
|
27
|
-
return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : ''
|
|
29
|
+
return (_jsx("div", { className: style('box-border overflow-auto no-scrollbar', listType, className), style: containerStyle, role: "list", ref: containerRef, children: mapChildren((child, idx) => (_jsx(SwipeListItem, { className: style(snapAlign, visibleItemCount ? childStyleMap[visibleItemCount - 1] : ''), style: isHorizontalList ? getContainerOffset(padding / 4) : {}, activeIndex: activeIndex, idx: idx, observerOptions: observerOptions, onIntersection: handleIntersection, children: child }, String(idx))))(children) }));
|
|
28
30
|
});
|
|
29
31
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
30
|
-
const
|
|
32
|
+
const getContainerOffset = (padding, additionalPadding = 0) => ({
|
|
31
33
|
marginLeft: `${-padding}px`,
|
|
32
34
|
marginRight: `${-padding}px`,
|
|
33
35
|
paddingLeft: `${padding}px`,
|
|
@@ -37,4 +39,7 @@ const getVisibleIndices = (itemsVisibilityList) => itemsVisibilityList
|
|
|
37
39
|
.map((_, i) => [_, i])
|
|
38
40
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
39
41
|
.map(([, i]) => i);
|
|
42
|
+
const getContainerHeight = (ref) => ({
|
|
43
|
+
height: ref?.current?.firstElementChild?.clientHeight || 0,
|
|
44
|
+
});
|
|
40
45
|
//# sourceMappingURL=SwipeListContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAoBhD,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CACnC,CAAC,EACC,SAAS,GAAG,EAAE,EACd,YAAY,EACZ,WAAW,EACX,gBAAgB,GAAG,CAAC,EACpB,GAAG,GAAG,CAAC,EACP,OAAO,GAAG,CAAC,EACX,QAAQ,GAAG,iBAAiB,EAC5B,SAAS,GAAG,aAAa,EACzB,QAAQ,EACR,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,EAAE;IACH,MAAM,eAAe,GAAgC;QACnD,WAAW,EAAE,CAAC;QACd,OAAO,EAAE,YAAY;KACtB,CAAC;IAEF,MAAM,sBAAsB,GAAG,MAAM,CAAsB,EAAE,CAAC,CAAC;IAC/D,MAAM,kBAAkB,GAAG,WAAW,CACpC,CAAC,GAAW,EAAE,KAAgC,EAAE,EAAE;QAChD,MAAM,mBAAmB,GAAG,CAAC,GAAG,CAAC,sBAAsB,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;QACxE,mBAAmB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACjC,sBAAsB,CAAC,OAAO,GAAG,mBAAmB,CAAC;QAErD,oBAAoB,IAAI,oBAAoB,CAAC,mBAAmB,CAAC,CAAC;QAClE,sBAAsB,IAAI,sBAAsB,CAAC,iBAAiB,CAAC,mBAAmB,CAAC,CAAC,CAAC;IAC3F,CAAC,EACD,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAC/C,CAAC;IAEF,MAAM,eAAe,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtF,MAAM,gBAAgB,GAAG,QAAQ,KAAK,iBAAiB,CAAC;IACxD,MAAM,cAAc,GAAG;QACrB,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"SwipeListContainer.js","sourceRoot":"","sources":["../../../src/ui-kit/SwipeListControl/SwipeListContainer.tsx"],"names":[],"mappings":"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"}
|
|
@@ -60,9 +60,11 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
60
60
|
|
|
61
61
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
62
62
|
|
|
63
|
+
const isVerticalList = listType === 'vertical-list';
|
|
63
64
|
const isHorizontalList = listType === 'horizontal-list';
|
|
64
65
|
const containerStyle = {
|
|
65
|
-
...(isHorizontalList ?
|
|
66
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
67
|
+
...(isVerticalList ? getContainerHeight(containerRef) : {}),
|
|
66
68
|
gap: `${gap}px`,
|
|
67
69
|
};
|
|
68
70
|
|
|
@@ -79,9 +81,8 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
79
81
|
className={style(
|
|
80
82
|
snapAlign,
|
|
81
83
|
visibleItemCount ? childStyleMap[visibleItemCount - 1] : '',
|
|
82
|
-
listType === 'vertical-list' ? 'h-full' : '',
|
|
83
84
|
)}
|
|
84
|
-
style={isHorizontalList ?
|
|
85
|
+
style={isHorizontalList ? getContainerOffset(padding / 4) : {}}
|
|
85
86
|
activeIndex={activeIndex}
|
|
86
87
|
idx={idx}
|
|
87
88
|
observerOptions={observerOptions}
|
|
@@ -96,7 +97,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
96
97
|
);
|
|
97
98
|
|
|
98
99
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
99
|
-
const
|
|
100
|
+
const getContainerOffset = (padding: number, additionalPadding = 0): Record<string, string> => ({
|
|
100
101
|
marginLeft: `${-padding}px`,
|
|
101
102
|
marginRight: `${-padding}px`,
|
|
102
103
|
paddingLeft: `${padding}px`,
|
|
@@ -108,3 +109,7 @@ const getVisibleIndices = (itemsVisibilityList: ItemsVisibilityList) =>
|
|
|
108
109
|
.map((_, i): [IntersectionObserverEntry | undefined, number] => [_, i])
|
|
109
110
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
110
111
|
.map(([, i]) => i);
|
|
112
|
+
|
|
113
|
+
const getContainerHeight = (ref?: { current: HTMLDivElement | null }) => ({
|
|
114
|
+
height: ref?.current?.firstElementChild?.clientHeight || 0,
|
|
115
|
+
});
|
package/package.json
CHANGED
|
@@ -60,9 +60,11 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
60
60
|
|
|
61
61
|
const additionPadding = visibleItemCount > 0 ? gap * Number(visibleItemCount) - 1 : 0;
|
|
62
62
|
|
|
63
|
+
const isVerticalList = listType === 'vertical-list';
|
|
63
64
|
const isHorizontalList = listType === 'horizontal-list';
|
|
64
65
|
const containerStyle = {
|
|
65
|
-
...(isHorizontalList ?
|
|
66
|
+
...(isHorizontalList ? getContainerOffset(padding, additionPadding) : {}),
|
|
67
|
+
...(isVerticalList ? getContainerHeight(containerRef) : {}),
|
|
66
68
|
gap: `${gap}px`,
|
|
67
69
|
};
|
|
68
70
|
|
|
@@ -79,9 +81,8 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
79
81
|
className={style(
|
|
80
82
|
snapAlign,
|
|
81
83
|
visibleItemCount ? childStyleMap[visibleItemCount - 1] : '',
|
|
82
|
-
listType === 'vertical-list' ? 'h-full' : '',
|
|
83
84
|
)}
|
|
84
|
-
style={isHorizontalList ?
|
|
85
|
+
style={isHorizontalList ? getContainerOffset(padding / 4) : {}}
|
|
85
86
|
activeIndex={activeIndex}
|
|
86
87
|
idx={idx}
|
|
87
88
|
observerOptions={observerOptions}
|
|
@@ -96,7 +97,7 @@ export const SwipeListContainer = JSX<SwipeListContainerProps>(
|
|
|
96
97
|
);
|
|
97
98
|
|
|
98
99
|
// Styles used to compensate outer container padding to get rid of clipping effect
|
|
99
|
-
const
|
|
100
|
+
const getContainerOffset = (padding: number, additionalPadding = 0): Record<string, string> => ({
|
|
100
101
|
marginLeft: `${-padding}px`,
|
|
101
102
|
marginRight: `${-padding}px`,
|
|
102
103
|
paddingLeft: `${padding}px`,
|
|
@@ -108,3 +109,7 @@ const getVisibleIndices = (itemsVisibilityList: ItemsVisibilityList) =>
|
|
|
108
109
|
.map((_, i): [IntersectionObserverEntry | undefined, number] => [_, i])
|
|
109
110
|
.filter(([_]) => _ && _.intersectionRatio >= 0.9)
|
|
110
111
|
.map(([, i]) => i);
|
|
112
|
+
|
|
113
|
+
const getContainerHeight = (ref?: { current: HTMLDivElement | null }) => ({
|
|
114
|
+
height: ref?.current?.firstElementChild?.clientHeight || 0,
|
|
115
|
+
});
|
|
@@ -3,7 +3,7 @@ import '../../setup-fixture';
|
|
|
3
3
|
import { SwipeListControl } from './SwipeListControl';
|
|
4
4
|
|
|
5
5
|
const renderElement = (_: any, i: number): VNode => (
|
|
6
|
-
<div key={String(i)} className="border border-gray rounded-md text-center h-
|
|
6
|
+
<div key={String(i)} className="border border-gray rounded-md text-center h-32">
|
|
7
7
|
{`Element #${i}`}
|
|
8
8
|
</div>
|
|
9
9
|
);
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
</div>
|
|
47
47
|
),
|
|
48
48
|
vertical: (
|
|
49
|
-
<div className="px-4 py-5 bg-white
|
|
49
|
+
<div className="px-4 py-5 bg-white">
|
|
50
50
|
<SwipeListControl listType="vertical-list">{generateChildren(3)}</SwipeListControl>
|
|
51
51
|
</div>
|
|
52
52
|
),
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { VNode } from '../../model/VNode';
|
|
2
|
+
import '../../setup-fixture';
|
|
3
|
+
import { SwipeListControl } from './SwipeListControl';
|
|
4
|
+
|
|
5
|
+
const renderElement = (_: any, i: number): VNode => (
|
|
6
|
+
<div key={String(i)} className="border border-gray rounded-md text-center h-32">
|
|
7
|
+
{`Element #${i}`}
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
const generateChildren = (count: number) => new Array(count).fill(0).map(renderElement);
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
default: (
|
|
15
|
+
<div className="px-4 py-5 bg-white">
|
|
16
|
+
<SwipeListControl>{generateChildren(5)}</SwipeListControl>
|
|
17
|
+
</div>
|
|
18
|
+
),
|
|
19
|
+
'w/o dots': (
|
|
20
|
+
<div className="px-4 py-5 bg-white">
|
|
21
|
+
<SwipeListControl showDots={false}>{generateChildren(5)}</SwipeListControl>
|
|
22
|
+
</div>
|
|
23
|
+
),
|
|
24
|
+
'1 element': (
|
|
25
|
+
<div className="px-4 py-5 bg-white">
|
|
26
|
+
<SwipeListControl>
|
|
27
|
+
<div className="border border-gray rounded-md text-center h-12">
|
|
28
|
+
Single element, not inside an array
|
|
29
|
+
</div>
|
|
30
|
+
</SwipeListControl>
|
|
31
|
+
</div>
|
|
32
|
+
),
|
|
33
|
+
'2 elements': (
|
|
34
|
+
<div className="px-4 py-5 bg-white">
|
|
35
|
+
<SwipeListControl>{generateChildren(2)}</SwipeListControl>
|
|
36
|
+
</div>
|
|
37
|
+
),
|
|
38
|
+
'empty element': (
|
|
39
|
+
<div className="px-4 py-5 bg-white">
|
|
40
|
+
<SwipeListControl>{null}</SwipeListControl>
|
|
41
|
+
</div>
|
|
42
|
+
),
|
|
43
|
+
'string element': (
|
|
44
|
+
<div className="px-4 py-5 bg-white">
|
|
45
|
+
<SwipeListControl>string content</SwipeListControl>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
vertical: (
|
|
49
|
+
<div className="px-4 py-5 bg-white">
|
|
50
|
+
<SwipeListControl listType="vertical-list">{generateChildren(3)}</SwipeListControl>
|
|
51
|
+
</div>
|
|
52
|
+
),
|
|
53
|
+
};
|