PageSourceSearch

https://www.erste.pl/_cms-js/time20261001095458/calculator.js

js erste.pl collected 2026-10-02 10:14:39 UTC 6,350 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkcomponentsManager=self.webpackChunkcomponentsManager||[]).push([[5959],{3774(e,t,n){n.r(t),n.d(t,{init:()=>d});var a=n(3672),r=n(8727),i=n(7640),s=n(131),o=n(9929),l=n(4591),u=n(9208),c=n(6927);const m="aria-hidden",h=".calculator__summaryModalHeader",d=e=>{const t=e.componentElement,n=e.componentParameters;(0,i.K)(n.calculatorDataUrl).then(e=>{((e,t,n)=>{const o=n.enableTooltips,l=n.hasRegularPromotion,d=t.querySelector((0,s.lj)().INSURANCE_CHECKBOX),g=t.querySelector((0,s.lj)().AGE_VALUE),V=t.querySelector((0,s.lj)().AMOUNT_VALUE),R=t.querySelector((0,s.lj)().INSTALLMENTS_VALUE),C=t.querySelector((0,s.$p)().BUTTON_FIRST),E=[(0,s.lj)().AGE_VALUE,(0,s.lj)().AMOUNT_VALUE,(0,s.lj)().INSTALLMENTS_VALUE];C.removeAttribute(m),(0,i.iL)(t,E),(0,i.pH)(!0,e,t),(0,i.W2)("[data-replace]",e,t);const T=new r.i(t,n.calculatorAnnualPercentageRateCalculationUrl,!0,e.riskTable,e.rangeValues.withInsuranceRangeValues,e.rangeValues.withoutInsuranceRangeValues,e.rangeValues.regularPromotionWithInsuranceRangeValues,e.rangeValues.regularPromotionWithoutInsuranceRangeValues,e.discountFactors);if((0,i.PW)(t,n,e,!0,T),(0,i.Ve)(t,V.value,R.value,d.checked),(0,i.s5)(t,d,h),t.dispatchEvent(new Event("calculatorUtagSet")),setTimeout(()=>{t.querySelector(`${(0,s.o6)().AGE} .noUi-handle`).setAttribute("tabindex","-1"),(0,a.e)(t,n,T,l)},10),d){const e=new URL(document.location.toString()).searchParams,r=t.querySelector((0,s.$p)().INSURANCE_CONTAINER),o=r.getAttribute(m);d.addEventListener("change",()=>{const e=t.querySelector(`${(0,s.o6)().AGE} .noUi-handle`);r.setAttribute(m,o),(0,u.mf)({slideElement:r,ariaExpandedElement:d}),setTimeout(()=>{const t=(0,c.o9)(r,c.xj.EXPANDED)?"visible":"hidden",n=(0,c.o9)(r,c.xj.EXPANDED)?"0":"-1";r.style.overflow=t,[e,g].forEach(e=>{e.setAttribute("tabindex",n)})},100),(0,a.e)(t,n,T,l),(0,i.Ve)(t,V.value,R.value,d.checked),(0,i.s5)(t,d,h)}),+e.get(n.insuranceParam)&&(d.checked=!0,d.dispatchEvent(new Event("change")),(0,i.s5)(t,d,h))}V.addEventListener("change",a.e.bind(null,t,n,T,l)),R.addEventListener("change",a.e.bind(null,t,n,T)),t.addEventListener("calculatorValueChange",()=>{(0,i.Ve)(t,V.value,R.value,d.checked)}),d&&d.checked&&(g.addEventListener("change",a.e.bind(null,t,n,T,l)),(0,u.C9)({slideElement:t.querySelector((0,s.$p)().INSURANCE_CONTAINER)})),(0,i.FF)(t,o)})(e,t,n)}),(0,i.pD)(t),(0,o.CC)(t,`${(0,s.$p)().CTA_BUTTONS} ${(0,s.$p)().BUTTON_FIRST}`,`${(0,s.$p)().CTA_BUTTONS} ${(0,s.$p)().BUTTON_SECOND}`),(0,l.b1)(()=>{(0,o.CC)(t,`${(0,s.$p)().CTA_BUTTONS} ${(0,s.$p)().BUTTON_FIRST}`,`${(0,s.$p)().CTA_BUTTONS} ${(0,s.$p)().BUTTON_SECOND}`)})}},8727(e,t,n){n.d(t,{i:()=>l});var a=n(7640),r=n(131),i=n(569),s=n(435);const o=(e,t,n,o,l,u,c,m,h)=>{let d;if(d=h?e.querySelector((0,r.Ks)().RRSO_PROMO_VALUE):e.querySelector((0,r.Ks)().RRSO_VALUE),d){const g={creditValue:t,commissionValue:n,interestRate:l,insuranceValue:c?o:0,totalInstallmentsCount:u,hasRegularPromotion:h,interestRateWithRegularPromotion:l,commissionValueWithRegularPromotion:n,insuranceValueWithRegularPromotion:c?o:0},V=new FormData;for(const e in g)V.append(e,g[e]);fetch(m,{method:"POST",body:V}).then(e=>e.json()).then(t=>{const n="calculator_medium"===e.dataset.componentTypeCode,o=(0,i.nB)(e.querySelector((0,r.Ks)().SUMMARY),"hasPromo");d.innerHTML=(0,s.bP)(t.rrso,n&&!o,n),(0,a.VJ)(e,t.rrso)})}};class l{constructor(e,t,n,a,r,i,s,o,l){this.componentElement=e,this.calculatorAnnualPercentageRateCalculationUrl=t,this.insuranceEnabled=n,this.creditRiskTable=a,this.creditRangeValuesWithInsurance=r,this.creditRangeValuesWithoutInsurance=i,this.creditRangeValuesRegularPromotionWithInsurance=s,this.creditRangeValuesRegularPromotionWithoutInsurance=o,this.discountFactorsMap=l}calculateCommission(e,t){return e*t/100}exponential(e,t,n){const a=Math.pow(1+t,n);return e*(t*a)/(a-1)}getRiskValue(e,t){const n=this.creditRiskTable.find(t=>t.thresholdValue===e);return n?this.creditRiskTable.filter(e=>e.periodFrom>=n.thresholdMin&&e.periodTo<=n.thresholdMax&&e.age===t).map(e=>e.riskValue).reduce((e,t)=>e+t,0):0}getInterestAndCommission(e,t,n){const a=n.find(n=>n.creditValueMin<=t&&n.creditValueMax>=t&&n.creditInstallmentsMax>=e&&n.creditInstallmentsMin<=e);return a?JSON.parse(JSON.stringify(a)):{interest:0,commission:0}}calculateConfigWithoutInsurance(e,t,n){const a=this.getInterestAndCommission(e,t,n?this.creditRangeValuesRegularPromotionWithoutInsurance:this.creditRangeValuesWithoutInsurance);return a.realCreditValue=100*t/(100-a.commission),a}getRealCreditAmount(e,t){return 100*e/(100-t)}getInsuranceMonthlyValue(e,t,n){return t*e*(1-n)+1e-10}getDiscountFactor(e,t,n){const a=e*(1+t)/(1-n-n*t)*n+e;let r=0;const i=Math.min(2e5,a)/1e6;return i>
1.025&&Object.keys(this.discountFactorsMap).forEach(e=>{const t=parseInt(e);r+=this.discountFactorsMap[+e]*Math.pow(i,t)}),r}getInsurancePremiumValue(e,t,n,a,r){const i=e+t*a;return this.getInsuranceMonthlyValue(n,i,r)}calculateConfigForInsurance(e,t,n,a){const r=this.getInterestAndCommission(e,n,a?this.creditRangeValuesRegularPromotionWithInsurance:this.creditRangeValuesWithInsurance),i=this.getRiskValue(e,t),s=r.commission/100,o=this.getDiscountFactor(n,i,s);r.realCreditValue=this.getRealCreditAmount(n,r.commission);const l=this.getInsurancePremiumValue(n,r.realCreditValue,i,s,o);return r.insurancePremium=+l.toFixed(2),r}calculateInsurancePremium(e,t,n,a){return this.calculateConfigForInsurance(n,e,t,a).insurancePremium}calculateSimulationValues(e,t,n){const a=this.calculateCommission(e.realCreditValue,e.commission),r=this.exponential(e.realCreditValue,e.interest/1200,t);return e.installmentMonthly=+r.toFixed(2),e.interests=+e.interest.toFixed(2),e.commissionRate=e.commission,e.installmentCount=t,e.commission=+a.toFixed(2),e.realCreditValue=+e.realCreditValue.toFixed(2),e.amount=n,e}runSimulation(e,t,n,a,r,i){const s=this.calculateSimulationValues(r?this.calculateConfigForInsurance(a,t,n,i):this.calculateConfigWithoutInsurance(a,n,i),a,n);return o(e,n,s.commission,r?s.insurancePremium:0,s.interest/100,a,this.insuranceEnabled,this.calculatorAnnualPercentageRateCalculationUrl,i),s}runSimulationWithoutInsurance(e,t,n,a){const r=this.calculateSimulationValues(this.calculateConfigWithoutInsurance(n,t,a),n,t);return o(e,t,r.commission,0,r.interest/100,n,!1,this.calculatorAnnualPercentageRateCalculationUrl,a),r}}}}]);

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.