1"use strict";(this.webpackJsonpSharedCalc=this.webpackJsonpSharedCalc||[]).push([[3715],{5079:function(t,e,a){a.r(e),a.d(e,{List:function(){return o}});var r=a(659),i=a(3),l=a(5859),s=a(9949),n=a(5337),c=a(7843),u=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},d=function(t){var e="function"==typeof Symbol&&Symbol.iterator,a=e&&t[e],r=0;if(a)return a.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o=function(){function t(t,e,a,r){var i=this;this.attributeService=t,this.calculator=e,this.calcDOMHelper=a,this.calcInfoService=r,this.setData=function(t,e){i.attributeId=t,i.data=e},this.init=function(){var t=i.calculator.getData();i.selectedValue=i.calculator.selectedSpecs[i.attributeId];var e=i.attributeId.replace("list_","");i.attribute=t.prod_attrs[e],i.attrContainer=i.mainElementRef.querySelectorAll(".list-attr-"+i.attribute.attribute_id),i.attrContainer&&(i.updateAttributeValue=i.updateAttributeValue.bind(i),i.attrContainer.forEach(function(t){var e=t.querySelectorAll(".list-action"),a=t.querySelector(".list-wrap").children,r=-1;e.forEach(function(e,a){e.parentNode.classList.contains("selected")&&(r=a,i.updateListClasses(r,t))}),e.forEach(function(l){l.addEventListener("click",function(l){l.preventDefault(),e.forEach(function(t){return t.parentNode.classList.remove("selected")});var s=l.currentTarget.parentNode;s.classList.add("selected"),r=Array.from(a).indexOf(s),i.updateListClasses(r,t),i.updateAttributeValue(l)})})}))},this.mainElementRef=this.calcDOMHelper.getCalcDOM(),this.updateAttribute=this.updateAttribute.bind(this)}return t.prototype.updateListClasses=function(t,e){var a=e.querySelectorAll(".list-wrap .list"),r=(t-1+a.length)%a.length,i=(t+1)%a.length;a.forEach(function(t,e){t.classList.remove("active","prev","next"),t.classList.contains("selected")&&t.classList.add("active"),e==r&&t.classList.add("prev"),e==i&&t.classList.add("next")})},t.prototype.updateAttributeValue=function(t){if(this.calcInfoService.isCustomModalOpen&&"Custom Size"==t.currentTarget.dataset.display)return i.U.dispatchEvent(this.mainElementRef,"calc.customSizeModal",{attribute_id:this.attribute.attribute_id,prod_attr_val_id:t.currentTarget.dataset.value}),!1;var e='input[type="hidden"][name="attr'.concat(this.attribute.attribute_id,'"]');if(this.mainElementRef.querySelector(e).getAttribute("value")==t.currentTarget.dataset.value)return!1;this.selectedValue=t.currentTarget.dataset.value;var a=document.querySelector(".sms-wgt-gallery");if(a){var r='[data-attr-val-id="'.concat(this.selectedValue,'"]'),l=a.querySelector(r);l&&l.click()}var s={attribute_id:this.attribute.attribute_id,prod_attr_val_id:this.selectedValue};this.triggerEvents(s)},t.prototype.updateAttribute=function(t,e,a,r){var i,l,s,n;void 0===r&&(r=null),this.attribute=t,this.selectedValue=e;var c=[],u=this.mainElementRef.querySelector(".list-attr-".concat(t.attribute_id));if(!r){var o=this.attributeService.getAttributeValues(this.attribute);try{for(var h=d(o),f=h.next();!f.done;f=h.next())(y=f.value).hide_flag&&"n"!=y.hide_flag||c.push(Number(y.prod_attr_val_id))}catch(t){i={error:t}}finally{try{f&&!f.done&&(l=h.return)&&l.call(h)}finally{if(i)throw i.error}}u.classList.remove("hidden"),this.attribute.hide_attribute_flag&&"y"==this.attribute.hide_attribute_flag&&u.classList.add("hidden")}var v=[];if(!v.length){o=this.getOtherListAttrValues(this.attribute);try{for(var p=d(o),b=p.next();!b.done;b=p.next()){var y;(y=b.value).hide_flag&&"n"!=y.hide_flag||v.push(1*y.prod_attr_val_id)}}catch(t){s={error:t}}finally{try{b&&!b.done&&(n=p.return)&&n.call(p)}finally{if(s)throw s.error}}}for(var _=a.querySelectorAll(".attr-value"),g=!1,m=null,L=0;L<_.length;L++){var S=_[L];S.setAttribute("aria-selected",!1);var E=S.parentNode;E.classList.remove("hidden"),E.classList.remove("selected");var A=1*S.dataset.value;c.length||(E.classList.add("hidden"),m||(m=S),v.length&&v.indexOf(A)>=0&&(E.classList.remove("hidden"),S.dataset.value==this.selectedValue&&(S.setAttribute("aria-selected",!0),E.classList.add("selected"),g=!0))),c.length&&c.indexOf(A)<0&&E.classList.add("hidden"),c.indexOf(A)>=0&&(m||(m=S),S.dataset.value==this.selectedValue&&(S.setAttribute("aria-selected",!0),E.classList.add("selected"),g=!0))}!g&&m&&(m.setAttribute("aria-selected",!0),m.parentNode.classList.add("selected"),this.selectedValue=m.dataset.value),a.querySelector('input[type="hidden"]').value=this.selectedValue},t.prototype.getOtherListAttrValues=function(t){var e,a,r=[];if(null==t.other_list)return[];try{for(var i=d(t.other_list),l=i.next();!l.done;l=i.next()){var s=l.value,n=t.prod_attr_vals[s];n&&("undefined"!=n.product_attr_value&&n.product_attr_value&&""!=n.product_attr_value.replace(/\s/g,"")&&(n.attr_value=n.product_attr_value),r.push(n))}}catch(t){e={error:t}}finally{try{l&&!l.done&&(a=i.return)&&a.call(i)}finally{if(e)throw e.error}}return r},t.prototype.triggerEvents=function(t){i.U.dispatchEvent(this.mainElementRef,"calc.changeSpecs",t),i.U.dispatchEvent(this.mainElementRef,"calc.attribute",t),i.U.dispatchEvent(this.mainElementRef,"calc.attributeClick",t)},function(t,e,a,r){var i,l=arguments.length,s=l<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,a):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,a,r);else for(var n=t.length-1;n>=0;n--)(i=t[n])&&(s=(l<3?i(s):l>3?i(e,a,s):i(e,a))||s);return l>3&&s&&Object.defineProperty(e,a,s),s}([(0,r.injectable)(),u("design:paramtypes",[l.e,s.t,n.a,c.t])],t)}()}}]);
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.