@redneckz/wildless-cms-uni-blocks 0.14.674 → 0.14.676

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 (205) hide show
  1. package/bundle/EventBus/EventBus.d.ts +1 -8
  2. package/bundle/EventBus/defaultEventBus.d.ts +0 -9
  3. package/bundle/bundle.umd.js +406 -136
  4. package/bundle/bundle.umd.min.js +1 -1
  5. package/bundle/hooks/useLocation.d.ts +4 -1
  6. package/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  7. package/dist/EventBus/EventBus.d.ts +1 -8
  8. package/dist/EventBus/EventBus.js +2 -28
  9. package/dist/EventBus/EventBus.js.map +1 -1
  10. package/dist/EventBus/defaultEventBus.d.ts +0 -9
  11. package/dist/EventBus/defaultEventBus.js.map +1 -1
  12. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +1 -1
  13. package/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  14. package/dist/components/ContentPage/ContentPage.js +2 -0
  15. package/dist/components/ContentPage/ContentPage.js.map +1 -1
  16. package/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  17. package/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  18. package/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  19. package/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  20. package/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  21. package/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  22. package/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  23. package/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  24. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  25. package/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  26. package/dist/hooks/useLocation.d.ts +4 -1
  27. package/dist/hooks/useLocation.js +16 -34
  28. package/dist/hooks/useLocation.js.map +1 -1
  29. package/dist/hooks/useRegions.js +3 -1
  30. package/dist/hooks/useRegions.js.map +1 -1
  31. package/dist/ui-kit/DialogManager/useDialogsList.js +3 -0
  32. package/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  33. package/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
  34. package/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  35. package/dist/ui-kit/FormField/validators.js +3 -2
  36. package/dist/ui-kit/FormField/validators.js.map +1 -1
  37. package/dist/ui-kit/Input/InputControl.js +4 -1
  38. package/dist/ui-kit/Input/InputControl.js.map +1 -1
  39. package/dist/ui-kit/LocationDialog/LocationDialog.js +11 -14
  40. package/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  41. package/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  42. package/dist/ui-kit/LocationDialog/SelectedLocation.js +15 -0
  43. package/dist/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
  44. package/dist/ui-kit/PopupManager/PopupManager.js +3 -0
  45. package/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  46. package/lib/EventBus/EventBus.d.ts +1 -8
  47. package/lib/EventBus/EventBus.js +1 -27
  48. package/lib/EventBus/EventBus.js.map +1 -1
  49. package/lib/EventBus/defaultEventBus.d.ts +0 -9
  50. package/lib/EventBus/defaultEventBus.js.map +1 -1
  51. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +1 -1
  52. package/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  53. package/lib/components/ContentPage/ContentPage.js +2 -0
  54. package/lib/components/ContentPage/ContentPage.js.map +1 -1
  55. package/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  56. package/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  57. package/lib/components/Header/HeaderSecondaryMenu.js +1 -1
  58. package/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  59. package/lib/components/OfficesAtmsMap/AtmsMap.js +1 -1
  60. package/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  61. package/lib/components/OfficesAtmsMap/OfficesMap.js +1 -1
  62. package/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  63. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  64. package/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  65. package/lib/hooks/useLocation.d.ts +4 -1
  66. package/lib/hooks/useLocation.js +15 -34
  67. package/lib/hooks/useLocation.js.map +1 -1
  68. package/lib/hooks/useRegions.js +3 -1
  69. package/lib/hooks/useRegions.js.map +1 -1
  70. package/lib/ui-kit/DialogManager/useDialogsList.js +3 -0
  71. package/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  72. package/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
  73. package/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  74. package/lib/ui-kit/FormField/validators.js +3 -2
  75. package/lib/ui-kit/FormField/validators.js.map +1 -1
  76. package/lib/ui-kit/Input/InputControl.js +4 -1
  77. package/lib/ui-kit/Input/InputControl.js.map +1 -1
  78. package/lib/ui-kit/LocationDialog/LocationDialog.js +13 -16
  79. package/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  80. package/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  81. package/lib/ui-kit/LocationDialog/SelectedLocation.js +13 -0
  82. package/lib/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
  83. package/lib/ui-kit/PopupManager/PopupManager.js +3 -0
  84. package/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  85. package/mobile/bundle/EventBus/EventBus.d.ts +1 -8
  86. package/mobile/bundle/EventBus/defaultEventBus.d.ts +0 -9
  87. package/mobile/bundle/bundle.umd.js +406 -136
  88. package/mobile/bundle/bundle.umd.min.js +1 -1
  89. package/mobile/bundle/hooks/useLocation.d.ts +4 -1
  90. package/mobile/bundle/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  91. package/mobile/dist/EventBus/EventBus.d.ts +1 -8
  92. package/mobile/dist/EventBus/EventBus.js +2 -28
  93. package/mobile/dist/EventBus/EventBus.js.map +1 -1
  94. package/mobile/dist/EventBus/defaultEventBus.d.ts +0 -9
  95. package/mobile/dist/EventBus/defaultEventBus.js.map +1 -1
  96. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js +1 -1
  97. package/mobile/dist/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  98. package/mobile/dist/components/ContentPage/ContentPage.js +2 -0
  99. package/mobile/dist/components/ContentPage/ContentPage.js.map +1 -1
  100. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  101. package/mobile/dist/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  102. package/mobile/dist/components/Header/HeaderSecondaryMenu.js +1 -1
  103. package/mobile/dist/components/Header/HeaderSecondaryMenu.js.map +1 -1
  104. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js +1 -1
  105. package/mobile/dist/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  106. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js +1 -1
  107. package/mobile/dist/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  108. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  109. package/mobile/dist/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  110. package/mobile/dist/hooks/useLocation.d.ts +4 -1
  111. package/mobile/dist/hooks/useLocation.js +16 -34
  112. package/mobile/dist/hooks/useLocation.js.map +1 -1
  113. package/mobile/dist/hooks/useRegions.js +3 -1
  114. package/mobile/dist/hooks/useRegions.js.map +1 -1
  115. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js +3 -0
  116. package/mobile/dist/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  117. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js +1 -1
  118. package/mobile/dist/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  119. package/mobile/dist/ui-kit/FormField/validators.js +3 -2
  120. package/mobile/dist/ui-kit/FormField/validators.js.map +1 -1
  121. package/mobile/dist/ui-kit/Input/InputControl.js +4 -1
  122. package/mobile/dist/ui-kit/Input/InputControl.js.map +1 -1
  123. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js +11 -14
  124. package/mobile/dist/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  125. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  126. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js +15 -0
  127. package/mobile/dist/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
  128. package/mobile/dist/ui-kit/PopupManager/PopupManager.js +3 -0
  129. package/mobile/dist/ui-kit/PopupManager/PopupManager.js.map +1 -1
  130. package/mobile/lib/EventBus/EventBus.d.ts +1 -8
  131. package/mobile/lib/EventBus/EventBus.js +1 -27
  132. package/mobile/lib/EventBus/EventBus.js.map +1 -1
  133. package/mobile/lib/EventBus/defaultEventBus.d.ts +0 -9
  134. package/mobile/lib/EventBus/defaultEventBus.js.map +1 -1
  135. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js +1 -1
  136. package/mobile/lib/components/CarouselTariffsCard/CarouselTariffsCard.js.map +1 -1
  137. package/mobile/lib/components/ContentPage/ContentPage.js +2 -0
  138. package/mobile/lib/components/ContentPage/ContentPage.js.map +1 -1
  139. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js +1 -1
  140. package/mobile/lib/components/ExchangeRateTile/ExchangeRateTile.js.map +1 -1
  141. package/mobile/lib/components/Header/HeaderSecondaryMenu.js +1 -1
  142. package/mobile/lib/components/Header/HeaderSecondaryMenu.js.map +1 -1
  143. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js +1 -1
  144. package/mobile/lib/components/OfficesAtmsMap/AtmsMap.js.map +1 -1
  145. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js +1 -1
  146. package/mobile/lib/components/OfficesAtmsMap/OfficesMap.js.map +1 -1
  147. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js +1 -1
  148. package/mobile/lib/components/StickyBottomMenu/BurgerMenuDialog.js.map +1 -1
  149. package/mobile/lib/hooks/useLocation.d.ts +4 -1
  150. package/mobile/lib/hooks/useLocation.js +15 -34
  151. package/mobile/lib/hooks/useLocation.js.map +1 -1
  152. package/mobile/lib/hooks/useRegions.js +3 -1
  153. package/mobile/lib/hooks/useRegions.js.map +1 -1
  154. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js +3 -0
  155. package/mobile/lib/ui-kit/DialogManager/useDialogsList.js.map +1 -1
  156. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js +1 -1
  157. package/mobile/lib/ui-kit/FormField/Fields/AddressFactField.js.map +1 -1
  158. package/mobile/lib/ui-kit/FormField/validators.js +3 -2
  159. package/mobile/lib/ui-kit/FormField/validators.js.map +1 -1
  160. package/mobile/lib/ui-kit/Input/InputControl.js +4 -1
  161. package/mobile/lib/ui-kit/Input/InputControl.js.map +1 -1
  162. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js +13 -16
  163. package/mobile/lib/ui-kit/LocationDialog/LocationDialog.js.map +1 -1
  164. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.d.ts +5 -0
  165. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js +13 -0
  166. package/mobile/lib/ui-kit/LocationDialog/SelectedLocation.js.map +1 -0
  167. package/mobile/lib/ui-kit/PopupManager/PopupManager.js +3 -0
  168. package/mobile/lib/ui-kit/PopupManager/PopupManager.js.map +1 -1
  169. package/mobile/src/EventBus/EventBus.ts +1 -36
  170. package/mobile/src/EventBus/defaultEventBus.ts +0 -10
  171. package/mobile/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +1 -1
  172. package/mobile/src/components/ContentPage/ContentPage.tsx +2 -0
  173. package/mobile/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  174. package/mobile/src/components/Header/HeaderSecondaryMenu.tsx +1 -1
  175. package/mobile/src/components/OfficesAtmsMap/AtmsMap.tsx +1 -1
  176. package/mobile/src/components/OfficesAtmsMap/OfficesMap.tsx +1 -1
  177. package/mobile/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +1 -1
  178. package/mobile/src/hooks/useLocation.ts +25 -47
  179. package/mobile/src/hooks/useRegions.ts +4 -1
  180. package/mobile/src/ui-kit/DialogManager/useDialogsList.ts +3 -0
  181. package/mobile/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
  182. package/mobile/src/ui-kit/FormField/validators.ts +4 -3
  183. package/mobile/src/ui-kit/Input/InputControl.tsx +5 -2
  184. package/mobile/src/ui-kit/LocationDialog/LocationDialog.tsx +22 -28
  185. package/mobile/src/ui-kit/LocationDialog/SelectedLocation.tsx +27 -0
  186. package/mobile/src/ui-kit/PopupManager/PopupManager.tsx +3 -0
  187. package/package.json +5 -5
  188. package/src/EventBus/EventBus.ts +1 -36
  189. package/src/EventBus/defaultEventBus.ts +0 -10
  190. package/src/components/CarouselTariffsCard/CarouselTariffsCard.tsx +1 -1
  191. package/src/components/ContentPage/ContentPage.tsx +2 -0
  192. package/src/components/ExchangeRateTile/ExchangeRateTile.tsx +1 -1
  193. package/src/components/Header/HeaderSecondaryMenu.tsx +1 -1
  194. package/src/components/OfficesAtmsMap/AtmsMap.tsx +1 -1
  195. package/src/components/OfficesAtmsMap/OfficesMap.tsx +1 -1
  196. package/src/components/StickyBottomMenu/BurgerMenuDialog.tsx +1 -1
  197. package/src/hooks/useLocation.ts +25 -47
  198. package/src/hooks/useRegions.ts +4 -1
  199. package/src/ui-kit/DialogManager/useDialogsList.ts +3 -0
  200. package/src/ui-kit/FormField/Fields/AddressFactField.tsx +1 -1
  201. package/src/ui-kit/FormField/validators.ts +4 -3
  202. package/src/ui-kit/Input/InputControl.tsx +5 -2
  203. package/src/ui-kit/LocationDialog/LocationDialog.tsx +22 -28
  204. package/src/ui-kit/LocationDialog/SelectedLocation.tsx +27 -0
  205. package/src/ui-kit/PopupManager/PopupManager.tsx +3 -0
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=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:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,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:i="p-xl",padding:a,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],a||i,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:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),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:i,description:a,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:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),T=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),I=[];function B(e,t,{className:n,...i}={}){const{key:a,blockDecorator:l=T,blocksRegistry:r={},ancestors:s=I}=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,...i},a):null}},a)}const P=[],R=(e,{key:t,ancestors:n=P,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const A=["CDN","BASE_PATH"],E=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return A.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),_=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!_(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:_,isLocalURL:z,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const q="/api/",j=`${q}v1/storage`,$=e=>(t,n)=>{if([!t,_(t),F(t),[E.CDN,q].some((e=>O(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`${j}/${t}/attachment`;const i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=M(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(E.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"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:[a?o("title",{children:a}):null,i?o("desc",{children:i}):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&&!_(t)?$(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 i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(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="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={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","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},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?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" ");const ce=new class{subscribers={};subjectsStateMap={};subscribe(e,t){this.subscribers[e]=(this.subscribers[e]||[]).concat(t);const n=this.subjectsStateMap[e];return n&&t(n),()=>{this.unsubscribe(e,t)}}unsubscribe(e,t){this.subscribers[e]=this.subscribers[e]?.filter((e=>e!==t))}fire(e,t){e in this.subjectsStateMap&&(this.subjectsStateMap[e]=t),this.subscribers[e]?.forEach((e=>e(t)))}subject(e,t){this.subjectsStateMap[e]=t}},de=()=>({open:(e,t={})=>ce.fire("dialog",{type:"open",dialog:e,...t}),close:()=>ce.fire("dialog",{type:"close"}),closeAll:()=>ce.fire("dialog",{type:"close",all:!0})}),me=e=>me._impl(e);function ue(){const e=X(G.SITE_URL),t=M(),{closeAll:n}=de();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:me(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),he(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}me._impl=e=>e,me.setup=e=>{me._impl=e};const he=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>O(e,t)))||!O(e,n||"/")},pe=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},ge=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=xe(e)&&"hidden lg:block";return c("div",{className:u(fe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,xe(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,a?o("div",{className:u(r,se[l]),children:a}):null]})})),fe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",xe(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},xe=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),ye=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),be=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].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:i}),s=ue()({onClick:r,href:i,...a}),c=t??o(ge,{...s});return o(e?Ne:ve,{...s,children:c})})),ve=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,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:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...pe(d),children:m}))),Ne=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:ye({className:e,rounded:i,version:n}),children:a})));function we({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"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:a}})}),o(be,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Ce=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},Se={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},ke=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&Se[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Ce(),v=M(),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",i||n,e),children:[C&&we({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[ke(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]}),Be(D({...y,extraProps:{className:"@container-normal"}})),ke(d,{className:u("@xl:justify-self-end @xl:col-start-2",{[Ie(p)]:r,"col-start-2 self-center":p,"hidden @xl:block":g}),imageAlign:m}),r?o("div",{className:"self-end",children:r}):null]})]})]})})),Ie=e=>u(e?"row-span-2":"@xl:row-span-2"),Be=e=>e?.length?o("div",{className:"flex items-start justify-end",children:e}):null,Pe=(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,Re=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),De=(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,Me=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(Me,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:De(e.description,t)},String(t)):null,"__html"in e?o(Re,{...e},`rte-${t}`):null],_e=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?Pe(n.icon,t):null,o("div",{children:Ee(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(_e,{benefitsVersion:t,...e},String(n))))}):null)),Fe=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(Ee)}):null)),Ve=d((({isTabularBenefits:e,...t})=>o(e?Fe:ze,{...t}))),Oe=e=>Boolean(e?.src||e?.icon),Le=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"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:i,icon:a,iconRight:l,version:r,...s}=t||{},c=je(a,r),d=je(l,r);return i||a?.icon?o(be,{className:u("basis-full @lg:basis-auto",e),appendLeft:$e({...a,iconVersion:c}),appendRight:$e({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},je=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},$e=e=>Oe(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),Ue=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),We=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(He)}):null)),He=({label:e,amount:t,unit:n},i)=>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(Me,{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:[Ue(2)(t)," ",n||"₽"]}):null]},String(i)),Ye=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ke)}):null)),Ke=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(Me,{size:"text-m",font:"font-light",children:e})},String(t)),Ge={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Xe=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,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:T,...I})=>{const B=b?.src?o(ne,{image:b}):null,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Je(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:Le(y),backwardButton:S,...I,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Ve,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(Re,{richVersion:p,__html:h,isDotted:m,itemSize:Ge[l]}):null,T,f?.length?o(We,{priceList:f}):null,Ze(x)]})})})),Je=(e,t)=>t?{rightImage:e}:{leftImage:e},Ze=e=>e?.length?o(Ye,{tags:e}):null,Qe=e=>Boolean(e&&Array.isArray(e)),et=e=>Boolean(e&&!Array.isArray(e)&&"object"==typeof e),tt=(e,t)=>{return n=e,Boolean(et(n)&&"string"==typeof n.$ref)?t.ref(e):et(e)?t.record(e):Qe(e)?t.array(e):t.scalar?t.scalar(e):e;var n},nt=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(it,e),it=(e,t)=>e&&t?et(e)?e[t]:Qe(e)?e[parseInt(t,10)]:e:e,at=(e,t)=>tt(e,{ref:({$ref:e,...n})=>at(e?nt(t(e),e):n,t),record:e=>Object.entries(e).map((([e,n])=>({[e]:at(n,t)}))).reduce(((e,t)=>Object.assign(e,t)),{}),array:e=>e.map((e=>at(e,t)))}),lt=(e,t,n=[])=>{tt(e,{ref:e=>t(e.$ref,n),record:e=>{for(const i in e)lt(e[i],t,[...n,i])},array:e=>{for(let i=0;i<e.length;i++)lt(e[i],t,[...n,i])}})};async function rt(e,t){try{return e?await st(e,t):null}catch(e){console.error(e)}return null}const st=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),ot=e=>[...new Set(e)],ct={},dt=["/portal-resources"],mt=(e,t)=>at(e,(e=>t?.[e])),ut=(e,t)=>{const n=(e=>{const t=[];return lt(e,(e=>t.push(e))),t})(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(ot(e).filter((e=>!dt.some((t=>e.startsWith(t))))).map((async e=>[e,ct[e]||=await st(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?mt(e,{...t,...l}):e};function ht(e,t={}){const n=d((t=>{const n=ut((({block:e,options:t,className:n,defaultPadding:i,padding:a,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 pt=ht((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Xe,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),gt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>ft(0,t?.length)),[t]),i=t?.[n];return i?o(pt,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),ft=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),xt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},yt=e=>e?.replace(/[^+\d]/g,"");const bt=e=>e?{phone:yt(e)}:{},vt=(e,t="birthday")=>e?{[t]:xt(e)}:{},Nt=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ct=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:yt(e)}:{},St=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)},kt="rshb-query-params";function Tt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(kt)||"";return e&&globalThis.sessionStorage?.setItem(kt,e),e}function It(e){if(!e)throw new Error("Value should be fulfilled");return e}const Bt=e=>t=>{const[,n]=It(e.find((([e])=>e(t))));return n(t)},Pt=e=>Bt(e.map((([e,t])=>[e,()=>t])));Pt.if=e=>new Rt(void 0,e);class Rt{parent;predicate;unit;get entry(){return[It(this.predicate),It(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Rt(this,e)}then(e){return new Rt(this.parent,this.predicate,e)}else(e){return Bt([...Dt(this),[()=>!0,e]])}}const Dt=e=>[...e?.parent?Dt(e.parent):[],e.entry],Mt=e=>{const t=e.target?.closest("a");if(_(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Tt();if(!_(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){At(t?.target)?.(n)}}},At=Pt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function Et(){return Et._impl()}Et._impl=()=>({forwardQuery:Mt}),Et.setup=e=>{Et._impl=e};const _t=e=>e,zt=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return Ft(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=_t,format:i=_t}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[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}]},Ft=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),Vt=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),Ot=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function Lt(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function qt(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function jt(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return qt(globalThis.document,"click",n),t}const $t=({label:e,errors:t})=>e&&t?`${e}*`:e,Ut=()=>{},Wt="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",Ht=e=>e?o(Me,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,Yt=d((({key:e,className:t="",id:n,name:i,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]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",T=Kt(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[Ht(d),N?o("textarea",{className:u("block resize-y min-h-24",Gt,T),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",Gt,k,T),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),Kt=e=>e?Wt:"border-error",Gt="w-full border rounded-md text-primary-text outline-none p-m",Xt=e=>o("div",{className:"h-6",children:e?o(Me,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Jt=e=>e?.value||"",Zt={url:"suggest/address"},Qt={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:Zt,addressFact:Zt,organizationAddress:Zt,addressCourier:Zt},en=()=>({open:(e,t)=>ce.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>ce.fire("popup",{type:"update",popup:e,...t}),close:()=>ce.fire("popup",{type:"close"})}),tn=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 nn({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=en(),x=Qt[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:i,requestData:a={},responseItemHandler:l=Jt}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,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 i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(tn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const an=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=Ut,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=Lt(),C=jt(N),S=l((e=>x?e.length<=x&&s(e):s(e)),[s]),k=nn({isOpen:v&&y,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(Yt,{disabled:b,type:p||"text","aria-label":t,label:$t({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:ln(i,r,t)})}),Xt(a)]})})),ln=(e,t,n)=>t&&!n?`${e}*`:e,rn=e=>e?.text||e?.key||"",sn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,on=d((({popupRef:e,options:t,value:n,query:i,onChange:a,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:sn(t,i).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(),a&&a(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 cn=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}]=Lt(),[N,w]=i(""),C=un(x,n.length),S=y&&!C,k=l((()=>{w(""),b()}),[]),T=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=en(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=jt(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(on,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[Ht(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",mn(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:rn(r)||h}),dn(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(Yt,{type:"text",autoFocus:!0,value:N,onChange:w})}):null]})]})})),dn=(e,t)=>o(W,{className:u("absolute right-0 flex self-center",{"rotate-180":!e}),iconVersion:t,name:"ArrowUpIcon",width:"16",height:"16"}),mn=(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"),un=(e,t)=>e||0===t,hn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(cn,{...a,valid:!n,label:$t({label:t,errors:i})}),Xt(n)]}))),pn=e=>!e?.length,gn=e=>t=>n=>e(n)?[]:[t],fn=gn((e=>null!=e&&""!==e)),xn="Некорректно заполненное поле",yn=e=>fn(e??xn),bn=e=>gn((e=>e?.key&&""!==e?.key))(e??xn),vn=e=>gn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??xn),Nn=e=>gn((e=>"string"==typeof e&&e.length>1&&Rn(e)))(e??xn),wn=(e,t)=>gn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??xn),Cn=e=>gn((e=>"string"==typeof e&&6===e.length))(e),Sn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,gn((e=>"string"==typeof e&&t.test(e))))(e);var t},kn=gn((e=>"boolean"==typeof e&&e))("Согласие обязательно"),Tn=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},In=e=>Boolean(e.region&&e.city&&e.house),Bn=()=>gn(In)("Укажите регион, город/населенный пункт, улицу, дом, квартиру"),Pn=/^[\u0400-\u04FF\d]+$/u,Rn=(e="")=>Pn.test(e),Dn={typeForm:yn(),surname:Nn("Укажите свою фамилию"),name:Nn("Укажите своё имя"),middleName:Nn("Укажите своё отчество"),region:bn(),addressBranch:bn(),phone:Sn("Укажите номер телефона"),secondaryPhone:Sn("Укажите номер телефона"),organizationPhone:Sn("Укажите номер телефона"),birthday:yn("Укажите дату рождения"),birthPlace:yn("Укажите место рождения"),education:yn("Выберите ваше образование"),housing:yn("Выберите тип жилья"),employment:yn("Выберите информацию о трудоустройстве"),organization:yn("Выберите тип организации"),amountWorkers:yn("Выберите информацию о количестве сотрудников"),employerActivities:yn("Выберите вид деятельности организации"),employerOrganization:yn("Выберите вид организации"),positionOrganization:yn("Выберите вашу должность"),dulSerie:(Mn="Укажите серию паспорта",gn((e=>"string"==typeof e&&4===e.length))(Mn)),dulNumber:Cn("Укажите номер паспорта"),dulIssueDateField:yn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Cn("Укажите код подразделения"),dulIssuedBy:yn("Укажите организацию, выдавшую паспорт"),email:(e=>gn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Nn(),inn:(e=>gn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:yn("Укажите ОПФ"),organizationName:yn("Укажите наименование организации"),generalSeniority:vn("Укажите количество лет стажа"),lastJobExperience:vn("Укажите стаж на последнем месте работы"),experience5Years:vn("Укажите общий стаж за последние 5 лет"),jobsNumber:vn("Укажите количество мест работы за последние 5 лет"),beginDate:yn("Укажите дату заключения трудового договора"),addressFact:Bn(),partnerComments:yn(),collectionCount:yn(),comment:yn(),acquiringType:bn(),feedbackMethod:bn(),serviceType:bn(),serviceDirection:bn(),regionRetail:bn("Выберите регион"),meetingDay:yn(),product:yn(),localities:yn(),consentDataProcessing:kn,annualRevenue:yn(),consentToReceiveMaterials:kn,processPersonalDataFlg:kn,consentProviderFlg:kn,consentPfrFlg:kn,consentOthersFlg:kn,consentInformFlg:kn,familyStatus:yn("Выберите семейное положение"),children:wn(2,"Укажите количество детей"),familyMembers:wn(2,"Укажите количество членов семьи"),dependents:wn(2,"Укажите количество иждивенцев"),totalIncome:wn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:wn(10,"Укажите сумму обязательных выплат"),snils:(e=>gn(Tn)(e))("Некорректный номер СНИЛС"),conscription:yn(),armyIdFlg:kn,sex:yn("Укажите свой пол"),addressRegistration:Bn(),organizationAddress:gn((e=>Boolean(e.fiasCode&&e.city&&e.house)))("Укажите регион, город/населенный пункт, улицу, дом"),participantDateRegistration:yn("Укажите дату регистрации"),retirementIncome:yn(),otherIncome:yn(),wages:yn(),mandatoryPayments:yn(),disablePeopleFlg:yn(),bankruptcyFlg:yn(),shareholderFlg:yn(),legalEntityName:yn(),bankEmployeeCode:yn(),partInBusiness:yn(),addressRetail:bn("Выберите адрес банка"),addressMatch:yn(),codeWord:(e=>gn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&Rn(e)))(e??xn))("Необходимо ввести кодовое слово"),confirmationIncome:yn(),deliveryDate:yn("Укажите дату доставки"),addressCourier:Bn()};var Mn;const An=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,Dn?.[e||""]])).filter((([,e])=>e)))},En=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},_n=(e,t,n=!1)=>n&&t?En(e,t):e,zn=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],Fn=d((({field:e,input:t})=>o(hn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:zn,..._n(e("acquiringType"),Dn.acquiringType,t?.required)}))),Vn=(e="")=>Boolean("trade"===e||"all"===e),On=e=>null!=e,Ln=new Map,qn=e=>Boolean(e?.every((e=>Array.isArray(e)?qn(e):!e||"string"==typeof e))),jn=e=>qn(e)?e.toString():"";function $n(e,t,{fallback:n,cache:l}={}){const s=r((()=>Un(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(On))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=Ln)=>n=>{const i=jn(n),a=t.get(i);if(i&&On(a))return a;const l=e(...n);return i&&On(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function Un(e){return Array.isArray(e)?e:e instanceof Function?Un(e()):[e]}const Wn=[];const Hn=async e=>await rt(e,{method:"GET"})||Wn;function Yn(e=!1){const{data:t}=$n("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),st);return Array.isArray(t)?t:[]}const Kn=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?Yn(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=$n(e?`/api/v1/branches?regionCode=${e}`:null,Hn);return t||Wn}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(hn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),..._n(e("addressBranch"),Dn.addressBranch,t?.required),isSearch:!0})})),Gn=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{r&&e("addressFact")?.onChange?.(e("addressRegistration").value)}),[r]);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?.({...e(n).value,fullAddress:t})}),[]);return o(an,{label:"Адрес",disabled:r,..._n(e(n),Dn[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),Xn=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Jn=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=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})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(an,{disabled:t?.filledByEsia&&Xn(e,n),label:"Адрес",..._n(e(n),Dn[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),Zn=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Qn="appearance-none w-5 h-5 border-solid flex-none",ei=[{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"}],ti=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(Zn,{paths:ei,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",ii(i)),onClick:s,children:[o("div",{className:u(Qn,"m-0",a?"rounded-full border-2":li(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:ai(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,ni(n)]})})})),ni=e=>e?o("div",{className:"ml-s",children:o(Me,{size:"text-l",font:"font-light",children:e})}):null,ii=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",ai=(e=!1)=>e?"radio":"checkbox",li=(e=!1)=>u("rounded border",{"bg-primary-main":e}),ri=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ti,{text:t,value:n,disabled:a,onChange:r},i),Xt(l)]}))),si=d((({field:e,input:t})=>o(ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",..._n(e("addressMatch"),Dn.addressMatch,t?.required)}))),oi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),ci="/icons/MapMarkerClusterIcon.svg",di="/icons/MapMarkerClusterYellowIcon.svg";function mi({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=ui("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=ui("workplaces",e,a),r=hi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=hi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=hi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const ui=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?ci:di,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),hi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?ci:di,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),pi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},gi={...pi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},fi=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(gi).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"})}),xi=e=>globalThis[e];function yi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=xi(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(xi(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(xi(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const bi={...pi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},vi=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values(bi).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Ni=[55.753995,37.614069],wi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=yi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${E.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?mi({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Ci(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),mi({yandexMaps:m,map:r.current,points:e,isLoad:i})})),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,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(oi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(vi,{yandexMaps:r}),o(vi,{yandexMaps:r,direction:"out"})]}),fi(r,m,u("right-2 top-80",h))]})})),Ci=e=>{const t=[ki(Si(e,0)),ki(Si(e,1))];return t.every((e=>e))?t:Ni},Si=(e,t)=>e.map((e=>e.coords?.[t])),ki=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Ti=async(e,t,n)=>{try{return(await Ii(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ii(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Bi()},credentials:"include",body:n?JSON.stringify(n):null})}const Bi=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Pi=e=>Number(e.toString().replace(",",".")),Ri=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({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 Di=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),Mi=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:Ai({textItems:l,subText:t,children:n,isPhone:i,...a})})),Ai=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,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(Me,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||Ei(n,s),a?o(Me,{color:i,size:"text-m",children:a}):null]}),Ei=(e,t)=>e.filter(Boolean).map(((e,n)=>o(Me,{size:"text-l",children:t?o("a",{href:`tel:${_i(e)}`,children:e.trim()}):e.trim()},String(n)))),_i=e=>e.replace(/\D/g,""),zi=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}))),Fi=e=>{const t=Oi(e);return o(Mi,{label:"Режим работы",value:t,className:"max-w-none"})},Vi=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",Oi=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))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[Vi({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),Vi({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},Li=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],qi=e=>Li.map((([t,n,i])=>({key:t,title:i,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??"")}}))),ji=e=>{if(!e)return null;const t=$i(e);return c(zi,{className:"border-none",children:[o(Mi,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(Ui)})}),o(Mi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]})},$i=e=>{const t=Li.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},Ui=({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(Me,{size:"text-xs",children:e})},String(n)),Wi=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(Mi,{label:"Валюта",value:e.currency}):null,t?o(Mi,{label:"Купить",value:String(t)}):null,n?o(Mi,{label:"Продать",value:String(n)}):null]},String(i)),Hi={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"}},Yi=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",Hi[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(Me,{size:"text-m",color:Hi[n].text,children:t})]}))),Ki=(new Date).getDay(),Gi=e=>{const[t]=e?.slice(Ki-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(Yi,{color:"green",children:a}):null,n&&l?o(Yi,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(Yi,{color:"red",children:"Выходной"})},Xi=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Ji=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(Mi,{label:e,value:t&&n?n:"",subText:Xi({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),Zi=["ArrowDownIcon","ArrowUpIcon"],Qi=["Подробнее","Скрыть"],ea=({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:Qi[Number(e)]}),o(W,{className:"text-primary-text",name:Zi[Number(e)],width:"16",height:"16"})]}),ta=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,na=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,ia=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,aa=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=qi(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(Me,{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(Me,{size:"text-l",children:t})]}):null]}),Gi(h)]}),o("div",{className:"hidden sm:block",children:la({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(Ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Di,{isUnfolded:e,children:la({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ea({isUnfolded:e,onToggle:t})})]},String(u))},la=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=qi(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(zi,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(Mi,{label:"Факс",value:t,isPhone:!0}),o(Mi,{label:"Телефон филиала",value:e,isPhone:!0}),o(Mi,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(Mi,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(Mi,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(Mi,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(zi,{children:o(Mi,{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(Ji)})})}):c(zi,{children:[o(Mi,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(Ui)})}),Fi(d)]}),r?.businessScheduleVisibleTag?ji(r?.businessScheduleDescription):null,s?.currencies?.length?o(zi,{className:"flex-wrap",children:s?.currencies?.map(Wi)}):null]})},ra=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=qi(e),n=e?Oi(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ta(n):ia(n,i):na(n):""})(n)}`;return{header:i,body:l}},sa=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),oa=d((({children:e})=>sa?e:null)),ca={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},da={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},ma={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)};function ua({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const ha={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"},pa={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")},ga=d((({children:e,...t})=>{const n=e=>({...e,onClick:me(ua(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(ha[a],pa[a]),i),type:s,role:d,onClick:m,children:e})})),fa=(e,t)=>e&&"underlined"!==t?"primary":"secondary",xa=(e,t,n)=>{const i=fa("all"===t),a=fa("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},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(ga,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(ga,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},ya=({__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(Re,{__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(Me,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,ba="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",va=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(ti,{text:a[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(Ri,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:ba,children:s}),o(Di,{className:ba,isUnfolded:e,children:d})]}),renderFoldButton:Na(n,i)})}):null})},Na=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(be,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:wa()})]}),wa=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ca=(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(Me,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Sa=()=>{},ka=e=>"all"===e?"block":"hidden",Ta=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Sa,renderRemoteWorkplaceCard:r=Sa,getBalloon:s=Sa,getBalloonRemoteWorkplaces:d=Sa,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=zt(ca),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=Ra({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Ba([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:da};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ca(h,N),m?ya(m):null,p&&xa(t,w,C),o("div",{className:u("pb-3xl",ka(w)),children:va(S)})]}),o("div",{className:"h-[600px]",children:o(oa,{children:o(wi,{points:b,isLoad:n,className:"h-full"})})})]}),c(oa,{children:[y.map(l),v.map(r)]})]})})),Ia=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>ma[t](e)))))},Ba=e=>Object.keys(ca).filter((t=>e.filter((e=>ma[t](e))).length)),Pa=()=>{},Ra=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Pa,getBalloonRemoteWorkplaces:a=Pa})=>{const[l,s,o,c]=r((()=>{const l=Ia(e,n),r=Ia(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({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,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},Da=e=>{const{data:t,error:n}=$n(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,Ma);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},Ma=async e=>await rt(e,{method:"POST"})||[],Aa=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=Da("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Ti("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:Pi(e.latitude??Ni[0]),gpsLongitude:Pi(e.longitude??Ni[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=Ra({data:n,filtrationState:{},getBalloon:ra}),u=Boolean(s?.key);return c("div",{children:[o(hn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),..._n(e("addressRetail"),Dn.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(oa,{children:o(wi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),Ea=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},_a=(e,t,n)=>Math.max(t,Math.min(e,n));function za(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function Fa({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,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:i,value:s,disabled:l,onChange:t=>{const n=za(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const Va=1,Oa=100,La=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:Va),max:s=(a.length?a.length-1:Oa),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=Ea(e,{normalize:(e=0)=>a.length?qa(a)(e):_a(e,r,s),format:Ue()}),f=l((e=>{p&&p(za(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(Me,{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",Wt,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),Fa({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ja(i)]})})),qa=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ja=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),$a=["От 1 000 ₽","До 1 000 000 000 ₽"],Ua=d((({field:e})=>o(La,{title:"Сумма, ₽",items:$a,min:1e3,max:1e9,...e("amount")}))),Wa=ht((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(hn,{placeholder:l,label:n,options:s,isSearch:r,..._n(e(i),Dn[i],a?.required)})})),Ha=d((({field:e,input:t})=>{const{data:n}=Da("EMPLOYEES_NUMBER");return o(Wa,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),Ya=d((({field:e,input:t})=>o(an,{label:"Годовая выручка, ₽",..._n(e("annualRevenue"),Dn.annualRevenue,t?.required)}))),Ka=d((({field:e,input:t})=>o(ri,{text:"Наличие военного билета",..._n(e("armyIdFlg"),Dn.armyIdFlg,t?.required)}))),Ga=d((({field:e,input:t})=>o(an,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",..._n(e("bankEmployeeCode"),Dn.bankEmployeeCode,t?.required),...t}))),Xa=d((({field:e})=>o(an,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Ja=d((({field:e,input:t})=>o(ri,{text:"В отношении меня ведётся производство по делу о банкротстве",..._n(e("bankruptcyFlg"),Dn.bankruptcyFlg,t?.required)}))),Za=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,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(a,i,d),n=Qa(t,e),c=el(t,l,r);u.push(o("td",{children:o("div",{className:tl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Qa=(e,t)=>t&&e.toDateString()===t.toDateString(),el=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),tl=(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"),nl=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],il=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=Ut,setValue:d=Ut})=>{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:nl.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:Za({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),al=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function ll(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(rl),l=i.map(((e,t)=>ol(e)?i.slice(0,t).filter(ol).length:-1)),r=i.map(((e,t)=>sl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const rl=e=>"_"===e,sl=e=>/\d/.test(e),ol=e=>rl(e)||sl(e),cl=1940,dl={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},ml=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),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(ll(t,"__.__.____"))},onBlur:()=>{if(ul(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...dl})]})})),ul=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=cl&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},hl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(ml,{onChange:i,disabled:r,onClick:e,value:t&&xt(t),setSelectedMonth:a,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")}),pl=al.map((e=>({key:e}))),gl=Array.from({length:(new Date).getFullYear()-cl+1},((e,t)=>cl+t)).reverse().map((e=>({key:String(e)}))),fl=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},xl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},yl={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},bl={className:"min-w-32",iconVersion:"black",isBorder:!1},vl=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=Lt(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(n?.getFullYear()||(new Date).getFullYear()),{handlePrevMonth:v,handleNextMonth:N,handleSelectMonth:w,handleSelectYear:C,monthsOptions:S,yearsOptions:k,handleChangeVisibleCalendar:T,ref:I}=(({onShowCalendar:e,showCalendar:t,selectedMonth:n,onMonthSelect:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=jt(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(al.indexOf(e));const t=fl(r,al.indexOf(e));xl({maxDateOfMonth:t,selectedYear:r,selectedMonth:al.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:pl,yearsOptions:gl,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{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})(I,370);return c("div",{className:u("space-y-xs",e),ref:I,children:[Ht(t),c("div",{className:"relative",children:[hl({handleChangeVisibleCalendar:T,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":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...yl,className:"-rotate-90 cursor-pointer"})}),o(cn,{onChange:w,value:{key:al[f]},options:S,...bl}),o(cn,{onChange:C,value:{key:String(y)},options:k,...bl}),o("div",{className:"my-auto",onClick:N,children:o(W,{...yl,className:"rotate-90 cursor-pointer"})})]}),o(il,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Nl=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(vl,{label:$t({label:t,errors:i}),valid:Boolean(!n),...a}),Xt(n)]}))),wl=d((({field:e,input:t})=>o(Nl,{label:"Дата начала работы на текущем месте",..._n(e("beginDate"),Dn.beginDate,t?.required),...t}))),Cl="birthday",Sl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Cl);return o(Nl,{label:"Дата рождения",..._n(e(Cl),Dn.birthday,t?.required),error:n&&i&&!kl(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&Xn(e,Cl)})})),kl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},Tl=d((({field:e,input:t})=>o(an,{label:"Место рождения",..._n(e("birthPlace"),Dn.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&Xn(e,"birthPlace")}))),Il=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Ii("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(Wa,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Bl=d((({field:e,input:t})=>o(an,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",..._n(e("children"),Dn.children,t?.required),...t}))),Pl=d((({field:e,input:t})=>o(an,{label:"Кодовое слово",..._n(e("codeWord"),Dn.codeWord,t?.required),...t}))),Rl=d((({field:e,input:t})=>o(an,{label:"Количество объектов инкассации",type:"number",..._n(e("collectionCount"),Dn.collectionCount,t?.required)}))),Dl=d((({field:e,input:t})=>o(an,{className:"col-span-2",..._n(e("comment"),Dn.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),Ml=d((({field:e,input:t})=>{const{data:n}=Da("INCOME_CERT_UNITED");return o(Wa,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),Al=d((({field:e,input:t})=>{const{data:n}=Da("MILITARY_STATUS");return o(Wa,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),El={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},_l=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Ii(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},zl=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"})}))),Fl=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=de(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(zl,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),Vl=async(e,t,n=!1)=>{const i=await _l(t,n);e(o(Fl,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},Ol=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=de(),l=Ce();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ti,{...i}),n?o(be,{className:"text-primary-main",onClick:()=>Vl(a,n,l),children:o(Me,{children:"Ознакомиться"})}):null]}),Xt(t)]})})),Ll=d((({field:e,input:t})=>t&&t.name?o(Ol,{text:El[t.name]?.text,docId:El[t.name]?.docId,..._n(e(t.name),Dn[t.name],t?.required)}):null)),ql=d((({field:e,input:t})=>{const{data:n}=Da("CREDIT_IN_RSHB");return o(Wa,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),jl={horizontal:"@lg:flex-row",vertical:""},$l=d((({label:e,items:t,value:n,className:i,onChange:a,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(Me,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",jl[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ti,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),Ul=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o($l,{label:$t({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),Xt(i)]}))),Wl=[{id:"rub",text:"Рубль"}],Hl=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(Ul,{label:"Валюта",orientation:"horizontal",items:Wl,value:n,onChange:e=>i?.(e),..._n(e("currency"),Dn.currency,t?.required)})})),Yl=d((({field:e,input:t})=>o(Nl,{label:"Дата доставки",..._n(e("deliveryDate"),Dn.deliveryDate,t?.required)}))),Kl=d((({field:e,input:t})=>o(an,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,..._n(e("dependents"),Dn.dependents,t?.required),...t}))),Gl=d((({field:e,input:t})=>o(Nl,{label:"Желаемая дата встречи",..._n(e("desiredMeetingDate"),Dn.meetingDay,t?.required)}))),Xl=d((({field:e,input:t})=>o(ri,{text:"Являюсь инвалидом",..._n(e("disablePeopleFlg"),Dn.disablePeopleFlg,t?.required)}))),Jl="dulIssueDateField",Zl=d((({field:e,input:t})=>o(Nl,{label:"Дата выдачи",..._n(e(Jl),Dn.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&Xn(e,Jl)}))),Ql="dulIssuedBy",er=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(an,{disabled:t?.filledByEsia&&Xn(e,Ql),label:"Кем выдан",...t,..._n(e(Ql),Dn.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),tr=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Xn(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,..._n(e("dulNumber"),Dn.dulNumber,t?.required)}))),nr=d((({field:e,input:t})=>o(an,{disabled:t?.filledByEsia&&Xn(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,..._n(e("dulSerie"),Dn.dulSerie,t?.required)}))),ir="dulSubdivisionCode",ar=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(an,{disabled:t?.filledByEsia&&Xn(e,ir),label:"Код подразделения",type:"number",maxLength:6,...t,..._n(e(ir),Dn.dulSubdivisionCode,t?.required),onDaDataChange:n})})),lr=d((({field:e,input:t})=>{const{data:n}=Da("EDUCATION_LEVEL");return o(Wa,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),rr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(an,{label:"Электронная почта",..._n(e("email"),Dn.email,n),...i})})),sr=d((({field:e,input:t})=>{const{data:n}=Da("ORGANIZATION_ACTIVITY_TYPE");return o(Wa,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),or=d((({field:e,input:t})=>{const{data:n}=Da("ORGANIZATION_KIND");return o(Wa,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),cr=d((({field:e,input:t})=>{const{data:n}=Da("EMPLOYMENT_INFO_UNITED");return o(Wa,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),dr=d((({field:e,input:t})=>o(an,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",..._n(e("expenses"),Dn.expenses,t?.required),...t}))),mr=d((({field:e,input:t})=>o(an,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,..._n(e("experience5Years"),Dn.experience5Years,t?.required),...t}))),ur=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(an,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),hr=d((({field:e,input:t})=>{const{data:n}=Da("MARITAL_STATUS");return o(Wa,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),pr=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],gr=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],fr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],xr=d((({field:e,input:t})=>o(hn,{label:"Способ получения ответа",options:fr,..._n(e("feedbackMethod"),Dn.feedbackMethod,t?.required)}))),yr=d((({field:e,input:t})=>o(an,{label:"ФИО",..._n(e("fullName"),Dn.fullName,t?.required),...t}))),br=d((({field:e,input:t})=>o(an,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",..._n(e("generalSeniority"),Dn.generalSeniority,t?.required),...t}))),vr=d((({field:e,input:t})=>{const{data:n}=Da("HOUSE_TYPE");return o(Wa,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Nr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"ИНН",type:"number",maxLength:12,...t,..._n(e("inn"),Dn.inn,t?.required),onDaDataChange:n})})),wr=d((({field:e})=>o(ri,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Cr=d((({field:e,input:t})=>o(an,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,..._n(e("jobsNumber"),Dn.jobsNumber,t?.required),...t}))),Sr=d((({field:e,input:t})=>o(an,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,..._n(e("lastJobExperience"),Dn.lastJobExperience,t?.required),...t}))),kr=d((({field:e,input:t})=>o(an,{label:"Наименование юридического лица",...t,..._n(e("legalEntityName"),Dn.legalEntityName,t?.required)}))),Tr=d((({field:e,input:t})=>o(an,{label:"ОПФ",placeholder:"ООО, ПАО и др.",..._n(e("legalForm"),Dn.legalForm,t?.required),...t}))),Ir=[];async function Br(){const e=await rt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Ir}const Pr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=$n("outServiceRegions",Br),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(hn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,..._n(e("localities"),Dn.localities,t?.required),isSearch:!0})})),Rr=d((({field:e,input:t})=>o(an,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",..._n(e("mandatoryPayments"),Dn.mandatoryPayments,t?.required),...t}))),Dr=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],Mr=d((({field:e,input:t})=>o(Ul,{orientation:"horizontal",items:Dr,..._n(e("methodObtain"),Dn.methodObtain,t?.required)}))),Ar="middleName",Er=d((({field:e,input:t})=>o(an,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&Xn(e,Ar),..._n(e(Ar),Dn.middleName,t?.required),...t}))),_r=d((({field:e,input:t})=>o(an,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&Xn(e,t.name??""),..._n(e("name"),Dn.name,t?.required),...t}))),zr=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!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(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),Fr=d((({field:e})=>Vn(e("acquiringType")?.value?.key)?o(zr,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),Vr=d((({field:e,input:t})=>{const{data:n}=Da("ORGANIZATION_TYPE");return o(Wa,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),Or=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(an,{label:"Наименование организации",...t,..._n(e("organizationName"),Dn.organizationName,t?.required),onDaDataChange:n})})),Lr=d((({field:e,input:t})=>o(an,{label:"Иные доходы",placeholder:"Введите значение",type:"number",..._n(e("otherIncome"),Dn.otherIncome,t?.required),...t}))),qr=d((({field:e,input:t})=>o(Nl,{label:"Дата регистрации по месту жительства",..._n(e("participantDateRegistration"),Dn.participantDateRegistration,t?.required)}))),jr=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={..._n(e("partInBusiness"),Dn.partInBusiness,t?.required)};return o(an,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),$r=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(an,{..._n(e("partnerComments"),Dn.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),Ur=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Ii("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))})();s(e||[])})()}),[]),o(Ul,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),..._n(e("paymentSystem"),Dn.paymentSystem,t?.required)})})),Wr=e=>"_"===e,Hr=e=>/\d/.test(e),Yr=e=>Wr(e)||Hr(e),Kr=[..."+7 (___) ___-__-__"],Gr=Kr.findIndex(Wr),Xr=Kr.map(((e,t)=>Yr(e)?Kr.slice(0,t).filter(Yr).length:-1));function Jr(e){const t=e.replace(/\D/g,""),n=Kr.map(((e,n)=>Hr(e)?e:t.charAt(Xr[n])||e)),i=Xr.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(Gr,i)):n).join("")}const Zr=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Jr(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Qr=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Zr,{"aria-label":t,label:$t({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),Xt(n)]}))),es=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Qr,{label:"Телефон",..._n(e(n),Dn.phone,t?.required),disabled:t?.filledByEsia&&Xn(e,n),...t})})),ts=d((({field:e,input:t})=>{const{data:n}=Da("POSITION");return o(Wa,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),ns=d((({field:e})=>Vn(e("acquiringType")?.value?.key)?o(zr,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),is=ht((({field:e,source:t})=>o(hn,{placeholder:"Выберите продукт",label:"Продукт",options:as(t?.productList),...En(e("product"),Dn.product)}))),as=e=>(e??[]).map((e=>({key:e,value:e})));function ls(e="/api/v1/regions"){const{data:t}=$n(e,st);return Array.isArray(t)?t:[]}const rs=d((({field:e,input:t,url:n})=>{const i=ls(n);return o(hn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),..._n(e("region"),Dn.region,t?.required)})})),ss=d((({field:e,input:t})=>{const n=Yn(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(hn,{label:"Регион",placeholder:"Выберите регион",options:i,..._n(e("region"),Dn.region,t?.required)})})),os=d((({field:e,input:t})=>{const{data:n}=Da("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(hn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,..._n(e("regionRetail"),Dn.regionRetail,t?.required)})})),cs=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(an,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",..._n(e("retirementIncome"),Dn.retirementIncome,t?.required),...t,onChange:i})})),ds=d((({field:e})=>{const t=e("secondaryPhone");return o(Qr,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?En(t,Dn.secondaryPhone):t})})),ms=d((({field:e,input:t})=>o(hn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:gr,..._n(e("serviceDirection"),Dn.serviceDirection,t?.required)}))),us=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],hs=d((({field:e,input:t})=>o(Ul,{label:"Пол",orientation:"horizontal",items:us,..._n(e("sex"),Dn.sex,t?.required)}))),ps=d((({field:e,input:t})=>o(ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",..._n(e("shareholderFlg"),Dn.shareholderFlg,t?.required)}))),gs=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(ll(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(Yt,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),fs=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(gs,{"aria-label":t,label:$t({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),Xt(i)]}))),xs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(fs,{label:"СНИЛС",..._n(e("snils"),Dn.snils,!!n&&t?.required),...t})})),ys=d((({field:e,input:t})=>o(an,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&Xn(e,"surname"),..._n(e("surname"),Dn.surname,t?.required),...t}))),bs=["От 1 мес","До 15 лет"],vs=d((({field:e})=>o(La,{title:"Срок, месяцев",items:bs,min:1,max:180,...e("term")}))),Ns=d((({field:e,input:t})=>o(an,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("totalIncome"),Dn.totalIncome,t?.required),...t}))),ws=d((({field:e,input:t})=>o(hn,{label:"Тип обслуживания",options:pr,..._n(e("serviceType"),Dn.serviceType,t?.required)}))),Cs=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Ss=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o($l,{className:"whitespace-normal",orientation:"horizontal",items:Cs,value:t,onChange:e=>n&&n(e)})})})),ks=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(an,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",..._n(e("wages"),Dn.wages,t?.required),...t,onChange:i})}));const Ts={$ref:"/wcms-resources/outservice-productlist.json"},Is=(e,t,n=!1)=>(i,a)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o(ys,{field:e,input:i}),name:o(_r,{field:e,input:i}),middleName:o(Er,{field:e,input:i}),phone:o(es,{field:e,input:i}),organizationPhone:o(es,{field:e,input:i}),email:o(rr,{field:e,input:i}),fullName:o(yr,{field:e,input:i}),inn:o(Nr,{field:e,input:i}),legalForm:o(Tr,{field:e,input:i}),organizationName:o(Or,{field:e,input:i}),generalSeniority:o(br,{field:e,input:i}),lastJobExperience:o(Sr,{field:e,input:i}),experience5Years:o(mr,{field:e,input:i}),jobsNumber:o(Cr,{field:e,input:i}),beginDate:o(wl,{field:e,input:i}),addressFact:o(Gn,{field:e,input:i}),organizationAddress:o(Jn,{field:e,input:i}),comment:o(Dl,{field:e,input:i}),addressBranch:o(Kn,{field:e,input:i,isPremium:l}),sex:o(hs,{field:e,input:i}),birthday:o(Sl,{field:e,input:i,isRetailForm:n}),birthPlace:o(Tl,{field:e,input:i}),desiredMeetingDate:o(Gl,{field:e,input:i}),product:o(is,{field:e,source:Ts}),localities:o(Pr,{field:e,input:i}),isClient:o(wr,{field:e}),partnerComments:o($r,{field:e,input:i}),collectionCount:o(Rl,{field:e,input:i}),acquiringType:o(Fn,{field:e,input:i}),onlineCheckout:o(Fr,{field:e}),posTerminal:o(ns,{field:e}),serviceType:o(ws,{field:e,input:i}),term:o(vs,{field:e}),amount:o(Ua,{field:e}),annualRevenue:o(Ya,{field:e,input:i}),vedTypes:o(Ss,{field:e}),feedbackMethod:o(xr,{field:e,input:i}),serviceDirection:o(ms,{field:e,input:i}),bankEmpolee:o(Xa,{field:e}),secondaryPhone:o(ds,{field:e}),consentToReceiveMaterials:o(Ll,{field:e,input:i}),processPersonalDataFlg:o(Ll,{field:e,input:i}),consentProviderFlg:o(Ll,{field:e,input:i}),consentOthersFlg:o(Ll,{field:e,input:i}),consentInformFlg:o(Ll,{field:e,input:i}),consentPfrFlg:o(Ll,{field:e,input:i}),applicationDate:o(an,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(ss,{field:e}):o(rs,{field:e,input:i,url:Ot(t)}),education:o(lr,{field:e,input:i}),housing:o(vr,{field:e,input:i}),employment:o(cr,{field:e,input:i}),organization:o(Vr,{field:e,input:i}),amountWorkers:o(Ha,{field:e,input:i}),employerActivities:o(sr,{field:e,input:i}),employerOrganization:o(or,{field:e,input:i}),positionOrganization:o(ts,{field:e,input:i}),familyStatus:o(hr,{field:e,input:i}),children:o(Bl,{field:e,input:i}),familyMembers:o(ur,{field:e,input:i}),dependents:o(Kl,{field:e,input:i}),totalIncome:o(Ns,{field:e,input:i}),expenses:o(dr,{field:e,input:i}),snils:o(xs,{field:e,input:i}),conscription:o(Al,{field:e,input:i}),armyIdFlg:o(Ka,{field:e,input:i}),dulSerie:o(nr,{field:e,input:i}),dulNumber:o(tr,{field:e,input:i}),dulIssueDateField:o(Zl,{field:e,input:i}),dulSubdivisionCode:o(ar,{field:e,input:i}),dulIssuedBy:o(er,{field:e,input:i}),addressRegistration:o(Jn,{field:e,input:i}),addressCourier:o(Jn,{field:e,input:i}),participantDateRegistration:o(qr,{field:e,input:i}),retirementIncome:o(cs,{field:e,input:i}),otherIncome:o(Lr,{field:e,input:i}),wages:o(ks,{field:e,input:i}),mandatoryPayments:o(Rr,{field:e,input:i}),disablePeopleFlg:o(Xl,{field:e,input:i}),bankruptcyFlg:o(Ja,{field:e,input:i}),shareholderFlg:o(ps,{field:e,input:i}),legalEntityName:o(kr,{field:e,input:i}),creditInRshbCd:o(ql,{field:e,input:i}),bankEmployeeCode:o(Ga,{field:e,input:i}),partInBusiness:o(jr,{field:e,input:i}),regionRetail:o(os,{field:e,input:i}),addressRetail:o(Aa,{field:e,input:i}),addressMatch:o(si,{field:e,input:i}),paymentSystem:o(Ur,{field:e,input:i}),currency:o(Hl,{field:e,input:i}),cardCategory:o(Il,{field:e,input:i}),codeWord:o(Pl,{field:e,input:i}),confirmationIncome:o(Ml,{field:e,input:i}),methodObtain:o(Mr,{field:e,input:i}),deliveryDate:o(Yl,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(a)):null},Bs=e=>2===e?"@xl:grid-cols-2":"",Ps=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(Me,{size:"text-h6",children:e})}):null,Rs=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=de(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(Fl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(ga,{type:"button",onClick:r,children:"Хорошо"})]})})})),Ds=e=>{const{open:t,close:n}=de();return{open:(n,i={})=>t(o(Rs,{...e,...n}),i),close:n}},Ms=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],As=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${Vn(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,..._s(o),...Es(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},Es=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},_s=e=>e?{vedTypes:Object.fromEntries(Cs.map((({id:t})=>[t,t===e])))}:{},zs={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:pr[0],feedbackMethod:fr[0],serviceDirection:gr[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},Fs=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(Me,{children:e}):null,t?o(be,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(Me,{children:t.text})}):null]}))),Vs=(e,t)=>o(ga,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Os=(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(ti,{...e}),o(Fs,{link:t})]}),Xt(En(e,kn).error)]}):o(Fs,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),Vs(n)]}),Ls={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Nt(i,g),...wt(l,g),...bt(a),...vt(s,"desiredMeetingDate"),...g?vt(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ct(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}}},qs=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="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||zs[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=pr[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=Ds({typeForm:n}),C=l((async(e,t)=>{const n=js(x,e),i=Ms(An(n));if(!pn(i(e)))return console.warn("validation fail");const a=As({...e,...h}),l=await Ls.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&N.open({responseType:l}),"OK"===l&&g){const e=Et();St({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:T}]=zt(y,{onSubmit:C}),I=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),T())}),[b]),c(Vt,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Bs(e.columns),"grid gap-x-m"),children:[Ps(e.title),(e?.inputs||[])?.map(Is(S,n))]},`section-${t}`))),Os(I?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]})})),js=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function $s(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const Us=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(En(n(e?.name),Dn[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(Ri,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(Di,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Is(n,t))}),renderFoldButton:Ws(c("div",{children:[o(ti,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),Xt(l?"Отметьте все обязательные соглашения":"")]}))})})})),Ws=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"})})]}),Hs=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:a,restInputs:l}=Ys(n||[]);return a.length>2?c("div",{children:[l.map(Is(e,t,i)),o(Us,{inputs:a,field:e})]}):(n||[])?.map(Is(e,t,i))},Ys=e=>({consentInputs:e?.filter((e=>Object.keys(El).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(El).includes(e.name||"")))||[]}),Ks={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:zn[0],serviceType:pr[0],feedbackMethod:fr[0],serviceDirection:gr[0],vedTypes:Cs[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},Gs=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||Ks[e.name||""]]))),typeForm:{key:n,text:""}}},Xs=(e,t)=>o(ga,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Js=e=>Ti("/user-data/updateUserProfile","PUT",e),Zs=e=>Ti("/user-data/updateUserTask","PUT",e),Qs=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),eo={width:"103",height:"21"},to={"bg-white":"color",transparent:"white"},no={"bg-white":"text-primary-main",transparent:"text-white"},io=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:to[e]},className:no[e],width:n?.width,height:n?.height}),ao={"bg-white":"text-primary-text",transparent:"text-white"},lo=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,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:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...pe(s),children:[io(l,n?.image,eo),r?i??o("div",{className:"ml-s",children:o(Me,{font:"font-medium",color:ao[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),ro=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Ii("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Ii(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(Fl,{head:o(lo,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",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:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(Yt,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(ga,{onClick:t,version:"secondary",children:"Вернуться"}),o(ga,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),so=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:oo(e)})))),oo=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,co=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:mo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),mo=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},uo=d((({isDisabled:e,onClick:t,text:n})=>o(ga,{type:"button",onClick:t,disabled:e,children:o(Me,{font:"font-normal",children:n})}))),ho=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},po=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=l((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Ti("/sms/checkCode","POST",e).then(ho))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},go=d((({close:e=Ut,onClose:t=Ut,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=po({values:p,close:e}),T=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Ti("/sms/sendCode","POST",e).then((t=>!Qs(t,e.phoneNumber))))?(S(0),w(180),C(!0)):I.open()}),[]),I=((e,t)=>{const{open:n,close:i,closeAll:a}=de();return{open:()=>n(o(ro,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:T},t);return a((()=>{T()}),[]),o(Fl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(co,{values:p,setValues:g,errorText:y,hasError:x}):null,xo(v,w,T),o(Re,{itemSize:"list-s",__html:s}),fo(u,N,f),b?o(oi,{blur:!1}):null]})})})),fo=(e,t,n)=>e?o(uo,{isDisabled:t,onClick:n,text:e}):null,xo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(so,{className:"text-base ml-1",time:e,setTime:t})]}):o(be,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),yo=()=>{const{open:e,close:t}=de();return{open:(n,i)=>e(o(go,{onClose:t,close:n,...i})),close:t}},bo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},vo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},No=d((function({handleSubmit:e=Ut,onClose:t=Ut}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=de(),u=Ce(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?vo:bo;return o(Fl,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>Vl(d,Co,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o($l,{className:"whitespace-normal",orientation:"horizontal",items:wo,value:n,onChange:p}),o(ga,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),wo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Co=2,So=e=>{const{open:t,close:n}=de(),i=yo(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await Js({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),ko(t)):e()};return{open:(n,i)=>t(o(No,{handleSubmit:a(n,i),onClose:e}))}},ko=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),To=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Ti("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(Fl,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",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 items-center justify-between w-full m-0",children:[o(ga,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(ga,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Io={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Bo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},Po={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},Ro=e=>Object.entries(e).reduce(((e,[t,n])=>t in Io?[...e,{contactTypeCd:{key:Io[t]},value:n}]:e),[]),Do=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Bo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Bo[t]},...i}]}return e}),[]),Mo=e=>Object.entries(e).reduce(((e,[t,n])=>t in Po?[...e,{incomeTypeCd:{key:Po[t]},value:Number(n||0)}]:e),[]),Ao=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=$s("taskId"),[,d]=$s("profileId"),[,m]=$s("participantId"),u=(e=>{const{open:t,close:n}=de(),i=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(To,{handleClose:i}),e),close:n}})(n),h=So(u.open),p=yo(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=Ms(An(e));if(!pn(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:yt(n.phone)}},Ti("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await Eo({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(El).filter((e=>n[e])).map((e=>El[e]?.text));p.open(i,_o(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},Eo=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=Fo(n);await Js(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday: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:i,midname:a,birthDate:l&&xt(l,!0),email:s,phone:yt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Ti("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await Zs((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,birthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&xt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:Ro({phone:o&&yt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},_o=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:yt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${zo(t)}`}),zo=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,Fo=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},Vo=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Jr(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:Oo(a),addressFact:Oo(l),esiaAccountTypeCd:t?.esiaAccountType}},Oo=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||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:i?.key,fullAddress:m}},Lo=e=>{const[t,n]=i(!1),[r]=$s("profileId"),[s,o]=$s("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Ti("/esia/updateProfileEsia","POST",t));n&&o({...s,...Vo(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},qo=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=Lo(l),[f,x]=$s("leadForm"),y=Gs(m,f),{handleSubmit:b,responseStatus:v}=Ao({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){Ds({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=zt(y,{onSubmit:b});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(Vt,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(oi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Bs(e.columns),"grid gap-x-m"),children:[Ps(e.title),Hs({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),Xs(s)]})})})),jo=d((({title:e,description:t})=>{const n=Ce();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"})]})})),$o=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",Uo=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function Wo(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const Ho=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:Wo(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(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===i),ref:h,role:"listitem",children:d})})),Yo=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],Ko=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=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(Xo(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?Go(c,v):{},...N?Uo(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(Ho,{className:u(m,a?Yo[a-1]:"",{"h-full":N},t),style:w?Go(c/4):{},activeIndex:i,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})),Go=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Xo=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),Jo={"horizontal-list":"w-6","vertical-list":"h-6"},Zo=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?Jo[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Qo=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"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=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"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(i))},ec=e=>e,tc=(e=ec)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),nc=tc(),ic=(e=ec)=>tc((t=>-e(t))),ac=ic(),lc=e=>t=>e.scrollWidth/t,rc=e=>(t,n)=>{e.scrollBy({left:n*lc(e)(t),behavior:"smooth"})},sc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[ic()(a),tc()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?rc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?rc(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}]},oc={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},cc=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Ce(),[h,p]=sc({itemCount:s.length}),g=dc(Boolean(s?.length));a((()=>{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(Ko,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Qo({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",oc[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Zo({activeIndex:t,onClick:f,listType:i}))}):null})),dc=(e=!1)=>({behavior:e?"auto":"smooth"}),mc=d((({className:e,disabled:t,...n})=>o(be,{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"})}))),uc=d((e=>o(mc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),hc=d((e=>o(mc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),pc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",gc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?fc(t):null,l?o(uc,{className:u(xc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(hc,{className:u(xc(a),m?"right-1":"right-0"),onClick:d}):null]})})),fc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(pc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(pc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),xc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),yc=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=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]=sc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(Ko,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(gc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(cc,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),bc=({blocksToRender:e,...t})=>o(yc,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",$o(!0)),children:B(e,t)},String(n))})}),vc=e=>e%2!=0,Nc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),wc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Nc,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(Me,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Cc=({isUnfolded:e,onToggle:t})=>o(wc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Sc=["ArrowDownIcon","ArrowUpIcon"],kc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Tc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(kc),children:[R(l,{...a.options,parent:n}),vc(l.length)?o(gt,{className:"col-span-6",...a}):null]}),o(Ri,{renderFoldableSection:({isUnfolded:e})=>c(Di,{className:u(kc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),vc(r.length)?o(gt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(wc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Sc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Ic=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Bc(n,t),Tc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Bc(n,t),bc({...i,blocksToRender:t})]});default:return null}})),Bc=(e,t)=>e&&!t.length?o(jo,{...e}):null,Pc=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),Rc=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(zr,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),Dc=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>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,Pc(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(Mc(i)).filter(Boolean))]}),n?o("div",{children:o(ga,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),Mc=e=>([t,n])=>{const i=n?.type;return"array"===i?Ac(t,e)(n):null},Ac=(e,t)=>n=>{const i=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(Me,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(Rc,{items:i,multiple:!n?.single,...t(e)})]},e)};function Ec(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const _c=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,zc=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>_c(t[e])||_c(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||Fc(t[e])<=Fc(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>_c(t[e])||_c(n[e])||Fc(t[e]?.min)>=Fc(n[e]?.min)&&Fc(t[e]?.min)<=Fc(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>_c(t[e])||_c(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),Fc=e=>Number(e||0),Vc=(e,{block:t,page:n,normalize:i=_t})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=zt(e),d=r((()=>Ec(a,a.map((e=>mt(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=_t)=>e?.filter((([,e])=>zc(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},Oc={},Lc={},qc=ht((({className:e,filtrationSchema:t=Oc,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=Vc(Lc,{block:a.block,page:a.options?.page}),d=o(cn,{className:"w-64",label:n?.title,options:jc(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>jc(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Dc,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(ga,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Ic,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),jc=e=>Ec(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),$c=(e=!1)=>e?"text-left":"text-center",Uc={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},Wc=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",Uc[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),Hc=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Ce();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:$c(a),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(Yc)}):null]})})),Yc=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(Wc,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(Me,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(Re,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),Kc=(e,t,n)=>{return o(yc,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>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(Me,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(Me,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},Gc=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?Kc(e,0,t):null]}))),Xc={start:"justify-start",center:"justify-center",end:"justify-end"},Jc=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Xc[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:Le(e)})})),Zc=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Qc="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",ed="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",td="flex flex-col gap-y-xl min-w-52",nd=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(Me,{size:"text-h3",children:"number"==typeof e?[i,Ue(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),id=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(Me,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(nd,{value:n,...a}):o(Me,{size:"text-h3",children:"-"})]}))),ad=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,ld=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(Me,{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:Ue(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),rd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(Me,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),sd=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="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(ld,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(id,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(rd,{title:e,...r}),od=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(La,{items:e?[`От ${Ue(1)(i.min||0)} ${n}`,`До ${Ue(1)(i.max||0)} ${n}`]:[],step:t,...i}),cd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},dd={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},md=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=cd.prefMonthsNum,prefTravelBonusRate:l=cd.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||dd,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},ud=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=zt({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=md(r,n);return o(Zc,{className:e,title:t,...l,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),od({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?sd({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:td,children:[f>=0?o(id,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,Le(i,{isVertical:!0}),ad(a)]})]})})})),hd=Math.round(29.5),pd=(e,t=0)=>e?.sum?e.sum:t,gd=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,fd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,xd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,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(Me,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(Me,{color:"text-secondary-text",font:"font-light",children:n})}):null,o($l,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),yd=e=>xd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),bd=" (c капитализацией)",vd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:td,children:[o(id,{title:`Доход в конце срока${l?bd:""}`,value:e,postfix:n,prefix:"+"}),o(id,{title:`Сумма в конце срока${l?bd:""}`,value:t,postfix:n}),Le(i,{isVertical:!0}),a?.map(ad)]}),Nd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:wd([e,t],i),wd=([e,t],n=[])=>({[e]:n.length?ac(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?nc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Cd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Sd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const kd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Td=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Sd[e?.rateType]:"",{data:n}=$n(t?`/api/v1/depositrates/${t}`:null,st);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Id(s,e)&&Cd(i,["minSum","maxSum"],e)&&Cd(n,["minDays","maxDays"],e)))||kd,{rate:m}=d,u=Bd(m,e),h=i+u,p=c||[kd];return{...d,...wd(["minSum","maxSum"],p),...wd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Id=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Bd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},Pd=ht((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=zt({moneyValue:pd(r,1e5),daysValue:gd(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Td(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Zc,{className:e,title:t,...d,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({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(La,{items:[`От ${fd(b.min||0)}`,`До ${fd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[Rd(p,h),yd({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),sd({rate:x,depositeName:y,isShowDepositeName:l}),vd({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),Rd=(e,t)=>c("div",{className:"space-y-s",children:[o(Me,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ti,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ti,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),Dd=(e=[],t=!1)=>Md([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),Md=(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]},Ad=({min:e=0,max:t=0,availableMonths:n,...i})=>o(La,{items:[`От ${Ed(e)}`,`До ${Ed(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),Ed=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,_d=e=>xd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),zd=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(_a(t?.[a],n.minMonths,n.maxMonths))},Fd=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},Vd={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},Od=e=>Ld({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Ld({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&Ld({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&Ld({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Ld=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],qd=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[Vd],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Nd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Nd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>Od({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i,["minSum","maxSum"],e)&&Cd(a,["minMonths","maxMonths"],e)))||Vd)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=Fd(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},jd=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),$d={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},Ud=ht((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,Md([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=zt({moneyValue:pd(s,2e5),monthsValue:gd(s,hd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=qd(g,n,r),b=_d({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(_a(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(_a(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!jd(s)&&h&&zd({field:f,defParams:h,calcParams:y,map:$d,monthsValue:"minMonths"})}),[n,s]),o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),Ad({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),Wd({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),Le(i,{isVertical:!0}),ad(l)]})]})})})),Wd=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ti,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ti,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),Hd=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},Yd={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},Kd=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?Jd(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=>[Xd({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Xd({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Xd({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Xd({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Cd(i,["minSum","maxSum"],t),Cd(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||Yd,{rate:u}=m,h=Gd(u,e),p=i+h,g=t||[Yd];return{...m,...wd(["minSum","maxSum"],g),...wd(["minMonths","maxMonths"],g),availableMonths:Hd(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},Gd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Xd=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],Jd=(e,t)=>e+Math.round((t-e)/2),Zd=(e="rub")=>"rub"===e,Qd=(e,t)=>{const{minMonths:n,maxMonths:i}=wd(["minMonths","maxMonths"],im(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:_a(a,n,i)}},em=(e,t)=>{const{minSum:n,maxSum:i}=wd(["minSum","maxSum"],im(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:_a(a,n,i)}},tm=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),nm=e=>{const t=Zd(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},im=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},am=(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?xd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?xd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),lm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?yd({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},xd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),lm(e.isShowNewClient),e.isShowNewClient?o(ti,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},lm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,rm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},sm={text:"₽",key:"rub"},om=ht((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[sm],g=l((e=>t=>e?{...t,...nm(t),...em(t,e),...Qd(t,e),...tm(t,e)}:t)(h),[h]),[f,{field:x}]=zt({moneyValue:pd(d,2e4),monthsValue:gd(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:sm},{normalize:g}),y=x?.("currency")?.value??sm,b=x?.("isNewClient")?.value,v=im(h,y),N=Kd(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,T=l((()=>{zd({field:x,defParams:Dd(v,b),calcParams:N,monthsValue:"minMonths",map:rm})}),[x,h]);a((()=>{!jd(d)&&v&&T()}),[d,h]);const I=w===Dd(v,b)?.rate;return o(Zc,{className:e,title:t,...m,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[c("div",{className:"flex gap-m",children:[od({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:cm(y?.key)}),h&&h?.length>1?o(hn,{label:"Валюта",options:p,...x("currency")}):null]}),Ad({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),am({...N,...s},x)]}),sd({rate:w,children:mm(T,I)}),vd({income:C,finalSum:S,buttons:[...i,dm(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),cm=(e="")=>Zd(e)?1e3:100,dm=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},mm=(e,t=!1)=>t?null:o(ga,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),um=e=>hm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&hm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),hm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],pm={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},gm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[pm],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Nd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Nd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>um({row:e,userInputParams:t,paramsViewSettings:n})&&Cd(i+r,["minSum","maxSum"],e)&&Cd(l,["minSumOld","maxSumOld"],e)&&Cd(r,["minSumExtra","maxSumExtra"],e)&&Cd(a,["minMonths","maxMonths"],e)))||pm)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=Fd(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},fm=ht((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=zt({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=gm(s,n,l),h=_d({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Zc,{className:e,title:t,...r,children:c("section",{className:u(Qc,e),children:[c("div",{className:ed,children:[od({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),od({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),Ad({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),xm({...m,...l},d),m.isExtraMoney?od({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(td,"@4xl:w-1/2"),children:[o(id,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(id,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(id,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(id,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),Le(i,{isVertical:!0}),ad(a)]})]})})})),xm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ti,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ti,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ti,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),ym=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=Ea(e,{normalize:(e=a)=>n&&i?String(_a(Number(bm(e)),n,i)):bm(e),format:Ue(r)}),d=l((e=>t&&t(bm(e))),[t]);return o(Yt,{onChange:d,...s,...c})})),bm=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),vm=d((e=>o(ym,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(Me,{size:"text-xl",font:"font-light",children:"₽"})})}))),Nm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},wm={amount:1500},Cm=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=zt(wm),[h,p]=i(!1);return a((()=>{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:Nm[r],children:[o(vm,{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(ga,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Sm=({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})]}),km="relative h-full",Tm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Im=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(Rm),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:Bm(n,{someCardsHighlighted:l}),children:[B(n,i,{className:Pm(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),Rm(n)?Sm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Bm=(e,{someCardsHighlighted:t})=>u(km,t&&(Rm(e)?"pt-3xl":"pt-3xl sm:pt-16")),Pm=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(km,"min-w-80",Tm[i],t&&(Rm(e)?"pt-3xl sm:pt-16":"pt-3xl"),$o(n),n&&"h-full"),Rm=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,Dm=ht((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o(yc,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?Mm(s?.block?.blocks):[],hasBlur:!0,children:Im({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),Mm=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],Am="z-10 border border-solid w-full h-full",Em=u(Am,"absolute hidden @xl:block border-transparent"),_m=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(Em,"top-9 right-12 bg-green-dark")}),o("div",{className:u(Em,"top-6 right-8 bg-green")}),o("div",{className:u(Em,"top-3 right-4 bg-green-light")}),c("div",{className:u(Am,"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}),Le([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),zm={black:"bg-black",white:"bg-white"},Fm=d((({className:e="",title:t,description:n,image:i,price:a,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(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:Le([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(Me,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(Vm)]}):null,a?c(Me,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),Vm=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${zm[e]}`},String(t)),Om=d((({icon:e,...t})=>{const n=ue(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,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:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),Lm=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...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:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?qm(i):null]})}))),qm=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(Om,{...e},String(t))))}),jm=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),$m=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=ue()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...pe(a),children:l})})),Um=[{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"}}],Wm=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>Um.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Oe(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&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},Hm(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:Le(m,{className:Ym(s??!1,a??!1,n),buttonClassName:h})}),r?o(Me,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),Hm=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",Ym=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),Km=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,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($m,{href:a,target:m,className:"h-full",data:jm(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Je(Oe(l)?o(ne,{image:l}):null,x),buttons:d.length?o(Wm,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Ve,{benefits:f}),s?o(Re,{__html:s,isDotted:r,itemSize:"list-s"}):null,Gm(i,p)]})})}))),Gm=(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,Xm=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(Me,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(Me,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:Le(a)}):null]},String(t))},Jm=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(Xm),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>ce.subscribe("fold",(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:[Oe(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(be,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(Ri,{renderFoldableSection:()=>c("div",{children:[x,o(Di,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Zm(m?.parent,h,b):null}):o("div",{children:x})]})})),Zm=(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&&ce.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?pe(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Qm=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const i=async()=>{const n=await Ii("/auth/refresh","POST",{refresh_token:e,access_token:t});if(n){eu(n.status);const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const a=setInterval(i,24e4);return()=>clearInterval(a)},eu=e=>{401==e&&(globalThis.location.href="/")},tu=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]})]}))),nu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=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(tu,{step:i,showPercentage:!1})]})})}));var iu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(iu||(iu={}));const au=e=>Ti("/user-data/getTaskStatus","POST",e),lu=e=>Ii("/user-data/sendSignalToProcess","POST",e),ru=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>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(Re,{__html:e}),i?.text?o(be,{className:"text-primary-main",children:i.text}):null]})]}))),su=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(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(so,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(Re,{__html:a}):null]})]})})),ou=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,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(su,{interval:d}):null]}),o(cu,{title:i,items:a}),o(cu,{title:l,items:r,countColumns:!0}),n?.__html?o(ru,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),cu=({title:e,items:t,countColumns:n=!1})=>{const i=Ce();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(Me,{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",Bs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:du(e)},t)))}):null]})]}):null},du=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),mu=d((()=>o(ou,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),uu=d((()=>{const[e]=$s("leadForm");return o(ou,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),hu=d((()=>{const[e]=$s("leadForm");return o(ou,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),pu=d((()=>{const[e]=$s("leadForm");return o(ou,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),gu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],fu=d((()=>{const[e,t]=i(iu.process),[n]=$s("taskId");return a((()=>{(async()=>{for(const e of gu)await lu({signalType:e,taskId:n})})();const e=l((async()=>{const e=await au({taskId:n});e&&e?.statusCd!==iu.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),xu(e)})),xu=e=>({IN_PROCESS:o(uu,{}),CANCELLED:o(mu,{}),APPROVED:o(pu,{}),REVISION:o(hu,{})}[e]||null),yu=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday: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:""},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:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],bu=e=>{if(e)try{return new Date(e)}catch(e){return}},vu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Nu(n,e),wu(t,e),Cu(t,e),Su(t,e),ku(t,e),Tu(t,e)].some(Boolean)?{...t,required:!1}:t)),Nu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,wu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Cu=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Su=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ku=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Tu=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Iu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ru,{__html:e},`${t}_${n}`))):null},Bu=({field:e,inputs:t})=>t.map(Is(e,"")),Pu=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=vu(Ru(t))(e,n),s=r.filter((e=>!Tu(e,Ru(t))));return c("div",{className:u(Bs(i),"grid gap-x-m"),children:[Iu(s),Ps(a),Bu({field:t,inputs:r})]},`section-${l}`)})),Ru=e=>t=>e(t)?.value,Du=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(ga,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ga,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),Mu=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},Au=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",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:xt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Ro({phone:yt(l),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Ro({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:Mo({wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:Do({addressCourier:t})}})(t);default:return{}}},Eu=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=$s("taskId"),[s]=$s("profileId"),[o]=$s("participantId"),c=l((async l=>{const c=Ms(An(vu(_u(l))(t,e)));if(console.log(An(vu(_u(l))(t,e))),!pn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await Zs((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Au(a,i)}],...Mu(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},_u=e=>t=>e[t],zu=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=$s("leadForm"),u=((e,t)=>({...yu[e],...t,birthday:bu(t?.birthday),dulIssueDateField:bu(t?.dulIssueDateField),participantDateRegistration:bu(t?.participantDateRegistration),beginDate:bu(t?.beginDate),deliveryDate:bu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=Eu({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=zt(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(fu,{}):c("form",{onSubmit:y,className:"space-y-m",children:[Pu({sections:t,field:x,step:e,registerSubmit:g}),o(Du,{step:e,onPrevStep:n})]})})),Fu=[[{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}]}],[{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:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!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"},{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:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{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:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{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:"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"}]}],[{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"]}}]}]],Vu=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],Ou=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Qm,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>Fu[n]),[n]),[y,b]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(nu,{stepsTitles:Vu,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(zu,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),Lu=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=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(tu,{step:i,showPercentage:!1})]})})})),qu=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,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(su,{interval:d,intervalExpireAction:m}):null]}),o(ju,{title:i,items:a}),o(ju,{title:l,items:r,countColumns:!0}),n?.__html?o(ru,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(be,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),ju=({title:e,items:t,countColumns:n=!1})=>{const i=Ce();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(Me,{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",Bs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:$u(e)},t)))}):null]})]}):null},$u=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(Me,{color:"text-secondary-text",size:"text-l",children:e}),o(Me,{color:"text-primary-text",size:"text-xl",children:t})]}),Uu=d((()=>o(qu,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Wu=d((({handleExpireTimer:e})=>{const[t]=$s("leadForm");return o(qu,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),Hu=d((()=>{const[e]=$s("leadForm");return o(qu,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Yu=d((()=>{const[e]=$s("leadForm");return o(qu,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Ku=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],Gu=d((()=>{const[e,t]=i(iu.process),[n]=$s("taskId");a((()=>{(async()=>{for(const e of Ku)await lu({signalType:e,taskId:n})})();const e=setInterval((()=>n&&au({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==iu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Xu(e,(()=>t(iu.rework)))})),Xu=(e,t)=>({IN_PROCESS:o(Wu,{handleExpireTimer:t}),CANCELLED:o(Uu,{}),APPROVED:o(Yu,{}),REVISION:o(Hu,{})}[e]||null),Ju=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday: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:"",addressRetail:void 0,bankEmployeeCode:void 0}],Zu=e=>{if(e)try{return new Date(e)}catch(e){return}},Qu=e=>(t,n)=>t.filter((e=>e)).map((t=>[eh(n,e),th(t,e),nh(t,e),ih(t,e),ah(t,e),lh(t,e)].some(Boolean)?{...t,required:!1}:t)),eh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,th=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,nh=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),ih=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,ah=({name:e},t)=>"addressFact"===e&&t("addressMatch"),lh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),rh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(ru,{__html:e},`${t}_${n}`))):null},sh=({field:e,inputs:t})=>t.map(Is(e,"")),oh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Qu(ch(t))(e,n);return c("div",{className:u(Bs(i),"grid gap-x-m"),children:[rh(r),Ps(a),sh({field:t,inputs:r})]},`section-${l}`)})),ch=e=>t=>e(t)?.value,dh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(ga,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(ga,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),mh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},uh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},hh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:uh[i?"annuity":"differential"]}},ph=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",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:xt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:xt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:xt(g,!0),houseTypeCd:f,participantContacts:Ro({phone:yt(l),email:r}),participantAddresses:Do({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:Ro({organizationPhone:h&&yt(h)}),participantAddresses:Do({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:a,otherDependents:n,participantIncomes:Mo({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},gh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=$s("taskId"),[s]=$s("profileId"),[o]=$s("participantId"),c=l((async l=>{const c=Ms(An(Qu(fh(l))(t,e)));if(!pn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await Zs((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...ph(a,i)}],...hh(i),...mh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},fh=e=>t=>e[t],xh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=oh,isFormFinished:r,finishForm:d})=>{const[m,u]=$s("leadForm"),h=((e,t)=>({...Ju[e],...t,birthday:Zu(t?.birthday),dulIssueDateField:Zu(t?.dulIssueDateField),participantDateRegistration:Zu(t?.participantDateRegistration),beginDate:Zu(t?.beginDate),deliveryDate:Zu(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=gh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=zt(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(Gu,{}):c("form",{onSubmit:b,className:"space-y-m",children:[a({sections:t,field:y,step:e,registerSubmit:f}),o(dh,{step:e,onPrevStep:n})]})})),yh=[[],[{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:"birthday",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"},{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:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{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:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{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"}]}],[{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"}]}]],bh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],vh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Qm,[]);const p=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>yh[n]),[n]),y=0===n,[b,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(Lu,{stepsTitles:bh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(xh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,renderStep:y?({registerSubmit:e,field:t})=>o(Ud,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Nh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,wh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Ch=1e9,Sh={sum:{min:1e4,max:Ch},period:3},kh=ht((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=Vc(Sh,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Th(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Ih(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(Dc,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(vm,{label:i?.title,min:500,max:Ch,...d("sum",{parse:e=>({min:Number(e),max:Ch}),format:({min:e})=>String(e)})}),o(La,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Ic,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Th=e=>ot((e?.paramsSource?.rateRows||[]).filter(Nh).flatMap((e=>wh(e.minMonths,e.maxMonths)))),Ih=e=>ot(e.flatMap((e=>e||[])).filter(Nh).flatMap((e=>wh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Bh=[{key:"10"},{key:"50"},{key:"100"}],Ph=({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(cn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Bh,iconVersion:"black"})]})},Rh="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",Dh=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=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!==a&&((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,a)?o("div",{onClick:()=>i(l),className:Rh,"aria-label":`Страница ${l}`,children:l},String(t)):null},Mh={width:"24",height:"24"},Ah=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=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:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eh(1===e),...Mh})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:Rh,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(Dh),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:Rh,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:Eh(e===n),...Mh})})]})},Eh=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",_h=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(Ah,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(Ph,{itemCount:i,onItemCountChange:a}):null]}),zh=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);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",Wt),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),Fh=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(zh,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(vl,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(vl,{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(ga,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),Vh=(e,t)=>o(Wc,{...e,iconBgVersion:t,className:"shrink-0"}),Oh=({title:e,timestamp:t,publicId:n})=>{const i=ue(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[Vh({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(Me,{size:"text-m","font-weight":"font-light",children:xt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},Lh="/api/v1/depository",qh={startDate:void 0,endDate:void 0,query:""},jh=ht((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=zt(qh),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?xt(i,!0):"",r=a?xt(a,!0):"",s=new URLSearchParams(Lh);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}=$n(Lh+o,st);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(Fh,{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(Me,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(Me,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(Oh,{...e},String(e.publicId)))):o(jo,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(_h,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),$h=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,Uh=d((({className:e="",title:t,description:n,error:i,button:a,...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:$h(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(be,{version:a?.version,text:a?.text,...a}):null]}))),Wh="location";function Hh(e="Москва"){const[t,n]=((e,t,n)=>{const[r,s]=i(n||null);return a((()=>e.subscribe(t,(e=>s(e)))),[e,t]),[r,l((n=>e.fire(t,n)),[e,t])]})(ce,"location",Kh()??{name:e}),r=l((e=>{Gh(e),n(e)}),[]),{data:s}=$n(Yh()?null:"/api/v1/region",st);return a((()=>{s&&!Yh()&&n(s)}),[s]),[t??{name:e},r]}const Yh=()=>Boolean(globalThis.localStorage?.getItem(Wh)),Kh=()=>{try{const e=globalThis.localStorage?.getItem(Wh);return e&&JSON.parse(e)}catch(e){return null}},Gh=e=>{try{globalThis.localStorage?.setItem(Wh,JSON.stringify(e))}catch(e){}};var Xh;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Xh||(Xh={}));const Jh=new Intl.NumberFormat("ru",{style:"currency",currency:Xh.RUB}),Zh=e=>e?Jh.format(e):"",Qh="text-m font-light text-secondary-text ",ep=`${Qh} text-left`,tp=`${Qh} pl-5xl text-center`,np=`${Qh} pl-5xl text-right`,ip={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},ap=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:ep,children:o(Me,{size:"text-m",children:"Валюта"})}),o("th",{className:tp,children:o(Me,{size:"text-m",children:"Купить"})}),o("th",{className:np,children:o(Me,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(lp)})]}))),lp=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:ip[t]},width:"24",height:"24"}):null,o(Me,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(Me,{size:"text-h6",children:Zh(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(Me,{size:"text-h6",children:Zh(e?.buyExchangeRate)})})]},t)},rp={icon:"GpsIcon"},sp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(Wc,{...rp,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:"Курс указан для заданного офиса"})]})]}))),op=(e,t,n)=>{const i=Number(cp(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},cp=e=>e.replace(/[^\d.,]/g,"").replace(",","."),dp=e=>Pt([[e=>e.value!==Xh.RUB&&e.oppositeValue!==Xh.RUB,()=>e.handleConvert(e.value,Xh.RUB)],[e=>e.value===Xh.RUB&&e.oppositeValue===Xh.RUB,()=>e.handleConvert(e.value,Xh.USD)],[e=>e.value===Xh.RUB&&e.oppositeValue===Xh.RUB,()=>e.handleConvert(e.value,Xh.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function mp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(Yt,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(cn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const up=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Xh.RUB,selectBuy:n?.[0]?.currency?.currency||Xh.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:[mp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:hp(r,d,n),value:r.inputSell,setValue:e=>gp(d,n)(e,r.selectSell,r.selectBuy)}),mp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:pp(r,d,t),value:r.inputBuy,setValue:e=>fp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(be,{text:a.text,version:a?.version,...a}):null]})})),hp=(e,t,n)=>i=>{t({selectSell:i}),dp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{gp(t,n)(e.inputSell,i,a)}})},pp=(e,t,n)=>i=>{t({selectBuy:i}),dp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>fp(t,n)(e.inputBuy,i,a)})},gp=(e,t)=>(n,i,a)=>{e({inputSell:cp(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(op(n,l,i===Xh.RUB)||"")})},fp=(e,t)=>(n,i,a)=>{e({inputBuy:cp(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(op(n,l,i===Xh.RUB)||"")})};const xp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const[a]=Hh(),l=function(e){const t=e?.code||"000",{data:n}=$n(`/api/v1/exchangerates?regionCode=${t}`,st);return n||{}}(a),r=yp(l?.exchangeRate?.currencies),s=r.filter((e=>e.buyExchangeRate));s.unshift({currency:{currency:Xh.RUB}});const d=r.filter((e=>e.saleExchangeRate));return d.push({currency:{currency:Xh.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{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:[r?o(ap,{className:"mb-xl",exchangeCurrencyItems:r}):null,o(sp,{address:l?.address})]}),o(up,{className:"grow w-1/2",currencyRatesBuy:s,currencyRatesSell:d,button:n})]})})})})),yp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],bp=d((({className:e="",items:t})=>{const n=ue();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(vp(n))})})),vp=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...pe(t),children:a||null})},String(i)):null},Np=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Nc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[Vh(a,t),e?o(Me,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),wp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Cp=(e=!1)=>e?"MinusIcon":"PlusIcon",Sp=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",kp=ht((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Ce();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(Ri,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(Di,{className:u("gap-lg",wp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Tp({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),Tp=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?Sp(e):Cp(e))(a,r);return"accordion"===e?o(Np,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(wc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},Ip=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:Bp(e)}))),Bp=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(kp,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(bp,{items:e.items}):null},String(t)))),Pp=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(Rp)}):null)),Rp=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(Me,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(Dp)})]},String(t)),Dp=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:Mp(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),Mp=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${Ap(t)}`,children:o(Me,{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})}},Ap=e=>e.replaceAll(/\D/g,""),Ep=d((({className:e="",index:t,text:n,...i})=>{const a=ue(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),_p=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(Me,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(Ep,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),zp=d((({className:e="",index:t,...n})=>{const i=ue(),{href:a,target:l,text:r,onClick:s}=i(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:a,target:l,onClick:s,children:r||`Документ ${t}`})})),Fp=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(Me,{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(zp,{index:t,...e},String(t))))}):null]}))),Vp=ht((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:a,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(Ip,{navigationItems:i}),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(Pp,{items:r}),m?o(be,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(Wm,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(be,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(_p,{title:d,links:l}),o(Fp,{links:a,license:h})]})})),Op=ht((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.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 max-w-[978px] space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(hn,{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(be,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:jm(l,s?.key),children:f})}):null]})})})),Lp={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"},qp=d((({version:e,text:t,mobileText:n,...i})=>{const a=Ce()?n:t;return a?o(be,{className:u("py-s px-lg font-light whitespace-nowrap",Lp["transparent"===e?"transparent":"default"]),...i,children:a}):null})),jp=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=M(),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(lo,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):$p(p,r),o(qp,{version:a,...i})]})})),$p=(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,Up={"bg-white":"primary",transparent:"transparent"},Wp=ht((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=Up[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(jp,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),Hp=(e=!1)=>e?{}:{padding:"p-0"},Yp={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Kp=ht((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",Yp[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",$o(r)),...Hp(i)}})})}),{childrenTypes:[]}),Gp=ht((e=>o(Kp,{...e})),{childrenTypes:[]}),Xp=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Xc[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Jp=["байт","Кб","Мб","Гб","Тб","Пб"],Zp=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";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:i,...pe(l),children:[e,t?c(Me,{size:"text-l",font:"font-light",children:[t," ",Qp(d,m),o(Me,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Qp=(e,t)=>e||t?o("span",{children:", "}):"",eg=(e,t)=>(n,i)=>{const a=$(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))} ${Jp[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?ng(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Zp,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:tg(t),data:n?.data}),o(Re,{__html:n?.__html})]},String(i))},tg=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,ng=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},ig=d((({href:e,__html:t,target:n})=>{const{close:i}=de(),a=M(),r=$(a)(e),s=l((()=>{i()}),[]);return c(Fl,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(Re,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(be,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(ga,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),ag=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o(ig,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[tg(a),o(Me,{font:"font-light",children:e})]})})),lg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},rg=ht((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",lg[r]),role:"list",children:a.map(sg(d,l))}):null]})})),sg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?og(t)(n,i):eg(e,t)(n,i)},og=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(ag,{...i,icon:e,href:cg(t)?t?.href:t?.attachment?.src}),o(Re,{__html:t?.__html})]},String(n)):null},cg=e=>"href"in e,dg=ht((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,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(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:Le(i,{className:"flex-wrap"}),children:[a?o(Me,{size:"text-xl","font-weight":"font-light",children:a}):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(Re,{__html:r,itemSize:"list-m"}):null,o(Me,{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]})]})})})),mg=(e=[],t={})=>e.filter((({content:e={}})=>zc(t,e))).length,ug=(e,t)=>e===t;const hg=(pg=function(...e){return(t,n)=>e.some((e=>e(t,n)))}(ug,((e=ug)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))()),(e,t)=>e===t||Boolean(e&&t&&Object.keys(e).length===Object.keys(t).length&&Object.entries(e).every((([e,n])=>pg(n,t[e])))));var pg;const gg=[],fg={},xg={primary:"bg-white/30",secondary:"bg-main-divider"},yg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},bg=d((({count:e,version:t="secondary"})=>{const n=Ce(),i=n?"bg-main-divider":xg[t],a=yg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(Me,{size:"text-xs",color:a,children:e})})})),vg=({text:e,description:t,icon:n,isActive:i,type:a})=>{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"}))(i);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"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Ng={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},wg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Cg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Sg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},kg=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{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",Ng[i],n?Sg[i]:Cg[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?wg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[vg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(bg,{count:m,version:fa(n,i)})}):null]})})})),Tg=d((e=>o(e?.item?.href?Ig:Bg,{...e}))),Ig=d((e=>{const t=ue(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(kg,{...e,tag:"a",item:a,onClick:i})})),Bg=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(kg,{item:e,onClick:i,...n})})),Pg=(e,t,n)=>(i,a)=>o(Tg,{isActive:i===e,onClick:t,type:n,item:i},String(a)),Rg=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(Pg(i,a,t))}))),Dg={categories:[],extraOptions:[],propertyType:[],stage:[]},Mg=ht((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=Vc(Dg,{block:a.block,page:a.options?.page}),f=l(((e=Dg)=>p(e)),[]),x=(({hotFilters:e=gg,filtrationState:t=fg,blocks:n=gg,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>hg(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:mg(n,t.filter),version:fa(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(Rg,{...x}),o(Dc,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Ic,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),Ag=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:zg(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{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(Me,{size:"text-h4",children:zg(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(Me,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(Yi,{color:"green",children:zg(s)})})]}),o("div",{className:"hidden sm:block",children:o(zi,{className:"flex-wrap",children:m?.map(_g)})}),o(Ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Di,{isUnfolded:e,children:o(zi,{className:"flex-wrap",children:m?.map(_g)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ea({isUnfolded:e,onToggle:t})})]},String(d))},Eg=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${zg(t)} №${n}`,body:e.toUpperCase()}),_g=(e,t)=>o(Mi,{...e},String(t)),zg=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",Fg=[];const Vg=async e=>{const t=await rt(e,{method:"GET"});return Array.isArray(t)?t:Fg},Og={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},Lg={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)},qg=d((({descriptionData:e,className:t})=>{const[n]=Hh(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=$n(`/api/v1/atms?regionCode=${e}`,Vg);return{data:t||Fg,isLoad:!t&&!n}}(i);return o(Ta,{className:t,filterItems:jg,data:a,isLoad:l,initFilterState:Og,renderCard:Ag,getBalloon:Eg,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),jg=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>Lg[t](e))),n=!i.length||i.some((t=>Lg[t](e)));return t&&n}))},$g=({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(Me,{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(Me,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:Ug({workScheduleDescription:t})}),o(Ri,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(Di,{isUnfolded:e,children:Ug({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ea({isUnfolded:e,onToggle:t})})]},String(n)):null,Ug=({workScheduleDescription:e})=>c("div",{children:[c(zi,{className:"flex",children:[o(Mi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(Mi,{label:"Операции для физических лиц",children:o(Me,{children:"Оформление и обслуживание банковских карт"})}),o(Mi,{label:"Операции для физических лиц",children:o(Me,{children:"Инвестиционное и накопительное страхование"})}),o(Mi,{label:"Операции для физических лиц",children:o(Me,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(Mi,{label:"Режим работы",className:"max-w-none",children:o(Me,{children:e})})]}),Wg=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),Hg={branches:[],remoteWorkplaces:[]};const Yg=async e=>await rt(e,{method:"GET"})||Hg,Kg=d((({className:e})=>{const[t]=Hh(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=$n(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Yg);return{data:t||Hg,isLoad:!t&&!n}}(n);return o(Ta,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:aa,renderRemoteWorkplaceCard:$g,getBalloon:ra,getBalloonRemoteWorkplaces:Wg,title:`Офисы филиала ${t?.name}`})})),Gg=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Kg,{}):o(qg,{descriptionData:e})})})),Xg=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Jg=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o(yc,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Xe,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Zg=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Oe(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?Qg({__html:l,richVersion:r}):null,ef({label:"Адрес",data:e,iconName:"GeolocationIcon"}),ef({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),ef({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?Le([i]):null]})]}))),Qg=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(Re,{...e,itemSize:"list-s"})}),ef=({label:e,data:t,iconName:n,dataColor:i=""})=>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(Me,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(Me,{size:"text-xl",color:i,children:t})]})]}):null,tf=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(Re,{__html:t,richVersion:n})})})),nf=d((({name:e,text:t,value:n,checked:i,onChange:a,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(Wt.split(" ").filter((e=>"rounded"!==e)),Qn,"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:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(Me,{color:"text-primary-text",children:t}):null]})}))),af=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(nf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(nf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),lf=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(cn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),rf=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,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(lf,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(lf,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),sf=["От 1 дня","До 365 дней"],of=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(Me,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(La,{min:1,max:365,value:e,items:sf,onChange:t})]}))),cf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,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(lf,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(lf,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),df=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,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(rf,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:mf(m)}),o(of,{days:a,setDays:e=>m({days:e})}),o(cf,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:uf(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(Me,{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(af,{}),o(be,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),mf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},uf=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},hf=d((({days:e,tariffs:t=[]})=>{const n=gf(e,t),i="На рисунке изображена пачка листов\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:[pf("Аренда за",e),pf("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),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:i})})]})]})})),pf=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(Me,{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})]}),gf=(e,t)=>{const n=ff(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},ff=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},xf=(e,t)=>e.find((e=>e.branchCode===t)),yf=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=xf(i,n.selectedBranch),d=bf(s?.safeBoxCaseVolumes),m=vf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Nf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(df,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(hf,{days:n.days,tariffs:u})]})})),bf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],vf=(e,t)=>e?.find((e=>e.volume===t)),Nf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,wf=[];const Cf=async e=>await rt(e,{method:"GET"})||wf,Sf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=ls(),p=kf(m.selectedRegion,h),f=function(e){const{data:t}=$n(e?`/api/v1/safeboxes?regionCode=${e}`:null,Cf);return t||wf}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=xf(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:"",...a,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(yf,{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(wi,{points:y,className:"h-[640px]"}):null]})})),kf=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,Tf={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"},If=(e,t,n)=>(i,a)=>{const{button:l}=i;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:Bf(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[Pf(i),l?.text?o(be,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},Bf=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=Rf(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:Df({step:n,iconVersion:a,i:i,stepVersion:t})})})},Pf=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",Tf.description),children:e.description}):null,o(Re,{__html:e.__html})]}),Rf=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",Df=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Oe(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"===i?Tf.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},Mf=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.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"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(If(d,r,l))}):null,Le(a,{isVertical:!0})]})})),Af=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||""]}))),Ef=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=de(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full 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(zl,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),_f=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:a,rightItems:l})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?a:l,d=e?.current?.getBoundingClientRect();i(o(Ef,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?a[r].title:l[r].title})}}];function zf(e){throw new Error(e)}const Ff=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=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:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>ce.subscribe("dialog",(e=>{switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:zf(e)}}))),[c,d]),n},Vf=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=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++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),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 Of=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(Me,{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(Lf,{...e},String(t))))})]}):null,Lf=d((({icon:e,...t})=>{const n=ue(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(Me,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),qf=(e,t)=>n=>n.name?o($m,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:jm(e,n.name),children:o(Me,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,jf=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(Wt,"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"})]}))),$f=d((({foreignOffices:e,branches:t})=>{const[n,a]=Hh(t?.default),r=ue(),{href:s}=r({href:`/branches/${n.slug}`}),[d,m]=i(""),u=Wf(ls()).sort(((e,t)=>e.name.localeCompare(t.name))),h=((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(u,Uf),{close:p}=de(),g=l((e=>{a(e),p()}),[]);return c(Fl,{className:"pb-20",head:c("div",{children:[o(Me,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),n?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o($m,{href:s,className:"inline mx-2xs text-primary-main",children:n.name})]})}):null,o(jf,{onSearch:m,searchTerm:d})]}),children:[d&&d.length>=3?o("div",{children:u.filter((({name:e})=>e&&Vf(e.toLowerCase())(d.toLowerCase())>=.8)).map(qf(t?.dataSelect,g))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(h.entries()).map((f=g,x=t?.dataSelect,([e,t])=>c("div",{className:"break-inside-avoid mb-2xl w-56",children:[o("div",{className:"mb-s",children:o(Me,{size:"text-h6",children:e})}),t.map(qf(x,f))]},e)))}),Of(e)]});var f,x})),Uf=e=>e.name?.charAt(0)||"",Wf=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()||""}))),Hf=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const l=(e=>{const{open:t,close:n}=de();return{open:(n={})=>t(o($f,{...e}),n),close:n}})(n||{}),[{name:r}]=Hh(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open(),"reload"===e.data.type&&i(),"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)}}),[]),o(Ef,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),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})})})})),Yf="burgerMenuDialog",Kf=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:a})=>{const l=Ff(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Yf,l);return[r,{toggle:()=>{r?n():i(o(Hf,{locationDialogProps:a,menuRef:e,menuItem:t,closeAll:n}),{id:Yf})}}]},Gf=[],Xf=ht((({sticky:e,...t})=>{const{menuItems:n=Gf}=e??{},a=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]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=de(),v=l((()=>{p(-1),x(""),b()}),[b]),N=jt(v),w=s(null),[C,{toggle:S}]=Kf({menuRef:w,centralMenuItem:a,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:k}]=_f({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),T=l((e=>{v(),e.stopPropagation(),S()}),[v,S]),I=l(((e,t)=>{x(t),p(e),b(),k(e,t)}),[b,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Jf(I,"left",{activeIndex:h,currentItemPosition:f})),o(Af,{item:a,isActive:C,onClick:e=>T(e)}),u.map(Jf(I,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Jf=(e,t,n)=>(i,a,l)=>o(Af,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),Zf="hidden sm:flex absolute z-40",Qf={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},ex=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=sc({itemCount:t?.length||0});return a((()=>tx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(Ko,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Qf[l].item,gap:Qf[l].gap,children:t.map(Pg(n,i,l))}),s.canScrollLeft?o(uc,{className:u("left-6",Zf,Qf[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(hc,{className:u("right-6",Zf,Qf[l].buttonTop),onClick:s.scrollRight}):null]})})),tx=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},nx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},ix=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(nx[t].wrapper,e),children:o(ex,{className:nx[t].component,tabsType:t,...n})}):null,ax=ht((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=lx(n??{}),p=M(),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]=i(ox(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)));a((()=>{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=sx(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:[ix({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:rx(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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(sx)?.filter(Boolean)||[]}),lx=({__id:e,anchor:t})=>t??e??"tabs",rx=(e,t)=>t?.length?t:e,sx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",ox=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),cx={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},dx=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:cx[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),mx=d((({className:e="",isOpen:t,onClick:n})=>o(be,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),ux={Buttons:({buttons:e})=>Le(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(Re,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(Me,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(Me,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(mx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},hx=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return px({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),px=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in ux))return null;return o(ux[n],{...t,...i})},gx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,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(hx,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),fx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),xx=(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(Me,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,yx=d((({rows:e})=>{return o(Ko,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=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:[i?.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(Me,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${fx(a,t)}px)`},children:a?.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(Me,{size:"text-xl",children:e.data}):null,e?.cols?xx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),bx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`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(Me,{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(yx,{rows:t.rowsData})})})]},i)}))}))),vx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Nx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>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:()=>i(t),children:o(Me,{size:"text-xl",font:"font-light",color:vx(t===n),children:e||t+1})},e)))}):null,t?o(be,{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]}))),wx=ht((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Nx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(bx,{activeTabIndex:r,items:m}),o(mx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(Me,{size:"text-h6",children:"Данных нет"}),o(mx,{onClick:n,isOpen:!0})]})})),Cx=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(wx,{...t,onClick:n})}):null]}))),Sx=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(Cx,{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(Me,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(dx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(gx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function kx({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(mc,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(mc,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const Tx=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,kx({...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]})})),Ix=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a: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(Sx,{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(Ri,{renderFoldableSection:({isUnfolded:e})=>c(Tx,{controls:x,children:[b,o(Di,{isUnfolded:e,children:v})]}),renderFoldButton:Cc}):o(Tx,{controls:x,children:y})})]})})),Bx=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?Px():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(Me,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?Rx(n):null,a?o(Re,{richVersion:l,__html:a}):null]})]}))),Px=()=>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"}),Rx=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),Dx=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(Me,{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(Me,{size:"text-h2",children:n})}):null]}))),Mx=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(Dx,{prefix:t,unit:n,suffix:i})})})),Ax={AdTile:gt,ApplicationForm:qs,ApplicationLeadForm:qo,BankAccountFiltration:qc,BenefitsBlock:Hc,BonusBenefitsBlock:Gc,ButtonsBlock:Jc,CalculatorBonus:ud,CalculatorBusinessDeposit:Pd,CalculatorCredit:Ud,CalculatorDeposit:om,CalculatorRefinancing:fm,CardTransfer:Cm,Carousel:Dm,CarouselCard:_m,CarouselCatalogCard:Fm,CarouselLinks:Lm,CarouselRecommendationCard:Km,CarouselTariffsCard:Jm,CreditCardForm:Ou,CreditForm:vh,DepositFiltration:kh,Depository:jh,ErrorBlock:Uh,ExchangeRateTile:xp,Footer:Vp,GrantSupport:Op,Header:Wp,Headline:k,HorizontalLayout:Gp,ImgBlock:Xp,LinkDocs:rg,MobileAppTile:dg,MortgageFiltration:Mg,OfficesAtmsMap:Gg,Placeholder:Xg,ProductBlock:pt,ProductGallery:Jg,RepresentativeOfficeInfo:Zg,RichTextBlock:tf,RollupItem:kp,SafeDepositRental:Sf,StepsBlock:Mf,StickyBottomMenu:Xf,TabsLayout:ax,TariffsTable:Ix,TextBlock:Bx,UnitBlock:Mx,VerticalLayout:Kp},Ex=me((()=>{a((()=>{Tt()}),[]);const e=Et();qt(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");St({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const _x="cookie",zx=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=Lt();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(_x)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(_x,"true"),i()}),[]);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(Re,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(zl,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null})),Fx=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=Ff({onCloseAll:e,onClose:t}),{close:i}=de(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return qt(globalThis.document,"keydown",r),a((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),Vx=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>ce.subscribe("popup",(e=>{switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:zf(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return qt(globalThis.document,"keydown",r),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})),Ox="header",Lx="footer",qx="sticky-footer",jx={},$x=d((({className:e,data:t=jx,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=ut(s,r);Ex();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:Ox})}):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"}}),R(a?.footer,{...m,slotName:Lx})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:qx})}):null,o(Fx,{}),o(Vx,{}),o(zx,{__html:d?.cookieContent?.__html})]})}));Object.assign($x,{childrenTypes:[],slots:()=>[Ox,Lx,qx]});e.Blocks=Ax,e.ContentPage=$x,e.handlerDecorator=me,e.joinList=Pc,e.packageVersion="0.14.673",e.projectSettings=E,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UniMobileBlocks={})}(this,(function(e){"use strict";let t;const n=e=>(...n)=>t[e](...n),i=n("useState"),a=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:i,...a}=t||{},l=n?.slots?.default,r=i||l&&l();return e(Object.assign(a,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:i="p-xl",padding:a,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],a||i,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:i,children:a})=>{const l=v[n]||"h3";return o(l,{role:"heading",className:u("font-sans m-0",N[t],e),children:i||a})})),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:i,description:a,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:[i?o(w,{className:u("whitespace-pre-wrap",l),...h?.title,as:r||h?.title.as,title:i}):null,a?o(C,{size:h.descriptionSize,font:h.descriptionWeight,align:l,...p,children:a}):null]})})),I=({blockClassName:e,block:t,render:n})=>n({blockClassName:e,block:t}),T=[];function B(e,t,{className:n,...i}={}){const{key:a,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,...i},a):null}},a)}const P=[],R=(e,{key:t,ancestors:n=P,slotName:i=null,extraProps:a,renderProps:l=B,...r})=>{const s=a?(e,t)=>B(e,t,a):l;return(e||[]).map(((e,a)=>s(e,{...r,key:`${t||e.type}-${a}`,ancestors:r.parent?[...n||P,[r.parent,i]]:n},a)))};function D({block:e,options:t,children:n,extraProps:i,renderProps:a}){return n||(e&&t?R(e.blocks,{...t,parent:e,extraProps:i,renderProps:a}):null)}function M(){return M._impl()}M._impl=()=>({isReady:!1,href:globalThis.location?.href||"/",pathname:globalThis.location?.pathname||"/",query:{},push:()=>{},replace:()=>{},back:()=>{}}),M.setup=e=>{M._impl=e};const _=["CDN","BASE_PATH"],A=new Proxy({_:{},setup(e){this._=e}},{get(e,t){const n=e._[t]||e[t];return _.includes(t)?(e=>e&&!e.endsWith("/")?`${e}/`:e)(n):n}}),E=e=>Boolean(e?.includes(":")),z=(e,t)=>Boolean(e&&!E(e)&&(!t||"_self"===t)),F=e=>Boolean(e?.startsWith("#")),V=(...e)=>e.filter(Boolean).join("/").replace(/\/+/g,"/").replace(/^(.+):\//,"$1://").replace(/^file:/,"file:/").replace(/\/(\?|&|#[^!])/g,"$1").replace(/\?/g,"&").replace("&","?"),O=(e,t)=>!(!e||!t)&&(!!e.startsWith(t)&&["/"===t,e===t,"/"===e[t.length]].some(Boolean));var L=Object.freeze({__proto__:null,isURL:E,isLocalURL:z,isHash:F,withoutQuery:e=>(e||"").replace(/\?.*/,"").replace(/\/$/,""),joinPath:V,hasPrefix:O});const j="/api/",q=`${j}v1/storage`,$=e=>(t,n)=>{if([!t,E(t),F(t),[A.CDN,j].some((e=>O(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`${q}/${t}/attachment`;const i=t?.startsWith("/");return V(O(t,n)?"":n,i?"/":e.pathname?.split("/").slice(0,-1).join("/"),t)},U={"":"",normal:"",color:"text-primary-main",black:"text-black",white:"text-black",gray:"text-gray"},W=d((({className:e="",imageClassName:t="",name:n="",alt:i=`Иконка ${n}`,title:a=i,iconVersion:l="color",width:r,height:s})=>{const d=M(),m="normal"===l?`${n}.svg`:`sprites.svg#${n}`,h=$(d)(V(A.CDN,"/icons/",m));return"normal"===l?o("img",{className:e,src:h,alt:i,title:a,"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:[a?o("title",{children:a}):null,i?o("desc",{children:i}):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&&!E(t)?$(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 i=M();return c("picture",{className:e,children:[t?.sources?.length?t.sources.filter((e=>e?.src)).sort(Z).map((({src:e,format:n,media:a},l)=>o("source",{srcSet:J(i)(e),type:te(n),media:a?`(max-width: ${a}px)`:"",width:t?.size?.width,height:t?.size?.height},`${l}_${e}`))):null,t?.src?ee({...t,src:J(i)(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="",...i})=>t?.src||t?.icon?t.icon?o(W,{className:e,imageClassName:n,iconVersion:t?.iconVersion,name:t.icon,...i}):o(Q,{className:e,imageClassName:n,image:t}):null)),ie={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","":""},ae="bg-main-divider text-main-disabled",le={primary:ae,secondary:ae,white:ae,link:"",transparent:"",gray:ae,"":""},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?ie[n]:"",t?"rounded-full":"rounded-md",e].join(" ");class ce{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 de=new ce,me=()=>({open:(e,t={})=>de.fire("dialog",{type:"open",dialog:e,...t}),close:()=>de.fire("dialog",{type:"close"}),closeAll:()=>de.fire("dialog",{type:"close",all:!0})}),ue=e=>ue._impl(e);function he(){const e=X(G.SITE_URL),t=M(),{closeAll:n}=me();return e=>{const n=$(t)(e.href);return{...e,href:n,"aria-label":e.text,onClick:ue(i({...e,href:n}))}};function i({href:i,target:a,onClick:l}){return r=>{l?.(r),pe(i,a,e)||(n(),r?.preventDefault(),t.push(((e,t="")=>e?.replace(t,"")||"/")(i,e)))}}}ue._impl=e=>e,ue.setup=e=>{ue._impl=e};const pe=(e,t,n)=>{if(!z(e,t))return!0;const i=G.SUB_PORTALS?.split(",");return!!i?.some((t=>O(e,t)))||!O(e,n||"/")},ge=e=>{if(!Array.isArray(e)||!e.length)return{};try{return{"data-aspects":JSON.stringify(e)}}catch(e){return{}}},fe=d((e=>{const{text:t,aboveText:n,appendLeft:i,appendRight:a,version:l="primary"}=e,r=ye(e)&&"hidden lg:block";return c("div",{className:u(xe(e),"flex gap-xs"),children:[i?o("div",{className:u(r,se[l]),children:i}):null,ye(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,a?o("div",{className:u(r,se[l]),children:a}):null]})})),xe=e=>{const{version:t,aboveText:n,rounded:i}=e;if("link"===t)return"";const a=""+(n?"py-2.5 px-9":"py-4 px-9");return u("group/btn items-center justify-center",ye(e)?a:"h-12 w-12 m-auto",{"rounded-full":i})},ye=({text:e,aboveText:t,appendLeft:n})=>Boolean(e||t||!n),be=({className:e,rounded:t,version:n})=>["inline-block",re,n?le[n]:"",t?"rounded-full":"rounded-md",e].join(" "),ve=d((({disabled:e,children:t,method:n="LINK",href:i,...a})=>{const r=(({method:e,href:t})=>l((n=>{if("POST"!==e||!t)return;n.preventDefault(),n.stopPropagation();const{origin:i,pathname:a,searchParams:l}=new URL(t||""),r=document.createElement("form");r.setAttribute("method","POST"),r.setAttribute("action",[i,a].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:i}),s=he()({onClick:r,href:i,...a}),c=t??o(fe,{...s});return o(e?we:Ne,{...s,children:c})})),Ne=d((({className:e="",href:t,rel:n,target:i,ariaLabel:a,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:i,"aria-label":a||`Ссылка на ${u}`,role:t?"link":"button",onClick:s,type:c,...ge(d),children:m}))),we=d((({className:e,ariaLabel:t,version:n,rounded:i,children:a})=>o("button",{type:"button","aria-disabled":"true","aria-label":t,tabIndex:-1,className:be({className:e,rounded:i,version:n}),children:a})));function Ce({version:e,handleClick:t,text:n="Вернуться назад",alwaysVisible:i=!1}){if(!n)return null;const a="primary"===e?"white":"black",l="primary"===e?"bg-primary-main":"bg-white";return c("div",{className:u(i?"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:a}})}),o(ve,{version:"link",className:"group-data-secondary:text-white",text:n,ariaLabel:n,onClick:t,type:"button"})]})}const Se=()=>{const[e,t]=i(true);return a((()=>{const e=globalThis.matchMedia?.("(max-width: 1024px)"),n=()=>{t(Boolean(e?.matches))};return e?.addEventListener("change",n),e?.matches&&t(Boolean(e.matches)),()=>{e?.removeEventListener("change",n)}}),[]),e},ke={start:"@xl:self-start",center:"@xl:self-center",end:"@xl:self-end"},Ie=(e,{className:t,imageAlign:n})=>e?o("div",{className:u("shrink-1/2 justify-self-center",n&&ke[n],t),children:e}):null,Te=d((({className:e,version:t="primary",defaultPadding:n,padding:i="",title:a,buttons:r,leftImage:s,rightImage:d,imageAlign:m,insetTitle:h,isImageAlwaysOnRight:p=!1,isImageSecondary:g=!1,backwardButton:f,children:x,...y})=>{const b=Se(),v=M(),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",i||n,e),children:[C&&Ce({version:t,handleClick:N,text:w}),a?o("div",{className:"relative h-full",children:a}):null,c("div",{className:u("grow relative flex flex-col @xl:flex-row gap-3xl w-full",{"self-start @xl:w-auto":s}),children:[Ie(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"}})),Ie(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,Re=(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,De=d((e=>{const{__html:t="",richVersion:n="",itemSize:i="list-m",isDotted:a=!0}=e,l=a?"":"without-dots";return t&&"<p><br></p>"!==t.replace(/<\/?[^>]+\/?>/g,"").trim()?o("div",{"data-component":"rich-text-container",children:o("div",{className:u(n,i,"md-container group-data-secondary:text-white group-data-gray:text-secondary-text",l),dangerouslySetInnerHTML:{__html:t}})}):null})),Me=(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,_e=d((({children:e,...t})=>o("span",{className:u("font-sans",Object.values(t)),children:e}))),Ae=(e,t)=>e?o(_e,{color:"text-primary-text group-data-secondary:text-white",size:"text-h6",children:e},`label-${t}`):null,Ee=(e,t)=>["label"in e?Ae(e.label,t):null,"description"in e?o("span",{className:e.descriptionClassName,children:Me(e.description,t)},String(t)):null,"__html"in e?o(De,{...e},`rte-${t}`):null],ze=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?Re(n.icon,t):null,o("div",{children:Ee(n)})]}))),Fe=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(ze,{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(Ee)}):null)),Oe=d((({isTabularBenefits:e,...t})=>o(e?Ve:Fe,{...t}))),Le=e=>Boolean(e?.src||e?.icon),je=(e,{className:t,buttonClassName:n,isVertical:i}={})=>e?.length&&e.some((e=>e?.text||e?.icon?.icon))?o("div",{className:u("flex",i?"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:i,icon:a,iconRight:l,version:r,...s}=t||{},c=$e(a,r),d=$e(l,r);return i||a?.icon?o(ve,{className:u("basis-full @lg:basis-auto",e),appendLeft:Ue({...a,iconVersion:c}),appendRight:Ue({...l,iconVersion:d}),version:r,text:i,...s},n?String(n):""):null},$e=(e,t="secondary")=>{const n="secondary"===t?"color":"white";return e?.iconVersion||n},Ue=e=>Le(e)&&o(ne,{image:e,width:String(e?.size?.width||24),height:String(24)}),We=(e=0,{fixed:t}={})=>(n=0)=>new Intl.NumberFormat("ru-RU",{minimumFractionDigits:t?e:0,maximumFractionDigits:e}).format(Number(n)||0),He=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(Ye)}):null)),Ye=({label:e,amount:t,unit:n},i)=>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(_e,{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:[We(2)(t)," ",n||"₽"]}):null]},String(i)),Ke=d((({className:e,tags:t})=>t?.length?o("div",{className:u("flex flex-wrap gap-xs",e),role:"list",children:t.map(Ge)}):null)),Ge=(e,t)=>o("div",{className:"p-xs border-solid border rounded-md border-gray",role:"listitem",children:o(_e,{size:"text-m",font:"font-light",children:e})},String(t)),Xe={XXL:"list-l",XL:"list-l",L:"list-m",M:"list-m",S:"list-s",XS:"list-s"},Je=d((({className:e,padding:t,defaultPadding:n,title:i,description:a,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 B=b?.src?o(ne,{image:b}):null,P=o(k,{title:i,description:a,headlineVersion:l,align:r,isEmbedded:!0}),R=u?.filter((e=>"__html"in e||"label"in e||"description"in e));return o(Te,{className:e,padding:t,defaultPadding:n,...g?{title:P}:{insetTitle:P},...Ze(B,N),isImageSecondary:C,imageAlign:v,isImageAlwaysOnRight:w,buttons:je(y),backwardButton:S,...T,children:c("div",{className:"flex flex-col sm:gap-xl gap-4xl",children:[R?.length?o(Oe,{benefitsVersion:s,isTabularBenefits:d,benefits:R}):null,h?o(De,{richVersion:p,__html:h,isDotted:m,itemSize:Xe[l]}):null,I,f?.length?o(He,{priceList:f}):null,Qe(x)]})})})),Ze=(e,t)=>t?{rightImage:e}:{leftImage:e},Qe=e=>e?.length?o(Ke,{tags:e}):null;class et{_;constructor(e){this._=e}of(e){return new this.constructor(e instanceof et?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 tt=()=>!0,nt=(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 at=e=>Boolean(e&&Array.isArray(e)),lt=e=>Boolean(e&&"object"==typeof e&&!at(e)),rt=e=>e;function st(e){return e instanceof et?e._:e}class ot extends et{from(e){return this.of(e.map(((e=rt)=>([,t])=>e(t))(st)))}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(at(this._)?Array.from({length:Math.max(this._.length,Number(e)+1)},((n,i)=>i===e?t:this._[i])):Array.from({length:Number(e)+1},((n,i)=>i===e?t:void 0)))}}class ct extends et{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 dt extends et{from(e){return this.of(Object.fromEntries(e.map((([e,t])=>[e,st(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 mt extends et{proto=it([e=>at(this._)||"number"==typeof e,()=>ot.prototype],[e=>lt(this._)||"string"==typeof e,()=>dt.prototype],[tt,()=>ct.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 ut=e=>e instanceof et?e:new mt(e),ht=e=>{const t=(t,...n)=>st(e(ut(t),...n));return t.fn=e,t},pt=[],gt=e=>e instanceof Function?e:t=>e===t,ft=e=>(t,n,i=pt)=>ut(t).entries().reduce(((t,[n,a])=>ft(e)(a,t,i.concat(n))),e(n,[i,ut(t)])),xt=ht(((e,[t,n])=>{const[i,...a]=t;return e.set(i,a.length?xt(e.get(i),[a,n]):n)})),yt=ht(((e,t)=>t.reduce(xt.fn,e))),bt=e=>ft(((e,[t,n])=>vt(n)?[...e,[t,st(n)]]:e))(e,[]),vt=e=>0===e.size();ht(((e,t=pt)=>t.reduce(((e,t)=>e.get(t)),e)));const Nt=ht(((e,[t,...n])=>n.length?e.set(t,Nt(e.get(t),n)):e.filter((([e])=>e!==t)))),wt=(Ct=["$ref"]).map(((e,t)=>n=>gt(e)(n[t+n.length-Ct.length]))).reduceRight(nt,tt);var Ct;const St=(e,t)=>(e=>e.includes("#")?e.substring(e.indexOf("#")+1).split("/").filter(Boolean):[])(t).reduce(kt,e),kt=it([at,(e,t)=>e[parseInt(t,10)]],[lt,(e,t)=>e[t]],[tt,rt]),It=(e,t)=>((e,t={})=>n=>yt(t,bt(n).map((t=>e(t)))))((([e,n])=>{return wt(e)?[(i=e,i.slice(0,-1)),St(t(n),n)]:[e,n];var i}))(e),Tt=e=>bt(e).filter(((e=rt)=>([t])=>e(t))(wt)),Bt=e=>{return t=Tt(e).map((([,e])=>e)),[...new Set(t)];var t};async function Pt(e,t){try{return e?await Rt(e,t):null}catch(e){console.error(e)}return null}const Rt=async(e,t)=>(await fetch(e,{...t,headers:{...t?.headers,"Content-Type":"application/json"}})).json(),Dt=e=>[...new Set(e)],Mt={},_t=["/portal-resources"],At=(e,t)=>It(e,(e=>t?.[e])),Et=(e,t)=>{const n=Bt(e),[l,r]=i({});return a((()=>{n.length&&(async e=>Object.fromEntries((await Promise.allSettled(Dt(e).filter((e=>!_t.some((t=>e.startsWith(t))))).map((async e=>[e,Mt[e]||=await Rt(e)])))).filter((e=>"fulfilled"===e.status)).map((({value:e})=>e))))(n).then(r)}),[n.join()]),n.length?At(e,{...t,...l}):e};function zt(e,t={}){const n=d((t=>{const n=Et((({block:e,options:t,className:n,defaultPadding:i,padding:a,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 Ft=zt((({className:e,padding:t,defaultPadding:n,...i})=>o(g,{className:u("overflow-hidden flex flex-col gap-3xl box-border",e),padding:"p-0",...i,children:o(Je,{defaultPadding:n||"p-6xl",padding:t,className:"grow h-full",...i})})),{childrenTypes:["UnitBlock"]}),Vt=d((e=>{const{items:t}=e.options?.page?.adSourceBook??{},n=r((()=>Ot(0,t?.length)),[t]),i=t?.[n];return i?o(Ft,{suppressHydrationWarning:!0,...i,...e}):o(g,{...e,children:o(f,{})})})),Ot=(e=0,t=0)=>Math.floor(Math.random()*(t-e)+e),Lt=(e,t=!1)=>{if("string"==typeof e)return e.split("-").reverse().join(".");{const n=String(e.getDate()).padStart(2,"0"),i=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getFullYear());return t?`${a}-${i}-${n}`:`${n}.${i}.${a}`}},jt=e=>e?.replace(/[^+\d]/g,"");const qt=e=>e?{phone:jt(e)}:{},$t=(e,t="birthday")=>e?{[t]:Lt(e)}:{},Ut=(e,t=!0)=>({[t?"regionBranch":"region"]:e}),Wt=(e,t=!0)=>({[t?"email":"mail"]:e}),Ht=(e="")=>e&&"+7 ("!==e?{secondaryPhoneNumber:jt(e)}:{},Yt=({aspectsAttributes:e,aspects:t,ev:n})=>{for(const{aspectName:i,params:a}of e)t[i??""]?.(n,a)},Kt="rshb-query-params";function Gt(){const e=globalThis.location?.search||globalThis.sessionStorage?.getItem(Kt)||"";return e&&globalThis.sessionStorage?.setItem(Kt,e),e}function Xt(e){if(!e)throw new Error("Value should be fulfilled");return e}const Jt=e=>t=>{const[,n]=Xt(e.find((([e])=>e(t))));return n(t)},Zt=e=>Jt(e.map((([e,t])=>[e,()=>t])));Zt.if=e=>new Qt(void 0,e);class Qt{parent;predicate;unit;get entry(){return[Xt(this.predicate),Xt(this.unit)]}constructor(e,t,n){this.parent=e,this.predicate=t,this.unit=n}if(e){return new Qt(this,e)}then(e){return new Qt(this.parent,this.predicate,e)}else(e){return Jt([...en(this),[()=>!0,e]])}}const en=e=>[...e?.parent?en(e.parent):[],e.entry],tn=e=>{const t=e.target?.closest("a");if(E(t?.href)&&!t?.href?.startsWith(globalThis.location?.origin)){e.preventDefault(),e.stopPropagation();const n=(e=>{const t=Gt();if(!E(e)||!t)return e;const n=new URL(e);for(const[e,i]of new URLSearchParams(t))n.searchParams.set(e,i);return n.toString()})(t?.href)||t?.href;if(n){nn(t?.target)?.(n)}}},nn=Zt([[e=>"_blank"===e,e=>globalThis.open(e,"_blank")],[e=>"_parent"===e,e=>globalThis.parent&&(globalThis.parent.location.href=e)],[e=>"_top"===e,e=>{globalThis.top&&(globalThis.top.location.href=e)}],[()=>!0,e=>globalThis.location&&(globalThis.location.href=e)]]);function an(){return an._impl()}an._impl=()=>({forwardQuery:tn}),an.setup=e=>{an._impl=e};const ln=e=>e,rn=(e,{resetOnSubmit:t,onSubmit:n,normalize:r}={})=>{const[s,o]=i(e),c=l(r?e=>o(e instanceof Function?t=>{const n=r(e(t));return sn(t,n)?t:n}:r(e)):o,[r]);a((()=>{r&&o(r)}),[r]);const[d,m]=i(!1),[u,h]=i({}),p=l(((e,t)=>{const{parse:n=ln,format:i=ln}=t||{};return{value:i(s[e]),isDirty:d||u[e],onChange:t=>{c((i=>({...i,[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}]},sn=(e,t)=>e&&t&&Object.keys({...e,...t}).every((n=>e[n]===t[n])),on=d((e=>{const{className:t,title:n,children:i,...a}=e;return o(g,{className:t,defaultPadding:"p-6xl",...a,children:c("div",{className:"container max-w-[978px] space-y-lg",children:[n?o(w,{headingType:"h3",title:n,className:"@xl:text-center"}):null,i]})})})),cn=e=>"OUTSERVICE"===e?"/api/v1/outservice/outserviceregions":void 0;function dn(e=!1){const[t,n]=i(e),a=l((()=>n(!0)),[]),r=l((()=>n(!1)),[]),s=l((()=>n((e=>!e))),[]);return[t,{setValue:n,setTrue:a,setFalse:r,toggle:s}]}function mn(e,t,n,i){a((()=>{if(e&&n)return e.addEventListener(t,n,i),()=>{e.removeEventListener(t,n,i)}}),[e,t,n])}function un(e){const t=s(null),n=l((n=>{t&&t.current&&n.target instanceof Node&&!t.current.contains(n.target)&&e()}),[e]);return mn(globalThis.document,"click",n),t}const hn=({label:e,errors:t})=>e&&t?`${e}*`:e,pn=()=>{},gn="border border-solid outline-none border-gray hover:border-primary-hover active:border-primary-text focus:border-primary-text rounded",fn=e=>e?o(_e,{size:"text-m",color:"text-primary-text",font:"font-light",children:e}):null,xn=d((({key:e,className:t="",id:n,name:i,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]);a((()=>{v&&C.current?.focus()}),[v,C]);const k=g?"pr-3xl":"",I=yn(p);return c("div",{className:u("relative",t),children:[c("label",{className:"space-y-xs",children:[fn(d),N?o("textarea",{className:u("block resize-y min-h-24",bn,I),id:u("textarea",n),name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,disabled:w},e):o("input",{type:r,className:u("h-14",bn,k,I),ref:C,id:n,name:i||n,placeholder:m,value:h,onChange:S,onFocus:x,onBlur:y,pattern:b,disabled:w},e)]}),g]})})),yn=e=>e?gn:"border-error",bn="w-full border rounded-md text-primary-text outline-none p-m",vn=e=>o("div",{className:"h-6",children:e?o(_e,{size:"text-xs",font:"font-light",color:"text-error",children:e}):null}),Nn=e=>e?.value||"",wn={url:"suggest/address"},Cn={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:wn,addressFact:wn,organizationAddress:wn,addressCourier:wn},Sn=()=>({open:(e,t)=>de.fire("popup",{type:"open",popup:e,...t}),update:(e,t)=>de.fire("popup",{type:"update",popup:e,...t}),close:()=>de.fire("popup",{type:"close"})}),kn=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 In({isOpen:e,value:t,name:n,onChange:c,onDaDataChange:d,daDataQueryPrefix:m}){const u=s(t),h=s(t),[p,g]=i([]),f=Sn(),x=Cn[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:i,requestData:a={},responseItemHandler:l=Nn}=e,r=(s=l,e=>(e?.suggestions||[]).map((e=>{const t=s(e);return{...e,processedValue:t}})));var s;const o=`${i?`${i}, `:""}${n}`;return fetch(`/api/v1/suggestions/${t}`,{method:"POST",mode:"cors",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:10,...a,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 i=(...a)=>{i.dispose(),n=setTimeout((()=>{e(...a)}),t)};return i.dispose=()=>{n&&clearTimeout(n)},i})(N,300)),[N]);return a((()=>{if(!e||!v.current||h.current===t)return void y();const n=v.current,{top:i,left:a,width:l,height:r}=n.getBoundingClientRect();t&&u.current!==t&&(w(t),u.current=t),f.update(o(kn,{options:p,value:t,onChange:b}),{top:i+globalThis.scrollY+r,left:a,width:l})}),[e,p,t,b]),v}const Tn=d((({className:e,label:t,value:n="",placeholder:i,error:a,errors:r,onChange:s=pn,onDaDataChange:d,onBlur:m,isTextarea:h,type:p,name:g="",daDataQueryPrefix:f,maxLength:x,dadata:y=!1,disabled:b=!1})=>{const[v,{setFalse:N,setTrue:w}]=dn(),C=un(N),S=l((e=>{y&&!v&&w(),x?e.length<=x&&s(e):s(e)}),[y,v,s]),k=In({isOpen:v&&y,name:g,value:n,daDataQueryPrefix:f,onChange:s,onDaDataChange:d});return c("div",{className:u("shrink-0 w-full",e),ref:C,onBlur:N,onFocus:w,children:[o("div",{ref:k,children:o(xn,{disabled:b,type:p||"text","aria-label":t,label:hn({label:t,errors:r}),valid:Boolean(!a),value:n,onChange:S,onBlur:m,isTextarea:h,placeholder:Bn(i,r,t)})}),vn(a)]})})),Bn=(e,t,n)=>t&&!n?`${e}*`:e,Pn=e=>e?.text||e?.key||"",Rn=(e,t)=>e?.length&&t?.trim()?e.filter((e=>e.text?.toLocaleLowerCase().includes(t?.trim().toLocaleLowerCase()))):e,Dn=d((({popupRef:e,options:t,value:n,query:i,onChange:a,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:Rn(t,i).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(),a&&a(e)},children:[o("span",{className:"min-h-6",children:Pn(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 Mn=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}]=dn(),[N,w]=i(""),C=En(x,n.length),S=y&&!C,k=l((()=>{w(""),b()}),[]),I=function({isOpen:e,options:t,value:n,query:i,onChange:r,onClose:c,iconVersion:d}){const m=Sn(),u=l((()=>{m.close(),c&&c()}),[c]),h=l((e=>{u(),r&&r(e)}),[u,r]),p=s(null),g=un(u);return a((()=>{if(!e||!p.current)return;const a=p.current,{top:l,left:r,width:s,height:c}=a.getBoundingClientRect();m.update(o(Dn,{popupRef:g,options:t,value:n,query:i,onChange:h,iconVersion:d}),{top:l+window.scrollY+c,left:r,width:s})}),[e,t,n,i,h]),p}({isOpen:y,options:n,value:r,query:N,onChange:f,onClose:k,iconVersion:g});return c("div",{className:u("space-y-xs",e),children:[fn(t),c("div",{className:u("relative",S?"z-20":"z-10"),ref:I,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",An(m,d,C)),onClick:S?k:v,children:[o("p",{className:"line-clamp-2 text-ellipsis",children:Pn(r)||h}),_n(S,g)]}),p&&S?o("div",{className:u("absolute top-0 w-full z-20"),children:o(xn,{type:"text",autoFocus:!0,value:N,onChange:w})}):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"}),An=(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"),En=(e,t)=>e||0===t,zn=d((({className:e="",label:t,error:n,errors:i,...a})=>c("div",{className:e,children:[o(Mn,{...a,valid:!n,label:hn({label:t,errors:i})}),vn(n)]}))),Fn=e=>!e?.length,Vn=e=>t=>n=>e(n)?[]:[t],On=Vn((e=>null!=e&&""!==e)),Ln="Некорректно заполненное поле",jn="Укажите регион, город/населенный пункт, улицу, дом",qn=e=>On(e??Ln),$n=e=>Vn((e=>e?.key&&""!==e?.key))(e??Ln),Un=e=>Vn((e=>"string"==typeof e&&e.length>0&&e.length<=2))(e??Ln),Wn=e=>Vn((e=>"string"==typeof e&&e.length>1&&ei(e)))(e??Ln),Hn=(e,t)=>Vn((t=>"string"==typeof t&&t.length>=1&&t.length<=e))(t??Ln),Yn=e=>Vn((e=>"string"==typeof e&&6===e.length))(e),Kn=e=>{return(t=/^(\+7)?[\s-]?\(?[0-9]{3}\)?[\s-]?[0-9]{3}[\s-]?[0-9]{2}[\s-]?[0-9]{2}$/,Vn((e=>"string"==typeof e&&t.test(e))))(e);var t},Gn=Vn((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=()=>Vn(Jn)(jn),Qn=/^[\u0400-\u04FF\d]+$/u,ei=(e="")=>Qn.test(e),ti={typeForm:qn(),surname:Wn("Укажите свою фамилию"),name:Wn("Укажите своё имя"),middleName:Wn("Укажите своё отчество"),region:$n(),addressBranch:$n(),phone:Kn("Укажите номер телефона"),secondaryPhone:Kn("Укажите номер телефона"),organizationPhone:Kn("Укажите номер телефона"),birthday:qn("Укажите дату рождения"),birthPlace:qn("Укажите место рождения"),education:qn("Выберите ваше образование"),housing:qn("Выберите тип жилья"),employment:qn("Выберите информацию о трудоустройстве"),organization:qn("Выберите тип организации"),amountWorkers:qn("Выберите информацию о количестве сотрудников"),employerActivities:qn("Выберите вид деятельности организации"),employerOrganization:qn("Выберите вид организации"),positionOrganization:qn("Выберите вашу должность"),dulSerie:(ni="Укажите серию паспорта",Vn((e=>"string"==typeof e&&4===e.length))(ni)),dulNumber:Yn("Укажите номер паспорта"),dulIssueDateField:qn("Укажите дату выдачи паспорта"),dulSubdivisionCode:Yn("Укажите код подразделения"),dulIssuedBy:qn("Укажите организацию, выдавшую паспорт"),email:(e=>Vn((e=>/^[^\s@]+@[^\s@]+\.[a-zA-Z]{2,4}$/.test(e)))(e))("Укажите электронную почту"),fullName:Wn(),inn:(e=>Vn((e=>"string"==typeof e&&(10===e.length||12===e.length)))(e))("Укажите ИНН"),legalForm:qn("Укажите ОПФ"),organizationName:qn("Укажите наименование организации"),generalSeniority:Un("Укажите количество лет стажа"),lastJobExperience:Un("Укажите стаж на последнем месте работы"),experience5Years:Un("Укажите общий стаж за последние 5 лет"),jobsNumber:Un("Укажите количество мест работы за последние 5 лет"),beginDate:qn("Укажите дату заключения трудового договора"),addressFact:Zn(),partnerComments:qn(),collectionCount:qn(),comment:qn(),acquiringType:$n(),feedbackMethod:$n(),serviceType:$n(),serviceDirection:$n(),regionRetail:$n("Выберите регион"),meetingDay:qn(),product:qn(),localities:qn(),consentDataProcessing:Gn,annualRevenue:qn(),consentToReceiveMaterials:Gn,processPersonalDataFlg:Gn,consentProviderFlg:Gn,consentPfrFlg:Gn,consentOthersFlg:Gn,consentInformFlg:Gn,familyStatus:qn("Выберите семейное положение"),children:Hn(2,"Укажите количество детей"),familyMembers:Hn(2,"Укажите количество членов семьи"),dependents:Hn(2,"Укажите количество иждивенцев"),totalIncome:Hn(19,"Укажите среднемесячный доход от основной зарплаты"),expenses:Hn(10,"Укажите сумму обязательных выплат"),snils:(e=>Vn(Xn)(e))("Некорректный номер СНИЛС"),conscription:qn(),armyIdFlg:Gn,sex:qn("Укажите свой пол"),addressRegistration:Zn(),organizationAddress:Vn((e=>Boolean(e.fiasCode&&e.city&&e.house)))(jn),participantDateRegistration:qn("Укажите дату регистрации"),retirementIncome:qn(),otherIncome:qn(),wages:qn(),mandatoryPayments:qn(),disablePeopleFlg:qn(),bankruptcyFlg:qn(),shareholderFlg:qn(),legalEntityName:qn(),bankEmployeeCode:qn(),partInBusiness:qn(),addressRetail:$n("Выберите адрес банка"),addressMatch:qn(),codeWord:(e=>Vn((e=>"string"==typeof e&&e.length>=3&&e.length<=21&&ei(e)))(e??Ln))("Необходимо ввести кодовое слово"),confirmationIncome:qn(),deliveryDate:qn("Укажите дату доставки"),addressCourier:Zn()};var ni;const ii=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,ti?.[e||""]])).filter((([,e])=>e)))},ai=(e,t)=>{const{value:n,isDirty:i}=e,a=i?t(n):[];return{...e,errors:a,error:a[0]}},li=(e,t,n=!1)=>n&&t?ai(e,t):e,ri=[{text:"Торговый эквайринг",key:"trade"},{text:"СБП-эквайринг",key:"sbp"},{text:"Интернет-эквайринг",key:"internet"},{text:"Все виды эквайринга",key:"all"}],si=d((({field:e,input:t})=>o(zn,{label:"Вид эквайринга",placeholder:"Выберите эквайринг",options:ri,...li(e("acquiringType"),ti.acquiringType,t?.required)}))),oi=(e="")=>Boolean("trade"===e||"all"===e),ci=e=>null!=e,di=new Map,mi=e=>Boolean(e?.every((e=>Array.isArray(e)?mi(e):!e||"string"==typeof e))),ui=e=>mi(e)?e.toString():"";function hi(e,t,{fallback:n,cache:l}={}){const s=r((()=>pi(e)),[e]),[o,c]=i(void 0),[d,m]=i(void 0);a((()=>{if(!s.some(ci))return;let e=!1;const n=(t,n)=>{e||(c(t),m(n))};return(async()=>{try{n(await((e,t=di)=>n=>{const i=ui(n),a=t.get(i);if(i&&ci(a))return a;const l=e(...n);return i&&ci(l)&&t.set(i,Promise.resolve(l)),l})(t,l)(s))}catch(e){n(void 0,e)}})(),()=>{e=!0}}),[t,l,s]);const u=n&&(e=>Boolean(e&&Array.isArray(e)&&1===e.length&&"string"==typeof e[0]))(s)&&n[s[0]];return{data:!o&&u?u:o,error:d,mutate:()=>Promise.resolve(void 0)}}function pi(e){return Array.isArray(e)?e:e instanceof Function?pi(e()):[e]}const gi=[];const fi=async e=>await Pt(e,{method:"GET"})||gi;function xi(e=!1){const{data:t}=hi("/api/v1"+(e?"/premiumBranchesByRegions":"/branchesByRegions"),Rt);return Array.isArray(t)?t:[]}const yi=d((({field:e,input:t,isPremium:n=!1})=>{const i=e("region"),l=i?.value?.key,r=i?.value?.text,s=n?xi(n)?.find((e=>e?.region===r))?.branches:function(e){const{data:t}=hi(e?`/api/v1/branches?regionCode=${e}`:null,fi);return t||gi}(l)?.filter((e=>e?.address));return a((()=>{""!==i?.value?.key&&e?.("addressBranch")?.onChange?.("")}),[i?.value]),o(zn,{label:"Отделение",placeholder:"Выберите отделение",options:(s||[]).map((({address:e=""})=>({key:e,text:e}))),...li(e("addressBranch"),ti.addressBranch,t?.required),isSearch:!0})})),bi=d((({field:e,input:t})=>{const n="addressFact",i=e(n).value,{value:r}=e("addressMatch");a((()=>{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?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{label:"Адрес",disabled:r,...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:c,...t,onDaDataChange:s})})),vi=(e,t)=>Boolean(e("esiaAccountTypeCd")?.value?.key)&&e(t).value,Ni=d((({field:e,input:t})=>{const n=t?.name||"addressRegistration",i=e(n).value,a=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})}),[]),r=l((t=>{e?.(n)?.onChange?.({...e(n).value,fullAddress:t})}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,n),label:"Адрес",...li(e(n),ti[n],t?.required),value:i.fullAddress,onChange:r,...t,onDaDataChange:a})})),wi=d((({className:e,viewBox:t,fill:n="none",width:i,height:a,paths:l,...r})=>o("svg",{xmlns:"http://www.w3.org/2000/svg",className:e,viewBox:t,fill:n,width:i,height:a,children:l.map((({d:e,fill:t,...n},i)=>{const a={...r,...n};return o("path",{d:e,fill:t||"currentColor",stroke:a.stroke,strokeLinecap:a.strokeLinecap,strokeLinejoin:a.strokeLinejoin,strokeWidth:a.strokeWidth,strokeMiterlimit:a.strokeMiterlimit},i)}))}))),Ci="appearance-none w-5 h-5 border-solid flex-none",Si=[{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"}],ki=d((({className:e,value:t,text:n,disabled:i,isRadio:a,onChange:r})=>{const s=l((e=>{i||(e.preventDefault(),r&&r(!t))}),[r,i,t]),d=a?o("div",{className:"absolute left-1 w-3 h-3 rounded-full bg-primary-main"}):o(wi,{paths:Si,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",Ti(i)),onClick:s,children:[o("div",{className:u(Ci,"m-0",a?"rounded-full border-2":Pi(t),!i&&t?"border-primary-main":"border-gray",i?"bg-main-disabled":"group-hover/box:border-primary-hover"),role:Bi(a),"aria-checked":Boolean(t),"aria-disabled":Boolean(i),"aria-label":n}),t?d:null,Ii(n)]})})})),Ii=e=>e?o("div",{className:"ml-s",children:o(_e,{size:"text-l",font:"font-light",children:e})}):null,Ti=(e=!1)=>e?"cursor-not-allowed":"cursor-pointer",Bi=(e=!1)=>e?"radio":"checkbox",Pi=(e=!1)=>u("rounded border",{"bg-primary-main":e}),Ri=d((({className:e,text:t,value:n,key:i,disabled:a,error:l,onChange:r})=>c("div",{className:u("shrink-0",e),children:[o(ki,{text:t,value:n,disabled:a,onChange:r},i),vn(l)]}))),Di=d((({field:e,input:t})=>o(Ri,{text:"Адрес фактического места жительства совпадает с адресом регистрации",...li(e("addressMatch"),ti.addressMatch,t?.required)}))),Mi=d((({color:e="text-primary-main",position:t="absolute",blur:n=!0})=>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 h-28 w-28","animate-spin rounded-full","border-8 border-solid border-current","border-r-transparent",e),role:"status"})}))),_i="/icons/MapMarkerClusterIcon.svg",Ai="/icons/MapMarkerClusterYellowIcon.svg";function Ei({yandexMaps:e,map:t,points:n,isLoad:i}){if(i||!n)return;if(t.geoObjects.removeAll(),!n.length)return;const a=e.templateLayoutFactory.createClass('<div style="margin-top: -3px;">{{properties.geoObjects.length}}</div>'),l=zi("offices",e,a);if(n.length&&n.every((e=>"type"in e))){const i=zi("workplaces",e,a),r=Fi(n.filter((e=>"workplaces"===e.type)),"workplaces",e),s=Fi(n.filter((e=>"offices"===e.type)),"offices",e);l.add(s),i.add(r),t.geoObjects.add(i),t.geoObjects.add(l)}else{const i=Fi(n,"offices",e);l.add(i),t.geoObjects.add(l)}t.setBounds(e.util.bounds.fromPoints(n.map((e=>e.coords)))).then((()=>{t.getZoom()>10&&t.setZoom(10)}))}const zi=(e,t,n)=>new t.Clusterer({clusterIcons:[{href:"offices"===e?_i:Ai,size:[78,84],offset:[-35,-50]}],clusterIconContentLayout:n,clusterHideIconOnBalloonOpen:!1,geoObjectHideIconOnBalloonOpen:!1}),Fi=(e,t,n)=>e.map((({coords:e,content:i})=>new n.Placemark(e,{balloonContentHeader:i?.header,balloonContentBody:i?.body,balloonContentFooter:i?.footer,hintContent:i?.hint},{iconLayout:"default#image",iconImageHref:"offices"===t?_i:Ai,iconImageSize:[78,84],iconImageOffset:[-35,-50]}))),Vi={focus:"focus:border-primary-text focus:border",hover:"hover:bg-primary-hover",active:"active:bg-primary-active",font:"text-center font-sans"},Oi={...Vi,border:"border border-transparent rounded-md",position:"absolute flex items-center justify-center"},Li=(e,t,n)=>o("div",{className:`select-none cursor-pointer py-m w-12 bg-white ${Object.values(Oi).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"})}),ji=e=>globalThis[e];function qi(e,t,n=!0){const[l,r]=i(void 0);return a((()=>{let i=!0;return((e,t)=>{const n=document.getElementById(t);if(n){const t=ji(e);return t?Promise.resolve(t):new Promise((t=>{n.addEventListener("load",(()=>{t(ji(e))}))}))}return new Promise(((n,i)=>{const a=document.createElement("script");a.src=t,a.async=!0,a.id=t,a.addEventListener("load",(()=>{n(ji(e))})),a.addEventListener("error",(e=>{i(e)})),document.head.appendChild(a)}))})(e,t).then((e=>{i&&r(e)})).catch((e=>{console.error(`Failed to initialize external namespace: ${e}`)})),()=>{if(i=!1,n){const e=document.getElementById(t);e&&document.head.removeChild(e),r(void 0)}}}),[e,t,n]),l}const $i={...Vi,border:"border-b border-b-2 border-gray last:border-0",position:"relative flex items-center justify-center"},Ui=d((({yandexMaps:e,direction:t="in"})=>{const n="in"===t?"PlusIcon":"MinusIcon";return o("div",{onClick:()=>{const n=e.current.getZoom(),i="in"===t?n+1:n-1;e.current.setZoom(i,{checkZoomRange:!0})},className:`${Object.values($i).join(" ")} bg-white select-none cursor-pointer w-12 h-12`,children:o(W,{name:n,width:"20",height:"16"})})})),Wi=[55.753995,37.614069],Hi=d((({points:e,className:t="",zoom:n=5,isLoad:i,selectedAddress:l})=>{const r=s(null),d=s(null),m=qi("ymaps",`https://api-maps.yandex.ru/2.1/?apikey=${A.YANDEX_MAP_API_KEY||""}&lang=ru_RU`,!1);if(a((()=>{r.current?Ei({yandexMaps:m,map:r.current,points:e,isLoad:i}):m?.ready((()=>{r.current||(r.current=new m.Map(d.current,{center:Yi(e),zoom:n,controls:[],suppressMapOpenBlock:!0})),Ei({yandexMaps:m,map:r.current,points:e,isLoad:i})})),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,i,l]),!m)return null;const h="z-10";return c("div",{ref:d,className:u("relative","w-full",t),children:[i?o(Mi,{}):null,c("div",{className:u("absolute right-2 top-52 z-10 w-12 overflow-hidden border border-transparent rounded-md",h),children:[o(Ui,{yandexMaps:r}),o(Ui,{yandexMaps:r,direction:"out"})]}),Li(r,m,u("right-2 top-80",h))]})})),Yi=e=>{const t=[Gi(Ki(e,0)),Gi(Ki(e,1))];return t.every((e=>e))?t:Wi},Ki=(e,t)=>e.map((e=>e.coords?.[t])),Gi=e=>e.length&&e.reduce(((e,t)=>e+t))/e.length,Xi=async(e,t,n)=>{try{return(await Ji(e,t,n)).json()}catch(e){return console.error(e),null}};async function Ji(e,t,n){return globalThis?.fetch?.(`/api/v1${e}`,{method:t,headers:{"Content-Type":"application/json",...Zi()},credentials:"include",body:n?JSON.stringify(n):null})}const Zi=()=>{const e=sessionStorage.getItem("accessToken");return e?{Authorization:`Bearer ${e}`}:null},Qi=e=>Number(e.toString().replace(",",".")),ea=d((({className:e="",isFoldButtonOnTop:t=!1,unfoldedByDefault:n=!1,renderFoldableSection:a,renderFoldButton:r})=>{const[s,o]=i(n),d=l((()=>{o((e=>!e))}),[]),m=a({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 ta=d((({className:e="",isUnfolded:t,children:n})=>{const i=s(null),l=function(e,t){const n=s(null);return a((()=>{const t=n?.current;if(!t)return;const i=new ResizeObserver((n=>{e(t,n[0])}));return i.observe(t),()=>{i.disconnect()}}),[e,...t]),n}((e=>{i.current&&(i.current.style.maxHeight=t?`${e.scrollHeight}px`:"")}),[t]);return o("div",{ref:i,className:`transition-max-h duration-300 overflow-hidden ${i.current||!t?"max-h-0":""} `,children:o("div",{className:e,ref:l,children:n})})})),na=d((({value:e,subText:t,children:n,isPhone:i,...a})=>{const l=(Array.isArray(e)?e:e?.split(",")??[]).filter(Boolean);return[l.length,n,t].every((e=>!e))?null:ia({textItems:l,subText:t,children:n,isPhone:i,...a})})),ia=({label:e,labelSize:t="text-m",textItems:n,subColor:i,subText:a,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(_e,{color:"text-secondary-text",font:"font-light",size:t,children:e}):null,r||aa(n,s),a?o(_e,{color:i,size:"text-m",children:a}):null]}),aa=(e,t)=>e.filter(Boolean).map(((e,n)=>o(_e,{size:"text-l",children:t?o("a",{href:`tel:${la(e)}`,children:e.trim()}):e.trim()},String(n)))),la=e=>e.replace(/\D/g,""),ra=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}))),sa=e=>{const t=ca(e);return o(na,{label:"Режим работы",value:t,className:"max-w-none"})},oa=({workTime:e="",lunchHour:t="",daysOff:n=""},i=!1)=>e?[`${i?"Суббота":"Будние дни"}: ${e}`,t?`перерыв: ${t}`:"",n?`не работает: ${n}`:""].filter(Boolean).join("; "):"",ca=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))),i=e.filter((e=>!e.status)).map((e=>e.short?.toLowerCase())).join(", ");return[oa({workTime:t?.workTime,lunchHour:t?.lunchHour,daysOff:n?"":i}),oa({workTime:n?.workTime,lunchHour:n?.lunchHour,daysOff:i},!0)].filter(Boolean)},da=[["workingMonday","Пн","Понедельник"],["workingTuesday","Вт","Вторник"],["workingWednesday","Ср","Среда"],["workingThursday","Чт","Четверг"],["workingFriday","Пт","Пятница"],["workingSaturday","Сб","Суббота"],["workingSunday","Вс","Воскресенье"]],ma=e=>da.map((([t,n,i])=>({key:t,title:i,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??"")}}))),ua=e=>{if(!e)return null;const t=ha(e);return c(ra,{className:"border-none",children:[o(na,{label:"Для юридических лиц",labelSize:"text-l",children:o("div",{className:"flex gap-1",children:t.map(pa)})}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]})},ha=e=>{const t=da.map((([,e])=>({short:e,status:!0}))),n=e.split("/")??[],i=n[n.length-1]?.toLowerCase();return i?.includes("выходной")?t.map((e=>({...e,status:!i?.includes(e.short.toLowerCase())}))):t},pa=({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(_e,{size:"text-xs",children:e})},String(n)),ga=({currency:e,buyExchangeRate:t,saleExchangeRate:n},i)=>c("div",{className:"flex gap-lg h-full",children:[e?.currency?o(na,{label:"Валюта",value:e.currency}):null,t?o(na,{label:"Купить",value:String(t)}):null,n?o(na,{label:"Продать",value:String(n)}):null]},String(i)),fa={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"}},xa=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",fa[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(_e,{size:"text-m",color:fa[n].text,children:t})]}))),ya=(new Date).getDay(),ba=e=>{const[t]=e?.slice(ya-1)??[];if(!t)return null;const{lunchHour:n,status:i,workTime:a,hasLunch:l}=t;return i?c("div",{className:"flex gap-s items-start whitespace-nowrap",children:[a?o(xa,{color:"green",children:a}):null,n&&l?o(xa,{color:"yellow",children:`перерыв: ${n}`}):null]}):o(xa,{color:"red",children:"Выходной"})},va=({lunchHour:e,hasLunch:t=!1,status:n=!1})=>n?e&&t?`Перерыв ${e}`:e:"Не работает",Na=({title:e,status:t,workTime:n,lunchHour:i,hasLunch:a},l)=>o(na,{label:e,value:t&&n?n:"",subText:va({lunchHour:i,hasLunch:a,status:t}),subColor:!t||a?"text-error":"text-green-dark"},String(l)),wa=["ArrowDownIcon","ArrowUpIcon"],Ca=["Подробнее","Скрыть"],Sa=({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:Ca[Number(e)]}),o(W,{className:"text-primary-text",name:wa[Number(e)],width:"16",height:"16"})]}),ka=e=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p>`,Ia=e=>`<p><b>Режим обслуживания физ. и юр. лиц:<br/></b> ${e}</p>`,Ta=(e,t)=>`<p><b>Режим обслуживания физ.лиц:<br/></b>${e}</p> <p><b>Режим обслуживания юр.лиц:<br/></b>${t}</p>`,Ba=({name:e,address:t,phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m},u)=>{if(!d)return null;const h=ma(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(_e,{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(_e,{size:"text-l",children:t})]}):null]}),ba(h)]}),o("div",{className:"hidden sm:block",children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:Pa({phone:n,fax:i,phoneBusiness:a,phoneNatural:l,phoneCallCentre:r,phoneCurrencyControl:s,workSchedule:d,exchangeRate:m})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(u))},Pa=({phone:e,fax:t,phoneBusiness:n,phoneNatural:i,phoneCallCentre:a,phoneCurrencyControl:l,workSchedule:r,exchangeRate:s})=>{const d=ma(r),m=r?.businessScheduleVisibleTag?"Для физических лиц":"Для физических и юридических лиц";return c("div",{children:[c(ra,{className:"flex-wrap border-b border-solid border-main-divider",children:[o(na,{label:"Факс",value:t,isPhone:!0}),o(na,{label:"Телефон филиала",value:e,isPhone:!0}),o(na,{label:"Для обращений юридических лиц",value:n,isPhone:!0}),o(na,{label:"Обслуживание физических лиц",value:i,isPhone:!0}),o(na,{label:"Для консультаций по валютному контролю",value:l,isPhone:!0}),o(na,{label:"Контакт-центр",value:a,isPhone:!0})]}),r?.isMatchesPattern?o(ra,{children:o(na,{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(Na)})})}):c(ra,{children:[o(na,{label:m,labelSize:"text-l",children:o("div",{className:"flex gap-1",children:d?.map(pa)})}),sa(d)]}),r?.businessScheduleVisibleTag?ua(r?.businessScheduleDescription):null,s?.currencies?.length?o(ra,{className:"flex-wrap",children:s?.currencies?.map(ga)}):null]})},Ra=({name:e="",address:t="",workSchedule:n})=>{const i=(a=e)?`${a?.charAt(0)?.toUpperCase()}${a?.slice(1)}`:"";var a;const l=`${t} ${(e=>{const t=ma(e),n=e?ca(t):"",i=e?e.businessScheduleDescription:"";return e?e.businessScheduleVisibleTag?e.businessScheduleVisibleTag&&null===e.businessScheduleDescription?ka(n):Ta(n,i):Ia(n):""})(n)}`;return{header:i,body:l}},Da=!Boolean("object"==typeof globalThis.process&&globalThis.process&&globalThis.process.version),Ma=d((({children:e})=>Da?e:null)),_a={workingSaturday:!1,premiumService:!1,privateBanking:!1,remoteWorkplace:!1,serviceDisabledPeople:!1,sellingCoins:!1,buyingCoins:!1,bullionOperations:!1,preciousMetalsOperations:!1,transferringDataToBiometricSystem:!1},Aa={safeBoxCaseVolumes:"Аренда индивидуальных сейфовых ячеек",workingSaturday:"Открыты по субботам",terminalTypeAtms:"Банкоматы",terminalTypeTerm:"Терминалы",workAllTime:"Круглосуточно",billAcceptorEnable:"Прием наличных",premiumService:"Премиальное обслуживание",privateBanking:"Услуга Private banking",sellingCoins:"Продажа монет из драгоценных металлов",buyingCoins:"Покупка монет из драгоценных металлов",bullionOperations:"Операции со слитками",preciousMetalsOperations:"Операции с драгоценными металлами",transferringDataToBiometricSystem:"Передача фото и голоса в Единую биометрическую систему",locationDisabledPeople:"Для маломобильных",designDisabledPeople:"Для слабовидящих",remoteWorkplace:"Удаленное рабочее место",serviceDisabledPeople:"Для маломобильных граждан"},Ea={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)};function za({disabled:e,onClick:t}){return n=>{!e&&t&&t(n)}}const Fa={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"},Va={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")},Oa=d((({children:e,...t})=>{const n=e=>({...e,onClick:ue(za(e))}),{className:i,version:a="primary",active:l,disabled:r,type:s="button",rounded:c=!0,role:d,onClick:m}=n(t);return o("button",{className:u("font-sans px-9 py-4","flex justify-center items-center gap-xs",{"text-white bg-primary-active":l,"bg-main-gray text-main-disabled cursor-not-allowed":r,"rounded-md":c},l||r?"":u(Fa[a],Va[a]),i),type:s,role:d,onClick:m,children:e})})),La=(e,t)=>e&&"underlined"!==t?"primary":"secondary",ja=(e,t,n)=>{const i=La("all"===t),a=La("business"===t),l=(e,t,i)=>{const a=e.currentTarget===e.target&&"business"===t?r(i):i;return n(t),a},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(Oa,{"data-id":"all",onClick:t=>l(t,"all",e),version:i,children:"Для физических лиц"}),o(Oa,{"data-id":"business",onClick:t=>l(t,"business",e),version:a,children:"Для юридических лиц"})]})},qa=({__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(De,{__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(_e,{size:"text-m",font:"font-light",children:e.text}):null]},String(t))))}):null]}):null,$a="flex flex-col sm:flex-row sm:flex-wrap gap-3xl pb-2xl",Ua=({filters:e,field:{field:t,reset:n},onlyOffice:i,labels:a})=>{const l=i?5:6,r=(e||[]).map((e=>o(ki,{text:a[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(ea,{renderFoldableSection:({isUnfolded:e})=>c("div",{children:[o("div",{className:$a,children:s}),o(ta,{className:$a,isUnfolded:e,children:d})]}),renderFoldButton:Wa(n,i)})}):null})},Wa=(e,t=!1)=>({isUnfolded:n,onToggle:i})=>c("div",{className:"flex space-x-lg",children:[t?o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",appendRight:o(W,{name:["ArrowDownIcon","ArrowUpIcon"][Number(n)],width:"16",height:"16"}),text:["Больше фильтров","Меньше фильтров"][Number(n)],onClick:i}):null,o(ve,{version:"transparent",className:"text-secondary-text [&>*]:p-0",onClick:e,children:Ha()})]}),Ha=()=>c("div",{className:"flex items-center",children:["Очистить фильтр",o(W,{name:"CloseIcon",width:"16",height:"16",className:"ml-2xs"})]}),Ya=(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(_e,{size:"text-h2",color:"text-secondary-text",children:o("span",{suppressHydrationWarning:!0,children:` (${t})`})}):null]})}),Ka=()=>{},Ga=e=>"all"===e?"block":"hidden",Xa=d((({className:e,data:t=[],isLoad:n,remoteWorkplaces:a=[],renderCard:l=Ka,renderRemoteWorkplaceCard:r=Ka,getBalloon:s=Ka,getBalloonRemoteWorkplaces:d=Ka,descriptionData:m,title:h})=>{const p=h?.includes("Офис"),[g,{field:f,reset:x}]=rn(_a),{filteredItems:y,points:b,filteredRemoteWorkplaces:v,lengthItems:N}=el({data:t,remoteWorkplaces:a,filtrationState:g,getBalloon:s,getBalloonRemoteWorkplaces:d}),[w,C]=i("all"),S={filters:Za([...t,...a]),field:{field:f,reset:x},onlyOffice:p,labels:Aa};return c("div",{className:u("space-y-1",e),children:[c("div",{className:"bg-white",children:[c("div",{className:"p-3xl pb-0",children:[Ya(h,N),m?qa(m):null,p&&ja(t,w,C),o("div",{className:u("pb-3xl",Ga(w)),children:Ua(S)})]}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:b,isLoad:n,className:"h-full"})})})]}),c(Ma,{children:[y.map(l),v.map(r)]})]})})),Ja=(e,t)=>{const n=Object.keys(t).filter((e=>t[e]));return e.filter((e=>n.every((t=>Ea[t](e)))))},Za=e=>Object.keys(_a).filter((t=>e.filter((e=>Ea[t](e))).length)),Qa=()=>{},el=({data:e,remoteWorkplaces:t=[],filtrationState:n={},getBalloon:i=Qa,getBalloonRemoteWorkplaces:a=Qa})=>{const[l,s,o,c]=r((()=>{const l=Ja(e,n),r=Ja(t,n),s=[...l.map((e=>({type:"offices",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:i(e)}))),...r.map((e=>({type:"workplaces",coords:[Number(e.gpsLatitude),Number(e.gpsLongitude)]?.filter(Boolean),content:a({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,i,a]);return{filteredItems:l,points:s,filteredRemoteWorkplaces:o,lengthItems:c}},tl=e=>{const{data:t,error:n}=hi(`/api/v1/dictionary?dictionaryType=${encodeURIComponent(e)}`,nl);return t&&"errorMessage"in t?{error:n}:{data:t,error:n}},nl=async e=>await Pt(e,{method:"POST"})||[],il=d((({field:e,input:t})=>{const[n,l]=i([]),{data:r}=tl("REGION_RF"),s=e("regionRetail")?.value||{},d=e("addressRetail");a((()=>{(async()=>{const e=await(async e=>(await Xi("/public-data/regionOffices","POST",{regionRfCd:{key:e},cashCardFlg:!0}))?.offices?.map((e=>({...e,gpsLatitude:Qi(e.latitude??Wi[0]),gpsLongitude:Qi(e.longitude??Wi[1])})))||[])(s?.key??"");l(e)})(),s?.key&&e?.("addressRetail")?.onChange?.("")}),[s.key]);const{points:m}=el({data:n,filtrationState:{},getBalloon:Ra}),u=Boolean(s?.key);return c("div",{children:[o(zn,{label:"Адрес отделения",placeholder:"Выберите отделение",options:n.map((({id:e,address:t=""})=>({key:e?.toString()||"",text:t}))),...li(e("addressRetail"),ti.addressRetail,t?.required&&u),isSearch:!0}),o("div",{className:"h-[600px]",children:o(Ma,{children:o(Hi,{points:m,isLoad:!r,className:"h-full",selectedAddress:d?.value?.text})})})]})})),al=(e,{normalize:t,format:n})=>{const{value:a,onFocus:r,onBlur:s,onChange:o}=e,[c,d]=i(!1),m=l((e=>{d(!0),r&&r(e)}),[]),u=l((()=>{d(!1),o&&o(t(a)),s&&s()}),[o,a]);return{value:c||!n?a:n(a),onFocus:m,onBlur:u}},ll=(e,t,n)=>Math.max(t,Math.min(e,n));function rl(e){const t=(e||"").replace(/\D/g,""),n=parseInt(t,10);return Number.isNaN(n)?0:n}function sl({list:e=[],min:t,max:n,step:i,value:a=e[0]||t,disabled:l,onChange:r}){const s=e.length?e.indexOf(a):a,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:i,value:s,disabled:l,onChange:t=>{const n=rl(t.target?.value),i=e.length?e[n]:n;r&&r(i||0)}})})]})}const ol=1,cl=100,dl=d((e=>{const{className:t,title:n,items:i=[],list:a=[],min:r=(a.length?0:ol),max:s=(a.length?a.length-1:cl),step:d=1,value:m=a[0]||r,disabled:h=!1,onChange:p}=e,g=al(e,{normalize:(e=0)=>a.length?ml(a)(e):ll(e,r,s),format:We()}),f=l((e=>{p&&p(rl(e.target?.value))}),[p]);return c("div",{className:t,children:[c("label",{className:"block relative",children:[n?o(_e,{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",gn,"disabled:border-gray disabled:bg-main-divider"),disabled:h,onChange:f,...g}),sl({list:a,min:r,max:s,step:d,disabled:h,value:m,onChange:p})]}),ul(i)]})})),ml=e=>t=>e.reduce(((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e)),ul=e=>o("div",{className:"flex justify-between my-xs",children:e.map(((e,t)=>o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e},String(t))))}),hl=["От 1 000 ₽","До 1 000 000 000 ₽"],pl=d((({field:e})=>o(dl,{title:"Сумма, ₽",items:hl,min:1e3,max:1e9,...e("amount")}))),gl=zt((({field:e,source:t,label:n,fieldName:i,input:a,placeholder:l="Выберите из списка",isSearch:r=!1})=>{const s=t&&t?.map((e=>({key:e.key||"",text:e.value})))||[];return o(zn,{placeholder:l,label:n,options:s,isSearch:r,...li(e(i),ti[i],a?.required)})})),fl=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYEES_NUMBER");return o(gl,{field:e,source:n,label:"Количество работающих в организации",fieldName:"amountWorkers",input:t})})),xl=d((({field:e,input:t})=>o(Tn,{label:"Годовая выручка, ₽",...li(e("annualRevenue"),ti.annualRevenue,t?.required)}))),yl=d((({field:e,input:t})=>o(Ri,{text:"Наличие военного билета",...li(e("armyIdFlg"),ti.armyIdFlg,t?.required)}))),bl=d((({field:e,input:t})=>o(Tn,{label:"Код представителя Банка",placeholder:"Введите код",type:"number",...li(e("bankEmployeeCode"),ti.bankEmployeeCode,t?.required),...t}))),vl=d((({field:e})=>o(Tn,{label:"ФИО или должность обслуживавшего Вас сотрудника Банка",...e("bankEmpolee")}))),Nl=d((({field:e,input:t})=>o(Ri,{text:"В отношении меня ведётся производство по делу о банкротстве",...li(e("bankruptcyFlg"),ti.bankruptcyFlg,t?.required)}))),wl=({today:e,firstDayOfWeek:t,totalDays:n,currentMonth:i,currentYear:a,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(a,i,d),n=Cl(t,e),c=Sl(t,l,r);u.push(o("td",{children:o("div",{className:kl(n,c),onClick:()=>!c&&s(t),children:d})},`day-${d}`)),d++}c.push(o("tr",{children:u},`row-${m}`))}return c},Cl=(e,t)=>t&&e.toDateString()===t.toDateString(),Sl=(e,t,n)=>t&&e.getTime()<t.getTime()||n&&e.getTime()>n.getTime(),kl=(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"),Il=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],Tl=d((({today:e,currentMonth:t,currentYear:n,min:i,max:a,onDateSelect:s=pn,setValue:d=pn})=>{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:Il.map(((e,t)=>o("th",{className:"p-s",children:e},String(t))))})}),o("tbody",{children:wl({firstDayOfWeek:u,today:e,totalDays:h,currentYear:n,currentMonth:t,min:i,max:a,onDateClick:m})})]})})),Bl=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"];function Pl(e,t){const n=e.replace(/\D/g,"");if(""===n||e?.length===t.length)return e;const i=[...t],a=i.findIndex(Rl),l=i.map(((e,t)=>Ml(e)?i.slice(0,t).filter(Ml).length:-1)),r=i.map(((e,t)=>Dl(e)?e:n.charAt(l[t])||e)),s=l.indexOf(n.length-1)+1;return r.slice(0,Math.max(a,s)).join("")}const Rl=e=>"_"===e,Dl=e=>/\d/.test(e),Ml=e=>Rl(e)||Dl(e),_l=1940,Al={name:"CalendarIcon",iconVersion:"black",width:"24",height:"24"},El=d((({setSelectedMonth:e,setSelectedYear:t,className:n,value:l,disabled:r,onChange:d,onClick:m})=>{const h=s(null),[p,g]=i(l||"");return a((()=>{g(l||"")}),[l]),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(Pl(t,"__.__.____"))},onBlur:()=>{if(zl(p)){const[n,i,a]=p.split(".");d?.(new Date(Number(a),Number(i)-1,Number(n))),e(Number(i)-1),t(Number(a))}else g(l||"")},disabled:r}),r?null:o(W,{className:"mr-s",...Al})]})})),zl=e=>{const[t,n,i]=e.split(".");if((e=>Number(e)>=_l&&Number(e)<=(new Date).getFullYear())(i)&&(e=>Number(e)>0&&Number(e)<13)(n)){const e=new Date(Number(i),Number(n)-1,1);let a=0;for(;e.getMonth()===Number(n)-1;)e.setDate(e.getDate()+1),a++;if(Number(t)>0&&Number(t)<=a)return!0}return!1},Fl=({handleChangeVisibleCalendar:e,value:t,valid:n,onChange:i,setSelectedMonth:a,setSelectedYear:l,disabled:r=!1})=>o(El,{onChange:i,disabled:r,onClick:e,value:t&&Lt(t),setSelectedMonth:a,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")}),Vl=Bl.map((e=>({key:e}))),Ol=Array.from({length:(new Date).getFullYear()-_l+1},((e,t)=>_l+t)).reverse().map((e=>({key:String(e)}))),Ll=(e,t)=>{const n=new Date(e,t,1);let i=0;for(;n.getMonth()===t;)i++,n.setDate(n.getDate()+1);return i},jl=({maxDateOfMonth:e,selectedYear:t,selectedMonth:n,value:i,onChange:a})=>{i&&a?.(new Date(t,n,Math.min(e,i.getDate())))},ql={name:"ArrowUpIcon",iconVersion:"black",width:"24",height:"24"},$l={className:"min-w-32",iconVersion:"black",isBorder:!1},Ul=d((({className:e="",label:t="",value:n,valid:r=!0,minDate:s,maxDate:d,disabled:m,onChange:h})=>{const[p,{setValue:g}]=dn(!1),[f,x]=i(n?.getMonth()||(new Date).getMonth()),[y,b]=i(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:i,onYearSelect:a,selectedYear:r,onChange:s,value:o})=>{const c=un(l((()=>t&&e(!1)),[t]));return{handleChangeVisibleCalendar:l((()=>e(!t)),[t]),handleNextMonth:l((()=>{n+1<=11?i(n+1):(i(0),a(r+1))}),[n]),handlePrevMonth:l((()=>{n-1>=0?i(n-1):(i(11),a(r-1))}),[n]),handleSelectMonth:l((({key:e})=>{i(Bl.indexOf(e));const t=Ll(r,Bl.indexOf(e));jl({maxDateOfMonth:t,selectedYear:r,selectedMonth:Bl.indexOf(e),value:o,onChange:s})}),[o]),handleSelectYear:l((({key:e})=>{a(Number(e)),o&&s?.(new Date(Number(e),n,o?.getDate()))}),[o]),monthsOptions:Vl,yearsOptions:Ol,ref:c}})({onYearSelect:b,onMonthSelect:x,onShowCalendar:g,selectedYear:y,selectedMonth:f,showCalendar:p,onChange:h,value:n}),B=((e,t)=>{const[n,l]=i(!1);return a((()=>{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:[fn(t),c("div",{className:"relative",children:[Fl({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":B}),children:[c("div",{className:"flex gap-s",children:[o("div",{className:"my-auto",onClick:v,children:o(W,{...ql,className:"-rotate-90 cursor-pointer"})}),o(Mn,{onChange:w,value:{key:Bl[f]},options:S,...$l}),o(Mn,{onChange:C,value:{key:String(y)},options:k,...$l}),o("div",{className:"my-auto",onClick:N,children:o(W,{...ql,className:"rotate-90 cursor-pointer"})})]}),o(Tl,{today:n,currentMonth:f,currentYear:y,onDateSelect:h,min:s,max:d,setValue:g})]}):null]})]})})),Wl=d((({className:e,label:t,error:n,errors:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ul,{label:hn({label:t,errors:i}),valid:Boolean(!n),...a}),vn(n)]}))),Hl=d((({field:e,input:t})=>o(Wl,{label:"Дата начала работы на текущем месте",...li(e("beginDate"),ti.beginDate,t?.required),...t}))),Yl="birthday",Kl=d((({field:e,input:t,isRetailForm:n=!1})=>{const{value:i}=e(Yl);return o(Wl,{label:"Дата рождения",...li(e(Yl),ti.birthday,t?.required),error:n&&i&&!Gl(i)?"Допустимый возраст заёмщика - от 23 до 75 лет":"",disabled:t?.filledByEsia&&vi(e,Yl)})})),Gl=e=>{const t=new Date,n=new Date(t.getFullYear()-23,t.getMonth(),t.getDate()),i=new Date(t.getFullYear()-75,t.getMonth(),t.getDate());return!(!e||e>n||e<i)},Xl=d((({field:e,input:t})=>o(Tn,{label:"Место рождения",...li(e("birthPlace"),ti.birthPlace,t?.required),...t,disabled:t?.filledByEsia&&vi(e,"birthPlace")}))),Jl=d((({field:e,input:t})=>{const[n,l]=i([]),r=e("paymentSystem").value;return a((()=>{(async()=>{const e=await(async e=>{const t=await Ji("/dictionaryFiltered","POST",{type:"CARD_TYPE",presets:{paymentSystemType:e,creditProgramId:13}});return await(t?.json())})(r);l(e)})()}),[r]),o(gl,{field:e,source:n,label:"Категория карты",fieldName:"cardCategory",input:t})})),Zl=d((({field:e,input:t})=>o(Tn,{label:"Количество детей до 18 лет",placeholder:"Введите значение",type:"number",...li(e("children"),ti.children,t?.required),...t}))),Ql=d((({field:e,input:t})=>o(Tn,{label:"Кодовое слово",...li(e("codeWord"),ti.codeWord,t?.required),...t}))),er=d((({field:e,input:t})=>o(Tn,{label:"Количество объектов инкассации",type:"number",...li(e("collectionCount"),ti.collectionCount,t?.required)}))),tr=d((({field:e,input:t})=>o(Tn,{className:"col-span-2",...li(e("comment"),ti.comment,t?.required),placeholder:"Ваше сообщение",isTextarea:!0}))),nr=d((({field:e,input:t})=>{const{data:n}=tl("INCOME_CERT_UNITED");return o(gl,{field:e,source:n,label:"Способ подтверждения дохода",fieldName:"confirmationIncome",input:t})})),ir=d((({field:e,input:t})=>{const{data:n}=tl("MILITARY_STATUS");return o(gl,{field:e,source:n,label:"Статус военнообязанного",fieldName:"conscription",input:t})})),ar={processPersonalDataFlg:{text:"Согласие на обработку персональных данных",docId:4},consentInformFlg:{text:"Согласие на информирование о продуктах и услугах Банка",docId:14},consentProviderFlg:{text:"Согласие об использовании простой электронной подписи",docId:5},consentOthersFlg:{text:"Прочие согласия",docId:1},consentPfrFlg:{text:"Согласие на запрос в ПФР",docId:3},consentToReceiveMaterials:{text:"Согласен на получение информационных и аналитических материалов по электронной почте"}},lr=async(e,t=!1)=>{const n=await(async(e,t=!1)=>{const n=await Ji(`/feedback/file?id=${encodeURIComponent(e)}&convertToPngFlg=${t}`,"GET");return n?await n.blob():new Blob})(e,t);return URL.createObjectURL(n)},rr=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"})}))),sr=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full bg-white pt-0 p-lg",e),role:"dialog",children:[c("div",{className:"sticky py-xl top-0 bg-white z-10",children:[o(rr,{className:"absolute top-0 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),or=async(e,t,n=!1)=>{const i=await lr(t,n);e(o(sr,{className:"my-6xl max-w-4xl mx-auto px-0 min-h-0 pb-0",children:n?o("img",{src:i}):o("iframe",{src:`${i}#toolbar=0`,className:"w-full h-[80vh]",id:"iframe-dialog"})}))},cr=d((({className:e,error:t,docId:n,...i})=>{const{open:a}=me(),l=Se();return c("div",{className:e,children:[c("div",{className:"flex flex-wrap gap-x-m",children:[o(ki,{...i}),n?o(ve,{className:"text-primary-main",onClick:()=>or(a,n,l),children:o(_e,{children:"Ознакомиться"})}):null]}),vn(t)]})})),dr=d((({field:e,input:t})=>t&&t.name?o(cr,{text:ar[t.name]?.text,docId:ar[t.name]?.docId,...li(e(t.name),ti[t.name],t?.required)}):null)),mr=d((({field:e,input:t})=>{const{data:n}=tl("CREDIT_IN_RSHB");return o(gl,{field:e,source:n,label:"Имеет ли юридическое лицо, акционером / участником / членом / пайщиком / \n вкладчиком с долей участия более 20% уставного капитала руководителем, \n которого Вы являетесь, кредит в АО «Россельхозбанк»",fieldName:"creditInRshbCd",input:t})})),ur={horizontal:"@lg:flex-row",vertical:""},hr=d((({label:e,items:t,value:n,className:i,onChange:a,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(_e,{color:"text-secondary-text",font:"font-light",children:e})}):null,o("div",{className:u("flex flex-col gap-s",ur[r],i),role:"radiogroup","aria-label":"Группа кнопок",children:t?.map((({id:e,text:t})=>o(ki,{isRadio:!0,text:t,value:n===e,onChange:()=>a&&a(e),disabled:l},String(e))))})]}))),pr=d((({className:e,label:t,onChange:n,error:i,...a})=>c("div",{className:u("shrink-0 w-full",e),children:[o(hr,{label:hn({label:t,errors:a?.errors}),onChange:e=>n&&n(e),...a}),vn(i)]}))),gr=[{id:"rub",text:"Рубль"}],fr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("currency");return o(pr,{label:"Валюта",orientation:"horizontal",items:gr,value:n,onChange:e=>i?.(e),...li(e("currency"),ti.currency,t?.required)})})),xr=d((({field:e,input:t})=>o(Wl,{label:"Дата доставки",...li(e("deliveryDate"),ti.deliveryDate,t?.required)}))),yr=d((({field:e,input:t})=>o(Tn,{label:"Количество иждивенцев",placeholder:"За исключение детей до 18 лет",type:"number",maxLength:2,...li(e("dependents"),ti.dependents,t?.required),...t}))),br=d((({field:e,input:t})=>o(Wl,{label:"Желаемая дата встречи",...li(e("desiredMeetingDate"),ti.meetingDay,t?.required)}))),vr=d((({field:e,input:t})=>o(Ri,{text:"Являюсь инвалидом",...li(e("disablePeopleFlg"),ti.disablePeopleFlg,t?.required)}))),Nr="dulIssueDateField",wr=d((({field:e,input:t})=>o(Wl,{label:"Дата выдачи",...li(e(Nr),ti.dulIssueDateField,t?.required),disabled:t?.filledByEsia&&vi(e,Nr)}))),Cr="dulIssuedBy",Sr=d((({field:e,input:t})=>{const{value:n,onChange:i}=e("dulSubdivisionCode"),a=l((e=>{i?.(e?.data?.code?.replace("-",""))}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Cr),label:"Кем выдан",...t,...li(e(Cr),ti.dulIssuedBy,t?.required),onDaDataChange:a,daDataQueryPrefix:n})})),kr=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulNumber"),label:"Номер документа",type:"number",maxLength:6,...li(e("dulNumber"),ti.dulNumber,t?.required)}))),Ir=d((({field:e,input:t})=>o(Tn,{disabled:t?.filledByEsia&&vi(e,"dulSerie"),label:"Серия документа",type:"number",maxLength:4,...li(e("dulSerie"),ti.dulSerie,t?.required)}))),Tr="dulSubdivisionCode",Br=d((({field:e,input:t})=>{const n=l((t=>{e?.("dulIssuedBy")?.onChange?.(t?.data?.name)}),[]);return o(Tn,{disabled:t?.filledByEsia&&vi(e,Tr),label:"Код подразделения",type:"number",maxLength:6,...t,...li(e(Tr),ti.dulSubdivisionCode,t?.required),onDaDataChange:n})})),Pr=d((({field:e,input:t})=>{const{data:n}=tl("EDUCATION_LEVEL");return o(gl,{field:e,source:n,label:"Образование",fieldName:"education",input:t})})),Rr=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{label:"Электронная почта",...li(e("email"),ti.email,n),...i})})),Dr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_ACTIVITY_TYPE");return o(gl,{field:e,source:n,label:"Вид деятельности организации-работодателя",fieldName:"employerActivities",input:t})})),Mr=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_KIND");return o(gl,{field:e,source:n,label:"Вид организации работодателя",fieldName:"employerOrganization",input:t})})),_r=d((({field:e,input:t})=>{const{data:n}=tl("EMPLOYMENT_INFO_UNITED");return o(gl,{field:e,source:n,label:"Информация о трудоустройстве",fieldName:"employment",input:t})})),Ar=d((({field:e,input:t})=>o(Tn,{label:"Обязательные расходы в месяц",placeholder:"Введите значение",type:"number",...li(e("expenses"),ti.expenses,t?.required),...t}))),Er=d((({field:e,input:t})=>o(Tn,{label:"Стаж",placeholder:"За последние 5 лет",type:"number",maxLength:2,...li(e("experience5Years"),ti.experience5Years,t?.required),...t}))),zr=d((({field:e})=>{const{value:t,onChange:n}=e("familyMembers"),i=e("familyStatus")?.value?.key,l="MARRIED"===i?2:1,r=Number(e("children")?.value),s=Number(e("dependents")?.value),c=l+r+s;return a((()=>{e?.("familyMembers")?.onChange?.(c)}),[i,r,s]),o(Tn,{label:"Количество членов семьи",placeholder:"Введите значение",type:"number",disabled:!0,value:t,onChange:e=>n?.(e)})})),Fr=d((({field:e,input:t})=>{const{data:n}=tl("MARITAL_STATUS");return o(gl,{field:e,source:n,label:"Семейное положение",fieldName:"familyStatus",input:t})})),Vr=[{key:"ULTRASERVICE",text:"Ультра"},{key:"PREMIUMSERVICE",text:"Премиум"}],Or=[{key:"Физическое лицо"},{key:"Юридическое лицо / ИП"}],Lr=[{key:"phone",text:"Телефонный звонок"},{key:"email",text:"Электронное сообщение"}],jr=d((({field:e,input:t})=>o(zn,{label:"Способ получения ответа",options:Lr,...li(e("feedbackMethod"),ti.feedbackMethod,t?.required)}))),qr=d((({field:e,input:t})=>o(Tn,{label:"ФИО",...li(e("fullName"),ti.fullName,t?.required),...t}))),$r=d((({field:e,input:t})=>o(Tn,{label:"Общий стаж",type:"number",maxLength:2,placeholder:"Количество лет",...li(e("generalSeniority"),ti.generalSeniority,t?.required),...t}))),Ur=d((({field:e,input:t})=>{const{data:n}=tl("HOUSE_TYPE");return o(gl,{field:e,source:n,label:"Тип жилья",fieldName:"housing",input:t})})),Wr=d((({field:e,input:t})=>{const n=l((t=>{e?.("organizationName")?.onChange?.(t.data?.name?.short_with_opf),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"ИНН",type:"number",maxLength:12,...t,...li(e("inn"),ti.inn,t?.required),onDaDataChange:n})})),Hr=d((({field:e})=>o(Ri,{...e("isClient"),text:'Являюсь клиентом банка АО "Россельхозбанк"'}))),Yr=d((({field:e,input:t})=>o(Tn,{label:"Количество мест работы за последние 5 лет",placeholder:"Количество мест",type:"number",maxLength:2,...li(e("jobsNumber"),ti.jobsNumber,t?.required),...t}))),Kr=d((({field:e,input:t})=>o(Tn,{label:"Стаж на последнем рабочем месте",placeholder:"Количество лет",type:"number",maxLength:2,...li(e("lastJobExperience"),ti.lastJobExperience,t?.required),...t}))),Gr=d((({field:e,input:t})=>o(Tn,{label:"Наименование юридического лица",...t,...li(e("legalEntityName"),ti.legalEntityName,t?.required)}))),Xr=d((({field:e,input:t})=>o(Tn,{label:"ОПФ",placeholder:"ООО, ПАО и др.",...li(e("legalForm"),ti.legalForm,t?.required),...t}))),Jr=[];async function Zr(){const e=await Pt("/api/v1/outservice/outserviceregions");return e&&Array.isArray(e)?e:Jr}const Qr=d((({field:e,input:t})=>{const n=e("region")?.value?.key,{data:i}=hi("outServiceRegions",Zr),l=i?.find((e=>e.code===n))?.localities?.map((e=>({key:e,text:e})));return a((()=>{""!==n&&e?.("localities")?.onChange?.("")}),[n]),o(zn,{label:"Населенный пункт",placeholder:"Выберите город, где доступен сервис",options:l,...li(e("localities"),ti.localities,t?.required),isSearch:!0})})),es=d((({field:e,input:t})=>o(Tn,{label:"Обязательные выплаты",placeholder:"Введите значение",type:"number",...li(e("mandatoryPayments"),ti.mandatoryPayments,t?.required),...t}))),ts=[{id:"office",text:"В отделении Банка"},{id:"courier",text:"Курьерская доставка"}],ns=d((({field:e,input:t})=>o(pr,{orientation:"horizontal",items:ts,...li(e("methodObtain"),ti.methodObtain,t?.required)}))),is="middleName",as=d((({field:e,input:t})=>o(Tn,{label:"Отчество (Обязательно, при наличии)",maxLength:60,disabled:t?.filledByEsia&&vi(e,is),...li(e(is),ti.middleName,t?.required),...t}))),ls=d((({field:e,input:t})=>o(Tn,{label:"Имя",maxLength:60,disabled:t?.filledByEsia&&vi(e,t.name??""),...li(e("name"),ti.name,t?.required),...t}))),rs=d((({value:e=!1,text:t,type:n="checkbox",onChange:i})=>c("div",{role:n,"aria-checked":e,className:"flex justify-start items-center w-full cursor-pointer mb-s",onClick:()=>i&&i(!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(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:t}):null]}))),ss=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу онлайн-кассу",...e("onlineCheckout")}):null)),os=d((({field:e,input:t})=>{const{data:n}=tl("ORGANIZATION_TYPE");return o(gl,{field:e,source:n,label:"Тип организации",fieldName:"organization",input:t})})),cs=d((({field:e,input:t})=>{const n=l((t=>{e?.("inn")?.onChange?.(t.data?.inn),e?.("legalForm")?.onChange?.(t.data?.opf?.short)}),[]);return o(Tn,{label:"Наименование организации",...t,...li(e("organizationName"),ti.organizationName,t?.required),onDaDataChange:n})})),ds=d((({field:e,input:t})=>o(Tn,{label:"Иные доходы",placeholder:"Введите значение",type:"number",...li(e("otherIncome"),ti.otherIncome,t?.required),...t}))),ms=d((({field:e,input:t})=>o(Wl,{label:"Дата регистрации по месту жительства",...li(e("participantDateRegistration"),ti.participantDateRegistration,t?.required)}))),us=d((({field:e,input:t})=>{const n="BUSINESS_OWNER"===e("positionOrganization")?.value?.key,i={...li(e("partInBusiness"),ti.partInBusiness,t?.required)};return o(Tn,{label:"Доля участия в бизнесе",placeholder:"в %",type:"number",maxLength:3,...i,...t,onChange:e=>i?.onChange&&i?.onChange(String(Number(e)>100?100:Number(e)||"")),value:n?i?.value:"",disabled:!n})})),hs=d((({field:e,input:t})=>{const{required:n,...i}=t;return o(Tn,{...li(e("partnerComments"),ti.partnerComments,n),placeholder:"Укажите интересующий вас вопрос",isTextarea:!0,...i})})),ps=d((({field:e,input:t})=>{const{value:n,onChange:l}=e("paymentSystem"),[r,s]=i([]);return a((()=>{(async()=>{const e=await(async()=>{const e=await Ji("/public-data/creditProgramConditions","POST",{creditProgramId:13});return(await(e?.json()))?.paymentSystems?.map((e=>({id:e.type,text:e.name})))})();s(e||[])})()}),[]),o(pr,{label:"Платежная система",orientation:"horizontal",items:r,value:n,onChange:e=>l?.(e),...li(e("paymentSystem"),ti.paymentSystem,t?.required)})})),gs=e=>"_"===e,fs=e=>/\d/.test(e),xs=e=>gs(e)||fs(e),ys=[..."+7 (___) ___-__-__"],bs=ys.findIndex(gs),vs=ys.map(((e,t)=>xs(e)?ys.slice(0,t).filter(xs).length:-1));function Ns(e){const t=e.replace(/\D/g,""),n=ys.map(((e,n)=>fs(e)?e:t.charAt(vs[n])||e)),i=vs.indexOf(t.length-1)+1;return(i?n.slice(0,Math.max(bs,i)):n).join("")}const ws=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Ns(e))),[t]),a=l((e=>{"+7 ("===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),Cs=d((({className:e,label:t,error:n,...i})=>c("div",{className:u("shrink-0 w-full",e),children:[o(ws,{"aria-label":t,label:hn({label:t,errors:i?.errors}),valid:Boolean(!n),placeholder:"+7 (___) ___-__-__",...i}),vn(n)]}))),Ss=d((({field:e,input:t})=>{const n=t?.name||"phone";return o(Cs,{label:"Телефон",...li(e(n),ti.phone,t?.required),disabled:t?.filledByEsia&&vi(e,n),...t})})),ks=d((({field:e,input:t})=>{const{data:n}=tl("POSITION");return o(gl,{field:e,source:n,label:"Должность в организации",fieldName:"positionOrganization",input:t})})),Is=d((({field:e})=>oi(e("acquiringType")?.value?.key)?o(rs,{type:"radio",text:"Хочу POS-терминал",...e("posTerminal")}):null)),Ts=zt((({field:e,source:t})=>o(zn,{placeholder:"Выберите продукт",label:"Продукт",options:Bs(t?.productList),...ai(e("product"),ti.product)}))),Bs=e=>(e??[]).map((e=>({key:e,value:e}))),Ps=[];function Rs(e="/api/v1/regions"){const{data:t}=hi(e,Rt);return Array.isArray(t)?t:Ps}const Ds=d((({field:e,input:t,url:n})=>{const i=Rs(n);return o(zn,{label:"Филиал",placeholder:"Выберите филиал",isSearch:!0,options:r((()=>i?.map((({code:e="",name:t=""})=>({key:e,text:t})))),[i]),...li(e("region"),ti.region,t?.required)})})),Ms=d((({field:e,input:t})=>{const n=xi(!0),i=r((()=>n?.map((({region:e})=>({key:e,text:e})))),[n]);return o(zn,{label:"Регион",placeholder:"Выберите регион",options:i,...li(e("region"),ti.region,t?.required)})})),_s=d((({field:e,input:t})=>{const{data:n}=tl("REGION_RF"),i=n?.map((({key:e,value:t})=>({key:e,text:t})));return o(zn,{label:"Регион",placeholder:"Выберите регион",isSearch:!0,options:i,...li(e("regionRetail"),ti.regionRetail,t?.required)})})),As=d((({field:e,input:t})=>{const n=e("wages")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("retirementIncome")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Пенсионные доходы",placeholder:"Введите значение",type:"number",...li(e("retirementIncome"),ti.retirementIncome,t?.required),...t,onChange:i})})),Es=d((({field:e})=>{const t=e("secondaryPhone");return o(Cs,{label:"Дополнительный телефон",...t.value&&"+7 ("!==t.value?ai(t,ti.secondaryPhone):t})})),zs=d((({field:e,input:t})=>o(zn,{label:"Направление обслуживания",placeholder:"Выберите направление",options:Or,...li(e("serviceDirection"),ti.serviceDirection,t?.required)}))),Fs=[{id:"male",text:"Мужской"},{id:"female",text:"Женский"}],Vs=d((({field:e,input:t})=>o(pr,{label:"Пол",orientation:"horizontal",items:Fs,...li(e("sex"),ti.sex,t?.required)}))),Os=d((({field:e,input:t})=>o(Ri,{text:"Я являюсь акционером / участником / членом / пайщиком / вкладчиком с долей участия более 20% уставного капитала юридического лица",...li(e("shareholderFlg"),ti.shareholderFlg,t?.required)}))),Ls=d((({children:e,onChange:t,...n})=>{const i=l((e=>t&&t(Pl(e,"___-___-___ __"))),[t]),a=l((e=>{"___-___-___ __"===e&&t&&t("")}),[]);return o(xn,{...n,onChange:i,onFocus:e=>i(e?.target?.value||""),onBlur:e=>a(e?.target?.value||""),children:e})})),js=d((({className:e,label:t,value:n,error:i,onChange:a,onBlur:l,...r})=>c("div",{className:u("shrink-0 w-full",e),children:[o(Ls,{"aria-label":t,label:hn({label:t,errors:r?.errors}),valid:Boolean(!i),value:n,onChange:a,onBlur:l,placeholder:"___-___-___ __"}),vn(i)]}))),qs=d((({field:e,input:t})=>{const n=e("consentPfrFlg")?.value;return o(js,{label:"СНИЛС",...li(e("snils"),ti.snils,!!n&&t?.required),...t})})),$s=d((({field:e,input:t})=>o(Tn,{label:"Фамилия",maxLength:60,disabled:t?.filledByEsia&&vi(e,"surname"),...li(e("surname"),ti.surname,t?.required),...t}))),Us=["От 1 мес","До 15 лет"],Ws=d((({field:e})=>o(dl,{title:"Срок, месяцев",items:Us,min:1,max:180,...e("term")}))),Hs=d((({field:e,input:t})=>o(Tn,{label:"Совокупный официальный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("totalIncome"),ti.totalIncome,t?.required),...t}))),Ys=d((({field:e,input:t})=>o(zn,{label:"Тип обслуживания",options:Vr,...li(e("serviceType"),ti.serviceType,t?.required)}))),Ks=[{id:"currencyControl",text:"Валютный контроль"},{id:"documentOperations",text:"Документарные операции"},{id:"conversionTransactions",text:"Конверсионные операции"},{id:"otherIssues",text:"Иные вопросы ВЭД"}],Gs=d((({field:e})=>{const{value:t,onChange:n}=e("vedTypes");return a((()=>{"currencyControl"!==t&&(e?.("inn")?.onChange?.(""),e?.("region")?.onChange?.(""))}),[t]),o("div",{className:"py-m gap-m grid @xl:flex @xl:items-center",children:o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Ks,value:t,onChange:e=>n&&n(e)})})})),Xs=d((({field:e,input:t})=>{const n=e("retirementIncome")?.value,i=l((t=>{const i=Number(t)+Number(n||0);e("wages")?.onChange?.(t),e("incomeAverage")?.onChange?.(String(i))}),[n]);return o(Tn,{label:"Совокупный доход в месяц после вычета налогов (зарплата, премии)",placeholder:"Введите значение",type:"number",...li(e("wages"),ti.wages,t?.required),...t,onChange:i})}));const Js={$ref:"/wcms-resources/outservice-productlist.json"},Zs=(e,t,n=!1)=>(i,a)=>{const l="ULTRASERVICE"===t||"PREMIUMSERVICE"===t,r={surname:o($s,{field:e,input:i}),name:o(ls,{field:e,input:i}),middleName:o(as,{field:e,input:i}),phone:o(Ss,{field:e,input:i}),organizationPhone:o(Ss,{field:e,input:i}),email:o(Rr,{field:e,input:i}),fullName:o(qr,{field:e,input:i}),inn:o(Wr,{field:e,input:i}),legalForm:o(Xr,{field:e,input:i}),organizationName:o(cs,{field:e,input:i}),generalSeniority:o($r,{field:e,input:i}),lastJobExperience:o(Kr,{field:e,input:i}),experience5Years:o(Er,{field:e,input:i}),jobsNumber:o(Yr,{field:e,input:i}),beginDate:o(Hl,{field:e,input:i}),addressFact:o(bi,{field:e,input:i}),organizationAddress:o(Ni,{field:e,input:i}),comment:o(tr,{field:e,input:i}),addressBranch:o(yi,{field:e,input:i,isPremium:l}),sex:o(Vs,{field:e,input:i}),birthday:o(Kl,{field:e,input:i,isRetailForm:n}),birthPlace:o(Xl,{field:e,input:i}),desiredMeetingDate:o(br,{field:e,input:i}),product:o(Ts,{field:e,source:Js}),localities:o(Qr,{field:e,input:i}),isClient:o(Hr,{field:e}),partnerComments:o(hs,{field:e,input:i}),collectionCount:o(er,{field:e,input:i}),acquiringType:o(si,{field:e,input:i}),onlineCheckout:o(ss,{field:e}),posTerminal:o(Is,{field:e}),serviceType:o(Ys,{field:e,input:i}),term:o(Ws,{field:e}),amount:o(pl,{field:e}),annualRevenue:o(xl,{field:e,input:i}),vedTypes:o(Gs,{field:e}),feedbackMethod:o(jr,{field:e,input:i}),serviceDirection:o(zs,{field:e,input:i}),bankEmpolee:o(vl,{field:e}),secondaryPhone:o(Es,{field:e}),consentToReceiveMaterials:o(dr,{field:e,input:i}),processPersonalDataFlg:o(dr,{field:e,input:i}),consentProviderFlg:o(dr,{field:e,input:i}),consentOthersFlg:o(dr,{field:e,input:i}),consentInformFlg:o(dr,{field:e,input:i}),consentPfrFlg:o(dr,{field:e,input:i}),applicationDate:o(Tn,{label:"Дата и время обращения в Банк",...e("applicationDate")}),region:l?o(Ms,{field:e}):o(Ds,{field:e,input:i,url:cn(t)}),education:o(Pr,{field:e,input:i}),housing:o(Ur,{field:e,input:i}),employment:o(_r,{field:e,input:i}),organization:o(os,{field:e,input:i}),amountWorkers:o(fl,{field:e,input:i}),employerActivities:o(Dr,{field:e,input:i}),employerOrganization:o(Mr,{field:e,input:i}),positionOrganization:o(ks,{field:e,input:i}),familyStatus:o(Fr,{field:e,input:i}),children:o(Zl,{field:e,input:i}),familyMembers:o(zr,{field:e,input:i}),dependents:o(yr,{field:e,input:i}),totalIncome:o(Hs,{field:e,input:i}),expenses:o(Ar,{field:e,input:i}),snils:o(qs,{field:e,input:i}),conscription:o(ir,{field:e,input:i}),armyIdFlg:o(yl,{field:e,input:i}),dulSerie:o(Ir,{field:e,input:i}),dulNumber:o(kr,{field:e,input:i}),dulIssueDateField:o(wr,{field:e,input:i}),dulSubdivisionCode:o(Br,{field:e,input:i}),dulIssuedBy:o(Sr,{field:e,input:i}),addressRegistration:o(Ni,{field:e,input:i}),addressCourier:o(Ni,{field:e,input:i}),participantDateRegistration:o(ms,{field:e,input:i}),retirementIncome:o(As,{field:e,input:i}),otherIncome:o(ds,{field:e,input:i}),wages:o(Xs,{field:e,input:i}),mandatoryPayments:o(es,{field:e,input:i}),disablePeopleFlg:o(vr,{field:e,input:i}),bankruptcyFlg:o(Nl,{field:e,input:i}),shareholderFlg:o(Os,{field:e,input:i}),legalEntityName:o(Gr,{field:e,input:i}),creditInRshbCd:o(mr,{field:e,input:i}),bankEmployeeCode:o(bl,{field:e,input:i}),partInBusiness:o(us,{field:e,input:i}),regionRetail:o(_s,{field:e,input:i}),addressRetail:o(il,{field:e,input:i}),addressMatch:o(Di,{field:e,input:i}),paymentSystem:o(ps,{field:e,input:i}),currency:o(fr,{field:e,input:i}),cardCategory:o(Jl,{field:e,input:i}),codeWord:o(Ql,{field:e,input:i}),confirmationIncome:o(nr,{field:e,input:i}),methodObtain:o(ns,{field:e,input:i}),deliveryDate:o(xr,{field:e,input:i})};return function({input:e,field:t}){const{condition:n}=e,{value:i}=t(n?.name||"");return!n||n?.values?.find((e=>e===(i?.key??i)))}({input:i,field:e})?o("div",{children:r[i?.name||""]},String(a)):null},Qs=e=>2===e?"@xl:grid-cols-2":"",eo=e=>e?o("div",{className:"@xl:text-center @xl:col-span-2 mb-m",children:o(_e,{size:"text-h6",children:e})}):null,to=d((function({responseType:e,typeForm:t}){const n="OK"===e,i=n?"ResponseOKIcon":"ResponseFailIcon",{close:a}=me(),r=l((()=>{a()}),[]),s="ANTIFRAUD"===t?"Сообщение отправлено. Для уточнения информации с Вами могут связаться работники Банка либо Вы\n можете самостоятельно позвонить по номеру контакт-центра +78001000100. Будьте внимательны, работники Банка\n не звонят с использованием мессенджеров.":"Совсем скоро мы с вами свяжемся";return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto ",children:c("div",{className:"flex flex-col gap-lg items-center rounded-md space-x-m",children:[o(ne,{image:{icon:i,iconVersion:"normal"},width:"136",height:"136"}),o(k,{className:"w-full",title:n?"Ваша заявка отправлена":"Не удалось отправить заявку",description:n?s:"Пожалуйста, повторите позднее",headlineVersion:"XS",isEmbedded:!0}),o(Oa,{type:"button",onClick:r,children:"Хорошо"})]})})})),no=e=>{const{open:t,close:n}=me();return{open:(n,i={})=>t(o(to,{...e,...n}),i),close:n}},io=e=>t=>t&&Object.entries(e).flatMap((([e,n])=>n(t[e])))||[],ao=e=>{const{acquiringType:t,onlineCheckout:n,posTerminal:i,amount:a,term:l,annualRevenue:r,serviceType:s,vedTypes:o,region:c,...d}=e,m=t||r?(e=>{const{acquiringType:t,onlineCheckout:n=!1,posTerminal:i=!1,term:a,amount:l,annualRevenue:r}=e;return t?`Вид эквайринга=${t?.text||""}${oi(t?.key)?`/Онлайн касса=${n}/POS-терминал=${i}`:"/Онлайн касса=false/POS-терминал=false"}`:`Сумма=${l}/Срок=${a}/Выручка=${r}`})(e):null,u={...d,...ro(o),...lo(c),...m?{partnerComments:m}:{},...s?{typeForm:s}:{}};return Object.fromEntries(Object.entries(u)?.map((([e,t])=>[e,t?.key||t])))},lo=e=>e?.key||e?.text?{region:e?.text||e?.key}:{},ro=e=>e?{vedTypes:Object.fromEntries(Ks.map((({id:t})=>[t,t===e])))}:{},so={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,addressRetail:{key:"",text:""}},oo=d((({text:e,link:t})=>c(C,{size:"text-l",font:"font-light",color:"text-secondary-text",children:[e?o(_e,{children:e}):null,t?o(ve,{href:t.href,ariaLabel:"условия передачи данных",target:t.target||"",className:"!text-left text-primary-main",children:o(_e,{children:t.text})}):null]}))),co=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),mo=(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(ki,{...e}),o(oo,{link:t})]}),vn(ai(e,Gn).error)]}):o(oo,{text:"Нажимая кнопку, вы подтверждаете согласие с ",link:t}),co(n)]}),uo={send:async function(e,t=!1){const{typeForm:n,region:i,phone:a="",email:l,birthday:r,desiredMeetingDate:s,inn:o,addressBranch:c,secondaryPhone:d="",bankEmpolee:m,applicationDate:u,serviceDirection:h,...p}=e,g=t&&"Юридическое лицо / ИП"!==h,f="/api/v1"+(g?"/lead":"/sendcorporatelead"),x={typeForm:n,...Ut(i,g),...Wt(l,g),...qt(a),...$t(s,"desiredMeetingDate"),...g?$t(r):{inn:o},..."FEEDBACK"===n?{}:{addressBranch:c,bankEmpolee:m,applicationDate:u,...Ht(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}}},ho=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="")=>{const n=Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||so[e.name||""]])));return n?.serviceType&&"PREMIUMSERVICE"===t&&(n.serviceType=Vr[1]),{...n,typeForm:{key:t,text:""}}})(x,n),[b,v]=i(""),N=no({typeForm:n}),C=l((async(e,t)=>{const n=po(x,e),i=io(ii(n));if(!Fn(i(e)))return console.warn("validation fail");const a=ao({...e,...h}),l=await uo.send(a,"lead"===m)?"OK":"Fail";if(v(l),l&&N.open({responseType:l}),"OK"===l&&g){const e=an();Yt({aspectsAttributes:g,aspects:e,ev:t})}return l}),[]),[,{field:S,onSubmit:k,reset:I}]=rn(y,{onSubmit:C}),T=(e=>e?.find((e=>"consentDataProcessing"===e?.name)))(x)?.name;return a((()=>{"OK"===b&&(v(""),I())}),[b]),c(on,{className:u("container space-y-m",e),title:t,...f,children:[c("form",{onSubmit:k,children:[r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),(e?.inputs||[])?.map(Zs(S,n))]},`section-${t}`))),mo(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]})})),po=(e,t)=>e.filter((e=>"secondaryPhone"===e?.name?Boolean(t.secondaryPhone):e)).filter((e=>!e?.condition||e?.condition.values.find((n=>{const i=t?.[e?.condition?.name??""];return n===(i?.key??i)}))));function go(e){const[t,n]=i(JSON.parse(globalThis.localStorage?.getItem(e)||"null"));return[t,l((t=>{globalThis.localStorage?.setItem(e,JSON.stringify(t)),n(t)}),[e,globalThis.localStorage])]}const fo=d((({inputs:e=[],typeForm:t="",field:n,key:i})=>{const a=e.every((e=>Boolean(n(e.name).value))),l=r((()=>e?.filter((e=>e.required))?.some((e=>Boolean(ai(n(e?.name),ti[e?.name]).error)))),[e]);return o("div",{className:"w-fit",children:o(ea,{isFoldButtonOnTop:!0,unfoldedByDefault:!0,renderFoldableSection:({isUnfolded:i})=>o(ta,{isUnfolded:i,className:"flex flex-col pl-2xl",children:e.map(Zs(n,t))}),renderFoldButton:xo(c("div",{children:[o(ki,{value:a,onChange:t=>{for(const i of e){const e=n(i.name);e?.onChange&&e.onChange(t)}},text:"Согласие на все документы"},i),vn(l?"Отметьте все обязательные соглашения":"")]}))})})})),xo=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"})})]}),yo=({field:e,typeForm:t="",inputs:n,isRetailForm:i=!1})=>{const{consentInputs:a,restInputs:l}=bo(n||[]);return a.length>2?c("div",{children:[l.map(Zs(e,t,i)),o(fo,{inputs:a,field:e})]}):(n||[])?.map(Zs(e,t,i))},bo=e=>({consentInputs:e?.filter((e=>Object.keys(ar).includes(e.name||"")))||[],restInputs:e?.filter((e=>!Object.keys(ar).includes(e.name||"")))||[]}),vo={typeForm:"",region:{key:"",text:""},addressBranch:{key:"",text:""},surname:"",name:"",phone:"",secondaryPhone:"",organizationPhone:"",comment:"",product:"",partnerComments:"",annualRevenue:"",term:12,amount:1e5,acquiringType:ri[0],serviceType:Vr[0],feedbackMethod:Lr[0],serviceDirection:Or[0],vedTypes:Ks[0],birthday:void 0,isClient:!1,onlineCheckout:!1,posTerminal:!1,consentToReceiveMaterials:!1,consentDataProcessing:!1,processPersonalDataFlg:!1,consentProviderFlg:!1,consentOthersFlg:!1,consentInformFlg:!1,addressRegistration:"",participantDateRegistration:void 0,currency:"",paymentSystem:"",cardCategory:{key:"",text:""},codeWord:"",addressRetail:{key:"",text:""}},No=(e,t,n="")=>{if(t){const e={...t};return e.birthday=new Date(e?.birthday||0),e}return{...Object.fromEntries(e.map((e=>[e.name,"ved"===e.fieldType&&e?.defaultValue||vo[e.name||""]]))),typeForm:{key:n,text:""}}},wo=(e,t)=>o(Oa,{className:u("w-full @xl:w-auto",t),type:"submit",children:e?.text?e.text:"Отправить заявку"}),Co=e=>Xi("/user-data/updateUserProfile","PUT",e),So=e=>Xi("/user-data/updateUserTask","PUT",e),ko=(e,t)=>Boolean(e)&&"string"!=typeof e&&Boolean(e?.errorMessage.startsWith(`Too many request for phoneNumber [${t}]`)),Io={width:"103",height:"21"},To={"bg-white":"color",transparent:"white"},Bo={"bg-white":"text-primary-main",transparent:"text-white"},Po=(e,t,n)=>o(ne,{image:t?.src?t:{icon:t?.icon||"LogoIcon",iconVersion:To[e]},className:Bo[e],width:n?.width,height:n?.height}),Ro={"bg-white":"text-primary-text",transparent:"text-white"},Do=d((({className:e,href:t="/",logo:n,children:i,targetBlank:a,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:a?"_blank":"_self","aria-label":n?.title??"Россельхозбанк",...ge(s),children:[Po(l,n?.image,Io),r?i??o("div",{className:"ml-s",children:o(_e,{font:"font-medium",color:Ro[l],size:"text-s",children:n?.title??"Россельхозбанк"})}):null]}))),Mo=d((({phoneNumber:e,close:t,sendCode:n,onClose:r})=>{const[s,d]=i(""),[m,u]=i(""),[h,p]=i(!1),g=l((async()=>{const e=await(i={captchaText:m},Ji("/sms/checkCaptcha","POST",i).then((e=>e.text())).then((e=>"ERROR"!==e)));var i;e?(n?.(),t?.()):p(e)}),[]),f=l((()=>{(async()=>{d(URL.createObjectURL(await(e=>Ji(`/sms/createCaptcha?phoneNumber=${encodeURIComponent(e)}`,"GET").then((async e=>e?await e.blob():new Blob)))(e)))})()}),[]);return a(f,[]),o(sr,{head:o(Do,{}),onClose:r,className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",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:s}),o("div",{onClick:f,className:"flex w-8 items-center justify-center cursor-pointer",children:o(W,{iconVersion:"normal",name:"RefreshIcon"})})]}),o(xn,{className:"w-[300px]",onChange:u,value:m,placeholder:"Введите код с картинки"}),h?o("div",{className:"text-error",children:"Неверный код"}):null,c("div",{className:"flex w-[310px] justify-between",children:[o(Oa,{onClick:t,version:"secondary",children:"Вернуться"}),o(Oa,{type:"submit",disabled:!m,onClick:g,version:"secondary",children:"Отправить"})]})]})})})),_o=d((({time:e,setTime:t,className:n})=>(a((()=>{const n=setInterval((()=>{t(e-1)}),1e3);return 0===e&&clearInterval(n),()=>{clearInterval(n)}}),[e]),o("span",{className:n,children:Ao(e)})))),Ao=e=>`${`${Math.floor(e/60)}`.padStart(2,"0")}:${(""+e%60).padStart(2,"0")}`,Eo=d((({values:e,setValues:t,hasError:n,errorText:r})=>{const[d,m]=i(0),u=s([]);a((()=>{u.current?.[d]?.focus()}),[d]);const h=l((n=>i=>{const{value:a}=i.currentTarget,l=a.slice(0,1);t(e.map(((e,t)=>t===n?l:e))),m(n+1)}),[e]),p=l((n=>i=>{const{key:a}=i;if("Backspace"===a&&!e[n]){const i=n>0?n-1:e.length-1,a=e.map(((e,t)=>t===i?"":e));t(a),m(i)}}),[e]),g=l((n=>{n.preventDefault();const i=n.clipboardData.getData("text"),a=e.map(((e,t)=>t<i.length?i[t]:e));t(a),m(a.length-1)}),[e]);return c("div",{className:"flex flex-col gap-2 text-center",children:[o("div",{children:e.map(((t,i)=>o("input",{type:"number",maxLength:1,value:t,onChange:h(i),onPaste:g,ref:e=>{u.current||(u.current=[]),u.current[i]=e},onFocus:e=>e.target.select(),onKeyDown:p(i),className:zo(i,e,n)},i)))}),n?o("div",{className:"text-error",children:r}):null]})})),zo=(e,t,n=!1)=>{const i=!t[e];return`w-20 h-24 text-5xl text-center p-lg m-2 border ${n&&i?"border-error":"border-gray"} rounded-md caret-transparent outline-none`},Fo=d((({isDisabled:e,onClick:t,text:n})=>o(Oa,{type:"button",onClick:t,disabled:e,children:o(_e,{font:"font-normal",children:n})}))),Vo=e=>{e&&(globalThis.sessionStorage.setItem("accessToken",e.access_token),globalThis.sessionStorage.setItem("refreshToken",e.refresh_token))},Oo=({close:e,values:t})=>{const[n,s]=i(!1),[o,c]=i(""),[d,m]=i(!1),[u,h]=i(0),[p,g]=i(!1),[f,x]=i(0),y=l((()=>{s(!1),c("")}),[]),b=r((()=>0===u&&p),[u,p]),v=r((()=>f>2||!t.every(Boolean)||b),[t]),N=l((async()=>{try{g(!1),h(0),x(f+1),m(!0),await(async e=>Xi("/sms/checkCode","POST",e).then(Vo))({smsText:t.join(""),smsCodesSetName:{key:"AUTHENTICATION"}}),y(),e&&e(t.join(""))}catch{m(!1),c(f>1?"Исчерпан лимит ввода смс-кода":"Неверный код"),s(!0)}}),[t,f]);return a((()=>{b?(s(!0),c("Код просрочен")):s(!1)}),[b]),{handleSubmit:N,hasError:n,errorText:o,isLoading:d,timeNextReq:u,isSubmitButtonDisabled:v,setTimeNextReq:h,setIsTimerStarted:g,setAttemps:x}},Lo=d((({close:e=pn,onClose:t=pn,title:n,description:r,__html:s,code:d=!0,codeLength:m=4,textButton:u="",phoneNumber:h="+79999999999"})=>{const[p,g]=i(Array(m).fill("")),{handleSubmit:f,hasError:x,errorText:y,isLoading:b,timeNextReq:v,isSubmitButtonDisabled:N,setTimeNextReq:w,setIsTimerStarted:C,setAttemps:S}=Oo({values:p,close:e}),I=l((async()=>{var e;await(e={phoneNumber:h,smsCodesSetName:{key:"AUTHENTICATION"}},Xi("/sms/sendCode","POST",e).then((t=>!ko(t,e.phoneNumber))))?(S(0),w(180),C(!0)):T.open()}),[]),T=((e,t)=>{const{open:n,close:i,closeAll:a}=me();return{open:()=>n(o(Mo,{close:i,onClose:t,...e})),close:i,closeAll:a}})({phoneNumber:h,sendCode:I},t);return a((()=>{I()}),[]),o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-xl px-5xl py-0",children:c("div",{className:"flex flex-col gap-xl items-center rounded-md",children:[o(k,{className:"w-full",title:n,description:r,headlineVersion:"XS",isEmbedded:!0,as:"h6"}),d?o(Eo,{values:p,setValues:g,errorText:y,hasError:x}):null,qo(v,w,I),o(De,{itemSize:"list-s",__html:s}),jo(u,N,f),b?o(Mi,{blur:!1}):null]})})})),jo=(e,t,n)=>e?o(Fo,{isDisabled:t,onClick:n,text:e}):null,qo=(e,t,n)=>e?c("div",{className:"flex flex-row text-l font-light text-base",children:["Получить новый код можно через",o(_o,{className:"text-base ml-1",time:e,setTime:t})]}):o(ve,{onClick:n,className:"text-primary-main",children:"Получить новый код"}),$o=()=>{const{open:e,close:t}=me();return{open:(n,i)=>e(o(Lo,{onClose:t,close:n,...i})),close:t}},Uo={title:"Подпишите согласие на запрос в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) ускорит решение по кредиту"},Wo={title:"Вы уверены, что хотите отказаться от запроса в БКИ",description:"Согласие на запрос в Бюро кредитных историй (БКИ) повысит вероятность одобрения"},Ho=d((function({handleSubmit:e=pn,onClose:t=pn}){const[n,a]=i(""),[r,s]=i(!1),{open:d,close:m}=me(),u=Se(),h=l((()=>{m(),e(n)}),[n]),p=l((e=>{a(e),"REFUSE"===e&&s(!0)}),[]),g=r?Wo:Uo;return o(sr,{className:"my-6xl max-w-3xl w-full min-h-fit mx-auto rounded-lg py-0 px-5xl",onClose:t,children:c("div",{className:"flex flex-col gap-xl items-center",children:[o("div",{role:"button",onClick:()=>or(d,Ko,u),children:o(w,{className:"text-center text-balance",headingType:"h2",title:g.title})}),o(C,{align:"text-center",children:g.description}),o(hr,{className:"whitespace-normal",orientation:"horizontal",items:Yo,value:n,onChange:p}),o(Oa,{disabled:!n,type:"button",onClick:h,children:"Продолжить"})]})})})),Yo=[{id:"SIGNED",text:"Подписать"},{id:"REFUSE",text:"Отказаться"}],Ko=2,Go=e=>{const{open:t,close:n}=me(),i=$o(),a=(t,a)=>async l=>{n(),"SIGNED"===l&&t?i.open((t=>async n=>{t&&await Co({profile:{id:t,consentBkiFlg:!0,smsConsentBki:n}}),e()})(a),Xo(t)):e()};return{open:(n,i)=>t(o(Ho,{handleSubmit:a(n,i),onClose:e}))}},Xo=e=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Отправить",__html:"<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>\n <ul><li>согласие на запрос информации в БКИ</li></ul>"}),Jo=d((function({handleClose:e}){const t=l((async()=>{const e=await(t={redirectUri:globalThis.location.href},Xi("/esia/getLink","POST",t));var t;e&&(globalThis.location.href=e.link)}),[]);return o(sr,{className:"my-6xl max-w-lg w-full min-h-fit mx-auto rounded-lg",onClose:e,children:c("div",{className:"flex flex-col gap-lg items-center rounded-md",children:[c("div",{className:"flex items-center justify-around w-full",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 items-center justify-between w-full m-0",children:[o(Oa,{type:"button",onClick:t,children:"Заполнить через Госуслуги"}),o(Oa,{type:"button",version:"secondary",onClick:e,children:"Пропустить"})]})]})})})),Zo={email:"EMAIL",phone:"MAIN_PHONE",organizationPhone:"ORGANIZATION_PHONE"},Qo={addressRegistration:"REGISTRATION",addressFact:"RESIDENTAL",organizationAddress:"WORK"},ec={incomeAverage:"INCOME_AVERAGE",mandatoryPayments:"MANDATORY_PAYMENTS",additionalIncome:"ADDITIONAL_INCOME",otherIncome:"OTHER_INCOME",otherPayments:"OTHER_PAYMENTS",rentalIncome:"RENTAL_INCOME",wages:"WAGES",retirementIncome:"RETIREMENT_INCOME"},tc=e=>Object.entries(e).reduce(((e,[t,n])=>t in Zo?[...e,{contactTypeCd:{key:Zo[t]},value:n}]:e),[]),nc=e=>Object.entries(e).reduce(((e,[t,n])=>{if(t in Qo){const i=Object.fromEntries(Object.entries(n??{}).filter((([e])=>!e.startsWith("qc"))).map((([e,t])=>[e,t??""])));return[...e,{addressType:{key:Qo[t]},...i}]}return e}),[]),ic=e=>Object.entries(e).reduce(((e,[t,n])=>t in ec?[...e,{incomeTypeCd:{key:ec[t]},value:Number(n||0)}]:e),[]),ac=({inputs:e,programId:t,nextStepLink:n,saveForm:a})=>{const[r,s]=i(""),[,c]=go("taskId"),[,d]=go("profileId"),[,m]=go("participantId"),u=(e=>{const{open:t,close:n}=me(),i=l((()=>{n(),globalThis.location.href=e}),[]);return{open:(e={})=>t(o(Jo,{handleClose:i}),e),close:n}})(n),h=Go(u.open),p=$o(),g=l(((e,t,n)=>{m(e),c(t),d(n)}),[]);return{handleSubmit:l((async n=>{const i=io(ii(e));if(!Fn(i(n)))return console.warn("validation fail");try{const e=await(l={profile:{phone:jt(n.phone)}},Xi("/public-data/createUserProfile","POST",l).then((e=>e?.profile?.id||null)));if(e&&n?.phone){const i=async()=>{try{await lc({programId:t,profileId:e,formData:n,saveUserData:g,saveForm:a}),p.close(),h.open(n.phone,e)}catch{s("Fail")}},l=Object.keys(ar).filter((e=>n[e])).map((e=>ar[e]?.text));p.open(i,rc(n?.phone,l))}}catch{s("Fail")}var l}),[]),responseStatus:r}},lc=async({programId:e,profileId:t,formData:n,saveUserData:i,saveForm:a})=>{const l=oc(n);await Co(((e,t)=>{const{name:n="",surname:i="",middleName:a="",birthday: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:i,midname:a,birthDate:l&&Lt(l,!0),email:s,phone:jt(r),processPersonalDataFlg:Boolean(o),consentProviderFlg:Boolean(c),consentPfrFlg:Boolean(d),consentPhotoFlg:Boolean(m),consentAssignmentClaimsFlg:Boolean(u),consentCollectionFlg:Boolean(h),consentInformFlg:Boolean(p)}}})(t,l));const{taskId:r,participantId:s}=await(async e=>await Xi("/user-data/createDraftTask","POST",e)||{})({profileId:t,programId:e});await So((({participantId:e,taskId:t,profileId:n,formData:i})=>{const{name:a,surname:l,middleName:r,birthday:s,phone:o,email:c}=i;return{sendToBank:!0,taskKind:"SHORT",task:{taskSource:globalThis.location.origin,id:t,participants:[{birthDate:s&&Lt(s,!0),id:e,midname:r,name:a,surname:l,profile:{id:n},participantContacts:tc({phone:o&&jt(o),email:c}),roleCd:{key:"BORROWER",value:"Заемщик"}}]}}})({participantId:s,taskId:r,profileId:t,formData:l})),i(s,r,t),a(n)},rc=(e,t)=>({title:"Подтвердите номер телефона",description:`Мы отправили код на ${e}`,phoneNumber:jt(e),textButton:"Оформить",__html:`<span>Вводя код, я подтверждаю, что ознакомлен и подписываю:</span>${sc(t)}`}),sc=e=>`<ul>${e?.map((e=>"<li>"+e+"</li>")).join("")}</ul>`,oc=e=>{const{consentOthersFlg:t,...n}=e;return{...n,consentCollectionFlg:t,consentAssignmentClaimsFlg:t,consentPhotoFlg:t}},cc=e=>{const{profile:t,addInfo:n,document:i,addressRegistration:a,addressFact:l}=e;return{name:t?.name,surname:t?.surname,middleName:t?.midname,birthday:t?.birthDate,phone:Ns(t?.phone),email:t?.email,dulIssueDateField:i?.dulIssueDate,dulIssuedBy:i?.dulIssuedBy,dulNumber:i?.dulNumber,dulSerie:i?.dulSerie,dulSubdivisionCode:i?.dulSubdivisionCode,snils:n?.snils,birthPlace:n?.birthPlace,addressRegistration:dc(a),addressFact:dc(l),esiaAccountTypeCd:t?.esiaAccountType}},dc=e=>{const{postcode:t,region:n,regionCode:i,locality:a,city:l,street:r,house:s,building:o,block:c,apartment:d}=e,m=[t,n,a||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:i?.key,fullAddress:m}},mc=e=>{const[t,n]=i(!1),[r]=go("profileId"),[s,o]=go("leadForm"),c=new URLSearchParams(decodeURIComponent(globalThis.location?.search)),d=c.get("code"),m=c.get("state"),u=l((async()=>{if(r&&d&&m){const n=await(t={profileId:r,code:d,state:m,redirectUri:globalThis.location?.href},Xi("/esia/updateProfileEsia","POST",t));n&&o({...s,...cc(n)}),globalThis.location.href=e}var t}),[]);return a((()=>{d?(n(!0),u()):(sessionStorage.removeItem("accessToken"),sessionStorage.removeItem("refreshToken"))}),[]),{isLoading:t}},uc=d((({className:e,title:t,programId:n="",nextStepLink:l="/credit-lead",sections:r=[],button:s,...d})=>{const m=r?.flatMap((e=>e?.inputs))||[],[h,p]=i(""),{isLoading:g}=mc(l),[f,x]=go("leadForm"),y=No(m,f),{handleSubmit:b,responseStatus:v}=ac({inputs:m,programId:n,nextStepLink:l,saveForm:x});if(v){no({responseType:v}).open()}const[,{field:N,onSubmit:w,reset:C}]=rn(y,{onSubmit:b});return a((()=>{"OK"===h&&(p(""),C())}),[h]),o(on,{className:u("container space-y-m",e),title:t,...d,children:c("form",{onSubmit:w,className:"space-y-m relative",children:[g?o(Mi,{blur:!1}):null,r.map(((e,t)=>c("div",{className:u(Qs(e.columns),"grid gap-x-m"),children:[eo(e.title),yo({field:N,inputs:e?.inputs,isRetailForm:!0})]},`section-${t}`))),wo(s)]})})})),hc=d((({title:e,description:t})=>{const n=Se();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"})]})})),pc=(e=!1)=>e?"border border-solid border-gray group-data-secondary:border-white/50 group-data-gray:border-main-divider":"",gc=e=>({height:"calc(100vh - 242px)",minHeight:`${e||866}px`});function fc(e=0){const t=Math.round(10*e);return Array.from({length:t}).fill(0).map(((e,n)=>Math.min(n/t)),1).concat(1)}const xc=d((({className:e,style:t,idx:n,activeIndex:i,observerOptions:c,children:d,onIntersection:m})=>{const h=function(e,{sensitivity:t,rootRef:n}={}){const i=s(null),l=r((()=>({threshold:fc(t),root:n?.current})),[t,n?.current]);return a((()=>{if(!i.current)return;const t=new IntersectionObserver(e,l);return t.observe(i.current),()=>{t.disconnect()}}),[e,l]),i}(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===i),ref:h,role:"listitem",children:d})})),yc=["min-w-full","lg:min-w-[50%]","lg:min-w-[33.3%]","lg:min-w-[25%]"],bc=d((({className:e,itemClassName:t,containerRef:n,activeIndex:i,visibleItemCount:a=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(Nc(n))}),[g,f]),v=a>0?r*Number(a)-1:0,N="vertical-list"===d,w="horizontal-list"===d,C={...w?vc(c,v):{},...N?gc(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(xc,{className:u(m,a?yc[a-1]:"",{"h-full":N},t),style:w?vc(c/4):{},activeIndex:i,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})),vc=(e,t=0)=>({marginLeft:-e+"px",marginRight:-e+"px",paddingLeft:`${e}px`,paddingRight:`${e+t}px`}),Nc=e=>e.map(((e,t)=>[e,t])).filter((([e])=>e&&e.intersectionRatio>=.9)).map((([,e])=>e)),wc={"horizontal-list":"w-6","vertical-list":"h-6"},Cc=({activeIndex:e,onClick:t,listType:n="horizontal-list"})=>(i,a)=>o("div",{className:u("cursor-pointer rounded-full transition-width duration-300 bg-primary-main group-data-secondary:bg-white",a===e?wc[n]:"w-2 h-2 opacity-30"),role:"button","aria-hidden":!0,onClick:()=>t(a)},String(a)),Sc=({activeIndex:e,onClick:t})=>(n,i)=>{const a=i===e,l=a?"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=a?"text-primary-text text-h6 py-xs":"text-l pb-2xs text-secondary-text group-data-secondary:text-white",s=a?"text-l":"text-m group-data-secondary:text-white/80";return c("button",{type:"button",onClick:()=>t(i),"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(i))},kc=e=>e,Ic=(e=kc)=>t=>t.reduceRight(((t,n)=>e(t)>e(n)?t:n)),Tc=Ic(),Bc=(e=kc)=>Ic((t=>-e(t))),Pc=Bc(),Rc=e=>t=>e.scrollWidth/t,Dc=e=>(t,n)=>{e.scrollBy({left:n*Rc(e)(t),behavior:"smooth"})},Mc=({itemCount:e,onVisibleIndicesChange:t})=>{const n=s(null),[a,r]=i([]),o=l((e=>{r((t=>{return(n=t)===(i=e)||Boolean(n&&i&&n?.length===i?.length&&n.every(((e,t)=>e===i[t])))?t:e;var n,i})),t&&t(e)}),[t]),[c,d]=a.length?[Bc()(a),Ic()(a)]:[-1,-1],m=c>0,u=d<e-1,h=l((()=>{var t;n.current&&(m?Dc(n.current)(e,-1):(t=n.current).scrollTo({left:t.scrollWidth,behavior:"smooth"}))}),[e,m]),p=l((()=>{n.current&&(u?Dc(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}]},_c={"horizontal-list":"mx-auto mt-lg w-fit","vertical-list":"absolute flex-col justify-center h-full top-0 left-4"},Ac=d((({className:e="",activeIndex:t=0,dotCount:n=0,listType:i="horizontal-list",version:r,navButtons:s=[],containerRef:c,containerScroll:d})=>{const m=Se(),[h,p]=Mc({itemCount:s.length}),g=Ec(Boolean(s?.length));a((()=>{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(bc,{containerRef:h,snapAlign:"snap-start",itemClassName:"h-36 flex items-stretch w-screen",gap:8,children:s.map(Sc({activeIndex:t,onClick:f}))}):n?o("div",{className:u("flex gap-xs",_c[i],r?"group":"",e,{"pb-xl":s?.length&&m}),"data-ver":r,children:Array.from({length:n}).fill(null).map(Cc({activeIndex:t,onClick:f,listType:i}))}):null})),Ec=(e=!1)=>({behavior:e?"auto":"smooth"}),zc=d((({className:e,disabled:t,...n})=>o(ve,{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"})}))),Fc=d((e=>o(zc,{...e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left"}))),Vc=d((e=>o(zc,{...e,className:`${e.className||""} rotate-180`,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right"}))),Oc="absolute top-0 bottom-0 z-40 hidden @lg:block w-20 pointer-events-none",Lc=d((({className:e,scroll:t,hasBlur:n,arrowsPadded:i,isBottom:a})=>{const{canScrollLeft:l,canScrollRight:r,scrollLeft:s,scrollRight:d}=t,m=i&&!a;return c("div",{className:e,children:[n?jc(t):null,l?o(Fc,{className:u(qc(a),m?"left-1":"left-0"),onClick:s}):null,r?o(Vc,{className:u(qc(a),m?"right-1":"right-0"),onClick:d}):null]})})),jc=e=>c("div",{children:[e.canScrollLeft?o("div",{className:u(Oc,"left-0 bg-opacity-from-white group-data-secondary:bg-none")}):null,e.canScrollRight?o("div",{className:u(Oc,"right-0 bg-opacity-to-white group-data-secondary:bg-none")}):null]}),qc=(e=!1)=>u("absolute z-40",e?"bottom-[56px]":"top-[calc(50%-24px)]"),$c=d((({className:e,version:t,gap:n=14,padding:i=16,visibleItemCount:a=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]=Mc({itemCount:y,onVisibleIndicesChange:f}),[N]=v.visibleIndicesRange;return c("div",{className:u(e,"vertical-list"===l?"relative h-full":""),children:[o(bc,{containerRef:b,activeIndex:N,visibleItemCount:a,gap:n,padding:i,listType:l,snapAlign:r,minHeight:s,onVisibleIndicesChange:v.handleVisibleIndicesChange,children:g}),o(Lc,{className:u(!d&&"hidden lg:block"),scroll:v,hasBlur:m,arrowsPadded:h,isBottom:Boolean(x?.length)}),o(Ac,{className:u(!p&&"lg:hidden"),activeIndex:N,dotCount:y,listType:l,version:t,navButtons:x,containerRef:b,containerScroll:v})]})})),Uc=({blocksToRender:e,...t})=>o($c,{visibleItemCount:0,gap:0,arrowsPadded:!0,children:R(e,{...t.options,parent:t.block,renderProps:(e,t,n)=>o("div",{className:u("relative min-w-80",pc(!0)),children:B(e,t)},String(n))})}),Wc=e=>e%2!=0,Hc=d((({textNode:e,iconNode:t,tag:n,onClick:i,justifyContent:a="between",className:l,role:r,...s})=>c(n,{tag:n,className:u("flex items-center w-full gap-1","between"===a?"justify-between":"justify-center",l),onClick:i,role:r,...s,children:[e?o("div",{children:e}):null,t?o("div",{children:t}):null]}))),Yc=d((({className:e="",label:t,icon:n,dataTheme:i="pc",disabled:a=!1,onClick:l})=>o(Hc,{tag:"button",onClick:l,disabled:a,"data-theme":i,justifyContent:"center",role:"button",className:u("py-4 border border-transparent outline-none focus:border-primary-text space-x-s",a?"bg-main-divider text-main-disabled hover:bg-main-divider":"bg-primary-main text-white hover:bg-primary-hove",e),textNode:o(_e,{size:"text-h4",children:t}),iconNode:n?o(ne,{image:{icon:n,iconVersion:"white"},className:"my-auto",width:"20",height:"20"}):null}))),Kc=({isUnfolded:e,onToggle:t})=>o(Yc,{icon:["ArrowDownIcon","ArrowUpIcon"][Number(e)],label:["Развернуть","Скрыть"][Number(e)],onClick:t}),Gc=["ArrowDownIcon","ArrowUpIcon"],Xc="space-y-px lg:space-y-0 lg:grid lg:grid-cols-12 gap-2xs",Jc=({topItemsCount:e=0,label:t="",block:n,blocksToRender:i=[],...a})=>{const[l,r]=e>0?[i.slice(0,e),i.slice(e)]:[i,[]];return c("div",{className:u("space-y-2xs",{hidden:!i.length}),children:[c("div",{className:u(Xc),children:[R(l,{...a.options,parent:n}),Wc(l.length)?o(Vt,{className:"col-span-6",...a}):null]}),o(ea,{renderFoldableSection:({isUnfolded:e})=>c(ta,{className:u(Xc),isUnfolded:e,children:[R(r,{...a.options,parent:n}),Wc(r.length)?o(Vt,{className:"col-span-6",...a}):null]}),renderFoldButton:({isUnfolded:n,onToggle:i})=>o(Yc,{className:u({hidden:e<1}),disabled:!r?.length,label:t,icon:Gc[Number(n)],dataTheme:a.options?.page?.colorPalette,onClick:i})})]})},Zc=d((({blocksSection:e,blocksToRender:t=[],notFound:n,...i})=>{switch(e?.view){case"grid":return c("div",{children:[Qc(n,t),Jc({...e,...i,blocksToRender:t})]});case"carousel":return c("div",{className:"relative",children:[Qc(n,t),Uc({...i,blocksToRender:t})]});default:return null}})),Qc=(e,t)=>e&&!t.length?o(hc,{...e}):null,ed=e=>t=>t.reduce(((t,n,i)=>t.length?t.concat({...e,key:`sep-${i}`},n):[n]),[]),td=d((({value:e,onChange:t,items:n=[],multiple:i})=>n.map((n=>o(rs,{text:n?.title,value:[e].flatMap((e=>e)).includes(n.value),onChange:()=>(n=>{if(!t)return;const a=e?.includes(n);t(i?a?(e||[]).filter((e=>e!==n)):[...e||[],n]:a?[]:[n])})(n.value),type:i?"checkbox":"radio"},n.value))))),nd=d((({children:e,filtrationSchema:t,resetButton:n,field:i,reset:a})=>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,ed(o("div",{className:"h-full w-px bg-gray hidden @4xl:block"}))(Object.entries(t).map(id(i)).filter(Boolean))]}),n?o("div",{children:o(Oa,{type:"reset",className:"w-full @4xl:w-56 @4xl:ml-s",onClick:a,children:n?.text})}):null]}))),id=e=>([t,n])=>{const i=n?.type;return"array"===i?ad(t,e)(n):null},ad=(e,t)=>n=>{const i=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(_e,{size:"text-m",font:"font-medium",color:"text-primary-text",children:n.title})}):null,o(td,{items:i,multiple:!n?.single,...t(e)})]},e)};function ld(e,...t){return e.map(((e,n)=>[e,...t.map((e=>e[n]))]))}const rd=e=>null==e||""===e||Array.isArray(e)&&0===e.length||"object"==typeof e&&0===Object.keys(e).length,sd=(e,t)=>Object.entries(e).map((([n,i])=>"number"==typeof i?Array.isArray(t[n])?((e,t)=>n=>rd(t[e])||rd(n[e])||n[e]?.includes(t[e]))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e])<=od(n[e]))(n,e):"object"==typeof i&&"min"in i&&"max"in i?((e,t)=>n=>rd(t[e])||rd(n[e])||od(t[e]?.min)>=od(n[e]?.min)&&od(t[e]?.min)<=od(n[e]?.max))(n,e):Array.isArray(i)?((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]?.every((t=>n[e]?.includes(t))))(n,e):((e,t)=>n=>rd(t[e])||rd(n[e])||t[e]===n[e])(n,e))).every((e=>e(t))),od=e=>Number(e||0),cd=(e,{block:t,page:n,normalize:i=ln})=>{const a=t?.blocks||[],[l,{field:s,reset:o,update:c}]=rn(e),d=r((()=>ld(a,a.map((e=>At(e.content,n?.fallback))))),[a,n?.fallback]),m=l===e?a:((e,t)=>(n=ln)=>e?.filter((([,e])=>sd(t,n(e)||{}))).map((([e])=>e)))(d,l)(i);return[l,{blocksToRender:m,blocksWithProps:d},{field:s,reset:o,update:c}]},dd={},md={},ud=zt((({className:e,filtrationSchema:t=dd,consumerField:n={},resetButton:i,...a})=>{const[,{blocksToRender:l},{field:r,reset:s}]=cd(md,{block:a.block,page:a.options?.page}),d=o(Mn,{className:"w-64",label:n?.title,options:hd(n),...r("consumer",{parse:({key:e})=>[e],format:([e]=[])=>hd(n).find((t=>t.key===e))||{key:""}})});return c(g,{className:u(e),defaultPadding:"p-0",version:"transparent",...a,children:[o(nd,{filtrationSchema:t,field:r,reset:s,children:c("div",{children:[d,o("div",{children:o(Oa,{type:"reset",className:"mt-lg w-64",onClick:s,version:i?.version,children:i?.text})})]})}),o(Zc,{blocksToRender:l,...a})]})}),{childrenTypes:["CarouselTariffsCard"],childSchema:e=>({...e?.filtrationSchema,...e?.consumerField?{consumer:e?.consumerField}:{}})}),hd=e=>ld(e.items?.enum||[],e.items?.enumNames||[]).map((([e,t])=>({key:e,text:t}))),pd=(e=!1)=>e?"text-left":"text-center",gd={"":"bg-main-divider group-data-secondary:bg-white/30",primary:"bg-main-divider",secondary:"bg-secondary-light",opacity:"bg-white/30"},fd=d((({className:e,defaultIconSize:t=44,iconBgVersion:n="primary",size:i,icon:a,...l})=>{const r=String(i?.width||t);return a?o("div",{style:{width:`${r}px`,height:`${r}px`},className:u("rounded-icon object-fit flex justify-center items-center",gd[n],e),children:o(W,{...l,width:"54%",height:"54%",name:a})}):null})),xd=d((({className:e="",title:t,benefitList:n,...i})=>{const a=Se();return c(g,{className:e,defaultPadding:"p-6xl",...i,children:[t?o(w,{headingType:"h3",as:"h2",className:pd(a),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(yd)}):null]})})),yd=({label:e,description:t,__html:n,icon:i,isDotted:a=!1,iconBgVersion:l},r)=>c("div",{className:"flex gap-m items-center @md:basis-1/2 @md:max-w-[500px]",role:"listitem",children:[i?.icon?o(fd,{className:"shrink-0",iconBgVersion:l,...i}):null,i?.src?o(ne,{className:"shrink-0",image:i}):null,e?c("div",{className:"@sm:h-full space-y-xs",children:[o(w,{headingType:"h6",children:e}),o(_e,{size:"text-l",color:"text-secondary-text group-data-secondary:text-white/80",font:"font-light",children:t}),n?o(De,{__html:n,isDotted:a,itemSize:"list-s"}):null]}):null]},String(r)),bd=(e,t,n)=>{return o($c,{children:e.map((i=n,({icon:e,title:t,description:n},a)=>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(_e,{size:"text-h6",font:"font-normal",align:i,children:t}):null,e?o(ne,{image:e,height:"180",className:"w-auto mx-auto"}):null,n?o(_e,{size:"text-h6",font:"font-normal",align:i,children:n}):null]},String(a))))});var i},vd=d((({bonusBenefits:e,cardTextAlign:t="text-center",className:n="",columnsCount:i="4",subtitle:a,title:l,...r})=>c(g,{className:u("space-y-3xl",n),defaultPadding:"p-6xl",...r,children:[o(k,{defaultPadding:"",title:l,description:a,headlineVersion:"M"}),e?.length?bd(e,0,t):null]}))),Nd={start:"justify-start",center:"justify-center",end:"justify-end"},wd=d((({buttons:e,className:t="",align:n,...i})=>{const a=n&&u("flex",Nd[n]);return o(g,{className:u("!bg-transparent",a,t),defaultPadding:"p-0",...i,children:je(e)})})),Cd=d((({className:e,title:t,children:n,...i})=>c(g,{className:u("space-y-xl",e),defaultPadding:"p-4xl",...i,children:[t?o(w,{className:"text-center",title:t}):null,n]}))),Sd="flex flex-col justify-between lg:flex-row gap-x-4xl gap-y-7 lg:gap-y-4xl",kd="flex flex-col lg:max-w-80 lg:w-1/2 gap-2xl",Id="flex flex-col gap-y-xl min-w-52",Td=d((({value:e,fractionDigits:t,fixed:n,prefix:i,postfix:a})=>o(_e,{size:"text-h3",children:"number"==typeof e?[i,We(t,{fixed:n})(e),a].filter(Boolean).join(" "):e}))),Bd=d((({className:e,title:t,value:n,color:i="text-secondary-text",...a})=>c("div",{className:u("flex justify-between @xl:flex-col",e),children:[t?o(_e,{size:"text-l",font:"font-light",color:i,children:t}):null,n?o(Td,{value:n,...a}):o(_e,{size:"text-h3",children:"-"})]}))),Pd=(e,t)=>e?o(C,{size:"text-xs",font:"font-light",color:"text-secondary-text",children:e},String(t)):null,Rd=d((({rate:e=0,title:t="Ставка",unit:n,fractionDigits:i=2,depositeName:a,isShowDepositeName:l,color:r="text-secondary-text"})=>c("div",{children:[o(_e,{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:We(i,{fixed:!0})(e)}),n?o("span",{className:"text-7xl mt-5",children:n}):null]}),a&&l?o("div",{className:"absolute bottom-2 w-full text-left whitespace-nowrap",children:a}):null]})]}))),Dd=d((({title:e="Ставка"})=>c("div",{className:"space-y-s min-w-96",children:[o(_e,{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:"Процентная ставка не найдена, выберите другие параметры"})})]}))),Md=({title:e="Ставка",rate:t=0,unit:n="%",fractionDigits:i=2,color:a="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(Rd,{title:e,rate:t,unit:n,fractionDigits:i,color:a,...r})}),o(Bd,{className:"lg:hidden",title:e,value:t,postfix:n,fractionDigits:i,fixed:!0,color:a,...r}),l]}):o(Dd,{title:e,...r}),_d=({isShowItems:e=!0,step:t=1e3,postfix:n="₽",...i})=>o(dl,{items:e?[`От ${We(1)(i.min||0)} ${n}`,`До ${We(1)(i.max||0)} ${n}`]:[],step:t,...i}),Ad={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},Ed={minSumTravel:6e3,maxSumTravel:2e5,minSumOther:6e3,maxSumOther:2e5,maxBonus:5e3,prefMonthsNum:2,prefTravelBonusRate:.015,prefRestBonusRate:.01,travelBonusRate:.015,restBonusRate:.01},zd=(e,t)=>{const{travelExpenseValue:n,restExpenseValue:i}=e,[a,l]=((e,t,n)=>{const{maxBonus:i=5e3,prefMonthsNum:a=Ad.prefMonthsNum,prefTravelBonusRate:l=Ad.prefTravelBonusRate,prefRestBonusRate:r=.01,travelBonusRate:s=.015,restBonusRate:o=.01}=e,c=Math.min(Math.round(l*t)+Math.round(r*n),i);return[c,c*a+Math.min(Math.round(s*t)+Math.round(o*n),i)*(12-a)]})(t||Ed,n,i);return{...t,...e,monthBonus:a,yearBonus:l}},Fd=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,...l})=>{const[r,{field:s}]=rn({travelExpenseValue:6e3,restExpenseValue:6e3}),{minSumTravel:d,maxSumTravel:m,minSumOther:h,maxSumOther:p,monthBonus:g,yearBonus:f}=zd(r,n);return o(Cd,{className:e,title:t,...l,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма покупок в категории путешествия, ₽",min:d,max:m,step:500,isShowItems:!1,...s("travelExpenseValue")}),_d({title:"Сумма покупок в остальных категориях, ₽",min:h,max:p,step:500,isShowItems:!1,...s("restExpenseValue")})]}),o("div",{className:"mb-s",children:g>=0?Md({title:"Баллов за месяц",rate:g,fractionDigits:0,unit:"",color:"text-primary-text"}):null}),c("div",{className:Id,children:[f>=0?o(Bd,{title:"Баллов за год",value:f,color:"text-primary-text"}):null,je(i,{isVertical:!0}),Pd(a)]})]})})})),Vd=Math.round(29.5),Od=(e,t=0)=>e?.sum?e.sum:t,Ld=(e,t=0)=>e?.period&&e.period>=1&&e.period<=60?e.period:t,jd=e=>`${e} ${Number(e)%10==1?"дня":"дней"}`,qd=({items:e,title:t,mobileTitle:n=t,orientation:i="horizontal",value:a,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(_e,{color:"text-secondary-text",font:"font-light",children:t})}):null,n?o("div",{className:"@5xl:hidden",role:"radiogroup","aria-label":n,children:o(_e,{color:"text-secondary-text",font:"font-light",children:n})}):null,o(hr,{orientation:i,items:e,value:e[a?0:1].id,onChange:t=>l&&l(t===e[0].id),...r})]}),$d=e=>qd({...e,items:[{id:"everyMonth",text:"Ежемесячно"},{id:"atEndTerm",text:"В конце срока"}]}),Ud=" (c капитализацией)",Wd=({income:e,finalSum:t,postfix:n="₽",buttons:i=[],footnotes:a=[],isCapitalization:l=!1})=>c("div",{className:Id,children:[o(Bd,{title:`Доход в конце срока${l?Ud:""}`,value:e,postfix:n,prefix:"+"}),o(Bd,{title:`Сумма в конце срока${l?Ud:""}`,value:t,postfix:n}),je(i,{isVertical:!0}),a?.map(Pd)]}),Hd=([e,t],n,i=[])=>n&&n[e]&&n[t]?{[e]:n[e],[t]:n[t]}:Yd([e,t],i),Yd=([e,t],n=[])=>({[e]:n.length?Pc(n.filter((t=>"number"==typeof t[e])).map((t=>t[e]))):0,[t]:n.length?Tc(n.filter((t=>"number"==typeof t[e])).map((e=>e[t]))):0}),Kd=(e,[t,n],i)=>e>=i[t]&&e<=i[n],Gd={UL:"businessdepositrates",IP:"selfemployeddepositrates"};const Xd={minSum:1e3,maxSum:100000001,minDays:1,maxDays:1095,rate:0,isMonthlyInterestPayment:!0,isReplenished:!1,isPartialWithdrawal:!1,depositeName:"Депозит 'Стабильный'"},Jd=(e,t)=>{const{daysValue:n,moneyValue:i,isPartialWithdrawal:a,isReplenished:l,isMonthlyInterestPayment:r}=e,s=l||a,o=n<90||n>730,c=function(e){const t=e?.rateType?Gd[e?.rateType]:"",{data:n}=hi(t?`/api/v1/depositrates/${t}`:null,Rt);return Array.isArray(n)?n:[]}(t),d=c?.find((e=>r===e.isMonthlyInterestPayment&&Zd(s,e)&&Kd(i,["minSum","maxSum"],e)&&Kd(n,["minDays","maxDays"],e)))||Xd,{rate:m}=d,u=Qd(m,e),h=i+u,p=c||[Xd];return{...d,...Yd(["minSum","maxSum"],p),...Yd(["minDays","maxDays"],p),...e,isDisabledOperatingDeposit:o,income:u,finalSum:h}},Zd=(e,t)=>e?t.isReplenished&&t.isPartialWithdrawal:!t.isReplenished&&!t.isPartialWithdrawal,Qd=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,daysValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a/30)-i):Math.round(i*e*a/365/100)},em=zt((({className:e="",title:t,buttons:n,footnote:i,bottomFootnote:a,isShowDepositeName:l,defaultParams:r,rateParams:s,...d})=>{const[m,{field:h}]=rn({moneyValue:Od(r,1e5),daysValue:Ld(r,60),isReplenished:Boolean(r?.isReplenished),isPartialWithdrawal:Boolean(r?.isPartialWithdrawal),isMonthlyInterestPayment:Boolean(r?.isMonthlyInterestPayment)}),p=Jd(m,s),{income:g,finalSum:f,rate:x,depositeName:y}=p;return o(Cd,{className:e,title:t,...d,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({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(dl,{items:[`От ${jd(b.min||0)}`,`До ${jd(b.max||0)}`],step:1,...b})),c("div",{className:"flex flex-col sm:flex-row gap-y-m gap-x-5xl",children:[tm(p,h),$d({title:"Выплата процентов",orientation:"vertical",...h("isMonthlyInterestPayment"),className:"sm:flex-col"})]})]}),Md({rate:x,depositeName:y,isShowDepositeName:l}),Wd({income:g,finalSum:f,buttons:n,footnotes:[i,a]})]})});var b})),tm=(e,t)=>c("div",{className:"space-y-s",children:[o(_e,{color:"text-secondary-text",font:"font-light",children:"Параметры"}),c("div",{className:"flex flex-col gap-y-lg sm:gap-y-s",children:[o(ki,{text:"Пополнение",disabled:e.isDisabledOperatingDeposit,...t("isReplenished"),value:e.isReplenished}),o(ki,{disabled:e.isDisabledOperatingDeposit,text:"Частичное снятие",...t("isPartialWithdrawal"),value:e.isPartialWithdrawal})]})]}),nm=(e=[],t=!1)=>im([(e,t)=>e>t,(e,t)=>e?.minSum<t?.minSum],e?.filter((e=>t===Boolean(e?.isNewClient)))),im=(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]},am=({min:e=0,max:t=0,availableMonths:n,...i})=>o(dl,{items:[`От ${lm(e)}`,`До ${lm(t)}`],step:1,...n?.length?{list:n}:{min:e,max:t},...i}),lm=e=>`${e} ${Number(e)%10==1?"месяца":"месяцев"}`,rm=e=>qd({...e,className:"sm:flex-col",items:[{id:"annuity",text:"Аннуитетный"},{id:"differential",text:"Дифференцированный"}]}),sm=({field:e,defParams:t,calcParams:n,map:i,monthsValue:a="maxMonths"})=>{Object.entries(i).forEach((([n,i])=>{e?.(n)?.onChange?.(t?.[i])})),e?.("monthsValue")?.onChange?.(ll(t?.[a],n.minMonths,n.maxMonths))},om=(e,t)=>{const{isAnnuity:n,moneyValue:i,monthsValue:a,moneyExtra:l}=t;if(0===e)return 0;if(n){const t=e/1200;return l?(i+l)*(t+t/(Math.pow(1+t,a)-1)):i*(t+t/(Math.pow(1+t,a)-1))}return Math.round(i/a)+i*(e/1200)},cm={minSum:1e4,maxSum:5e6,minMonths:1,maxMonths:60,rate:0,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1,isInsurance:!0},dm=e=>mm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&mm({...e,fieldKey:"isStateEmployee",viewSettingFieldKey:"isShowStateEmployee"})&&mm({...e,fieldKey:"isPensionClient",viewSettingFieldKey:"isShowPensionClient"})&&mm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),mm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],um=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.rateRows||[cm],r=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:s,maxSum:o}=Hd(["minSum","maxSum"],r,l),{minMonths:c,maxMonths:d}=Hd(["minMonths","maxMonths"],r,l),m=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a})=>e?.find((e=>dm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i,["minSum","maxSum"],e)&&Kd(a,["minMonths","maxMonths"],e)))||cm)({rateRows:l,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a}),{rate:u}=m,h=om(u,e);return{...m,...e,minSum:s,maxSum:o,minMonths:c,maxMonths:d,moneyValue:i,monthsValue:a,monthlyPayment:h}},hm=(e={})=>Boolean(Object.values(e).filter((e=>e)).length),pm={isSalaryClient:"isSalaryClient",isStateEmployee:"isStateEmployee",isPensionClient:"isPensionClient",isInsurance:"isInsurance",moneyValue:"maxSum"},gm=zt((({className:e,title:t,calcSource:n,buttons:i,footnote:l,paramsViewSettings:r,defaultParams:s,registerSubmit:d,...m})=>{const h=(p=n?.rateRows,im([(e,t)=>e<t,(e,t)=>e?.maxSum>t?.maxSum],p));var p;const[g,{field:f,onSubmit:x}]=rn({moneyValue:Od(s,2e5),monthsValue:Ld(s,Vd),isAnnuity:Boolean(s?.isAnnuity),isInsurance:Boolean(s?.isEnableInsurance),isSalaryClient:Boolean(s?.isEnableSalaryClient),isPensionClient:Boolean(s?.isEnablePensionClient),isStateEmployee:Boolean(s?.isEnableStateEmployee)});d?.(x);const y=um(g,n,r),b=rm({title:"Тип платежа",orientation:"vertical",...f("isAnnuity")}),{onChange:v}=f("moneyValue"),{onChange:N}=f("monthsValue");return a((()=>{v&&v(ll(g.moneyValue,y.minSum,y.maxSum))}),[y.minSum,y.maxSum]),a((()=>{N&&N(ll(g.monthsValue,y.minMonths,y.maxMonths))}),[y.minMonths,y.maxMonths]),a((()=>{!hm(s)&&h&&sm({field:f,defParams:h,calcParams:y,map:pm,monthsValue:"minMonths"})}),[n,s]),o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Сумма кредита, ₽",step:500,min:y.minSum,max:y.maxSum,...f("moneyValue"),value:y.moneyValue}),am({title:"Срок кредита, месяцев",min:y.minMonths,max:y.maxMonths,...f("monthsValue"),value:y.monthsValue}),fm({...y,...r},f),o("div",{className:"sm:hidden",children:b})]}),c("div",{className:u(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:y?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:y.monthlyPayment,postfix:"₽"}),o("div",{className:"hidden sm:block mb-lg",children:b}),je(i,{isVertical:!0}),Pd(l)]})]})})})),fm=(e,t)=>c("div",{className:"flex flex-col gap-y-2xl",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт\nв Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient,className:"whitespace-pre-line sm:whitespace-normal"}):null,e.isShowStateEmployee?o(ki,{text:"Работаю в бюджетной организации",...t("isStateEmployee"),value:e.isStateEmployee}):null,e.isShowPensionClient?o(ki,{text:"Получаю пенсию на карту Россельхозбанка",...t("isPensionClient"),value:e.isPensionClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null]}),xm=e=>{const t=[...e];t.sort((([e],[t])=>e-t));let n=1;for(;n<t.length;){const[e,i]=t[n-1],[a,l]=t[n];i>=a?t.splice(n-1,2,[e,Math.max(i,l)]):n++}return t},ym={minSum:5e4,maxSum:100000001,minMonths:2,maxMonths:10,rate:0,isMonthlyInterestPayment:!0,isRemoteRegistration:!0,isReplenish:!1,isWithdrawn:!1,type:""},bm=(e,t,n)=>{const{moneyValue:i,monthsValue:a}=e,l=t?.[0]?wm(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=>[Nm({row:t,userInputParams:e,paramKey:"isReplenish",isExclude:o}),Nm({row:t,userInputParams:e,paramKey:"isWithdrawn",isExclude:c}),Nm({row:t,userInputParams:e,paramKey:"isMonthlyInterestPayment",isExclude:r}),Nm({row:t,userInputParams:e,paramKey:"isRemoteRegistration",isExclude:s}),d||e?.isNewClient===t?.isNewClient,Kd(i,["minSum","maxSum"],t),Kd(a||l,["minMonths","maxMonths"],t)].every(Boolean)))||ym,{rate:u}=m,h=vm(u,e),p=i+h,g=t||[ym];return{...m,...Yd(["minSum","maxSum"],g),...Yd(["minMonths","maxMonths"],g),availableMonths:xm(g.map((e=>[e.minMonths,e.maxMonths]))).flatMap((([e,t])=>((e,t,n=1)=>Array.from({length:Math.abs(t-e)/n+1},((i,a)=>t>=e?e+a*n:e-a*n)))(e,t))),...e,defaultMonth:l,income:h,finalSum:p}},vm=(e,t)=>{const{isMonthlyInterestPayment:n,moneyValue:i,monthsValue:a}=t;return n?Math.round(i*Math.pow((1200+e)/1200,a)-i):Math.round(i*e*30*a/365/100)},Nm=({row:e,userInputParams:t,paramKey:n,isExclude:i})=>i||t[n]===e[n],wm=(e,t)=>e+Math.round((t-e)/2),Cm=(e="rub")=>"rub"===e,Sm=(e,t)=>{const{minMonths:n,maxMonths:i}=Yd(["minMonths","maxMonths"],Bm(t,e?.currency)),a=e.monthsValue||Math.round((n+i)/2);return{monthsValue:ll(a,n,i)}},km=(e,t)=>{const{minSum:n,maxSum:i}=Yd(["minSum","maxSum"],Bm(t,e?.currency)),a=e.moneyValue||n;return{moneyValue:ll(a,n,i)}},Im=(e,t)=>({currency:e?.currency??t?.map((e=>e.currency))?.[0]}),Tm=e=>{const t=Cm(e?.currency?.key);return{isReplenish:t&&e?.isReplenish,isWithdrawn:t&&e?.isWithdrawn}},Bm=(e,t)=>{const{rates:n}=e?.find((e=>e?.currency.key===t?.key))??{};return n??e?.[0]?.rates},Pm=(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?qd({title:"Пополнение",...t("isReplenish"),value:e.isReplenish,orientation:"vertical",items:[{id:"withReplenish",text:"С пополнением"},{id:"withoutReplenish",text:"Без пополнения"}],disabled:n}):null,e.isShowWithdrawn?qd({title:"Снятие",...t("isWithdrawn"),value:e.isWithdrawn,orientation:"vertical",items:[{id:"wthDrawn",text:"Со снятием"},{id:"noWithdrawn",text:"Без снятия"}],disabled:n}):null]}),Rm(e.isShowReplenish||e.isShowWithdrawn),c("div",{className:"flex gap-lg",children:[e.isShowMonthlyInterestPayment?$d({title:"Выплата процентов",...t("isMonthlyInterestPayment"),value:e.isMonthlyInterestPayment,orientation:"vertical"}):null,e.isShowRemoteRegistration?(i={title:"Оформление",...t("isRemoteRegistration"),value:e.isRemoteRegistration,orientation:"vertical"},qd({...i,items:[{id:"remote",text:"Дистанционно"},{id:"office",text:"Офис Банка"}]})):null]}),Rm(e.isShowNewClient),e.isShowNewClient?o(ki,{text:"Новый вкладчик",...t("isNewClient")}):null]});var i},Rm=(e=!1)=>e?o("div",{className:"border-b border-main-divider w-full"}):null,Dm={isMonthlyInterestPayment:"isMonthlyInterestPayment",isRemoteRegistration:"isRemoteRegistration",isReplenish:"isReplenish",isWithdrawn:"isWithdrawn",moneyValue:"minSum"},Mm={text:"₽",key:"rub"},_m=zt((({className:e,title:t,calcSource:n,buttons:i=[],footnote:r="",paramsViewSettings:s,defaultParams:d,...m})=>{const{rows:h}=n??{},p=h?.map((e=>e.currency))??[Mm],g=l((e=>t=>e?{...t,...Tm(t),...km(t,e),...Sm(t,e),...Im(t,e)}:t)(h),[h]),[f,{field:x}]=rn({moneyValue:Od(d,2e4),monthsValue:Ld(d,1),isMonthlyInterestPayment:Boolean(d?.isMonthlyInterestPayment),isRemoteRegistration:Boolean(d?.isRemoteRegistration),isReplenish:Boolean(d?.isReplenish),isWithdrawn:Boolean(d?.isWithdrawn),isNewClient:Boolean(d?.isNewClient),currency:Mm},{normalize:g}),y=x?.("currency")?.value??Mm,b=x?.("isNewClient")?.value,v=Bm(h,y),N=bm(f,v,s),{rate:w,income:C,finalSum:S,type:k=""}=N,I=l((()=>{sm({field:x,defParams:nm(v,b),calcParams:N,monthsValue:"minMonths",map:Dm})}),[x,h]);a((()=>{!hm(d)&&v&&I()}),[d,h]);const T=w===nm(v,b)?.rate;return o(Cd,{className:e,title:t,...m,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[c("div",{className:"flex gap-m",children:[_d({className:"w-full",title:`Сумма, ${y?.text}`,min:N.minSum,max:N.maxSum,...x("moneyValue"),value:N.moneyValue,postfix:y?.text,step:Am(y?.key)}),h&&h?.length>1?o(zn,{label:"Валюта",options:p,...x("currency")}):null]}),am({title:"Срок, месяцев",min:N.minMonths,max:N.maxMonths,availableMonths:N.availableMonths,...x("monthsValue"),value:N.monthsValue}),Pm({...N,...s},x)]}),Md({rate:w,children:zm(I,T)}),Wd({income:C,finalSum:S,buttons:[...i,Em(n?.buttons,k)],footnotes:[r],postfix:y?.text,isCapitalization:x("isMonthlyInterestPayment").value})]})})})),Am=(e="")=>Cm(e)?1e3:100,Em=(e=[],t="")=>{const{type:n,...i}=e.find((e=>e.type===t))??{};return i},zm=(e,t=!1)=>t?null:o(Oa,{type:"button",version:"secondary",onClick:e,children:"Показать максимальную ставку"}),Fm=e=>Vm({...e,fieldKey:"isSalaryClient",viewSettingFieldKey:"isShowSalaryClient"})&&Vm({...e,fieldKey:"isInsurance",viewSettingFieldKey:"isShowInsurance"}),Vm=({row:e,userInputParams:t,paramsViewSettings:n,fieldKey:i,viewSettingFieldKey:a})=>!!n&&!n[a]||t[i]===e[i],Om={minSum:1e4,maxSum:3e6,minSumOld:0,maxSumOld:25e5,minSumExtra:0,maxSumExtra:5e5,minMonths:13,maxMonths:60,rate:0,isExtraMoney:!1,isSalaryClient:!1,isInsurance:!0},Lm=(e,t,n)=>{const{moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}=e,s=t?.rateRows||[Om],o=(({limitRows:e,userInputParams:t,paramsViewSettings:n})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n}))))({limitRows:t?.limitRows||[],userInputParams:e,paramsViewSettings:n}),{minSum:c,maxSum:d}=Hd(["minSum","maxSum"],o,s),{minMonths:m,maxMonths:u}=Hd(["minMonths","maxMonths"],o,s),h=(({rateRows:e=[],userInputParams:t,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r})=>e?.find((e=>Fm({row:e,userInputParams:t,paramsViewSettings:n})&&Kd(i+r,["minSum","maxSum"],e)&&Kd(l,["minSumOld","maxSumOld"],e)&&Kd(r,["minSumExtra","maxSumExtra"],e)&&Kd(a,["minMonths","maxMonths"],e)))||Om)({rateRows:s,userInputParams:e,paramsViewSettings:n,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r}),{rate:p}=h,g=om(p,e),f=e.oldMonthlyPayment-g;return{...h,...e,minSum:c,maxSum:d,minMonths:m,maxMonths:u,moneyValue:i,monthsValue:a,oldMonthlyPayment:l,moneyExtra:r,monthlyPayment:g,benefit:f}},jm=zt((({className:e="",title:t,calcSource:n,buttons:i,footnote:a,paramsViewSettings:l,...r})=>{const[s,{field:d}]=rn({isAnnuity:!0,isInsurance:!0,isSalaryClient:!1,isExtraMoney:!1,moneyValue:7e5,oldMonthlyPayment:0,monthsValue:48,moneyExtra:0}),m=Lm(s,n,l),h=rm({title:"",mobileTitle:"Тип платежа",orientation:"vertical",...d("isAnnuity")});return o(Cd,{className:e,title:t,...r,children:c("section",{className:u(Sd,e),children:[c("div",{className:kd,children:[_d({title:"Остаток долга в других банках, ₽ ",step:500,min:m.minSum,max:m.maxSum-m.maxSumExtra,...d("moneyValue"),value:m.moneyValue}),_d({title:"Ежемесячный платёж в других банках, ₽",step:500,min:m.minSumOld,max:m.maxSumOld,...d("oldMonthlyPayment"),value:m.oldMonthlyPayment}),am({title:"Новый срок кредита, месяцев",min:m.minMonths,max:m.maxMonths,...d("monthsValue"),value:m.monthsValue}),qm({...m,...l},d),m.isExtraMoney?_d({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(Id,"@4xl:w-1/2"),children:[o(Bd,{title:"Полная стоимость кредита",value:n?.totalLoanCost}),o(Bd,{title:"Ставка",value:m?.rate,fractionDigits:2,postfix:"%"}),o(Bd,{title:"Ежемесячный платёж",value:m.monthlyPayment,postfix:"₽"}),m.benefit>0?o(Bd,{title:"Выгода в месяц",value:m.benefit,postfix:"₽"}):null,o("div",{className:"hidden sm:block mb-lg",children:h}),je(i,{isVertical:!0}),Pd(a)]})]})})})),qm=(e,t)=>c("div",{className:"space-y-lg sm:space-y-s",children:[e.isShowSalaryClient?o(ki,{text:"Получаю зарплату на счёт в Россельхозбанке",...t("isSalaryClient"),value:e.isSalaryClient}):null,e.isShowInsurance?o(ki,{text:"Комплексная страховая защита",...t("isInsurance"),value:e.isInsurance}):null,o(ki,{text:"Получить дополнительную сумму",...t("isExtraMoney"),value:e.isExtraMoney})]}),$m=d((e=>{const{onChange:t,min:n,max:i,defaultValue:a="0",fractionDigits:r=0,...s}=e,c=al(e,{normalize:(e=a)=>n&&i?String(ll(Number(Um(e)),n,i)):Um(e),format:We(r)}),d=l((e=>t&&t(Um(e))),[t]);return o(xn,{onChange:d,...s,...c})})),Um=(e="")=>e.replaceAll(",",".").replace(/[^\d.]/g,"").replace(/([^.]*\.[^.]*)\./,"$1"),Wm=d((e=>o($m,{...e,fractionDigits:2,children:o("div",{className:"absolute right-4 bottom-4",children:o(_e,{size:"text-xl",font:"font-light",children:"₽"})})}))),Hm={private:"https://old.rshb.ru/p2p/",business:"https://old.rshb.ru/smallbusiness/p2p/"},Ym={amount:1500},Km=d((({className:e="",title:t="Укажите сумму перевода",label:n="Сумма перевода",button:l,formType:r="private",...s})=>{const[{amount:d},{field:m}]=rn(Ym),[h,p]=i(!1);return a((()=>{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:Hm[r],children:[o(Wm,{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(Oa,{className:"w-full mt-lg",type:"submit",disabled:h,children:l.text}):null]})]})})),Gm=({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})]}),Xm="relative h-full",Jm={small:"lg:min-w-64",normal:"lg:min-w-80 xl:min-w-96",big:"lg:min-w-[515px]"},Zm=({noCardBorder:e,cardSize:t="normal",isNavButtons:n=!1,...i})=>{const{blocks:a}=i.block||{},l=a?.some(tu),r=n?{defaultPadding:"p-6xl pb-m"}:{};return D({...i,renderProps:(n,i,a)=>c("div",{className:Qm(n,{someCardsHighlighted:l}),children:[B(n,i,{className:eu(n,{someCardsHighlighted:l,showBorder:!e,cardSize:t}),...r,blockIndex:a}),tu(n)?Gm({className:"absolute top-0 -right-4 z-40"}):null]},String(a))})},Qm=(e,{someCardsHighlighted:t})=>u(Xm,t&&(tu(e)?"pt-3xl":"pt-3xl sm:pt-16")),eu=(e,{someCardsHighlighted:t,showBorder:n,cardSize:i="normal"})=>u(Xm,"min-w-80",Jm[i],t&&(tu(e)?"pt-3xl sm:pt-16":"pt-3xl"),pc(n),n&&"h-full"),tu=e=>e?.content&&"isHighlighting"in e.content&&e.content.isHighlighting,nu=zt((({className:e,visibleItemCount:t=0,noCardBorder:n,arrowsPadded:i=!0,isGap:a=!0,cardSize:l="normal",isNavButtons:r=!1,...s})=>o(g,{className:u(e),defaultPadding:"p-6xl",...s,children:o($c,{className:u("relative max-w-full"),visibleItemCount:t,snapAlign:"snap-start",gap:a?16:0,padding:0,arrowsPadded:i,navButtons:r?iu(s?.block?.blocks):[],hasBlur:!0,children:Zm({noCardBorder:n,cardSize:l,isNavButtons:r,...s})})})),{childrenTypes:["CarouselCard","CarouselCatalogCard","CarouselRecommendationCard","CarouselTariffsCard","RichTextBlock","ProductBlock"],childSchema:()=>({isHighlighting:{title:"Выделить карточку",type:"boolean"}})}),iu=e=>e?.map((e=>{const t=e?.content;return{title:t?.title,description:t?.additionalDescription||t?.description}}))??[],au="z-10 border border-solid w-full h-full",lu=u(au,"absolute hidden @xl:block border-transparent"),ru=d((({className:e,title:t,description:n,button:i,...a})=>o(g,{className:u("sm:pl-6xl sm:pb-4xl @container-normal",e),defaultPadding:"p-0",...a,children:c("div",{className:"relative h-full",children:[o("div",{className:u(lu,"top-9 right-12 bg-green-dark")}),o("div",{className:u(lu,"top-6 right-8 bg-green")}),o("div",{className:u(lu,"top-3 right-4 bg-green-light")}),c("div",{className:u(au,"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}),je([i],{className:"mt-m sm:mt-6xl sm:justify-center",isVertical:!0})]})]})}))),su={black:"bg-black",white:"bg-white"},ou=d((({className:e="",title:t,description:n,image:i,price:a,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(Te,{className:"h-full",padding:d,title:o(k,{title:t,description:n,headlineVersion:"XS",isEmbedded:!0,align:s}),rightImage:i?.src?o(ne,{className:"flex justify-center align-center mb-xl",image:i}):null,buttons:je([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(_e,{size:"text-s",align:"text-left",font:"font-light",children:"Цвета:"})}),r.map(cu)]}):null,a?c(_e,{size:"text-h3",align:"text-left",children:[a," ₽"]}):null]})}))),cu=(e,t)=>o("figure",{className:`w-6 h-6 ml-s border border-solid border-main-divider rounded-full ${su[e]}`},String(t)),du=d((({icon:e,...t})=>{const n=he(),{text:i,href:a,target:l,onClick:r}=n(t);return i?o("div",{className:u("p-3 rounded-lg bg-white text-secondary-text flex justify-center"),children:o("a",{role:"link",href:a,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:i}):null,o("div",{className:"font-light md:font-normal text-primary-text text-center text-xs md:text-sm whitespace-wrap",children:i})]})})}):null})),mu=d((({className:e,additionalDescription:t,description:n,links:i,title:a,...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:a,description:n,as:"h1",align:"text-left",headlineVersion:"XL"}),o(k,{className:"pt-m",description:t,align:"text-left",isEmbedded:!0})]}),i?.length?uu(i):null]})}))),uu=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(du,{...e},String(t))))}),hu=(e,t)=>e?.map((({aspectName:e,params:n})=>({aspectName:e,params:"mindboxEvent"===e?{...n,eventJson:t}:n}))),pu=d((({className:e="",href:t,target:n,onClick:i,data:a,children:l})=>{const r=he()({href:t,target:n,onClick:i});return o(t?"a":"div",{className:u("block",e),...t?r:{},role:t?"link":"none",...ge(a),children:l})})),gu=[{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"}}],fu=d((({className:e="",media:t,showButtonText:n,stretched:a,version:l="white",children:r})=>{if(!t?.length)return null;const[s,d]=i(),m=t?.map((e=>{const{href:t,icon:i,text:a}=e,{iconMapped:r}=(e=>gu.find((({origins:t})=>t?.some((t=>e?.includes(t)))))||{})(t),o=Le(i)?i:r,c=n?{text:a}:{text:""},m=e?.icon?.iconVersion||"color";return!s&&a&&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},xu(a));return c("div",{className:u("flex flex-col gap-m xl:gap-xs",e),"aria-label":"Социальные сети",children:[o("div",{className:"flex gap-xs",children:je(m,{className:yu(s??!1,a??!1,n),buttonClassName:h})}),r?o(_e,{size:"text-s",font:"font-light",color:"text-secondary-text",children:r}):null]})})),xu=(e=!1)=>e?"flex-1 @lg:flex-initial justify-center":"",yu=(e,t,n=!1)=>u(e||t?"basis-full":"",t&&(!n||!e)?"flex-nowrap":""),bu=d((({className:e,padding:t,description:n,additionalDescription:i,href:a,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(pu,{href:a,target:m,className:"h-full",data:hu(v),children:c(Te,{className:"h-full",defaultPadding:"p-2xl",padding:t,insetTitle:o(k,{title:h,description:n,headlineVersion:"XS",isEmbedded:!0,align:p}),...Ze(Le(l)?o(ne,{image:l}):null,x),buttons:d.length?o(fu,{media:d,stretched:!0,showButtonText:!0,version:N?.version}):null,isImageAlwaysOnRight:y,isImageSecondary:b,imageAlign:"center",children:[o(Oe,{benefits:f}),s?o(De,{__html:s,isDotted:r,itemSize:"list-s"}):null,vu(i,p)]})})}))),vu=(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,Nu=(e,t)=>{const{title:n,description:i,buttons:a}=e;return c("div",{className:"py-lg border-b border-main-divider",children:[n?o("div",{className:"opacity-80",children:o(_e,{size:"text-m",color:"text-secondary-text",children:n})}):null,i?o("div",{className:"mt-2xs",children:o(_e,{size:"text-xl",color:"text-primary-text",children:i})}):null,a?.length?o("div",{className:"text-primary-main",children:je(a)}):null]},String(t))},wu=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(Nu),[x,y]=s>0?[f.slice(0,s),f.slice(s)]:[f,[]],[b,v]=i(!1);return a((()=>de.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:[Le(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(ve,{className:"w-full mt-m mb-lg",...r}):null,y.length?o(ea,{renderFoldableSection:()=>c("div",{children:[x,o(ta,{isUnfolded:b,children:y})]}),renderFoldButton:d.length>=s?Cu(m?.parent,h,b):null}):o("div",{children:x})]})})),Cu=(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&&de.fire("fold",{type:"fold",isUnfolded:!n,parent:e})},type:"button",...n?ge(t):{},children:[o("div",{children:n?"Скрыть":"Подробнее о тарифе"}),o(W,{className:"text-primary-text",name:n?"ArrowUpIcon":"ArrowDownIcon",width:"16",height:"16"})]}),Su=()=>{const e=globalThis.sessionStorage?.getItem("refreshToken"),t=globalThis.sessionStorage?.getItem("accessToken"),n=globalThis.localStorage.getItem("taskId");if(!t||!e||!n)return globalThis.location.href="/",()=>null;const i=async()=>{const n=await Ji("/auth/refresh","POST",{refresh_token:e,access_token:t});if(n){ku(n.status);const e=await n.json();globalThis.sessionStorage.setItem("refreshToken",e.refresh_token),globalThis.sessionStorage.setItem("accessToken",e.access_token)}};i();const a=setInterval(i,24e4);return()=>clearInterval(a)},ku=e=>{401==e&&(globalThis.location.href="/")},Iu=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]})]}))),Tu=d((({step:e=1,totalSteps:t=6,stepsTitles:n=[]})=>{const i=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(Iu,{step:i,showPercentage:!1})]})})}));var Bu;!function(e){e.process="IN_PROCESS",e.ok="APPROVED",e.fail="CANCELLED",e.rework="REVISION"}(Bu||(Bu={}));const Pu=e=>Xi("/user-data/getTaskStatus","POST",e),Ru=e=>Ji("/user-data/sendSignalToProcess","POST",e),Du=d((({__html:e,icon:t="InfoCircleIcon",iconVersion:n="black",link:i})=>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(De,{__html:e}),i?.text?o(ve,{className:"text-primary-main",children:i.text}):null]})]}))),Mu=d((({interval:e=0,intervalExpireAction:t=(()=>null),title:n,__html:a})=>{const[l,r]=i(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(_o,{interval:e,time:l,setTime:e=>{0===e&&t(),r(e)}})})]}),a?o(De,{__html:a}):null]})]})})),_u=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,sectionAdditionalTitle:l,sectionInfoAdditional:r,buttonText:s,interval:d,...m})=>c(g,{...m,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(Mu,{interval:d}):null]}),o(Au,{title:i,items:a}),o(Au,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),Au=({title:e,items:t,countColumns:n=!1})=>{const i=Se();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(_e,{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",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:Eu(e)},t)))}):null]})]}):null},Eu=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),zu=d((()=>o(_u,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),Fu=d((()=>{const[e]=go("leadForm");return o(_u,{interval:300,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредитная карта"},{label:"Категория",description:e?.cardCategory?.text}]})})),Vu=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),Ou=d((()=>{const[e]=go("leadForm");return o(_u,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),Lu=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],ju=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");return a((()=>{(async()=>{for(const e of Lu)await Ru({signalType:e,taskId:n})})();const e=l((async()=>{const e=await Pu({taskId:n});e&&e?.statusCd!==Bu.process&&(clearInterval(i),t(e.statusCd))}),[]),i=setInterval(e,3e4)}),[]),qu(e)})),qu=e=>({IN_PROCESS:o(Fu,{}),CANCELLED:o(zu,{}),APPROVED:o(Ou,{}),REVISION:o(Vu,{})}[e]||null),$u=[{paymentSystem:"",currency:"rub",codeWord:""},{surname:"",name:"",middleName:"",sex:"",birthday: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:""},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:"",addressRetail:{key:"",text:""},bankEmployeeCode:void 0,addressCourier:{fullAddress:"",fiasCode:""},methodObtain:"office",deliveryDate:void 0}],Uu=e=>{if(e)try{return new Date(e)}catch(e){return}},Wu=e=>(t,n)=>t.filter((e=>e)).map((t=>[Hu(n,e),Yu(t,e),Ku(t,e),Gu(t,e),Xu(t,e),Ju(t,e)].some(Boolean)?{...t,required:!1}:t)),Hu=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Yu=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Ku=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Gu=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Xu=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Ju=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Zu=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Qu=({field:e,inputs:t})=>t.map(Zs(e,"")),eh=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Wu(th(t))(e,n),s=r.filter((e=>!Ju(e,th(t))));return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Zu(s),eo(a),Qu({field:t,inputs:r})]},`section-${l}`)})),th=e=>t=>e(t)?.value,nh=d((({step:e,onPrevStep:t})=>{const n=6===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),ih=e=>{const{methodObtain:t,deliveryDate:n=""}=e;return{courierDeliveryFlg:"courier"===t,deliveryDate:(i=n,i?new Date(i).toISOString().split(".")[0]:""),deliveryTimeCd:{value:"TIME_2"}};var i},ah=(e,t)=>{switch(e){case 0:return(e=>{const{currency:t,paymentSystem:n,cardCategory:i,codeWord:a}=e;return{currencyCode:t,paymentSystemTypeCd:n,classCard:i,codeWord:a}})(t);case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",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:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m,snils:u,armyIdFlg:h}=e;return{maritalStatusCd:t,totalDependents:i,otherDependents:n,participantIncomes:ic({wages:a,mandatoryPayments:l,incomeAverage:r,additionalIncome:s,otherIncome:o,otherPayments:c,rentalIncome:d,retirementIncome:m}),snils:u?.replaceAll(" ",""),armyIdFlg:h}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t);case 5:return(e=>{const{addressCourier:t}=e;return{participantAddresses:nc({addressCourier:t})}})(t);default:return{}}},lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Wu(rh(l))(t,e)));if(console.log(ii(Wu(rh(l))(t,e))),!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:"650"},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...ah(a,i)}],...ih(i)}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},rh=e=>t=>e[t],sh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,isFormFinished:a,finishForm:r})=>{const[d,m]=go("leadForm"),u=((e,t)=>({...$u[e],...t,birthday:Uu(t?.birthday),dulIssueDateField:Uu(t?.dulIssueDateField),participantDateRegistration:Uu(t?.participantDateRegistration),beginDate:Uu(t?.beginDate),deliveryDate:Uu(t?.deliveryDate)}))(e,d),h=s(void 0),p=t?.flatMap((e=>e?.inputs))||[],g=l((e=>{h.current=e}),[]),{handleSubmit:f}=lh({step:e,inputs:p,onNextStep:i,saveStep:m,finishForm:r}),[,{field:x,onSubmit:y}]=rn(u,{onSubmit:(e,t)=>{f({...e,...h.current?.(t)})}});return a?o(ju,{}):c("form",{onSubmit:y,className:"space-y-m",children:[eh({sections:t,field:x,step:e,registerSubmit:g}),o(nh,{step:e,onPrevStep:n})]})})),oh=[[{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}]}],[{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:"birthday",required:!0,filledByEsia:!0},{fieldType:"common",name:"birthPlace",required:!0},{fieldType:"common",name:"phone",required:!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"},{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:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{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:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{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:"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"}]}],[{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"]}}]}]],ch=["Параметры карты","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Выбор способа получения"],dh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Su,[]);const p=l((()=>{d((e=>Math.min(e+1,6))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>oh[n]),[n]),[y,b]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y?null:o(Tu,{stepsTitles:ch,step:n,totalSteps:6}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(sh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:y,finishForm:b},String(n))})]})})})),mh=d((({step:e=1,totalSteps:t=5,stepsTitles:n=[]})=>{const i=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(Iu,{step:i,showPercentage:!1})]})})})),uh=d((({title:e,description:t,infoCard:n,sectionInfoTitle:i,sectionInfo:a,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(Mu,{interval:d,intervalExpireAction:m}):null]}),o(hh,{title:i,items:a}),o(hh,{title:l,items:r,countColumns:!0}),n?.__html?o(Du,{__html:n?.__html,icon:n?.icon,link:{text:n?.link?.text}}):null,s?o(ve,{href:"/natural",text:s,version:"primary",className:"w-full mt-lg"}):null]}))),hh=({title:e,items:t,countColumns:n=!1})=>{const i=Se();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(_e,{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",Qs(n||i?1:2)),children:t.map(((e,t)=>o("div",{children:ph(e)},t)))}):null]})]}):null},ph=({label:e,description:t})=>c("div",{className:"flex flex-col",children:[o(_e,{color:"text-secondary-text",size:"text-l",children:e}),o(_e,{color:"text-primary-text",size:"text-xl",children:t})]}),gh=d((()=>o(uh,{title:"Благодарим Вас за ожидание",description:"В настоящий момент Банк не может одобрить Вашу заявку на кредит. Попробуйте подать заявку позже. Спасибо за обращение в АО «Россельхозбанк».",buttonText:"Вернуться на главную"}))),fh=d((({handleExpireTimer:e})=>{const[t]=go("leadForm");return o(uh,{interval:300,intervalExpireAction:e,title:"Заявка успешно отправлена",description:"Не закрывайте окно, скоро сообщим результат",sectionInfoTitle:"Заявленные условия по кредиту",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Цель кредита",description:"На любые цели"},{label:"Сумма",description:t?.moneyValue?.toLocaleString()+" ₽"},{label:"Срок кредита",description:t?.monthsValue+" мес"},{label:"Тип платежа",description:t?.isAnnuity?"Аннуитетный":"Дифференцированный"}]})})),xh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Благодарим вас за ожидание, но нам требуется больше времени для принятия решения",description:"Посетите выбранное отделение банка с необходимыми документами и так завершите оформление кредита.",sectionAdditionalTitle:"В отделении Банка",sectionInfoAdditional:[{label:"Регион",description:e?.regionRetail?.text},{label:"Адрес",description:e?.addressRetail?.text}],sectionInfo:[{label:"Основные документы:",description:"- Паспорт РФ"}],buttonText:"Вернуться на главную"})})),yh=d((()=>{const[e]=go("leadForm");return o(uh,{title:"Банк одобрил вам кредит",description:"Обратитесь в отделение банка, чтобы завершить оформление и получит ваш кредит",sectionInfo:[{label:"Название продукта",description:"Кредит на любые цели"},{label:"Ставка",description:"14,5%"},{label:"Ежемесячный платеж",description:"86 052 ₽"},{label:"Срок кредита",description:e?.monthsValue+" мес"},{label:"Тип платежа",description:e?.isAnnuity?"Аннуитетный":"Дифференцированный"}],buttonText:"Вернуться на главную"})})),bh=["CREATE_APPLICATION_SHORT_SIGNAL","CREATE_APPLICATION_LOAN_V3_SIGNAL"],vh=d((()=>{const[e,t]=i(Bu.process),[n]=go("taskId");a((()=>{(async()=>{for(const e of bh)await Ru({signalType:e,taskId:n})})();const e=setInterval((()=>n&&Pu({taskId:n}).then((n=>{n?.statusCd&&n.statusCd!==Bu.process&&(clearInterval(e),t(n.statusCd))}))),3e4);return()=>clearInterval(e)}),[]);return Nh(e,(()=>t(Bu.rework)))})),Nh=(e,t)=>({IN_PROCESS:o(fh,{handleExpireTimer:t}),CANCELLED:o(gh,{}),APPROVED:o(yh,{}),REVISION:o(xh,{})}[e]||null),wh=[{moneyValue:0,monthsValue:0,isAnnuity:!1,isInsurance:!1,isSalaryClient:!1,isPensionClient:!1,isStateEmployee:!1},{surname:"",name:"",middleName:"",sex:"",birthday: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:"",addressRetail:void 0,bankEmployeeCode:void 0}],Ch=e=>{if(e)try{return new Date(e)}catch(e){return}},Sh=e=>(t,n)=>t.filter((e=>e)).map((t=>[kh(n,e),Ih(t,e),Th(t,e),Bh(t,e),Ph(t,e),Rh(t,e)].some(Boolean)?{...t,required:!1}:t)),kh=(e,t)=>2===e&&"RETIREE"===t("employment")?.key,Ih=({name:e},t)=>"partInBusiness"===e&&"BUSINESS_OWNER"!==t("positionOrganization")?.key,Th=({name:e},t)=>"snils"===e&&!t("consentPfrFlg"),Bh=({name:e,filledByEsia:t},n)=>e?.startsWith("address")&&n("esiaAccountTypeCd")?.key&&t,Ph=({name:e},t)=>"addressFact"===e&&t("addressMatch"),Rh=({condition:e},t)=>e?.name&&e?.values?.some((n=>{const i=t(e?.name);return n!==(i?.key??i)})),Dh=(e=[])=>{const t=e.filter((e=>"info"===e.fieldType));return t.length?t.map((({text:e,name:t},n)=>o(Du,{__html:e},`${t}_${n}`))):null},Mh=({field:e,inputs:t})=>t.map(Zs(e,"")),_h=({sections:e,field:t,step:n})=>e?.map((({inputs:e=[],columns:i,title:a},l)=>{const r=Sh(Ah(t))(e,n);return c("div",{className:u(Qs(i),"grid gap-x-m"),children:[Dh(r),eo(a),Mh({field:t,inputs:r})]},`section-${l}`)})),Ah=e=>t=>e(t)?.value,Eh=d((({step:e,onPrevStep:t})=>{const n=5===e;return c("div",{className:"flex justify-between gap-m",children:[o(Oa,{onClick:t,type:"button",version:"secondary",disabled:0===e,children:"Назад"}),o(Oa,{type:"submit",children:n?"Отправить заявку":"Далее"})]})})),zh=e=>{const{addressRetail:t}=e;return{office:t?.key?{id:t.key}:void 0}},Fh={annuity:{key:"ANNUITY",value:"Аннуитетный"},differential:{key:"DIFFERENTIAL",value:"Дифференцированный "}},Vh=e=>{const{moneyValue:t,monthsValue:n,isAnnuity:i}=e;return{loanAmount:t,creditPeriod:n,paymentTypeCd:Fh[i?"annuity":"differential"]}},Oh=(e,t)=>{switch(e){case 0:default:return{};case 1:return(e=>{const{name:t,surname:n,middleName:i,birthday:a="",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:Lt(a,!0),midname:i,name:t,surname:n,birthPlace:o,dulIssueDate:Lt(c,!0),dulIssuedBy:d,dulNumber:m,dulSerie:u,dulSubdivisionCode:h,educationLevelCd:p,registrationDate:Lt(g,!0),houseTypeCd:f,participantContacts:tc({phone:jt(l),email:r}),participantAddresses:nc({addressRegistration:x,addressFact:y}),genderCd:s?{key:"male"===s?"MAN":"WOMAN"}:void 0}})(t);case 2:return(e=>{const{employment:t,organizationName:n,inn:i,legalForm:a,organization:l,amountWorkers:r,employerActivities:s,employerOrganization:o,generalSeniority:c,lastJobExperience:d,experience5Years:m,jobsNumber:u,organizationPhone:h,organizationAddress:p,positionOrganization:g}=e;return{employmentTypeCd:t,organizationName:n,organizationInn:i,organizationActivityTypeCd:s,organizationTypeCd:l,organizationKindCd:o,employeesNumberCd:r,opf:a,seniority:c,generalSeniority:m,jobsNumber:u,lastWorkDuration:d,payrollCardRshbFlg:!0,positionCd:g,participantContacts:tc({organizationPhone:h&&jt(h)}),participantAddresses:nc({organizationAddress:p})}})(t);case 3:return(e=>{const{familyStatus:t,dependents:n,familyMembers:i,confirmationIncome:a,wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u,snils:h,armyIdFlg:p}=e;return{maritalStatusCd:t,totalDependents:i,incomeCertificateCd:a,otherDependents:n,participantIncomes:ic({wages:l,mandatoryPayments:r,incomeAverage:s,additionalIncome:o,otherIncome:c,otherPayments:d,rentalIncome:m,retirementIncome:u}),snils:h?.replaceAll(" ",""),armyIdFlg:p}})(t);case 4:return(e=>{const{bankruptcyFlg:t,shareholderFlg:n,legalEntityName:i,creditInRshbCd:a}=e;return{bankruptcyFlg:t,shareholderFlg:n,nameLegalEntity:i,creditInRshbCd:a}})(t)}},Lh=({step:e,inputs:t,onNextStep:n,saveStep:i,finishForm:a})=>{const[r]=go("taskId"),[s]=go("profileId"),[o]=go("participantId"),c=l((async l=>{const c=io(ii(Sh(jh(l))(t,e)));if(!Fn(c(l)))return console.warn("validation fail");i(l);try{r&&s&&o&&await So((({participantId:e,taskId:t,profileId:n,formData:i,step:a=0})=>({sendToBank:!0,taskKind:"UNITED",task:{taskSource:globalThis.location.origin,id:t,office:{id:""},authorizedAgentId:i?.bankEmployeeCode,participants:[{id:e,profile:{id:n},roleCd:{key:"BORROWER",value:"Заемщик"},...Oh(a,i)}],...Vh(i),...zh(i),esiaAccountTypeCd:{key:i?.esiaAccountTypeCd?.key}}}))({participantId:o,taskId:r,profileId:s,step:e,formData:l}))}catch(e){return"Fail"}return n(),5===e&&a?.(!0),"OK"}),[]);return{handleSubmit:c}},jh=e=>t=>e[t],qh=d((({step:e,sections:t,onPrevStep:n,onNextStep:i,renderStep:a=_h,isFormFinished:r,finishForm:d})=>{const[m,u]=go("leadForm"),h=((e,t)=>({...wh[e],...t,birthday:Ch(t?.birthday),dulIssueDateField:Ch(t?.dulIssueDateField),participantDateRegistration:Ch(t?.participantDateRegistration),beginDate:Ch(t?.beginDate),deliveryDate:Ch(t?.deliveryDate)}))(e,m),p=s(void 0),g=t?.flatMap((e=>e?.inputs))||[],f=l((e=>{p.current=e}),[]),{handleSubmit:x}=Lh({step:e,inputs:g,onNextStep:i,saveStep:u,finishForm:d}),[,{field:y,onSubmit:b}]=rn(h,{onSubmit:(e,t)=>{x({...e,...p.current?.(t)})}});return r?o(vh,{}):c("form",{onSubmit:b,className:"space-y-m",children:[a({sections:t,field:y,step:e,registerSubmit:f}),o(Eh,{step:e,onPrevStep:n})]})})),$h=[[],[{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:"birthday",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"},{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:!1},{fieldType:"common",name:"amountWorkers",required:!1}]},{columns:2,inputs:[{fieldType:"common",name:"employerActivities",required:!1},{fieldType:"common",name:"employerOrganization",required:!1},{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:!1},{fieldType:"common",name:"partInBusiness",required:!0}]},{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"}]}],[{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"}]}]],Uh=["","Персональные данные","Данные о трудоустройстве","Семейное положение и доход","Дополнительные сведения","Отделение Банка"],Wh=d((({className:e,...t})=>{const[n,d]=i(0),m=s(null),h=l((()=>m?.current?.scrollIntoView({behavior:"smooth"})),[m]);a(Su,[]);const p=l((()=>{d((e=>Math.min(e+1,5))),h()}),[]),f=l((()=>{d((e=>Math.max(e-1,0))),h()}),[]),x=r((()=>$h[n]),[n]),y=0===n,[b,v]=i(!1);return o(g,{className:u("bg-transparent",e),defaultPadding:"p-0",...t,children:c("div",{ref:m,className:"container grid grid-cols-12",children:[y||b?null:o(mh,{stepsTitles:Uh,step:n,totalSteps:5}),o("div",{className:"py-lg px-5xl mt-2xs bg-white col-span-12",children:o(qh,{step:n,sections:x,onNextStep:p,onPrevStep:f,isFormFinished:b,finishForm:v,renderStep:y?({registerSubmit:e,field:t})=>o(gm,{defaultParams:{sum:t("moneyValue").value,period:t("monthsValue").value,isAnnuity:t("isAnnuity").value},title:"Калькулятор кредита",footnote:"Расчёт является предварительным. Точные условия будут предоставлены в отделении Банка.",calcSource:{$ref:"/wcms-resources/credit-calculator-data.json"},registerSubmit:e}):void 0},String(n))})]})})})),Hh=e=>"number"==typeof e?.minMonths&&"number"==typeof e?.maxMonths,Yh=(e,t)=>Array.from({length:t-e+1},((t,n)=>e+n)),Kh=1e9,Gh={sum:{min:1e4,max:Kh},period:3},Xh=zt((({className:e,filtrationSchema:t={},resetButton:n,sumInput:i,periodInput:a,...l})=>{const[,{blocksToRender:r,blocksWithProps:s},{field:d,reset:m}]=cd(Gh,{block:l.block,page:l.options?.page,normalize:e=>({...e,period:Jh(e)})}),h=s.map((([,e])=>e?.paramsSource?.rows?.[0]?.rates)),p=Zh(h);return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...l,children:[o(nd,{filtrationSchema:t,resetButton:n,field:d,reset:m,children:c("div",{className:"@4xl:max-w-xs space-y-lg",children:[o(Wm,{label:i?.title,min:500,max:Kh,...d("sum",{parse:e=>({min:Number(e),max:Kh}),format:({min:e})=>String(e)})}),o(dl,{title:a?.title,items:["От 3 мес","До 5 лет"],list:p,...d("period")})]})}),o(Zc,{blocksToRender:r,...l})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>({...e?.filtrationSchema||{},paramsSource:{type:"object",title:"Адрес справочника"}})}),Jh=e=>Dt((e?.paramsSource?.rateRows||[]).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))),Zh=e=>Dt(e.flatMap((e=>e||[])).filter(Hh).flatMap((e=>Yh(e.minMonths,e.maxMonths)))).sort(((e,t)=>e-t))||[],Qh=[{key:"10"},{key:"50"},{key:"100"}],ep=({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(Mn,{className:"min-w-20",onChange:n,value:{key:String(e)},options:Qh,iconVersion:"black"})]})},tp="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",np=(e,t)=>{const{currentPage:n,onPageChange:i,totalPages:a}=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!==a&&((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,a)?o("div",{onClick:()=>i(l),className:tp,"aria-label":`Страница ${l}`,children:l},String(t)):null},ip={width:"24",height:"24"},ap=({currentPage:e,onPageChange:t,totalPages:n})=>{const i=r((()=>Array.from({length:n}).fill({currentPage:e,onPageChange:t,totalPages:n})),[n,e]),a=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:a,children:o(W,{name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(1===e),...ip})}),c("div",{className:"flex @lg:gap-2xs",children:[e>1?o("div",{onClick:d,className:tp,"aria-label":"Страница 1",children:"1"}):null,e>3?o("div",{className:"py-m @lg:px-s",children:"..."}):null,i.map(np),e<n-2?o("div",{className:"py-m @lg:px-s",children:"..."}):null,e<n?o("div",{onClick:m,className:tp,"aria-label":`Страница ${n}`,children:n}):null]}),o("div",{onClick:s,children:o(W,{className:"rotate-180",name:"ArrowLeftIcon",iconVersion:"black",imageClassName:lp(e===n),...ip})})]})},lp=e=>e?"opacity-20":"cursor-pointer hover:opacity-60",rp=({currentPage:e,onPageChange:t,totalPages:n,itemCount:i,onItemCountChange:a})=>c("div",{className:"mt-3xl flex justify-between flex-col @lg:flex-row items-center select-none",role:"navigation","aria-label":"Пагинация",children:[o(ap,{currentPage:e,onPageChange:t,totalPages:n}),i&&a?o(ep,{itemCount:i,onItemCountChange:a}):null]}),sp=d((({className:e,value:t,autoFocus:n,onChange:i,onFocus:a,placeholder:r="Поиск по сайту"})=>{const s=l((e=>{i&&i(e.target?.value||"")}),[i]);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",gn),value:t,type:"text",name:"search-bar-input",placeholder:r,autoFocus:n,onChange:s,onFocus:a})]})})),op=d((({field:e,onClearFilter:t,filtrationState:n})=>c("div",{className:"grid grid-cols-12 mb-3xl @lg:space-x-xl",children:[o(sp,{className:"col-span-12 @lg:col-span-4 mt-auto",placeholder:"Поиск",...e("query")}),o(Ul,{className:"col-span-12 @lg:col-span-3 mt-4 @lg:mt-0",label:"Период от",maxDate:n.endDate,...e("startDate")}),o(Ul,{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(Oa,{type:"reset",className:"w-full",version:"secondary",onClick:t,children:"Очистить"})})]}))),cp=(e,t)=>o(fd,{...e,iconBgVersion:t,className:"shrink-0"}),dp=({title:e,timestamp:t,publicId:n})=>{const i=he(),{href:a}=i({href:`/api/v1/depository/${n}/file`});return c("div",{className:"flex gap-3 items-center py-lg border-gray border-opacity-50 border-b",children:[cp({icon:"DocDownloadIcon",iconVersion:"black"}),c("div",{className:"flex flex-col gap-x-6xl lg:flex-row lg:items-center",children:[t?o(_e,{size:"text-m","font-weight":"font-light",children:Lt(t)}):null,o("a",{className:"text-h6 hover:text-primary-active",href:a,download:!0,"aria-label":"Скачать",children:e})]})]},n)},mp="/api/v1/depository",up={startDate:void 0,endDate:void 0,query:""},hp=zt((({className:e,...t})=>{const[n,a]=i(0),[r,s]=i(10),[d,{field:m,reset:h}]=rn(up),{totalPages:p=0,items:f=[]}=(({size:e,page:t,query:n,startDate:i,endDate:a})=>{const l=i?Lt(i,!0):"",r=a?Lt(a,!0):"",s=new URLSearchParams(mp);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}=hi(mp+o,Rt);return{items:c?.content,totalPages:c?.totalPages}})({size:r,page:n,...d}),x=l((e=>a(e-1)),[]),y=l((e=>{r!==e?(s(e),a(0)):s(e)}),[]);return c(g,{className:u(e,"container p-6xl"),...t,children:[o(op,{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(_e,{size:"text-m",color:"text-secondary-text",children:"Дата"})}),o("span",{className:"col-span-8 @lg:col-span-10 hidden @lg:block",children:o(_e,{size:"text-m",color:"text-secondary-text",children:"Тема"})})]}),f.length?f.map((e=>o(dp,{...e},String(e.publicId)))):o(hc,{title:"Ничего не найдено",description:"Попробуйте очистить фильтры"}),o(rp,{currentPage:n+1,onPageChange:x,totalPages:p,itemCount:r,onItemCountChange:y})]})]})})),pp=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,gp=d((({className:e="",title:t,description:n,error:i,button:a,...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:pp(i)}),o(k,{title:t,description:n,headlineVersion:"XL",isEmbedded:!0,className:"mb-2xl last:mb-0"}),a?.text?o(ve,{version:a?.version,text:a?.text,...a}):null]})));function fp(e,t){for(const[n,i]of e.entries())null!=i?t.setItem(n,i):t.removeItem(n)}const xp={};function yp(e,t=xp){const n=s(null),o=function(){const[,e]=i(0);return l((()=>e((e=>(e+1)%65536))),[])}();return a((()=>e.bus.watch((e=>{n.current?.has(String(e.type))&&o()}))),[e,o]),r((()=>new Proxy(t,{get:(t,i)=>(n.current||=new Set,n.current.add(i),e.getItem(i)),has:(t,i)=>(n.current||=new Set,n.current.add(i),e.hasItem(i)),set:(t,n,i)=>(e.setItem(n,i),!0),deleteProperty:(t,n)=>(e.removeItem(n),!0)})),[e])}const bp=new class{bus;store=new Map;get size(){return this.store.size}constructor(e=new ce){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 vp,Np;function wp(e){return yp(bp,e)}vp=bp,Np=new class{storage;bus;get size(){return this.storage?.length??0}constructor(e,t=new ce){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),fp(vp,Np),fp(Np,vp),vp.bus.watch((({type:e,event:t})=>{null!=t?Np.setItem(e,t):Np.removeItem(e)}));const Cp="/api/v1/region";function Sp(e="Москва"){return wp().location??{name:e}}function kp(e="Москва"){const t=wp(),n=l((async()=>{if(!t.location){const n=await Pt(Cp);t.location=n??{name:e}}}),[t,e]);return hi(Cp,n),t}var Ip;!function(e){e.RUB="RUB",e.EUR="EUR",e.USD="USD",e.CNY="CNY"}(Ip||(Ip={}));const Tp=new Intl.NumberFormat("ru",{style:"currency",currency:Ip.RUB}),Bp=e=>e?Tp.format(e):"",Pp="text-m font-light text-secondary-text ",Rp=`${Pp} text-left`,Dp=`${Pp} pl-5xl text-center`,Mp=`${Pp} pl-5xl text-right`,_p={USD:"DollarIcon",EUR:"EuroIcon",CNY:"ChineseYuanRenminbiIcon"},Ap=d((({className:e,exchangeCurrencyItems:t})=>c("table",{className:u("h-fit w-full",e),children:[o("thead",{children:c("tr",{children:[o("th",{className:Rp,children:o(_e,{size:"text-m",children:"Валюта"})}),o("th",{className:Dp,children:o(_e,{size:"text-m",children:"Купить"})}),o("th",{className:Mp,children:o(_e,{size:"text-m",children:"Продать"})})]})}),o("tbody",{children:t.map(Ep)})]}))),Ep=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:_p[t]},width:"24",height:"24"}):null,o(_e,{size:"text-h6",children:t})]})}),o("td",{className:"pt-m pl-5xl text-center",children:o(_e,{size:"text-h6",children:Bp(e?.saleExchangeRate)})}),o("td",{className:"pt-m pl-5xl text-right",children:o(_e,{size:"text-h6",children:Bp(e?.buyExchangeRate)})})]},t)},zp={icon:"GpsIcon"},Fp=d((({className:e="",address:t})=>c("div",{className:u("flex gap-s w-full justify-between @sm:justify-center",e),children:[o(fd,{...zp,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:"Курс указан для заданного офиса"})]})]}))),Vp=(e,t,n)=>{const i=Number(Op(e))*Math.pow(t,n?-1:1);return Number.isInteger(i)?i:((e,t=2)=>{const n=10**t;return Math.round(parseFloat(String(e))*n)/n})(i)},Op=e=>e.replace(/[^\d.,]/g,"").replace(",","."),Lp=e=>Zt([[e=>e.value!==Ip.RUB&&e.oppositeValue!==Ip.RUB,()=>e.handleConvert(e.value,Ip.RUB)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.USD)],[e=>e.value===Ip.RUB&&e.oppositeValue===Ip.RUB,()=>e.handleConvert(e.value,Ip.CNY)],[()=>!0,()=>e.handleConvert(e.value)]])(e)?.();function jp(e){const{placeholder:t,rates:n,selected:i,value:a,setValue:l,setSelected:r}=e,s=n.map((e=>({key:e?.currency?.currency??"",text:e?.currency?.currency??""}))),d={key:i,text:i};return c("div",{className:"relative flex",children:[o(xn,{className:"shrink-0 text-l w-full appearance-none -mr-20",placeholder:t,type:"text",value:a,onChange:l}),s.length?o(Mn,{className:"absolute right-0",isBorder:!1,onChange:e=>r(e.key),options:s,value:d}):null]})}const qp=d((({className:e="",currencyRatesBuy:t,currencyRatesSell:n,button:a})=>{const[r,s]=i({inputSell:"",inputBuy:"",selectSell:t?.[0]?.currency?.currency||Ip.RUB,selectBuy:n?.[0]?.currency?.currency||Ip.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:[jp({placeholder:"Хочу продать",rates:n,selected:r.selectSell,setSelected:$p(r,d,n),value:r.inputSell,setValue:e=>Wp(d,n)(e,r.selectSell,r.selectBuy)}),jp({placeholder:"Получу",rates:t,selected:r.selectBuy,setSelected:Up(r,d,t),value:r.inputBuy,setValue:e=>Hp(d,t)(e,r.selectBuy,r.selectSell)})]}):null,a?.text?o(ve,{text:a.text,version:a?.version,...a}):null]})})),$p=(e,t,n)=>i=>{t({selectSell:i}),Lp({value:i,oppositeValue:e.selectBuy,handleConvert:(i=e.selectSell,a=e.selectBuy)=>{Wp(t,n)(e.inputSell,i,a)}})},Up=(e,t,n)=>i=>{t({selectBuy:i}),Lp({value:i,oppositeValue:e.selectSell,handleConvert:(i=e.selectBuy,a=e.selectSell)=>Hp(t,n)(e.inputBuy,i,a)})},Wp=(e,t)=>(n,i,a)=>{e({inputSell:Op(n),selectBuy:a});const l=t.find((e=>e.currency?.currency===a))?.buyExchangeRate||t.find((e=>e.currency?.currency===i))?.buyExchangeRate;l&&e({inputBuy:String(Vp(n,l,i===Ip.RUB)||"")})},Hp=(e,t)=>(n,i,a)=>{e({inputBuy:Op(n),selectSell:a});const l=t.find((e=>e.currency?.currency===a))?.saleExchangeRate||t.find((e=>e.currency?.currency===i))?.saleExchangeRate;l&&e({inputSell:String(Vp(n,l,i===Ip.RUB)||"")})};const Yp=d((({className:e="",title:t="Курсы обмена валют",button:n,...i})=>{const a=function(e){const t=e?.code||"000",{data:n}=hi(`/api/v1/exchangerates?regionCode=${t}`,Rt);return n||{}}(Sp()),l=Kp(a?.exchangeRate?.currencies),r=l.filter((e=>e.buyExchangeRate));r.unshift({currency:{currency:Ip.RUB}});const s=l.filter((e=>e.saleExchangeRate));return s.push({currency:{currency:Ip.RUB}}),o(g,{className:u("box-border min-h-80",e),...i,children:o(Te,{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(Ap,{className:"mb-xl",exchangeCurrencyItems:l}):null,o(Fp,{address:a?.address})]}),o(qp,{className:"grow w-1/2",currencyRatesBuy:r,currencyRatesSell:s,button:n})]})})})})),Kp=e=>e?.filter((e=>[1,2,3].includes(e?.currency?.id)))||[],Gp=d((({className:e="",items:t})=>{const n=he();return o("ul",{className:u("flex flex-col gap-s w-full",e),children:t?.map(Xp(n))})})),Xp=e=>({dataFooter:t,...n},i)=>{const{text:a,href:l,target:r,onClick:s}=e(n);return a?o("li",{className:"list-none",children:o("a",{className:"hover:text-primary-main font-light",role:"link",href:l,target:r||"_self",onClick:s,...ge(t),children:a||null})},String(i)):null},Jp=d((({label:e,labelIconBgVersion:t,icon:n,onToggle:i,labelIcon:a})=>o(Hc,{tag:"button",className:u("border-none bg-transparent items-center group/button",a?.icon?"py-xs":"py-lg"),onClick:i,textNode:c("div",{className:"flex items-center text-start group-hover/button:text-primary-main gap-s",children:[cp(a,t),e?o(_e,{size:"text-h6",font:"font-normal",children:e}):null]}),iconNode:n?o(W,{name:n,iconVersion:"color",width:"24",height:"24"}):null}))),Zp=(e=!1)=>e?"flex flex-wrap group-last:last:pb-0":"grid grid-cols-12 [&>*]:pb-m",Qp=(e=!1)=>e?"MinusIcon":"PlusIcon",eg=(e=!1)=>e?"ArrowUpSolidIcon":"ArrowDownSolidIcon",tg=zt((({className:e="",isExpanded:t,isFoldButtonOnTop:n=!0,label:i="Развернуть",labelIcon:a,labelIconBgVersion:l,foldButtonVersion:r="default",version:s,role:c,...d})=>{const m=Se();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(ea,{isFoldButtonOnTop:n,unfoldedByDefault:t,renderFoldableSection:({isUnfolded:e})=>o(ta,{className:u("gap-lg",Zp(m)),isUnfolded:e,children:D({...d,extraProps:{className:"w-full",padding:"p-0"}})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>ng({foldButtonVersion:r,label:i,labelIcon:a,labelIconBgVersion:l,isUnfolded:e,onToggle:t,isMobile:m})})})}),{childrenTypes:{exclude:["RollupItem"]}}),ng=({foldButtonVersion:e,label:t,labelIcon:n,labelIconBgVersion:i,isUnfolded:a,onToggle:l,isMobile:r=!1})=>{const s=t||(a?"Скрыть":"Развернуть"),c=((e=!1,t=!1)=>t?eg(e):Qp(e))(a,r);return"accordion"===e?o(Jp,{label:s,labelIcon:n,labelIconBgVersion:i,icon:c,onToggle:l}):o(Yc,{label:s,icon:a?"ArrowUpIcon":"ArrowDownIcon",onClick:l})},ig=d((({navigationItems:e})=>o("div",{className:"w-full",role:"menu",children:ag(e)}))),ag=e=>e?.filter((e=>e.icon?.icon)).map(((e,t)=>o(tg,{foldButtonVersion:"accordion",label:e?.text,labelIcon:e?.icon,role:"menuitem",children:e.items?o(Gp,{items:e.items}):null},String(t)))),lg=d((({className:e="",items:t=[]})=>t?.length?o("div",{className:u("space-y-m",e),children:t.map(rg)}):null)),rg=(e,t)=>c("div",{className:"space-y-m",children:[o("div",{children:o(_e,{size:"text-l",font:"font-medium",children:e?.title})}),o("div",{className:"space-y-m",children:e.items?.map(sg)})]},String(t)),sg=(e,t)=>c("div",{className:"space-y-2xs",children:[o("div",{children:og(e.type,e.text)}),o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:e.description})]},String(t)),og=(e,t="")=>{switch(e){case"tel":return o("a",{className:"text-primary-text hover:text-primary-main no-underline",href:`tel:${cg(t)}`,children:o(_e,{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})}},cg=e=>e.replaceAll(/\D/g,""),dg=d((({className:e="",index:t,text:n,...i})=>{const a=he(),{href:l,target:r,onClick:s}=a(i);return o("a",{className:u("text-secondary-text",e),href:l,target:r,onClick:s,children:n||`Документ ${t}`})})),mg=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(_e,{size:"text-l",font:"font-normal",children:t})}),n.map(((e,t)=>o(dg,{index:t,className:"text-l font-light lg:max-w-[292px]",...e},String(t))))]}):null}))),ug=d((({className:e="",index:t,...n})=>{const i=he(),{href:a,target:l,text:r,onClick:s}=i(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:a,target:l,onClick:s,children:r||`Документ ${t}`})})),hg=d((({className:e="",links:t,license:n})=>c("div",{className:u("@container space-y-lg",e),children:[n?o("div",{children:o(_e,{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(ug,{index:t,...e},String(t))))}):null]}))),pg=zt((({className:e,footer:t,...n})=>{const{navigationItems:i}=n.options?.page?.navigation??{};n.options?.page?.common;const{documents:a,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(ig,{navigationItems:i}),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(lg,{items:r}),m?o(ve,{className:"w-full",version:"primary",...m}):null,s.map(((e,t)=>o(fu,{media:e?.links??[],showButtonText:!1,stretched:!0,children:e?.title},String(t)))),p.map(((e,t)=>o(ve,{className:"!text-left text-s font-light",version:"link",...e,children:e?.text},String(t))))]})]}),o(mg,{title:d,links:l}),o(hg,{links:a,license:h})]})})),gg=zt((({className:e,title:t,button:n,regionSource:a,data:l,...r})=>{const[s,d]=i({key:""}),m=a?.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 max-w-[978px] space-y-m",children:[t?o(w,{headingType:"h3",title:t,className:"@xl:text-center"}):null,m?o(zn,{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(ve,{href:p,target:"_blank",className:u("p-m w-full @xl:w-auto",h),data:hu(l,s?.key),children:f})}):null]})})})),fg={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"},xg=d((({version:e,text:t,mobileText:n,...i})=>{const a=Se()?n:t;return a?o(ve,{className:u("py-s px-lg font-light whitespace-nowrap",fg["transparent"===e?"transparent":"default"]),...i,children:a}):null})),yg=d((({bgColor:e,logo:t,alwaysShowLogo:n,internetBankButton:i,version:a,backwardButton:r})=>{const s=M(),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(Do,{className:"my-2xs",bgColor:e,logo:h,data:u,showTitle:!1})}):bg(p,r),o(xg,{version:a,...i})]})})),bg=(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,vg={"bg-white":"primary",transparent:"transparent"},Ng=zt((({bgColor:e="bg-white",alwaysShowLogo:t=!1,version:n=vg[e],portal:i,logo:a={},...l})=>{const{backwardButton:r,logo:s={}}=l.options?.page?.common??{},{internetBankButton:c}=i||{},d=a.image?.icon||a.image?.src?a:s;return o(g,{tag:"header",defaultPadding:"",version:n,...l,children:o("div",{className:"container px-lg py-2xs box-border",children:o(yg,{bgColor:e,logo:d,alwaysShowLogo:t,internetBankButton:c,version:n,backwardButton:r,...l})})})})),wg=(e=!1)=>e?{}:{padding:"p-0"},Cg={XXL:"gap-6xl",XL:"gap-5xl",L:"gap-3xl",M:"gap-m",S:"gap-xs",XS:"gap-2xs","":""},Sg=zt((({className:e="",padding:t="p-0",gap:n="",isInnerPadding:i=!0,version:a="transparent",isTheme:l=!1,isCardBorder:r=!1,image:s,...c})=>{const d=M();return o(g,{className:u("relative flex flex-col",Cg[n],s?.src?"bg-right-bottom bg-no-repeat":"",e),...s?.src?{style:{backgroundImage:`url(${J(d)(s?.src)})`}}:{},padding:t,version:a,isTheme:l,...c,children:D({...c,extraProps:{className:u("w-full",pc(r)),...wg(i)}})})}),{childrenTypes:[]}),kg=zt((e=>o(Sg,{...e})),{childrenTypes:[]}),Ig=d((e=>{const{className:t,align:n,image:i,...a}=e,l=n?u("flex",Nd[n]):"";return o(g,{className:u(l,t),defaultPadding:"p-0",...a,children:o(ne,{image:i})})})),Tg=["байт","Кб","Мб","Гб","Тб","Пб"],Bg=d((({icon:e,text:t,href:n,target:i,fileFormat:a,data:l,fileSize:r})=>{const s=r&&a?",":"",d=r??"",m=a?String(a):"";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:i,...ge(l),children:[e,t?c(_e,{size:"text-l",font:"font-light",children:[t," ",Pg(d,m),o(_e,{color:"text-secondary-text",children:n&&`${d+s+m}`})]}):null]})})),Pg=(e,t)=>e||t?o("span",{children:", "}):"",Rg=(e,t)=>(n,i)=>{const a=$(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))} ${Tg[n]}`})(n?.attachment?.fileSize||0):n?.fileSize,r="Attachment"===n?.docType?Mg(a):n?.fileFormat;return c("div",{role:"listitem",children:[o(Bg,{text:n?.text,target:n?.target,href:a,fileFormat:r,fileSize:l,icon:Dg(t),data:n?.data}),o(De,{__html:n?.__html})]},String(i))},Dg=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,Mg=e=>{if(!e)return"";const t=e.lastIndexOf("."),n=new RegExp(/\/(.*)/),i=-1!==t?e.substring(t+1):"";return i.includes("/")?i.replace(n,""):i},_g=d((({href:e,__html:t,target:n})=>{const{close:i}=me(),a=M(),r=$(a)(e),s=l((()=>{i()}),[]);return c(sr,{className:"my-6xl min-h-fit w-fit mx-auto",children:[t?o(De,{__html:t}):null,c("div",{className:"flex flex-row mx-auto w-fit gap-lg py-lg",children:[o(ve,{text:"Я согласен",version:"primary",target:n,href:r,onClick:s}),o(Oa,{type:"button",version:"secondary",onClick:s,children:"Я не согласен"})]}),o("div",{children:"Нажимая кнопку «Я СОГЛАСЕН» ниже Вы принимаете данные условия. Распространение или раскрытие любой части данного Заключения или любой информации, или рекомендации в нем запрещено.»"})]})})),Ag=d((({text:e,href:t,target:n,__html:i,icon:a})=>{if(!e&&!i)return null;const r=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(_g,{...e}),n),close:n}})({__html:i,href:t,target:n}),s=l((()=>r.open()),[r]);return c("button",{className:"flex gap-s text-primary-text no-underline hover:text-primary-main",onClick:s,children:[Dg(a),o(_e,{font:"font-light",children:e})]})})),Eg={double:"sm:flex-wrap sm:flex-row",single:"sm:flex-col"},zg=zt((({className:e="",title:t,description:n,align:i="text-center",documents:a,icon:l={icon:"DocIcon"},columnsMode:r="double",...s})=>{const d=M();return c(g,{className:u("space-y-lg",e),defaultPadding:"p-6xl",...s,children:[o(k,{title:t,description:n,align:i,headlineVersion:"M",as:"h2",isEmbedded:!0}),a?.length?o("div",{className:u("grid gap-xl","double"===r?"@md:grid-cols-2":"grid-cols-1",Eg[r]),role:"list",children:a.map(Fg(d,l))}):null]})})),Fg=(e,t)=>(n,i)=>{const a=n?.docType;return""===a?null:"reportSource"in n&&n?.reportSource?.__html?Vg(t)(n,i):Rg(e,t)(n,i)},Vg=e=>(t,n)=>{const i={text:t.text,target:t.target,__html:t.reportSource?.__html};return t.reportSource?.__html&&t.text?c("div",{role:"listitem",children:[o(Ag,{...i,icon:e,href:Og(t)?t?.href:t?.attachment?.src}),o(De,{__html:t?.__html})]},String(n)):null},Og=e=>"href"in e,Lg=zt((({className:e,padding:t,align:n="text-left",buttons:i=[],description:a,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(Te,{className:"h-full",padding:t,defaultPadding:"p-6xl",title:o(w,{headingType:s,title:h,className:u("whitespace-pre-wrap",n)}),rightImage:y,buttons:je(i,{className:"flex-wrap"}),children:[a?o(_e,{size:"text-xl","font-weight":"font-light",children:a}):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(De,{__html:r,itemSize:"list-m"}):null,o(_e,{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]})]})})})),jg=(e=[],t={})=>e.filter((({content:e={}})=>sd(t,e))).length,qg=(e,t)=>e===t;const $g=(e=>(t,n)=>t===n||Boolean(t&&n&&Object.keys(t).length===Object.keys(n).length&&Object.entries(t).every((([t,i])=>e(i,n[t])))))(function(...e){return(t,n)=>e.some((e=>e(t,n)))}(qg,((e=qg)=>(t,n)=>t===n||Boolean(t&&n&&t.length===n.length&&t.every(((t,i)=>e(t,n[i])))))())),Ug=[],Wg={},Hg={primary:"bg-white/30",secondary:"bg-main-divider"},Yg={primary:{desktop:"text-white",mobile:"text-primary-text"},secondary:{desktop:"text-secondary-text",mobile:"text-secondary-text"}},Kg=d((({count:e,version:t="secondary"})=>{const n=Se(),i=n?"bg-main-divider":Hg[t],a=Yg[t][n?"mobile":"desktop"];return o("div",{className:u("w-6 h-6 rounded-full flex items-center justify-center",i),role:"status","aria-label":`Количество ${e} доступных программ и сервисов`,children:o(_e,{size:"text-xs",color:a,children:e})})})),Gg=({text:e,description:t,icon:n,isActive:i,type:a})=>{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"}))(i);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"===a?l.text:l.oldText,children:e}),o("div",{className:"animated"===a?l.desc:l.oldDesc,children:t})]})]})},Xg={default:"px-xs",underlined:"px-m",animated:"px-m border border-gray cursor-pointer text-left border-b-0 mt-auto flex gap-2xs"},Jg={default:"text-black sm:text-white",underlined:"text-primary-main border-b-2",animated:"text-white sm:text-white"},Zg={default:"bg-white",underlined:"bg-white",animated:"p-1 ease-in duration-300 bg-white text-primary-text h-[70px] w-96"},Qg={default:"bg-white sm:bg-primary-main",underlined:"bg-white",animated:"p-2 border-none bg-primary-main text-white h-20 w-96"},ef=d((({tag:e="div",item:t={},isActive:n=!1,type:i="default",onClick:a})=>{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",Xg[i],n?Qg[i]:Zg[i]),role:"tablist","aria-label":"Список табов",onClick:a,...p,children:c("div",{className:u("h-full","flex justify-center items-center","text-center whitespace-nowrap",n?Jg[i]:"text-secondary-text hover:text-primary-main"),role:"tab","aria-label":`Таб ${r}`,children:[Gg({text:r,description:s,icon:d,isActive:n,type:i}),Number.isInteger(m)?o("div",{className:"ml-xs",role:"status","aria-label":`Количество программ и сервисов ${m}`,children:o(Kg,{count:m,version:La(n,i)})}):null]})})})),tf=d((e=>o(e?.item?.href?nf:af,{...e}))),nf=d((e=>{const t=he(),n=l((()=>{e.onClick&&e.onClick(e.item||{})}),[e.onClick,e.item]),{onClick:i,...a}=t({...e.item,onClick:n});return o(ef,{...e,tag:"a",item:a,onClick:i})})),af=d((({item:e={},onClick:t,...n})=>{const i=l((()=>{t&&t(e)}),[t,e]);return o(ef,{item:e,onClick:i,...n})})),lf=(e,t,n)=>(i,a)=>o(tf,{isActive:i===e,onClick:t,type:n,item:i},String(a)),rf=d((({className:e,tabsType:t="default",items:n=[],activeItem:i,onChange:a})=>o("div",{className:u("flex gap-x-2xs overflow-x-auto no-scrollbar",e),role:"tabpanel","aria-label":"Панель управления табами",children:n.map(lf(i,a,t))}))),sf={categories:[],extraOptions:[],propertyType:[],stage:[]},of=zt((({className:e,hotFilters:t,filtrationSchema:n={},resetButton:i,...a})=>{const[s,{blocksToRender:d},{field:m,reset:h,update:p}]=cd(sf,{block:a.block,page:a.options?.page}),f=l(((e=sf)=>p(e)),[]),x=(({hotFilters:e=Ug,filtrationState:t=Wg,blocks:n=Ug,onFiltrationStateChange:i})=>{const a=r((()=>Math.max(0,e.findIndex((e=>$g(e.filter,t))))),[e,t]),s=r((()=>e.map((t=>({text:t.text,count:jg(n,t.filter),version:La(t===e[a])})))),[e,n,a]),o=l((t=>{i(e[s.indexOf(t)].filter)}),[e,s]);return{activeItem:s[a],items:s,onChange:o}})({hotFilters:t,filtrationState:s,blocks:a.block?.blocks,onFiltrationStateChange:f});return c(g,{className:u("space-y-2xs",e),defaultPadding:"p-0",version:"transparent",...a,children:[o(rf,{...x}),o(nd,{filtrationSchema:n,resetButton:i,field:m,reset:h}),o(Zc,{blocksToRender:d,...a})]})}),{childrenTypes:["ProductBlock"],childSchema:e=>e?.filtrationSchema||{}}),cf=({location:e,address:t,billAcceptorType:n,terminalType:i,billAcceptorEnable:a,atmCode:l="",atmAccess:r="",workTime:s},d)=>{const m=[{label:"Устройство",value:uf(i)},{label:"Модуль приема наличных",value:a?"Да":"Нет"},{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(_e,{size:"text-h4",children:uf(e)}),t?c("div",{className:"flex pb-xl pt-xs gap-2xs",children:[o(W,{name:"GeolocationIcon",width:"24",height:"24"}),o(_e,{size:"text-l",children:t})]}):null]}),o("div",{className:"whitespace-nowrap",children:o(xa,{color:"green",children:uf(s)})})]}),o("div",{className:"hidden sm:block",children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:o(ra,{className:"flex-wrap",children:m?.map(mf)})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(d))},df=({address:e="",terminalType:t,atmCode:n=""})=>({header:`${uf(t)} №${n}`,body:e.toUpperCase()}),mf=(e,t)=>o(na,{...e},String(t)),uf=e=>e?`${e?.charAt(0)?.toUpperCase()}${e?.slice(1)}`:"",hf=[];const pf=async e=>{const t=await Pt(e,{method:"GET"});return Array.isArray(t)?t:hf},gf={terminalTypeAtms:!0,terminalTypeTerm:!1,workAllTime:!1,billAcceptorEnable:!1,locationDisabledPeople:!1,designDisabledPeople:!1},ff={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)},xf=d((({descriptionData:e,className:t})=>{const n=Sp(),i=n?.code??"000",{data:a,isLoad:l}=function(e){const{data:t,error:n}=hi(`/api/v1/atms?regionCode=${e}`,pf);return{data:t||hf,isLoad:!t&&!n}}(i);return o(Xa,{className:t,filterItems:yf,data:a,isLoad:l,initFilterState:gf,renderCard:cf,getBalloon:df,title:`Банкоматы филиала ${n?.name}`,descriptionData:e})})),yf=(e,t)=>{const n=Object.keys(t).filter((e=>t[e])),i=n.filter((e=>e.startsWith("terminalType"))),a=n.filter((e=>!i.includes(e)));return e.filter((e=>{const t=a.every((t=>ff[t](e))),n=!i.length||i.some((t=>ff[t](e)));return t&&n}))},bf=({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(_e,{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(_e,{size:"text-l",children:e})]}):null]})}),o("div",{className:"hidden sm:block",children:vf({workScheduleDescription:t})}),o(ea,{className:"block sm:hidden",renderFoldableSection:({isUnfolded:e})=>o(ta,{isUnfolded:e,children:vf({workScheduleDescription:t})}),renderFoldButton:({isUnfolded:e,onToggle:t})=>Sa({isUnfolded:e,onToggle:t})})]},String(n)):null,vf=({workScheduleDescription:e})=>c("div",{children:[c(ra,{className:"flex",children:[o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание кредитов, счетов, вкладов"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Оформление и обслуживание банковских карт"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Инвестиционное и накопительное страхование"})}),o(na,{label:"Операции для физических лиц",children:o(_e,{children:"Безналичные операции в рублях, переводы без открытия счёта"})})]}),o("hr",{className:"text-main-divider pb-xl"}),o(na,{label:"Режим работы",className:"max-w-none",children:o(_e,{children:e})})]}),Nf=({address:e="",workScheduleDescription:t})=>({header:"Удаленное рабочее место",body:`${e} ${t}`}),wf={branches:[],remoteWorkplaces:[]};const Cf=async e=>await Pt(e,{method:"GET"})||wf,Sf=d((({className:e})=>{const t=Sp(),n=t?.code??"000",{data:i,isLoad:a}=function(e="000"){const{data:t,error:n}=hi(`/api/v1/branchesAndRemoteWorkplaces?regionCode=${encodeURIComponent(e)}`,Cf);return{data:t||wf,isLoad:!t&&!n}}(n);return o(Xa,{className:e,data:i?.branches,isLoad:a,remoteWorkplaces:i?.remoteWorkplaces,renderCard:Ba,renderRemoteWorkplaceCard:bf,getBalloon:Ra,getBalloonRemoteWorkplaces:Nf,title:`Офисы филиала ${t?.name}`})})),kf=d((({data:e,className:t,...n})=>{const i=e?.dataType??"offices";return o(g,{version:"transparent",className:u(t),defaultPadding:"p-0",...n,children:"offices"===i?o(Sf,{}):o(xf,{descriptionData:e})})})),If=d((({className:e,title:t,description:n="Блок в разработке...",...i})=>c(g,{className:u("box-border",e),...i,children:[o(k,{className:"max-w-[600px]",title:t,description:n,headlineVersion:"L",align:"text-left",isEmbedded:!0}),o(f,{})]}))),Tf=d((({className:e,padding:t,slides:n=[],...i})=>o(g,{className:u("overflow-hidden relative",e),padding:t,...i,children:o($c,{gap:0,padding:0,children:n.map((e=>e.productBlock)).map(((e,t)=>o("div",{className:"box-border h-full",children:o(Je,{className:"px-5 h-full",headlineVersion:"L",...e,...i})},String(t))))})}))),Bf=d((({address:e,email:t,telephone:n,button:i,className:a="",__html:l,richVersion:r,icon:s,title:d,version:m="primary",...h})=>c(g,{className:u("box-border text-left space-y-s",a),version:m,...h,children:[c("div",{className:"w-full flex justify-between flex-row-reverse",children:[Le(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?Pf({__html:l,richVersion:r}):null,Rf({label:"Адрес",data:e,iconName:"GeolocationIcon"}),Rf({label:"Телефон(факс)",data:n,iconName:"PhoneIcon"}),Rf({label:"E-mail",data:t,iconName:"MailIcon",dataColor:"text-primary-main"}),i?.text?je([i]):null]})]}))),Pf=e=>o("div",{className:"border-b border-main-divider pb-lg",children:o(De,{...e,itemSize:"list-s"})}),Rf=({label:e,data:t,iconName:n,dataColor:i=""})=>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(_e,{size:"text-m",font:"font-light",color:"text-secondary-text",children:e}),o(_e,{size:"text-xl",color:i,children:t})]})]}):null,Df=d((e=>{const{__html:t,richVersion:n="",...i}=e;return o(g,{defaultPadding:"p-0",...i,children:o(De,{__html:t,richVersion:n})})})),Mf=d((({name:e,text:t,value:n,checked:i,onChange:a,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(gn.split(" ").filter((e=>"rounded"!==e)),Ci,"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:i,onChange:e=>a?.(e.target.value),role:"radio"}),t?o(_e,{color:"text-primary-text",children:t}):null]})}))),_f=d((({className:e=""})=>{const[t,n]=i("option2"),a=l((e=>n(e)),[]);return c("div",{className:u("order-4",e),role:"radiogroup",children:[o(Mf,{className:"mb-xs",name:"contractType",text:"Простое хранение",value:"option1",checked:"option1"===t,onChange:a}),o(Mf,{name:"contractType",text:"Сделка с недвижимостью",value:"option2",checked:"option2"===t,onChange:a})]})})),Af=d((({data:e,fieldLabel:t,fieldValue:n,selected:i,placeholder:a="",setSelected:l,label:r})=>{const s=e.filter(Boolean).map((e=>({key:e?.[n||t],text:e?.[t]}))),c=s.find((e=>e.key===i));return o(Mn,{options:s,label:r,placeholder:a||i,onChange:e=>l(e.key),value:c})})),Ef=d((({regions:e=[],selectedRegion:t,onSelectedRegion:n,branches:i=[],selectedBranch:a,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(Af,{data:e,fieldValue:"code",fieldLabel:"name",selected:t,setSelected:n,label:"Регион"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldValue:"branchCode",fieldLabel:"address",selected:a,setSelected:l,label:"Отделение",placeholder:"Выберите отделение"})})]}))),zf=["От 1 дня","До 365 дней"],Ff=d((({days:e,setDays:t})=>c("div",{className:"order-1",children:[o(_e,{size:"text-m",font:"font-light",children:"Срок аренды"}),o(dl,{min:1,max:365,value:e,items:zf,onChange:t})]}))),Vf=d((({caseVolumes:e=[],selectedCaseVolume:t,onSelectedCaseVolume:n,safeBoxCases:i=[],selectedBoxSize:a,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(Af,{data:e,fieldLabel:"volume",selected:t,setSelected:n,label:"Размер",placeholder:"Выберите размер"})}),o("div",{className:"flex-1 min-w-0",children:o(Af,{data:i,fieldLabel:"safeBoxCasesSize",selected:a,setSelected:l,label:"Параметры ячейки, мм (ВхШхД)",placeholder:"Выберите параметр ячейки"})})]}))),Of=d((({regions:e,selectedRegion:t,branches:n,selectedBranch:i,days:a,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(Ef,{regions:e,selectedRegion:t,onSelectedRegion:e=>m({selectedRegion:e}),branches:n,selectedBranch:i,onSelectedBranch:Lf(m)}),o(Ff,{days:a,setDays:e=>m({days:e})}),o(Vf,{caseVolumes:d,selectedCaseVolume:l,onSelectedCaseVolume:jf(m),safeBoxCases:s,selectedBoxSize:r,onSelectedBoxSize:e=>m({selectedBoxSize:e})}),o("div",{className:"order-4",children:o(_e,{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(_f,{}),o(ve,{text:"Офисы на карте",version:"primary",onClick:u,className:"order-6"})]})]}))),Lf=e=>t=>{e({selectedBranch:t,selectedCaseVolume:"",selectedBoxSize:""})},jf=e=>t=>{e({selectedCaseVolume:t,selectedBoxSize:""})},qf=d((({days:e,tariffs:t=[]})=>{const n=Uf(e,t),i="На рисунке изображена пачка листов\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:[$f("Аренда за",e),$f("Цена",n+" ₽")]}),o("div",{className:"@xl:hidden order-3 mb-xs",children:o(C,{size:"text-s",font:"font-light",color:"text-secondary-text",children:i})}),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:i})})]})]})})),$f=(e,t)=>c("div",{className:"flex justify-between items-center gap-y-xs @xl:flex-col @xl:items-start",children:[o(_e,{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})]}),Uf=(e,t)=>{const n=Wf(e);return e*(t?.find((e=>e.tariffType===String(n)))?.tariffValue||0)},Wf=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},Hf=(e,t)=>e.find((e=>e.branchCode===t)),Yf=d((e=>{const{regions:t,data:n,branches:i,onChange:l,onClick:r}=e;a((()=>{l({selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:""})}),[n.selectedRegion,l]);const s=Hf(i,n.selectedBranch),d=Kf(s?.safeBoxCaseVolumes),m=Gf(s?.safeBoxCaseVolumes,n.selectedCaseVolume)?.safeBoxCases,u=Xf(m,n.selectedBoxSize);return c("div",{className:"flex flex-col @4xl:flex-row gap-4xl align-top",children:[o(Of,{...n,regions:t,onClick:r,branches:i,caseVolumes:d,safeBoxCases:m,onChange:l}),o(qf,{days:n.days,tariffs:u})]})})),Kf=e=>e?.length?e?.filter((e=>e?.safeBoxCases?.length)):[],Gf=(e,t)=>e?.find((e=>e.volume===t)),Xf=(e,t)=>e?.find((e=>e.safeBoxCasesSize===t))?.tariffs,Jf=[];const Zf=async e=>await Pt(e,{method:"GET"})||Jf,Qf=d((({title:e,footnote:t,className:n="",...a})=>{const[r,s]=i(!1),d=l((()=>s((e=>!e))),[]),[m,u]=i({selectedRegion:"",selectedBranch:"",selectedCaseVolume:"",selectedBoxSize:"",days:26}),h=Rs(),p=ex(m.selectedRegion,h),f=function(e){const{data:t}=hi(e?`/api/v1/safeboxes?regionCode=${e}`:null,Zf);return t||Jf}(p),x=l((e=>u((t=>({...t,...e})))),[u]),y=(b=Hf(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:"",...a,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(Yf,{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(Hi,{points:y,className:"h-[640px]"}):null]})})),ex=(e,t)=>!e&&t?.length&&t[0]?.code?t[0].code:e,tx={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"},nx=(e,t,n)=>(i,a)=>{const{button:l}=i;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:ix(e,n)(i,a)}),c("div",{className:u("flex flex-col justify-center h-fit w-full",{"min-h-6xl":e}),children:[ax(i),l?.text?o(ve,{className:"box-border py-s w-full max-w-60 mt-lg",version:t,...l,children:l?.text}):null]})]})},String(a))},ix=(e,t)=>(n,i)=>{const a="secondary"===t?"white":"color",l=Boolean(n?.icon?.src),r=lx(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:rx({step:n,iconVersion:a,i:i,stepVersion:t})})})},ax=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",tx.description),children:e.description}):null,o(De,{__html:e.__html})]}),lx=(e,t)=>e&&t?"h-14 w-14":"h-11 w-11",rx=({step:e,iconVersion:t,i:n,stepVersion:i})=>{return Le(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"===i?tx.iconText:(a=i,"secondary"===a?"group-data-primary:text-white":"text-secondary-text")),children:n+1});var a},sx=d((({className:e="",title:t,description:n,steps:i=[],buttons:a,stepVersion:l="gray",version:r="primary",...s})=>{const d=i.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"}),i?.length?o("div",{className:"flex flex-col gap-6xl justify-between box-border",children:i.map(nx(d,r,l))}):null,je(a,{isVertical:!0})]})})),ox=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||""]}))),cx=d((({className:e,head:t,children:n,onClose:i,onClick:a})=>{const{close:r}=me(),s=l((()=>{r(),i&&i()}),[i]);return c("div",{onClick:a,className:u("relative min-h-full 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(rr,{className:"absolute top-1.5 right-0",onClose:s}),o("div",{className:"container",children:t})]}),o("div",{className:"container pb-6xl",children:n})]})})),dx=({menuRef:e,dialogRef:t,closeDialog:n,openDialog:i,leftItems:a,rightItems:l})=>[{openBottomMenuItemDialog:(r,s)=>{const c="left"===s?a:l,d=e?.current?.getBoundingClientRect();i(o(cx,{onClick:e=>e.stopPropagation(),onClose:n,className:"mt-[20%] border-t border-current",head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:c[r].description||c[r].title})}),children:o("div",{className:"bg-white pb-20 pt-1 text-l",ref:t,children:o("iframe",{id:"iframe-dialog",onLoad:()=>(()=>{const e=document.getElementsByTagName("iframe")["iframe-dialog"];e.style.height=String(e?.contentWindow?.document.body.offsetHeight)+"px"})(),src:c[r]?.src,width:d?.width||0})})}),{id:"left"===s?a[r].title:l[r].title})}}];function mx(e){throw new Error(e)}const ux=({onCloseAll:e,onClose:t}={})=>{const[n,{push:r,pop:s,clear:o}]=function(e=[]){const[t,n]=i(e),a=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:a,pop:r,remove:s,clear:o}]}(),c=l((()=>{e&&e(n),o()}),[n,e]),d=l((()=>{t&&t(n[n.length-1]),s()}),[n,t]);return a((()=>de.subscribe("dialog",(e=>{if(e)switch(e.type){case"open":r(e);break;case"close":e.all?c():d();break;default:mx(e)}}))),[c,d]),n},hx=e=>t=>{if(e===t)return 1;if(!e||!t)return 0;const{m:n,s1Matches:i,s2Matches:a}=function(e,t){const n=Math.max(0,Math.floor(Math.max(e.length,t.length)/2)-1),i=Array.from({length:e.length}),a=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++)i[r]||a[n]||e[r]!==t[n]||(l++,i[r]=!0,a[n]=!0)}return{m:l,s1Matches:i,s2Matches:a}}(e,t);if(0===n)return 0;const l=function(e,t,{s1Matches:n,s2Matches:i}){let a=0;for(let l=0,r=0;l<e.length;l++){if(!n[l])continue;let s=r;for(;s<t.length;s++)if(i[s]){r=s+1;break}e[l]!==t[s]&&a++}return a}(e,t,{s1Matches:i,s2Matches:a}),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 px=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(_e,{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(gx,{...e},String(t))))})]}):null,gx=d((({icon:e,...t})=>{const n=he(),{text:i,target:a,href:l,onClick:r}=n(t);return c("div",{className:"flex gap-s items-center",children:[e?o(ne,{image:e}):null,i?o("a",{className:"hover:text-primary-hover",href:l,target:a,onClick:r,children:o(_e,{size:"text-l",font:"font-light",color:"text-primary-text",children:i})}):null]})})),fx=(e,t)=>n=>n.name?o(pu,{href:`/branches/${n.slug}`,className:"mb-xs sm:mb-2xs hover:text-primary-hover",onClick:()=>t?.(n),data:hu(e,n.name),children:o(_e,{size:"text-l",font:"font-light",children:n.name})},String(n.id)):null,xx=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(gn,"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"})]}))),yx=d((({defaultLocation:e})=>{const t=Sp(e),n=he(),{href:i}=n({href:`/branches/${t.slug}`});return t?o("div",{className:"mb-s",children:c(C,{size:"text-l",color:"text-primary-text",children:["Сейчас выбран:",o(pu,{href:i,className:"inline mx-2xs text-primary-main",children:t.name})]})}):null})),bx=d((({foreignOffices:e,branches:t})=>{const n=kp(t?.default),[a,s]=i(""),d=Rs(),m=r((()=>Nx(d).sort(((e,t)=>e.name.localeCompare(t.name)))),[d]),u=r((()=>((e,t)=>{const n=new Map;for(const i of e){const e=t(i),a=n.get(e)||[];n.set(e,[...a,i])}return n})(m,vx)),[m]),{close:h}=me(),p=l((e=>{n.location=e,h()}),[n]);return c(sr,{className:"pb-20",head:c("div",{children:[o(_e,{size:"text-h4",color:"text-primary-text",children:"Выберите филиал"}),o(yx,{defaultLocation:t?.default}),o(xx,{onSearch:s,searchTerm:a})]}),children:[a&&a.length>=3?o("div",{children:m.filter((({name:e})=>e&&hx(e.toLowerCase())(a.toLowerCase())>=.8)).map(fx(t?.dataSelect,p))}):o("div",{className:"columns-1 sm:columns-3 md:columns-4 lg:columns-5",children:Array.from(u.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(_e,{size:"text-h6",children:e})}),t.map(fx(f,g))]},e)))}),px(e)]});var g,f})),vx=e=>e.name?.charAt(0)??"",Nx=e=>e.map((e=>({...e,name:e.name?.replace(/республика|область|край'/gi,"").trim()??""}))),wx=d((({menuRef:e,menuItem:t,locationDialogProps:n,closeAll:i})=>{const l=(e=>{const{open:t,close:n}=me();return{open:(n={})=>t(o(bx,{...e}),n),close:n}})(n||{}),{name:r}=Sp(),s=e?.current?.getBoundingClientRect(),c=X(G.SITE_URL);return a((()=>{globalThis.frames["burger-menu-iframe"].postMessage({type:"currentLocation",data:r},"*")}),[r]),a((()=>{const e=e=>{if("location"===e.data.type&&l.open(),"reload"===e.data.type&&i(),"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)}}),[]),o(cx,{onClick:e=>e.stopPropagation(),head:o("div",{className:"flex items-center justify-center px-xl",children:o(w,{as:"h4",title:t?.title,className:"font-medium"})}),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})})})})),Cx="burgerMenuDialog",Sx=({menuRef:e,centralMenuItem:t,closeAll:n,openDialog:i,locationDialogProps:a})=>{const l=ux(),r=((e,t)=>Boolean(t.find((t=>t.id===e),e)))(Cx,l);return[r,{toggle:()=>{r?n():i(o(wx,{locationDialogProps:a,menuRef:e,menuItem:t,closeAll:n}),{id:Cx})}}]},kx=[],Ix=zt((({sticky:e,...t})=>{const{menuItems:n=kx}=e??{},a=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]=i(-1),[f,x]=i(""),{open:y,closeAll:b}=me(),v=l((()=>{p(-1),x(""),b()}),[b]),N=un(v),w=s(null),[C,{toggle:S}]=Sx({menuRef:w,centralMenuItem:a,closeAll:b,openDialog:y,locationDialogProps:t.header}),[{openBottomMenuItemDialog:k}]=dx({menuRef:w,dialogRef:N,closeDialog:v,openDialog:y,leftItems:m,rightItems:u}),I=l((e=>{v(),e.stopPropagation(),S()}),[v,S]),T=l(((e,t)=>{x(t),p(e),b(),k(e,t)}),[b,k]);return o(g,{className:"h-[74px] z-[100] relative",defaultPadding:"p-0",...t,children:c("div",{ref:w,className:"ml-auto container bg-white flex justify-center shadow-blue-gray",children:[m.map(Tx(T,"left",{activeIndex:h,currentItemPosition:f})),o(ox,{item:a,isActive:C,onClick:e=>I(e)}),u.map(Tx(T,"right",{activeIndex:h,currentItemPosition:f}))]})})})),Tx=(e,t,n)=>(i,a,l)=>o(ox,{item:i,isActive:l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t,onClick:r=>{l[n.activeIndex]?.title===i?.title&&n.currentItemPosition===t||r.stopPropagation(),e(a,t)}},i.title||String(a)),Bx="hidden sm:flex absolute z-40",Px={default:{item:"flex-1",gap:0,buttonTop:"top-0"},animated:{item:"flex",gap:8,buttonTop:"top-5"},underlined:{item:"",gap:0,buttonTop:"top-0"}},Rx=d((({className:e,items:t=[],activeItem:n,onChange:i,tabsType:l="default"})=>{const[r,s]=Mc({itemCount:t?.length||0});return a((()=>Dx(r.current,t,n)),[]),c("div",{className:u("relative overflow-x-auto no-scrollbar",e),children:[o(bc,{containerRef:r,snapAlign:"snap-start",onVisibleIndicesChange:s.handleVisibleIndicesChange,itemClassName:Px[l].item,gap:Px[l].gap,children:t.map(lf(n,i,l))}),s.canScrollLeft?o(Fc,{className:u("left-6",Bx,Px[l].buttonTop),onClick:s.scrollLeft}):null,s.canScrollRight?o(Vc,{className:u("right-6",Bx,Px[l].buttonTop),onClick:s.scrollRight}):null]})})),Dx=(e,t,n)=>{const i=t.findIndex((e=>e===n));e&&i>0&&e.scrollTo({left:e?.children[i]?.offsetLeft,behavior:"smooth"})},Mx={default:{wrapper:"",component:""},animated:{wrapper:"border-b-8 border-primary-main bg-white",component:"m-auto"},underlined:{wrapper:"flex",component:"m-auto"}},_x=({className:e="",tabsType:t="animated",...n})=>t?o("div",{className:u(Mx[t].wrapper,e),children:o(Rx,{className:Mx[t].component,tabsType:t,...n})}):null,Ax=zt((({className:e="",tabs:t=[],block:n,tabsType:r,showCounter:s=!1,isSticky:d=!1,...m})=>{const h=Ex(n??{}),p=M(),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]=i(Vx(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)));a((()=>{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=Fx(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:[_x({className:u({"pb-1":n?.slots&&"default"===r,"sticky top-1 z-20":d&&!f}),items:zx(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])=>R(t,{...m?.options,slotName:C,parent:n,extraProps:{className:e===C?"":"hidden"}})))})]})}),{slots:({tabs:e})=>e?.map(Fx)?.filter(Boolean)||[]}),Ex=({__id:e,anchor:t})=>t??e??"tabs",zx=(e,t)=>t?.length?t:e,Fx=(e,t)=>"group"===e?.type?e?.tabName||`Слот №${t+1}`:"",Vx=(e,t)=>t?Number(t):e.reduce(((e,t,n)=>t.selected?n:e),0),Ox={comparison:"flex gap-m duration-1000",tariff:"flex gap-5xl flex-grow duration-1000"},Lx=d((({children:e,activeIndex:t,columnWidth:n,version:i="comparison"})=>o("div",{className:"flex flex-1 overflow-hidden",children:o("div",{className:Ox[i],style:{transform:`translateX(-${t*n}px)`},children:e})}))),jx=d((({className:e="",isOpen:t,onClick:n})=>o(ve,{className:e,appendRight:o(ne,{image:{icon:t?"ArrowUpIcon":"ArrowDownIcon"},width:"24",height:"24"}),text:t?"Скрыть":"Показать",version:"gray",onClick:n}))),qx={Buttons:({buttons:e})=>je(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(De,{__html:e,isDotted:t,itemSize:"list-m"})}),LabelDescription:({label:e,description:t})=>c("div",{className:"space-y-2xs",children:[e?o("div",{children:o(_e,{size:"text-h6",children:e})}):null,t?o("div",{className:"lg:text-l font-light text-xs",children:o(_e,{color:"text-secondary-text",children:t})}):null]}),Table:({isVisible:e,displayTable:t,tableSource:n,pdfUrl:i,isOpen:a})=>e?o(jx,{className:"w-fit",isOpen:a,onClick:()=>{t({tableSource:n,pdfUrl:i})}}):null},$x=d((({cell:e,fieldIdx:t,rowIdx:n,cellIdx:l,setTableInner:r,tableInner:s,openTableInnerIdx:o,setOpenTableInnerIdx:c})=>{const[d,m]=i(!0);a((()=>{l===o&&s||m(!0)}),[s,o]);return Ux({cell:e,cellProps:{rowIdx:n,cellIdx:l,fieldIdx:t,displayTable:e=>{m(!1),c(l),r(e)},isVisible:d}})})),Ux=({cell:e,cellProps:t})=>{if(!e)return null;const{tableCellType:n,...i}=e;if(!n||!(n in qx))return null;return o(qx[n],{...t,...i})},Wx=d((({cells:e,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,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($x,{cell:e,fieldIdx:s,rowIdx:t,cellIdx:n,setTableInner:i,tableInner:a,openTableInnerIdx:l,setOpenTableInnerIdx:r},String(s)))):null}))),Hx=(e,t)=>140*((e=[])=>e.reduce(((e,t)=>e+t),0))(e.slice(0,t).map((e=>e?.cols?.length??1))),Yx=(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(_e,{size:"text-h6",font:"font-light",children:e})},String(t))))}):null,Kx=d((({rows:e})=>{return o(bc,{visibleItemCount:0,snapAlign:"snap-start",children:o("div",{children:e?.map((t=0,(e,n)=>{if(!e?.length)return null;const[i,...a]=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:[i?.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(_e,{size:"text-xl",font:"font-light",children:i.data})}):null,o("div",{className:"flex flex-grow overflow-hidden",children:o("div",{className:l,style:{transform:`translateX(-${Hx(a,t)}px)`},children:a?.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(_e,{size:"text-xl",children:e.data}):null,e?.cols?Yx(e.cols,t):null]},`row${n}`)))})})]},String(n))}))})});var t})),Gx=d((({activeTabIndex:e,items:t})=>o("div",{children:t.map(((t,n)=>{const i=`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(_e,{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(Kx,{rows:t.rowsData})})})]},i)}))}))),Xx=(e=!1)=>""+(e?"text-white":"text-secondary-text"),Jx=d((({currencies:e,linkToPDF:t,activeTabIndex:n,setActiveTabIndex:i})=>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:()=>i(t),children:o(_e,{size:"text-xl",font:"font-light",color:Xx(t===n),children:e||t+1})},e)))}):null,t?o(ve,{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]}))),Zx=zt((({tableSource:e,pdfUrl:t,onClick:n})=>{const a=e?.tableData,[r,s]=i(0),d=l((e=>s(e)),[]),m=a?.[r]?.items??[],u=a?.map((e=>e.currency??""));return c("div",a?{className:"bg-white z-10",children:[o(Jx,{currencies:u,activeTabIndex:r,setActiveTabIndex:d,linkToPDF:t}),o(Gx,{activeTabIndex:r,items:m}),o(jx,{className:"mt-xl",onClick:n,isOpen:!0})]}:{className:"my-lg space-y-m text-center",children:[o(_e,{size:"text-h6",children:"Данных нет"}),o(jx,{onClick:n,isOpen:!0})]})})),Qx=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(Zx,{...t,onClick:n})}):null]}))),ey=d((({row:{header:e,data:t},activeIndex:n,rowIdx:a,...r})=>{const[s,d]=i(void 0),m=l((e=>d(e)),[]),[h,p]=i(void 0),g=l((e=>p(e)),[]);return c(Qx,{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(_e,{size:"text-m",font:"font-light",color:"text-primary-text",children:e?.title}):null]})}),t?.length?o(Lx,{activeIndex:n,columnWidth:360,version:"tariff",children:t.map(((e,t)=>o(Wx,{cells:e,rowIdx:a,cellIdx:t,setTableInner:m,tableInner:s,openTableInnerIdx:h,setOpenTableInnerIdx:g,...r},String(t))))}):null]})}));function ty({dec:e,inc:t,canDec:n,canInc:i,btnClass:a,className:l=""}){return n||i?c("div",{children:[n?o(zc,{className:u("absolute z-40",a[0],l),onClick:e,ariaLabel:"Пролистать влево","data-block-control":"scroll-left",disabled:!n}):null,i?o(zc,{className:u("absolute z-40 rotate-180",a[1],l),onClick:t,ariaLabel:"Пролистать вправо","data-block-control":"scroll-right",disabled:!i}):null]}):null}const ny=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,ty({...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]})})),iy=d((({className:e="",title:t,description:n,rowHeaders:a,tariffsColumns:r,hiddenRowsNum:s=0,...d})=>{const m=r?.map((({data:e})=>e))||[],h=a?.map(((e,t)=>({header:e,data:m.map((e=>e?.[t]||[]))}))),p=m.length,[f,x]=((e,t=0)=>{const{itemCount:n,visibleItemCount:a}=e,[r,s]=i(t),o=l((()=>s((e=>Math.min(e+1,n-1)))),[n]),c=l((()=>s((e=>Math.max(e-1,0)))),[n]),d=a?n>a&&r<n-a: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(ey,{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(ea,{renderFoldableSection:({isUnfolded:e})=>c(ny,{controls:x,children:[b,o(ta,{isUnfolded:e,children:v})]}),renderFoldButton:Kc}):o(ny,{controls:x,children:y})})]})})),ay=d((({className:e="",title:t,description:n,iconVersion:i,__html:a,richVersion:l,...r})=>c(g,{className:u("flex gap-s sm:gap-m bg-white group-data-secondary:bg-primary-main/10",e),...r,children:["small"===i?ly():null,c("div",{className:"flex flex-col w-fit gap-2xs sm:gap-xs",children:[t?o(_e,{size:"text-l",font:"font-normal",color:"text-primary-text group-data-secondary:text-white",children:t}):null,n?ry(n):null,a?o(De,{richVersion:l,__html:a}):null]})]}))),ly=()=>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"}),ry=e=>o(C,{size:"text-s",font:"font-light",color:"text-secondary-text group-data-secondary:text-white",children:e}),sy=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(_e,{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(_e,{size:"text-h2",children:n})}):null]}))),oy=d((e=>{const{prefix:t,unit:n,suffix:i,...a}=e;return o(g,{defaultPadding:"p-0",...a,children:o(sy,{prefix:t,unit:n,suffix:i})})})),cy={AdTile:Vt,ApplicationForm:ho,ApplicationLeadForm:uc,BankAccountFiltration:ud,BenefitsBlock:xd,BonusBenefitsBlock:vd,ButtonsBlock:wd,CalculatorBonus:Fd,CalculatorBusinessDeposit:em,CalculatorCredit:gm,CalculatorDeposit:_m,CalculatorRefinancing:jm,CardTransfer:Km,Carousel:nu,CarouselCard:ru,CarouselCatalogCard:ou,CarouselLinks:mu,CarouselRecommendationCard:bu,CarouselTariffsCard:wu,CreditCardForm:dh,CreditForm:Wh,DepositFiltration:Xh,Depository:hp,ErrorBlock:gp,ExchangeRateTile:Yp,Footer:pg,GrantSupport:gg,Header:Ng,Headline:k,HorizontalLayout:kg,ImgBlock:Ig,LinkDocs:zg,MobileAppTile:Lg,MortgageFiltration:of,OfficesAtmsMap:kf,Placeholder:If,ProductBlock:Ft,ProductGallery:Tf,RepresentativeOfficeInfo:Bf,RichTextBlock:Df,RollupItem:tg,SafeDepositRental:Qf,StepsBlock:sx,StickyBottomMenu:Ix,TabsLayout:Ax,TariffsTable:iy,TextBlock:ay,UnitBlock:oy,VerticalLayout:Sg},dy=ue((()=>{a((()=>{Gt()}),[]);const e=an();mn(globalThis,"click",(e=>t=>{const n=t.target?.closest("[data-aspects]");try{const i=JSON.parse(n?.dataset?.aspects??"[]");Yt({aspectsAttributes:i,aspects:e,ev:t})}catch(e){}e.forwardQuery?.(t)})(e))}));const my="cookie",uy=d((({__html:e})=>{const[t,{setTrue:n,setFalse:i}]=dn();!function(e,t,n=300){a((()=>{const t=globalThis.setTimeout(e,n);return()=>{globalThis.clearTimeout(t)}}),t)}((()=>{globalThis.localStorage?.getItem(my)||n()}),[],3e3);const r=l((()=>{globalThis.localStorage?.setItem(my,"true"),i()}),[]);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(De,{__html:e})}),o("div",{className:"ml-s sm:ml-0 w-36 flex justify-end",children:o(rr,{className:"bg-main-gray rounded-md w-11 h-11",onClose:r})})]})}):null})),hy=d((()=>{const e=l((e=>{for(const t of e)t?.onClose&&t.onClose()}),[]),t=l((e=>{e?.onClose&&e.onClose()}),[]),n=ux({onCloseAll:e,onClose:t}),{close:i}=me(),r=l((({key:e})=>{"Escape"===e&&i()}),[]);return mn(globalThis.document,"keydown",r),a((()=>{n.length?(globalThis.document?.body.classList.add("no-scrollbar"),globalThis.document?.body.classList.add("overflow-hidden")):(globalThis.document?.body.classList.remove("no-scrollbar"),globalThis.document?.body.classList.remove("overflow-hidden"))}),[n]),n.length?o("div",{className:"fixed inset-0 z-50",role:"dialog",children:n.map((({dialog:e,id:t},i)=>o("div",{className:u("absolute inset-0 overflow-x-hidden overflow-y-scroll no-scrollbar bg-black/50",{hidden:i!==n.length-1}),children:e},String(t||i))))}):null})),py=d((()=>{const[e,t]=i(null),n=l((()=>{t(null)}),[]);a((()=>de.subscribe("popup",(e=>{if(e)switch(e.type){case"open":case"update":t(e);break;case"close":n();break;default:mx(e)}}))),[]);const r=l((({key:e})=>{"Escape"===e&&n()}),[n]);return mn(globalThis.document,"keydown",r),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})),gy="header",fy="footer",xy="sticky-footer",yy={},by=d((({className:e,data:t=yy,blocksRegistry:n,blockDecorator:i})=>{const{slots:a,blocks:l,fallback:r,...s}=t,d=Et(s,r);dy(),kp();const m={key:"",page:{slots:a,blocks:l,fallback:r,...d},blocksRegistry:n,blockDecorator:i,parent:t};return c("div",{"data-theme":t.colorPalette||"pc",children:[c("section",{className:u("@container relative",t.style,e),children:[a?.header?.length?o("div",{className:"relative z-10 mb-lg shadow-[0_8px_32px_0px_#00000014]",children:R(a?.header,{...m,slotName:gy})}):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"}}),R(a?.footer,{...m,slotName:fy})]})]}),a?.["sticky-footer"]?.length?o("div",{className:"fixed w-full bottom-0 left-0 z-[100]",children:R(a?.["sticky-footer"],{...m,slotName:xy})}):null,o(hy,{}),o(py,{}),o(uy,{__html:d?.cookieContent?.__html})]})}));Object.assign(by,{childrenTypes:[],slots:()=>[gy,fy,xy]});e.Blocks=cy,e.ContentPage=by,e.handlerDecorator=ue,e.joinList=ed,e.packageVersion="0.14.675",e.projectSettings=A,e.setup=(e,t)=>{globalThis._uni={_jsx:e,_jsxs:t||e}},e.setupHooks=e=>{t=e},e.url=L,e.useRouter=M,Object.defineProperty(e,"__esModule",{value:!0})}));