1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7619],{838:(t,n,e)=>{e.d(n,{MB:()=>u,No:()=>o,Vh:()=>i,aW:()=>r,wk:()=>l,zb:()=>a});let l="calc-field-estate-value",a="calc-field-contribution-amount",r="calc-field-loan-period",i="calc-field-check-promo",u="calc-card-calculations-of-calc-mortgage",o="calc-card-calculations-of-calc-mortgage-amount"},34658:(t,n,e)=>{e.d(n,{T:()=>l});let l=(t,n,e)=>{var l,a,r;let i={event:n,idGTM:t,...e};return window&&(null==(l=window)?void 0:l.dataLayer)&&(null==(r=window)||null==(a=r.dataLayer)||a.push(i)),i}},62952:(t,n,e)=>{e.d(n,{A:()=>a});var l=e(75834);let a=t=>{let n=(0,l.useRef)(null);return(0,l.useEffect)(()=>{let e=n.current;e&&t&&e.querySelectorAll('button, input, select, textarea, [tabindex]:not([tabindex="-1"])').forEach(t=>{t.setAttribute("tabindex","-1")})},[t]),n}},77619:(t,n,e)=>{e.r(n),e.d(n,{default:()=>P});var l=e(26514),a=e(7650),r=e.n(a),i=e(75834),u=e(75163),o=e(34658),s=e(13436),c=e(48216);class d{static create(t,n,e){return Object.assign(new d,{...(0,c.A)(t,"calc_type"),...(0,c.A)(n,"min","max","minInstallments","maxInstallments","minOwnContribution","maxOwnContribution","ratesAmount","creditAmount"),...(0,c.A)(e,"currentValue","currentInstallmentsValue","currentOwnContributionValue","currentPromotion","currentInterestType")})}static update(t,n){return Object.assign(new d,t,n)}constructor(){this.min=2e4,this.max=33e6,this.currentValue=5e5,this.minOwnContribution=2e3,this.maxOwnContribution=33e5,this.currentOwnContributionValue=1e5,this.minInstallments=1,this.maxInstallments=35,this.currentInstallmentsValue=24,this.creditAmount=null,this.ratesAmount=null,this.currentPromotion=!1,this.currentInterestType="constant"}}var m=e(23469),p=e.n(m),b=e(54907),w=e(6395),v=e(93794),h=e(43371),x=e(54004),y=e(34453),C=e(18827),f=e(66828),O=e(62952),g=e(27133),_=e(61265),A=e(42920),V=e(838),I=e(88295);let k=p()(()=>e.e(1897).then(e.bind(e,1897)),{loadableGenerated:{webpack:()=>[1897]}}),j=p()(()=>e.e(624).then(e.bind(e,60624)),{loadableGenerated:{webpack:()=>[60624]}}),T=p()(()=>e.e(993).then(e.bind(e,30993)),{loadableGenerated:{webpack:()=>[30993]}}),S=p()(()=>e.e(2145).then(e.bind(e,42145)),{loadableGenerated:{webpack:()=>[42145]}}),E=p()(()=>e.e(4775).then(e.bind(e,44775)),{loadableGenerated:{webpack:()=>[44775]}}),D=p()(()=>e.e(509).then(e.bind(e,20509)),{loadableGenerated:{webpack:()=>[20509]}}),L="CalcMortgageLarge",N={constant:"staÅe",variable:"zmienne"},R=Object.keys(N).map(t=>({value:t,label:N[t]})),M=v.Df.withName("PKOBPCalcMortgageLarge").create(()=>({container:{position:"relative",display:"flex",justifyContent:"center",marginTop:"5px",["& .".concat(_.TooltipClass)]:{"&>div":{fontSize:"14px",lineHeight:"20px",fontWeight:300}}},containerInner:{maxWidth:"1020px",width:"100%"},subtitle:{marginBottom:"10px",[x.Ay.breakpoints.up("lg")]:{marginBottom:"12px"}},title:{...x.Ay.typography.h2,marginTop:"0",marginBottom:"18px",[x.Ay.breakpoints.up("lg")]:{marginBottom:"40px"}},containerForm:{position:"relative",display:"flex",justifyContent:"space-between",flexWrap:"wrap"},leftBox:{width:"100%",margin:0,padding:0,border:"none","&>legend":h.$,[x.Ay.breakpoints.up("sm")]:{width:"50%"},[x.Ay.breakpoints.up("md")]:{width:"62%"}},rightBox:{width:"100%",marginTop:"25px",[x.Ay.breakpoints.up("sm")]:{width:"40%",marginTop:"0"},[x.Ay.breakpoints.up("md")]:{width:"30.6%"}}})),G=t=>{var n,e,a,r,u;let{snippetData:o,calculatorData:c,currentData:d,isLoading:m,isMockedData:p,onUpdateCurrentData:v,onUpdateCurrentDataDebounced:h,showOwnContributionExtraMsg:_=!1}=t,{classes:N}=M(),G=(0,i.useContext)(s.G),{property_input:B,property_tooltip:P,installments_input:W,installments_tooltip:z,own_contribution_input:U,own_contribution_tooltip:$,own_contribution_message:H,promotion_input:F,promotion_tooltip:K,promotion_checkbox:Q,interest_input:q,interest_tooltip:Z}=o,[J,X]=(0,i.useState)("");(0,i.useEffect)(()=>{m&&X("")},[m]);let Y=(t,n)=>(J!==t&&X(t),h({[t]:n},null)),tt=(t,n)=>v({[t]:n}),tn=(0,w.A)(x.Ay.breakpoints.down("sm")),te=(0,O.A)(p);return(0,l.jsx)(b.A,{className:N.container,"data-cy":L,id:G,children:(0,l.jsxs)(b.A,{className:N.containerInner,ref:te,children:[(0,l.jsx)(j,{isMockedData:p}),(0,l.jsxs)(b.A,{children:[!!(null==o||null==(n=o.subtitle)?void 0:n.length)&&(0,l.jsx)(A.A,{variant:"subtitle1",align:"center",cy:"calc-subtitle",className:N.subtitle,children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:o.subtitle}}
1)}),!!(null==o||null==(a=o.title)||null==(e=a.text)?void 0:e.length)&&(0,l.jsx)(A.A,{variant:(0,y.a)(null==(r=o.title)?void 0:r.hx),align:"center",cy:"calc-title",className:N.title,children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:null==(u=o.title)?void 0:u.text}})})]}),(0,l.jsxs)(b.A,{className:N.containerForm,children:[(0,l.jsx)(g.Ay,{isLoading:m,text:"Trwa Åadowanie",withOverlay:!0,size:g.iW.LG}),(0,l.jsxs)(b.A,{className:N.leftBox,component:"fieldset",children:[(0,l.jsx)("legend",{children:"Wprowadź dane dotyczÄ
ce pożyczki"}),(0,l.jsx)(T,{name:"currentValue",value:d.currentValue,min:c.min,max:c.max,label:(null==B?void 0:B.label)||"",tooltipContent:(0,I.s)(null==P?void 0:P.content,null==o?void 0:o.product_for_wysiwyg_rendered),step:1e3,updateInput:Y,unit:f.Unit.Currency,disabled:J&&"currentValue"!==J||m,$_ID:"".concat(L,"--")+V.wk,$_ARIA_CONTROLS:V.MB}),(0,l.jsx)(b.A,{children:(0,l.jsx)(T,{name:"currentOwnContributionValue",value:d.currentOwnContributionValue,min:c.minOwnContribution,max:c.maxOwnContribution,label:(null==U?void 0:U.label)||"",tooltipContent:(0,I.s)(null==$?void 0:$.content,null==o?void 0:o.product_for_wysiwyg_rendered),step:1e3,extraMessage:_?(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:H.default_value}}):null,updateInput:Y,unit:f.Unit.Currency,disabled:J&&"currentOwnContributionValue"!==J||m,$_ID:"".concat(L,"--")+V.zb,$_ARIA_CONTROLS:V.MB})}),(0,l.jsx)(T,{name:"currentInstallmentsValue",value:d.currentInstallmentsValue,min:c.minInstallments,max:c.maxInstallments,label:(null==W?void 0:W.label)||"",tooltipContent:(0,I.s)(null==z?void 0:z.content,null==o?void 0:o.product_for_wysiwyg_rendered),step:1,updateInput:Y,unit:(0,C.DV)(d.currentInstallmentsValue),disabled:J&&"currentInstallmentsValue"!==J||m,$_ID:"".concat(L,"--")+V.aW,$_ARIA_CONTROLS:V.MB}),(0,l.jsx)(k,{updateCheckbox:tt,fieldName:"currentPromotion",label:null==Q?void 0:Q.label,value:d.currentPromotion,tooltipContent:(0,I.s)(null==K?void 0:K.content,null==o?void 0:o.product_for_wysiwyg_rendered),sectionLabel:null==F?void 0:F.label,showAsSwitch:tn,disabled:!!J||m,$_ID:"".concat(L,"--")+V.Vh}),(0,l.jsx)(E,{label:q.label||"Oprocentowanie",fieldName:"currentInterestType",options:R,value:d.currentInterestType,tooltipContent:(0,I.s)(Z.content,null==o?void 0:o.product_for_wysiwyg_rendered),updateRadio:tt,showAsTabs:tn,disabled:!!J||m})]}),(0,l.jsx)(b.A,{className:N.rightBox,children:(0,l.jsx)(S,{calculatorData:c,snippetData:o,currentData:d,addCardTriangle:!0})})]}),(0,l.jsx)(D,{snippetData:o,currentData:d})]})})},B={constant:"Stala",variable:"Zmienna"},P=t=>{let{...n}=t,{property_input:e,installments_input:a,own_contribution_input:c,api_path:m,interest_input:p,promotion_checkbox:b}=n,[w,v]=(0,i.useState)({currentValue:(null==e?void 0:e.default_value)||5e5,currentOwnContributionValue:(null==c?void 0:c.default_value)||1e5,currentInstallmentsValue:(null==a?void 0:a.default_value)||24,currentPromotion:(null==b?void 0:b.default_value)||!1,currentInterestType:(null==p?void 0:p.default_value)||"constant"}),[h,x]=(0,i.useState)(d.create(n,{},w)),[y,C]=(0,i.useState)(!1),[f,O]=(0,i.useState)(!1),[g,_]=(0,i.useState)(!1),A=(0,i.useContext)(s.G);(0,i.useEffect)(()=>{v({...w,currentPromotion:null==b?void 0:b.default_value,currentInterestType:null==p?void 0:p.default_value})},[null==b?void 0:b.default_value,null==p?void 0:p.default_value]),(0,i.useEffect)(()=>{(async()=>await I())()},[]),(0,i.useEffect)(()=>{let t=S({currentValue:h.currentValue,currentInstallmentsValue:h.currentInstallmentsValue,currentOwnContributionValue:h.currentOwnContributionValue});v({...w,...t})},[h]);let V=()=>{var t,n;return null==(n=r()())||null==(t=n.publicRuntimeConfig)?void 0:t.OLD_CMS_URL},I=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w;C(!0);try{if(!m||!V())throw Error("Nie można utworzyÄ adresu url do zaciÄ
gania danych dla kalkulatora");let n=await fetch("".concat(V(),"/").concat(m),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({wkladWlasny:"".concat(null==t?void 0:t.currentOwnContributionValue),okresSplaty:"".concat(null==t?void 0:t.currentInstallmentsValue),wartoscNieruchomosci:"".concat(null==t?void 0:t.currentValue),pakietProduktow:"".concat(null==t?void 0:t.currentPromotion),rodzajStopyOprocentowania:"".concat(B[null==t?void 0:t.currentInterestType]),rodzajProduktu:"Kredyt"})});(0,o.T)(A,"CALC_MORTGAGE_REQUEST_SEND",t);let e=await n.json(),l=d.update(h,{...t,...{currentOwnContributionValue:null==e?void 0:e.wkladWlasny,minInstallments:null==e?void 0:e.minOkresSplaty,maxInstallments:null==e?void 0:e.maxOkresSplaty,minOwnContribution:null==e?void 0:e.minimalnyWkladWlasny,maxOwnContribution:null==e?void 0:e.maksymalnyWkladWlasny,ratesAmount:null==e?void 0:e.rata,creditAmount:null==e?void 0:e.kwotaKredytu,ltv:null==e?void 0:e.ltv}});(0,o.T)(A,"CALC_MORTGAGE_REQUEST_RECEIVED",e),x(l),O(!1)}catch(n){console.error(n),(0,o.T)(A,"CALC_MORTGAGE_REQUEST_FAIL",n),x(d.update(h,{...t,ratesAmount:1,creditAmount:1})),O(!0)}finally{C(!1)}},k=async function(t){var n,e,l,a;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;((null==t?void 0:t.currentOwnContributionValue)&&(null==t?void 0:t.currentOwnContributionValue)!=h.minOwnContribution||h.currentOwnContributionValue>=h.minOwnContribution)&&_(!1);let i=S({...t,...{currentValue:null!=(n=null==t?void 0:t.currentValue)?n:null==h?void 0:h.currentValue,currentInstallmentsValue:null!=(e=null==t?void 0:t.currentInstallmentsValue)?e:null==h?void 0:h.currentInstallmentsValue,currentOwnContributionValue:null!=(l=null==t?void 0:t.currentOwnContributionValue)?l:h.currentOwnContributionValue}});x(d.update(h,i)),v({...w,...i}),await I(i),"function"==typeof r&&r(null==i?void 0:i[null==(a=Object.keys(t))?void 0:a[0]])},j=(t,n,e)=>t<n?n:t>e?e:t,T=(0,u.s)(1500,function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;k(t,n)}),S=t=>{let{currentValue:n,currentInstallmentsValue:e,currentOwnContributionValue:l}=t,a=Object.assign({},w,t);
1if(void 0!==n&&(a=Object.assign({},a,{currentValue:j(n,h.min,h.max)})),void 0!==e&&(a=Object.assign({},a,{currentInstallmentsValue:j(e,h.minInstallments,h.maxInstallments)})),void 0!==l){let t=j(l,h.minOwnContribution,h.maxOwnContribution);(w.currentOwnContributionValue<h.minOwnContribution||l<h.minOwnContribution)&&_(!0),a=Object.assign({},a,{currentOwnContributionValue:t})}return a};return(0,l.jsx)(G,{snippetData:n,calculatorData:h,currentData:w,isLoading:y,isMockedData:f,onUpdateCurrentData:k,onUpdateCurrentDataDebounced:T,showOwnContributionExtraMsg:g})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.