@redneckz/wildless-cms-uni-blocks 0.14.731 → 0.14.733

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/bundle/blocks.schema.json +1 -1
  2. package/bundle/bundle.umd.js +21 -31
  3. package/bundle/bundle.umd.min.js +1 -1
  4. package/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  5. package/bundle/components/CreditCardForm/renderStep.d.ts +1 -2
  6. package/bundle/components/CreditForm/renderStep.d.ts +1 -2
  7. package/bundle/services/retail/inputs.d.ts +1 -0
  8. package/bundle/services/retail/model/RetailFormContent.d.ts +3 -17
  9. package/bundle/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  10. package/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  11. package/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  12. package/dist/components/CreditCardForm/renderStep.d.ts +1 -2
  13. package/dist/components/CreditCardForm/renderStep.js +1 -3
  14. package/dist/components/CreditCardForm/renderStep.js.map +1 -1
  15. package/dist/components/CreditForm/renderStep.d.ts +1 -2
  16. package/dist/components/CreditForm/renderStep.js +1 -2
  17. package/dist/components/CreditForm/renderStep.js.map +1 -1
  18. package/dist/services/retail/content.js +12 -8
  19. package/dist/services/retail/content.js.map +1 -1
  20. package/dist/services/retail/inputs.d.ts +1 -0
  21. package/dist/services/retail/inputs.js +2 -0
  22. package/dist/services/retail/inputs.js.map +1 -1
  23. package/dist/services/retail/model/RetailFormContent.d.ts +3 -17
  24. package/dist/ui-kit/FormField/Fields/CurrencyField.js +1 -4
  25. package/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
  26. package/dist/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  27. package/dist/ui-kit/FormField/Fields/InfoCardField.js +7 -0
  28. package/dist/ui-kit/FormField/Fields/InfoCardField.js.map +1 -0
  29. package/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  30. package/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  31. package/lib/components/CreditCardForm/renderStep.d.ts +1 -2
  32. package/lib/components/CreditCardForm/renderStep.js +2 -4
  33. package/lib/components/CreditCardForm/renderStep.js.map +1 -1
  34. package/lib/components/CreditForm/renderStep.d.ts +1 -2
  35. package/lib/components/CreditForm/renderStep.js +1 -2
  36. package/lib/components/CreditForm/renderStep.js.map +1 -1
  37. package/lib/services/retail/content.js +12 -8
  38. package/lib/services/retail/content.js.map +1 -1
  39. package/lib/services/retail/inputs.d.ts +1 -0
  40. package/lib/services/retail/inputs.js +2 -0
  41. package/lib/services/retail/inputs.js.map +1 -1
  42. package/lib/services/retail/model/RetailFormContent.d.ts +3 -17
  43. package/lib/ui-kit/FormField/Fields/CurrencyField.js +1 -4
  44. package/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
  45. package/lib/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  46. package/lib/ui-kit/FormField/Fields/InfoCardField.js +5 -0
  47. package/lib/ui-kit/FormField/Fields/InfoCardField.js.map +1 -0
  48. package/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  49. package/mobile/bundle/bundle.umd.js +21 -31
  50. package/mobile/bundle/bundle.umd.min.js +1 -1
  51. package/mobile/bundle/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  52. package/mobile/bundle/components/CreditCardForm/renderStep.d.ts +1 -2
  53. package/mobile/bundle/components/CreditForm/renderStep.d.ts +1 -2
  54. package/mobile/bundle/services/retail/inputs.d.ts +1 -0
  55. package/mobile/bundle/services/retail/model/RetailFormContent.d.ts +3 -17
  56. package/mobile/bundle/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  57. package/mobile/bundle/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  58. package/mobile/dist/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  59. package/mobile/dist/components/CreditCardForm/renderStep.d.ts +1 -2
  60. package/mobile/dist/components/CreditCardForm/renderStep.js +1 -3
  61. package/mobile/dist/components/CreditCardForm/renderStep.js.map +1 -1
  62. package/mobile/dist/components/CreditForm/renderStep.d.ts +1 -2
  63. package/mobile/dist/components/CreditForm/renderStep.js +1 -2
  64. package/mobile/dist/components/CreditForm/renderStep.js.map +1 -1
  65. package/mobile/dist/services/retail/content.js +12 -8
  66. package/mobile/dist/services/retail/content.js.map +1 -1
  67. package/mobile/dist/services/retail/inputs.d.ts +1 -0
  68. package/mobile/dist/services/retail/inputs.js +2 -0
  69. package/mobile/dist/services/retail/inputs.js.map +1 -1
  70. package/mobile/dist/services/retail/model/RetailFormContent.d.ts +3 -17
  71. package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js +1 -4
  72. package/mobile/dist/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
  73. package/mobile/dist/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  74. package/mobile/dist/ui-kit/FormField/Fields/InfoCardField.js +7 -0
  75. package/mobile/dist/ui-kit/FormField/Fields/InfoCardField.js.map +1 -0
  76. package/mobile/dist/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  77. package/mobile/lib/components/ApplicationForm/ApplicationFormContent.d.ts +1 -9
  78. package/mobile/lib/components/CreditCardForm/renderStep.d.ts +1 -2
  79. package/mobile/lib/components/CreditCardForm/renderStep.js +2 -4
  80. package/mobile/lib/components/CreditCardForm/renderStep.js.map +1 -1
  81. package/mobile/lib/components/CreditForm/renderStep.d.ts +1 -2
  82. package/mobile/lib/components/CreditForm/renderStep.js +1 -2
  83. package/mobile/lib/components/CreditForm/renderStep.js.map +1 -1
  84. package/mobile/lib/services/retail/content.js +12 -8
  85. package/mobile/lib/services/retail/content.js.map +1 -1
  86. package/mobile/lib/services/retail/inputs.d.ts +1 -0
  87. package/mobile/lib/services/retail/inputs.js +2 -0
  88. package/mobile/lib/services/retail/inputs.js.map +1 -1
  89. package/mobile/lib/services/retail/model/RetailFormContent.d.ts +3 -17
  90. package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js +1 -4
  91. package/mobile/lib/ui-kit/FormField/Fields/CurrencyField.js.map +1 -1
  92. package/mobile/lib/ui-kit/FormField/Fields/InfoCardField.d.ts +2 -0
  93. package/mobile/lib/ui-kit/FormField/Fields/InfoCardField.js +5 -0
  94. package/mobile/lib/ui-kit/FormField/Fields/InfoCardField.js.map +1 -0
  95. package/mobile/lib/ui-kit/FormField/NameFieldDef.d.ts +1 -1
  96. package/mobile/src/components/ApplicationForm/ApplicationFormContent.ts +1 -11
  97. package/mobile/src/components/CreditCardForm/renderStep.tsx +2 -11
  98. package/mobile/src/components/CreditForm/renderStep.tsx +1 -5
  99. package/mobile/src/services/retail/content.tsx +12 -8
  100. package/mobile/src/services/retail/inputs.tsx +2 -0
  101. package/mobile/src/services/retail/model/RetailFormContent.ts +4 -20
  102. package/mobile/src/ui-kit/FormField/Fields/CurrencyField.tsx +1 -8
  103. package/mobile/src/ui-kit/FormField/Fields/InfoCardField.tsx +7 -0
  104. package/mobile/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  105. package/package.json +1 -1
  106. package/src/components/ApplicationForm/ApplicationFormContent.ts +1 -11
  107. package/src/components/CreditCardForm/renderStep.tsx +2 -11
  108. package/src/components/CreditForm/renderStep.tsx +1 -5
  109. package/src/services/retail/content.tsx +12 -8
  110. package/src/services/retail/inputs.tsx +2 -0
  111. package/src/services/retail/model/RetailFormContent.ts +4 -20
  112. package/src/ui-kit/FormField/Fields/CurrencyField.tsx +1 -8
  113. package/src/ui-kit/FormField/Fields/InfoCardField.tsx +7 -0
  114. package/src/ui-kit/FormField/NameFieldDef.ts +2 -1
  115. package/bundle/components/CreditCardForm/renderInfo.d.ts +0 -2
  116. package/bundle/components/CreditForm/renderInfo.d.ts +0 -2
  117. package/dist/components/CreditCardForm/renderInfo.d.ts +0 -2
  118. package/dist/components/CreditCardForm/renderInfo.js +0 -12
  119. package/dist/components/CreditCardForm/renderInfo.js.map +0 -1
  120. package/dist/components/CreditForm/renderInfo.d.ts +0 -2
  121. package/dist/components/CreditForm/renderInfo.js +0 -12
  122. package/dist/components/CreditForm/renderInfo.js.map +0 -1
  123. package/lib/components/CreditCardForm/renderInfo.d.ts +0 -2
  124. package/lib/components/CreditCardForm/renderInfo.js +0 -9
  125. package/lib/components/CreditCardForm/renderInfo.js.map +0 -1
  126. package/lib/components/CreditForm/renderInfo.d.ts +0 -2
  127. package/lib/components/CreditForm/renderInfo.js +0 -9
  128. package/lib/components/CreditForm/renderInfo.js.map +0 -1
  129. package/mobile/bundle/components/CreditCardForm/renderInfo.d.ts +0 -2
  130. package/mobile/bundle/components/CreditForm/renderInfo.d.ts +0 -2
  131. package/mobile/dist/components/CreditCardForm/renderInfo.d.ts +0 -2
  132. package/mobile/dist/components/CreditCardForm/renderInfo.js +0 -12
  133. package/mobile/dist/components/CreditCardForm/renderInfo.js.map +0 -1
  134. package/mobile/dist/components/CreditForm/renderInfo.d.ts +0 -2
  135. package/mobile/dist/components/CreditForm/renderInfo.js +0 -12
  136. package/mobile/dist/components/CreditForm/renderInfo.js.map +0 -1
  137. package/mobile/lib/components/CreditCardForm/renderInfo.d.ts +0 -2
  138. package/mobile/lib/components/CreditCardForm/renderInfo.js +0 -9
  139. package/mobile/lib/components/CreditCardForm/renderInfo.js.map +0 -1
  140. package/mobile/lib/components/CreditForm/renderInfo.d.ts +0 -2
  141. package/mobile/lib/components/CreditForm/renderInfo.js +0 -9
  142. package/mobile/lib/components/CreditForm/renderInfo.js.map +0 -1
  143. package/mobile/src/components/CreditCardForm/renderInfo.tsx +0 -10
  144. package/mobile/src/components/CreditForm/renderInfo.tsx +0 -10
  145. package/src/components/CreditCardForm/renderInfo.tsx +0 -10
  146. package/src/components/CreditForm/renderInfo.tsx +0 -10
@@ -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),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:i,renderProps:l=R,...r})=>{const s=i?(e,t)=>R(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},i)))};function D({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function _(){return _._impl()}_._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const E=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return E.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:z,hasPrefix:V});const j="/api/",$=`${j}v1/storage`,q=e=>(t,n)=>{if([!t,M(t),F(t),[A.CDN,j].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${$}/${t}/attachment`;const a=t?.startsWith("/");return z(V(t,n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",width:r,height:s})=>{const d=_(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=q(d)(z(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:a,title:i,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!M(t)?q(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const a=_();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:J(a)(e),type:te(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):null)),ae={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:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ie="bg-main-divider text-main-disabled",le={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},re="text-center font-sans select-none",se={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:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=_(),{closeAll:n}=he();return e=>{const n=q(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(a({...e,href:n}))}};function a({href:a,target:i,onClick:l}){return r=>{l?.(r),ge(a,i,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}const ge=(e,t,n)=>{if(!O(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[l]),children:a}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,se[l]),children:i}):null]})})),ye=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=pe()({onClick:r,href:a,...i}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:a,version:n}),children:i})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Re=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=_(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,_e=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Ee=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ae=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Me=(e,t)=>e?o(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ee(e.description,t)},String(t)):null,"__html"in e?o(_e,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Oe(n)})]}))),ze=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:ze,{...t}))),je=e=>Boolean(e?.src||e?.icon),$e=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=Ue(i,r),d=Ue(l,r);return a||i?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...i,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>je(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ke)}):null)),Ke=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[He(2)(t)," ",n||"₽"]}):null]},String(a)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ae,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ne,{image:b}):null,B=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Re,{className:e,padding:t,defaultPadding:n,...g?{title:B}:{insetTitle:B},...Qe(R,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:$e(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(_e,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const nt=()=>!0,at=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(lt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class dt extends tt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class ut extends tt{proto=it([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,a=gt)=>ht(t).entries().reduce(((t,[n,i])=>xt(e)(i,t,a.concat(n))),e(n,[a,ht(t)])),yt=pt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?yt(e.get(a),[i,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(at,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=it([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(a=e,a.slice(0,-1)),kt(t(n),n)]:[e,n];var a}))(e),Rt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Bt=e=>{return t=Rt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),_t=e=>[...new Set(e)],Et={},At=["/portal-resources"],Mt=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Bt(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?Mt(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(_t(e).filter((e=>!At.some((t=>e.startsWith(t))))).map((async e=>[e,Et[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Bt(e)));return i.length?Ft(i,a):a}return t};function zt(e,t={}){const n=d((t=>{const n=Ot((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=zt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>jt(0,t?.length)),[t]),a=t?.[n];return a?o(Vt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),jt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),$t=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},qt=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:qt(e)}:{},Ht=(e,t="birthday")=>e?{[t]:$t(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:qt(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e)t[a??""]?.(n,i)};function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Qt();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function tn(){return tn._impl()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);i((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=l(((e,t)=>{const{parse:n=nn,format:a=nn}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function sn(e,t={}){const{open:n,close:a,...i}=he();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function on(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}function cn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?hn:"border-error",gn=e=>e?o(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,fn=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);i((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=pn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[gn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(Ae,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);i((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(fn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(a,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Bn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=a(""),C=An(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(Pn,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[gn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",En(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),_n(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(fn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),_n=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),En=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),An=(e,t)=>e||0===t,Mn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Dn,{...i,valid:!n,label:mn({label:t,errors:a})}),yn(n)]}))),On=e=>!e?.length,Fn=e=>t=>n=>e(n)?[]:[t],zn=Fn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",jn=e=>zn(e??Vn),$n=e=>Fn((e=>e?.key&&""!==e?.key))(e??Vn),qn=e=>Fn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>Fn((e=>"string"==typeof e&&e.length>1&&ea(e)))(e??Vn),Wn=(e,t)=>Fn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>Fn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Kn=e=>Fn(Yn)(e),Gn=Fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Xn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Jn=e=>Boolean(e.region&&e.city&&e.house),Zn=()=>Fn(Jn)(Ln),Qn=/^[\u0400-\u04FF\d\s]+$/u,ea=(e="")=>Qn.test(e),ta=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},na={processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentInformFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn},aa={addressCourier:Zn(),paymentSystem:jn("Укажите тип платежной системы"),currency:jn("Укажите валюту"),cardCategory:jn("Укажите категорию карты"),codeWord:(ia="Необходимо ввести кодовое слово",Fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ea(e)))(ia??Vn)),confirmationIncome:$n(),methodObtain:jn(),deliveryDate:jn("Укажите дату доставки")};var ia;const la={organization:$n("Выберите тип организации"),organizationAddress:Fn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),organizationPhone:Kn("Укажите номер телефона"),organizationName:jn("Укажите наименование организации"),legalForm:jn("Укажите ОПФ"),generalSeniority:qn("Укажите количество лет стажа"),lastJobExperience:qn("Укажите стаж на последнем месте работы"),experience5Years:qn("Укажите общий стаж за последние 5 лет"),jobsNumber:qn("Укажите количество мест работы за последние 5 лет"),beginDate:jn("Укажите дату заключения трудового договора"),addressFact:Zn(),addressRegistration:Zn(),addressRetail:$n("Выберите адрес банка"),addressMatch:jn(),sex:jn("Укажите свой пол"),limitedBirthday:Fn(ta)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:jn("Укажите место рождения"),education:$n("Выберите ваше образование"),housing:$n("Выберите тип жилья"),amountWorkers:$n("Выберите информацию о количестве сотрудников"),employment:$n("Выберите информацию о трудоустройстве"),employerActivities:$n("Выберите вид деятельности организации"),employerOrganization:$n("Выберите вид организации"),positionOrganization:$n("Выберите вашу должность"),familyStatus:$n("Выберите семейное положение"),familyMembers:Wn(2,"Укажите количество членов семьи"),children:Wn(2,"Укажите количество детей"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>Fn(Xn)(e))("Некорректный номер СНИЛС"),conscription:jn(),armyIdFlg:Gn,dulSerie:(e=>Fn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:jn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:jn("Укажите организацию, выдавшую паспорт"),participantDateRegistration:jn("Укажите дату регистрации"),retirementIncome:jn(),otherIncome:jn(),wages:jn(),mandatoryPayments:jn(),disablePeopleFlg:jn(),bankruptcyFlg:jn(),shareholderFlg:jn(),legalEntityName:jn(),bankEmployeeCode:jn(),partInBusiness:jn(),regionRetail:$n("Выберите регион")},ra={fullName:jn(),addressBranch:$n(),desiredMeetingDate:jn(),product:jn(),localities:jn(),partnerComments:jn(),collectionCount:jn(),acquiringType:$n(),serviceType:$n(),annualRevenue:jn(),feedbackMethod:$n(),serviceDirection:$n(),secondaryPhone:Kn("Укажите номер телефона"),region:$n(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),birthday:jn("Укажите дату рождения"),phone:Kn("Укажите номер телефона"),email:(e=>Fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),inn:(e=>Fn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:jn(),typeForm:jn(),consentToReceiveMaterials:Gn,consentDataProcessing:Gn,...na,...la,...aa},sa=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ra?.[e||""]])).filter((([,e])=>e)))},oa=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},ca=(e,t,n=!1)=>n&&t?oa(e,t):e,da=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],ma=d((({field:e,input:t})=>o(Mn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:da,...ca(e("acquiringType"),ra.acquiringType,t?.required)}))),ua=(e="")=>Boolean("trade"===e||"all"===e),ha=e=>null!=e,pa=new Map,ga=(e,t=pa)=>n=>{const a=xa(n),i=t.get(a);if(a&&ha(i))return i;const l=e(...n);return a&&ha(l)&&t.set(a,Promise.resolve(l)),l},fa=e=>Boolean(e?.every((e=>Array.isArray(e)?fa(e):!e||"string"==typeof e))),xa=e=>fa(e)?e.toString():"",ya=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function ba(e,t,{fallback:n,cache:l}={}){const s=r((()=>va(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(ha))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await ga(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&ya(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function va(e){return Array.isArray(e)?e:e instanceof Function?va(e()):[e]}const Na=`${Ut}/branches`,wa=[];const Ca=async e=>await Pt(e,{method:"GET"})||wa;function Sa(e=!1){const{data:t}=ba(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const ka=(e="")=>"ULTRASERVICE"===e,Ia=d((({field:e,input:t,params:n})=>{const a=ka(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?Sa(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=ba(e?`${Na}?regionCode=${e}`:null,Ca);return t||wa}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(Mn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...ca(e("addressBranch"),ra.addressBranch,t?.required),isSearch:!0})})),Ta=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ra=(e,t,n)=>Math.max(t,Math.min(e,n));function Ba(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Pa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=Ba(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const Da=1,_a=100,Ea=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:Da),max:s=(i.length?i.length-1:_a),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Ta(e,{normalize:(e=0)=>i.length?Aa(i)(e):Ra(e,r,s),format:He()}),f=l((e=>{p&&p(Ba(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Pa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Ma(a)]})})),Aa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Ma=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Oa=["От 1 000 ₽","До 1 000 000 000 ₽"],Fa=d((({field:e})=>o(Ea,{title:"Сумма, ₽",items:Oa,min:1e3,max:1e9,...e("amount")}))),za=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...ca(e("annualRevenue"),ra.annualRevenue,t?.required)}))),Va=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),La=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=ja(t,e),c=$a(t,l,r);u.push(o("td",{children:o("div",{className:qa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ja=(e,t)=>t&&e.toDateString()===t.toDateString(),$a=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),qa=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Ua=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Wa=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Ua.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:La({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),Ha=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ya(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ka),l=a.map(((e,t)=>Xa(e)?a.slice(0,t).filter(Xa).length:-1)),r=a.map(((e,t)=>Ga(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Ka=e=>"_"===e,Ga=e=>/\d/.test(e),Xa=e=>Ka(e)||Ga(e),Ja=1940,Za={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Qa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{ti({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ya(t,"__.__.____"))},onBlur:()=>{ei(p)?ti({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Za})]})})),ei=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ja&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},ti=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(ei(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},ni=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Qa,{onChange:a,disabled:r,onClick:e,value:t&&$t(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),ai=Ha.map((e=>({key:e}))),ii=Array.from({length:(new Date).getFullYear()-Ja+1},((e,t)=>Ja+t)).reverse().map((e=>({key:String(e)}))),li=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},ri=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},si={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},oi={className:"min-w-32",iconVersion:"black",isBorder:!1},ci=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[y,b]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(Ha.indexOf(e));const t=li(r,Ha.indexOf(e));ri({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ha.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ai,yearsOptions:ii,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),R=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[gn(t),c("div",{className:"relative",children:[ni({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":R}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...si,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Ha[f]},options:S,...oi}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...oi}),o("div",{className:"my-auto",onClick:N,children:o(W,{...si,className:"rotate-90 cursor-pointer"})})]}),o(Wa,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),di=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ci,{label:mn({label:t,errors:a}),valid:Boolean(!n),...i}),yn(n)]}))),mi=d((({field:e,input:t})=>o(di,{label:"Дата рождения",...ca(e("birthday"),ra.birthday,t?.required)}))),ui=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...ca(e("collectionCount"),ra.collectionCount,t?.required)}))),hi=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...ca(e("comment"),ra.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),pi=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),gi="appearance-none w-5 h-5 border-solid flex-none",fi=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],xi=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(pi,{paths:fi,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",bi(a)),onClick:s,children:[o("div",{className:u(gi,"m-0",i?"rounded-full border-2":Ni(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:vi(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,yi(n)]})})})),yi=e=>e?o("div",{className:"ml-s",children:o(Ae,{size:"text-l",font:"font-light",children:e})}):null,bi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",vi=(e=!1)=>e?"radio":"checkbox",Ni=(e=!1)=>u("rounded border",{"bg-primary-main":e}),wi="consentToReceiveMaterials",Ci=d((({field:e,input:t})=>o(xi,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...ca(e(wi),ra[wi],t?.required)}))),Si=d((({field:e,input:t})=>o(di,{label:"Желаемая дата встречи",...ca(e("desiredMeetingDate"),ra.desiredMeetingDate,t?.required)}))),ki=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{label:"Электронная почта",...ca(e("email"),ra.email,n),...a})})),Ii=[{key:"ULTRASERVICE",text:"Ультра"}],Ti=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ri=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bi=d((({field:e,input:t})=>o(Mn,{label:"Способ получения ответа",options:Ri,...ca(e("feedbackMethod"),ra.feedbackMethod,t?.required)}))),Pi=d((({field:e,input:t})=>o(kn,{label:"ФИО",...ca(e("fullName"),ra.fullName,t?.required),...t})));function Di(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}const _i={};function Ei(e,t=_i){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Ai=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var Mi,Oi;function Fi(e){return Ei(Ai,e)}Mi=Ai,Oi=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),Di(Mi,Oi),Di(Oi,Mi),Mi.bus.watch((({type:e,event:t})=>{null!=t?Oi.setItem(e,t):Oi.removeItem(e)}));const zi=()=>Fi(),Vi=(e,t)=>{if(!t)return null;const n=qi(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Li=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},ji=(e,t)=>{const n=qi(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},$i=(e,t,n)=>{const a=qi(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},qi=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Ui=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Wi=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(Hi(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,n),label:"Адрес",...ca(e(n),ra[n],t?.required),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),Hi=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Yi=(e,t,n)=>{const{okved:a,okopf:i,inn:l}=Ki(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Hi(n.data?.address));const r={amountWorkers:Li(e?.amountWorkers,n.data?.employee_count),employerActivities:Vi(e?.employerActivities??[],a),organization:$i(e?.organization??[],i,l),employerOrganization:ji(e?.employerOrganization??[],i)};for(const e in r)r[e]&&t?.(e)?.onChange?.(r[e])},Ki=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??""}),Gi=d((({field:e,input:t})=>{const n=zi(),a=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),Yi(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...ca(e("inn"),ra.inn,t?.required),onDaDataChange:a})})),Xi=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(xi,{text:t,value:n,disabled:i,onChange:r},a),yn(l)]}))),Ji=d((({field:e})=>o(Xi,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Zi=`${Ut}/outservice`,Qi=[];async function el(){const e=await Pt(`${Zi}/outserviceregions`);return e&&Array.isArray(e)?e:Qi}const tl=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=ba("outServiceRegions",el),r=l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==a&&e?.("localities")?.onChange?.("")}),[a]),o(Mn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...ca(e("localities"),ra.localities,t?.required),isSearch:!0})})),nl="middleName",al=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ui(e,nl),...ca(e(nl),ra.middleName,t?.required),...t}))),il=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ui(e,t.name??""),...ca(e("name"),ra.name,t?.required),...t}))),ll=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),rl=d((({field:e})=>ua(e("acquiringType")?.value?.key)?o(ll,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),sl=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{...ca(e("partnerComments"),ra.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),ol=e=>"_"===e,cl=e=>/\d/.test(e),dl=e=>ol(e)||cl(e),ml=[..."+7 (___) ___-__-__"],ul=ml.findIndex(ol),hl=ml.map(((e,t)=>dl(e)?ml.slice(0,t).filter(dl).length:-1));function pl(e){const t=e.replace(/\D/g,""),n=ml.map(((e,n)=>cl(e)?e:t.charAt(hl[n])||e)),a=hl.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(ul,a)):n).join("")}const gl=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(pl(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),fl=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{"aria-label":t,label:mn({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),yn(n)]}))),xl=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(fl,{label:"Телефон",...ca(e(n),ra.phone,t?.required),disabled:t?.filledByEsia&&Ui(e,n),...t})})),yl=d((({field:e})=>ua(e("acquiringType")?.value?.key)?o(ll,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),bl=d((({field:e,source:t})=>o(Mn,{placeholder:"Выберите продукт",label:"Продукт",options:vl(t?.productList),...oa(e("product"),ra.product)}))),vl=e=>(e??[]).map((e=>({key:e,value:e}))),Nl=`${Ut}/regions`,wl=[];function Cl(e=Nl){const{data:t}=ba(e,Dt);return Array.isArray(t)?t:wl}const Sl=`${Ut}/outservice/outserviceregions`,kl=d((({field:e,input:t,params:n})=>{var a;const i=Cl((a=n?.typeForm,"OUTSERVICE"===a?Sl:void 0));return o(Mn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...ca(e("region"),ra.region,t?.required)})})),Il=d((({field:e,input:t})=>{const n=Sa(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Mn,{label:"Регион",placeholder:"Выберите регион",options:a,...ca(e("region"),ra.region,t?.required)})})),Tl=d((({field:e})=>{const t=e("secondaryPhone");return o(fl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?oa(t,ra.secondaryPhone):t})})),Rl=d((({field:e,input:t})=>o(Mn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ti,...ca(e("serviceDirection"),ra.serviceDirection,t?.required)}))),Bl=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ui(e,"surname"),...ca(e("surname"),ra.surname,t?.required),...t}))),Pl=["От 1 мес","До 15 лет"],Dl=d((({field:e})=>o(Ea,{title:"Срок, месяцев",items:Pl,min:1,max:180,...e("term")}))),_l=d((({field:e,input:t})=>o(Mn,{label:"Тип обслуживания",options:Ii,...ca(e("serviceType"),ra.serviceType,t?.required)}))),El={horizontal:"@lg:flex-row",vertical:""},Al=d((({label:e,items:t,value:n,className:a,onChange:i,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",El[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(xi,{isRadio:!0,text:t,value:n===e,onChange:()=>i&&i(e),disabled:l},String(e))))})]}))),Ml=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ol=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return i((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Al,{className:"whitespace-normal",orientation:"horizontal",items:Ml,value:t,onChange:e=>n&&n(e)})})}));const Fl={$ref:"/wcms-resources/outservice-productlist.json"},zl={fullName:e=>o(Pi,{...e}),addressBranch:e=>o(Ia,{...e}),desiredMeetingDate:e=>o(Si,{...e}),product:e=>o(bl,{...e,source:Fl}),localities:e=>o(tl,{...e}),isClient:e=>o(Ji,{...e}),partnerComments:e=>o(sl,{...e}),collectionCount:e=>o(ui,{...e}),acquiringType:e=>o(ma,{...e}),onlineCheckout:e=>o(rl,{...e}),posTerminal:e=>o(yl,{...e}),serviceType:e=>o(_l,{...e}),term:e=>o(Dl,{...e}),amount:e=>o(Fa,{...e}),annualRevenue:e=>o(za,{...e}),vedTypes:e=>o(Ol,{...e}),feedbackMethod:e=>o(Bi,{...e}),serviceDirection:e=>o(Rl,{...e}),bankEmpolee:e=>o(Va,{...e}),secondaryPhone:e=>o(Tl,{...e}),applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>ka(e?.params?.typeForm)?o(Il,{...e}):o(kl,{...e}),consentToReceiveMaterials:e=>o(Ci,{...e}),surname:e=>o(Bl,{...e}),name:e=>o(il,{...e}),middleName:e=>o(al,{...e}),birthday:e=>o(mi,{...e}),phone:e=>o(xl,{...e}),email:e=>o(ki,{...e}),inn:e=>o(Gi,{...e}),comment:e=>o(hi,{...e})},Vl=(e,t,n={})=>(a,i)=>{const l={...zl,...n};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:l[a?.name||""]?.({field:e,input:a,params:t})},String(i)):null},Ll=e=>2===e?"@xl:grid-cols-2":"",jl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ae,{size:"text-h6",children:e})}):null,$l=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block ","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})})));function ql({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Ul={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"},Wl={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Hl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(ql(e))}),{className:a,version:i="primary",active:l,disabled:r,isLoading:s,type:d="button",rounded:m=!0,role:h,onClick:p}=n(t);return c("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs relative",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r||s,"rounded-md":m},l||r||s?"":u(Ul[i],Wl[i]),a),type:d,role:h,onClick:p,children:[s?o($l,{blur:!0,size:"small"}):null,e]})})),Yl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Kl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Yl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Gl=d((({responseType:e,typeForm:t,onClose:n})=>{const a="OK"===e,i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:a?"Ваша заявка отправлена":"Не удалось отправить заявку",description:a?i:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Hl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Xl=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Jl=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${ua(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,u={...d,...Ql(o),...Zl(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Zl=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ql=e=>e?{vedTypes:Object.fromEntries(Ml.map((({id:t})=>[t,t===e])))}:{},er={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:da[0],serviceType:Ii[0],feedbackMethod:Ri[0],serviceDirection:Ti[0],vedTypes:Ml[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},tr=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ae,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Ae,{children:t.text})}):null]}))),nr=(e,t)=>o(Hl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),ar=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(xi,{...e}),o(tr,{link:t})]}),yn(oa(e,Gn).error)]}):o(tr,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),nr(n)]}),ir={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(a,g),...Kt(l,g),...Wt(i),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},lr=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||er[e.name||""]]))),typeForm:{key:t,text:""}}))(x,n),[b,v]=a(""),N=sn(Gl),C=l((async(e,t)=>{const a=rr(x,e),i=Xl(sa(a));if(!On(i(e)))return console.warn("validation fail");const l=Jl({...e,...h}),r=await ir.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&N.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return i((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Ll(e.columns),"grid gap-x-m"),children:[jl(e.title),(e?.inputs||[])?.map(Vl(S,{typeForm:n}))]},`section-${t}`))),ar(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),rr=(e,t)=>e.filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)})))),sr=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],or=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...ca(e(n),ra[n],t?.required),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),cr=d((({field:e,input:t})=>o(Xi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...ca(e("addressMatch"),ra.addressMatch,t?.required)}))),dr="/icons/MapMarkerClusterIcon.svg",mr="/icons/MapMarkerClusterYellowIcon.svg";function ur({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=hr("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=hr("workplaces",e,i),r=pr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=pr(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=pr(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const hr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?dr:mr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),pr=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?dr:mr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),gr={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},fr={...gr,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},xr=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(fr).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),yr=e=>globalThis[e];function br(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=yr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(yr(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(yr(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))})(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const vr={...gr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Nr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(vr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),wr=[55.753995,37.614069],Cr=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=br("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{r.current?ur({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Sr(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),ur({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o($l,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Nr,{yandexMaps:r}),o(Nr,{yandexMaps:r,direction:"out"})]}),xr(r,m,u("right-2 top-80",h))]})})),Sr=e=>{const t=[Ir(kr(e,0)),Ir(kr(e,1))];return t.every((e=>e))?t:wr},kr=(e,t)=>e.map((e=>e.coords?.[t])),Ir=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Tr=async(e,t,n)=>{try{return(await Rr(e,t,n)).json()}catch(e){return console.error(e),null}};async function Rr(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...Br()},credentials:"include",body:n?JSON.stringify(n):null})}const Br=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Pr=e=>Number(e.toString().replace(",",".")),Dr=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:i,renderFoldButton:r})=>{const[s,o]=a(n),d=l((()=>{o((e=>!e))}),[]),m=i({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const _r=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Er=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Ar({textItems:l,subText:t,children:n,isPhone:a,...i})})),Ar=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Mr(n,s),i?o(Ae,{color:a,size:"text-m",children:i}):null]}),Mr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ae,{size:"text-l",children:t?o("a",{href:`tel:${Or(e)}`,children:e.trim()}):e.trim()},String(n)))),Or=e=>e.replace(/\D/g,""),Fr=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),zr=e=>{const t=Lr(e);return o(Er,{label:"Режим работы",value:t,className:"max-w-none"})},Vr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Lr=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Vr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Vr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},jr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],$r=e=>jr.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),qr=e=>{if(!e)return null;const t=Ur(e);return c(Fr,{className:"border-none",children:[o(Er,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Wr)})}),o(Er,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]})},Ur=e=>{const t=jr.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Wr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Ae,{size:"text-xs",children:e})},String(n)),Hr=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Er,{label:"Валюта",value:e.currency}):null,t?o(Er,{label:"Купить",value:String(t)}):null,n?o(Er,{label:"Продать",value:String(n)}):null]},String(a)),Yr={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Kr=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",Yr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ae,{size:"text-m",color:Yr[n].text,children:t})]}))),Gr=(new Date).getDay(),Xr=e=>{const[t]=e?.slice(Gr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Kr,{color:"green",children:i}):null,n&&l?o(Kr,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Kr,{color:"red",children:"Выходной"})},Jr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Zr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(Er,{label:e,value:t&&n?n:"",subText:Jr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Qr=["ArrowDownIcon","ArrowUpIcon"],es=["Подробнее","Скрыть"],ts=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:es[Number(e)]}),o(W,{className:"text-primary-text",name:Qr[Number(e)],width:"16",height:"16"})]}),ns=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,as=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,is=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ls=({name:e,address:t,phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=$r(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ae,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),Xr(h)]}),o("div",{className:"hidden sm:block",children:rs({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:rs({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(u))},rs=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=$r(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Fr,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Er,{label:"Факс",value:t,isPhone:!0}),o(Er,{label:"Телефон филиала",value:e,isPhone:!0}),o(Er,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Er,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Er,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Er,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(Fr,{children:o(Er,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Zr)})})}):c(Fr,{children:[o(Er,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Wr)})}),zr(d)]}),r?.businessScheduleVisibleTag?qr(r?.businessScheduleDescription):null,s?.currencies?.length?o(Fr,{className:"flex-wrap",children:s?.currencies?.map(Hr)}):null]})},ss=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=$r(e),n=e?Lr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ns(n):is(n,a):as(n):""})(n)}`;return{header:a,body:l}},os={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},cs={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ds={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},ms=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ds[t](e)))))},us=()=>{},hs=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=us,getBalloonRemoteWorkplaces:i=us})=>{const[l,s,o,c]=r((()=>{const l=ms(e,n),r=ms(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},ps=e=>{const{data:t,error:n}=ba(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,gs);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},gs=async e=>await Pt(e,{method:"POST"})||[],fs=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),xs=d((({children:e})=>fs?e:null)),ys=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=ps("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await Tr("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Pr(e.latitude??wr[0]),gpsLongitude:Pr(e.longitude??wr[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=hs({data:n,filtrationState:{},getBalloon:ss}),u=Boolean(s?.key);return c("div",{children:[o(Mn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...ca(e("addressRetail"),ra.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(xs,{children:o(Cr,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),bs=zt((({field:e,source:t,fieldName:n,input:a,placeholder:i="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Mn,{placeholder:i,options:s,...ca(e(n),ra[n],a?.required),...r})})),vs=d((({field:e,input:t})=>{const{data:n}=ps("EMPLOYEES_NUMBER"),a=zi();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(bs,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Ns=d((({field:e,input:t})=>o(Xi,{text:"Наличие военного билета",...ca(e("armyIdFlg"),ra.armyIdFlg,t?.required)}))),ws=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...ca(e("bankEmployeeCode"),ra.bankEmployeeCode,t?.required),...t}))),Cs=d((({field:e,input:t})=>o(Xi,{text:"В отношении меня ведётся производство по делу о банкротстве",...ca(e("bankruptcyFlg"),ra.bankruptcyFlg,t?.required)}))),Ss=d((({field:e,input:t})=>o(di,{label:"Дата начала работы на текущем месте",...ca(e("beginDate"),ra.beginDate,t?.required),...t}))),ks=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...ca(e("birthPlace"),ra.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ui(e,"birthPlace")}))),Is=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Ts(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?Is(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const Rs=d((({field:e,input:t})=>{const[n,l]=a([]),[r]=Ts("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.key;return i((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await Tr("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Bs(e,s)||c&&c(null)})()}),[d]),o(bs,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Bs=(e,t)=>e.some((e=>e.key===t?.key)),Ps=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...ca(e("children"),ra.children,t?.required),...t}))),Ds=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...ca(e("codeWord"),ra.codeWord,t?.required),...t}))),_s=d((({field:e,input:t})=>{const{data:n}=ps("INCOME_CERT_UNITED");return o(bs,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Es=d((({field:e,input:t})=>{const{data:n}=ps("MILITARY_STATUS");return o(bs,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),As={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},Ms=d((({src:e,convertToPng:t,onClose:n,onDocumentRead:a})=>c(Kl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Hl,{className:"mx-auto mt-m",type:"button",onClick:()=>{a?.(),n?.()},children:"Ознакомиться"})]}))),Os=(e,t)=>{const{open:n}=sn(Ms),a=ke();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await Rr(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},Fs=d((({className:e,error:t,docId:n,...a})=>{const i=Os(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(xi,{...a}),n?o(Ne,{className:"text-primary-main",onClick:i,children:o(Ae,{children:"Ознакомиться"})}):null]}),yn(t)]})})),zs=d((({field:e,input:t})=>t&&t.name?o(Fs,{text:As[t.name]?.text,docId:As[t.name]?.docId,...ca(e(t.name),ra[t.name],t?.required)}):null)),Vs=Math.round(29.5),Ls=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),js="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",$s="flex flex-col lg:w-1/2 gap-2xl",qs="flex flex-col gap-y-xl min-w-52",Us=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Ae,{size:"text-h3",children:"number"==typeof e?[a,He(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Ws=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Ae,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Us,{value:n,...i}):o(Ae,{size:"text-h3",children:"-"})]}))),Hs=(e=[],t=!1)=>Ys([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Ys=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},Ks=(e,t=0)=>e?.sum?e.sum:t,Gs=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Xs=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Js=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Ea,{items:[`От ${Zs(e)}`,`До ${Zs(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Zs=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Qs=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:i,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(Al,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),eo=e=>Qs({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),to=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Ea,{items:e?[`От ${He(1)(a.min||0)} ${n}`,`До ${He(1)(a.max||0)} ${n}`]:[],step:t,...a}),no=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(Ra(t?.[i],n.minMonths,n.maxMonths))},ao=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},io=e=>e,lo=(e=io)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),ro=lo(),so=(e=io)=>lo((t=>-e(t))),oo=so(),co=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:mo([e,t],a),mo=([e,t],n=[])=>({[e]:n.length?oo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?ro(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),uo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],ho={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},po=e=>go({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&go({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&go({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&go({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),go=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],fo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[ho],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>po({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=co(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=co(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>po({row:e,userInputParams:t,paramsViewSettings:n})&&uo(a,["minSum","maxSum"],e)&&uo(i,["minMonths","maxMonths"],e)))||ho)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=ao(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},xo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),yo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},bo=zt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,Ys([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Ks(s,2e5),monthsValue:Gs(s,Vs),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});i((()=>{x&&d?.(g)}),[g,x]);const y=fo(g,n,r),b=eo({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return i((()=>{v&&v(Ra(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(Ra(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!xo(s)&&h&&no({field:f,defParams:h,calcParams:y,map:yo,monthsValue:"minMonths"})}),[n,s]),o(Ls,{className:e,title:t,...m,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Js({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),vo({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(qs,"@4xl:w-1/2"),children:[o(Ws,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ws,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Ws,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),$e(a,{isVertical:!0}),Xs(l)]})]})})})),vo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(xi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(xi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(xi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(xi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),No="calculator",wo=d((({field:e,params:t})=>{const n=l((t=>{e(No).onChange?.(t)}),[]);return o(bo,{...t?.calcData,padding:"p-0",defaultParams:So(e(No).value),onChange:n})})),Co={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},So=(e,t=!1)=>{const n=t?ko(Co):Co;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},ko=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Io=d((({field:e,input:t})=>{const{data:n}=ps("CREDIT_IN_RSHB");return o(bs,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),To=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Al,{label:mn({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),yn(a)]}))),Ro=[{id:"810",text:"Рубли"}],Bo=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency"),{data:i}=ps("CURRENCY"),l=i?.map((e=>({id:e.key,text:e.value})))??Ro;return o(To,{label:"Валюта",orientation:"horizontal",items:l,value:n,onChange:e=>a?.(e),...ca(e("currency"),ra.currency,t?.required)})})),Po=d((({field:e,input:t})=>o(di,{label:"Дата доставки",...ca(e("deliveryDate"),ra.deliveryDate,t?.required)}))),Do=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...ca(e("dependents"),ra.dependents,t?.required),...t}))),_o=d((({field:e,input:t})=>o(Xi,{text:"Являюсь инвалидом",...ca(e("disablePeopleFlg"),ra.disablePeopleFlg,t?.required)}))),Eo="dulIssueDateField",Ao=d((({field:e,input:t})=>o(di,{label:"Дата выдачи",...ca(e(Eo),ra.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ui(e,Eo)}))),Mo="dulIssuedBy",Oo=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,Mo),label:"Кем выдан",...t,...ca(e(Mo),ra.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),Fo=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ui(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...ca(e("dulNumber"),ra.dulNumber,t?.required)}))),zo=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ui(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...ca(e("dulSerie"),ra.dulSerie,t?.required)}))),Vo="dulSubdivisionCode",Lo=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,Vo),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...ca(e(Vo),ra.dulSubdivisionCode,t?.required),onDaDataChange:n})})),jo=d((({field:e,input:t})=>{const{data:n}=ps("EDUCATION_LEVEL");return o(bs,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),$o=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_ACTIVITY_TYPE"),a=zi();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(bs,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),qo=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_KIND"),a=zi();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(bs,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),Uo=d((({field:e,input:t})=>{const{data:n}=ps("EMPLOYMENT_INFO_UNITED");return o(bs,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Wo=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...ca(e("expenses"),ra.expenses,t?.required),...t}))),Ho="experience5Years",Yo=d((({field:e,input:t})=>{const n=l((t=>e(Ho)?.onChange?.(String(Ra(Number(t),0,5)))),[]);return o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...ca(e(Ho),ra[Ho],t?.required),...t,onChange:n})})),Ko=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,l="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return i((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Go=d((({field:e,input:t})=>{const{data:n}=ps("MARITAL_STATUS");return o(bs,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Xo=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...ca(e("generalSeniority"),ra.generalSeniority,t?.required),...t}))),Jo=d((({field:e,input:t})=>{const{data:n}=ps("HOUSE_TYPE");return o(bs,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Zo=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...ca(e("jobsNumber"),ra.jobsNumber,t?.required),...t}))),Qo=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...ca(e("lastJobExperience"),ra.lastJobExperience,t?.required),...t}))),ec=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...ca(e("legalEntityName"),ra.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),tc=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...ca(e("legalForm"),ra.legalForm,t?.required),...t}))),nc="limitedBirthday",ac=d((({field:e,input:t})=>o(di,{label:"Дата рождения",...ca(e(nc),ra.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ui(e,nc)}))),ic=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...ca(e("mandatoryPayments"),ra.mandatoryPayments,t?.required),...t}))),lc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],rc=d((({field:e,input:t})=>o(To,{orientation:"horizontal",items:lc,...ca(e("methodObtain"),ra.methodObtain,t?.required)}))),sc=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_TYPE"),a=zi();return i((()=>{n&&(a.organization=n)}),[n]),o(bs,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),oc=d((({field:e,input:t})=>{const n=zi(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Yi(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...ca(e("organizationName"),ra.organizationName,t?.required),onDaDataChange:a})})),cc=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...ca(e("otherIncome"),ra.otherIncome,t?.required),...t}))),dc=d((({field:e,input:t})=>o(di,{label:"Дата регистрации по месту жительства",...ca(e("participantDateRegistration"),ra.participantDateRegistration,t?.required)}))),mc="partInBusiness",uc=d((({field:e,input:t})=>{const n=l((t=>e(mc)?.onChange?.(String(Ra(Number(t),0,100)))),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...ca(e(mc),ra.partInBusiness,t?.required),...t,onChange:n})})),hc=e=>e.map((e=>({key:e.type,text:e.name}))),pc=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Ts("programId"),[c,d]=a([]);i((()=>{s&&(async()=>{const e=await(async e=>{const t=await Tr("/public-data/creditProgramConditions","POST",{creditProgramId:e});return hc(t?.paymentSystems||[])})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.key===e)))),[c,r]);return o(To,{label:"Платежная система",orientation:"horizontal",items:gc(c),...ca(e("paymentSystem"),ra.paymentSystem,t?.required),value:n?.key,onChange:m})})),gc=e=>e?.map((e=>({id:e.key,text:e.text})))??[],fc=d((({field:e,input:t})=>{const{data:n}=ps("POSITION");return o(bs,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),xc=d((({field:e,input:t})=>{const{data:n}=ps("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Mn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...ca(e("regionRetail"),ra.regionRetail,t?.required)})})),yc=d((({field:e,input:t})=>o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...ca(e("retirementIncome"),ra.retirementIncome,t?.required),...t}))),bc=["male","female"],vc=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Nc=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await Tr("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return bc.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(To,{label:"Пол",orientation:"horizontal",items:vc,...ca(e("sex"),ra.sex,t?.required)})})),wc=d((({field:e,input:t})=>o(Xi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...ca(e("shareholderFlg"),ra.shareholderFlg,t?.required)}))),Cc=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ya(e,"___-___-___ __")):t?.(Ya(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),Sc=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Cc,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),yn(a)]}))),kc=d((({field:e,input:t})=>o(Sc,{label:"СНИЛС",maxLength:14,...ca(e("snils"),ra.snils,t?.required),...t}))),Ic=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...ca(e("totalIncome"),ra.totalIncome,t?.required),...t}))),Tc=d((({field:e,input:t})=>o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...ca(e("wages"),ra.wages,t?.required),...t}))),Rc={limitedBirthday:e=>o(ac,{...e})},Bc={processPersonalDataFlg:e=>o(zs,{...e}),consentProviderFlg:e=>o(zs,{...e}),consentOthersFlg:e=>o(zs,{...e}),consentInformFlg:e=>o(zs,{...e}),consentPfrFlg:e=>o(zs,{...e})},Pc={organization:e=>o(sc,{...e}),organizationAddress:e=>o(Wi,{...e}),organizationPhone:e=>o(xl,{...e}),organizationName:e=>o(oc,{...e}),legalForm:e=>o(tc,{...e}),generalSeniority:e=>o(Xo,{...e}),lastJobExperience:e=>o(Qo,{...e}),experience5Years:e=>o(Yo,{...e}),jobsNumber:e=>o(Zo,{...e}),beginDate:e=>o(Ss,{...e}),addressFact:e=>o(or,{...e}),addressRegistration:e=>o(Wi,{...e}),addressRetail:e=>o(ys,{...e}),addressMatch:e=>o(cr,{...e}),sex:e=>o(Nc,{...e}),limitedBirthday:e=>o(ac,{...e}),birthPlace:e=>o(ks,{...e}),education:e=>o(jo,{...e}),housing:e=>o(Jo,{...e}),amountWorkers:e=>o(vs,{...e}),employment:e=>o(Uo,{...e}),employerActivities:e=>o($o,{...e}),employerOrganization:e=>o(qo,{...e}),positionOrganization:e=>o(fc,{...e}),familyStatus:e=>o(Go,{...e}),familyMembers:e=>o(Ko,{...e}),children:e=>o(Ps,{...e}),dependents:e=>o(Do,{...e}),totalIncome:e=>o(Ic,{...e}),expenses:e=>o(Wo,{...e}),snils:e=>o(kc,{...e}),conscription:e=>o(Es,{...e}),armyIdFlg:e=>o(Ns,{...e}),dulSerie:e=>o(zo,{...e}),dulNumber:e=>o(Fo,{...e}),dulIssueDateField:e=>o(Ao,{...e}),dulSubdivisionCode:e=>o(Lo,{...e}),dulIssuedBy:e=>o(Oo,{...e}),participantDateRegistration:e=>o(dc,{...e}),retirementIncome:e=>o(yc,{...e}),otherIncome:e=>o(cc,{...e}),wages:e=>o(Tc,{...e}),mandatoryPayments:e=>o(ic,{...e}),disablePeopleFlg:e=>o(_o,{...e}),bankruptcyFlg:e=>o(Cs,{...e}),shareholderFlg:e=>o(wc,{...e}),legalEntityName:e=>o(ec,{...e}),creditInRshbCd:e=>o(Io,{...e}),bankEmployeeCode:e=>o(ws,{...e}),partInBusiness:e=>o(uc,{...e}),regionRetail:e=>o(xc,{...e}),calculator:e=>o(wo,{...e})},Dc={addressCourier:e=>o(Wi,{...e}),paymentSystem:e=>o(pc,{...e}),currency:e=>o(Bo,{...e}),cardCategory:e=>o(Rs,{...e}),codeWord:e=>o(Ds,{...e}),confirmationIncome:e=>o(_s,{...e}),methodObtain:e=>o(rc,{...e}),deliveryDate:e=>o(Po,{...e})},_c=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(oa(t(e?.name),ra[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Dr,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:n})=>o(_r,{isUnfolded:n,className:"flex flex-col pl-2xl",children:e.map(Vl(t,{},Bc))}),renderFoldButton:Ec(c("div",{children:[o(xi,{value:a,onChange:n=>{for(const a of e){const e=t(a.name);e?.onChange&&e.onChange(n)}},text:"Согласие на все документы"},n),yn(i?"Отметьте все обязательные соглашения":"")]}))})})})),Ec=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Ac=({field:e,inputs:t})=>{const{consentInputs:n,restInputs:a}=Mc(t||[]);return n.length>2?c("div",{children:[a.map(Vl(e,{},{...Rc})),o(_c,{inputs:n,field:e})]}):(t||[])?.map(Vl(e,{},{...Rc}))},Mc=e=>({consentInputs:e?.filter((e=>Object.keys(As).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(As).includes(e.name||"")))||[]}),Oc=(e,t)=>o(Hl,{className:u("w-full @xl:w-auto"),type:"submit",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),Fc=e=>Rr("/user-data/updateUserProfile","PUT",e),zc=e=>Rr("/user-data/updateUserTask","PUT",e),Vc={width:"103",height:"21"},Lc={"bg-white":"color",transparent:"white"},jc={"bg-white":"text-primary-main",transparent:"text-white"},$c=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:Lc[e]},className:jc[e],width:n?.width,height:n?.height}),qc={"bg-white":"text-primary-text",transparent:"text-white"},Uc=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[$c(l,n?.image,Vc),r?a??o("div",{className:"ml-s",children:o(Ae,{font:"font-medium",color:qc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Wc=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),p=l((async()=>{const e=await(a={captchaText:d},Rr("/sms/checkCaptcha","POST",a).then((e=>e.text())).then((e=>"ERROR"!==e)));var a;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>Rr(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(g,[]),o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Uc,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(fn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Hl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Hl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Hc=d((({time:e,setTime:t,className:n})=>(i((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Yc(e)})))),Yc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Kc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Gc(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Gc=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!a)} rounded-md caret-transparent outline-none`},Xc=d((({isDisabled:e,onClick:t,text:n})=>o(Hl,{type:"button",onClick:t,disabled:e,children:o(Ae,{font:"font-normal",children:n})}))),Jc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Zc=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=on(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>Tr("/sms/checkCode","POST",e).then(Jc))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},Qc=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=a(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Zc({values:m,onSuccess:s}),w=sn(Wc),C=qt(e),S=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},Rr("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:S,onClose:d})}),[C,d]);return i((()=>{S()}),[]),o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Kc,{values:m,setValues:u,errorText:g,hasError:p}):null,td(x,b,S),c(_e,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),ed(y,h),f?o($l,{blur:!1}):null]})})})),ed=(e,t)=>o(Xc,{text:"Далее",isDisabled:e,onClick:t}),td=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Hc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),nd={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},ad={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},id=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],ld=d((({onSubmit:e=un,onClose:t=un})=>{const[n,i]=a(""),[r,s]=a(!1),d=Os(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),h=r?ad:nd;return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(Al,{className:"whitespace-normal",orientation:"horizontal",items:id,value:n,onChange:u}),o(Hl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),rd=d((({title:e,icon:t,description:n,onClick:a=un})=>c("button",{className:"flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ne,{image:{icon:t,iconVersion:"black"},width:"78",height:"78"}),c("div",{className:"w-full md:w-auto",children:[o(w,{className:"text-center md:text-left",title:e,headingType:"h5"}),n?o(C,{color:"text-secondary-text",size:"text-m",children:n}):null]})]}))),sd={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},od={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},cd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},dd=e=>Object.entries(e).reduce(((e,[t,n])=>t in sd?[...e,{contactTypeCd:{key:sd[t]},value:n}]:e),[]),md=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in od){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:od[t]},...a}]}return e}),[]),ud=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:hd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in cd?[...e,{incomeTypeCd:{key:cd[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},hd=(e,t)=>Number(e)+Number(t),pd={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},gd={...pd,amur_card:"14",owner_card:"13",travel_card:"15"},fd=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:hd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},xd=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},yd=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},bd=e=>e?.key?{key:e.key,text:e.value}:void 0,vd=d((function({task:e,isFromLead:t=!1,onClose:n=un}){const a=zi(),i=Jt(),{participants:r,creditProgram:s,id:d}=e,m=gd[s.code],u=Boolean(pd[s.code]),h=u?"/credit-lead":"/credit-card-lead",{name:p,midname:g,id:f,profile:x}=r[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:B,organizationTypeCd:P,organizationKindCd:D,employeesNumberCd:_,opf:E,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:F,positionCd:z,maritalStatusCd:V,childrenDependents:L,totalDependents:j,otherDependents:$,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,nameLegalEntity:G,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q}=t;return{currency:l?.key,paymentSystem:bd(i),cardCategory:bd(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDateField:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:bd(b),participantDateRegistration:v,housing:bd(N),beginDate:k,employment:bd(I),organizationName:T,inn:R,employerActivities:bd(B),organization:bd(P),employerOrganization:bd(D),amountWorkers:bd(_),legalForm:E,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:F?.toString(),positionOrganization:bd(z),familyStatus:bd(V),children:L?.toString(),familyMembers:j?.toString(),dependents:$?.toString(),conscription:bd(q),confirmationIncome:bd(Q),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,legalEntityName:G,creditInRshbCd:bd(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...fd(U),...xd(S),...yd(C),...(ee=w,ee?.key?{sex:"MAN"===ee.key?"male":"female"}:null)};var ee})(e);a.participantId=f,a.taskId=d,a.profileId=x?.id,a.programId=m,a.leadForm=t,i.assign(h)}),[]),b=l((()=>{i.assign(u?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]),v=l((()=>{i.assign("/")}),[]);return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:n,children:c("div",{className:"flex flex-col gap-lg mt-xs md:mt-0",children:[o(w,{className:"whitespace-pre-wrap text-center",title:`${p&&g?`${p} ${g}, `:""}мы нашли черновик вашей заявки.\nПродолжите заполнение?`,headingType:"h5"}),o(rd,{title:"Перейти к черновику",icon:"BankIcon",description:"Продолжайте заполнять заявку из черновика",onClick:y}),o(rd,{title:t?"Продолжить заполнение текущей заявки":"Заполнить новую заявку",icon:"DocIcon",onClick:t?n:b}),o(Hl,{type:"button",version:"secondary",className:"w-full text-h5",onClick:v,children:"Вернуться на главную"})]})})})),Nd=d((function({onClose:e=un}){const t=Jt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Hl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Hl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),wd=d((({onClose:e})=>{const t=Jt(),n=zi(),a=l((async()=>{const e=await(n={redirectUri:t.href},Tr("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),i=l((()=>{if(n.leadForm){const e={...n.leadForm};delete e.esiaAccountTypeCd,n.leadForm=e}e?.()}),[]);return o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex flex-wrap gap-lg w-full",children:[o(Hl,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(Hl,{type:"button",version:"secondary",onClick:i,children:"Пропустить"})]})]})})})),Cd=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},Sd=()=>Fi(),kd=({inputs:e,programId:t,nextStepLink:n})=>{const[i,r]=a(""),[s,{setTrue:o,setFalse:c}]=on(!1),d=(()=>{const e=Sd();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),m=(e=>{const{open:t}=sn(wd),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),u=(e=>{const{open:t}=sn(ld),n=sn(Qc),a=t=>async n=>{try{t&&await Fc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(m),h=sn(Qc),p=(()=>{const{open:e}=sn(vd),{open:t}=sn(Nd);return{open:({task:n,isFromLead:a,onClose:i})=>{n?e({task:n,isFromLead:a,onClose:i}):t({})}}})();return{handleSubmit:l((async n=>{const a=Xl(sa(e));var i;if(On(a(n)))try{o();const e=await(i={profile:{phone:qt(n.phone)}},Tr("/public-data/createUserProfile","POST",i).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const a=async()=>{await Td({programId:t,profileId:e,formData:n,saveUserData:d}),h.close(),u.open(n.phone,e)},i=async()=>{try{const n=await(async e=>{const t=await Tr("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:e,programId:t});if(n){const e=await(async e=>await Tr("/user-data/getTaskById","POST",e)||void 0)({taskId:n});h.close(),p.open({task:e,isFromLead:!0,onClose:a})}else await a()}catch{r("Fail")}},l=Id(n);h.open({phone:n?.phone,consents:l,onSuccess:i}),c()}}catch{r("Fail")}}),[]),responseStatus:i,isSending:s}},Id=e=>Object.keys(As).filter((t=>e[t])).map((e=>As[e]?.text)),Td=async({programId:e,profileId:t,formData:n,saveUserData:a})=>{const i=Rd(n);await Fc(((e,t)=>{const{name:n="",surname:a="",middleName:i="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:i,birthDate:l&&$t(l,!0),email:s,phone:qt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:l,participantId:r}=await(async e=>await Tr("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await zc((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&$t(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:dd({phone:o&&qt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:Cd()}}})({participantId:r,taskId:l,profileId:t,formData:i}))}catch(e){console.log(e)}a({participantId:r,taskId:l,profileId:t,programId:e,formData:n})},Rd=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Bd={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1},Pd=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,Bd[e.name||""]])))}},Dd=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:i,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:pl(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:_d(i),addressFact:_d(l),esiaAccountTypeCd:t?.esiaAccountType}},_d=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},Ed=(e,t)=>{const n=Jt(),[a,{setTrue:s,setFalse:o}]=on(!1),c=Sd(),d=l((e=>{const t=e instanceof Function?e(m[u]):e;null!=t?m[u]=t:delete m[u]}),[m=c,u="leadForm"]);var m,u;const h=r((()=>Pd(e,c.leadForm)),[e,c.leadForm]),p=l((async(e,a,i)=>{s();try{const r=await(l={profileId:e,code:a,state:i,redirectUri:globalThis.location?.href},Tr("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,...Dd(r)}))),n.assign(t)}finally{o()}var l}),[t]);return i((()=>{const e=Is(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),a=t.get("state");e&&n&&a?p(e,n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[h,{isLoading:a}]},Ad=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,...s})=>{const d=r((()=>sr?.flatMap((e=>e?.inputs))||[]),[sr]),[m,{isLoading:h}]=Ed(d,a),{handleSubmit:p,responseStatus:g,isSending:f}=kd({inputs:d,programId:n,nextStepLink:a}),[,{field:x,onSubmit:y}]=an(m,{onSubmit:p}),b=sn(Gl);return i((()=>{g&&b.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[h?o($l,{blur:!1}):null,sr.map(((e,t)=>c("div",{className:u(Ll(e.columns),"grid gap-x-m"),children:[jl(e.title),Ac({field:x,inputs:e?.inputs})]},`section-${t}`))),Oc(l,f)]})})})),Md=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Od=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Fd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),zd=10;function Vd(e=0){const t=Math.round(e*zd);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Ld=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Vd(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),jd=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],$d=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Ud(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?qd(c,v):{},...N?Fd(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(Ld,{className:u(m,i?jd[i-1]:"",{"h-full":N},t),style:w?qd(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),qd=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Ud=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Wd={"horizontal-list":"w-6","vertical-list":"h-6"},Hd=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Wd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Yd=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Kd=e=>t=>e.scrollWidth/t,Gd=e=>(t,n)=>{e.scrollBy({left:n*Kd(e)(t),behavior:"smooth"})},Xd=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[so()(i),lo()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Gd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Gd(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Jd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Zd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=Xd({itemCount:s.length}),g=Qd(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o($d,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Yd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Jd[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Hd({activeIndex:t,onClick:f,listType:a}))}):null})),Qd=(e=!1)=>({behavior:e?"auto":"smooth"}),em=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),tm=d((e=>o(em,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),nm=d((e=>o(em,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),am="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",im=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?lm(t):null,l?o(tm,{className:u(rm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(nm,{className:u(rm(i),m?"right-1":"right-0"),onClick:d}):null]})})),lm=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(am,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(am,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),rm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),sm=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Xd({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o($d,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(im,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Zd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),om=({blocksToRender:e,...t})=>o(sm,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Od(!0)),children:R(e,t)},String(n))})}),cm=e=>e%2!=0,dm=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:i="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===i?"justify-between":"justify-center",l),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),mm=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:i=!1,onClick:l})=>o(dm,{tag:"button",onClick:l,disabled:i,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",i?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Ae,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),um=({isUnfolded:e,onToggle:t})=>o(mm,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),hm=["ArrowDownIcon","ArrowUpIcon"],pm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",gm=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(pm),children:[P(l,{...i.options,parent:n}),cm(l.length)?o(Lt,{className:"col-span-6",...i}):null]}),o(Dr,{renderFoldableSection:({isUnfolded:e})=>c(_r,{className:u(pm),isUnfolded:e,children:[P(r,{...i.options,parent:n}),cm(r.length)?o(Lt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(mm,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:hm[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},fm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[xm(n,t),gm({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[xm(n,t),om({...a,blocksToRender:t})]});default:return null}})),xm=(e,t)=>e&&!t.length?o(Md,{...e}):null,ym=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),bm=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(ll,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),vm=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,ym(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Nm(a)).filter(Boolean))]}),n?o("div",{children:o(Hl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),Nm=e=>([t,n])=>{const a=n?.type;return"array"===a?wm(t,e)(n):null},wm=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(bm,{items:a,multiple:!n?.single,...t(e)})]},e)};function Cm(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const Sm=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,km=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>Sm(t[e])||Sm(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>Sm(t[e])||Sm(n[e])||Im(t[e])<=Im(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>Sm(t[e])||Sm(n[e])||Im(t[e]?.min)>=Im(n[e]?.min)&&Im(t[e]?.min)<=Im(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>Sm(t[e])||Sm(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>Sm(t[e])||Sm(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Im=e=>Number(e||0),Tm=(e,{block:t,page:n,normalize:a=nn})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Cm(i,i.map((e=>Mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=nn)=>e?.filter((([,e])=>km(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Rm={},Bm={},Pm=zt((({className:e,filtrationSchema:t=Rm,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Tm(Bm,{block:i.block,page:i.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:Dm(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>Dm(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(vm,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Hl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(fm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),Dm=e=>Cm(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),_m=(e=!1)=>e?"text-left":"text-center",Em={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Am=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:i,...l})=>{const r=String(a?.width||t);return i?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Em[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),Mm=d((({className:e="",title:t,benefitList:n,...a})=>{const i=ke();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:_m(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Om)}):null]})})),Om=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Am,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Ae,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(_e,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),Fm=(e,t,n)=>{return o(sm,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Ae,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Ae,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},zm=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?Fm(e,0,t):null]}))),Vm={start:"justify-start",center:"justify-center",end:"justify-end"},Lm=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Vm[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:$e(e)})})),jm=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Ae,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),$m=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),qm=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o(jm,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(Ws,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o($m,{title:e,...r}),Um={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Wm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Hm=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Um.prefMonthsNum,prefTravelBonusRate:l=Um.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Wm,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Ym=zt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Hm(r,n);return o(Ls,{className:e,title:t,...l,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),to({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?qm({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:qs,children:[f>=0?o(Ws,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,$e(a,{isVertical:!0}),Xs(i)]})]})})})),Km=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Gm=e=>Qs({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Xm=" (c капитализацией)",Jm=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:qs,children:[o(Ws,{title:`Доход в конце срока${l?Xm:""}`,value:e,postfix:n,prefix:"+"}),o(Ws,{title:`Сумма в конце срока${l?Xm:""}`,value:t,postfix:n}),$e(a,{isVertical:!0}),i?.map(Xs)]}),Zm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Qm={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},eu=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Zm[e?.rateType]:"",{data:n}=ba(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&tu(s,e)&&uo(a,["minSum","maxSum"],e)&&uo(n,["minDays","maxDays"],e)))||Qm,{rate:m}=d,u=nu(m,e),h=a+u,p=c||[Qm];return{...d,...mo(["minSum","maxSum"],p),...mo(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},tu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,nu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},au=zt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Ks(r,1e5),daysValue:Gs(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=eu(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Ls,{className:e,title:t,...d,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Ea,{items:[`От ${Km(b.min||0)}`,`До ${Km(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[iu(p,h),Gm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),qm({rate:x,depositeName:y,isShowDepositeName:l}),Jm({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),iu=(e,t)=>c("div",{className:"space-y-s",children:[o(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(xi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(xi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),lu=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},ru={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},su=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?du(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[cu({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),cu({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),cu({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),cu({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,uo(a,["minSum","maxSum"],t),uo(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||ru,{rate:u}=m,h=ou(u,e),p=a+h,g=t||[ru];return{...m,...mo(["minSum","maxSum"],g),...mo(["minMonths","maxMonths"],g),availableMonths:lu(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},ou=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},cu=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],du=(e,t)=>e+Math.round((t-e)/2),mu=(e="rub")=>"rub"===e,uu=(e,t)=>{const{minMonths:n,maxMonths:a}=mo(["minMonths","maxMonths"],fu(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ra(i,n,a)}},hu=(e,t)=>{const{minSum:n,maxSum:a}=mo(["minSum","maxSum"],fu(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ra(i,n,a)}},pu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),gu=e=>{const t=mu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},fu=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},xu=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Qs({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Qs({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),yu(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Gm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Qs({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),yu(e.isShowNewClient),e.isShowNewClient?o(xi,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},yu=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,bu={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},vu={text:"₽",key:"rub"},Nu=zt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[vu],g=l((e=>t=>e?{...t,...gu(t),...hu(t,e),...uu(t,e),...pu(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Ks(d,2e4),monthsValue:Gs(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:vu},{normalize:g}),y=x?.("currency")?.value??vu,b=x?.("isNewClient")?.value,v=fu(h,y),N=su(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{no({field:x,defParams:Hs(v,b),calcParams:N,monthsValue:"minMonths",map:bu})}),[x,h]);i((()=>{!xo(d)&&v&&I()}),[d,h]);const T=w===Hs(v,b)?.rate;return o(Ls,{className:e,title:t,...m,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[c("div",{className:"flex gap-m",children:[to({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:wu(y?.key)}),h&&h?.length>1?o(Mn,{label:"Валюта",options:p,...x("currency")}):null]}),Js({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),xu({...N,...s},x)]}),qm({rate:w,children:Su(I,T)}),Jm({income:C,finalSum:S,buttons:[...a,Cu(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),wu=(e="")=>mu(e)?1e3:100,Cu=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},Su=(e,t=!1)=>t?null:o(Hl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),ku=e=>Iu({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Iu({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Iu=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Tu={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Ru=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Tu],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>ku({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=co(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=co(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>ku({row:e,userInputParams:t,paramsViewSettings:n})&&uo(a+r,["minSum","maxSum"],e)&&uo(l,["minSumOld","maxSumOld"],e)&&uo(r,["minSumExtra","maxSumExtra"],e)&&uo(i,["minMonths","maxMonths"],e)))||Tu)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=ao(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Bu=zt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Ru(s,n,l),h=eo({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Ls,{className:e,title:t,...r,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),to({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Js({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Pu({...m,...l},d),m.isExtraMoney?to({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(qs,"@4xl:w-1/2"),children:[o(Ws,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ws,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Ws,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Ws,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),$e(a,{isVertical:!0}),Xs(i)]})]})})})),Pu=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(xi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(xi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(xi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),Du=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Ta(e,{normalize:(e=i)=>n&&a?String(Ra(Number(_u(e)),n,a)):_u(e),format:He(r)}),d=l((e=>t&&t(_u(e))),[t]);return o(fn,{onChange:d,...s,...c})})),_u=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Eu=d((e=>o(Du,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Au={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Mu={amount:1500},Ou=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Mu),[h,p]=a(!1);return i((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Au[r],children:[o(Eu,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Hl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Fu=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),zu="relative h-full",Vu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Lu=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(qu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...a,renderProps:(n,a,i)=>c("div",{className:ju(n,{someCardsHighlighted:l}),children:[R(n,a,{className:$u(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),qu(n)?Fu({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},ju=(e,{someCardsHighlighted:t})=>u(zu,t&&(qu(e)?"pt-3xl":"pt-3xl sm:pt-16")),$u=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(zu,"min-w-80",Vu[a],t&&(qu(e)?"pt-3xl sm:pt-16":"pt-3xl"),Od(n),n&&"h-full"),qu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Uu=zt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(sm,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Wu(s?.block?.blocks):[],hasBlur:!0,children:Lu({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Wu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Hu="z-10 border border-solid w-full h-full",Yu=u(Hu,"absolute hidden @xl:block border-transparent"),Ku=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Yu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Yu,"top-6 right-8 bg-green")}),o("div",{className:u(Yu,"top-3 right-4 bg-green-light")}),c("div",{className:u(Hu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),$e([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Gu={black:"bg-black",white:"bg-white"},Xu=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Re,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:$e([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Ju)]}):null,i?c(Ae,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Ju=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Gu[e]}`},String(t)),Zu=d((({icon:e,...t})=>{const n=pe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),Qu=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?eh(a):null]})}))),eh=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Zu,{...e},String(t))))}),th=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),nh=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=pe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(i),children:l})})),ah=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],ih=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>ah.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=je(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},lh(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:$e(m,{className:rh(s??!1,i??!1,n),buttonClassName:h})}),r?o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),lh=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",rh=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),sh=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(nh,{href:i,target:m,className:"h-full",data:th(v),children:c(Re,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe(je(l)?o(ne,{image:l}):null,x),buttons:d.length?o(ih,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(_e,{__html:s,isDotted:r,itemSize:"list-s"}):null,oh(a,p)]})})}))),oh=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,ch=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Ae,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:$e(i)}):null]},String(t))},dh=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(ch),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=a(!1);return i((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[je(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(Dr,{renderFoldableSection:()=>c("div",{children:[x,o(_r,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?mh(m?.parent,h,b):null}):o("div",{children:x})]})})),mh=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),uh=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Jt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await Rr("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},hh=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),ph=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(hh,{step:a,showPercentage:!1})]})})}));var gh;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION"}(gh||(gh={}));const fh=e=>Tr("/user-data/getTaskStatus","POST",e),xh=e=>Rr("/user-data/sendSignalToProcess","POST",e),yh=(e,t)=>{const n=s(null),a=l((()=>n.current&&clearInterval(n.current)),[]);return i((()=>(n.current=setInterval((()=>e(a)),t),a)),[e,t]),a},bh=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(_e,{__html:e}),a?.text?o(Ne,{className:"text-primary-main",children:a.text}):null]})]}))),vh=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:i})=>{const[l,r]=a(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Hc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(_e,{__html:i}):null]})]})})),Nh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(vh,{interval:d,intervalExpireAction:m}):null]}),o(wh,{title:a,items:i}),o(wh,{title:l,items:r,countColumns:!0}),n?.__html?o(bh,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),wh=({title:e,items:t,countColumns:n=!1})=>{const a=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Ll(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Ch(e)},t)))}):null]})]}):null},Ch=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Sh=d((()=>o(Nh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),kh=d((({handleExpireTimer:e})=>{const{statusInfo:t}=zi();return o(Nh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}]})})),Ih=d((()=>{const{statusInfo:e}=zi();return o(Nh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Th=d((()=>{const{statusInfo:e}=zi();return o(Nh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:Rh(e),buttonText:"Вернуться на главную"})})),Rh=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:$t(e?.deliveryDate)}]):t},Bh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ph=d((()=>{const[e,t]=a(gh.process),{taskId:n}=zi();i((()=>{(async()=>{for(const e of Bh)await xh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await fh({taskId:n});a&&a?.statusCd!==gh.process&&(e(),t(a.statusCd))}),[n]);yh(r,3e4);return Dh(e,(()=>t(gh.rework)))})),Dh=(e,t)=>({IN_PROCESS:o(kh,{handleExpireTimer:t}),CANCELLED:o(Sh,{}),FAILED:o(Sh,{}),DRAFT:o(Sh,{}),APPROVED:o(Th,{}),PRE_DECISION:o(Th,{}),REVISION:o(Ih,{})}[e]||o(Ih,{})),_h=e=>(t,n)=>t.filter((e=>e)).map((t=>[Eh(n,e),Ah(t,e),zh(t,e),Mh(t,e),Oh(t,e),Fh(t,e)].some(Boolean)?{...t,required:!1}:t)),Eh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ah=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Mh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Oh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Fh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),zh=({name:e},t)=>"snils"===e&&Vh(t),Vh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Lh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(bh,{__html:e},`${t}_${n}`))):null},jh=({field:e,inputs:t,params:n})=>t.map(Vl(e,n,{...Pc,...Dc})),$h=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=_h(qh(t))(e,n),o=s.filter((e=>!Fh(e,qh(t))));return c("div",{className:u(Ll(i),"grid gap-x-m"),children:[Lh(o),jl(l),jh({field:t,inputs:s,params:a})]},`section-${r}`)})),qh=e=>t=>e(t)?.value,Uh=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Hl,{onClick:n,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Hl,{isLoading:t,type:"submit",children:a?"Отправить заявку":"Далее"})]})})),Wh=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Hh=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Yh=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:$t(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:dd({organizationPhone:p&&qt(p)}),participantAddresses:md({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},Kh=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:$t(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:$t(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:$t(g,!0),houseTypeCd:f,participantContacts:dd({phone:qt(l),email:r}),participantAddresses:md({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Gh=e=>{const{methodObtain:t,deliveryDate:n=""}=e,a="courier"===t;return a?{courierDeliveryFlg:a,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"},office:{id:"3"}}:{};var i},Xh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Jh=(e,t)=>{switch(e){case 0:default:return{};case 1:return Kh(t);case 2:return Yh(t);case 3:return ud(t);case 4:return Wh(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:md({addressCourier:t})}:{}})(t)}},Zh=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Qh=e=>{try{return e?new Date(e):void 0}catch(e){return}},ep=({step:e,inputs:t,onNextStep:n,onFinish:a})=>{const[i,{setTrue:s,setFalse:o}]=on(!1),c=5===e,d=zi(),m=r((()=>((e,t)=>({...Zh[e],...t,limitedBirthday:Qh(t?.limitedBirthday),dulIssueDateField:Qh(t?.dulIssueDateField),participantDateRegistration:Qh(t?.participantDateRegistration),beginDate:Qh(t?.beginDate),deliveryDate:Qh(t?.deliveryDate)}))(e,d.leadForm)),[e,d.leadForm]),u=l((e=>{const{leadForm:t}=d;c&&e.ok&&t&&(d.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},d.leadForm=m)}),[c,m]),h=l((async i=>{const l=Xl(sa(_h(tp(i))(t,e)));if(On(l(i))){s(),d.leadForm=i;try{const{taskId:t,profileId:l,participantId:r}=d;if(t&&l&&r){const n=await zc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...Xh(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Jh(i,a)}],...Hh(a),...Gh(a)}}))({participantId:r,taskId:t,profileId:l,step:e,formData:i}));u(n)}n(),c&&a?.()}catch(e){}finally{o()}}}),[c,u]);return[m,h,i]},tp=e=>t=>e[t],np=d((({step:e,sections:t,isFormFinished:n,onPrevStep:a,onNextStep:i,onFinish:l})=>{const s=r((()=>t?.flatMap((e=>e?.inputs))||[]),[t]),[d,m,u]=ep({step:e,inputs:s,onNextStep:i,onFinish:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:m});return n?o(Ph,{}):c("form",{onSubmit:p,className:"space-y-m",children:[$h({sections:t,field:h,step:e}),o(Uh,{isSending:u,step:e,onPrevStep:a})]})})),ap=[[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"info",text:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"info",text:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}]],ip=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],...ap,[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],lp=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],rp=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(uh,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>ip[n]),[n]),[x,{setTrue:y}]=on(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(ph,{stepsTitles:lp,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(np,{step:n,sections:f,isFormFinished:x,onNextStep:h,onPrevStep:p,onFinish:y},String(n))})]})})})),sp=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(hh,{step:a,showPercentage:!1})]})})})),op=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(vh,{interval:d,intervalExpireAction:m}):null]}),o(cp,{title:a,items:i}),o(cp,{title:l,items:r,countColumns:!0}),n?.__html?o(bh,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),cp=({title:e,items:t,countColumns:n=!1})=>{const a=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Ll(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:dp(e)},t)))}):null]})]}):null},dp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),mp=d((()=>o(op,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),up=d((({handleExpireTimer:e})=>{const{statusInfo:t}=zi();return o(op,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),hp=d((()=>{const{statusInfo:e}=zi();return o(op,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),pp=d((()=>{const{statusInfo:e}=zi();return o(op,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),gp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],fp=d((()=>{const[e,t]=a(gh.process),{taskId:n}=zi();i((()=>{(async()=>{for(const e of gp)await xh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await fh({taskId:n});a&&a?.statusCd!==gh.process&&(e(),t(a.statusCd))}),[n]);yh(r,3e4);return xp(e,(()=>t(gh.rework)))})),xp=(e,t)=>({IN_PROCESS:o(up,{handleExpireTimer:t}),CANCELLED:o(mp,{}),FAILED:o(mp,{}),DRAFT:o(mp,{}),APPROVED:o(pp,{}),PRE_DECISION:o(pp,{}),REVISION:o(hp,{})}[e]||o(hp,{})),yp=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(bh,{__html:e},`${t}_${n}`))):null},bp=({field:e,inputs:t,params:n})=>t.map(Vl(e,n,{...Pc})),vp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=_h(Np(t))(e,n);return c("div",{className:u(Ll(i),"grid gap-x-m"),children:[yp(s),jl(l),bp({field:t,inputs:s,params:a})]},`section-${r}`)})),Np=e=>t=>e(t)?.value,wp=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Hl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Hl,{type:"submit",isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),Cp={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Sp=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Cp[a?"annuity":"differential"]}},kp=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Ip=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return Kh(t);case 2:return Yh(t);case 3:return ud(t);case 4:return Wh(t);default:return{}}},Tp=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Rp=e=>{try{return e?new Date(e):void 0}catch(e){return}},Bp=({step:e,inputs:t,onNextStep:n,onFinish:a})=>{const[i,{setTrue:s,setFalse:o}]=on(!1),c=5===e,d=zi(),m=r((()=>((e,t)=>({...Tp[e],...t,limitedBirthday:Rp(t?.limitedBirthday),dulIssueDateField:Rp(t?.dulIssueDateField),participantDateRegistration:Rp(t?.participantDateRegistration),beginDate:Rp(t?.beginDate),deliveryDate:Rp(t?.deliveryDate)}))(e,d.leadForm)),[e,d.leadForm]),u=l((e=>{const{leadForm:t}=d;c&&e.ok&&t&&(d.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity}},d.leadForm=m)}),[c,m]),h=l((async i=>{const l=Xl(sa(_h(Pp(i))(t,e)));if(On(l(i))){s(),d.leadForm=i;try{const{taskId:t,profileId:l,participantId:r}=d;if(t&&l&&r){const n=await zc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Ip(i,a)}],...Sp(a),...kp(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:r,taskId:t,profileId:l,step:e,formData:i}));u(n)}n(),c&&a?.()}catch(e){}finally{o()}}}),[c,u]);return[m,h,i]},Pp=e=>t=>e[t],Dp=d((({step:e,sections:t,isFormFinished:n,programsSource:a,onPrevStep:i,onNextStep:l,onFinish:s})=>{const{programId:d}=zi(),m=a?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs))||[]),[t]),[h,p,g]=Bp({step:e,inputs:u,onNextStep:l,onFinish:s}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:p});return n?o(fp,{}):c("form",{onSubmit:x,className:"space-y-m",children:[vp({sections:t,field:f,step:e,params:{calcData:m}}),o(wp,{step:e,isSending:g,onPrevStep:i})]})})),_p=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],...ap,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"info",text:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Ep=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Ap=zt((({className:e,programsSource:t,...n})=>{const[d,m]=a(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);i(uh,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>_p[d]),[d]),y=0===d,[b,{setTrue:v}]=on(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(sp,{stepsTitles:Ep,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Dp,{step:d,sections:x,isFormFinished:b,programsSource:t,onNextStep:p,onPrevStep:f,onFinish:v},String(d))})]})})})),Mp=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Op=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Fp=1e9,zp={sum:{min:1e4,max:Fp},period:3},Vp=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Tm(zp,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Lp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=jp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(vm,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Eu,{label:a?.title,min:500,max:Fp,...d("sum",{parse:e=>({min:Number(e),max:Fp}),format:({min:e})=>String(e)})}),o(Ea,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(fm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Lp=e=>_t((e?.paramsSource?.rateRows||[]).filter(Mp).flatMap((e=>Op(e.minMonths,e.maxMonths)))),jp=e=>_t(e.flatMap((e=>e||[])).filter(Mp).flatMap((e=>Op(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],$p=[{key:"10"},{key:"50"},{key:"100"}],qp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:$p,iconVersion:"black"})]})},Up="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",Wp=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:Up,"aria-label":`Страница ${l}`,children:l},String(t)):null},Hp={width:"24",height:"24"},Yp=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Kp(1===e),...Hp})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Up,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(Wp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Up,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Kp(e===n),...Hp})})]})},Kp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Gp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Yp,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(qp,{itemCount:a,onItemCountChange:i}):null]}),Xp=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Jp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Xp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(ci,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(ci,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Hl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Zp=(e,t)=>o(Am,{...e,iconBgVersion:t,className:"shrink-0"}),Qp=d((({title:e,timestamp:t,publicId:n})=>{const a=pe(),{href:i}=a({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[Zp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Ae,{size:"text-m","font-weight":"font-light",children:$t(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),eg=`${Ut}/depository`,tg={startDate:void 0,endDate:void 0,query:""},ng=zt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=an(tg),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?$t(a,!0):"",r=i?$t(i,!0):"",s=new URLSearchParams(eg);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=ba(eg+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Jp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Qp,{...e},String(e.publicId)))):o(Md,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Gp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),ag=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,ig=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:ag(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ne,{version:i?.version,text:i?.text,...i}):null]}))),lg=`${Ut}/region`;function rg(e="Москва"){return Fi().location??{name:e}}function sg(e="Москва"){const t=Fi(),n=l((async()=>{if(!t.location){const n=await Pt(lg);t.location=n??{name:e}}}),[t,e]);return ba(lg,n),t}var og;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(og||(og={}));const cg=new Intl.NumberFormat("ru",{style:"currency",currency:og.RUB}),dg=e=>e?cg.format(e):"",mg="text-m font-light text-secondary-text ",ug=`${mg} text-left`,hg=`${mg} pl-5xl text-center`,pg=`${mg} pl-5xl text-right`,gg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},fg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:ug,children:o(Ae,{size:"text-m",children:"Валюта"})}),o("th",{className:hg,children:o(Ae,{size:"text-m",children:"Купить"})}),o("th",{className:pg,children:o(Ae,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(xg)})]}))),xg=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:gg[t]},width:"24",height:"24"}):null,o(Ae,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ae,{size:"text-h6",children:dg(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ae,{size:"text-h6",children:dg(e?.buyExchangeRate)})})]},t)},yg={icon:"GpsIcon"},bg=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Am,{...yg,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),vg=(e,t,n)=>{const a=Number(Ng(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},Ng=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function wg(e){if(!e)throw new Error("Value should be fulfilled");return e}const Cg=e=>t=>{const[,n]=wg(e.find((([e])=>e(t))));return n(t)},Sg=e=>Cg(e.map((([e,t])=>[e,()=>t])));Sg.if=e=>new kg(void 0,e);class kg{parent;predicate;unit;get entry(){return[wg(this.predicate),wg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new kg(this,e)}then(e){return new kg(this.parent,this.predicate,e)}else(e){return Cg([...Ig(this),[()=>!0,e]])}}const Ig=e=>[...e?.parent?Ig(e.parent):[],e.entry],Tg=e=>Sg([[e=>e.value!==og.RUB&&e.oppositeValue!==og.RUB,()=>e.handleConvert(e.value,og.RUB)],[e=>e.value===og.RUB&&e.oppositeValue===og.RUB,()=>e.handleConvert(e.value,og.USD)],[e=>e.value===og.RUB&&e.oppositeValue===og.RUB,()=>e.handleConvert(e.value,og.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Rg(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(fn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Bg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||og.RUB,selectBuy:n?.[0]?.currency?.currency||og.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Rg({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Pg(r,d,n),value:r.inputSell,setValue:e=>_g(d,n)(e,r.selectSell,r.selectBuy)}),Rg({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Dg(r,d,t),value:r.inputBuy,setValue:e=>Eg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ne,{text:i.text,version:i?.version,...i}):null]})})),Pg=(e,t,n)=>a=>{t({selectSell:a}),Tg({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{_g(t,n)(e.inputSell,a,i)}})},Dg=(e,t,n)=>a=>{t({selectBuy:a}),Tg({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Eg(t,n)(e.inputBuy,a,i)})},_g=(e,t)=>(n,a,i)=>{e({inputSell:Ng(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(vg(n,l,a===og.RUB)||"")})},Eg=(e,t)=>(n,a,i)=>{e({inputBuy:Ng(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(vg(n,l,a===og.RUB)||"")})},Ag=`${Ut}/exchangerates`;const Mg=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=ba(Ag+`?regionCode=${t}`,Dt);return n||{}}(rg()),l=Og(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:og.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:og.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Re,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(fg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(bg,{address:i?.address})]}),o(Bg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Og=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Fg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(zg(n))})})),zg=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:i||null})},String(a)):null},Vg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:i})=>o(dm,{tag:"button",className:u("border-none bg-transparent items-center group/button",i?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Zp(i,t),e?o(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Lg=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",jg=(e=!1)=>e?"MinusIcon":"PlusIcon",$g=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",qg=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:i,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Dr,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(_r,{className:u("gap-lg",Lg(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Ug({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Ug=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:i,onToggle:l,isMobile:r=!1})=>{const s=t||(i?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?$g(e):jg(e))(i,r);return"accordion"===e?o(Vg,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(mm,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Wg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Hg(e)}))),Hg=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(qg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Fg,{items:e.items}):null},String(t)))),Yg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Kg)}):null)),Kg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Gg)})]},String(t)),Gg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Xg(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Xg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Jg(t)}`,children:o(Ae,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Jg=e=>e.replaceAll(/\D/g,""),Zg=d((({className:e="",index:t,text:n,...a})=>{const i=pe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Qg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ae,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Zg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),ef=d((({className:e="",index:t,...n})=>{const a=pe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),tf=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(ef,{index:t,...e},String(t))))}):null]}))),nf=zt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(Wg,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Yg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(ih,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Qg,{title:d,links:l}),o(tf,{links:i,license:h})]})})),af=zt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Mn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:th(l,s?.key),children:f})}):null]})})})),lf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},rf=d((({version:e,text:t,mobileText:n,...a})=>{const i=ke()?n:t;return i?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",lf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),sf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=_(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Uc,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):of(p,r),o(rf,{version:i,...a})]})})),of=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,cf={"bg-white":"primary",transparent:"transparent"},df=zt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=cf[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(sf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),mf=(e=!1)=>e?{}:{padding:"p-0"},uf={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},hf=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=_();return o(g,{className:u("relative flex flex-col",uf[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",Od(r)),...mf(a)}})})}),{childrenTypes:[]}),pf=zt((e=>o(hf,{...e})),{childrenTypes:[]}),gf=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Vm[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),ff=["байт","Кб","Мб","Гб","Тб","Пб"],xf=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...fe(l),children:[e,t?c(Ae,{size:"text-l",font:"font-light",children:[t," ",yf(d,m),o(Ae,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),yf=(e,t)=>e||t?o("span",{children:", "}):"",bf=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${ff[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Nf(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(xf,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:vf(t),data:n?.data}),o(_e,{__html:n?.__html})]},String(a))},vf=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,Nf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},wf=d((({href:e,__html:t,target:n,onClose:a})=>{const i=_(),l=q(i)(e);return c(Kl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(_e,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:a}),o(Hl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Cf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=sn(wf),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[vf(i),o(Ae,{font:"font-light",children:e})]}):null})),Sf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},kf=zt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=_();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Sf[r]),role:"list",children:i.map(If(d,l))}):null]})})),If=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?Tf(t)(n,a):bf(e,t)(n,a)},Tf=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Cf,{...a,icon:e,href:Rf(t)?t?.href:t?.attachment?.src}),o(_e,{__html:t?.__html})]},String(n)):null},Rf=e=>"href"in e,Bf=zt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Re,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:$e(a,{className:"flex-wrap"}),children:[i?o(Ae,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(_e,{__html:r,itemSize:"list-m"}):null,o(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),Pf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Df=(e=[],t={})=>e.filter((({content:e={}})=>km(t,e))).length,_f=(e,t)=>e===t;const Ef=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(_f,((e=_f)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),Af=[],Mf={},Of={primary:"bg-white/30",secondary:"bg-main-divider"},Ff={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},zf=d((({count:e,version:t="secondary"})=>{const n=ke(),a=n?"bg-main-divider":Of[t],i=Ff[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Ae,{size:"text-xs",color:i,children:e})})})),Vf=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},Lf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},jf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},$f={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},qf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},Uf=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",Lf[a],n?qf[a]:$f[a]),role:"tablist","aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?jf[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Vf({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(zf,{count:m,version:Pf(n,a)})}):null]})})})),Wf=d((e=>o(e?.item?.href?Hf:Yf,{...e}))),Hf=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o(Uf,{...e,tag:"a",item:i,onClick:a})})),Yf=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o(Uf,{item:e,onClick:a,...n})})),Kf=(e,t,n)=>(a,i)=>o(Wf,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Gf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Kf(a,i,t))}))),Xf={categories:[],extraOptions:[],propertyType:[],stage:[]},Jf=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Tm(Xf,{block:i.block,page:i.options?.page}),f=l(((e=Xf)=>p(e)),[]),x=(({hotFilters:e=Af,filtrationState:t=Mf,blocks:n=Af,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Ef(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Df(n,t.filter),version:Pf(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Gf,{...x}),o(vm,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(fm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Zf=(e,t,n)=>{const a=Pf("all"===t),i=Pf("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Hl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(Hl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},Qf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(_e,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,ex="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",tx=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(xi,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Dr,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:ex,children:s}),o(_r,{className:ex,isUnfolded:e,children:d})]}),renderFoldButton:nx(n,a)})}):null})},nx=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:ax()})]}),ax=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),ix=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Ae,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),lx=()=>{},rx=e=>"all"===e?"block":"hidden",sx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=lx,renderRemoteWorkplaceCard:r=lx,getBalloon:s=lx,getBalloonRemoteWorkplaces:d=lx,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(os),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=hs({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),S={filters:ox([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:cs};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[ix(h,N),m?Qf(m):null,p&&Zf(t,w,C),o("div",{className:u("pb-3xl",rx(w)),children:tx(S)})]}),o("div",{className:"h-[600px]",children:o(xs,{children:o(Cr,{points:b,isLoad:n,className:"h-full"})})})]}),c(xs,{children:[y.map(l),v.map(r)]})]})})),ox=e=>Object.keys(os).filter((t=>e.filter((e=>ds[t](e))).length)),cx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:ux(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ae,{size:"text-h4",children:ux(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Kr,{color:"green",children:ux(s)})})]}),o("div",{className:"hidden sm:block",children:o(Fr,{className:"flex-wrap",children:m?.map(mx)})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:o(Fr,{className:"flex-wrap",children:m?.map(mx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(d))},dx=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${ux(t)} №${n}`,body:e.toUpperCase()}),mx=(e,t)=>o(Er,{...e},String(t)),ux=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",hx=[];const px=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:hx},gx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},fx={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},xx=d((({descriptionData:e,className:t})=>{const n=rg(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=ba(`${Ut}/atms?regionCode=${e}`,px);return{data:t||hx,isLoad:!t&&!n}}(a);return o(sx,{className:t,filterItems:yx,data:i,isLoad:l,initFilterState:gx,renderCard:cx,getBalloon:dx,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),yx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>fx[t](e))),n=!a.length||a.some((t=>fx[t](e)));return t&&n}))},bx=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ae,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:vx({workScheduleDescription:t})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:vx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(n)):null,vx=({workScheduleDescription:e})=>c("div",{children:[c(Fr,{className:"flex",children:[o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание банковских карт"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Инвестиционное и накопительное страхование"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Er,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]}),Nx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),wx={branches:[],remoteWorkplaces:[]};const Cx=async e=>await Pt(e,{method:"GET"})||wx,Sx=d((({className:e})=>{const t=rg(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=ba(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Cx);return{data:t||wx,isLoad:!t&&!n}}(n);return o(sx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ls,renderRemoteWorkplaceCard:bx,getBalloon:ss,getBalloonRemoteWorkplaces:Nx,title:`Офисы филиала ${t?.name}`})})),kx=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(Sx,{}):o(xx,{descriptionData:e})})})),Ix=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Tx=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(sm,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Ze,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),Rx=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[je(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Bx({__html:l,richVersion:r}):null,Px({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Px({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Px({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?$e([a]):null]})]}))),Bx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(_e,{...e,itemSize:"list-s"})}),Px=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ae,{size:"text-xl",color:a,children:t})]})]}):null,Dx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(_e,{__html:t,richVersion:n})})})),_x=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),gi,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Ae,{color:"text-primary-text",children:t}):null]})}))),Ex=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(_x,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(_x,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),Ax=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(Dn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),Mx=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ox=["От 1 дня","До 365 дней"],Fx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Ea,{min:1,max:365,value:e,items:Ox,onChange:t})]}))),zx=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Ax,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Vx=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Mx,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:Lx(m)}),o(Fx,{days:i,setDays:e=>m({days:e})}),o(zx,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:jx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Ex,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Lx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},jx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},$x=d((({days:e,tariffs:t=[]})=>{const n=Ux(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[qx("Аренда за",e),qx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),qx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),Ux=(e,t)=>{const n=Wx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Wx=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Hx=(e,t)=>e.find((e=>e.branchCode===t)),Yx=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Hx(a,n.selectedBranch),d=Kx(s?.safeBoxCaseVolumes),m=Gx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Xx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Vx,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o($x,{days:n.days,tariffs:u})]})})),Kx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Gx=(e,t)=>e?.find((e=>e.volume===t)),Xx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Jx=`${Ut}/safeboxes`,Zx=[];const Qx=async e=>await Pt(e,{method:"GET"})||Zx,ey=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Cl(),p=ty(m.selectedRegion,h),f=function(e){const{data:t}=ba(e?`${Jx}?regionCode=${e}`:null,Qx);return t||Zx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Hx(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Yx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Cr,{points:y,className:"h-[640px]"}):null]})})),ty=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,ny={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},ay=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:iy(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[ly(a),l?.text?o(Ne,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},iy=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=ry(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:sy({step:n,iconVersion:i,i:a,stepVersion:t})})})},ly=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",ny.description),children:e.description}):null,o(_e,{__html:e.__html})]}),ry=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",sy=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return je(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?ny.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},oy=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(ay(d,r,l))}):null,$e(i,{isVertical:!0})]})})),cy=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),dy=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Yl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function my(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const uy=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return my(ue.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},hy=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const py=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(gy,{...e},String(t))))})]}):null,gy=d((({icon:e,...t})=>{const n=pe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),fy=(e,t)=>n=>n.name?o(nh,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:th(e,n.name),children:o(Ae,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,xy=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(hn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),yy=d((({defaultLocation:e})=>{const t=rg(e),n=pe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(nh,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),by=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=sg(t?.default),[s,d]=a(""),m=Cl(),u=r((()=>Ny(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,vy)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Kl,{className:"pb-20",head:c("div",{children:[o(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(yy,{defaultLocation:t?.default}),o(xy,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&hy(e.toLowerCase())(s.toLowerCase())>=.8)).map(fy(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ae,{size:"text-h6",children:e})}),t.map(fy(f,g))]},e)))}),py(e)]});var g,f})),vy=e=>e.name?.charAt(0)??"",Ny=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),wy=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=sn(by,n),{name:r}=rg(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(dy,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Cy="burgerMenuDialog",Sy=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=un})=>{const{open:i}=sn(wy),[r]=uy(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Cy,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Cy})),[e,n,t,a]);return[s,{toggle:s?a:o}]},ky=[],Iy=zt((({sticky:e,...t})=>{const{menuItems:n=ky}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=he(),b=l((()=>{p(-1),x(""),y()}),[y]),v=dn(b),N=s(null),[C,{toggle:S}]=Sy({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=he(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(dy,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Ty(T,"left",{activeIndex:h,currentItemPosition:f})),o(cy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(Ty(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Ty=(e,t,n)=>(a,i,l)=>o(cy,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),Ry="hidden sm:flex absolute z-40",By={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Py=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Xd({itemCount:t?.length||0});return i((()=>Dy(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o($d,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:By[l].item,gap:By[l].gap,children:t.map(Kf(n,a,l))}),s.canScrollLeft?o(tm,{className:u("left-6",Ry,By[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(nm,{className:u("right-6",Ry,By[l].buttonTop),onClick:s.scrollRight}):null]})})),Dy=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},_y={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Ey=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(_y[t].wrapper,e),children:o(Py,{className:_y[t].component,tabsType:t,...n})}):null,Ay=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=My(n??{}),p=_(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(zy(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=Fy(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[Ey({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Oy(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Fy)?.filter(Boolean)||[]}),My=({__id:e,anchor:t})=>t??e??"tabs",Oy=(e,t)=>t?.length?t:e,Fy=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",zy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Vy={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Ly=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Vy[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),jy=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),$y={Buttons:({buttons:e})=>$e(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(_e,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ae,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Ae,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(jy,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},qy=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return Uy({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Uy=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in $y))return null;return o($y[n],{...t,...a})},Wy=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(qy,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Hy=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Yy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Ky=d((({rows:e})=>{return o($d,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Ae,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Hy(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ae,{size:"text-xl",children:e.data}):null,e?.cols?Yy(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Gy=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Ae,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Ky,{rows:t.rowsData})})})]},a)}))}))),Xy=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Jy=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Ae,{size:"text-xl",font:"font-light",color:Xy(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Zy=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Jy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Gy,{activeTabIndex:r,items:m}),o(jy,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ae,{size:"text-h6",children:"Данных нет"}),o(jy,{onClick:n,isOpen:!0})]})})),Qy=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Zy,{...t,onClick:n})}):null]}))),eb=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Qy,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Ly,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Wy,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function tb({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(em,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(em,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const nb=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,tb({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),ab=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(eb,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(Dr,{renderFoldableSection:({isUnfolded:e})=>c(nb,{controls:x,children:[b,o(_r,{isUnfolded:e,children:v})]}),renderFoldButton:um}):o(nb,{controls:x,children:y})})]})})),ib=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?lb():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?rb(n):null,i?o(_e,{richVersion:l,__html:i}):null]})]}))),lb=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),rb=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),sb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:n})}):null]}))),ob=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(sb,{prefix:t,unit:n,suffix:a})})})),cb={AdTile:Lt,ApplicationForm:lr,ApplicationLeadForm:Ad,BankAccountFiltration:Pm,BenefitsBlock:Mm,BonusBenefitsBlock:zm,ButtonsBlock:Lm,CalculatorBonus:Ym,CalculatorBusinessDeposit:au,CalculatorCredit:bo,CalculatorDeposit:Nu,CalculatorRefinancing:Bu,CardTransfer:Ou,Carousel:Uu,CarouselCard:Ku,CarouselCatalogCard:Xu,CarouselLinks:Qu,CarouselRecommendationCard:sh,CarouselTariffsCard:dh,CreditCardForm:rp,CreditForm:Ap,DepositFiltration:Vp,Depository:ng,ErrorBlock:ig,ExchangeRateTile:Mg,Footer:nf,GrantSupport:af,Header:df,Headline:k,HorizontalLayout:pf,ImgBlock:gf,LinkDocs:kf,MobileAppTile:Bf,MortgageFiltration:Jf,OfficesAtmsMap:kx,Placeholder:Ix,ProductBlock:Vt,ProductGallery:Tx,RepresentativeOfficeInfo:Rx,RichTextBlock:Dx,RollupItem:qg,SafeDepositRental:ey,StepsBlock:oy,StickyBottomMenu:Iy,TabsLayout:Ay,TariffsTable:ab,TextBlock:ib,UnitBlock:ob,VerticalLayout:hf},db=ce((()=>{i((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const mb="cookie",ub=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=on();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(mb)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(mb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(_e,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Yl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function hb(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const pb=d((()=>{const[e,{close:t}]=uy(),n=Boolean(e.length);return hb(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),gb=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return my(ue.observable,"popup",{open:t,close:n}),hb(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),fb="header",xb="footer",yb="sticky-footer",bb={},vb=d((({className:e,data:t=bb,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ot(s,r);db(),sg();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[fb]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(i?.[fb],{...m,slotName:fb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(i?.[xb],{...m,slotName:xb})]})]}),i?.[yb]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(i?.[yb],{...m,slotName:yb})}):null,o(pb,{}),o(gb,{}),o(ub,{__html:d?.cookieContent?.__html})]})}));Object.assign(vb,{childrenTypes:[],slots:()=>[fb,xb,yb]});e.Blocks=cb,e.ContentPage=vb,e.handlerDecorator=ce,e.joinList=ym,e.locationNavigator=Jt,e.packageVersion="0.14.730",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=_,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),a=n("useState"),i=n("useEffect"),l=n("useCallback"),r=n("useMemo"),s=n("useRef"),o=(...e)=>globalThis._uni._jsx(...e),c=(...e)=>globalThis._uni._jsxs(...e),d=e=>{const t=e;return t._tmpl||(t._tmpl=globalThis.__UNI_REACT__?e:m(e)),t._tmpl},m=e=>{function t(t,n){const{children:a,...i}=t||{},l=n?.slots?.default,r=a||l&&l();return e(Object.assign(i,r&&{children:r}),n)}return t.inheritAttrs=!1,t},u=(...e)=>e.map((e=>h(e)?Object.entries(e).filter((([,e])=>e)).map((([e])=>e)):e)).flatMap((e=>e)).filter(Boolean).join(" "),h=e=>Boolean(e&&"object"==typeof e&&!Array.isArray(e)),p={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","":""},g=d((({className:e,version:t="primary",isTheme:n=!0,defaultPadding:a="p-xl",padding:i,block:l,tag:r="section",role:s,children:c,style:d})=>{const m=t&&n;return o(r,{className:u("@container font-sans",{group:m},p[t],i||a,e),...m?{"data-ver":t}:{},...l?.anchor?{id:l.anchor}:{},role:s,style:d,children:c})})),f=d((({className:e,size:t})=>o("figure",{className:u("m-0 mt-xl min-w-[80%]",e),children:x(t)}))),x=(e=3)=>b(100,e).map((e=>Math.floor(e))).map(y),y=(e,t)=>o("div",{style:{width:`${e||100}%`},className:"h-4 mt-xs bg-secondary-dark relative overflow-hidden animate-pulse"},String(t)),b=(e,t)=>[e].concat(t>0?b(e/1.618,t-1):[]),v={h1:"h1",h2:"h1",h3:"h2",h4:"h2",h5:"h3",h6:"h3"},N={h0:"text-h0",h1:"text-h1",h2:"text-h2",h3:"text-h3",h4:"text-h4",h5:"text-h5",h6:"text-h6"},w=d((({className:e="",headingType:t="h3",as:n="h3",title:a,children:i})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:a||i})})),C=d((({children:e,...t})=>o("p",{className:u("font-sans",Object.values(t)),children:e}))),S={XXL:{title:{headingType:"h0",as:"h1"},descriptionSize:"text-h5",descriptionWeight:"font-normal",descriptionStyle:"mt-xl"},XL:{title:{headingType:"h1",as:"h1"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},L:{title:{headingType:"h2",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-m"},M:{title:{headingType:"h3",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-s"},S:{title:{headingType:"h4",as:"h2"},descriptionSize:"text-xl",descriptionWeight:"font-light",descriptionStyle:"mt-xs"},XS:{title:{headingType:"h5",as:"h2"},descriptionSize:"text-m",descriptionWeight:"font-light",descriptionStyle:"mt-xs"}},k=d((({className:e,version:t="",headlineVersion:n="XL",title:a,description:i,align:l="text-center",as:r,isEmbedded:s=!1,isTheme:d=!1,...m})=>{const h=S[n],p={marginTop:h.descriptionStyle};return c(g,{className:u({"@container-normal":s},e),defaultPadding:s?"":"p-6xl",version:t,isTheme:d,...m,children:[a?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:a}):null,i?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:i}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function R(e,t,{className:n,...a}={}){const{key:i,blockDecorator:l=I,blocksRegistry:r={},ancestors:s=T}=t,{type:c}=e;c&&c in r||console.warn(`No block with "${c}" is registered`);const d=c&&r[c];return l({blockClassName:u(e.style?.length?e.style:"col-span-12",n),block:e,ancestors:s,render:({block:n,blockClassName:l})=>{const{content:r}=n;return d?o(d,{className:l,block:e,options:t,...r,...a},i):null}},i)}const B=[],P=(e,{key:t,ancestors:n=B,slotName:a=null,extraProps:i,renderProps:l=R,...r})=>{const s=i?(e,t)=>R(e,t,i):l;return(e||[]).map(((e,i)=>s(e,{...r,key:`${t||e.type}-${i}`,ancestors:r.parent?[...n||B,[r.parent,a]]:n},i)))};function D({block:e,options:t,children:n,extraProps:a,renderProps:i}){return n||(e&&t?P(e.blocks,{...t,parent:e,extraProps:a,renderProps:i}):null)}function _(){return _._impl()}_._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),_.setup=e=>{_._impl=e};const E=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return E.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),M=e=>Boolean(e?.includes(":")),O=(e,t)=>Boolean(e&&!M(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),z=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),V=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:M,isLocalURL:O,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:z,hasPrefix:V});const j="/api/",$=`${j}v1/storage`,q=e=>(t,n)=>{if([!t,M(t),F(t),[A.CDN,j].some((e=>V(t,e)))].some(Boolean))return t;if(((e="")=>/^[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}(\/revs\/[0-9]{1,20})?$/.test(e))(t))return`${$}/${t}/attachment`;const a=t?.startsWith("/");return z(V(t,n)?"":n,a?"/":(i=e.pathname,i?.split("/").slice(0,-1).join("/")),t);var i},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:a=`Иконка ${n}`,title:i=a,iconVersion:l="color",width:r,height:s})=>{const d=_(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=q(d)(z(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:a,title:i,"aria-hidden":"true",width:r,height:s,style:H(e,s)}):o(K,{className:e,children:c("svg",{className:u(Y(r),U[l],{invert:"white"===l},t),width:r,height:s,"aria-hidden":"true",children:[i?o("title",{children:i}):null,a?o("desc",{children:a}):null,o("use",{href:h,xlinkHref:h})]})})})),H=(e,t)=>{return e?.includes("h-")?{}:{height:(n=t,n&&!/\D/.test(n)?`${t}px`:t),width:"auto"};var n},Y=e=>e?"":"w-full h-full",K=d((({className:e,children:t})=>e?o("div",{role:"img",className:e,children:t}):t)),G=new Proxy({_:{},setup(e){this._=e}},{get:(e,t)=>e._[t]||e[t]});function X(e=""){try{return new URL(e).pathname}catch(e){return""}}const J=e=>t=>{const n=t?.startsWith("/wcms-resources")?"":X(G.SITE_URL);return t&&!M(t)?q(e)(t,n):t},Z=(e,t)=>e?.media&&t?.media?e.media-t.media:0,Q=d((({className:e="",image:t,imageClassName:n=""})=>{const a=_();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:i},l)=>o("source",{srcSet:J(a)(e),type:te(n),media:i?`(max-width: ${i}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(a)(t.src)},n):null]})})),ee=(e,t="")=>o("img",{src:e.src,className:u("object-contain",t),alt:e?.alt||e?.title||"",title:e?.title||"",style:{width:e?.size?.width?`${e.size?.width}px`:"100%",height:e?.size?.height?`${e.size?.height}px`:"auto"},width:e?.size?.width,height:e?.size?.height}),te=e=>e?`image/${String(e)}`:void 0,ne=d((({className:e="",image:t,imageClassName:n="",...a})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...a}):o(Q,{className:e,imageClassName:n,image:t}):null)),ae={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:"text-primary-main",transparent:"",gray:"text-primary-main bg-main-divider hover:text-white hover:bg-primary-hover active:bg-primary-active","":""},ie="bg-main-divider text-main-disabled",le={primary:ie,secondary:ie,white:ie,link:"",transparent:"",gray:ie,"":""},re="text-center font-sans select-none",se={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:"text-primary-main",transparent:"",gray:"group-hover/btn:brightness-0 group-hover/btn:invert","":""},oe=({className:e,rounded:t,version:n})=>[re,"border border-transparent inline-block cursor-pointer no-underline focus:border-primary-text focus:border h-fit",n?ae[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ce=e=>ce._impl(e);function de(e,t){const n=s({});return r((()=>new Proxy({},{get:(a,i)=>(n.current||={},n.current[i]||=n=>e.fire(t,{...n??{},type:i}),n.current[i])})),[e,t])}ce._impl=e=>e,ce.setup=e=>{ce._impl=e};class me{watchers=new Set;subscribersMap={};subjectsStateMap={};emitter=this;observable=this;watch(e){return this.watchers.add(e),()=>{this.watchers.delete(e)}}subscribe(e,t){this.subscribersMap[e]||=new Set,this.subscribersMap[e]?.add(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.subscribersMap[e]?.delete(t)}}fire(e,t){e in this.subjectsStateMap?this.subject(e,t):this.fireSubscribers(e,t)}subject(e,t){return this.subjectsStateMap[e]!==t&&(this.subjectsStateMap[e]=t??void 0,this.fireSubscribers(e,t)),()=>{delete this.subjectsStateMap[e]}}fireSubscribers(e,t){for(const n of this.subscribersMap[e]??[])n(t??null);for(const n of this.watchers)n({type:e,event:t??null})}}const ue=new me,he=()=>de(ue.emitter,"dialog");function pe(){const e=X(G.SITE_URL),t=_(),{closeAll:n}=he();return e=>{const n=q(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ce(a({...e,href:n}))}};function a({href:a,target:i,onClick:l}){return r=>{l?.(r),ge(a,i,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(a,e)))}}}const ge=(e,t,n)=>{if(!O(e,t))return!0;const a=G.SUB_PORTALS?.split(",");return!!a?.some((t=>V(e,t)))||!V(e,n||"/")},fe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},xe=d((e=>{const{text:t,aboveText:n,appendLeft:a,appendRight:i,version:l="primary"}=e,r=be(e)&&"hidden lg:block";return c("div",{className:u(ye(e),"flex gap-xs"),children:[a?o("div",{className:u(r,se[l]),children:a}):null,be(e)?c("div",{className:"whitespace-pre",children:[n?o("div",{className:"text-xs font-light text-left",children:n}):null,o("div",{className:"text-left "+(n?"text-s -mt-3xs":"text-l"),children:t})]}):null,i?o("div",{className:u(r,se[l]),children:i}):null]})})),ye=e=>{const{version:t,aboveText:n,rounded:a}=e;if("link"===t)return"";const i=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",be(e)?i:"h-12 w-12 m-auto",{"rounded-full":a})},be=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ve=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),Ne=d((({disabled:e,children:t,method:n="LINK",href:a,...i})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:a,pathname:i,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[a,i].join(""));for(const[e,t]of l.entries()){const n=document.createElement("input");n.setAttribute("type","hidden"),n.setAttribute("name",e),n.setAttribute("value",t),r.appendChild(n)}document.body.appendChild(r),r.submit()}),[]))({method:n,href:a}),s=pe()({onClick:r,href:a,...i}),c=t??o(xe,{...s});return o(e?Ce:we,{...s,children:c})})),we=d((({className:e="",href:t,rel:n,target:a,ariaLabel:i,version:l,rounded:r,onClick:s,type:c,data:d,children:m,text:u})=>o("a",{className:oe({className:e,version:l,rounded:r}),href:t,rel:n,target:a,"aria-label":i||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...fe(d),children:m}))),Ce=d((({className:e,ariaLabel:t,version:n,rounded:a,children:i})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ve({className:e,rounded:a,version:n}),children:i})));function Se({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:a=!1}){if(!n)return null;const i="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(a?"flex":"hidden sm:flex","items-center gap-s"),children:[o("div",{className:u(oe({className:"w-12 h-12 min-h-12 min-w-12 flex items-center justify-center",rounded:!0}),l),onClick:t,children:o(ne,{className:"w-4 h-4",image:{icon:"ArrowLeftIcon",iconVersion:i}})}),o(Ne,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const ke=()=>{const[e,t]=a(true);return i((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(!0),()=>{e?.removeEventListener("change",n)}}),[]),e},Ie={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Te=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Ie[n],t),children:e}):null,Re=d((({className:e,version:t="primary",defaultPadding:n,padding:a="",title:i,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=ke(),v=_(),N=l((()=>v.back()),[]),w=y.options?.page?.common?.backwardButton,C=f&&!b;return c("div",{className:u("relative flex flex-col gap-3xl overflow-hidden",a||n,e),children:[C&&Se({version:t,handleClick:N,text:w}),i?o("div",{className:"relative h-full",children:i}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Te(s,{imageAlign:m,className:"mx-auto"}),c("div",{className:u("grid gap-3xl items-center md:items-stretch",{"@xl:grid-cols-2 auto-cols-fr":d,grow:!s},"h-full","auto-rows-[max-content_1fr]"),children:[c("div",{className:"grow space-y-lg min-w-fit",children:[h,x]}),Pe(D({...y,extraProps:{className:"@container-normal"}})),Te(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Be(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Be=e=>u(e?"row-span-2":"@xl:row-span-2"),Pe=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,De=(e,t="normal")=>e?.icon||e?.src?o("div",{className:u("sm:w-12 sm:h-12 sm:min-w-12 w-11 h-11 min-w-11 box-border flex items-center justify-center rounded-icon","normal"===t?"bg-secondary-light text-primary-main":"bg-primary-main text-black group-data-secondary:bg-white/30 group-data-secondary:text-black"),children:o(ne,{className:"w-6 h-6",image:{...e,iconVersion:e.iconVersion||t}})}):null,_e=d((({__html:e="",richVersion:t="",itemSize:n="list-m",isDotted:a=!0,children:i})=>e||i?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(t,n,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",a?"":"without-dots"),dangerouslySetInnerHTML:e?{__html:e}:void 0,children:i})}):null)),Ee=(e,t)=>e?o(C,{font:"font-light",size:"text-m",color:"text-secondary-text group-data-secondary:text-white",children:e},`description-${t}`):null,Ae=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Me=(e,t)=>e?o(Ae,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Oe=(e,t)=>["label"in e?Me(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Ee(e.description,t)},String(t)):null,"__html"in e?o(_e,{...e},`rte-${t}`):null],Fe=d((({className:e,benefitsVersion:t,...n})=>c("div",{className:u("flex gap-m min-w-56 items-center",e),role:"listitem",children:["icon"in n?De(n.icon,t):null,o("div",{children:Oe(n)})]}))),ze=d((({className:e,benefitsVersion:t="normal",benefits:n})=>n?.length?o("div",{className:u("flex gap-x-m gap-y-s flex-col",e),role:"list",children:n.map(((e,n)=>o(Fe,{benefitsVersion:t,...e},String(n))))}):null)),Ve=d((({className:e,benefits:t})=>t?.length?o("div",{className:u("grid grid-cols-[max-content_1fr] auto-rows-auto items-baseline gap-x-m gap-y-xs",e),role:"list",children:t.flatMap(Oe)}):null)),Le=d((({isTabularBenefits:e,...t})=>o(e?Ve:ze,{...t}))),je=e=>Boolean(e?.src||e?.icon),$e=(e,{className:t,buttonClassName:n,isVertical:a}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",a?"flex-col gap-xs justify-items-stretch":"flex-wrap @xl:flex-nowrap gap-lg sm:gap-m w-full @lg:w-auto",t),role:"group",children:e.map(qe(n))}):null,qe=(e="")=>(t,n)=>{const{text:a,icon:i,iconRight:l,version:r,...s}=t||{},c=Ue(i,r),d=Ue(l,r);return a||i?.icon?o(Ne,{className:u("basis-full @lg:basis-auto",e),appendLeft:We({...i,iconVersion:c}),appendRight:We({...l,iconVersion:d}),version:r,text:a,...s},n?String(n):""):null},Ue=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},We=e=>je(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),He=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),Ye=d((({priceList:e})=>e?.length?o("div",{className:"flex flex-wrap xl:flex-nowrap xl:bg-main-divider xl:rounded-md p-xs gap-xl",role:"list",children:e.map(Ke)}):null)),Ke=({label:e,amount:t,unit:n},a)=>c("div",{className:"basis-full flex flex-col-reverse sm:flex-row sm:justify-between sm:bg-main-divider sm:py-m sm:px-lg sm:rounded-md items-baseline whitespace-pre",role:"listitem",children:[o(Ae,{font:"font-light",size:"text-l",color:"text-secondary-text",children:e}),t?c("span",{className:"font-sans text-h6 sm:text-primary-main text-primary-text",children:[He(2)(t)," ",n||"₽"]}):null]},String(a)),Ge=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Xe)}):null)),Xe=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Ae,{size:"text-m",font:"font-light",children:e})},String(t)),Je={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Ze=d((({className:e,padding:t,defaultPadding:n,title:a,description:i,headlineVersion:l="L",align:r="text-left",benefitsVersion:s,isTabularBenefits:d,isDotted:m=!0,benefits:u,__html:h,richVersion:p,isFullWidthTitle:g,priceList:f=[],tags:x=[],buttons:y,image:b,imageOptions:{imageAlign:v="center",directionRight:N=!0,isImageAlwaysOnRight:w,isImageSecondary:C=!1}={},backwardButton:S,children:I,...T})=>{const R=b?.src?o(ne,{image:b}):null,B=o(k,{title:a,description:i,headlineVersion:l,align:r,isEmbedded:!0}),P=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Re,{className:e,padding:t,defaultPadding:n,...g?{title:B}:{insetTitle:B},...Qe(R,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:$e(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[P?.length?o(Le,{benefitsVersion:s,isTabularBenefits:d,benefits:P}):null,h?o(_e,{richVersion:p,__html:h,isDotted:m,itemSize:Je[l]}):null,I,f?.length?o(Ye,{priceList:f}):null,et(x)]})})})),Qe=(e,t)=>t?{rightImage:e}:{leftImage:e},et=e=>e?.length?o(Ge,{tags:e}):null;class tt{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof tt?e._:e)}filter(e){return this.from(this.entries().filter(e))}map(e){return this.from(this.entries().map(e))}flatMap(e){return this.from(this.entries().flatMap(e))}reduce(e,t){return this.entries().reduce(e.bind(this),t)}}const nt=()=>!0,at=(e,t)=>(...n)=>e(...n)&&t(...n),it=(...e)=>(...t)=>{const[,n]=function(e){if(!e)throw new Error("Value should be fulfilled");return e}(e.find((([e])=>e(...t))));return n(...t)};const lt=e=>Boolean(e&&Array.isArray(e)),rt=e=>Boolean(e&&"object"==typeof e&&!lt(e)),st=e=>e;function ot(e){return e instanceof tt?e._:e}class ct extends tt{from(e){return this.of(e.map(((e=st)=>([,t])=>e(t))(ot)))}entries(){return(this._??[]).map(((e,t)=>[t,this.of(e)]))}size(){return this._?.length??0}get(e){return this.of("number"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of(lt(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,a)=>a===e?t:this._[a])):Array.from({length:Number(e)+1},((n,a)=>a===e?t:void 0)))}}class dt extends tt{from(){return this}entries(){return[]}size(){return 0}get(e){return this.of(void 0!==e?void 0:this._)}set(e,t){return this.of(t)}}class mt extends tt{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,ot(t)]))))}entries(){return Object.entries(this._??{}).map((([e,t])=>[e,this.of(t)]))}size(){return Object.keys(this._??{}).length}get(e){return this.of("string"==typeof e?this._?.[e]:void 0)}set(e,t){return this.of({...this._,[e]:t})}}class ut extends tt{proto=it([e=>lt(this._)||"number"==typeof e,()=>ct.prototype],[e=>rt(this._)||"string"==typeof e,()=>mt.prototype],[nt,()=>dt.prototype]);from(e){return this.proto(void 0).from.call(this,e)}entries(){return this.proto(void 0).entries.call(this)}size(){return this.proto(void 0).size.call(this)}get(e){return this.proto(e).get.call(this,e)}set(e,t){return this.proto(e).set.call(this,e,t)}}const ht=e=>e instanceof tt?e:new ut(e),pt=e=>{const t=(t,...n)=>ot(e(ht(t),...n));return t.fn=e,t},gt=[],ft=e=>e instanceof Function?e:t=>e===t,xt=e=>(t,n,a=gt)=>ht(t).entries().reduce(((t,[n,i])=>xt(e)(i,t,a.concat(n))),e(n,[a,ht(t)])),yt=pt(((e,[t,n])=>{const[a,...i]=t;return e.set(a,i.length?yt(e.get(a),[i,n]):n)})),bt=pt(((e,t)=>t.reduce(yt.fn,e))),vt=e=>xt(((e,[t,n])=>Nt(n)?[...e,[t,ot(n)]]:e))(e,[]),Nt=e=>0===e.size();pt(((e,t=gt)=>t.reduce(((e,t)=>e.get(t)),e)));const wt=pt(((e,[t,...n])=>n.length?e.set(t,wt(e.get(t),n)):e.filter((([e])=>e!==t)))),Ct=(St=["$ref"]).map(((e,t)=>n=>ft(e)(n[t+n.length-St.length]))).reduceRight(at,nt);var St;const kt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(It,e),It=it([lt,(e,t)=>e[parseInt(t,10)]],[rt,(e,t)=>e[t]],[nt,st]),Tt=(e,t)=>((e,t={})=>n=>bt(t,vt(n).map((t=>e(t)))))((([e,n])=>{return Ct(e)?[(a=e,a.slice(0,-1)),kt(t(n),n)]:[e,n];var a}))(e),Rt=e=>vt(e).filter(((e=st)=>([t])=>e(t))(Ct)),Bt=e=>{return t=Rt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Dt(e,t):null}catch(e){console.error(e)}return null}const Dt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),_t=e=>[...new Set(e)],Et={},At=["/portal-resources"],Mt=(e,t)=>Tt(e,(e=>t?.[e])),Ot=(e,t)=>{const n=Bt(e),[l,r]=a({});return i((()=>{Ft(n).then(r)}),[n.join()]),n.length?Mt(e,{...t,...l}):e},Ft=async(e,t={})=>{if(e.length){const n=await(async e=>Object.fromEntries((await Promise.allSettled(_t(e).filter((e=>!At.some((t=>e.startsWith(t))))).map((async e=>[e,Et[e]||=await Dt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(e),a={...t,...n},i=Object.entries(n).flatMap((([,e])=>Bt(e)));return i.length?Ft(i,a):a}return t};function zt(e,t={}){const n=d((t=>{const n=Ot((({block:e,options:t,className:n,defaultPadding:a,padding:i,isTheme:l,version:r,children:s,...o})=>o)(t),t.options?.page?.fallback);return o(e,{...t,...n})}));return Object.assign(n,t),n}const Vt=zt((({className:e,padding:t,defaultPadding:n,...a})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...a,children:o(Ze,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...a})})),{childrenTypes:["UnitBlock"]}),Lt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>jt(0,t?.length)),[t]),a=t?.[n];return a?o(Vt,{suppressHydrationWarning:!0,...a,...e}):o(g,{...e,children:o(f,{})})})),jt=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),$t=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),a=String(e.getMonth()+1).padStart(2,"0"),i=String(e.getFullYear());return t?`${i}-${a}-${n}`:`${n}.${a}.${i}`}},qt=e=>e?.replace(/[^+\d]/g,""),Ut="/api/v1";const Wt=e=>e?{phone:qt(e)}:{},Ht=(e,t="birthday")=>e?{[t]:$t(e)}:{},Yt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Kt=(e,t=!0)=>({[t?"email":"mail"]:e}),Gt=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:qt(e)}:{},Xt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:a,params:i}of e)t[a??""]?.(n,i)};function Jt(){return Jt._impl()}Jt._impl=()=>({assign:(e,t)=>{globalThis.open(e,t||"_self")},get origin(){return globalThis.location.origin},get href(){return globalThis.location.href}}),Jt.setup=e=>{Jt._impl=e};const Zt="rshb-query-params";function Qt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Zt)||"";return e&&globalThis.sessionStorage?.setItem(Zt,e),e}const en=e=>{const t=e.target?.closest("a"),n=Jt();if(M(t?.href)&&!t?.href?.startsWith(n.origin)){e.preventDefault(),e.stopPropagation();const a=(e=>{const t=Qt();if(!M(e)||!t)return e;const n=new URL(e);for(const[e,a]of new URLSearchParams(t))n.searchParams.set(e,a);return n.toString()})(t?.href)||t?.href;a&&n.assign(a,t?.target)}};function tn(){return tn._impl()}tn._impl=()=>({forwardQuery:en}),tn.setup=e=>{tn._impl=e};const nn=e=>e,an=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=a(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return ln(t,n)?t:n}:r(e)):o,[r]);i((()=>{r&&o(r)}),[r]);const[d,m]=a(!1),[u,h]=a({}),p=l(((e,t)=>{const{parse:n=nn,format:a=nn}=t||{};return{value:a(s[e]),isDirty:d||u[e],onChange:t=>{c((a=>({...a,[e]:n(t)}))),h((t=>({...t,[e]:!0})))}}}),[c,d,u]),g=l((e=>{c(e),h(e)}),[]),f=l((()=>{c(e),m(!1),h({})}),[e]),x=l((e=>(e.preventDefault(),t?f():m(!0),n&&n(s,e),s)),[n,s]);return[s,{isDirty:d||Object.values(u).some(Boolean),field:p,update:g,reset:f,onSubmit:x}]},ln=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),rn=d((e=>{const{className:t,title:n,children:a,...i}=e;return o(g,{className:t,defaultPadding:"p-6xl",...i,children:c("div",{className:"container space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,a]})})}));function sn(e,t={}){const{open:n,close:a,...i}=he();return{open:l(((i,l={})=>n({dialog:o(e,{...t,...i,onClose:()=>{a(),i.onClose?.()}}),...l})),[e,n,a]),close:a,...i}}function on(e=!1){const[t,n]=a(e),i=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:i,setFalse:r,toggle:s}]}function cn(e,t,n,a){i((()=>{if(e&&n)return e.addEventListener(t,n,a),()=>{e.removeEventListener(t,n,a)}}),[e,t,n])}function dn(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return cn(globalThis.document,"click",n),t}const mn=({label:e,errors:t})=>e&&t?`${e}*`:e,un=()=>{},hn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",pn=e=>e?hn:"border-error",gn=e=>e?o(Ae,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,fn=d((({key:e,className:t="",id:n,name:a,type:r="text",label:d,placeholder:m,value:h="",valid:p=!0,children:g,onChange:f,onFocus:x,onBlur:y,pattern:b,autoFocus:v=!1,isTextarea:N=!1,disabled:w=!1})=>{const C=s(null),S=l((e=>{const t=(e.target?.value||"").trimStart();f&&f(t)}),[f]);i((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=pn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[gn(d),N?o("textarea",{className:u("block resize-y min-h-24",xn,I),id:u("textarea",n),name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",xn,k,I),ref:C,id:n,name:a||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),xn="w-full border rounded-md text-primary-text outline-none p-m",yn=e=>o("div",{className:"h-6",children:e?o(Ae,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),bn=e=>e?.value||"",vn={url:"suggest/address"},Nn={name:{url:"suggest/fio",requestData:{parts:["NAME"],gender:"UNKNOWN"}},surname:{url:"suggest/fio",requestData:{parts:["SURNAME"],gender:"UNKNOWN"}},middleName:{url:"suggest/fio",requestData:{parts:["PATRONYMIC"],gender:"UNKNOWN"}},email:{url:"suggest/email"},dulSubdivisionCode:{url:"suggest/fms_unit",responseItemHandler:e=>e?.data?.code?.replace("-","")||""},dulIssuedBy:{url:"suggest/fms_unit"},organizationName:{url:"suggest/party"},inn:{url:"suggest/party",responseItemHandler:e=>e?.data?.inn||""},addressRegistration:vn,addressFact:vn,organizationAddress:vn,addressCourier:vn},wn=()=>de(ue.emitter,"popup"),Cn=d((({options:e,onChange:t})=>o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",children:e?.map(((e,n)=>o("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem",onMouseDown:()=>t(e),children:o("span",{className:"min-h-6",children:e.processedValue})},n.toString())))})));function Sn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=a([]),f=wn(),x=Nn[n],y=l((()=>{h.current=t,f.close()}),[t]),b=l((e=>{y(),h.current=e.processedValue,c&&c(e.processedValue),d&&d(e)}),[y,c]),v=s(null),N=r((()=>async e=>{if(!x)return;const t=await(e=>{const{url:t,query:n,queryPrefix:a,requestData:i={},responseItemHandler:l=bn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${a?`${a}, `:""}${n}`;return fetch(`${Ut}/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...i,query:o})}).then((e=>e.json())).then(r)})({url:x.url,responseItemHandler:x.responseItemHandler,requestData:{...x?.requestData},query:e,queryPrefix:m});t?.length&&g(t)}),[m]),w=r((()=>((e,t=600)=>{let n;const a=(...i)=>{a.dispose(),n=setTimeout((()=>{e(...i)}),t)};return a.dispose=()=>{n&&clearTimeout(n)},a})(N,300)),[N]);return i((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:a,left:i,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.open({popup:o(Cn,{options:p,value:t,onChange:b}),top:a+globalThis.scrollY+r,left:i,width:l})}),[e,p,t,b]),v}const kn=d((({className:e,label:t,value:n="",placeholder:a,error:r,errors:s,onChange:d=un,onDaDataChange:m,onBlur:h,isTextarea:p,type:g,name:f="",daDataQueryPrefix:x,isInteger:y=!1,maxLength:b,dadata:v=!1,disabled:N=!1})=>{const[w,{setFalse:C,setTrue:S}]=on(),k=dn(C),I=l((e=>{v&&!w&&S(),b?e.length<=b&&d(e):d(e)}),[v,w,d]);i((()=>{y&&n&&d(In(n))}),[n]);const T=Sn({isOpen:w&&v,name:f,value:n,daDataQueryPrefix:x,onChange:d,onDaDataChange:m});return c("div",{className:u("shrink-0 w-full",e),ref:k,onBlur:C,onFocus:S,children:[o("div",{ref:T,children:o(fn,{disabled:N,type:g||"text","aria-label":t,label:mn({label:t,errors:s}),valid:Boolean(!r),value:n,onChange:I,onBlur:h,isTextarea:p,placeholder:Tn(a,s,t)})}),yn(r)]})})),In=(e="")=>e.replace(/[^\d]+/g,""),Tn=(e,t,n)=>t&&!n?`${e}*`:e,Rn=e=>e?.text||e?.key||"",Bn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Pn=d((({popupRef:e,options:t,value:n,query:a,onChange:i,iconVersion:l})=>t?.length?o("div",{className:"bg-white text-l max-h-64 overflow-y-auto overflow-x-hidden rounded-md shadow-2xl",role:"list",ref:e,children:Bn(t,a).map((e=>c("div",{className:"flex px-m py-s cursor-pointer hover:bg-main-divider pr-5xl relative",role:"listitem","aria-selected":e.key===n?.key,onClick:t=>{t.stopPropagation(),i&&i(e)},children:[o("span",{className:"min-h-6",children:Rn(e)}),o(W,{name:"DoneSimpleIcon",width:"16",height:"16",iconVersion:l,className:u("absolute right-4 pt-3xs",{hidden:e.key!==n?.key})})]},e.key)))}):null));const Dn=d((({className:e,label:t,options:n=[],value:r,valid:d=!0,isBorder:m=!0,placeholder:h="",isSearch:p=!1,iconVersion:g="black",onChange:f,disabled:x=!1})=>{const[y,{setFalse:b,setTrue:v}]=on(),[N,w]=a(""),C=An(x,n.length),S=y&&!C,k=l((()=>{C||v()}),[C]),I=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:a,onChange:r,onClose:c,iconVersion:d}){const m=wn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=dn(u);return i((()=>{if(!e||!p.current)return;const i=p.current,{top:l,left:r,width:s,height:c}=i.getBoundingClientRect();m.open({popup:o(Pn,{popupRef:g,options:t,value:n,query:a,onChange:h,iconVersion:d}),top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,a,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:I,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[gn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:T,children:[c("div",{className:u("h-14 [&>*]:p-m pr-6 text-l flex items-center justify-between text-primary-text relative z-10 overflow-hidden",En(m,d,C)),onClick:S?I:k,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Rn(r)||h}),_n(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(fn,{type:"text",autoFocus:!0,value:N,onChange:w,disabled:C})}):null]})]})})),_n=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),En=(e,t,n)=>u(e?"border rounded-md ":"",e&&!n?"hover:border-primary-hover":"",n?"bg-main-divider":"cursor-pointer ",t?"border-gray":"border-error"),An=(e,t)=>e||0===t,Mn=d((({className:e="",label:t,error:n,errors:a,...i})=>c("div",{className:e,children:[o(Dn,{...i,valid:!n,label:mn({label:t,errors:a})}),yn(n)]}))),On=e=>!e?.length,Fn=e=>t=>n=>e(n)?[]:[t],zn=Fn((e=>null!=e&&""!==e)),Vn="Некорректно заполненное поле",Ln="Укажите регион, город/населенный пункт, улицу, дом",jn=e=>zn(e??Vn),$n=e=>Fn((e=>e?.key&&""!==e?.key))(e??Vn),qn=e=>Fn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Vn),Un=e=>Fn((e=>"string"==typeof e&&e.length>1&&ea(e)))(e??Vn),Wn=(e,t)=>Fn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Vn),Hn=e=>Fn((e=>"string"==typeof e&&6===e.length))(e),Yn=e=>/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/.test(e),Kn=e=>Fn(Yn)(e),Gn=Fn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Xn=e=>{const t=String(e).replace(/[^0-9]+/g,"");if(11===t.length){let e=0;for(let n=0;n<9;n++)e+=parseInt(t.charAt(n))*(9-n);return e>101&&(e%=101),100!==e&&101!==e||(e=0),e===parseInt(t.substr(9))}return!1},Jn=e=>Boolean(e.region&&e.city&&e.house),Zn=()=>Fn(Jn)(Ln),Qn=/^[\u0400-\u04FF\d\s]+$/u,ea=(e="")=>Qn.test(e),ta=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),a=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<a)},na={processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentInformFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn},aa={addressCourier:Zn(),paymentSystem:jn("Укажите тип платежной системы"),currency:jn("Укажите валюту"),cardCategory:jn("Укажите категорию карты"),codeWord:(ia="Необходимо ввести кодовое слово",Fn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ea(e)))(ia??Vn)),confirmationIncome:$n(),methodObtain:jn(),deliveryDate:jn("Укажите дату доставки")};var ia;const la={organization:$n("Выберите тип организации"),organizationAddress:Fn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(Ln),organizationPhone:Kn("Укажите номер телефона"),organizationName:jn("Укажите наименование организации"),legalForm:jn("Укажите ОПФ"),generalSeniority:qn("Укажите количество лет стажа"),lastJobExperience:qn("Укажите стаж на последнем месте работы"),experience5Years:qn("Укажите общий стаж за последние 5 лет"),jobsNumber:qn("Укажите количество мест работы за последние 5 лет"),beginDate:jn("Укажите дату заключения трудового договора"),addressFact:Zn(),addressRegistration:Zn(),addressRetail:$n("Выберите адрес банка"),addressMatch:jn(),sex:jn("Укажите свой пол"),limitedBirthday:Fn(ta)("Допустимый возраст заёмщика - от 23 до 75 лет"),birthPlace:jn("Укажите место рождения"),education:$n("Выберите ваше образование"),housing:$n("Выберите тип жилья"),amountWorkers:$n("Выберите информацию о количестве сотрудников"),employment:$n("Выберите информацию о трудоустройстве"),employerActivities:$n("Выберите вид деятельности организации"),employerOrganization:$n("Выберите вид организации"),positionOrganization:$n("Выберите вашу должность"),familyStatus:$n("Выберите семейное положение"),familyMembers:Wn(2,"Укажите количество членов семьи"),children:Wn(2,"Укажите количество детей"),dependents:Wn(2,"Укажите количество иждивенцев"),totalIncome:Wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Wn(10,"Укажите сумму обязательных выплат"),snils:(e=>Fn(Xn)(e))("Некорректный номер СНИЛС"),conscription:jn(),armyIdFlg:Gn,dulSerie:(e=>Fn((e=>"string"==typeof e&&4===e.length))(e))("Укажите серию паспорта"),dulNumber:Hn("Укажите номер паспорта"),dulIssueDateField:jn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Hn("Укажите код подразделения"),dulIssuedBy:jn("Укажите организацию, выдавшую паспорт"),participantDateRegistration:jn("Укажите дату регистрации"),retirementIncome:jn(),otherIncome:jn(),wages:jn(),mandatoryPayments:jn(),disablePeopleFlg:jn(),bankruptcyFlg:jn(),shareholderFlg:jn(),legalEntityName:jn(),bankEmployeeCode:jn(),partInBusiness:jn(),regionRetail:$n("Выберите регион")},ra={fullName:jn(),addressBranch:$n(),desiredMeetingDate:jn(),product:jn(),localities:jn(),partnerComments:jn(),collectionCount:jn(),acquiringType:$n(),serviceType:$n(),annualRevenue:jn(),feedbackMethod:$n(),serviceDirection:$n(),secondaryPhone:Kn("Укажите номер телефона"),region:$n(),surname:Un("Укажите свою фамилию"),name:Un("Укажите своё имя"),middleName:Un("Укажите своё отчество"),birthday:jn("Укажите дату рождения"),phone:Kn("Укажите номер телефона"),email:(e=>Fn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),inn:(e=>Fn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),comment:jn(),typeForm:jn(),consentToReceiveMaterials:Gn,consentDataProcessing:Gn,...na,...la,...aa},sa=e=>{const t=(e=>Object.values(e.filter((e=>e)))?.map((e=>e.name)))(e.filter((e=>Boolean(e?.required))));return Object.fromEntries(t.map((e=>[e,ra?.[e||""]])).filter((([,e])=>e)))},oa=(e,t)=>{const{value:n,isDirty:a}=e,i=a?t(n):[];return{...e,errors:i,error:i[0]}},ca=(e,t,n=!1)=>n&&t?oa(e,t):e,da=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],ma=d((({field:e,input:t})=>o(Mn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:da,...ca(e("acquiringType"),ra.acquiringType,t?.required)}))),ua=(e="")=>Boolean("trade"===e||"all"===e),ha=e=>null!=e,pa=new Map,ga=(e,t=pa)=>n=>{const a=xa(n),i=t.get(a);if(a&&ha(i))return i;const l=e(...n);return a&&ha(l)&&t.set(a,Promise.resolve(l)),l},fa=e=>Boolean(e?.every((e=>Array.isArray(e)?fa(e):!e||"string"==typeof e))),xa=e=>fa(e)?e.toString():"",ya=e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]);function ba(e,t,{fallback:n,cache:l}={}){const s=r((()=>va(e)),[e]),[o,c]=a(void 0),[d,m]=a(void 0);i((()=>{if(!s.some(ha))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await ga(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&ya(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function va(e){return Array.isArray(e)?e:e instanceof Function?va(e()):[e]}const Na=`${Ut}/branches`,wa=[];const Ca=async e=>await Pt(e,{method:"GET"})||wa;function Sa(e=!1){const{data:t}=ba(`${Ut}${e?"/premiumBranchesByRegions":"/branchesByRegions"}`,Dt);return Array.isArray(t)?t:[]}const ka=(e="")=>"ULTRASERVICE"===e,Ia=d((({field:e,input:t,params:n})=>{const a=ka(n?.typeForm),l=e("region"),r=l?.value?.key,s=l?.value?.text,c=a?Sa(a)?.find((e=>e?.region===s))?.branches:function(e){const{data:t}=ba(e?`${Na}?regionCode=${e}`:null,Ca);return t||wa}(r)?.filter((e=>e?.address));return i((()=>{""!==l?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[l?.value]),o(Mn,{label:"Отделение",placeholder:"Выберите отделение",options:(c||[]).map((({address:e=""})=>({key:e,text:e}))),...ca(e("addressBranch"),ra.addressBranch,t?.required),isSearch:!0})})),Ta=(e,{normalize:t,format:n})=>{const{value:i,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=a(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(i)),s&&s()}),[o,i]);return{value:c||!n?i:n(i),onFocus:m,onBlur:u}},Ra=(e,t,n)=>Math.max(t,Math.min(e,n));function Ba(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Pa({list:e=[],min:t,max:n,step:a,value:i=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(i):i,d={backgroundSize:`${(100*(s>t?s-t:0)/(n-t)).toFixed(2)}% 100%`};return c("div",{children:[e.length?o("div",{className:"absolute w-full flex justify-between -bottom-[3px] px-m",children:e.map(((e,t)=>o("div",{className:u("w-2 h-2 rounded-full",s<=t||l?"bg-gray":"bg-primary-main")},String(t))))}):null,o("div",{className:"absolute inset-x-0 -bottom-1 px-m leading-[18px]",children:o("input",{className:"box-border w-full m-0 cursor-pointer slider relative z-10",style:d,type:"range",min:t,max:n,step:a,value:s,disabled:l,onChange:t=>{const n=Ba(t.target?.value),a=e.length?e[n]:n;r&&r(a||0)}})})]})}const Da=1,_a=100,Ea=d((e=>{const{className:t,title:n,items:a=[],list:i=[],min:r=(i.length?0:Da),max:s=(i.length?i.length-1:_a),step:d=1,value:m=i[0]||r,disabled:h=!1,onChange:p}=e,g=Ta(e,{normalize:(e=0)=>i.length?Aa(i)(e):Ra(e,r,s),format:He()}),f=l((e=>{p&&p(Ba(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:n}):null,o("input",{className:u("text-h3 w-full h-14","pl-m mt-xs box-border","text-primary-text",hn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Pa({list:i,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),Ma(a)]})})),Aa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),Ma=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),Oa=["От 1 000 ₽","До 1 000 000 000 ₽"],Fa=d((({field:e})=>o(Ea,{title:"Сумма, ₽",items:Oa,min:1e3,max:1e9,...e("amount")}))),za=d((({field:e,input:t})=>o(kn,{label:"Годовая выручка, ₽",...ca(e("annualRevenue"),ra.annualRevenue,t?.required)}))),Va=d((({field:e})=>o(kn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),La=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:a,currentYear:i,min:l,max:r,onDateClick:s})=>{const c=[];let d=1;for(let m=0;m<6;m++){const u=[];for(let c=0;c<7;c++)if(0===m&&c<t)u.push(o("td",{},`empty-${c}`));else if(d>n)u.push(o("td",{},`empty-${c}`));else{const t=new Date(i,a,d),n=ja(t,e),c=$a(t,l,r);u.push(o("td",{children:o("div",{className:qa(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},ja=(e,t)=>t&&e.toDateString()===t.toDateString(),$a=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),qa=(e=!1,t=!1)=>u("p-s text-center rounded-md border",{"border-transparent hover:bg-gray":!e},t?"text-gray hover:bg-transparent":"cursor-pointer"),Ua=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Wa=d((({today:e,currentMonth:t,currentYear:n,min:a,max:i,onDateSelect:s=un,setValue:d=un})=>{const m=l((e=>{s(e),d(!1)}),[]),{firstDayOfWeek:u,totalDays:h}=r((()=>({firstDayOfWeek:new Date(n,t,1).getDay()-1,totalDays:new Date(n,t+1,0).getDate()})),[n,t]);return c("table",{className:"mx-auto",children:[o("thead",{className:"text-gray font-light",children:o("tr",{children:Ua.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:La({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:a,max:i,onDateClick:m})})]})})),Ha=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Ya(e,t){const n=e.replace(/\D/g,"");if(""===n||n.length===t.length)return e;const a=[...t],i=a.findIndex(Ka),l=a.map(((e,t)=>Xa(e)?a.slice(0,t).filter(Xa).length:-1)),r=a.map(((e,t)=>Ga(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(i,s)).join("")}const Ka=e=>"_"===e,Ga=e=>/\d/.test(e),Xa=e=>Ka(e)||Ga(e),Ja=1940,Za={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},Qa=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=a(l||"");return i((()=>{g(l||"")}),[l]),i((()=>{ti({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d})}),[p]),c("div",{onClick:()=>{null!==h.current&&h.current.focus(),m?.()},className:u("relative",n),children:[o("input",{ref:h,className:"h-full w-full px-m text-l text-black focus-visible:outline-none",value:p,type:"text",onChange:e=>{const t=e.target?.value;"string"==typeof t&&t?.length<11&&g(Ya(t,"__.__.____"))},onBlur:()=>{ei(p)?ti({inputValue:p,setSelectedMonth:e,setSelectedYear:t,onChange:d}):g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Za})]})})),ei=e=>{const[t,n,a]=e.split(".");if((e=>Number(e)>=Ja&&Number(e)<=(new Date).getFullYear())(a)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(a),Number(n)-1,1);let i=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),i++;return Number(t)>0&&Number(t)<=i}return!1},ti=({inputValue:e,setSelectedMonth:t,setSelectedYear:n,onChange:a})=>{if(ei(e)){const{day:i,month:l,year:r}=(e=>{const[t,n,a]=e.split(".");return{day:Number(t),month:Number(n)-1,year:Number(a)}})(e);t(l),n(r),a?.(new Date(r,l,i))}},ni=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:a,setSelectedMonth:i,setSelectedYear:l,disabled:r=!1})=>o(Qa,{onChange:a,disabled:r,onClick:e,value:t&&$t(t),setSelectedMonth:i,setSelectedYear:l,className:u("flex justify-between items-center h-14 border rounded-md cursor-pointer hover:border-black active:border-black focus:border-black",n?"border-gray":"border-error")}),ai=Ha.map((e=>({key:e}))),ii=Array.from({length:(new Date).getFullYear()-Ja+1},((e,t)=>Ja+t)).reverse().map((e=>({key:String(e)}))),li=(e,t)=>{const n=new Date(e,t,1);let a=0;for(;n.getMonth()===t;)a++,n.setDate(n.getDate()+1);return a},ri=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:a,onChange:i})=>{a&&i?.(new Date(t,n,Math.min(e,a.getDate())))},si={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},oi={className:"min-w-32",iconVersion:"black",isBorder:!1},ci=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=on(!1),[f,x]=a(n?.getMonth()||(new Date).getMonth()),[y,b]=a(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:I,ref:T}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:a,onYearSelect:i,selectedYear:r,onChange:s,value:o})=>{const c=dn(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?a(n+1):(a(0),i(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?a(n-1):(a(11),i(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{a(Ha.indexOf(e));const t=li(r,Ha.indexOf(e));ri({maxDateOfMonth:t,selectedYear:r,selectedMonth:Ha.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{i(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:ai,yearsOptions:ii,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),R=((e,t)=>{const[n,l]=a(!1);return i((()=>{const n=()=>{if(e?.current){const{top:n}=e.current.getBoundingClientRect();l(n>t)}};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)}),[e]),n})(T,370);return c("div",{className:u("space-y-xs",e),ref:T,children:[gn(t),c("div",{className:"relative",children:[ni({handleChangeVisibleCalendar:I,value:n,valid:r,onChange:h,disabled:m,setSelectedMonth:x,setSelectedYear:b}),p&&!m?c("div",{className:u("absolute bg-white z-20 select-none",{"bottom-full":R}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...si,className:"-rotate-90 cursor-pointer"})}),o(Dn,{onChange:w,value:{key:Ha[f]},options:S,...oi}),o(Dn,{onChange:C,value:{key:String(y)},options:k,...oi}),o("div",{className:"my-auto",onClick:N,children:o(W,{...si,className:"rotate-90 cursor-pointer"})})]}),o(Wa,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),di=d((({className:e,label:t,error:n,errors:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ci,{label:mn({label:t,errors:a}),valid:Boolean(!n),...i}),yn(n)]}))),mi=d((({field:e,input:t})=>o(di,{label:"Дата рождения",...ca(e("birthday"),ra.birthday,t?.required)}))),ui=d((({field:e,input:t})=>o(kn,{label:"Количество объектов инкассации",isInteger:!0,...ca(e("collectionCount"),ra.collectionCount,t?.required)}))),hi=d((({field:e,input:t})=>o(kn,{className:"col-span-2",...ca(e("comment"),ra.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),pi=d((({className:e,viewBox:t,fill:n="none",width:a,height:i,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:a,height:i,children:l.map((({d:e,fill:t,...n},a)=>{const i={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:i.stroke,strokeLinecap:i.strokeLinecap,strokeLinejoin:i.strokeLinejoin,strokeWidth:i.strokeWidth,strokeMiterlimit:i.strokeMiterlimit},a)}))}))),gi="appearance-none w-5 h-5 border-solid flex-none",fi=[{d:"M10.207.793a1 1 0 0 1 0 1.414l-6 6a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L3.5 6.086 8.793.793a1 1 0 0 1 1.414 0Z",fillRule:"evenodd",clipRule:"evenodd",fill:"white"}],xi=d((({className:e,value:t,text:n,disabled:a,isRadio:i,onChange:r})=>{const s=l((e=>{a||(e.preventDefault(),r&&r(!t))}),[r,a,t]),d=i?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(pi,{paths:fi,className:"absolute left-1 ml-px block",width:"11",height:"9",fill:"white",viewBox:"0 0 11 9"});return o("div",{className:e,children:c("label",{className:u("flex items-center relative group/box",bi(a)),onClick:s,children:[o("div",{className:u(gi,"m-0",i?"rounded-full border-2":Ni(t),!a&&t?"border-primary-main":"border-gray",a?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:vi(i),"aria-checked":Boolean(t),"aria-disabled":Boolean(a),"aria-label":n}),t?d:null,yi(n)]})})})),yi=e=>e?o("div",{className:"ml-s",children:o(Ae,{size:"text-l",font:"font-light",children:e})}):null,bi=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",vi=(e=!1)=>e?"radio":"checkbox",Ni=(e=!1)=>u("rounded border",{"bg-primary-main":e}),wi="consentToReceiveMaterials",Ci=d((({field:e,input:t})=>o(xi,{text:"Согласен на получение информационных и аналитических материалов по электронной почте",...ca(e(wi),ra[wi],t?.required)}))),Si=d((({field:e,input:t})=>o(di,{label:"Желаемая дата встречи",...ca(e("desiredMeetingDate"),ra.desiredMeetingDate,t?.required)}))),ki=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{label:"Электронная почта",...ca(e("email"),ra.email,n),...a})})),Ii=[{key:"ULTRASERVICE",text:"Ультра"}],Ti=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Ri=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],Bi=d((({field:e,input:t})=>o(Mn,{label:"Способ получения ответа",options:Ri,...ca(e("feedbackMethod"),ra.feedbackMethod,t?.required)}))),Pi=d((({field:e,input:t})=>o(kn,{label:"ФИО",...ca(e("fullName"),ra.fullName,t?.required),...t})));function Di(e,t){for(const[n,a]of e.entries())null!=a?t.setItem(n,a):t.removeItem(n)}const _i={};function Ei(e,t=_i){const n=s(null),o=function(){const[,e]=a(0);return l((()=>e((e=>(e+1)%65536))),[])}();return i((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,a)=>(n.current||=new Set,n.current.add(a),e.getItem(a)),has:(t,a)=>(n.current||=new Set,n.current.add(a),e.hasItem(a)),set:(t,n,a)=>(e.setItem(n,a),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const Ai=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new me){this.bus=e}hasItem(e){return this.store.has(e)}getItem(e){return this.store.get(e)}entries(){return this.store.entries()}setItem(e,t){this.store.set(e,t),this.bus.subject(e,t)}removeItem(e){this.store.delete(e),this.bus.subject(e,null)}};var Mi,Oi;function Fi(e){return Ei(Ai,e)}Mi=Ai,Oi=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new me){this.storage=e,this.bus=t}hasItem(e){return Boolean(this.storage?.getItem(String(e)))}getItem(e){const t=this.storage?.getItem(String(e))??null;try{return JSON.parse(String(t))}catch(e){return null}}entries(){return Array.from({length:this.size},((e,t)=>{const n=String(this.storage?.key(t));return[n,this.getItem(n)]}))}setItem(e,t){null!==t?this.storage?.setItem(String(e),JSON.stringify(t)):this.storage?.removeItem(String(e)),this.bus?.subject(e,t)}removeItem(e){this.storage?.removeItem(String(e)),this.bus?.subject(e,null)}}(globalThis?.localStorage),Di(Mi,Oi),Di(Oi,Mi),Mi.bus.watch((({type:e,event:t})=>{null!=t?Oi.setItem(e,t):Oi.removeItem(e)}));const zi=()=>Fi(),Vi=(e,t)=>{if(!t)return null;const n=qi(e),a=+t?.split(".")[0],i=+t?.split(".")[1];switch(a){case 1:return n("AGRICULTURE");case 35:return n("FUEL_AND_ENERGY");case 41:case 42:case 43:return n("CONSTRUCTION");case 46:case 47:return n("TRADE");case 55:case 79:return n("TOURISM");case 62:return n("TECHNOLOGY");case 63:return n("CONSULTING_SERVICE");case 64:return n("BANK");case 65:return n("INSURER");case 66:return n("FINANCIAL_INSTITUTIONS");case 72:case 74:return n("SCIENCE");case 80:return n("SECURITY");case 84:return n(i<22?"GOVERNANCE":22===i?"ARMY":"OTHER_SECTORS");case 85:return n("EDUCATION");case 86:return n("HEALTHCARE");case 87:return n("SOCIAL_SPHERE");default:return n(a>=10&&a<=33?"INDUSTRY":a>=5&&a<=9?"FUEL_AND_ENERGY":a>=49&&a<=53?"TRANSPORT":"OTHER_SECTORS")}},Li=(e,t)=>{if(!t)return null;const[n]=[e?.find((e=>t<=Number(e.description)))].map((e=>({key:e?.key??"",text:e?.value??""})));return n},ji=(e,t)=>{const n=qi(e);return[40001,40002,71610].includes(t)?n("FOREIGN"):n("RUSSIAN")},$i=(e,t,n)=>{const a=qi(e);return a("7725114488"===n?"RSHB":50102===t?"SOLE_TRADER":t>=75e3&&t<=75505&&75500!==t?"BUDGETARY":"COMMERCIAL")},qi=e=>t=>e.map((e=>({key:e.key,text:e.value}))).find((e=>e.key===t))??null,Ui=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Wi=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",a=e(n).value,i=l((t=>{e?.(n)?.onChange?.(Hi(t))}),[]),r=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,n),label:"Адрес",...ca(e(n),ra[n],t?.required),value:a?.fullAddress,onChange:r,...t,onDaDataChange:i})})),Hi=e=>({apartment:e?.data?.flat,city:e?.data?.city,district:e?.data?.area_with_type,fullAddress:e?.unrestricted_value,fiasCode:e?.data?.fias_id,house:e?.data?.house,locality:e?.data?.settlement_with_type,okatoRegionCode:e?.data?.okato,postcode:e?.data?.postal_code,region:e?.data?.region,regionCode:e?.data?.region_kladr_id?e?.data?.region_kladr_id.substring(0,2):"",street:e?.data?.street,qc:e?.data?.qc,qcComplete:e?.data?.qc_complete,qcHouse:e?.data?.qc_house}),Yi=(e,t,n)=>{const{okved:a,okopf:i,inn:l}=Ki(n);t?.("legalForm")?.onChange?.(n.data?.opf?.short),t?.("organizationAddress")?.onChange?.(Hi(n.data?.address));const r={amountWorkers:Li(e?.amountWorkers,n.data?.employee_count),employerActivities:Vi(e?.employerActivities??[],a),organization:$i(e?.organization??[],i,l),employerOrganization:ji(e?.employerOrganization??[],i)};for(const e in r)r[e]&&t?.(e)?.onChange?.(r[e])},Ki=e=>({inn:e.data?.inn??"",okopf:Number(e.data?.opf?.code),okved:e.data?.okved??""}),Gi=d((({field:e,input:t})=>{const n=zi(),a=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),Yi(n,e,t)}),[]);return o(kn,{label:"ИНН",isInteger:!0,maxLength:12,...t,...ca(e("inn"),ra.inn,t?.required),onDaDataChange:a})})),Xi=d((({className:e,text:t,value:n,key:a,disabled:i,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(xi,{text:t,value:n,disabled:i,onChange:r},a),yn(l)]}))),Ji=d((({field:e})=>o(Xi,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Zi=`${Ut}/outservice`,Qi=[];async function el(){const e=await Pt(`${Zi}/outserviceregions`);return e&&Array.isArray(e)?e:Qi}const tl=d((({field:e,input:t})=>{const n=e("region"),a=n?.value?.key,{data:l}=ba("outServiceRegions",el),r=l?.find((e=>e.code===a))?.localities?.map((e=>({key:e,text:e})));return i((()=>{""!==a&&e?.("localities")?.onChange?.("")}),[a]),o(Mn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:r,...ca(e("localities"),ra.localities,t?.required),isSearch:!0})})),nl="middleName",al=d((({field:e,input:t})=>o(kn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Ui(e,nl),...ca(e(nl),ra.middleName,t?.required),...t}))),il=d((({field:e,input:t})=>o(kn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Ui(e,t.name??""),...ca(e("name"),ra.name,t?.required),...t}))),ll=d((({value:e=!1,text:t,type:n="checkbox",onChange:a})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>a&&a(!e),children:[o("div",{className:u("relative flex-shrink-0 duration-300 w-9 h-5 mr-s rounded-2xl",e?"bg-primary-main":"bg-main-divider"),children:o("div",{className:u("absolute opacity-80 duration-500 top-0.5 w-4 h-4 bg-white rounded-full",e?"left-1/2":"left-[5%]")})}),t?o(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),rl=d((({field:e})=>ua(e("acquiringType")?.value?.key)?o(ll,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),sl=d((({field:e,input:t})=>{const{required:n,...a}=t;return o(kn,{...ca(e("partnerComments"),ra.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...a})})),ol=e=>"_"===e,cl=e=>/\d/.test(e),dl=e=>ol(e)||cl(e),ml=[..."+7 (___) ___-__-__"],ul=ml.findIndex(ol),hl=ml.map(((e,t)=>dl(e)?ml.slice(0,t).filter(dl).length:-1));function pl(e){const t=e.replace(/\D/g,""),n=ml.map(((e,n)=>cl(e)?e:t.charAt(hl[n])||e)),a=hl.indexOf(t.length-1)+1;return(a?n.slice(0,Math.max(ul,a)):n).join("")}const gl=d((({children:e,onChange:t,...n})=>{const a=l((e=>t&&t(pl(e))),[t]),i=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(fn,{...n,onChange:a,onFocus:e=>a(e?.target?.value||""),onBlur:e=>i(e?.target?.value||""),children:e})})),fl=d((({className:e,label:t,error:n,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gl,{"aria-label":t,label:mn({label:t,errors:a?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...a}),yn(n)]}))),xl=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(fl,{label:"Телефон",...ca(e(n),ra.phone,t?.required),disabled:t?.filledByEsia&&Ui(e,n),...t})})),yl=d((({field:e})=>ua(e("acquiringType")?.value?.key)?o(ll,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),bl=d((({field:e,source:t})=>o(Mn,{placeholder:"Выберите продукт",label:"Продукт",options:vl(t?.productList),...oa(e("product"),ra.product)}))),vl=e=>(e??[]).map((e=>({key:e,value:e}))),Nl=`${Ut}/regions`,wl=[];function Cl(e=Nl){const{data:t}=ba(e,Dt);return Array.isArray(t)?t:wl}const Sl=`${Ut}/outservice/outserviceregions`,kl=d((({field:e,input:t,params:n})=>{var a;const i=Cl((a=n?.typeForm,"OUTSERVICE"===a?Sl:void 0));return o(Mn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...ca(e("region"),ra.region,t?.required)})})),Il=d((({field:e,input:t})=>{const n=Sa(!0),a=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(Mn,{label:"Регион",placeholder:"Выберите регион",options:a,...ca(e("region"),ra.region,t?.required)})})),Tl=d((({field:e})=>{const t=e("secondaryPhone");return o(fl,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?oa(t,ra.secondaryPhone):t})})),Rl=d((({field:e,input:t})=>o(Mn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Ti,...ca(e("serviceDirection"),ra.serviceDirection,t?.required)}))),Bl=d((({field:e,input:t})=>o(kn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Ui(e,"surname"),...ca(e("surname"),ra.surname,t?.required),...t}))),Pl=["От 1 мес","До 15 лет"],Dl=d((({field:e})=>o(Ea,{title:"Срок, месяцев",items:Pl,min:1,max:180,...e("term")}))),_l=d((({field:e,input:t})=>o(Mn,{label:"Тип обслуживания",options:Ii,...ca(e("serviceType"),ra.serviceType,t?.required)}))),El={horizontal:"@lg:flex-row",vertical:""},Al=d((({label:e,items:t,value:n,className:a,onChange:i,disabled:l=!1,orientation:r="horizontal"})=>c("div",{className:"grid gap-xs whitespace-nowrap",children:[e?o("div",{role:"radiogroup","aria-label":e,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",El[r],a),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(xi,{isRadio:!0,text:t,value:n===e,onChange:()=>i&&i(e),disabled:l},String(e))))})]}))),Ml=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ol=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return i((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(Al,{className:"whitespace-normal",orientation:"horizontal",items:Ml,value:t,onChange:e=>n&&n(e)})})}));const Fl={$ref:"/wcms-resources/outservice-productlist.json"},zl={fullName:e=>o(Pi,{...e}),addressBranch:e=>o(Ia,{...e}),desiredMeetingDate:e=>o(Si,{...e}),product:e=>o(bl,{...e,source:Fl}),localities:e=>o(tl,{...e}),isClient:e=>o(Ji,{...e}),partnerComments:e=>o(sl,{...e}),collectionCount:e=>o(ui,{...e}),acquiringType:e=>o(ma,{...e}),onlineCheckout:e=>o(rl,{...e}),posTerminal:e=>o(yl,{...e}),serviceType:e=>o(_l,{...e}),term:e=>o(Dl,{...e}),amount:e=>o(Fa,{...e}),annualRevenue:e=>o(za,{...e}),vedTypes:e=>o(Ol,{...e}),feedbackMethod:e=>o(Bi,{...e}),serviceDirection:e=>o(Rl,{...e}),bankEmpolee:e=>o(Va,{...e}),secondaryPhone:e=>o(Tl,{...e}),applicationDate:e=>o(kn,{label:"Дата и время обращения в Банк",...e}),region:e=>ka(e?.params?.typeForm)?o(Il,{...e}):o(kl,{...e}),consentToReceiveMaterials:e=>o(Ci,{...e}),surname:e=>o(Bl,{...e}),name:e=>o(il,{...e}),middleName:e=>o(al,{...e}),birthday:e=>o(mi,{...e}),phone:e=>o(xl,{...e}),email:e=>o(ki,{...e}),inn:e=>o(Gi,{...e}),comment:e=>o(hi,{...e})},Vl=(e,t,n={})=>(a,i)=>{const l={...zl,...n};return function({input:e,field:t}){const{condition:n}=e,{value:a}=t(n?.name||"");return!n||n?.values?.find((e=>e===(a?.key??a)))}({input:a,field:e})?o("div",{children:l[a?.name||""]?.({field:e,input:a,params:t})},String(i)):null},Ll=e=>2===e?"@xl:grid-cols-2":"",jl=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Ae,{size:"text-h6",children:e})}):null,$l=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0,size:a="big"})=>o("div",{className:u("flex justify-center items-center h-full w-full z-50",t,{"backdrop-blur":n}),children:o("div",{className:u("inline-block ","animate-spin rounded-full","border-solid border-current","border-r-transparent","small"===a?"border-4 h-8 w-8":"border-8 h-28 w-28",e),role:"status"})})));function ql({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Ul={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"},Wl={primary:u("group-data-secondary:text-primary-main group-data-secondary:bg-white","group-data-secondary:hover:text-white group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active"),secondary:u("group-data-secondary:text-white group-data-secondary:bg-white/20","group-data-secondary:hover:bg-primary-hover","group-data-secondary:active:bg-primary-active")},Hl=d((({children:e,...t})=>{const n=e=>({...e,onClick:ce(ql(e))}),{className:a,version:i="primary",active:l,disabled:r,isLoading:s,type:d="button",rounded:m=!0,role:h,onClick:p}=n(t);return c("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs relative",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r||s,"rounded-md":m},l||r||s?"":u(Ul[i],Wl[i]),a),type:d,role:h,onClick:p,children:[s?o($l,{blur:!0,size:"small"}):null,e]})})),Yl=d((({className:e,onClose:t})=>o("button",{className:u("flex justify-center items-center w-12 h-12 p-2xs bg-transparent border-none",e),onClick:t,title:"Закрыть",type:"button",children:o(W,{name:"CloseIcon",width:"20",height:"20",iconVersion:"gray"})}))),Kl=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{className:u("relative bg-white pt-0 p-lg",e),role:"dialog",onClick:i,children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(Yl,{className:"absolute top-0 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]}))),Gl=d((({responseType:e,typeForm:t,onClose:n})=>{const a="OK"===e,i="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto",onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:a?"ResponseOKIcon":"ResponseFailIcon",iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:a?"Ваша заявка отправлена":"Не удалось отправить заявку",description:a?i:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Hl,{type:"button",onClick:n,children:"Хорошо"})]})})})),Xl=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],Jl=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:a,amount:i,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:a=!1,term:i,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${ua(t?.key)?`/Онлайн касса=${n}/POS-терминал=${a}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${i}/Выручка=${r}`})(e):null,u={...d,...Ql(o),...Zl(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Zl=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},Ql=e=>e?{vedTypes:Object.fromEntries(Ml.map((({id:t})=>[t,t===e])))}:{},er={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:da[0],serviceType:Ii[0],feedbackMethod:Ri[0],serviceDirection:Ti[0],vedTypes:Ml[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},tr=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Ae,{children:e}):null,t?o(Ne,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Ae,{children:t.text})}):null]}))),nr=(e,t)=>o(Hl,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),ar=(e,t,n)=>c("div",{className:"flex col-span-2 gap-xs flex-col w-full items-baseline",children:[e?c("div",{children:[c("div",{className:"flex gap-3 items-center",children:[o(xi,{...e}),o(tr,{link:t})]}),yn(oa(e,Gn).error)]}):o(tr,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),nr(n)]}),ir={send:async function(e,t=!1){const{typeForm:n,region:a,phone:i="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f=`${Ut}${g?"/lead":"/sendcorporatelead"}`,x={typeForm:n,...Yt(a,g),...Kt(l,g),...Wt(i),...Ht(s,"desiredMeetingDate"),...g?Ht(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Gt(d)},...p};try{const e=await fetch(f,{method:"POST",headers:{"Content-Type":"application/json"},mode:"cors",body:JSON.stringify(x)});return e?.ok?await e.json():null}catch(e){return null}}},lr=d((({className:e,title:t,typeForm:n="",sections:r=[],button:s,link:d,endpoint:m,additionalParams:h,isContacts:p,data:g,...f})=>{const x=r?.flatMap((e=>e?.inputs))||[],y=((e,t="")=>({...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||er[e.name||""]]))),typeForm:{key:t,text:""}}))(x,n),[b,v]=a(""),N=sn(Gl),C=l((async(e,t)=>{const a=rr(x,e),i=Xl(sa(a));if(!On(i(e)))return console.warn("validation fail");const l=Jl({...e,...h}),r=await ir.send(l,"lead"===m)?"OK":"Fail";if(v(r),r&&N.open({typeForm:n,responseType:r}),"OK"===r&&g){const e=tn();Xt({aspectsAttributes:g,aspects:e,ev:t})}return r}),[n]),[,{field:S,onSubmit:k,reset:I}]=an(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return i((()=>{"OK"===b&&(v(""),I())}),[b]),c(rn,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Ll(e.columns),"grid gap-x-m"),children:[jl(e.title),(e?.inputs||[])?.map(Vl(S,{typeForm:n}))]},`section-${t}`))),ar(T?S("consentDataProcessing"):void 0,d,s)]}),p?c("div",{className:"space-y-m",children:[o(w,{headingType:"h6",title:"Или свяжитесь с нами удобным способом",className:"@xl:text-center"}),c("div",{className:"flex sm:justify-center gap-xl",children:[c("a",{className:"flex gap-s items-center text-primary-text no-underline",href:"tel:8 (800) 200-78-70","aria-label":"телефон 8 (800) 200-78-70",children:[o(ne,{image:{icon:"PhoneIcon"},width:"24",height:"24"}),o("span",{children:"8 (800) 200-78-70"})]}),c("a",{className:"flex gap-s items-center text-primary-text no-underline","aria-label":"почта ved@rshb.ru",href:"mailto:ved@rshb.ru",children:[o(ne,{image:{icon:"MailIcon"},width:"24",height:"24"}),o("span",{children:"ved@rshb.ru"})]})]})]}):null]})})),rr=(e,t)=>e.filter((e=>!e?.condition||e?.condition.values.find((n=>{const a=t?.[e?.condition?.name??""];return n===(a?.key??a)})))),sr=[{columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0},{fieldType:"common",name:"name",required:!0,dadata:!0},{fieldType:"common",name:"middleName",dadata:!0},{fieldType:"common",name:"limitedBirthday",required:!0},{fieldType:"common",name:"phone",required:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{inputs:[{fieldType:"common",name:"processPersonalDataFlg",required:!0},{fieldType:"common",name:"consentProviderFlg",required:!0},{fieldType:"common",name:"consentOthersFlg",required:!0},{fieldType:"common",name:"consentInformFlg"},{fieldType:"common",name:"consentPfrFlg"}]}],or=d((({field:e,input:t})=>{const n="addressFact",a=e(n).value,{value:r}=e("addressMatch");i((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r,e("addressRegistration").value]);const s=l((t=>{e?.(n)?.onChange?.({apartment:t?.data?.flat,city:t?.data?.city,district:t?.data?.area_with_type,fullAddress:t?.value,fiasCode:t?.data?.fias_id,house:t?.data?.house,locality:t?.data?.settlement_with_type,okatoRegionCode:t?.data?.okato,postcode:t?.data?.postal_code,region:t?.data?.region,regionCode:t?.data?.region_kladr_id?t?.data?.region_kladr_id.substring(0,2):"",street:t?.data?.house,qc:t?.data?.qc,qcComplete:t?.data?.qc_complete,qcHouse:t?.data?.qc_house})}),[]),c=l((t=>{e?.(n)?.onChange?.({apartment:"",city:"",district:"",fullAddress:t,fiasCode:"",house:"",locality:"",okatoRegionCode:"",postcode:"",region:"",regionCode:"",street:"",qc:"",qcComplete:"",qcHouse:""})}),[]);return o(kn,{label:"Адрес",disabled:r,...ca(e(n),ra[n],t?.required),value:a?.fullAddress,onChange:c,...t,onDaDataChange:s})})),cr=d((({field:e,input:t})=>o(Xi,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...ca(e("addressMatch"),ra.addressMatch,t?.required)}))),dr="/icons/MapMarkerClusterIcon.svg",mr="/icons/MapMarkerClusterYellowIcon.svg";function ur({yandexMaps:e,map:t,points:n,isLoad:a}){if(a||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const i=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=hr("offices",e,i);if(n.length&&n.every((e=>"type"in e))){const a=hr("workplaces",e,i),r=pr(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=pr(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),a.add(r),t.geoObjects.add(a),t.geoObjects.add(l)}else{const a=pr(n,"offices",e);l.add(a),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const hr=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?dr:mr,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),pr=(e,t,n)=>e.map((({coords:e,content:a})=>new n.Placemark(e,{balloonContentHeader:a?.header,balloonContentBody:a?.body,balloonContentFooter:a?.footer,hintContent:a?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?dr:mr,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),gr={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},fr={...gr,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},xr=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(fr).join(" ")} ${n}`,onClick:()=>{t.geolocation.get({provider:"yandex",autoReverseGeocode:!0,mapStateAutoApply:!0}).then((function(t){e.current.geoObjects.add(t.geoObjects)}))},children:o(W,{name:"UserGeoLocationIcon",width:"20",height:"16"})}),yr=e=>globalThis[e];function br(e,t,n=!0){const[l,r]=a(void 0);return i((()=>{let a=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=yr(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(yr(e))}))}))}return new Promise(((n,a)=>{const i=document.createElement("script");i.src=t,i.async=!0,i.id=t,i.addEventListener("load",(()=>{n(yr(e))})),i.addEventListener("error",(e=>{a(e)})),document.head.appendChild(i)}))})(e,t).then((e=>{a&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(a=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const vr={...gr,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Nr=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),a="in"===t?n+1:n-1;e.current.setZoom(a,{checkZoomRange:!0})},className:`${Object.values(vr).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),wr=[55.753995,37.614069],Cr=d((({points:e,className:t="",zoom:n=5,isLoad:a,selectedAddress:l})=>{const r=s(null),d=s(null),m=br("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(i((()=>{r.current?ur({yandexMaps:m,map:r.current,points:e,isLoad:a}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Sr(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),ur({yandexMaps:m,map:r.current,points:e,isLoad:a})})),r.current&&l&&m?.geocode(l).then((e=>{const t=e.geoObjects.get(0).geometry.getCoordinates();r.current.setCenter(t),r.current.setZoom(18)}))}),[m,e,n,a,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[a?o($l,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Nr,{yandexMaps:r}),o(Nr,{yandexMaps:r,direction:"out"})]}),xr(r,m,u("right-2 top-80",h))]})})),Sr=e=>{const t=[Ir(kr(e,0)),Ir(kr(e,1))];return t.every((e=>e))?t:wr},kr=(e,t)=>e.map((e=>e.coords?.[t])),Ir=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Tr=async(e,t,n)=>{try{return(await Rr(e,t,n)).json()}catch(e){return console.error(e),null}};async function Rr(e,t,n){return globalThis?.fetch?.(`${Ut}${e}`,{method:t,headers:{"Content-Type":"application/json",...Br()},credentials:"include",body:n?JSON.stringify(n):null})}const Br=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Pr=e=>Number(e.toString().replace(",",".")),Dr=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:i,renderFoldButton:r})=>{const[s,o]=a(n),d=l((()=>{o((e=>!e))}),[]),m=i({isUnfolded:s,onToggle:d}),u=r?r({isUnfolded:s,onToggle:d}):null;return c("div",t?{className:e,role:"group",children:[u,m]}:{className:e,role:"group",children:[m,u]})}));const _r=d((({className:e="",isUnfolded:t,children:n})=>{const a=s(null),l=function(e,t){const n=s(null);return i((()=>{const t=n?.current;if(!t)return;const a=new ResizeObserver((n=>{e(t,n[0])}));return a.observe(t),()=>{a.disconnect()}}),[e,...t]),n}((e=>{a.current&&(a.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:a,className:`transition-max-h duration-300 overflow-hidden ${a.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Er=d((({value:e,subText:t,children:n,isPhone:a,...i})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Ar({textItems:l,subText:t,children:n,isPhone:a,...i})})),Ar=({label:e,labelSize:t="text-m",textItems:n,subColor:a,subText:i,className:l,children:r,isPhone:s=!1})=>c("div",{className:u("flex gap-2xs flex-col h-full max-w-[300px]",l),children:[e?o(Ae,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Mr(n,s),i?o(Ae,{color:a,size:"text-m",children:i}):null]}),Mr=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Ae,{size:"text-l",children:t?o("a",{href:`tel:${Or(e)}`,children:e.trim()}):e.trim()},String(n)))),Or=e=>e.replace(/\D/g,""),Fr=d((({className:e,children:t})=>o("div",{className:u("flex flex-col sm:flex-row sm:border-t sm:border-solid sm:border-main-divider py-xl gap-x-6xl gap-y-xl",e),children:t}))),zr=e=>{const t=Lr(e);return o(Er,{label:"Режим работы",value:t,className:"max-w-none"})},Vr=({workTime:e="",lunchHour:t="",daysOff:n=""},a=!1)=>e?[`${a?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Lr=e=>{const t=e.find((e=>"workingSaturday"!==e.key&&Boolean(e.status)&&Boolean(e.workTime))),n=e.find((e=>"workingSaturday"===e.key&&Boolean(e.status)&&Boolean(e.workTime))),a=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Vr({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":a}),Vr({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:a},!0)].filter(Boolean)},jr=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],$r=e=>jr.map((([t,n,a])=>({key:t,title:a,short:n,status:Boolean(e?.[t]),get workTime(){return"workingSaturday"===t?e?.workTimeSaturday:e?.workTime},get lunchHour(){return"workingSaturday"===t?e?.lunchHourSaturday:e?.lunchHour},get hasLunch(){return/\d+/.test(this.lunchHour??"")}}))),qr=e=>{if(!e)return null;const t=Ur(e);return c(Fr,{className:"border-none",children:[o(Er,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Wr)})}),o(Er,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]})},Ur=e=>{const t=jr.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],a=n[n.length-1]?.toLowerCase();return a?.includes("выходной")?t.map((e=>({...e,status:!a?.includes(e.short.toLowerCase())}))):t},Wr=({short:e,status:t},n)=>o("div",{className:u("w-9 h-9 rounded-md flex items-center justify-center",t?"bg-green-more-light text-green-dark":"bg-error/30 text-error"),children:o(Ae,{size:"text-xs",children:e})},String(n)),Hr=({currency:e,buyExchangeRate:t,saleExchangeRate:n},a)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Er,{label:"Валюта",value:e.currency}):null,t?o(Er,{label:"Купить",value:String(t)}):null,n?o(Er,{label:"Продать",value:String(n)}):null]},String(a)),Yr={yellow:{border:"border-yellow-light",text:"text-yellow"},green:{border:"border-green-more-light",text:"text-green-dark"},gray:{border:"border-gray",text:"text-secondary-text"},red:{border:"border-error/30",text:"text-error"}},Kr=d((({className:e,children:t,color:n="gray"})=>c("div",{className:u("sm:p-s sm:border sm:border-green rounded-md flex items-center h-fit",Yr[n].border,e),children:[o("div",{className:"block pr-m sm:pr-0 sm:hidden",children:o(ne,{image:{icon:"SmallClockIcon"},width:"24",height:"24"})}),o(Ae,{size:"text-m",color:Yr[n].text,children:t})]}))),Gr=(new Date).getDay(),Xr=e=>{const[t]=e?.slice(Gr-1)??[];if(!t)return null;const{lunchHour:n,status:a,workTime:i,hasLunch:l}=t;return a?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[i?o(Kr,{color:"green",children:i}):null,n&&l?o(Kr,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Kr,{color:"red",children:"Выходной"})},Jr=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Zr=({title:e,status:t,workTime:n,lunchHour:a,hasLunch:i},l)=>o(Er,{label:e,value:t&&n?n:"",subText:Jr({lunchHour:a,hasLunch:i,status:t}),subColor:!t||i?"text-error":"text-green-dark"},String(l)),Qr=["ArrowDownIcon","ArrowUpIcon"],es=["Подробнее","Скрыть"],ts=({isUnfolded:e,onToggle:t})=>c("button",{className:"w-full py-2xl cursor-pointer text-primary-main flex items-center border-b border-solid border-main-divider",onClick:t,type:"button",children:[o("div",{className:"pr-m",children:es[Number(e)]}),o(W,{className:"text-primary-text",name:Qr[Number(e)],width:"16",height:"16"})]}),ns=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,as=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,is=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,ls=({name:e,address:t,phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=$r(d);return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ae,{size:"text-h4",children:e}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),Xr(h)]}),o("div",{className:"hidden sm:block",children:rs({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:rs({phone:n,fax:a,phoneBusiness:i,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(u))},rs=({phone:e,fax:t,phoneBusiness:n,phoneNatural:a,phoneCallCentre:i,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=$r(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(Fr,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Er,{label:"Факс",value:t,isPhone:!0}),o(Er,{label:"Телефон филиала",value:e,isPhone:!0}),o(Er,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Er,{label:"Обслуживание физических лиц",value:a,isPhone:!0}),o(Er,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Er,{label:"Контакт-центр",value:i,isPhone:!0})]}),r?.isMatchesPattern?o(Fr,{children:o(Er,{label:m,labelSize:"text-l",className:"w-full max-w-none",children:o("div",{className:"flex flex-wrap gap-xs sm:justify-between pt-xs",children:d?.map(Zr)})})}):c(Fr,{children:[o(Er,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Wr)})}),zr(d)]}),r?.businessScheduleVisibleTag?qr(r?.businessScheduleDescription):null,s?.currencies?.length?o(Fr,{className:"flex-wrap",children:s?.currencies?.map(Hr)}):null]})},ss=({name:e="",address:t="",workSchedule:n})=>{const a=(i=e)?`${i?.charAt(0)?.toUpperCase()}${i?.slice(1)}`:"";var i;const l=`${t} ${(e=>{const t=$r(e),n=e?Lr(t):"",a=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ns(n):is(n,a):as(n):""})(n)}`;return{header:a,body:l}},os={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},cs={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ds={workingSaturday:e=>Boolean("workSchedule"in e&&e.workSchedule?.workingSaturday),premiumService:e=>Boolean("premiumService"in e&&e.premiumService),privateBanking:e=>Boolean("privateBanking"in e&&e.privateBanking),remoteWorkplace:e=>Boolean("workScheduleDescription"in e),serviceDisabledPeople:e=>Boolean("serviceDisabledPeople"in e&&e.serviceDisabledPeople),sellingCoins:e=>Boolean("sellingCoins"in e&&e.sellingCoins),buyingCoins:e=>Boolean("buyingCoins"in e&&e.buyingCoins),bullionOperations:e=>Boolean("bullionOperations"in e&&e.bullionOperations),preciousMetalsOperations:e=>Boolean("preciousMetalsOperations"in e&&e.preciousMetalsOperations),transferringDataToBiometricSystem:e=>Boolean("transferringDataToBiometricSystem"in e&&e.transferringDataToBiometricSystem)},ms=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ds[t](e)))))},us=()=>{},hs=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:a=us,getBalloonRemoteWorkplaces:i=us})=>{const[l,s,o,c]=r((()=>{const l=ms(e,n),r=ms(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i({address:e.address,workScheduleDescription:e.workScheduleDescription})})))].filter((e=>e.coords&&2===e.coords.length));return[l,s,r,l.length+r?.length]}),[e,t,n,a,i]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},ps=e=>{const{data:t,error:n}=ba(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,gs);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},gs=async e=>await Pt(e,{method:"POST"})||[],fs=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),xs=d((({children:e})=>fs?e:null)),ys=d((({field:e,input:t})=>{const[n,l]=a([]),{data:r}=ps("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");i((()=>{(async()=>{const e=await(async e=>{const t=await Tr("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0});return t?.offices?.map((e=>({...e,gpsLatitude:Pr(e.latitude??wr[0]),gpsLongitude:Pr(e.longitude??wr[1])})))||[]})(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=hs({data:n,filtrationState:{},getBalloon:ss}),u=Boolean(s?.key);return c("div",{children:[o(Mn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...ca(e("addressRetail"),ra.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(xs,{children:o(Cr,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),bs=zt((({field:e,source:t,fieldName:n,input:a,placeholder:i="Выберите из списка",options:l,...r})=>{const s=t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(Mn,{placeholder:i,options:s,...ca(e(n),ra[n],a?.required),...r})})),vs=d((({field:e,input:t})=>{const{data:n}=ps("EMPLOYEES_NUMBER"),a=zi();return i((()=>{n&&(a.amountWorkers=n)}),[n]),o(bs,{field:e,source:a.amountWorkers??[],label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Ns=d((({field:e,input:t})=>o(Xi,{text:"Наличие военного билета",...ca(e("armyIdFlg"),ra.armyIdFlg,t?.required)}))),ws=d((({field:e,input:t})=>o(kn,{label:"Код представителя Банка",placeholder:"Введите код",isInteger:!0,...ca(e("bankEmployeeCode"),ra.bankEmployeeCode,t?.required),...t}))),Cs=d((({field:e,input:t})=>o(Xi,{text:"В отношении меня ведётся производство по делу о банкротстве",...ca(e("bankruptcyFlg"),ra.bankruptcyFlg,t?.required)}))),Ss=d((({field:e,input:t})=>o(di,{label:"Дата начала работы на текущем месте",...ca(e("beginDate"),ra.beginDate,t?.required),...t}))),ks=d((({field:e,input:t})=>o(kn,{label:"Место рождения",...ca(e("birthPlace"),ra.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Ui(e,"birthPlace")}))),Is=e=>{try{return JSON.parse(String(e))}catch(e){return null}};function Ts(e){const t=globalThis.localStorage?.getItem(e),[n,i]=a(t?Is(t):null);return[n,l((t=>{i((n=>{const a=t instanceof Function?t(n):t;return globalThis.localStorage?.setItem(e,JSON.stringify(a)),a}))}),[e])]}const Rs=d((({field:e,input:t})=>{const[n,l]=a([]),[r]=Ts("programId"),{value:s,onChange:c}=e("cardCategory"),d=e("paymentSystem")?.value?.key;return i((()=>{d&&r&&(async()=>{const e=await(async(e,t)=>{const n=await Tr("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemTypeCd:e,creditProgramId:t}});return Array.isArray(n)?n:[]})(d,r);l(e),Bs(e,s)||c&&c(null)})()}),[d]),o(bs,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Bs=(e,t)=>e.some((e=>e.key===t?.key)),Ps=d((({field:e,input:t})=>o(kn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",isInteger:!0,...ca(e("children"),ra.children,t?.required),...t}))),Ds=d((({field:e,input:t})=>o(kn,{label:"Кодовое слово",...ca(e("codeWord"),ra.codeWord,t?.required),...t}))),_s=d((({field:e,input:t})=>{const{data:n}=ps("INCOME_CERT_UNITED");return o(bs,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Es=d((({field:e,input:t})=>{const{data:n}=ps("MILITARY_STATUS");return o(bs,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),As={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3}},Ms=d((({src:e,convertToPng:t,onClose:n,onDocumentRead:a})=>c(Kl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",onClose:n,children:[t?o("img",{src:e}):o("iframe",{src:`${e}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"}),o(Hl,{className:"mx-auto mt-m",type:"button",onClick:()=>{a?.(),n?.()},children:"Ознакомиться"})]}))),Os=(e,t)=>{const{open:n}=sn(Ms),a=ke();return l((async()=>{if(e){const i=URL.createObjectURL(await(async(e,t=!1)=>{const n=await Rr(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,a));n({src:i,onDocumentRead:t})}}),[n,e,a])},Fs=d((({className:e,error:t,docId:n,...a})=>{const i=Os(n,(()=>a.onChange?.(!0)));return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(xi,{...a}),n?o(Ne,{className:"text-primary-main",onClick:i,children:o(Ae,{children:"Ознакомиться"})}):null]}),yn(t)]})})),zs=d((({field:e,input:t})=>t&&t.name?o(Fs,{text:As[t.name]?.text,docId:As[t.name]?.docId,...ca(e(t.name),ra[t.name],t?.required)}):null)),Vs=Math.round(29.5),Ls=d((({className:e,title:t,children:n,...a})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...a,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),js="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",$s="flex flex-col lg:w-1/2 gap-2xl",qs="flex flex-col gap-y-xl min-w-52",Us=d((({value:e,fractionDigits:t,fixed:n,prefix:a,postfix:i})=>o(Ae,{size:"text-h3",children:"number"==typeof e?[a,He(t,{fixed:n})(e),i].filter(Boolean).join(" "):e}))),Ws=d((({className:e,title:t,value:n,color:a="text-secondary-text",...i})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Ae,{size:"text-l",font:"font-light",color:a,children:t}):null,n?o(Us,{value:n,...i}):o(Ae,{size:"text-h3",children:"-"})]}))),Hs=(e=[],t=!1)=>Ys([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Ys=(e,t)=>{if(!t?.length)return;const n=t?.reduce(((t,n)=>e[0](n.rate,t[0].rate)?[n]:n.rate===t[0].rate?[...t,n]:t),[t[0]]);return n.length>1?n.reduce(((t,n)=>e[1](n,t)?n:t),n[0]):n[0]},Ks=(e,t=0)=>e?.sum?e.sum:t,Gs=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,Xs=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Js=({min:e=0,max:t=0,availableMonths:n,...a})=>o(Ea,{items:[`От ${Zs(e)}`,`До ${Zs(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...a}),Zs=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,Qs=({items:e,title:t,mobileTitle:n=t,orientation:a="horizontal",value:i,onChange:l,...r})=>c("div",{className:"grid gap-s whitespace-nowrap",children:[t?o("div",{className:"hidden @5xl:block",role:"radiogroup","aria-label":t,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Ae,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(Al,{orientation:a,items:e,value:e[i?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),eo=e=>Qs({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),to=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...a})=>o(Ea,{items:e?[`От ${He(1)(a.min||0)} ${n}`,`До ${He(1)(a.max||0)} ${n}`]:[],step:t,...a}),no=({field:e,defParams:t,calcParams:n,map:a,monthsValue:i="maxMonths"})=>{Object.entries(a).forEach((([n,a])=>{e?.(n)?.onChange?.(t?.[a])})),e?.("monthsValue")?.onChange?.(Ra(t?.[i],n.minMonths,n.maxMonths))},ao=(e,t)=>{const{isAnnuity:n,moneyValue:a,monthsValue:i,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(a+l)*(t+t/(Math.pow(1+t,i)-1)):a*(t+t/(Math.pow(1+t,i)-1))}return Math.round(a/i)+a*(e/1200)},io=e=>e,lo=(e=io)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),ro=lo(),so=(e=io)=>lo((t=>-e(t))),oo=so(),co=([e,t],n,a=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:mo([e,t],a),mo=([e,t],n=[])=>({[e]:n.length?oo(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?ro(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),uo=(e,[t,n],a)=>e>=a[t]&&e<=a[n],ho={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},po=e=>go({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&go({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&go({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&go({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),go=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],fo=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.rateRows||[ho],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>po({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=co(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=co(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i})=>e?.find((e=>po({row:e,userInputParams:t,paramsViewSettings:n})&&uo(a,["minSum","maxSum"],e)&&uo(i,["minMonths","maxMonths"],e)))||ho)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i}),{rate:u}=m,h=ao(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:a,monthsValue:i,monthlyPayment:h}},xo=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),yo={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},bo=zt((({className:e,title:t,calcSource:n,buttons:a,footnote:l,paramsViewSettings:r,defaultParams:s,onChange:d,...m})=>{const h=(p=n?.rateRows,Ys([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,isDirty:x}]=an({moneyValue:Ks(s,2e5),monthsValue:Gs(s,Vs),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});i((()=>{x&&d?.(g)}),[g,x]);const y=fo(g,n,r),b=eo({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return i((()=>{v&&v(Ra(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),i((()=>{N&&N(Ra(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),i((()=>{!xo(s)&&h&&no({field:f,defParams:h,calcParams:y,map:yo,monthsValue:"minMonths"})}),[n,s]),o(Ls,{className:e,title:t,...m,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Js({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),vo({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(qs,"@4xl:w-1/2"),children:[o(Ws,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ws,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Ws,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),$e(a,{isVertical:!0}),Xs(l)]})]})})})),vo=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(xi,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(xi,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(xi,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(xi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),No="calculator",wo=d((({field:e,params:t})=>{const n=l((t=>{e(No).onChange?.(t)}),[]);return o(bo,{...t?.calcData,padding:"p-0",defaultParams:So(e(No).value),onChange:n})})),Co={moneyValue:"sum",monthsValue:"period",isInsurance:"isEnableInsurance",isPensionClient:"isEnablePensionClient",isStateEmployee:"isEnableStateEmployee",isSalaryClient:"isEnableSalaryClient",isAnnuity:"isAnnuity"},So=(e,t=!1)=>{const n=t?ko(Co):Co;return Object.fromEntries(Object.entries(e??{}).map((([e,t])=>[n[e],t])))},ko=e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[t,e]))),Io=d((({field:e,input:t})=>{const{data:n}=ps("CREDIT_IN_RSHB");return o(bs,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком /\n вкладчиком с долей участия более 20% уставного капитала руководителем,\n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t,disabled:!e?.("shareholderFlg")?.value})})),To=d((({className:e,label:t,onChange:n,error:a,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Al,{label:mn({label:t,errors:i?.errors}),onChange:e=>n&&n(e),...i}),yn(a)]}))),Ro=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("currency");return o(To,{label:"Валюта",orientation:"horizontal",items:[{id:"810",text:"Рубли"}],value:n,onChange:e=>a?.(e),...ca(e("currency"),ra.currency,t?.required)})})),Bo=d((({field:e,input:t})=>o(di,{label:"Дата доставки",...ca(e("deliveryDate"),ra.deliveryDate,t?.required)}))),Po=d((({field:e,input:t})=>o(kn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",isInteger:!0,maxLength:2,...ca(e("dependents"),ra.dependents,t?.required),...t}))),Do=d((({field:e,input:t})=>o(Xi,{text:"Являюсь инвалидом",...ca(e("disablePeopleFlg"),ra.disablePeopleFlg,t?.required)}))),_o="dulIssueDateField",Eo=d((({field:e,input:t})=>o(di,{label:"Дата выдачи",...ca(e(_o),ra.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Ui(e,_o)}))),Ao="dulIssuedBy",Mo=d((({field:e,input:t})=>{const{value:n,onChange:a}=e("dulSubdivisionCode"),i=l((e=>{a?.(e?.data?.code?.replace("-",""))}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,Ao),label:"Кем выдан",...t,...ca(e(Ao),ra.dulIssuedBy,t?.required),onDaDataChange:i,daDataQueryPrefix:n})})),Oo=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ui(e,"dulNumber"),label:"Номер документа",isInteger:!0,maxLength:6,...ca(e("dulNumber"),ra.dulNumber,t?.required)}))),Fo=d((({field:e,input:t})=>o(kn,{disabled:t?.filledByEsia&&Ui(e,"dulSerie"),label:"Серия документа",isInteger:!0,maxLength:4,...ca(e("dulSerie"),ra.dulSerie,t?.required)}))),zo="dulSubdivisionCode",Vo=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(kn,{disabled:t?.filledByEsia&&Ui(e,zo),label:"Код подразделения",isInteger:!0,maxLength:6,...t,...ca(e(zo),ra.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Lo=d((({field:e,input:t})=>{const{data:n}=ps("EDUCATION_LEVEL");return o(bs,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),jo=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_ACTIVITY_TYPE"),a=zi();return i((()=>{n&&(a.employerActivities=n)}),[n]),o(bs,{field:e,source:a.employerActivities??[],label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),$o=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_KIND"),a=zi();return i((()=>{n&&(a.employerOrganization=n)}),[n]),o(bs,{field:e,source:a.employerOrganization??[],label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),qo=d((({field:e,input:t})=>{const{data:n}=ps("EMPLOYMENT_INFO_UNITED");return o(bs,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Uo=d((({field:e,input:t})=>o(kn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",isInteger:!0,...ca(e("expenses"),ra.expenses,t?.required),...t}))),Wo="experience5Years",Ho=d((({field:e,input:t})=>{const n=l((t=>e(Wo)?.onChange?.(String(Ra(Number(t),0,5)))),[]);return o(kn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",...ca(e(Wo),ra[Wo],t?.required),...t,onChange:n})})),Yo=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),a=e("familyStatus")?.value?.key,l="MARRIED"===a?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return i((()=>{e?.("familyMembers")?.onChange?.(c)}),[a,r,s]),o(kn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Ko=d((({field:e,input:t})=>{const{data:n}=ps("MARITAL_STATUS");return o(bs,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Go=d((({field:e,input:t})=>o(kn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...ca(e("generalSeniority"),ra.generalSeniority,t?.required),...t}))),Xo=d((({field:e,input:t})=>{const{data:n}=ps("HOUSE_TYPE");return o(bs,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Jo=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:a})=>c("div",{className:"flex flex-row items-center w-full min-h-14 bg-main-gray rounded-lg gap-m p-m",children:[o("div",{className:"rounded-full bg-white p-xs",children:o(W,{name:t,width:"24",height:"24",iconVersion:n})}),c("div",{className:"",children:[o(_e,{__html:e}),a?.text?o(Ne,{className:"text-primary-main",children:a.text}):null]})]}))),Zo=d((({input:e})=>o(Jo,{__html:e?.label}))),Qo=d((({field:e,input:t})=>o(kn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",isInteger:!0,maxLength:2,...ca(e("jobsNumber"),ra.jobsNumber,t?.required),...t}))),ec=d((({field:e,input:t})=>o(kn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...ca(e("lastJobExperience"),ra.lastJobExperience,t?.required),...t}))),tc=d((({field:e,input:t})=>o(kn,{label:"Наименование юридического лица",...t,...ca(e("legalEntityName"),ra.legalEntityName,t?.required),disabled:!e?.("shareholderFlg")?.value}))),nc=d((({field:e,input:t})=>o(kn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...ca(e("legalForm"),ra.legalForm,t?.required),...t}))),ac="limitedBirthday",ic=d((({field:e,input:t})=>o(di,{label:"Дата рождения",...ca(e(ac),ra.limitedBirthday,t?.required),disabled:t?.filledByEsia&&Ui(e,ac)}))),lc=d((({field:e,input:t})=>o(kn,{label:"Обязательные выплаты",placeholder:"Введите значение",isInteger:!0,...ca(e("mandatoryPayments"),ra.mandatoryPayments,t?.required),...t}))),rc=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],sc=d((({field:e,input:t})=>o(To,{orientation:"horizontal",items:rc,...ca(e("methodObtain"),ra.methodObtain,t?.required)}))),oc=d((({field:e,input:t})=>{const{data:n}=ps("ORGANIZATION_TYPE"),a=zi();return i((()=>{n&&(a.organization=n)}),[n]),o(bs,{field:e,source:a.organization??[],label:"Тип организации",fieldName:"organization",input:t})})),cc=d((({field:e,input:t})=>{const n=zi(),a=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),Yi(n,e,t)}),[]);return o(kn,{label:"Наименование организации",...t,...ca(e("organizationName"),ra.organizationName,t?.required),onDaDataChange:a})})),dc=d((({field:e,input:t})=>o(kn,{label:"Иные доходы",placeholder:"Введите значение",isInteger:!0,...ca(e("otherIncome"),ra.otherIncome,t?.required),...t}))),mc=d((({field:e,input:t})=>o(di,{label:"Дата регистрации по месту жительства",...ca(e("participantDateRegistration"),ra.participantDateRegistration,t?.required)}))),uc="partInBusiness",hc=d((({field:e,input:t})=>{const n=l((t=>e(uc)?.onChange?.(String(Ra(Number(t),0,100)))),[]);return o(kn,{label:"Доля участия в бизнесе",placeholder:"в %",isInteger:!0,maxLength:3,...ca(e(uc),ra.partInBusiness,t?.required),...t,onChange:n})})),pc=e=>e.map((e=>({key:e.type,text:e.name}))),gc=d((({field:e,input:t})=>{const{value:n,onChange:r}=e("paymentSystem"),[s]=Ts("programId"),[c,d]=a([]);i((()=>{s&&(async()=>{const e=await(async e=>{const t=await Tr("/public-data/creditProgramConditions","POST",{creditProgramId:e});return pc(t?.paymentSystems||[])})(s);d(e||[])})()}),[]);const m=l((e=>r?.(c?.find((t=>t.key===e)))),[c,r]);return o(To,{label:"Платежная система",orientation:"horizontal",items:fc(c),...ca(e("paymentSystem"),ra.paymentSystem,t?.required),value:n?.key,onChange:m})})),fc=e=>e?.map((e=>({id:e.key,text:e.text})))??[],xc=d((({field:e,input:t})=>{const{data:n}=ps("POSITION");return o(bs,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),yc=d((({field:e,input:t})=>{const{data:n}=ps("REGION_RF"),a=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(Mn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:a,...ca(e("regionRetail"),ra.regionRetail,t?.required)})})),bc=d((({field:e,input:t})=>o(kn,{label:"Пенсионные доходы",placeholder:"Введите значение",isInteger:!0,...ca(e("retirementIncome"),ra.retirementIncome,t?.required),...t}))),vc=["male","female"],Nc=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],wc=d((({field:e,input:t})=>{const n=e("name")?.value,{value:a,onChange:l}=e("sex");return i((()=>{n&&!a&&(async()=>{const e=await(async e=>{const t=await Tr("/suggestions/suggest/fio","POST",{query:e,count:1,parts:["NAME"]}),n=t?.suggestions[0]?.data?.gender?.toLowerCase()||"";return vc.includes(n)?n:""})(n);e&&l?.(e)})()}),[]),o(To,{label:"Пол",orientation:"horizontal",items:Nc,...ca(e("sex"),ra.sex,t?.required)})})),Cc=d((({field:e,input:t})=>o(Xi,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...ca(e("shareholderFlg"),ra.shareholderFlg,t?.required)}))),Sc=d((({children:e,onChange:t,maxLength:n,...a})=>{const i=l((e=>n?e.length<=n&&t?.(Ya(e,"___-___-___ __")):t?.(Ya(e,"___-___-___ __"))),[t]),r=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(fn,{...a,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>r(e?.target?.value||""),children:e})})),kc=d((({className:e,label:t,value:n,error:a,onChange:i,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Sc,{"aria-label":t,label:mn({label:t,errors:r?.errors}),valid:Boolean(!a),value:n,onChange:i,onBlur:l,placeholder:"___-___-___ __",...r}),yn(a)]}))),Ic=d((({field:e,input:t})=>o(kc,{label:"СНИЛС",maxLength:14,...ca(e("snils"),ra.snils,t?.required),...t}))),Tc=d((({field:e,input:t})=>o(kn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...ca(e("totalIncome"),ra.totalIncome,t?.required),...t}))),Rc=d((({field:e,input:t})=>o(kn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",isInteger:!0,...ca(e("wages"),ra.wages,t?.required),...t}))),Bc={limitedBirthday:e=>o(ic,{...e})},Pc={processPersonalDataFlg:e=>o(zs,{...e}),consentProviderFlg:e=>o(zs,{...e}),consentOthersFlg:e=>o(zs,{...e}),consentInformFlg:e=>o(zs,{...e}),consentPfrFlg:e=>o(zs,{...e})},Dc={organization:e=>o(oc,{...e}),organizationAddress:e=>o(Wi,{...e}),organizationPhone:e=>o(xl,{...e}),organizationName:e=>o(cc,{...e}),legalForm:e=>o(nc,{...e}),generalSeniority:e=>o(Go,{...e}),lastJobExperience:e=>o(ec,{...e}),experience5Years:e=>o(Ho,{...e}),jobsNumber:e=>o(Qo,{...e}),beginDate:e=>o(Ss,{...e}),addressFact:e=>o(or,{...e}),addressRegistration:e=>o(Wi,{...e}),addressRetail:e=>o(ys,{...e}),addressMatch:e=>o(cr,{...e}),sex:e=>o(wc,{...e}),limitedBirthday:e=>o(ic,{...e}),birthPlace:e=>o(ks,{...e}),education:e=>o(Lo,{...e}),housing:e=>o(Xo,{...e}),amountWorkers:e=>o(vs,{...e}),employment:e=>o(qo,{...e}),employerActivities:e=>o(jo,{...e}),employerOrganization:e=>o($o,{...e}),positionOrganization:e=>o(xc,{...e}),familyStatus:e=>o(Ko,{...e}),familyMembers:e=>o(Yo,{...e}),children:e=>o(Ps,{...e}),dependents:e=>o(Po,{...e}),totalIncome:e=>o(Tc,{...e}),expenses:e=>o(Uo,{...e}),snils:e=>o(Ic,{...e}),conscription:e=>o(Es,{...e}),armyIdFlg:e=>o(Ns,{...e}),dulSerie:e=>o(Fo,{...e}),dulNumber:e=>o(Oo,{...e}),dulIssueDateField:e=>o(Eo,{...e}),dulSubdivisionCode:e=>o(Vo,{...e}),dulIssuedBy:e=>o(Mo,{...e}),participantDateRegistration:e=>o(mc,{...e}),retirementIncome:e=>o(bc,{...e}),otherIncome:e=>o(dc,{...e}),wages:e=>o(Rc,{...e}),mandatoryPayments:e=>o(lc,{...e}),disablePeopleFlg:e=>o(Do,{...e}),bankruptcyFlg:e=>o(Cs,{...e}),shareholderFlg:e=>o(Cc,{...e}),legalEntityName:e=>o(tc,{...e}),creditInRshbCd:e=>o(Io,{...e}),bankEmployeeCode:e=>o(ws,{...e}),partInBusiness:e=>o(hc,{...e}),regionRetail:e=>o(yc,{...e}),infoCard:e=>o(Zo,{...e}),calculator:e=>o(wo,{...e})},_c={addressCourier:e=>o(Wi,{...e}),paymentSystem:e=>o(gc,{...e}),currency:e=>o(Ro,{...e}),cardCategory:e=>o(Rs,{...e}),codeWord:e=>o(Ds,{...e}),confirmationIncome:e=>o(_s,{...e}),methodObtain:e=>o(sc,{...e}),deliveryDate:e=>o(Bo,{...e})},Ec=d((({inputs:e=[],field:t,key:n})=>{const a=e.every((e=>Boolean(t(e.name).value))),i=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(oa(t(e?.name),ra[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Dr,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:n})=>o(_r,{isUnfolded:n,className:"flex flex-col pl-2xl",children:e.map(Vl(t,{},Pc))}),renderFoldButton:Ac(c("div",{children:[o(xi,{value:a,onChange:n=>{for(const a of e){const e=t(a.name);e?.onChange&&e.onChange(n)}},text:"Согласие на все документы"},n),yn(i?"Отметьте все обязательные соглашения":"")]}))})})})),Ac=e=>t=>c("div",{className:"flex items-start",children:[e,o("button",{onClick:t.onToggle,className:"px-m py-2xs",type:"button",children:o(W,{className:"text-primary-text",name:t.isUnfolded?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})})]}),Mc=({field:e,inputs:t})=>{const{consentInputs:n,restInputs:a}=Oc(t||[]);return n.length>2?c("div",{children:[a.map(Vl(e,{},{...Bc})),o(Ec,{inputs:n,field:e})]}):(t||[])?.map(Vl(e,{},{...Bc}))},Oc=e=>({consentInputs:e?.filter((e=>Object.keys(As).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(As).includes(e.name||"")))||[]}),Fc=(e,t)=>o(Hl,{className:u("w-full @xl:w-auto"),type:"submit",isLoading:t,children:e?.text?e.text:"Отправить заявку"}),zc=e=>Rr("/user-data/updateUserProfile","PUT",e),Vc=e=>Rr("/user-data/updateUserTask","PUT",e),Lc={width:"103",height:"21"},jc={"bg-white":"color",transparent:"white"},$c={"bg-white":"text-primary-main",transparent:"text-white"},qc=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:jc[e]},className:$c[e],width:n?.width,height:n?.height}),Uc={"bg-white":"text-primary-text",transparent:"text-white"},Wc=d((({className:e,href:t="/",logo:n,children:a,targetBlank:i,bgColor:l="bg-white",showTitle:r=!0,data:s})=>c("a",{className:u("inline-flex items-center font-sans no-underline",e),href:n?.href??t,target:i?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...fe(s),children:[qc(l,n?.image,Lc),r?a??o("div",{className:"ml-s",children:o(Ae,{font:"font-medium",color:Uc[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Hc=d((({phoneNumber:e,sendCode:t,onClose:n})=>{const[r,s]=a(""),[d,m]=a(""),[u,h]=a(!1),p=l((async()=>{const e=await(a={captchaText:d},Rr("/sms/checkCaptcha","POST",a).then((e=>e.text())).then((e=>"ERROR"!==e)));var a;e?(t?.(),n?.()):h(e)}),[d,t]),g=l((()=>{(async()=>{s(URL.createObjectURL(await(e=>Rr(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return i(g,[]),o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",head:o(Wc,{}),onClose:n,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex h-36 w-72",children:[o("img",{className:"grow",src:r}),o("div",{onClick:g,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(fn,{className:"w-[300px]",onChange:m,value:d,placeholder:"Введите код с картинки"}),u?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Hl,{onClick:close,version:"secondary",children:"Вернуться"}),o(Hl,{type:"submit",disabled:!d,onClick:p,version:"secondary",children:"Отправить"})]})]})})})),Yc=d((({time:e,setTime:t,className:n})=>(i((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Kc(e)})))),Kc=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Gc=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=a(0),u=s([]);i((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>a=>{const{value:i}=a.currentTarget,l=i.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>a=>{const{key:i}=a;if("Backspace"===i&&!e[n]){const a=n>0?n-1:e.length-1,i=e.map(((e,t)=>t===a?"":e));t(i),m(a)}}),[e]),g=l((n=>{n.preventDefault();const a=n.clipboardData.getData("text"),i=e.map(((e,t)=>t<a.length?a[t]:e));t(i),m(i.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,a)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(a),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[a]=e},onFocus:e=>e.target.select(),onKeyDown:p(a),className:Xc(a,e,n)},a)))}),n?o("div",{className:"text-error",children:r}):null]})})),Xc=(e,t,n=!1)=>{const a=!t[e];return`w-16 sm:w-20 h-24 text-5xl text-center p-md m-2 border ${pn(!n||!a)} rounded-md caret-transparent outline-none`},Jc=d((({isDisabled:e,onClick:t,text:n})=>o(Hl,{type:"button",onClick:t,disabled:e,children:o(Ae,{font:"font-normal",children:n})}))),Zc=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Qc=({values:e,onSuccess:t})=>{const[n,r]=a(""),[s,{setTrue:o,setFalse:c}]=on(!1),[d,m]=a(0),[u,h]=a(!1),[p,g]=a(0),f=l((()=>r("")),[]),x=Boolean(0===d&&u),y=p>2||x||!e.every(Boolean),b=l((async()=>{try{h(!1),m(0),g((e=>e+1)),o(),await(async e=>Tr("/sms/checkCode","POST",e).then(Zc))({smsText:e.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),f(),await(t?.(e.join("")))}catch{r(p>1?"Исчерпан лимит ввода смс-кода":"Неверный код")}finally{c()}}),[e,p]);return i((()=>{r(x?"Код просрочен":"")}),[x]),{handleSubmit:b,hasError:Boolean(n),errorText:n,isLoading:s,timeNextReq:d,isSubmitButtonDisabled:y,setTimeNextReq:m,setIsTimerStarted:h,setAttempts:g}},ed=d((({phone:e,code:t=!0,codeLength:n=4,consents:r,onSuccess:s=un,onClose:d=un})=>{const[m,u]=a(Array(n).fill("")),{handleSubmit:h,hasError:p,errorText:g,isLoading:f,timeNextReq:x,isSubmitButtonDisabled:y,setTimeNextReq:b,setIsTimerStarted:v,setAttempts:N}=Qc({values:m,onSuccess:s}),w=sn(Hc),C=qt(e),S=l((async()=>{var e;await(e={phoneNumber:C,smsCodesSetName:{key:"AUTHENTICATION"}},Rr("/sms/sendCode","POST",e).then((e=>e.text())).then((e=>"OK"===e)))?(N(0),b(180),v(!0)):w.open({phoneNumber:C,sendCode:S,onClose:d})}),[C,d]);return i((()=>{S()}),[]),o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl p-m",onClose:d,children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),t?o(Gc,{values:m,setValues:u,errorText:g,hasError:p}):null,nd(x,b,S),c(_e,{itemSize:"list-s",children:[o("span",{children:"Вводя код, я подтверждаю, что ознакомлен и подписываю: "}),o("ul",{children:r?.map(((e,t)=>o("li",{children:e},`${e}-${t}`)))})]}),td(y,h),f?o($l,{blur:!1}):null]})})})),td=(e,t)=>o(Jc,{text:"Далее",isDisabled:e,onClick:t}),nd=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(Yc,{className:"text-base ml-1",time:e,setTime:t})]}):o(Ne,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),ad={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},id={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},ld=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],rd=d((({onSubmit:e=un,onClose:t=un})=>{const[n,i]=a(""),[r,s]=a(!1),d=Os(2),m=l((()=>{e(n)}),[e,n]),u=l((e=>{i(e),"REFUSE"===e&&s(!0)}),[]),h=r?id:ad;return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:d,children:o(w,{className:"text-center text-balance",headingType:"h2",title:h.title})}),o(C,{align:"text-center",children:h.description}),o(Al,{className:"whitespace-normal",orientation:"horizontal",items:ld,value:n,onChange:u}),o(Hl,{disabled:!n,type:"button",onClick:m,children:"Далее"})]})})})),sd=d((({title:e,icon:t,description:n,onClick:a=un})=>c("button",{className:"flex gap-lg items-center border border-gray rounded-md cursor-pointer p-4 hover:border-green",type:"button",onClick:a,children:[o(ne,{image:{icon:t,iconVersion:"black"},width:"78",height:"78"}),c("div",{className:"w-full md:w-auto",children:[o(w,{className:"text-center md:text-left",title:e,headingType:"h5"}),n?o(C,{color:"text-secondary-text",size:"text-m",children:n}):null]})]}))),od={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},cd={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK",addressCourier:"DELIVERY"},dd={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},md=e=>Object.entries(e).reduce(((e,[t,n])=>t in od?[...e,{contactTypeCd:{key:od[t]},value:n}]:e),[]),ud=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in cd){const a=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:cd[t]},...a}]}return e}),[]),hd=e=>{const{familyStatus:t,familyMembers:n,dependents:a,children:i,confirmationIncome:l,wages:r,mandatoryPayments:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p,conscription:g}=e;return{maritalStatusCd:t,totalDependents:n,incomeCertificateCd:l,otherDependents:a,childrenDependents:i,militaryStatusCd:g,participantIncomes:(f={wages:r,mandatoryPayments:s,incomeAverage:pd(r,u),additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u},Object.entries(f).reduce(((e,[t,n])=>t in dd?[...e,{incomeTypeCd:{key:dd[t]},value:Number(n||0)}]:e),[])),snils:h?.replace(/[-\s]/g,""),armyIdFlg:p};var f},pd=(e,t)=>Number(e)+Number(t),gd={credit_cash:"10",credit_cash_single_doc:"28",credit_mcx:"39",family_offer_credit:"41",gas_engine_fuel:"33",pension_credit:"12",ref_credit:"11",ref_credit_single_doc:"29",self_employed:"34",summer_cash:"35",summer_cash_pens:"36"},fd={...gd,amur_card:"14",owner_card:"13",travel_card:"15"},xd=e=>{const t=e?.find((e=>"WAGES"===e.incomeTypeCd.key))?.value,n=e?.find((e=>"MANDATORY_PAYMENTS"===e.incomeTypeCd.key))?.value,a=e?.find((e=>"ADDITIONAL_INCOME"===e.incomeTypeCd.key))?.value,i=e?.find((e=>"OTHER_INCOME"===e.incomeTypeCd.key))?.value,l=e?.find((e=>"OTHER_PAYMENTS"===e.incomeTypeCd.key))?.value,r=e?.find((e=>"RENTAL_INCOME"===e.incomeTypeCd.key))?.value,s=e?.find((e=>"RETIREMENT_INCOME"===e.incomeTypeCd.key))?.value;return{wages:t,mandatoryPayments:n,incomeAverage:pd(t,s),additionalIncome:a,otherIncome:i,otherPayments:l,rentalIncome:r,retirementIncome:s}},yd=e=>{const t=e?.find((e=>"REGISTRATION"===e.addressType.key)),n=e?.find((e=>"RESIDENTAL"===e.addressType.key)),a=e?.find((e=>"WORK"===e.addressType.key));return{addressRegistration:t,addressFact:n,organizationAddress:a}},bd=e=>{const t=e?.find((e=>"EMAIL"===e.contactTypeCd.key))?.value,n=e?.find((e=>"MAIN_PHONE"===e.contactTypeCd.key))?.value,a=e?.find((e=>"ORGANIZATION_PHONE"===e.contactTypeCd.key))?.value;return{email:t,phone:n,organizationPhone:a}},vd=e=>e?.key?{key:e.key,text:e.value}:void 0,Nd=d((function({task:e,isFromLead:t=!1,onClose:n=un}){const a=zi(),i=Jt(),{participants:r,creditProgram:s,id:d}=e,m=fd[s.code],u=Boolean(gd[s.code]),h=u?"/credit-lead":"/credit-card-lead",{name:p,midname:g,id:f,profile:x}=r[0],y=l((()=>{const t=(e=>{const t=e.participants[0],{classCard:n,codeWord:a,paymentSystemTypeCd:i,currencyCode:l}=e,{loanAmount:r,creditPeriod:s,paymentTypeCd:o}=e,{birthDate:c,midname:d,name:m,surname:u,birthPlace:h,dulIssueDate:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,educationLevelCd:b,registrationDate:v,houseTypeCd:N,genderCd:w,participantContacts:C=[],participantAddresses:S=[],employmentContractDate:k,employmentTypeCd:I,organizationName:T,organizationInn:R,organizationActivityTypeCd:B,organizationTypeCd:P,organizationKindCd:D,employeesNumberCd:_,opf:E,seniority:A,generalSeniority:M,jobsNumber:O,lastWorkDuration:F,positionCd:z,maritalStatusCd:V,childrenDependents:L,totalDependents:j,otherDependents:$,militaryStatusCd:q,participantIncomes:U,snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,nameLegalEntity:G,creditInRshbCd:X,payrollCardRshbFlg:J,consentInsuranceFlg:Z,incomeCertificateCd:Q}=t;return{currency:l?.key,paymentSystem:vd(i),cardCategory:vd(n),codeWord:a,limitedBirthday:c,middleName:d,name:m,surname:u,birthPlace:h,dulIssueDateField:p,dulIssuedBy:g,dulNumber:f,dulSerie:x,dulSubdivisionCode:y,education:vd(b),participantDateRegistration:v,housing:vd(N),beginDate:k,employment:vd(I),organizationName:T,inn:R,employerActivities:vd(B),organization:vd(P),employerOrganization:vd(D),amountWorkers:vd(_),legalForm:E,generalSeniority:A?.toString(),experience5Years:M?.toString(),jobsNumber:O?.toString(),lastJobExperience:F?.toString(),positionOrganization:vd(z),familyStatus:vd(V),children:L?.toString(),familyMembers:j?.toString(),dependents:$?.toString(),conscription:vd(q),confirmationIncome:vd(Q),snils:W,armyIdFlg:H,bankruptcyFlg:Y,shareholderFlg:K,legalEntityName:G,creditInRshbCd:vd(X),calculator:{isInsurance:J,isSalaryClient:Z,moneyValue:r,monthsValue:s,isAnnuity:"ANNUITY"===o?.key},...xd(U),...yd(S),...bd(C),...(ee=w,ee?.key?{sex:"MAN"===ee.key?"male":"female"}:null)};var ee})(e);a.participantId=f,a.taskId=d,a.profileId=x?.id,a.programId=m,a.leadForm=t,i.assign(h)}),[]),b=l((()=>{i.assign(u?"/natural/loans/all-goals":"/natural/creditcards/svoya")}),[]),v=l((()=>{i.assign("/")}),[]);return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:n,children:c("div",{className:"flex flex-col gap-lg mt-xs md:mt-0",children:[o(w,{className:"whitespace-pre-wrap text-center",title:`${p&&g?`${p} ${g}, `:""}мы нашли черновик вашей заявки.\nПродолжите заполнение?`,headingType:"h5"}),o(sd,{title:"Перейти к черновику",icon:"BankIcon",description:"Продолжайте заполнять заявку из черновика",onClick:y}),o(sd,{title:t?"Продолжить заполнение текущей заявки":"Заполнить новую заявку",icon:"DocIcon",onClick:t?n:b}),o(Hl,{type:"button",version:"secondary",className:"w-full text-h5",onClick:v,children:"Вернуться на главную"})]})})})),wd=d((function({onClose:e=un}){const t=Jt(),n=l((()=>{t.assign("/natural/loans/all-goals")}),[]),a=l((()=>{t.assign("/")}),[]);return o(Kl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:e,children:c("div",{className:"flex flex-col gap-lg",children:[o(w,{className:"text-center",title:"Заявки не найдены",headingType:"h3"}),o(C,{size:"text-l",align:"text-center",children:"По данному номеру не найдено незавершенных заявок. Вы можете заполнить новую заявку или вернуться на главную страницу"}),o(Hl,{type:"button",className:"w-full",onClick:n,children:"Заполнить новую заявку"}),o(Hl,{type:"button",version:"secondary",className:"w-full",onClick:a,children:"Вернуться на главную"})]})})})),Cd=d((({onClose:e})=>{const t=Jt(),n=zi(),a=l((async()=>{const e=await(n={redirectUri:t.href},Tr("/esia/getLink","POST",n));var n;e?.link&&t.assign(e.link)}),[]),i=l((()=>{if(n.leadForm){const e={...n.leadForm};delete e.esiaAccountTypeCd,n.leadForm=e}e?.()}),[]);return o(Kl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:i,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full px-m",children:[c("ul",{className:"list-disc",children:[o("li",{children:"Вероятность одобрения выше"}),o("li",{children:"Без справок о доходах и трудоустройстве"}),o("li",{children:"С защитой Ваших данных"})]}),o(ne,{image:{icon:"GosUslugiIcon",iconVersion:"normal"},height:"70"})]}),c("div",{className:"flex flex-wrap gap-lg w-full",children:[o(Hl,{type:"button",onClick:a,children:"Заполнить через Госуслуги"}),o(Hl,{type:"button",version:"secondary",onClick:i,children:"Пропустить"})]})]})})})),Sd=()=>{const e=new URLSearchParams(decodeURIComponent(globalThis.location?.search));return{utm_campaign:e.get("utm_campaign"),utm_medium:e.get("utm_medium"),utm_source:e.get("utm_source"),utm_content:e.get("utm_content"),utm_term:e.get("utm_term")}},kd=()=>Fi(),Id=({inputs:e,programId:t,nextStepLink:n})=>{const[i,r]=a(""),[s,{setTrue:o,setFalse:c}]=on(!1),d=(()=>{const e=kd();return l((({participantId:t,taskId:n,profileId:a,programId:i,formData:l})=>{e.participantId=t,e.taskId=n,e.profileId=a,e.programId=i,e.leadForm=l}),[])})(),m=(e=>{const{open:t}=sn(Cd),n=Jt();return l((()=>{t({onClose:()=>n.assign(e)})}),[t,e])})(n),u=(e=>{const{open:t}=sn(rd),n=sn(ed),a=t=>async n=>{try{t&&await zc({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()}catch(e){console.log(e)}},i=(t,i)=>async l=>{"SIGNED"===l&&t?n.open({phone:t,consents:["согласие на запрос информации в БКИ"],onSuccess:a(i)}):e()};return{open:(n,a)=>t({onSubmit:i(n,a),onClose:e})}})(m),h=sn(ed),p=(()=>{const{open:e}=sn(Nd),{open:t}=sn(wd);return{open:({task:n,isFromLead:a,onClose:i})=>{n?e({task:n,isFromLead:a,onClose:i}):t({})}}})();return{handleSubmit:l((async n=>{const a=Xl(sa(e));var i;if(On(a(n)))try{o();const e=await(i={profile:{phone:qt(n.phone)}},Tr("/public-data/createUserProfile","POST",i).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const a=async()=>{await Rd({programId:t,profileId:e,formData:n,saveUserData:d}),h.close(),u.open(n.phone,e)},i=async()=>{try{const n=await(async e=>{const t=await Tr("/user-data/getLastStatus","POST",e);return"DRAFT"===t?.statusCd?t?.taskId:null})({profileId:e,programId:t});if(n){const e=await(async e=>await Tr("/user-data/getTaskById","POST",e)||void 0)({taskId:n});h.close(),p.open({task:e,isFromLead:!0,onClose:a})}else await a()}catch{r("Fail")}},l=Td(n);h.open({phone:n?.phone,consents:l,onSuccess:i}),c()}}catch{r("Fail")}}),[]),responseStatus:i,isSending:s}},Td=e=>Object.keys(As).filter((t=>e[t])).map((e=>As[e]?.text)),Rd=async({programId:e,profileId:t,formData:n,saveUserData:a})=>{const i=Bd(n);await zc(((e,t)=>{const{name:n="",surname:a="",middleName:i="",limitedBirthday:l="",phone:r="",email:s="",processPersonalDataFlg:o,consentProviderFlg:c,consentPfrFlg:d,consentPhotoFlg:m,consentAssignmentClaimsFlg:u,consentCollectionFlg:h,consentInformFlg:p}=t;return{profile:{id:e,name:n,surname:a,midname:i,birthDate:l&&$t(l,!0),email:s,phone:qt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,i));const{taskId:l,participantId:r}=await(async e=>await Tr("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});try{await Vc((({participantId:e,taskId:t,profileId:n,formData:a})=>{const{name:i,surname:l,middleName:r,limitedBirthday:s,phone:o,email:c}=a;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:Jt().origin,id:t,participants:[{birthDate:s&&$t(s,!0),id:e,midname:r,name:i,surname:l,profile:{id:n},participantContacts:md({phone:o&&qt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}],marketingInfo:Sd()}}})({participantId:r,taskId:l,profileId:t,formData:i}))}catch(e){console.log(e)}a({participantId:r,taskId:l,profileId:t,programId:e,formData:n})},Bd=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Pd={surname:"",name:"",middleName:"",limitedBirthday:void 0,phone:"",email:"",processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,consentPfrFlg:!1},Dd=(e,t)=>{if(t)return{...t,limitedBirthday:new Date(t?.limitedBirthday||0)};return{...Object.fromEntries(e.map((e=>[e.name,Pd[e.name||""]])))}},_d=e=>{const{profile:t,addInfo:n,document:a,addressRegistration:i,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,limitedBirthday:t?.birthDate,phone:pl(t?.phone),email:t?.email,dulIssueDateField:a?.dulIssueDate,dulIssuedBy:a?.dulIssuedBy,dulNumber:a?.dulNumber,dulSerie:a?.dulSerie,dulSubdivisionCode:a?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Ed(i),addressFact:Ed(l),esiaAccountTypeCd:t?.esiaAccountType}},Ed=e=>{const{postcode:t,region:n,regionCode:a,locality:i,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,i||l,r?`ул ${r}`:void 0,s?`д ${s}`:void 0,c?`к ${c}`:void 0,o?`стр ${o}`:void 0,d?`кв ${d}`:void 0].reduce(((e,t)=>t?e?`${e}, ${t}`:t:e),"");return{...e,regionCode:a?.key,fullAddress:m}},Ad=(e,t)=>{const n=Jt(),[a,{setTrue:s,setFalse:o}]=on(!1),c=kd(),d=l((e=>{const t=e instanceof Function?e(m[u]):e;null!=t?m[u]=t:delete m[u]}),[m=c,u="leadForm"]);var m,u;const h=r((()=>Dd(e,c.leadForm)),[e,c.leadForm]),p=l((async(e,a,i)=>{s();try{const r=await(l={profileId:e,code:a,state:i,redirectUri:globalThis.location?.href},Tr("/esia/updateProfileEsia","POST",l));r&&d((e=>({...e,..._d(r)}))),n.assign(t)}finally{o()}var l}),[t]);return i((()=>{const e=Is(globalThis.localStorage?.getItem("profileId")??""),t=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),n=t.get("code"),a=t.get("state");e&&n&&a?p(e,n,a):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),[h,{isLoading:a}]},Md=d((({className:e,title:t,programId:n="",nextStepLink:a="/credit-lead",button:l,...s})=>{const d=r((()=>sr?.flatMap((e=>e?.inputs))||[]),[sr]),[m,{isLoading:h}]=Ad(d,a),{handleSubmit:p,responseStatus:g,isSending:f}=Id({inputs:d,programId:n,nextStepLink:a}),[,{field:x,onSubmit:y}]=an(m,{onSubmit:p}),b=sn(Gl);return i((()=>{g&&b.open({responseType:g})}),[g]),o(rn,{className:u("container space-y-m",e),title:t,...s,children:c("form",{onSubmit:y,className:"space-y-m relative",children:[h?o($l,{blur:!1}):null,sr.map(((e,t)=>c("div",{className:u(Ll(e.columns),"grid gap-x-m"),children:[jl(e.title),Mc({field:x,inputs:e?.inputs})]},`section-${t}`))),Fc(l,f)]})})})),Od=d((({title:e,description:t})=>{const n=ke();return c("div",{className:"bg-white p-6xl py-20 flex gap-s flex-col @xl:items-center",children:[o(ne,{image:{icon:"MagnifierIcon",iconVersion:"normal"},width:"120",height:"120"}),o(k,{title:e,description:t,headlineVersion:n?"L":"S",isEmbedded:!0,className:"space-y-s"})]})})),Fd=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",zd=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`}),Vd=10;function Ld(e=0){const t=Math.round(e*Vd);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const jd=d((({className:e,style:t,idx:n,activeIndex:a,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const a=s(null),l=r((()=>({threshold:Ld(t),root:n?.current})),[t,n?.current]);return i((()=>{if(!a.current)return;const t=new IntersectionObserver(e,l);return t.observe(a.current),()=>{t.disconnect()}}),[e,l]),a}(l((e=>{e.length&&m&&m(n||0,e[e.length-1])}),[m,n]),c);return o("div",{className:u("inline-block snap-always box-border",e),style:t,"aria-current":Boolean(n===a),ref:h,role:"listitem",children:d})})),$d=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],qd=d((({className:e,itemClassName:t,containerRef:n,activeIndex:a,visibleItemCount:i=0,gap:r=0,padding:c=0,listType:d="horizontal-list",snapAlign:m="snap-center",minHeight:h,children:p,onVisibleItemsChange:g,onVisibleIndicesChange:f})=>{const x={sensitivity:1,rootRef:n},y=s([]),b=l(((e,t)=>{const n=[...y.current||[]];n[e]=t,y.current=n,g&&g(n),f&&f(Wd(n))}),[g,f]),v=i>0?r*Number(i)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Ud(c,v):{},...N?zd(h):{},gap:`${r}px`};return o("div",{className:u("box-border overflow-auto no-scrollbar",d,e),style:C,ref:n,role:"list",children:(S=(e,n)=>o(jd,{className:u(m,i?$d[i-1]:"",{"h-full":N},t),style:w?Ud(c/4):{},activeIndex:a,idx:n,observerOptions:x,onIntersection:b,children:e},String(n)),e=>null==e?e:Array.isArray(e)?e.map(S):S(e,0))(p)});var S})),Ud=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Wd=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Hd={"horizontal-list":"w-6","vertical-list":"h-6"},Yd=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(a,i)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",i===e?Hd[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(i)},String(i)),Kd=({activeIndex:e,onClick:t})=>(n,a)=>{const i=a===e,l=i?"min-w-[350px] bg-white shadow-dark-blue border-none p-6":"min-w-72 ease-in duration-300 bg-white/10 px-xl py-lg hover:backdrop-blur",r=i?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=i?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(a),"aria-label":n?.title,className:u("max-h-28 mt-xs ml-xs relative px-xl box-border overflow-hidden text-left grow basis-0 border border-gray group-data-secondary:border-white/50 whitespace-nowrap",l),children:[o("div",{className:r,children:n?.title}),o("div",{className:u("text-secondary-text font-light",s),children:n?.description})]},String(a))},Gd=e=>t=>e.scrollWidth/t,Xd=e=>(t,n)=>{e.scrollBy({left:n*Gd(e)(t),behavior:"smooth"})},Jd=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[i,r]=a([]),o=l((e=>{r((t=>{return(n=t)===(a=e)||Boolean(n&&a&&n?.length===a?.length&&n.every(((e,t)=>e===a[t])))?t:e;var n,a})),t&&t(e)}),[t]),[c,d]=i.length?[so()(i),lo()(i)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Xd(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Xd(n.current)(e,1):n.current.scrollTo({left:0,behavior:"smooth"}))}),[e,u]),g=l(((e,t={behavior:"smooth",block:"nearest",inline:"center"})=>{n?.current&&n.current.children[e]?.scrollIntoView(t)}),[n]);return[n,{scrollLeft:h,scrollRight:p,scrollTo:g,canScrollLeft:m,canScrollRight:u,visibleIndicesRange:[c,d],handleVisibleIndicesChange:o}]},Zd={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Qd=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:a="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=ke(),[h,p]=Jd({itemCount:s.length}),g=em(Boolean(s?.length));i((()=>{s?.length&&t>=0&&h?.current&&p.scrollTo(t,g)}),[t]);const f=l((e=>{e!==t&&c?.current&&d?.scrollTo(e,g)}),[c?.current]);return s?.length&&!m?o(qd,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Kd({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",Zd[a],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Yd({activeIndex:t,onClick:f,listType:a}))}):null})),em=(e=!1)=>({behavior:e?"auto":"smooth"}),tm=d((({className:e,disabled:t,...n})=>o(Ne,{rounded:!0,className:u("group/btn w-12 h-12 min-h-12 max-h-12 flex items-center justify-center shadow-main-black",t?"bg-secondary-light text-secondary-text":"bg-white text-primary-text hover:text-primary-main",e),disabled:t,...n,children:o(ne,{className:"w-4 h-4 min-w-4 min-h-4 rounded-full box-border",image:{icon:"ArrowLeftIcon",iconVersion:"black"},imageClassName:"group-hover/btn:text-primary-main",width:"16",height:"16"})}))),nm=d((e=>o(tm,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),am=d((e=>o(tm,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),im="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",lm=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:a,isBottom:i})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=a&&!i;return c("div",{className:e,children:[n?rm(t):null,l?o(nm,{className:u(sm(i),m?"left-1":"left-0"),onClick:s}):null,r?o(am,{className:u(sm(i),m?"right-1":"right-0"),onClick:d}):null]})})),rm=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(im,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(im,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),sm=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),om=d((({className:e,version:t,gap:n=14,padding:a=16,visibleItemCount:i=1,listType:l="horizontal-list",snapAlign:r,minHeight:s,showArrows:d,hasBlur:m,arrowsPadded:h,showDots:p,children:g,onVisibleIndicesChange:f,navButtons:x})=>{const y=Array.isArray(g)?g.length:0,[b,v]=Jd({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(qd,{containerRef:b,activeIndex:N,visibleItemCount:i,gap:n,padding:a,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(lm,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Qd,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),cm=({blocksToRender:e,...t})=>o(om,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:P(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",Fd(!0)),children:R(e,t)},String(n))})}),dm=e=>e%2!=0,mm=d((({textNode:e,iconNode:t,tag:n,onClick:a,justifyContent:i="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===i?"justify-between":"justify-center",l),onClick:a,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),um=d((({className:e="",label:t,icon:n,dataTheme:a="pc",disabled:i=!1,onClick:l})=>o(mm,{tag:"button",onClick:l,disabled:i,"data-theme":a,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",i?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Ae,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),hm=({isUnfolded:e,onToggle:t})=>o(um,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),pm=["ArrowDownIcon","ArrowUpIcon"],gm="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",fm=({topItemsCount:e=0,label:t="",block:n,blocksToRender:a=[],...i})=>{const[l,r]=e>0?[a.slice(0,e),a.slice(e)]:[a,[]];return c("div",{className:u("space-y-2xs",{hidden:!a.length}),children:[c("div",{className:u(gm),children:[P(l,{...i.options,parent:n}),dm(l.length)?o(Lt,{className:"col-span-6",...i}):null]}),o(Dr,{renderFoldableSection:({isUnfolded:e})=>c(_r,{className:u(gm),isUnfolded:e,children:[P(r,{...i.options,parent:n}),dm(r.length)?o(Lt,{className:"col-span-6",...i}):null]}),renderFoldButton:({isUnfolded:n,onToggle:a})=>o(um,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:pm[Number(n)],dataTheme:i.options?.page?.colorPalette,onClick:a})})]})},xm=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...a})=>{switch(e?.view){case"grid":return c("div",{children:[ym(n,t),fm({...e,...a,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[ym(n,t),cm({...a,blocksToRender:t})]});default:return null}})),ym=(e,t)=>e&&!t.length?o(Od,{...e}):null,bm=e=>t=>t.reduce(((t,n,a)=>t.length?t.concat({...e,key:`sep-${a}`},n):[n]),[]),vm=d((({value:e,onChange:t,items:n=[],multiple:a})=>n.map((n=>o(ll,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const i=e?.includes(n);t(a?i?(e||[]).filter((e=>e!==n)):[...e||[],n]:i?[]:[n])})(n.value),type:a?"checkbox":"radio"},n.value))))),Nm=d((({children:e,filtrationSchema:t,resetButton:n,field:a,reset:i})=>c("form",{className:"flex flex-col @4xl:flex-row justify-between bg-white p-4xl gap-s @4xl:gap-0",children:[c("div",{className:"flex flex-col @4xl:flex-row gap-xl",children:[e,bm(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(wm(a)).filter(Boolean))]}),n?o("div",{children:o(Hl,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:i,children:n?.text})}):null]}))),wm=e=>([t,n])=>{const a=n?.type;return"array"===a?Cm(t,e)(n):null},Cm=(e,t)=>n=>{const a=n?.items?.enum?.map(((e,t)=>({value:e,title:n?.items?.enumNames?.[t]||""})))||[];return c("div",{className:"flex-1",children:[n?.title?o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(vm,{items:a,multiple:!n?.single,...t(e)})]},e)};function Sm(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const km=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,Im=(e,t)=>Object.entries(e).map((([n,a])=>"number"==typeof a?Array.isArray(t[n])?((e,t)=>n=>km(t[e])||km(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>km(t[e])||km(n[e])||Tm(t[e])<=Tm(n[e]))(n,e):"object"==typeof a&&"min"in a&&"max"in a?((e,t)=>n=>km(t[e])||km(n[e])||Tm(t[e]?.min)>=Tm(n[e]?.min)&&Tm(t[e]?.min)<=Tm(n[e]?.max))(n,e):Array.isArray(a)?((e,t)=>n=>km(t[e])||km(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>km(t[e])||km(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Tm=e=>Number(e||0),Rm=(e,{block:t,page:n,normalize:a=nn})=>{const i=t?.blocks||[],[l,{field:s,reset:o,update:c}]=an(e),d=r((()=>Sm(i,i.map((e=>Mt(e.content,n?.fallback))))),[i,n?.fallback]),m=l===e?i:((e,t)=>(n=nn)=>e?.filter((([,e])=>Im(t,n(e)||{}))).map((([e])=>e)))(d,l)(a);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Bm={},Pm={},Dm=zt((({className:e,filtrationSchema:t=Bm,consumerField:n={},resetButton:a,...i})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Rm(Pm,{block:i.block,page:i.options?.page}),d=o(Dn,{className:"w-64",label:n?.title,options:_m(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>_m(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Nm,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Hl,{type:"reset",className:"mt-lg w-64",onClick:s,version:a?.version,children:a?.text})})]})}),o(xm,{blocksToRender:l,...i})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),_m=e=>Sm(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),Em=(e=!1)=>e?"text-left":"text-center",Am={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Mm=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:a,icon:i,...l})=>{const r=String(a?.width||t);return i?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Am[n],e),children:o(W,{...l,width:"54%",height:"54%",name:i})}):null})),Om=d((({className:e="",title:t,benefitList:n,...a})=>{const i=ke();return c(g,{className:e,defaultPadding:"p-6xl",...a,children:[t?o(w,{headingType:"h3",as:"h2",className:Em(i),title:t}):null,n?.length?o("div",{className:"flex flex-col @md:flex-row flex-wrap w-full @md:justify-center mt-xl gap-5xl",role:"list",children:n.map(Fm)}):null]})})),Fm=({label:e,description:t,__html:n,icon:a,isDotted:i=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[a?.icon?o(Mm,{className:"shrink-0",iconBgVersion:l,...a}):null,a?.src?o(ne,{className:"shrink-0",image:a}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Ae,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(_e,{__html:n,isDotted:i,itemSize:"list-s"}):null]}):null]},String(r)),zm=(e,t,n)=>{return o(om,{children:e.map((a=n,({icon:e,title:t,description:n},i)=>c("div",{className:u("flex flex-col gap-1","justify-between p-m h-full border border-gray",{"justify-center":!n&&!t}),children:[t?o(Ae,{size:"text-h6",font:"font-normal",align:a,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Ae,{size:"text-h6",font:"font-normal",align:a,children:n}):null]},String(i))))});var a},Vm=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:a="4",subtitle:i,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:i,headlineVersion:"M"}),e?.length?zm(e,0,t):null]}))),Lm={start:"justify-start",center:"justify-center",end:"justify-end"},jm=d((({buttons:e,className:t="",align:n,...a})=>{const i=n&&u("flex",Lm[n]);return o(g,{className:u("!bg-transparent",i,t),defaultPadding:"p-0",...a,children:$e(e)})})),$m=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:a=2,depositeName:i,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Ae,{size:"text-l",font:"font-light",color:r,children:t}),c("div",{className:"relative",children:[c("div",{className:"flex @xl:justify-center gradient-color-text",children:[o("span",{className:"font-mohave text-title-huge -mt-m tracking-[-15px]",children:He(a,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),i&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:i}):null]})]}))),qm=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o(W,{className:"w-10 h-auto lg:w-40",name:"PercentIcon"}),o("div",{className:"w-64",children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Um=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:a=2,color:i="text-secondary-text",children:l,...r})=>t?c("div",{className:"flex flex-col",children:[o("div",{className:"hidden lg:block min-w-96",children:o($m,{title:e,rate:t,unit:n,fractionDigits:a,color:i,...r})}),o(Ws,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:a,fixed:!0,color:i,...r}),l]}):o(qm,{title:e,...r}),Wm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Hm={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ym=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:a}=e,[i,l]=((e,t,n)=>{const{maxBonus:a=5e3,prefMonthsNum:i=Wm.prefMonthsNum,prefTravelBonusRate:l=Wm.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),a);return[c,c*i+Math.min(Math.round(s*t)+Math.round(o*n),a)*(12-i)]})(t||Hm,n,a);return{...t,...e,monthBonus:i,yearBonus:l}},Km=zt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,...l})=>{const[r,{field:s}]=an({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=Ym(r,n);return o(Ls,{className:e,title:t,...l,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),to({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Um({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:qs,children:[f>=0?o(Ws,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,$e(a,{isVertical:!0}),Xs(i)]})]})})})),Gm=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,Xm=e=>Qs({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Jm=" (c капитализацией)",Zm=({income:e,finalSum:t,postfix:n="₽",buttons:a=[],footnotes:i=[],isCapitalization:l=!1})=>c("div",{className:qs,children:[o(Ws,{title:`Доход в конце срока${l?Jm:""}`,value:e,postfix:n,prefix:"+"}),o(Ws,{title:`Сумма в конце срока${l?Jm:""}`,value:t,postfix:n}),$e(a,{isVertical:!0}),i?.map(Xs)]}),Qm={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const eu={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},tu=(e,t)=>{const{daysValue:n,moneyValue:a,isPartialWithdrawal:i,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||i,o=n<90||n>730,c=function(e){const t=e?.rateType?Qm[e?.rateType]:"",{data:n}=ba(t?`${Ut}/depositrates/${t}`:null,Dt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&nu(s,e)&&uo(a,["minSum","maxSum"],e)&&uo(n,["minDays","maxDays"],e)))||eu,{rate:m}=d,u=au(m,e),h=a+u,p=c||[eu];return{...d,...mo(["minSum","maxSum"],p),...mo(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},nu=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,au=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,daysValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i/30)-a):Math.round(a*e*i/365/100)},iu=zt((({className:e="",title:t,buttons:n,footnote:a,bottomFootnote:i,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=an({moneyValue:Ks(r,1e5),daysValue:Gs(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=tu(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Ls,{className:e,title:t,...d,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Сумма, ₽",min:p.minSum,max:p.maxSum,...h("moneyValue"),value:p.moneyValue}),(b={title:"Срок, дней",min:p.minDays,max:p.maxDays,...h("daysValue"),value:p.daysValue},o(Ea,{items:[`От ${Gm(b.min||0)}`,`До ${Gm(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[lu(p,h),Xm({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Um({rate:x,depositeName:y,isShowDepositeName:l}),Zm({income:g,finalSum:f,buttons:n,footnotes:[a,i]})]})});var b})),lu=(e,t)=>c("div",{className:"space-y-s",children:[o(Ae,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(xi,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(xi,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),ru=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,a]=t[n-1],[i,l]=t[n];a>=i?t.splice(n-1,2,[e,Math.max(a,l)]):n++}return t},su={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},ou=(e,t,n)=>{const{moneyValue:a,monthsValue:i}=e,l=t?.[0]?mu(t[0].minMonths,t[0].maxMonths):0,r=!n?.isShowMonthlyInterestPayment,s=!n?.isShowRemoteRegistration,o=!n?.isShowReplenish,c=!n?.isShowWithdrawn,d=!n?.isShowNewClient,m=t?.find((t=>[du({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),du({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),du({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),du({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,uo(a,["minSum","maxSum"],t),uo(i||l,["minMonths","maxMonths"],t)].every(Boolean)))||su,{rate:u}=m,h=cu(u,e),p=a+h,g=t||[su];return{...m,...mo(["minSum","maxSum"],g),...mo(["minMonths","maxMonths"],g),availableMonths:ru(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((a,i)=>t>=e?e+i*n:e-i*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},cu=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:a,monthsValue:i}=t;return n?Math.round(a*Math.pow((1200+e)/1200,i)-a):Math.round(a*e*30*i/365/100)},du=({row:e,userInputParams:t,paramKey:n,isExclude:a})=>a||t[n]===e[n],mu=(e,t)=>e+Math.round((t-e)/2),uu=(e="rub")=>"rub"===e,hu=(e,t)=>{const{minMonths:n,maxMonths:a}=mo(["minMonths","maxMonths"],xu(t,e?.currency)),i=e.monthsValue||Math.round((n+a)/2);return{monthsValue:Ra(i,n,a)}},pu=(e,t)=>{const{minSum:n,maxSum:a}=mo(["minSum","maxSum"],xu(t,e?.currency)),i=e.moneyValue||n;return{moneyValue:Ra(i,n,a)}},gu=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),fu=e=>{const t=uu(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},xu=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},yu=(e,t)=>{const n="rub"!==e?.currency?.key;return c("div",{className:"grid gap-lg",children:[c("div",{className:"flex gap-lg",children:[e.isShowReplenish?Qs({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?Qs({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),bu(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?Xm({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(a={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},Qs({...a,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),bu(e.isShowNewClient),e.isShowNewClient?o(xi,{text:"Новый вкладчик",...t("isNewClient")}):null]});var a},bu=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,vu={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Nu={text:"₽",key:"rub"},wu=zt((({className:e,title:t,calcSource:n,buttons:a=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Nu],g=l((e=>t=>e?{...t,...fu(t),...pu(t,e),...hu(t,e),...gu(t,e)}:t)(h),[h]),[f,{field:x}]=an({moneyValue:Ks(d,2e4),monthsValue:Gs(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Nu},{normalize:g}),y=x?.("currency")?.value??Nu,b=x?.("isNewClient")?.value,v=xu(h,y),N=ou(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{no({field:x,defParams:Hs(v,b),calcParams:N,monthsValue:"minMonths",map:vu})}),[x,h]);i((()=>{!xo(d)&&v&&I()}),[d,h]);const T=w===Hs(v,b)?.rate;return o(Ls,{className:e,title:t,...m,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[c("div",{className:"flex gap-m",children:[to({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Cu(y?.key)}),h&&h?.length>1?o(Mn,{label:"Валюта",options:p,...x("currency")}):null]}),Js({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),yu({...N,...s},x)]}),Um({rate:w,children:ku(I,T)}),Zm({income:C,finalSum:S,buttons:[...a,Su(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Cu=(e="")=>uu(e)?1e3:100,Su=(e=[],t="")=>{const{type:n,...a}=e.find((e=>e.type===t))??{};return a},ku=(e,t=!1)=>t?null:o(Hl,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Iu=e=>Tu({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Tu({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Tu=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:a,viewSettingFieldKey:i})=>!!n&&!n[i]||t[a]===e[a],Ru={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Bu=(e,t,n)=>{const{moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Ru],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Iu({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=co(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=co(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Iu({row:e,userInputParams:t,paramsViewSettings:n})&&uo(a+r,["minSum","maxSum"],e)&&uo(l,["minSumOld","maxSumOld"],e)&&uo(r,["minSumExtra","maxSumExtra"],e)&&uo(i,["minMonths","maxMonths"],e)))||Ru)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=ao(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:a,monthsValue:i,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},Pu=zt((({className:e="",title:t,calcSource:n,buttons:a,footnote:i,paramsViewSettings:l,...r})=>{const[s,{field:d}]=an({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Bu(s,n,l),h=eo({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Ls,{className:e,title:t,...r,children:c("section",{className:u(js,e),children:[c("div",{className:$s,children:[to({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),to({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Js({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),Du({...m,...l},d),m.isExtraMoney?to({title:"Дополнительная сумма, ₽ ",step:500,min:m.minSumExtra,max:m.maxSumExtra,...d("moneyExtra"),value:m.moneyExtra}):null,o("div",{className:"sm:hidden pt-1 pb-4 border-b border-main-divider",children:h})]}),c("div",{className:u(qs,"@4xl:w-1/2"),children:[o(Ws,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Ws,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Ws,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Ws,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),$e(a,{isVertical:!0}),Xs(i)]})]})})})),Du=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(xi,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(xi,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(xi,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),_u=d((e=>{const{onChange:t,min:n,max:a,defaultValue:i="0",fractionDigits:r=0,...s}=e,c=Ta(e,{normalize:(e=i)=>n&&a?String(Ra(Number(Eu(e)),n,a)):Eu(e),format:He(r)}),d=l((e=>t&&t(Eu(e))),[t]);return o(fn,{onChange:d,...s,...c})})),Eu=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Au=d((e=>o(_u,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Ae,{size:"text-xl",font:"font-light",children:"₽"})})}))),Mu={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Ou={amount:1500},Fu=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=an(Ou),[h,p]=a(!1);return i((()=>{p(d<=0)}),[d]),c(g,{className:u("flex flex-col items-center",e),defaultPadding:"p-6xl",...s,children:[t?o(w,{className:"pb-lg xl:pb-4xl self-start xl:self-center",headingType:"h3",title:t}):null,c("form",{className:"w-full xl:max-w-[468px]",method:"POST",action:Mu[r],children:[o(Au,{valid:!h,label:n,max:3e5,min:1,...m("amount",{parse:Number,format:String})}),o("input",{type:"hidden",name:"amount",value:d}),l?.text?o(Hl,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),zu=({className:e,text:t="ХИТ"}={})=>c("div",{className:u("w-14 h-14 bg-white flex flex-col items-center justify-center rounded-md shadow-main-black",e),children:[o(W,{iconVersion:"black",name:"HeartIcon",width:"24",height:"24"}),o(C,{size:"text-s",font:"font-normal",align:"text-center",color:"text-primary-text",children:t})]}),Vu="relative h-full",Lu={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},ju=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...a})=>{const{blocks:i}=a.block||{},l=i?.some(Uu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...a,renderProps:(n,a,i)=>c("div",{className:$u(n,{someCardsHighlighted:l}),children:[R(n,a,{className:qu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:i}),Uu(n)?zu({className:"absolute top-0 -right-4 z-40"}):null]},String(i))})},$u=(e,{someCardsHighlighted:t})=>u(Vu,t&&(Uu(e)?"pt-3xl":"pt-3xl sm:pt-16")),qu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:a="normal"})=>u(Vu,"min-w-80",Lu[a],t&&(Uu(e)?"pt-3xl sm:pt-16":"pt-3xl"),Fd(n),n&&"h-full"),Uu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Wu=zt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:a=!0,isGap:i=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(om,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:i?16:0,padding:0,arrowsPadded:a,navButtons:r?Hu(s?.block?.blocks):[],hasBlur:!0,children:ju({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Hu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Yu="z-10 border border-solid w-full h-full",Ku=u(Yu,"absolute hidden @xl:block border-transparent"),Gu=d((({className:e,title:t,description:n,button:a,...i})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...i,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Ku,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Ku,"top-6 right-8 bg-green")}),o("div",{className:u(Ku,"top-3 right-4 bg-green-light")}),c("div",{className:u(Yu,"relative p-xl sm:p-5xl bg-white border-transparent sm:border-green-more-light"),children:[o(k,{title:t,description:n,headlineVersion:"XS",align:"text-left",isEmbedded:!0}),$e([a],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),Xu={black:"bg-black",white:"bg-white"},Ju=d((({className:e="",title:t,description:n,image:a,price:i,button:l,colors:r=[],align:s="text-left",padding:d,...m})=>o(g,{className:u("flex flex-col justify-left",e),defaultPadding:"p-2xl",...m,children:c(Re,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:a?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:a}):null,buttons:$e([l],{buttonClassName:"w-full self-end"}),children:[r?.length?c("div",{className:"flex text-secondary-text mb-m",children:[o("div",{className:"mr-xs",children:o(Ae,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Zu)]}):null,i?c(Ae,{size:"text-h3",align:"text-left",children:[i," ₽"]}):null]})}))),Zu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${Xu[e]}`},String(t)),Qu=d((({icon:e,...t})=>{const n=pe(),{text:a,href:i,target:l,onClick:r}=n(t);return a?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:i,target:l,onClick:r,children:c("div",{className:"flex flex-col items-center gap-3 break-words max-w-[150px]",children:[e?o(ne,{className:"w-7 h-7 md:w-12 md:h-12",image:{...e,iconVersion:e?.iconVersion},alt:a}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:a})]})})}):null})),eh=d((({className:e,additionalDescription:t,description:n,links:a,title:i,...l})=>o(g,{defaultPadding:"p-5xl",className:u("overflow-hidden",e),...l,children:c("div",{className:"flex flex-col lg:flex-row gap-5 justify-between",children:[c("div",{className:"flex-1",children:[o(k,{isEmbedded:!0,title:i,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),a?.length?th(a):null]})}))),th=e=>o("div",{className:u("lg:grid-cols-9 lg:[&>*]:col-span-2 lg:[&>*:nth-child(14n+2)]:col-span-3 lg:[&>*:nth-child(7n+5)]:col-span-3","lg:[&>*:nth-child(7n+6)]:col-span-3 lg:[&>*:nth-child(7n+7)]:col-span-3 lg:[&>*:nth-child(14n+10)]:col-span-3 lg:w-3/6","grid-cols-3 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+3)]:col-span-2 max-lg:[&>*:not(:nth-child(-n+3)):nth-child(4n+4)]:col-span-2","grid gap-3 lg:gap-5"),children:e.map(((e,t)=>o(Qu,{...e},String(t))))}),nh=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),ah=d((({className:e="",href:t,target:n,onClick:a,data:i,children:l})=>{const r=pe()({href:t,target:n,onClick:a});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...fe(i),children:l})})),ih=[{origins:["t.me","telegram.org"],iconMapped:{icon:"TelegramIcon"}},{origins:["vk.com"],iconMapped:{icon:"VKIcon"}},{origins:["ok.ru"],iconMapped:{icon:"OkIcon"}},{origins:["apps.apple.com"],iconMapped:{icon:"AppleIcon"}},{origins:["play.google.com"],iconMapped:{icon:"PlayMarketIcon"}},{origins:["appgallery.huawei.com"],iconMapped:{icon:"HuaweiIcon"}},{origins:["youtube.com"],iconMapped:{icon:"YoutubeIcon"}},{origins:["rutube.ru"],iconMapped:{icon:"RutubeIcon"}},{origins:["dzen.ru"],iconMapped:{icon:"DzenIcon"}},{origins:["rustore.ru"],iconMapped:{icon:"RustoreIcon"}}],lh=d((({className:e="",media:t,showButtonText:n,stretched:i,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=a(),m=t?.map((e=>{const{href:t,icon:a,text:i}=e,{iconMapped:r}=(e=>ih.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=je(a)?a:r,c=n?{text:i}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&i&&d(!0),{...e,...c,icon:{...o,iconVersion:m},version:e?.version??l}})),h=u("border border-solid hover:border-transparent border-main-divider","group-data-primary:border-main-divider group-data-gray:border-green group/media",{"basis-auto":!n&&!s},rh(i));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:$e(m,{className:sh(s??!1,i??!1,n),buttonClassName:h})}),r?o(Ae,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),rh=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",sh=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),oh=d((({className:e,padding:t,description:n,additionalDescription:a,href:i,icon:l,isDotted:r,__html:s,socialMedia:d=[],target:m,title:h,align:p="text-left",benefits:f,imageOptions:{directionRight:x=!0,isImageAlwaysOnRight:y=false,isImageSecondary:b=!1}={},data:v,...N})=>o(g,{className:u("relative min-h-28 group-data-gray:bg-main-divider/50",e),defaultPadding:"p-0",...N,children:o(ah,{href:i,target:m,className:"h-full",data:nh(v),children:c(Re,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Qe(je(l)?o(ne,{image:l}):null,x),buttons:d.length?o(lh,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Le,{benefits:f}),s?o(_e,{__html:s,isDotted:r,itemSize:"list-s"}):null,ch(a,p)]})})}))),ch=(e,t)=>e?o(C,{size:"text-m",font:"font-light",color:"text-secondary-text group-data-secondary:text-white/80",align:t,children:e}):null,dh=(e,t)=>{const{title:n,description:a,buttons:i}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:n})}):null,a?o("div",{className:"mt-2xs",children:o(Ae,{size:"text-xl",color:"text-primary-text",children:a})}):null,i?.length?o("div",{className:"text-primary-main",children:$e(i)}):null]},String(t))},mh=d((({className:e="",title:t,align:n="text-center",icon:l,button:r,visibleCellsCount:s=1,cardCells:d=[],options:m,data:h,...p})=>{const f=d.map(dh),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=a(!1);return i((()=>ue.subscribe("fold",(e=>{e&&void 0!==m?.parent&&e.parent===m?.parent&&v(e.isUnfolded)}))),[m?.parent]),c(g,{className:u("flex flex-col",e),defaultPadding:"p-2xl",...p,children:[je(l)?o("div",{className:"self-center",children:o(ne,{image:l})}):null,t?o(w,{className:u("pt-xs",n),headingType:"h5",title:t}):null,r?.text?o(Ne,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(Dr,{renderFoldableSection:()=>c("div",{children:[x,o(_r,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?uh(m?.parent,h,b):null}):o("div",{children:x})]})})),uh=(e,t,n=!1)=>()=>c("button",{className:"w-full cursor-pointer text-primary-main pt-lg flex justify-between items-center",onClick:()=>{void 0!==e&&ue.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?fe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),hh=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId"),a=Jt();if(!t||!e||!n)return a.assign("/"),()=>{};const i=async()=>{const n=await Rr("/auth/refresh","POST",{refresh_token:e,access_token:t});if(401==n?.status&&a.assign("/"),n?.ok){const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const l=setInterval(i,24e4);return()=>clearInterval(l)},ph=d((({step:e=10,description:t,showPercentage:n=!0})=>c("div",{children:[o("div",{className:"h-4 w-full bg-gray relative",children:o("div",{className:"h-4 bg-green",style:{width:`${e}%`}})}),c("div",{className:"relative",children:[n?c("div",{className:"absolute left-2/4 text-green",children:[e,"%"]}):null,t?o("div",{className:"text-right mr-4 text-gray",children:t}):null]})]}))),gh=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const a=r((()=>(e+1)/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e+1," из ",t,"."]}),n[e]||null,o(ph,{step:a,showPercentage:!1})]})})}));var fh;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.pre_decision="PRE_DECISION",e.approved="APPROVED",e.cancelled="CANCELLED",e.failed="FAILED",e.draft="DRAFT",e.rework="REVISION"}(fh||(fh={}));const xh=e=>Tr("/user-data/getTaskStatus","POST",e),yh=e=>Rr("/user-data/sendSignalToProcess","POST",e),bh=(e,t)=>{const n=s(null),a=l((()=>n.current&&clearInterval(n.current)),[]);return i((()=>(n.current=setInterval((()=>e(a)),t),a)),[e,t]),a},vh=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:i})=>{const[l,r]=a(e),s=100-(e-l)/e*100;return c("div",{children:[n?o(k,{title:n,headlineVersion:"S"}):null,c("div",{className:"flex justify-center items-center flex-col",children:[c("div",{className:u("relative flex items-center justify-center w-24 h-24 rounded-full bg-gray text-transparent mb-5"),children:[o("div",{className:"absolute inset-0 rounded-full",style:{background:`conic-gradient(rgb(66, 171, 68) ${s}%, rgb(125, 126, 127) 0deg)`}}),o("div",{className:"z-10 flex items-center justify-center px-4 py-2 rounded-full w-20 h-20 bg-white text-primary-text text-m",children:o(Yc,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),i?o(_e,{__html:i}):null]})]})})),Nh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(vh,{interval:d,intervalExpireAction:m}):null]}),o(wh,{title:a,items:i}),o(wh,{title:l,items:r,countColumns:!0}),n?.__html?o(Jo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),wh=({title:e,items:t,countColumns:n=!1})=>{const a=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Ll(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:Ch(e)},t)))}):null]})]}):null},Ch=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),Sh=d((()=>o(Nh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),kh=d((({handleExpireTimer:e})=>{const{statusInfo:t}=zi();return o(Nh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:t?.cardCategory}]})})),Ih=d((()=>{const{statusInfo:e}=zi();return o(Nh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Th=d((()=>{const{statusInfo:e}=zi();return o(Nh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:Rh(e),buttonText:"Вернуться на главную"})})),Rh=e=>{const t=[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory}];return e?.deliveryAddress&&e?.deliveryDate?t.concat([{label:"Адрес доставки",description:e?.deliveryAddress},{label:"Дата доставки",description:$t(e?.deliveryDate)}]):t},Bh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Ph=d((()=>{const[e,t]=a(fh.process),{taskId:n}=zi();i((()=>{(async()=>{for(const e of Bh)await yh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await xh({taskId:n});a&&a?.statusCd!==fh.process&&(e(),t(a.statusCd))}),[n]);bh(r,3e4);return Dh(e,(()=>t(fh.rework)))})),Dh=(e,t)=>({IN_PROCESS:o(kh,{handleExpireTimer:t}),CANCELLED:o(Sh,{}),FAILED:o(Sh,{}),DRAFT:o(Sh,{}),APPROVED:o(Th,{}),PRE_DECISION:o(Th,{}),REVISION:o(Ih,{})}[e]||o(Ih,{})),_h=e=>(t,n)=>t.filter((e=>e)).map((t=>[Eh(n,e),Ah(t,e),zh(t,e),Mh(t,e),Oh(t,e),Fh(t,e)].some(Boolean)?{...t,required:!1}:t)),Eh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ah=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Mh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Oh=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Fh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const a=t(e?.name);return n!==(a?.key??a)})),zh=({name:e},t)=>"snils"===e&&Vh(t),Vh=e=>"PFR_CERTIFICATE"!==e("confirmationIncome")?.key,Lh=({field:e,inputs:t,params:n})=>t.map(Vl(e,n,{...Dc,..._c})),jh=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=_h($h(t))(e,n);return c("div",{className:u(Ll(i),"grid gap-x-m"),children:[jl(l),Lh({field:t,inputs:s,params:a})]},`section-${r}`)})),$h=e=>t=>e(t)?.value,qh=d((({step:e,isSending:t,onPrevStep:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Hl,{onClick:n,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Hl,{isLoading:t,type:"submit",children:a?"Отправить заявку":"Далее"})]})})),Uh=e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:a,creditInRshbCd:i}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:a,creditInRshbCd:i}},Wh=e=>{const{currency:t,paymentSystem:n,cardCategory:a,codeWord:i}=e;return{currencyCode:t?{key:t}:void 0,paymentSystemTypeCd:n,classCard:a,codeWord:i}},Hh=e=>{const{beginDate:t,employment:n,organizationName:a,inn:i,legalForm:l,organization:r,amountWorkers:s,employerActivities:o,employerOrganization:c,generalSeniority:d,lastJobExperience:m,experience5Years:u,jobsNumber:h,organizationPhone:p,organizationAddress:g,positionOrganization:f,partInBusiness:x}=e;return{employmentContractDate:$t(t||"",!0),employmentTypeCd:n,organizationName:a,organizationInn:i,organizationActivityTypeCd:o,organizationTypeCd:r,organizationKindCd:c,employeesNumberCd:s,opf:l,seniority:d,generalSeniority:u,jobsNumber:h,lastWorkDuration:m,positionCd:f,participantContacts:md({organizationPhone:p&&qt(p)}),participantAddresses:ud({organizationAddress:g}),ownershipShare:"BUSINESS_OWNER"===f?.key?x:""}},Yh=e=>{const{name:t,surname:n,middleName:a,limitedBirthday:i="",phone:l="",email:r,sex:s,birthPlace:o,dulIssueDateField:c="",dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,education:p,participantDateRegistration:g="",housing:f,addressRegistration:x,addressFact:y}=e;return{birthDate:$t(i,!0),midname:a,name:t,surname:n,birthPlace:o,dulIssueDate:$t(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:$t(g,!0),houseTypeCd:f,participantContacts:md({phone:qt(l),email:r}),participantAddresses:ud({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}},Kh=e=>{const{methodObtain:t,deliveryDate:n=""}=e,a="courier"===t;return a?{courierDeliveryFlg:a,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"},office:{id:"3"}}:{};var i},Gh=e=>{const{addressRetail:t,methodObtain:n}=e;return t?.key&&"office"===n?{office:{id:t.key}}:{}},Xh=(e,t)=>{switch(e){case 0:default:return{};case 1:return Yh(t);case 2:return Hh(t);case 3:return hd(t);case 4:return Uh(t);case 5:return(e=>{const{addressCourier:t,methodObtain:n}=e;return"courier"===n?{participantAddresses:ud({addressCourier:t})}:{}})(t)}},Jh=[{paymentSystem:{key:"",text:""},currency:"810",codeWord:""},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0,methodObtain:"office",addressCourier:{fullAddress:"",fiasCode:""}},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},familyMembers:void 0,dependents:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Zh=e=>{try{return e?new Date(e):void 0}catch(e){return}},Qh=({step:e,inputs:t,onNextStep:n,onFinish:a})=>{const[i,{setTrue:s,setFalse:o}]=on(!1),c=5===e,d=zi(),m=r((()=>((e,t)=>({...Jh[e],...t,limitedBirthday:Zh(t?.limitedBirthday),dulIssueDateField:Zh(t?.dulIssueDateField),participantDateRegistration:Zh(t?.participantDateRegistration),beginDate:Zh(t?.beginDate),deliveryDate:Zh(t?.deliveryDate)}))(e,d.leadForm)),[e,d.leadForm]),u=l((e=>{const{leadForm:t}=d;c&&e.ok&&t&&(d.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,deliveryAddress:t?.addressCourier?.fullAddress,cardCategory:t?.cardCategory?.text,deliveryDate:t?.deliveryDate},d.leadForm=m)}),[c,m]),h=l((async i=>{const l=Xl(sa(_h(ep(i))(t,e)));if(On(l(i))){s(),d.leadForm=i;try{const{taskId:t,profileId:l,participantId:r}=d;if(t&&l&&r){const n=await Vc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,...Gh(a),authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Xh(i,a)}],...Wh(a),...Kh(a)}}))({participantId:r,taskId:t,profileId:l,step:e,formData:i}));u(n)}n(),c&&a?.()}catch(e){}finally{o()}}}),[c,u]);return[m,h,i]},ep=e=>t=>e[t],tp=d((({step:e,sections:t,isFormFinished:n,onPrevStep:a,onNextStep:i,onFinish:l})=>{const s=r((()=>t?.flatMap((e=>e?.inputs))||[]),[t]),[d,m,u]=Qh({step:e,inputs:s,onNextStep:i,onFinish:l}),[,{field:h,onSubmit:p}]=an(d,{onSubmit:m});return n?o(Ph,{}):c("form",{onSubmit:p,className:"space-y-m",children:[jh({sections:t,field:h,step:e}),o(qh,{isSending:u,step:e,onPrevStep:a})]})})),np=[[{title:"Персональные данные",columns:2,inputs:[{fieldType:"common",name:"surname",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"name",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"middleName",dadata:!0,filledByEsia:!0},{fieldType:"common",name:"sex",required:!0},{fieldType:"common",name:"limitedBirthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0,filledByEsia:!0},{fieldType:"common",name:"phone",required:!0,filledByEsia:!0},{fieldType:"common",name:"email",required:!0,dadata:!0}]},{title:"Паспортные данные",columns:2,inputs:[{fieldType:"common",name:"dulSerie",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulNumber",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulIssueDateField",required:!0,filledByEsia:!0},{fieldType:"common",name:"dulSubdivisionCode",required:!0,dadata:!0,filledByEsia:!0}]},{inputs:[{fieldType:"common",name:"dulIssuedBy",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"education",required:!0}]},{title:"Адрес регистрации по месту жительства",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressRegistration",required:!0,dadata:!0,filledByEsia:!0},{fieldType:"common",name:"addressMatch"}]},{columns:2,inputs:[{fieldType:"common",name:"participantDateRegistration",required:!0}]},{title:"Адрес фактического проживания (место пребывания РФ)",inputs:[]},{columns:2,inputs:[{fieldType:"common",name:"housing",required:!0}]},{inputs:[{fieldType:"common",name:"addressFact",required:!0,dadata:!0}]}],[{title:"Данные о трудоустройстве",inputs:[]},{inputs:[{fieldType:"common",name:"infoCard",label:"Клиент на момент оформления заявки на кредит должен быть: официально трудоустроен более 6 месяцев, если Клиент получает з/п на счет РСХБ, то трудоустроен более 3 месяцев, не должен находиться в декретном отпуске"}]},{inputs:[{fieldType:"common",name:"employment",required:!0},{fieldType:"common",name:"organizationName",required:!0,dadata:!0}]},{columns:2,inputs:[{fieldType:"common",name:"inn",required:!0,dadata:!0},{fieldType:"common",name:"legalForm",required:!0}]},{inputs:[{fieldType:"common",name:"organization",required:!0},{fieldType:"common",name:"amountWorkers",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!0},{fieldType:"common",name:"employerOrganization",required:!0},{fieldType:"common",name:"generalSeniority",required:!0},{fieldType:"common",name:"lastJobExperience",required:!0},{fieldType:"common",name:"experience5Years",required:!0},{fieldType:"common",name:"jobsNumber",required:!0}]},{inputs:[{fieldType:"common",name:"organizationPhone",label:"Телефон работодателя",required:!0},{fieldType:"common",name:"beginDate",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"positionOrganization",required:!0},{fieldType:"common",name:"partInBusiness",required:!0,condition:{name:"positionOrganization",values:["BUSINESS_OWNER"]}}]},{title:"Адрес работодателя",inputs:[]},{inputs:[{fieldType:"common",name:"organizationAddress",required:!0,dadata:!0}]}],[{title:"Семейное положение"},{columns:1,inputs:[{fieldType:"common",name:"familyStatus",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"dependents",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"familyMembers"},{fieldType:"common",name:"children",required:!0}]},{title:"Совокупный доход"},{inputs:[{fieldType:"common",name:"infoCard",label:"Сумма основного и дополнительных доходов после вычета налога"}]},{columns:1,inputs:[{fieldType:"common",name:"confirmationIncome",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"wages",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"mandatoryPayments",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"snils",required:!0}]},{columns:1,inputs:[{fieldType:"common",name:"conscription",required:!0}]},{columns:2,inputs:[{fieldType:"common",name:"armyIdFlg"}]}],[{title:"Дополнительные сведения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"disablePeopleFlg"}]},{inputs:[{fieldType:"common",name:"bankruptcyFlg"}]},{inputs:[{fieldType:"common",name:"shareholderFlg"}]},{inputs:[{fieldType:"common",name:"legalEntityName"}]},{inputs:[{fieldType:"common",name:"creditInRshbCd"}]}]],ap=[[{title:"Параметры карты",inputs:[]},{inputs:[{fieldType:"common",name:"currency",required:!0},{fieldType:"common",name:"paymentSystem",required:!0},{fieldType:"common",name:"cardCategory",required:!0},{fieldType:"common",name:"codeWord",required:!0}]}],...np,[{title:"Способ получения",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"methodObtain"}]},{title:"Адрес",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"addressCourier",dadata:!0,condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"deliveryDate",condition:{name:"methodObtain",values:["courier"]},required:!0},{fieldType:"common",name:"comment",condition:{name:"methodObtain",values:["courier"]}}]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0,condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"addressRetail",required:!0,condition:{name:"methodObtain",values:["office"]}}]},{inputs:[{fieldType:"common",name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код",condition:{name:"methodObtain",values:["office"]}},{fieldType:"common",name:"bankEmployeeCode",condition:{name:"methodObtain",values:["office"]}}]}]],ip=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],lp=d((({className:e,...t})=>{const[n,d]=a(0),m=s(null),u=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);i(hh,[]);const h=l((()=>{d((e=>Math.min(e+1,6))),u()}),[]),p=l((()=>{d((e=>Math.max(e-1,0))),u()}),[]),f=r((()=>ap[n]),[n]),[x,{setTrue:y}]=on(!1);return o(g,{className:e,...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[x?null:o(gh,{stepsTitles:ip,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(tp,{step:n,sections:f,isFormFinished:x,onNextStep:h,onPrevStep:p,onFinish:y},String(n))})]})})})),rp=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const a=r((()=>e/t*100),[e,t]);return o("div",{className:"py-lg px-5xl bg-white col-span-12",children:c("div",{children:[c("span",{className:"font-bold mr-s",children:["Шаг ",e," из ",t,"."]}),n[e]||null,o(ph,{step:a,showPercentage:!1})]})})})),sp=d((({title:e,description:t,infoCard:n,sectionInfoTitle:a,sectionInfo:i,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,intervalExpireAction:m=(()=>{}),...u})=>c(g,{...u,children:[c("div",{className:"flex flex-col md:flex-row items-center",children:[o(k,{headlineVersion:"M",title:e,description:t,align:"text-left",padding:"p-xl",className:"w-full"}),d?o(vh,{interval:d,intervalExpireAction:m}):null]}),o(op,{title:a,items:i}),o(op,{title:l,items:r,countColumns:!0}),n?.__html?o(Jo,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(Ne,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),op=({title:e,items:t,countColumns:n=!1})=>{const a=ke();return t?c("div",{children:[o("hr",{className:"w-full h-px bg-main-gray border-0"}),c("div",{className:"p-xl",children:[e?o(Ae,{color:"text-primary-text",size:"text-h5",children:o("div",{className:u({"mb-m":Boolean(e)}),children:e})}):null,t?o("div",{className:u("grid grid-cols-1 gap-m",Ll(n||a?1:2)),children:t.map(((e,t)=>o("div",{children:cp(e)},t)))}):null]})]}):null},cp=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Ae,{color:"text-secondary-text",size:"text-l",children:e}),o(Ae,{color:"text-primary-text",size:"text-xl",children:t})]}),dp=d((()=>o(sp,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),mp=d((({handleExpireTimer:e})=>{const{statusInfo:t}=zi();return o(sp,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:`${t?.calculator?.moneyValue?.toLocaleString()??"0"} ₽`},{label:"Срок кредита",description:`${t?.calculator?.monthsValue??"0"} мес`},{label:"Тип платежа",description:t?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),up=d((()=>{const{statusInfo:e}=zi();return o(sp,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail},{label:"Адрес",description:e?.addressRetail}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),hp=d((()=>{const{statusInfo:e}=zi();return o(sp,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.calculator?.monthsValue+" мес"},{label:"Тип платежа",description:e?.calculator?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),pp=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],gp=d((()=>{const[e,t]=a(fh.process),{taskId:n}=zi();i((()=>{(async()=>{for(const e of pp)await yh({signalType:e,taskId:n})})()}),[n]);const r=l((async e=>{const a=await xh({taskId:n});a&&a?.statusCd!==fh.process&&(e(),t(a.statusCd))}),[n]);bh(r,3e4);return fp(e,(()=>t(fh.rework)))})),fp=(e,t)=>({IN_PROCESS:o(mp,{handleExpireTimer:t}),CANCELLED:o(dp,{}),FAILED:o(dp,{}),DRAFT:o(dp,{}),APPROVED:o(hp,{}),PRE_DECISION:o(hp,{}),REVISION:o(up,{})}[e]||o(up,{})),xp=({field:e,inputs:t,params:n})=>t.map(Vl(e,n,{...Dc})),yp=({sections:e,field:t,step:n,params:a})=>e?.map((({inputs:e=[],columns:i,title:l},r)=>{const s=_h(bp(t))(e,n);return c("div",{className:u(Ll(i),"grid gap-x-m"),children:[jl(l),xp({field:t,inputs:s,params:a})]},`section-${r}`)})),bp=e=>t=>e(t)?.value,vp=d((({step:e,onPrevStep:t,isSending:n})=>{const a=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Hl,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Hl,{type:"submit",isLoading:n,children:a?"Отправить заявку":"Далее"})]})})),Np={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},wp=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:a}=e?.calculator??{};return{loanAmount:t,creditPeriod:n,paymentTypeCd:Np[a?"annuity":"differential"]}},Cp=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Sp=(e,t)=>{switch(e){case 0:return(e=>{const{isInsurance:t,isSalaryClient:n}=e?.calculator??{};return{payrollCardRshbFlg:t,consentInsuranceFlg:n}})(t);case 1:return Yh(t);case 2:return Hh(t);case 3:return hd(t);case 4:return Uh(t);default:return{}}},kp=[{calculator:{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1}},{surname:"",name:"",middleName:"",sex:"",limitedBirthday:void 0,birthPlace:"",phone:"",email:"",dulSerie:void 0,dulNumber:void 0,dulIssueDateField:void 0,dulSubdivisionCode:"",dulIssuedBy:"",addressRegistration:{fullAddress:"",fiasCode:""},participantDateRegistration:void 0,addressFact:{fullAddress:"",fiasCode:""},housing:void 0},{amountWorkers:{key:"",text:""},beginDate:void 0,employerActivities:{key:"",text:""},employerOrganization:{key:"",text:""},employment:{key:"",text:""},experience5Years:void 0,inn:void 0,jobsNumber:void 0,lastJobExperience:void 0,legalForm:"",organization:{key:"",text:""},organizationAddress:{fullAddress:"",fiasCode:""},organizationName:"",organizationPhone:"",partInBusiness:void 0,positionOrganization:{key:"",text:""}},{familyStatus:{key:"",text:""},dependents:void 0,familyMembers:void 0,confirmationIncome:{key:"",text:""},wages:void 0,mandatoryPayments:void 0,snils:"",armyIdFlg:!1},{disablePeopleFlg:!1,bankruptcyFlg:!1,shareholderFlg:!1,legalEntityName:"",creditInRshbCd:void 0},{regionRetail:{key:"",text:""},addressRetail:void 0,bankEmployeeCode:void 0}],Ip=e=>{try{return e?new Date(e):void 0}catch(e){return}},Tp=({step:e,inputs:t,onNextStep:n,onFinish:a})=>{const[i,{setTrue:s,setFalse:o}]=on(!1),c=5===e,d=zi(),m=r((()=>((e,t)=>({...kp[e],...t,limitedBirthday:Ip(t?.limitedBirthday),dulIssueDateField:Ip(t?.dulIssueDateField),participantDateRegistration:Ip(t?.participantDateRegistration),beginDate:Ip(t?.beginDate),deliveryDate:Ip(t?.deliveryDate)}))(e,d.leadForm)),[e,d.leadForm]),u=l((e=>{const{leadForm:t}=d;c&&e.ok&&t&&(d.statusInfo={regionRetail:t?.regionRetail?.text,addressRetail:t?.addressRetail?.text,calculator:{monthsValue:t?.calculator?.monthsValue,moneyValue:t?.calculator?.moneyValue,isAnnuity:t?.calculator?.isAnnuity}},d.leadForm=m)}),[c,m]),h=l((async i=>{const l=Xl(sa(_h(Rp(i))(t,e)));if(On(l(i))){s(),d.leadForm=i;try{const{taskId:t,profileId:l,participantId:r}=d;if(t&&l&&r){const n=await Vc((({participantId:e,taskId:t,profileId:n,formData:a,step:i=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:Jt().origin,id:t,authorizedAgentId:a?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Sp(i,a)}],...wp(a),...Cp(a),esiaAccountTypeCd:{key:a?.esiaAccountTypeCd?.key}}}))({participantId:r,taskId:t,profileId:l,step:e,formData:i}));u(n)}n(),c&&a?.()}catch(e){}finally{o()}}}),[c,u]);return[m,h,i]},Rp=e=>t=>e[t],Bp=d((({step:e,sections:t,isFormFinished:n,programsSource:a,onPrevStep:i,onNextStep:l,onFinish:s})=>{const{programId:d}=zi(),m=a?.[d??""],u=r((()=>t?.flatMap((e=>e?.inputs))||[]),[t]),[h,p,g]=Tp({step:e,inputs:u,onNextStep:l,onFinish:s}),[,{field:f,onSubmit:x}]=an(h,{onSubmit:p});return n?o(gp,{}):c("form",{onSubmit:x,className:"space-y-m",children:[yp({sections:t,field:f,step:e,params:{calcData:m}}),o(vp,{step:e,isSending:g,onPrevStep:i})]})})),Pp=[[{columns:1,inputs:[{fieldType:"common",name:"calculator"}]}],...np,[{title:"Отделение Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"regionRetail",required:!0}]},{inputs:[{fieldType:"common",name:"addressRetail",required:!0}]},{title:"Код представителя Банка",columns:1,inputs:[]},{inputs:[{fieldType:"common",name:"infoCard",label:"Если представитель Банка помогал Вам в заведении заявки, введите здесь его код"}]},{inputs:[{fieldType:"common",name:"bankEmployeeCode"}]}]],Dp=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],_p=zt((({className:e,programsSource:t,...n})=>{const[d,m]=a(0),u=s(null),h=l((()=>u?.current?.scrollIntoView({behavior:"smooth"})),[u]);i(hh,[]);const p=l((()=>{m((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{m((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Pp[d]),[d]),y=0===d,[b,{setTrue:v}]=on(!1);return o(g,{className:e,...n,children:c("div",{ref:u,className:"container grid grid-cols-12",children:[y||b?null:o(rp,{stepsTitles:Dp,step:d,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(Bp,{step:d,sections:x,isFormFinished:b,programsSource:t,onNextStep:p,onPrevStep:f,onFinish:v},String(d))})]})})})),Ep=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Ap=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Mp=1e9,Op={sum:{min:1e4,max:Mp},period:3},Fp=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:a,periodInput:i,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Rm(Op,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:zp(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Vp(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Nm,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Au,{label:a?.title,min:500,max:Mp,...d("sum",{parse:e=>({min:Number(e),max:Mp}),format:({min:e})=>String(e)})}),o(Ea,{title:i?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(xm,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),zp=e=>_t((e?.paramsSource?.rateRows||[]).filter(Ep).flatMap((e=>Ap(e.minMonths,e.maxMonths)))),Vp=e=>_t(e.flatMap((e=>e||[])).filter(Ep).flatMap((e=>Ap(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Lp=[{key:"10"},{key:"50"},{key:"100"}],jp=({itemCount:e,onItemCountChange:t})=>{const n=l((({key:e})=>t(Number(e))),[]);return c("div",{className:"mt-2 @lg:mt-0 items-center gap-s hidden @lg:flex",children:[o("span",{children:"Показать по"}),o(Dn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Lp,iconVersion:"black"})]})},$p="py-m @lg:px-lg px-m rounded-md cursor-pointer text-center min-w-10 @lg:min-w-0 hover:bg-primary-hover hover:text-white",qp=(e,t)=>{const{currentPage:n,onPageChange:a,totalPages:i}=e,l=t+1;return l===n?o("div",{"aria-current":"true",className:"py-m @lg:px-lg px-m bg-primary-main text-center min-w-10 @lg:min-w-0 text-white rounded-md",children:l},String(t)):1!==l&&l!==i&&((e,t,n)=>e<t&&e>=t-1||e<=t+1&&e>t||((e,t,n)=>t<=2&&e<=t+2||t>=n-1&&e>=n-3)(e,t,n))(l,n,i)?o("div",{onClick:()=>a(l),className:$p,"aria-label":`Страница ${l}`,children:l},String(t)):null},Up={width:"24",height:"24"},Wp=({currentPage:e,onPageChange:t,totalPages:n})=>{const a=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),i=l((()=>{e>1&&t(e-1)}),[e]),s=l((()=>{e<n&&t(e+1)}),[e,n]),d=l((()=>t(1)),[]),m=l((()=>t(n)),[n]);return c("div",{className:"flex gap-m items-center",children:[o("div",{onClick:i,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Hp(1===e),...Up})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:$p,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,a.map(qp),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:$p,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Hp(e===n),...Up})})]})},Hp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",Yp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:a,onItemCountChange:i})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Wp,{currentPage:e,onPageChange:t,totalPages:n}),a&&i?o(jp,{itemCount:a,onItemCountChange:i}):null]}),Kp=d((({className:e,value:t,autoFocus:n,onChange:a,onFocus:i,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{a&&a(e.target?.value||"")}),[a]);return c("div",{className:u("relative",e),role:"form",children:[o("div",{className:"absolute h-full flex items-center pl-m pointer-events-none",children:o(ne,{image:{icon:"LoupeIcon",iconVersion:"black"},width:"24",height:"24"})}),o("input",{className:u("h-14 w-full px-10 text-l text-black box-border rounded-md",hn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:i})]})})),Gp=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(Kp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(ci,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(ci,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период до",minDate:n.startDate,...e("endDate")}),o("div",{className:"col-span-12 @lg:col-span-2 mt-8 @lg:mt-auto",children:o(Hl,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Xp=(e,t)=>o(Mm,{...e,iconBgVersion:t,className:"shrink-0"}),Jp=d((({title:e,timestamp:t,publicId:n})=>{const a=pe(),{href:i}=a({href:`${Ut}/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[Xp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Ae,{size:"text-m","font-weight":"font-light",children:$t(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:i,download:!0,"aria-label":"Скачать",children:e})]})]},n)})),Zp=`${Ut}/depository`,Qp={startDate:void 0,endDate:void 0,query:""},eg=zt((({className:e,...t})=>{const[n,i]=a(0),[r,s]=a(10),[d,{field:m,reset:h}]=an(Qp),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:a,endDate:i})=>{const l=a?$t(a,!0):"",r=i?$t(i,!0):"",s=new URLSearchParams(Zp);s.set("page",String(t)),s.set("size",String(e)),s.set("query",n),s.set("timestampStart",l),s.set("timestampEnd",r);const o=`?${s.toString()}`,{data:c}=ba(Zp+o,Dt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>i(e-1)),[]),y=l((e=>{r!==e?(s(e),i(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Gp,{filtrationState:d,field:m,onClearFilter:h}),c("div",{className:"flex flex-col",children:[c("div",{className:"grid grid-cols-12 pb-lg border-gray border-opacity-50 border-b",children:[o("div",{className:"col-span-4 @lg:col-span-2 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Ae,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Jp,{...e},String(e.publicId)))):o(Od,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(Yp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),tg=e=>"Image"===e?.contentType&&e?.image?o(ne,{image:e.image}):"Code"===e?.contentType&&e.code?o("div",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:e.code}):null,ng=d((({className:e="",title:t,description:n,error:a,button:i,...l})=>c(g,{className:u("flex flex-col justify-center items-center",e),defaultPadding:u("p-6xl"),version:"transparent",...l,children:[o("div",{className:"flex justify-center",children:tg(a)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),i?.text?o(Ne,{version:i?.version,text:i?.text,...i}):null]}))),ag=`${Ut}/region`;function ig(e="Москва"){return Fi().location??{name:e}}function lg(e="Москва"){const t=Fi(),n=l((async()=>{if(!t.location){const n=await Pt(ag);t.location=n??{name:e}}}),[t,e]);return ba(ag,n),t}var rg;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(rg||(rg={}));const sg=new Intl.NumberFormat("ru",{style:"currency",currency:rg.RUB}),og=e=>e?sg.format(e):"",cg="text-m font-light text-secondary-text ",dg=`${cg} text-left`,mg=`${cg} pl-5xl text-center`,ug=`${cg} pl-5xl text-right`,hg={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},pg=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:dg,children:o(Ae,{size:"text-m",children:"Валюта"})}),o("th",{className:mg,children:o(Ae,{size:"text-m",children:"Купить"})}),o("th",{className:ug,children:o(Ae,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(gg)})]}))),gg=e=>{const t=e?.currency?.currency;return c("tr",{className:"pb-2xs text-h6",children:[o("td",{className:"pt-m m-auto flex text-left",children:c("div",{className:"flex items-center gap-xs",children:[t?o(ne,{image:{icon:hg[t]},width:"24",height:"24"}):null,o(Ae,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Ae,{size:"text-h6",children:og(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Ae,{size:"text-h6",children:og(e?.buyExchangeRate)})})]},t)},fg={icon:"GpsIcon"},xg=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Mm,{...fg,iconBgVersion:"primary",className:"shrink-0"}),c("div",{className:"space-y-2xs whitespace-pre-wrap",children:[t?o(C,{size:"text-l",color:"text-primary-main",children:t}):null,o(C,{size:"text-m",color:"text-secondary-text",children:"Курс указан для заданного офиса"})]})]}))),yg=(e,t,n)=>{const a=Number(bg(e))*Math.pow(t,n?-1:1);return Number.isInteger(a)?a:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(a)},bg=e=>e.replace(/[^\d.,]/g,"").replace(",",".");function vg(e){if(!e)throw new Error("Value should be fulfilled");return e}const Ng=e=>t=>{const[,n]=vg(e.find((([e])=>e(t))));return n(t)},wg=e=>Ng(e.map((([e,t])=>[e,()=>t])));wg.if=e=>new Cg(void 0,e);class Cg{parent;predicate;unit;get entry(){return[vg(this.predicate),vg(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Cg(this,e)}then(e){return new Cg(this.parent,this.predicate,e)}else(e){return Ng([...Sg(this),[()=>!0,e]])}}const Sg=e=>[...e?.parent?Sg(e.parent):[],e.entry],kg=e=>wg([[e=>e.value!==rg.RUB&&e.oppositeValue!==rg.RUB,()=>e.handleConvert(e.value,rg.RUB)],[e=>e.value===rg.RUB&&e.oppositeValue===rg.RUB,()=>e.handleConvert(e.value,rg.USD)],[e=>e.value===rg.RUB&&e.oppositeValue===rg.RUB,()=>e.handleConvert(e.value,rg.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function Ig(e){const{placeholder:t,rates:n,selected:a,value:i,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:a,text:a};return c("div",{className:"relative flex",children:[o(fn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:i,onChange:l}),s.length?o(Dn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const Tg=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:i})=>{const[r,s]=a({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||rg.RUB,selectBuy:n?.[0]?.currency?.currency||rg.USD}),d=l((e=>s((t=>({...t,...e})))),[]);return c("div",{className:`flex flex-col gap-m pt-2xl ${e}`,children:[t&&n?c("div",{className:"grid gap-m",children:[Ig({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:Rg(r,d,n),value:r.inputSell,setValue:e=>Pg(d,n)(e,r.selectSell,r.selectBuy)}),Ig({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Bg(r,d,t),value:r.inputBuy,setValue:e=>Dg(d,t)(e,r.selectBuy,r.selectSell)})]}):null,i?.text?o(Ne,{text:i.text,version:i?.version,...i}):null]})})),Rg=(e,t,n)=>a=>{t({selectSell:a}),kg({value:a,oppositeValue:e.selectBuy,handleConvert:(a=e.selectSell,i=e.selectBuy)=>{Pg(t,n)(e.inputSell,a,i)}})},Bg=(e,t,n)=>a=>{t({selectBuy:a}),kg({value:a,oppositeValue:e.selectSell,handleConvert:(a=e.selectBuy,i=e.selectSell)=>Dg(t,n)(e.inputBuy,a,i)})},Pg=(e,t)=>(n,a,i)=>{e({inputSell:bg(n),selectBuy:i});const l=t.find((e=>e.currency?.currency===i))?.buyExchangeRate||t.find((e=>e.currency?.currency===a))?.buyExchangeRate;l&&e({inputBuy:String(yg(n,l,a===rg.RUB)||"")})},Dg=(e,t)=>(n,a,i)=>{e({inputBuy:bg(n),selectSell:i});const l=t.find((e=>e.currency?.currency===i))?.saleExchangeRate||t.find((e=>e.currency?.currency===a))?.saleExchangeRate;l&&e({inputSell:String(yg(n,l,a===rg.RUB)||"")})},_g=`${Ut}/exchangerates`;const Eg=d((({className:e="",title:t="Курсы обмена валют",button:n,...a})=>{const i=function(e){const t=e?.code||"000",{data:n}=ba(_g+`?regionCode=${t}`,Dt);return n||{}}(ig()),l=Ag(i?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:rg.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:rg.RUB}}),o(g,{className:u("box-border min-h-80",e),...a,children:o(Re,{className:"h-full",title:o(w,{headingType:"h4",title:t,className:"whitespace-pre-wrap"}),children:c("div",{className:"flex w-full gap-6xl flex-wrap @lg:flex-nowrap",children:[c("div",{className:"w-full @2xl:w-auto @5xl:w-1/2",children:[l?o(pg,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(xg,{address:i?.address})]}),o(Tg,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Ag=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Mg=d((({className:e="",items:t})=>{const n=pe();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Og(n))})})),Og=e=>({dataFooter:t,...n},a)=>{const{text:i,href:l,target:r,onClick:s}=e(n);return i?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...fe(t),children:i||null})},String(a)):null},Fg=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:a,labelIcon:i})=>o(mm,{tag:"button",className:u("border-none bg-transparent items-center group/button",i?.icon?"py-xs":"py-lg"),onClick:a,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Xp(i,t),e?o(Ae,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),zg=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Vg=(e=!1)=>e?"MinusIcon":"PlusIcon",Lg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",jg=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:a="Развернуть",labelIcon:i,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=ke();return o(g,{className:u("w-full border-0 border-b border-solid border-main-divider last:border-b-0",e),defaultPadding:"p-0",tag:"div",version:"transparent",role:c,...d,children:o(Dr,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(_r,{className:u("gap-lg",zg(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>$g({foldButtonVersion:r,label:a,labelIcon:i,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),$g=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:a,isUnfolded:i,onToggle:l,isMobile:r=!1})=>{const s=t||(i?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Lg(e):Vg(e))(i,r);return"accordion"===e?o(Fg,{label:s,labelIcon:n,labelIconBgVersion:a,icon:c,onToggle:l}):o(um,{label:s,icon:i?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},qg=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Ug(e)}))),Ug=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(jg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Mg,{items:e.items}):null},String(t)))),Wg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Hg)}):null)),Hg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Ae,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Yg)})]},String(t)),Yg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Kg(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Kg=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Gg(t)}`,children:o(Ae,{size:"text-h6",children:t})});case"email":return o("a",{className:"no-underline",href:`mailto:${t}`,children:o(C,{size:"text-xl",font:"font-light",color:"text-primary-text",children:t})});default:return o("span",{children:t})}},Gg=e=>e.replaceAll(/\D/g,""),Xg=d((({className:e="",index:t,text:n,...a})=>{const i=pe(),{href:l,target:r,onClick:s}=i(a);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),Jg=d((({className:e="",title:t,links:n})=>o("div",{className:e,children:n?.length?c("div",{className:"flex justify-between lg:items-center flex-col lg:flex-row gap-lg py-lg border-y border-y-main-divider",children:[o("div",{className:"lg:hidden",children:o(Ae,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Xg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),Zg=d((({className:e="",index:t,...n})=>{const a=pe(),{href:i,target:l,text:r,onClick:s}=a(n);return o("a",{className:u("text-xs font-light text-secondary-text visited:text-secondary-text hover:text-primary-main inline-block no-underline max-w-[292px]",e),href:i,target:l,onClick:s,children:r||`Документ ${t}`})})),Qg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Ae,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:`© 2000-${(new Date).getFullYear()} ${n}`})}):null,t?.length?o("div",{className:"flex flex-col @5xl:flex-row justify-start items-start gap-x-lg gap-y-xs",children:t.map(((e,t)=>o(Zg,{index:t,...e},String(t))))}):null]}))),ef=zt((({className:e,footer:t,...n})=>{const{navigationItems:a}=n.options?.page?.navigation??{};n.options;const{documents:i,relatedEnterprises:l,contacts:r,mediaLinks:s=[],horizontalNavigationTitle:d,feedbackButton:m,license:h,otherLinks:p=[]}=t??{};return c(g,{tag:"footer",className:u("grid gap-y-xl p-4xl pb-24 lg:p-xl",e),...n,children:[null,c("div",{className:"flex flex-col lg:flex-row items-center @lg:items-stretch gap-lg lg:gap-6xl ",children:[o(qg,{navigationItems:a}),o("div",{className:"border-t border-main-divider lg:hidden w-full"}),c("div",{className:u("w-full lg:w-52","flex flex-col shrink-0 overflow-hidden space-y-xl"),children:[o(Wg,{items:r}),m?o(Ne,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(lh,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(Ne,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(Jg,{title:d,links:l}),o(Qg,{links:i,license:h})]})})),tf=zt((({className:e,title:t,button:n,regionSource:i,data:l,...r})=>{const[s,d]=a({key:""}),m=i?.regions??[],h=oe({className:"text-white",version:n?.version||"primary"}),p=m?.find((e=>e.name===s.key))?.href,f=n?.text?n.text:"Перейти";return o(g,{className:e,defaultPadding:"p-6xl",...r,children:c("div",{className:"container space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(Mn,{label:"Ваш регион",placeholder:"Выберите регион",isSearch:!0,options:m.map((({name:e=""})=>({key:e,text:e}))),value:s,onChange:d}):null,p?o("div",{className:"text-center",children:o(Ne,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:nh(l,s?.key),children:f})}):null]})})})),nf={default:"bg-main-divider text-primary-main rounded hover:text-primary-main",transparent:"backdrop-opacity-30 bg-white/30 hover:text-primary-hover text-white"},af=d((({version:e,text:t,mobileText:n,...a})=>{const i=ke()?n:t;return i?o(Ne,{className:u("py-s px-lg font-light whitespace-nowrap",nf["transparent"===e?"transparent":"default"]),...a,children:i}):null})),lf=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:a,version:i,backwardButton:r})=>{const s=_(),d="/"===s.pathname,{dataFooter:m,dataHeader:u,...h}=t??{},p=l((()=>{s.back()}),[s]);return c("div",{className:"flex items-center justify-between w-full",children:[n||d?o("div",{children:o(Wc,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):rf(p,r),o(af,{version:i,...a})]})})),rf=(e,t)=>t?c("button",{className:"flex items-center text-l my-2xs",onClick:e,type:"button","aria-label":"Кнопка назад",children:[o(W,{name:"ChevronLeftIcon",iconVersion:"black",width:"24",height:"24"}),t]}):null,sf={"bg-white":"primary",transparent:"transparent"},of=zt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=sf[e],portal:a,logo:i={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=a||{},d=i.image?.icon||i.image?.src?i:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(lf,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),cf=(e=!1)=>e?{}:{padding:"p-0"},df={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},mf=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:a=!0,version:i="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=_();return o(g,{className:u("relative flex flex-col",df[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:i,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",Fd(r)),...cf(a)}})})}),{childrenTypes:[]}),uf=zt((e=>o(mf,{...e})),{childrenTypes:[]}),hf=d((e=>{const{className:t,align:n,image:a,...i}=e,l=n?u("flex",Lm[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...i,children:o(ne,{image:a})})})),pf=["байт","Кб","Мб","Гб","Тб","Пб"],gf=d((({icon:e,text:t,href:n,target:a,fileFormat:i,data:l,fileSize:r})=>{const s=r&&i?",":"",d=r??"",m=i?String(i):"";return c("a",{className:"flex box-border gap-s group/item h-fit w-fit text-primary-text no-underline hover:text-primary-main",href:n,target:a,...fe(l),children:[e,t?c(Ae,{size:"text-l",font:"font-light",children:[t," ",ff(d,m),o(Ae,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),ff=(e,t)=>e||t?o("span",{children:", "}):"",xf=(e,t)=>(n,a)=>{const i=q(e)("Attachment"===n?.docType?n?.attachment?.src:n?.href),l="Attachment"===n?.docType?((e,t=2)=>{if(0===e)return"";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,n)).toFixed(t))} ${pf[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?bf(i):n?.fileFormat;return c("div",{role:"listitem",children:[o(gf,{text:n?.text,target:n?.target,href:i,fileFormat:r,fileSize:l,icon:yf(t),data:n?.data}),o(_e,{__html:n?.__html})]},String(a))},yf=e=>e?o(ne,{className:"min-w-11 min-h-11 h-fit p-2.5 bg-main-divider rounded-md",image:e,width:"24",height:"24"}):null,bf=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),a=-1!==t?e.substring(t+1):"";return a.includes("/")?a.replace(n,""):a},vf=d((({href:e,__html:t,target:n,onClose:a})=>{const i=_(),l=q(i)(e);return c(Kl,{className:"my-6xl min-h-fit w-fit mx-auto",onClose:a,children:[t?o(_e,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(Ne,{text:"Я согласен",version:"primary",target:n,href:l,onClick:a}),o(Hl,{type:"button",version:"secondary",onClick:a,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Nf=d((({text:e,href:t,target:n,__html:a,icon:i})=>{const{open:r}=sn(vf),s=l((()=>r({__html:a,href:t,target:n})),[a,t,n]);return e?c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[yf(i),o(Ae,{font:"font-light",children:e})]}):null})),wf={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},Cf=zt((({className:e="",title:t,description:n,align:a="text-center",documents:i,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=_();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:a,headlineVersion:"M",as:"h2",isEmbedded:!0}),i?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",wf[r]),role:"list",children:i.map(Sf(d,l))}):null]})})),Sf=(e,t)=>(n,a)=>{const i=n?.docType;return""===i?null:"reportSource"in n&&n?.reportSource?.__html?kf(t)(n,a):xf(e,t)(n,a)},kf=e=>(t,n)=>{const a={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Nf,{...a,icon:e,href:If(t)?t?.href:t?.attachment?.src}),o(_e,{__html:t?.__html})]},String(n)):null},If=e=>"href"in e,Tf=zt((({className:e,padding:t,align:n="text-left",buttons:a=[],description:i,image:l,__html:r,headingType:s,qr:d,additionalDescription:m="",title:h="Мобильное приложение",version:p="primary",...f})=>{const x="secondary"===p?"p-m min-w-32":"min-w-24",y=l?.src?o(ne,{className:"hidden lg:block",image:l}):null;return o(g,{className:u("min-h-80",e),padding:"p-0",version:p,...f,children:c(Re,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:$e(a,{className:"flex-wrap"}),children:[i?o(Ae,{size:"text-xl","font-weight":"font-light",children:i}):null,c("div",{className:u("gap-m","flex flex-1 flex-col","flex-col items-start @xl:flex-row @xl:items-center"),children:[r?o(_e,{__html:r,itemSize:"list-m"}):null,o(Ae,{size:"text-m","font-weight":"font-light",color:"text-secondary-text",children:m}),d?.src?o("div",{className:u("flex justify-center bg-white rounded-md @xl:-order-1",x),children:o(ne,{className:"w-fit",image:d})}):null,l?.src?o(ne,{className:"lg:hidden",image:l}):null]})]})})})),Rf=(e,t)=>e&&"underlined"!==t?"primary":"secondary",Bf=(e=[],t={})=>e.filter((({content:e={}})=>Im(t,e))).length,Pf=(e,t)=>e===t;const Df=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,a])=>e(a,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(Pf,((e=Pf)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,a)=>e(t,n[a])))))())),_f=[],Ef={},Af={primary:"bg-white/30",secondary:"bg-main-divider"},Mf={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Of=d((({count:e,version:t="secondary"})=>{const n=ke(),a=n?"bg-main-divider":Af[t],i=Mf[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",a),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Ae,{size:"text-xs",color:i,children:e})})})),Ff=({text:e,description:t,icon:n,isActive:a,type:i})=>{const l=(e=>({btn:"w-96 "+(e?"p-m border-none bg-primary-main text-white":"p-s ease-in duration-300 bg-white"),text:e?"mb-xs text-xl":"mb-2xs text-l text-primary-text",desc:"font-light "+(e?"text-l text-white":"text-m text-secondary-text"),icon:e?"":"text-primary-main",iconVersion:e?"white":"normal",oldText:"text-m text-center",oldDesc:"text-m-light"}))(a);return c("div",{className:u("cursor-pointer text-left border-b-0 flex gap-2xs"),"aria-label":e,"aria-labelledby":`${e}-label`,children:[n?o(ne,{className:u("h-6 w-6 min-w-6 min-h-6",l.icon),image:{...n,iconVersion:n?.iconVersion??l.iconVersion},width:"24",height:"24",alt:e}):null,c("div",{className:"border-0",children:[o("div",{className:"animated"===i?l.text:l.oldText,children:e}),o("div",{className:"animated"===i?l.desc:l.oldDesc,children:t})]})]})},zf={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Vf={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Lf={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},jf={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},$f=d((({tag:e="div",item:t={},isActive:n=!1,type:a="default",onClick:i})=>{const l=e,{text:r,description:s,icon:d,count:m,tabName:h,...p}=t;return o(l,{className:u("h-12","block flex-1","cursor-pointer",zf[a],n?jf[a]:Lf[a]),role:"tablist","aria-label":"Список табов",onClick:i,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Vf[a]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Ff({text:r,description:s,icon:d,isActive:n,type:a}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Of,{count:m,version:Rf(n,a)})}):null]})})})),qf=d((e=>o(e?.item?.href?Uf:Wf,{...e}))),Uf=d((e=>{const t=pe(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:a,...i}=t({...e.item,onClick:n});return o($f,{...e,tag:"a",item:i,onClick:a})})),Wf=d((({item:e={},onClick:t,...n})=>{const a=l((()=>{t&&t(e)}),[t,e]);return o($f,{item:e,onClick:a,...n})})),Hf=(e,t,n)=>(a,i)=>o(qf,{isActive:a===e,onClick:t,type:n,item:a},String(i)),Yf=d((({className:e,tabsType:t="default",items:n=[],activeItem:a,onChange:i})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Hf(a,i,t))}))),Kf={categories:[],extraOptions:[],propertyType:[],stage:[]},Gf=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:a,...i})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Rm(Kf,{block:i.block,page:i.options?.page}),f=l(((e=Kf)=>p(e)),[]),x=(({hotFilters:e=_f,filtrationState:t=Ef,blocks:n=_f,onFiltrationStateChange:a})=>{const i=r((()=>Math.max(0,e.findIndex((e=>Df(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:Bf(n,t.filter),version:Rf(t===e[i])})))),[e,n,i]),o=l((t=>{a(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[i],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:i.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...i,children:[o(Yf,{...x}),o(Nm,{filtrationSchema:n,resetButton:a,field:m,reset:h}),o(xm,{blocksToRender:d,...i})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Xf=(e,t,n)=>{const a=Rf("all"===t),i=Rf("business"===t),l=(e,t,a)=>{const i=e.currentTarget===e.target&&"business"===t?r(a):a;return n(t),i},r=e=>e.filter((e=>e.workSchedule&&e.workSchedule.businessScheduleVisibleTag&&!e.workSchedule.businessScheduleDescription));return c("div",{className:"flex gap-lg flex-col sm:flex-row pb-lg",children:[o(Hl,{"data-id":"all",onClick:t=>l(t,"all",e),version:a,children:"Для физических лиц"}),o(Hl,{"data-id":"business",onClick:t=>l(t,"business",e),version:i,children:"Для юридических лиц"})]})},Jf=({__html:e,list:t,richVersion:n})=>e||t?.length?c("div",{className:"mb-2xl border-b sm:border border-main-divider sm:rounded-md",children:[e?o("div",{className:"mb-2xl",children:o(_e,{__html:e,richVersion:n})}):null,t?.length?o("div",{className:"flex flex-col sm:flex-row gap-2xl sm:flex-wrap pb-2xl sm:pb-xl",children:t.map(((e,t)=>c("div",{className:"flex gap-xs items-center",children:[e?.image?o(ne,{image:e.image}):null,e?.text?o(Ae,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,Zf="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Qf=({filters:e,field:{field:t,reset:n},onlyOffice:a,labels:i})=>{const l=a?5:6,r=(e||[]).map((e=>o(xi,{text:i[e],...t(e)},e))),[s,d]=l>0?[r.slice(0,l),r.slice(l)]:[r,[]];return o("div",{children:e?.length?o("div",{children:o(Dr,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:Zf,children:s}),o(_r,{className:Zf,isUnfolded:e,children:d})]}),renderFoldButton:ex(n,a)})}):null})},ex=(e,t=!1)=>({isUnfolded:n,onToggle:a})=>c("div",{className:"flex space-x-lg",children:[t?o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:a}):null,o(Ne,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:tx()})]}),tx=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),nx=(e,t)=>o("div",{className:"flex flex-col sm:flex-row gap-xs mb-2xl",children:c(w,{headingType:"h3",children:[o("span",{suppressHydrationWarning:!0,children:e}),t?o(Ae,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),ax=()=>{},ix=e=>"all"===e?"block":"hidden",lx=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:i=[],renderCard:l=ax,renderRemoteWorkplaceCard:r=ax,getBalloon:s=ax,getBalloonRemoteWorkplaces:d=ax,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=an(os),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=hs({data:t,remoteWorkplaces:i,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=a("all"),S={filters:rx([...t,...i]),field:{field:f,reset:x},onlyOffice:p,labels:cs};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[nx(h,N),m?Jf(m):null,p&&Xf(t,w,C),o("div",{className:u("pb-3xl",ix(w)),children:Qf(S)})]}),o("div",{className:"h-[600px]",children:o(xs,{children:o(Cr,{points:b,isLoad:n,className:"h-full"})})})]}),c(xs,{children:[y.map(l),v.map(r)]})]})})),rx=e=>Object.keys(os).filter((t=>e.filter((e=>ds[t](e))).length)),sx=({location:e,address:t,billAcceptorType:n,terminalType:a,billAcceptorEnable:i,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:dx(a)},{label:"Модуль приема наличных",value:i?"Да":"Нет"},{label:"Прием наличных пачкой",value:"банкомат принимает пачками"===n?"Да":"Нет"},{label:"Доступность",value:["внешняя установка","территория банка"].includes(r)?"Общедоступный":""},{label:"Регистрационный номер",value:l}];return c("div",{className:"bg-white col-span-12 p-3xl sm:border-green sm:border",children:[c("div",{className:"sm:flex sm:justify-between",children:[c("div",{children:[o(Ae,{size:"text-h4",children:dx(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Kr,{color:"green",children:dx(s)})})]}),o("div",{className:"hidden sm:block",children:o(Fr,{className:"flex-wrap",children:m?.map(cx)})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:o(Fr,{className:"flex-wrap",children:m?.map(cx)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(d))},ox=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${dx(t)} №${n}`,body:e.toUpperCase()}),cx=(e,t)=>o(Er,{...e},String(t)),dx=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",mx=[];const ux=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:mx},hx={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},px={terminalTypeAtms:e=>"банкомат"===e.terminalType?.toLowerCase(),terminalTypeTerm:e=>"терминал"===e.terminalType?.toLowerCase(),workAllTime:e=>"круглосуточно"===e.workTime?.toLowerCase(),billAcceptorEnable:e=>Boolean(e.billAcceptorEnable),locationDisabledPeople:e=>Boolean(e.locationDisabledPeople),designDisabledPeople:e=>Boolean(e.designDisabledPeople)},gx=d((({descriptionData:e,className:t})=>{const n=ig(),a=n?.code??"000",{data:i,isLoad:l}=function(e){const{data:t,error:n}=ba(`${Ut}/atms?regionCode=${e}`,ux);return{data:t||mx,isLoad:!t&&!n}}(a);return o(lx,{className:t,filterItems:fx,data:i,isLoad:l,initFilterState:hx,renderCard:sx,getBalloon:ox,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),fx=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),a=n.filter((e=>e.startsWith("terminalType"))),i=n.filter((e=>!a.includes(e)));return e.filter((e=>{const t=i.every((t=>px[t](e))),n=!a.length||a.some((t=>px[t](e)));return t&&n}))},xx=({address:e,workScheduleDescription:t},n)=>t?c("div",{className:"bg-white col-span-12 p-3xl sm:border-yellow sm:border",children:[o("div",{className:"sm:flex sm:justify-between",children:c("div",{children:[o(Ae,{size:"text-h4",children:"Удаленное рабочее место"}),e?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Ae,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:yx({workScheduleDescription:t})}),o(Dr,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(_r,{isUnfolded:e,children:yx({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ts({isUnfolded:e,onToggle:t})})]},String(n)):null,yx=({workScheduleDescription:e})=>c("div",{children:[c(Fr,{className:"flex",children:[o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Оформление и обслуживание банковских карт"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Инвестиционное и накопительное страхование"})}),o(Er,{label:"Операции для физических лиц",children:o(Ae,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Er,{label:"Режим работы",className:"max-w-none",children:o(Ae,{children:e})})]}),bx=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),vx={branches:[],remoteWorkplaces:[]};const Nx=async e=>await Pt(e,{method:"GET"})||vx,wx=d((({className:e})=>{const t=ig(),n=t?.code??"000",{data:a,isLoad:i}=function(e="000"){const{data:t,error:n}=ba(`${Ut}/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Nx);return{data:t||vx,isLoad:!t&&!n}}(n);return o(lx,{className:e,data:a?.branches,isLoad:i,remoteWorkplaces:a?.remoteWorkplaces,renderCard:ls,renderRemoteWorkplaceCard:xx,getBalloon:ss,getBalloonRemoteWorkplaces:bx,title:`Офисы филиала ${t?.name}`})})),Cx=d((({data:e,className:t,...n})=>{const a=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===a?o(wx,{}):o(gx,{descriptionData:e})})})),Sx=d((({className:e,title:t,description:n="Блок в разработке...",...a})=>c(g,{className:u("box-border",e),...a,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),kx=d((({className:e,padding:t,slides:n=[],...a})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...a,children:o(om,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Ze,{className:"px-5 h-full",headlineVersion:"L",...e,...a})},String(t))))})}))),Ix=d((({address:e,email:t,telephone:n,button:a,className:i="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",i),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[je(s)?o("div",{className:"w-10 h-7 sm:w-24 sm:h-16",children:o(ne,{image:s})}):null,d?o(w,{headingType:"h3",as:"h3",title:d}):null]}),c("div",{className:"w-full space-y-m",children:[l?Tx({__html:l,richVersion:r}):null,Rx({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Rx({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Rx({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),a?.text?$e([a]):null]})]}))),Tx=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(_e,{...e,itemSize:"list-s"})}),Rx=({label:e,data:t,iconName:n,dataColor:a=""})=>t?c("div",{className:"flex gap-s",children:[o(W,{iconVersion:"black",name:n,width:"24",height:"24"}),c("div",{className:"flex flex-col gap-2xs",children:[o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Ae,{size:"text-xl",color:a,children:t})]})]}):null,Bx=d((e=>{const{__html:t,richVersion:n="",...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(_e,{__html:t,richVersion:n})})})),Px=d((({name:e,text:t,value:n,checked:a,onChange:i,className:l})=>o("div",{className:l,children:c("label",{className:"font-sans flex gap-s items-center relative cursor-pointer",children:[o("input",{className:u(hn.split(" ").filter((e=>"rounded"!==e)),gi,"flex justify-center items-center after:block after:w-2.5 after:h-2.5 after:rounded-full rounded-full","checked:border-2 checked:!border-primary-main focus:checked:border-primary-main checked:after:bg-primary-main"),type:"radio",value:n,name:e,checked:a,onChange:e=>i?.(e.target.value),role:"radio"}),t?o(Ae,{color:"text-primary-text",children:t}):null]})}))),Dx=d((({className:e=""})=>{const[t,n]=a("option2"),i=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Px,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:i}),o(Px,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:i})]})})),_x=d((({data:e,fieldLabel:t,fieldValue:n,selected:a,placeholder:i="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===a));return o(Dn,{options:s,label:r,placeholder:i||a,onChange:e=>l(e.key),value:c})})),Ex=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:a=[],selectedBranch:i,onSelectedBranch:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(_x,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(_x,{data:a,fieldValue:"branchCode",fieldLabel:"address",selected:i,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),Ax=["От 1 дня","До 365 дней"],Mx=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Ae,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(Ea,{min:1,max:365,value:e,items:Ax,onChange:t})]}))),Ox=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:a=[],selectedBoxSize:i,onSelectedBoxSize:l})=>c("div",{className:"flex flex-col @xl:flex-row gap-m order-1",children:[o("div",{className:"flex-1 min-w-0",children:o(_x,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(_x,{data:a,fieldLabel:"safeBoxCasesSize",selected:i,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Fx=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:a,days:i,selectedCaseVolume:l,selectedBoxSize:r,safeBoxCases:s,caseVolumes:d,onChange:m,onClick:u})=>c("div",{className:"contents @xl:block flex-1 space-y-xl",children:[o(Ex,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:a,onSelectedBranch:zx(m)}),o(Mx,{days:i,setDays:e=>m({days:e})}),o(Ox,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:Vx(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:"Тип договора"})}),c("div",{className:"contents @md:flex justify-between items-center gap-m",children:[o(Dx,{}),o(Ne,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),zx=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},Vx=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},Lx=d((({days:e,tariffs:t=[]})=>{const n=$x(e,t),a="На рисунке изображена пачка листов\nформата А4";return c("div",{className:"contents @xl:flex flex-col justify-between gap-xl order-2",children:[c("div",{className:"flex flex-col @xl:flex-row gap-x-6xl gap-y-2xl order-5 @xl:order-none py-2xl @xl:py-0 border-t border-main-divider @xl:border-none",children:[jx("Аренда за",e),jx("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:a})}),c("div",{className:"flex flex-col items-center gap-s order-3 @xl:order-none mb-xl @xl:mb-0 bg-primary-main py-s @xl:p-3xl text-center",children:[o(ne,{image:{icon:"PackA4Icon"},className:"@xl:h-60"}),o("div",{className:"hidden @xl:inline opacity-80 whitespace-pre-line",children:o(C,{size:"text-s",font:"font-light",color:"text-white",children:a})})]})]})})),jx=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Ae,{size:"text-l",font:"font-light",color:"text-secondary-text",children:e}),o("span",{className:"text-l @xl:text-h3 text-primary-text",children:t})]}),$x=(e,t)=>{const n=qx(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},qx=e=>{let t=1;switch(!0){case e>30&&e<=90:t=2;break;case e>90&&e<=180:t=3;break;case e>180&&e<=365:t=4}return t},Ux=(e,t)=>e.find((e=>e.branchCode===t)),Wx=d((e=>{const{regions:t,data:n,branches:a,onChange:l,onClick:r}=e;i((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Ux(a,n.selectedBranch),d=Hx(s?.safeBoxCaseVolumes),m=Yx(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Kx(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Fx,{...n,regions:t,onClick:r,branches:a,caseVolumes:d,safeBoxCases:m,onChange:l}),o(Lx,{days:n.days,tariffs:u})]})})),Hx=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Yx=(e,t)=>e?.find((e=>e.volume===t)),Kx=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Gx=`${Ut}/safeboxes`,Xx=[];const Jx=async e=>await Pt(e,{method:"GET"})||Xx,Zx=d((({title:e,footnote:t,className:n="",...i})=>{const[r,s]=a(!1),d=l((()=>s((e=>!e))),[]),[m,u]=a({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Cl(),p=Qx(m.selectedRegion,h),f=function(e){const{data:t}=ba(e?`${Gx}?regionCode=${e}`:null,Jx);return t||Xx}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Ux(f,m.selectedBranch)||f,Array.isArray(b)?b.map((e=>({coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)].filter(Boolean),content:void 0}))).filter((e=>e.coords&&2===e.coords.length)):b?.gpsLatitude&&b?.gpsLongitude?[{coords:[b.gpsLatitude,b.gpsLongitude]}]:[]);var b;return c(g,{className:n,defaultPadding:"",...i,children:[c("div",{className:"p-4xl space-y-xl",children:[e?o(w,{title:e,headingType:"h3",as:"h2",className:"text-primary-text mb-s text-center"}):null,o(Wx,{regions:h,branches:f,data:{...m,selectedRegion:p},onClick:d,onChange:x}),t?o(C,{size:"text-s",font:"font-light",children:t}):null]}),y.length&&r?o(Cr,{points:y,className:"h-[640px]"}):null]})})),Qx=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,ey={description:"text-white/80 text-l font-light group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconText:"text-white group-data-primary:text-secondary-text group-data-gray:text-secondary-text",iconBackground:"bg-white/30 group-data-primary:bg-main-divider",iconConnector:"bg-white group-data-primary:bg-secondary-light",dot:"bg-white/80 group-data-primary:bg-secondary-text"},ty=(e,t,n)=>(a,i)=>{const{button:l}=a;return o("div",{className:"contents",children:c("div",{className:"flex items-center relative flex-row",children:[o("div",{className:"overflow-hidden flex flex-shrink-0 items-center",children:ny(e,n)(a,i)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[ay(a),l?.text?o(Ne,{className:"box-border py-s w-full mt-lg",version:t,...l,children:l?.text}):null]})]})},String(i))},ny=(e,t)=>(n,a)=>{const i="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=iy(e,l),s=l?"transparent"===t:t;return o(g,{className:u("z-10 mr-s flex justify-center content-center rounded-md",r),defaultPadding:"",version:s,children:o("div",{className:"flex max-w-full max-h-full items-center justify-center",children:ly({step:n,iconVersion:i,i:a,stepVersion:t})})})},ay=e=>c("div",{children:[e?.label?o(C,{size:"text-l",align:"text-left",children:e.label}):null,e?.description?o("div",{className:u("text-s font-light text-left",ey.description),children:e.description}):null,o(_e,{__html:e.__html})]}),iy=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",ly=({step:e,iconVersion:t,i:n,stepVersion:a})=>{return je(e?.icon)?o(ne,{image:{...e.icon,iconVersion:e.icon?.iconVersion||t},imageClassName:"max-w-full max-h-full",width:"24",height:"24"}):o("span",{className:u("text-h4","transparent"===a?ey.iconText:(i=a,"secondary"===i?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var i},ry=d((({className:e="",title:t,description:n,steps:a=[],buttons:i,stepVersion:l="gray",version:r="primary",...s})=>{const d=a.length>3;return c(g,{className:u("box-border flex flex-col gap-xl",e),defaultPadding:"p-6xl",version:r,...s,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-left"}),a?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:a.map(ty(d,r,l))}):null,$e(i,{isVertical:!0})]})})),sy=d((({isActive:e,item:t,onClick:n})=>c("div",{className:u(e?"text-primary-main":"text-primary-text","w-10 m-4 flex justify-center items-center flex-col text-xs cursor-pointer"),title:t?.title||"",onClick:n,children:[o(W,{className:"w-6 h-6",name:t?.icon?.icon,iconVersion:e?"color":"black"}),t?.title||""]}))),oy=d((({className:e,head:t,children:n,onClose:a,onClick:i})=>c("div",{onClick:i,className:u("relative bg-white p-0 rounded-xl top-32",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 rounded-xl bg-white z-10",children:[o(Yl,{className:"absolute top-1.5 right-0",onClose:a}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})));function cy(e,t,n){i((()=>e.subscribe(t,(e=>{const t=e?.type;if(t&&"string"==typeof t){const a=n[t];a&&a(e)}}))),[e,t,...Object.values(n)])}const dy=()=>{const[e,{push:t,pop:n,clear:i}]=function(e=[]){const[t,n]=a(e),i=l((e=>n((t=>[...t,e]))),[]),r=l((()=>n((e=>e.slice(0,-1)))),[]),s=l((e=>n((t=>t.filter((t=>t!==e))))),[]),o=l((()=>n([])),[]);return[t,{setList:n,push:i,pop:r,remove:s,clear:o}]}();return cy(ue.observable,"dialog",{open:t,close:n,closeAll:i}),[e,{close:n,closeAll:i}]},my=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:a,s2Matches:i}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),a=Array.from({length:e.length}),i=Array.from({length:t.length});let l=0;for(let r=0;r<e.length;r++){const s=Math.max(0,r-n),o=Math.min(r+n,t.length-1);for(let n=s;n<=o;n++)a[r]||i[n]||e[r]!==t[n]||(l++,a[r]=!0,i[n]=!0)}return{m:l,s1Matches:a,s2Matches:i}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:a}){let i=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(a[s]){r=s+1;break}e[l]!==t[s]&&i++}return i}(e,t,{s1Matches:a,s2Matches:i}),r=(n/e.length+n/t.length+(n-l/2)/n)/3,s=r>.7?.1*function(e,t){let n=0;for(;e[n]===t[n]&&n<4;)n++;return n}(e,t):0;return r+s*(1-r)};const uy=e=>e?.length?c("div",{className:"sm:border-t sm:border-main-divider mt-2xs pt-2xs",children:[o("div",{className:"mb-m",children:o(Ae,{size:"text-m",font:"font-light",color:"text-secondary-text",children:"Представительства за рубежом:"})}),o("div",{className:"flex flex-col sm:flex-row gap-5xl",children:e.map(((e,t)=>o(hy,{...e},String(t))))})]}):null,hy=d((({icon:e,...t})=>{const n=pe(),{text:a,target:i,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,a?o("a",{className:"hover:text-primary-hover",href:l,target:i,onClick:r,children:o(Ae,{size:"text-l",font:"font-light",color:"text-primary-text",children:a})}):null]})})),py=(e,t)=>n=>n.name?o(ah,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:nh(e,n.name),children:o(Ae,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,gy=d((({className:e,searchTerm:t,onSearch:n})=>c("form",{className:`font-sans relative ${e}`,children:[o("div",{className:"absolute rounded h-full flex items-center justify-center pl-m max-w-44 gap-s pointer-events-none",children:t?null:o("label",{htmlFor:"search-bar-input",className:"text-secondary-text ",children:"Поиск по филиалам"})}),o("input",{id:"search-bar-input",className:u(hn,"h-12 pl-m w-full peer text-l text-black rounded-md box-border"),value:t,onChange:e=>n(e.target.value.toLowerCase()),type:"text",name:"location-search-bar-input"})]}))),fy=d((({defaultLocation:e})=>{const t=ig(e),n=pe(),{href:a}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(ah,{href:a,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),xy=d((({foreignOffices:e,branches:t,onClose:n})=>{const i=lg(t?.default),[s,d]=a(""),m=Cl(),u=r((()=>by(m).sort(((e,t)=>e.name.localeCompare(t.name)))),[m]),h=r((()=>((e,t)=>{const n=new Map;for(const a of e){const e=t(a),i=n.get(e)||[];n.set(e,[...i,a])}return n})(u,yy)),[u]),p=l((e=>{i.location=e,n?.()}),[i,n]);return c(Kl,{className:"pb-20",head:c("div",{children:[o(Ae,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(fy,{defaultLocation:t?.default}),o(gy,{onSearch:d,searchTerm:s})]}),onClose:n,children:[s&&s.length>=3?o("div",{children:u.filter((({name:e})=>e&&my(e.toLowerCase())(s.toLowerCase())>=.8)).map(py(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((g=p,f=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Ae,{size:"text-h6",children:e})}),t.map(py(f,g))]},e)))}),uy(e)]});var g,f})),yy=e=>e.name?.charAt(0)??"",by=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),vy=d((({menuRef:e,menuItem:t,locationDialogProps:n,onClose:a})=>{const l=sn(xy,n),{name:r}=ig(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return i((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),i((()=>{const e=e=>{if("location"===e.data.type&&l.open({}),"reload"===e.data.type&&a?.(),"resize"===e.data.type){const t=document.getElementsByTagName("iframe")["iframe-dialog"];t&&t.style&&(t.style.height=String(e.data.data)+"px")}};return globalThis.addEventListener("message",e),()=>{globalThis.removeEventListener("message",e)}}),[a]),o(oy,{head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),onClick:e=>e.stopPropagation(),onClose:a,children:o("div",{className:"bg-white pb-20 pt-1 text-l",children:o("iframe",{id:"iframe-dialog",name:"burger-menu-iframe",onLoad:()=>(()=>{const e=globalThis.frames["burger-menu-iframe"],t=document.getElementsByTagName("iframe")["iframe-dialog"];t.style.height=String(t?.contentWindow?.document.body.offsetHeight)+"px",e.postMessage({type:"currentTab",data:c?.slice(1)},"*"),e.postMessage({type:"currentLocation",data:r},"*")})(),src:t?.src,width:s?.width||0})})})})),Ny="burgerMenuDialog",wy=({menuRef:e,centralMenuItem:t,locationDialogProps:n,onClose:a=un})=>{const{open:i}=sn(vy),[r]=dy(),s=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Ny,r),o=l((()=>i({menuRef:e,locationDialogProps:n,menuItem:t,onClose:a},{id:Ny})),[e,n,t,a]);return[s,{toggle:s?a:o}]},Cy=[],Sy=zt((({sticky:e,...t})=>{const{menuItems:n=Cy}=e??{},i=n.find((e=>"Меню"===e.title)),r=n.filter((e=>"Меню"!==e.title)),d=Math.floor(r.length/2),m=r.slice(0,d),u=r.slice(d),[h,p]=a(-1),[f,x]=a(""),{closeAll:y}=he(),b=l((()=>{p(-1),x(""),y()}),[y]),v=dn(b),N=s(null),[C,{toggle:S}]=wy({menuRef:N,centralMenuItem:i,locationDialogProps:t.header,onClose:b}),k=(({menuRef:e,dialogRef:t,leftItems:n,rightItems:a,onClose:i})=>{const{open:r,close:s}=he(),c=l((()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=`${e?.contentWindow?.document.body.offsetHeight}px`}),[]);return l(((l,d)=>{const m="left"===d?n:a,u=e?.current?.getBoundingClientRect();r({id:"left"===d?n[l].title:a[l].title,dialog:o(oy,{className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:m[l].description||m[l].title})}),onClick:e=>e.stopPropagation(),onClose:()=>{s(),i?.()},children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",src:m[l]?.src,width:u?.width??0,onLoad:c})})})})}),[c,n,a,i])})({menuRef:N,dialogRef:v,leftItems:m,rightItems:u,onClose:b}),I=l((e=>{e.stopPropagation(),b(),S()}),[b,S]),T=l(((e,t)=>{x(t),p(e),y(),k(e,t)}),[y,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:N,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(ky(T,"left",{activeIndex:h,currentItemPosition:f})),o(sy,{item:i,isActive:C,onClick:e=>I(e)}),u.map(ky(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),ky=(e,t,n)=>(a,i,l)=>o(sy,{item:a,isActive:l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===a?.title&&n.currentItemPosition===t||r.stopPropagation(),e(i,t)}},a.title||String(i)),Iy="hidden sm:flex absolute z-40",Ty={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Ry=d((({className:e,items:t=[],activeItem:n,onChange:a,tabsType:l="default"})=>{const[r,s]=Jd({itemCount:t?.length||0});return i((()=>By(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(qd,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Ty[l].item,gap:Ty[l].gap,children:t.map(Hf(n,a,l))}),s.canScrollLeft?o(nm,{className:u("left-6",Iy,Ty[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(am,{className:u("right-6",Iy,Ty[l].buttonTop),onClick:s.scrollRight}):null]})})),By=(e,t,n)=>{const a=t.findIndex((e=>e===n));e&&a>0&&e.scrollTo({left:e?.children[a]?.offsetLeft,behavior:"smooth"})},Py={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},Dy=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Py[t].wrapper,e),children:o(Ry,{className:Py[t].component,tabsType:t,...n})}):null,_y=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Ey(n??{}),p=_(),f=t.every((e=>"link"===e?.type)),x=s?t.map((e=>({...e,count:"group"===e?.type?n?.slots?.[e?.tabName??""]?.length??0:0}))):t,{isReady:y}=p,[b,v]=a(Oy(x,((e="")=>{const t=globalThis?.location?.href;return t?new URL(t).searchParams.get(e):null})(h))),N=x[b],w=x.findIndex((e=>Boolean(e.selected)));i((()=>{const e=p.query[h]?x.findIndex(((e,t)=>"group"===e.type&&(e?.tabName??String(t))===p.query[h])):w;v(-1===e?0:e)}),[y,w,h]);const C=My(x[b],b),S=l((e=>{const t=x.indexOf(e),n=x[t];v(t),"group"===n.type&&((e,t)=>{const n=new URLSearchParams(p.query);e.text?n.set(h,e?.tabName??String(t)):n.delete(h),p.replace(`${p.pathname}?${n}`,"",{scroll:!1})})(e,t)}),[x]);return c(g,{className:u({"sticky top-1 z-20":d&&f},e),defaultPadding:"p-0",block:n,...m,children:[Dy({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:Ay(t,x),activeItem:N,tabsType:r,onChange:S}),o("div",{className:"space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:Object.entries(n?.slots??{}).map((([e,t])=>P(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(My)?.filter(Boolean)||[]}),Ey=({__id:e,anchor:t})=>t??e??"tabs",Ay=(e,t)=>t?.length?t:e,My=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Oy=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Fy={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},zy=d((({children:e,activeIndex:t,columnWidth:n,version:a="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Fy[a],style:{transform:`translateX(-${t*n}px)`},children:e})}))),Vy=d((({className:e="",isOpen:t,onClick:n})=>o(Ne,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),Ly={Buttons:({buttons:e})=>$e(e,{buttonClassName:"basis-0"}),Img:({image:e})=>e?.src?o(ne,{image:e}):null,RichText:({__html:e,isDotted:t=!0})=>o("div",{className:"flex flex-col justify-between items-start text-h6",children:o(_e,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Ae,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Ae,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:a,isOpen:i})=>e?o(Vy,{className:"w-fit",isOpen:i,onClick:()=>{t({tableSource:n,pdfUrl:a})}}):null},jy=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=a(!0);i((()=>{l===o&&s||m(!0)}),[s,o]);return $y({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),$y=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...a}=e;if(!n||!(n in Ly))return null;return o(Ly[n],{...t,...a})},qy=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r})=>o("div",{className:"w-80 flex-grow flex flex-col gap-m @4xl:gap-lg",role:"cell",children:e?.length?e.map(((e,s)=>o(jy,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:a,tableInner:i,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Uy=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Wy=(e,t)=>e?.length>0?o("div",{className:u("flex",{"text-secondary-text":0===t}),children:e.map(((e,t)=>o("div",{className:"w-20 mx-lg",children:o(Ae,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Hy=d((({rows:e})=>{return o(qd,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[a,...i]=e,l=u("flex duration-1000 text-center",0!==n?"font-normal":"font-light");return c("div",{className:"flex border-main-divider border-b border-solid h-full",children:[a?.data?o("div",{className:"whitespace-pre-wrap sm:whitespace-normal w-48 sm:w-56 sm:min-w-56 py-lg pr-lg sm:pr-0",children:o(Ae,{size:"text-xl",font:"font-light",children:a.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Uy(i,t)}px)`},children:i?.map(((e,n)=>c("div",{className:"flex flex-col flex-grow gap-s justify-center py-xl odd:bg-main-divider",children:[e?.data?o(Ae,{size:"text-xl",children:e.data}):null,e?.cols?Wy(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Yy=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const a=`activeTabIdx:${e}-tableIdx:${n}`;return c("div",{className:"w-full @container",children:[o("div",{className:"flex py-m sm:px-m bg-white @4xl:bg-gray relative",children:o(Ae,{size:"text-xl",align:"text-left",children:t.title})}),o("div",{className:"w-full sm:pl-xs overflow-hidden transition-height duration-500 ease-in-out",children:o("div",{className:"relative",children:o(Hy,{rows:t.rowsData})})})]},a)}))}))),Ky=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Gy=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:a})=>c("div",{className:"flex justify-between items-center w-full py-lg",children:[e&&e.length>1?o("div",{className:"flex bg-secondary-light p-2xs rounded-md",children:e.map(((e,t)=>o("div",{className:u("rounded-md px-4 py-3 cursor-pointer",{"bg-primary-main":t===n}),onClick:()=>a(t),children:o(Ae,{size:"text-xl",font:"font-light",color:Ky(t===n),children:e||t+1})},e)))}):null,t?o(Ne,{className:"text-primary-main",href:t,version:"link",target:"_blank",appendLeft:o(W,{name:"DocDownloadIcon",iconVersion:"color",className:"mr-3xs",width:"20",height:"20"}),text:"Скачать в PDF"}):null]}))),Xy=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const i=e?.tableData,[r,s]=a(0),d=l((e=>s(e)),[]),m=i?.[r]?.items??[],u=i?.map((e=>e.currency??""));return c("div",i?{className:"bg-white z-10",children:[o(Gy,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Yy,{activeTabIndex:r,items:m}),o(Vy,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Ae,{size:"text-h6",children:"Данных нет"}),o(Vy,{onClick:n,isOpen:!0})]})})),Jy=d((({children:e,tableInner:t,onHideContentClick:n})=>c("div",{className:"self-start flex flex-col",role:"row",children:[o("div",{className:u("@4xl:border-main-divider @4xl:border-b","flex flex-col @4xl:flex-row gap-y-xs gap-x-5xl pb-lg @4xl:pt-lg"),children:e}),t?o("div",{className:"origin-top animate-expansion",children:o(Xy,{...t,onClick:n})}):null]}))),Zy=d((({row:{header:e,data:t},activeIndex:n,rowIdx:i,...r})=>{const[s,d]=a(void 0),m=l((e=>d(e)),[]),[h,p]=a(void 0),g=l((e=>p(e)),[]);return c(Jy,{onHideContentClick:()=>d(void 0),tableInner:s,...r,children:[o("div",{className:u("text-s","w-80 flex-shrink-0"),children:c("div",{className:"flex gap-m items-center",role:"cell",children:[e?.icon?o(ne,{className:"hidden @4xl:block max-w-6 shrink-0",image:e.icon,width:"24",height:"24"}):null,e?.title?o(Ae,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(zy,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(qy,{cells:e,rowIdx:i,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function Qy({dec:e,inc:t,canDec:n,canInc:a,btnClass:i,className:l=""}){return n||a?c("div",{children:[n?o(tm,{className:u("absolute z-40",i[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,a?o(tm,{className:u("absolute z-40 rotate-180",i[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!a}):null]}):null}const eb=d((({children:e,controls:t})=>{const{isScrollAvailable:n}=t;return c("div",{role:"table",className:"overflow-x-auto w-auto grid md:block",children:[c("div",{className:"relative space-y-xs",children:[e,Qy({...t,btnClass:["top-28","top-11"],className:"right-7"})]}),n?o("div",{className:"absolute top-0 right-0 bottom-0 w-20 bg-opacity-to-white"}):null]})})),tb=d((({className:e="",title:t,description:n,rowHeaders:i,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=i?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:i}=e,[r,s]=a(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=i?n>i&&r<n-i:r<n-1,m=r>0;return[r,{inc:o,dec:c,canInc:d,canDec:m,isScrollAvailable:m||d}]})({itemCount:p,visibleItemCount:2}),y=(h||[]).map(((e,t)=>o(Zy,{row:e,activeIndex:f,rowIdx:t,...d},String(t)))),[b,v]=s>0?[y.slice(0,-s),y.slice(-s)]:[y,[]];return c(g,{className:u("relative space-y-6xl @4xl:space-y-xl",e),defaultPadding:"p-6xl",...d,children:[o(k,{title:t,description:n,headlineVersion:"M",isEmbedded:!0,align:"text-center"}),o("div",{className:"space-y-m overflow-hidden",children:s>0?o(Dr,{renderFoldableSection:({isUnfolded:e})=>c(eb,{controls:x,children:[b,o(_r,{isUnfolded:e,children:v})]}),renderFoldButton:hm}):o(eb,{controls:x,children:y})})]})})),nb=d((({className:e="",title:t,description:n,iconVersion:a,__html:i,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m group-data-secondary:bg-primary-main/10",e),...r,children:["small"===a?ab():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Ae,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ib(n):null,i?o(_e,{richVersion:l,__html:i}):null]})]}))),ab=()=>o("div",{className:"rounded-full h-4 w-4 text-center text-xs font-light bg-primary-main text-white group-data-secondary:bg-white group-data-secondary:text-primary-main",children:"i"}),ib=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),lb=d((({prefix:e,unit:t,suffix:n})=>c("div",{className:"w-full flex items-end",children:[e?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:e})}):null,t?o("div",{className:"-mb-6 @xl:-mb-4",children:o("span",{className:"font-mohave text-title-large sm:text-title-extra gradient-color-text",children:t})}):null,n?o("div",{className:"gradient-color-text",children:o(Ae,{size:"text-h2",children:n})}):null]}))),rb=d((e=>{const{prefix:t,unit:n,suffix:a,...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(lb,{prefix:t,unit:n,suffix:a})})})),sb={AdTile:Lt,ApplicationForm:lr,ApplicationLeadForm:Md,BankAccountFiltration:Dm,BenefitsBlock:Om,BonusBenefitsBlock:Vm,ButtonsBlock:jm,CalculatorBonus:Km,CalculatorBusinessDeposit:iu,CalculatorCredit:bo,CalculatorDeposit:wu,CalculatorRefinancing:Pu,CardTransfer:Fu,Carousel:Wu,CarouselCard:Gu,CarouselCatalogCard:Ju,CarouselLinks:eh,CarouselRecommendationCard:oh,CarouselTariffsCard:mh,CreditCardForm:lp,CreditForm:_p,DepositFiltration:Fp,Depository:eg,ErrorBlock:ng,ExchangeRateTile:Eg,Footer:ef,GrantSupport:tf,Header:of,Headline:k,HorizontalLayout:uf,ImgBlock:hf,LinkDocs:Cf,MobileAppTile:Tf,MortgageFiltration:Gf,OfficesAtmsMap:Cx,Placeholder:Sx,ProductBlock:Vt,ProductGallery:kx,RepresentativeOfficeInfo:Ix,RichTextBlock:Bx,RollupItem:jg,SafeDepositRental:Zx,StepsBlock:ry,StickyBottomMenu:Sy,TabsLayout:_y,TariffsTable:tb,TextBlock:nb,UnitBlock:rb,VerticalLayout:mf},ob=ce((()=>{i((()=>{Qt()}),[]);const e=tn();cn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const a=JSON.parse(n?.dataset?.aspects??"[]");Xt({aspectsAttributes:a,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const cb="cookie",db=d((({__html:e})=>{const[t,{setTrue:n,setFalse:a}]=on();!function(e,t,n=300){i((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(cb)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(cb,"true"),a()}),[]);return t&&e?o("div",{className:"container fixed left-0 right-0 bottom-0 z-50",role:"dialog",children:c("div",{className:"bg-white m-xl p-xl rounded-md flex sm:items-center shadow-main-black",children:[o("div",{className:"sm:flex-1",children:o(_e,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(Yl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null}));function mb(e){const t=l((({key:t})=>{"Escape"===t&&e()}),[e]);cn(globalThis.document,"keydown",t)}const ub=d((()=>{const[e,{close:t}]=dy(),n=Boolean(e.length);return mb(t),i((()=>{n?globalThis.document?.body.classList.add("no-scrollbar","overflow-hidden"):globalThis.document?.body.classList.remove("no-scrollbar","overflow-hidden")}),[n]),n?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:e.map((({dialog:t,id:n},a)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:a!==e.length-1}),children:t},String(n||a))))}):null})),hb=d((()=>{const[e,t]=a(null),n=l((()=>{t(null)}),[]);return cy(ue.observable,"popup",{open:t,close:n}),mb(n),e?o("div",{className:u("z-50",e.fixed?"fixed":"absolute"),style:{left:`${e.left}px`,top:`${e.top}px`,...e.width?{width:`${e.width}px`}:{}},role:"dialog",children:e.popup}):null})),pb="header",gb="footer",fb="sticky-footer",xb={},yb=d((({className:e,data:t=xb,blocksRegistry:n,blockDecorator:a})=>{const{slots:i,blocks:l,fallback:r,...s}=t,d=Ot(s,r);ob(),lg();const m={key:"",page:{slots:i,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:a,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[i?.[pb]?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:P(i?.[pb],{...m,slotName:pb})}):null,c("div",{className:"container space-y-px @5xl:space-y-0 @5xl:grid @5xl:grid-cols-12 @5xl:gap-2xs",children:[D({block:t,options:m,extraProps:{className:"scroll-mt-12"}}),P(i?.[gb],{...m,slotName:gb})]})]}),i?.[fb]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:P(i?.[fb],{...m,slotName:fb})}):null,o(ub,{}),o(hb,{}),o(db,{__html:d?.cookieContent?.__html})]})}));Object.assign(yb,{childrenTypes:[],slots:()=>[pb,gb,fb]});e.Blocks=sb,e.ContentPage=yb,e.handlerDecorator=ce,e.joinList=bm,e.locationNavigator=Jt,e.packageVersion="0.14.732",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=_,Object.defineProperty(e,"__esModule",{value:!0})}));