PageSourceSearch

https://hawaiistatefcu.com/wp-content/plugins/pbry-calculators/ass…01k-comparison-script-min.js?ver=1790147579

js hawaiistatefcu.com collected 2026-09-24 11:22:28 UTC 7,292 bytes, 1 lines download raw bytes

1window.fourZeroOneKChartData=window.fourZeroOneKChartData||{traditional_color:"#008FFB",roth_color:"#00E396",fontFamily:"sans-serif",fontWeight:"normal"};class FourZeroOneKComparisonCalculator{constructor(){this.chart=null,this.initialized=!1,this.isElementorEditor=!1,this.chartRetryCount=0,this.resizeObserver=null,this.config={chartLoadDelay:10,retryLimit:3},this.waitForElementReady=this.waitForElementReady.bind(this),this.waitForInputsReady=this.waitForInputsReady.bind(this),this.init=this.init.bind(this),this.calculate=this.calculate.bind(this),this.initCharts=this.initCharts.bind(this)}async init(){return!!document.getElementById("pbry-four-zero-one-k-comparison-calc")&&(this.initialized||(this.initialized=!0,this.setInitialValues(),this.setupEventListeners(),this.isElementorEditor&&(await this.waitForElementReady("#four-zero-one-k-comparison-chart"),await this.waitForInputsReady(),this.setupResizeObserver()),this.calculate()),!0)}waitForElementReady(t,e=1e3){return new Promise((i=>{const r=document.querySelector(t);if(r&&r.offsetWidth>0&&r.offsetHeight>0)return void i(!0);const o=new MutationObserver((()=>{const e=document.querySelector(t);e&&e.offsetWidth>0&&e.offsetHeight>0&&(o.disconnect(),i(!0))}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{o.disconnect(),i(!1)}),e)}))}waitForInputsReady(){return new Promise((t=>{const e=()=>{["current-age","retirement-age","annual-contribution","return-rate","current-tax-rate","retirement-tax-rate"].every((t=>document.getElementById(t)))?t(!0):setTimeout(e,100)};e()}))}setupResizeObserver(){const t=document.getElementById("four-zero-one-k-comparison-chart");t&&(this.resizeObserver=new ResizeObserver((()=>{if(this.chart&&t.offsetWidth>0)try{this.chart.updateOptions({chart:{width:t.offsetWidth}})}catch(t){}})),this.resizeObserver.observe(t))}setInitialValues(){document.getElementById("current-age").value="35",document.getElementById("retirement-age").value="65",document.getElementById("annual-contribution").value="10000",document.getElementById("return-rate").value="5",document.getElementById("current-tax-rate").value="25",document.getElementById("retirement-tax-rate").value="15"}setupEventListeners(){const t=(t,e)=>{let i;return(...r)=>{clearTimeout(i),i=setTimeout((()=>t.apply(this,r)),e)}};["current-age","retirement-age","annual-contribution","return-rate","current-tax-rate","retirement-tax-rate"].forEach((e=>{document.getElementById(e).addEventListener("input",t((()=>this.calculate()),300))}))}calculate(){const t=document.getElementById("current-age"),e=document.getElementById("retirement-age"),i=document.getElementById("annual-contribution"),r=document.getElementById("return-rate"),o=document.getElementById("current-tax-rate"),n=document.getElementById("retirement-tax-rate");if(!(t&&e&&i&&r&&o&&n))return;const a=parseInt(t.value)||0,s=parseInt(e.value)||0,l=parseFloat(i.value.replace(/,/g,""))||0,c=parseFloat(r.value)||0,h=parseFloat(o.value)||0,d=parseFloat(n.value)||0;if(s<=a)return;const u=s-a,m=c/100,f=(100-h)/100,y=(100-d)/100;let g=0;g=m>0?l*((Math.pow(1+m,u)-1)/m):l*u,g*=y;const p=l*f;let x=0;x=m>0?p*((Math.pow(1+m,u)-1)/m):p*u,this.displayResults(g,x),this.createChart(g,x)}displayResults(t,e){document.getElementById("traditional-value").textContent=t.toLocaleString("en-US",{style:"decimal",maximumFractionDigits:2,minimumFractionDigits:2}),document.getElementById("roth-value").textContent=e.toLocaleString("en-US",{style:"decimal",maximumFractionDigits:2,minimumFractionDigits:2})}createChart(t,e){try{const i=document.getElementById("four-zero-one-k-comparison-chart");if((!i||0===i.offsetWidth||0===i.offsetHeight)&&this.isElementorEditor)return void setTimeout((()=>this.createChart(t,e)),100);const r=[{x:"Traditional 401(k)",y:t,color:this.getChartColor("traditional")},{x:"Roth 401(k)",y:e,color:this.getChartColor("roth")}],o={series:[{name:"Retirement Value",data:r}],chart:{type:"bar",height:350,width:i?i.offsetWidth:"100%",toolbar:{show:!1},animations:{enabled:!0,easing:"easeinout",speed:800}},plotOptions:{bar:{horizontal:!1,borderRadius:4,columnWidth:"50%",distributed:!0}
1},xaxis:{categories:r.map((t=>t.x)),labels:{style:{fontSize:"14px",fontWeight:this.setFontWeight(),fontFamily:this.setFont(),cssClass:"apexcharts-xaxis-label"}},axisBorder:{show:!1},axisTicks:{show:!1}},yaxis:{title:{text:"After-Tax Value ($)",style:{fontSize:"12px",fontWeight:this.setFontWeight(),fontFamily:this.setFont()}},labels:{formatter:function(t){return"$"+t.toLocaleString("en-US",{maximumFractionDigits:0})},style:{fontSize:"12px",fontWeight:this.setFontWeight(),fontFamily:this.setFont()}},min:0,forceNiceScale:!0},colors:r.map((t=>t.color)),legend:{show:!1},grid:{show:!0,borderColor:"#f1f1f1",strokeDashArray:0,position:"back",xaxis:{lines:{show:!1}},yaxis:{lines:{show:!0}}},dataLabels:{enabled:!0,formatter:function(t){return"$"+t.toLocaleString("en-US",{maximumFractionDigits:0})},style:{fontSize:"12px",fontFamily:this.setFont(),fontWeight:this.setFontWeight(),colors:["#333333"]},offsetY:-20,dropShadow:{enabled:!1}},tooltip:{custom:function({series:t,seriesIndex:e,dataPointIndex:i,w:r}){const o=r.globals.initialSeries[0].data[i];return'<div class="apexcharts-tooltip-box" style="padding: 8px; background: #fff; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 2px 6px rgba(0,0,0,0.1)"><div style="font-weight: 600; margin-bottom: 4px; color: '+o.color+'">'+o.x+'</div><div style="margin-bottom: 2px"><span style="font-weight: 500">After-Tax Value: </span>$'+o.y.toLocaleString("en-US",{maximumFractionDigits:2})+"</div></div>"}}};if(this.chart){if(!this.isElementorEditor)return void this.chart.updateOptions(o);this.chart.destroy(),this.chart=null}this.chart=new ApexCharts(i,o),this.chart.render()}catch(i){this.chart&&(this.chart.destroy(),this.chart=null),setTimeout((()=>this.createChart(t,e)),500)}}getChartColor(t){const e={traditional:"#008FFB",roth:"#00E396"};return void 0!==window.fourZeroOneKChartData?"traditional"===t?window.fourZeroOneKChartData.traditional_color||e.traditional:window.fourZeroOneKChartData.roth_color||e.roth:e[t]}setFont(){return"undefined"!=typeof fourZeroOneKChartData&&fourZeroOneKChartData.fontFamily||"sans-serif"}setFontWeight(){return"undefined"!=typeof fourZeroOneKChartData&&fourZeroOneKChartData.fontWeight||"normal"}async initCharts(){if(!(this.chartRetryCount>=this.config.retryLimit)){if("undefined"==typeof ApexCharts)return this.chartRetryCount++,void setTimeout((()=>this.initCharts()),this.config.chartLoadDelay);try{this.calculate()}catch(t){this.chartRetryCount++,setTimeout((()=>this.initCharts()),this.config.chartLoadDelay)}}}}document.addEventListener("DOMContentLoaded",(function(){const t=new FourZeroOneKComparisonCalculator;if("undefined"!=typeof elementorFrontend&&elementorFrontend.isEditMode()){t.isElementorEditor=!0,window.fourZeroOneKChartData=window.fourZeroOneKChartData||{traditional_color:"#008FFB",roth_color:"#00E396"};const e=()=>{t.init().then((()=>{setTimeout((()=>t.initCharts()),300)}))};if(document.getElementById("pbry-four-zero-one-k-comparison-calc"))e();else{new MutationObserver((function(t,i){document.getElementById("pbry-four-zero-one-k-comparison-calc")&&(e(),i.disconnect())})).observe(document.body,{childList:!0,subtree:!0})}}else t.init()}));

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.