1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([[3553],{2134(t,e,a){a.r(e),a.d(e,{updateHSAChart:()=>f});var r=a(66840);function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var a={}.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var a=0,r=Array(e);a<e;a++)r[a]=t[a];return r}var c={totCovered:"#066605",totHSAPaid:"#e87722",totOop:"#D71515"},i={totCovered:"rgba(6, 102, 5, 0.18)",totHSAPaid:"rgba(232, 119, 34, 0.18)",totOop:"rgba(215, 21, 21, 0.18)"},s=new WeakMap,l=new WeakSet;function u(t,e){var a,r;return null!==(a=null===(r=t.querySelector(e))||void 0===r?void 0:r.innerHTML)&&void 0!==a?a:""}function d(t,e,a){var r=t.querySelector(e);r&&(r.innerHTML=a)}function h(t,e,a){t.querySelectorAll(e).forEach(function(t){return t.classList.toggle("hidden",a)})}function p(t,e,a,o,u,d,h){var p=t.querySelector("#hsa-chart-item");if(p){p.innerHTML="";var f=p.clientWidth||600,v=16,m=72,y=f-m-16,g=360-v-56,S=r.format("$,"),b=r.scaleLinear().domain(r.extent(e)).range([0,y]),A=r.max(o,function(t){return r.max(a[t])})||0,C=r.scaleLinear().domain([0,A]).nice().range([g,0]),x=r.select(p).append("svg").attr("role","img").attr("aria-label","An area chart displaying estimated cost").attr("viewBox","0 0 ".concat(f," ").concat(360)).attr("width","100%").attr("height",360),k=x.append("g").attr("transform","translate(".concat(m,",").concat(v,")")),L=o.map(function(t){return{key:t,values:e.map(function(e,r){var n;return{age:e,cost:null!==(n=a[t][r])&&void 0!==n?n:0,key:t}})}}),M=n(L).sort(function(t,e){return(r.max(e.values,function(t){return t.cost})||0)-(r.max(t.values,function(t){return t.cost})||0)}),q=r.area().x(function(t){return b(t.age)}).y0(C(0)).y1(function(t){return C(t.cost)}),E=r.line().x(function(t){return b(t.age)}).y(function(t){return C(t.cost)});k.selectAll("path.hsa-chart-area").data(M).enter().append("path").attr("class","hsa-chart-area").attr("fill",function(t){return i[t.key]}).attr("d",function(t){return q(t.values)}),k.selectAll("path.hsa-chart-line").data(L).enter().append("path").attr("class","hsa-chart-line").attr("fill","none").attr("stroke",function(t){return c[t.key]}).attr("stroke-width",1.5).attr("d",function(t){return E(t.values)}),k.selectAll("circle.hsa-chart-point").data(L.flatMap(function(t){return t.values})).enter().append("circle").attr("class","hsa-chart-point").attr("fill",function(t){return c[t.key]}).attr("cx",function(t){return b(t.age)}).attr("cy",function(t){return C(t.cost)}).attr("r",3),k.append("g").attr("transform","translate(0,".concat(g,")")).call(r.axisBottom(b).ticks(Math.min(e.length,8)).tickFormat(r.format("d"))),k.append("g").call(r.axisLeft(C).tickFormat(function(t){return S(t)})),k.append("text").attr("text-anchor","middle").attr("x",y/2).attr("y",g+40).text(h),k.append("text").attr("text-anchor","middle").attr("transform","rotate(-90)").attr("x",-g/2).attr("y",-56).text(d),s.set(t,x),function(t,e,a,r){var n,o=t.querySelector(".hsa-chart-container");if(o){null===(n=o.querySelector("div.legend"))||void 0===n||n.remove();var i=document.createElement("div");i.className="legend";var s=document.createElement("ul");s.className="list-group unstyled horizontal-list",i.appendChild(s),a.forEach(function(t){var a=document.createElement("li");a.className="list-group-item";var n=document.createElement("div");n.className="legend-label",n.setAttribute("data-id",t);var o=document.createElement("span");o.className="badge",o.style.backgroundColor=c[t],o.innerHTML=" ",n.append("".concat(e[t],"Â ")),n.appendChild(o),n.append("Â Â Â "),n.addEventListener("mouseover",function(){return function(t,e){t.selectAll("path.hsa-chart-area, path.hsa-chart-line, circle.hsa-chart-point").style("opacity",function(t){return t.key===e?1:.2})}(r,t)}),n.addEventListener("mouseout",function(){return function(t){t.selectAll("path.hsa-chart-area, path.hsa-chart-line, circle.hsa-chart-point").style("opacity",1)}(r)}),a.appendChild(n),s.appendChild(a)}),o.appendChild(i)}}(t,u,o,x),function(t){if(!l.has(t)){l.add(t);var e=t.querySelector(".hsa-chart-toogle-chart"),a=t.querySelector(".hsa-chart-toogle-table"),r=t.querySelector(".hsa-graph-item"),n=t.querySelector(".hsa-chart-table"),o=function(){return t.querySelector(".hsa-chart-container div.legend")};null==e||e.addEventListener("click",function(){t.querySelectorAll(".hsa-chart-toogle-btn").forEach(function(t){t.classList.remove("active"),t.setAttribute("aria-pressed","fal
1se")}),r&&(r.style.display=""),n&&(n.style.visibility="hidden",n.style.height="0"),e.classList.add("active"),e.setAttribute("aria-pressed","true");var a=o();a&&(a.style.display="")}),null==a||a.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),t.querySelectorAll(".hsa-chart-toogle-btn").forEach(function(t){t.classList.remove("active"),t.setAttribute("aria-pressed","false")}),r&&(r.style.display="none"),n&&(n.style.visibility="visible",n.style.height="auto"),a.classList.add("active"),a.setAttribute("aria-pressed","true");var c=o();c&&(c.style.display="none")})}}(t)}}function f(t,e){var a,o=e.calculationResult;null===(a=t.querySelector(".hsa-chart-container"))||void 0===a||a.classList.add("fadeIn");var c=r.format("$,"),i=u(t,".coveredMedicare"),s=u(t,".paidhsa"),l=u(t,".js-chartOop"),f=u(t,".js-chart-age-text"),v=u(t,".js-chart-currency-text"),m=parseFloat(String(o.totOop)),y=parseFloat(String(o.hsaSurplus));d(t,".hsachart-total-health-care-costs",c(Math.round(100*parseFloat(String(o.totCost)))/100)),d(t,".hsachart-covered-by-medicare",c(Math.round(100*parseFloat(String(o.totMedicare)))/100)),d(t,".hsachart-paid-from-hsa",c(Math.round(100*parseFloat(String(o.totCovered)))/100)),d(t,".hsachart-estimated-shortage",c(Math.round(100*m)/100)),d(t,".hsachart-estimated-surplus",c(Math.round(100*y)/100));var g=o.totalMedicalCosts.costPoints.map(function(t){return t.age}),S=o.medicareCovered.costPoints.map(function(t){return t.cost}),b=o.outOfPocketCosts.costPoints.map(function(t){return t.cost}),A=o.hsaCovered.costPoints.map(function(t){return t.cost}),C=A.reduce(function(t,e){return t+e},0),x=m<1&&y>0;h(t,".shortage-container",x),h(t,".surplus-container",!x);var k=C>0?["totCovered","totHSAPaid","totOop"]:["totCovered","totOop"];h(t,".paid-from-hsa",C<=0);var L={totCovered:S,totHSAPaid:A,totOop:b},M={totCovered:i,totHSAPaid:s,totOop:l};t.querySelectorAll(".hsa-chart-container").forEach(function(t){return t.classList.remove("hidden","hsa-chart-blur")}),p(t,g,L,k,M,v,f),function(t,e,a,r){var o=t.querySelector("#headData"),c=t.querySelector("#bodyData");if(o&&c){var i=["Age"].concat(n(r.map(function(t){return"totCovered"===t?"Covered By Medicare":"totHSAPaid"===t?"Covered By HSA":"Out of Pocket"})));o.innerHTML="<tr>".concat(i.map(function(t){return'<th style="text-align:center">'.concat(t,"</th>")}).join(""),"</tr>"),c.innerHTML=e.map(function(t,e){var o=[t].concat(n(r.map(function(t){var r;return null!==(r=a[t][e])&&void 0!==r?r:0})));return"<tr>".concat(o.map(function(t){return'<td style="text-align:center">'.concat(t,"</td>")}).join(""),"</tr>")}).join("")}}(t,g,L,k)}}}]);
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.