PageSourceSearch

https://s1.48hourprint.com/assets/vendor/dri/dri-calculator-library/dist/calculator.js

js 48hourprint.com collected 2026-10-03 22:11:56 UTC 46,813 bytes, 1 lines download raw bytes

1var CalcLib=function(t){var e={};function i(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)i.d(r,a,function(e){return t[e]}.bind(null,a));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=5)}([function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.events={},this.events={}}return t.prototype.subscribe=function(t,e,i){var r=this,a=t+":"+e;return this.events[a]||(this.events[a]=[]),this.events[a].push(i),function(){r.events[a]=r.events[a].filter((function(t){return i!==t}))}},t.prototype.emit=function(t,e,i){var r=t+":"+e,a=this.events[r];a&&a.forEach((function(t){t.call(null,i)}))},t.prototype.clear=function(){this.events=null},t}();e.EventEmitter=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(12),a=function(){function t(){this.maxlength=6,this.size_attributes=["width","height","width_ft","height_ft","size_unit"],this.size_attribute=!1,this.AttributeService=new r.AttributeService}return t.prototype.emitFocus=function(t){this.AttributeService.emitFocusedAttribute(t)},t}();e.AttributeComponent=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(6),a=function(){function t(){this.calculator=null,this.selectedSpecs=null,this.previousSpecs=null,this.invalidSpecs=null,this.excludeAttrs=[],this.calcFormError=[],this.isFirstLoad=!0,this.hasCustomSizeSupport=0,this.customSize=0,this.customTrim=0,this.sizeUnit="in",this.calculatorData=null,this.attributes=null,this.exceptions=null,this.factors=null,this.qtyAttr=null,this.setsOfAttr=null}return t.prototype.initialize=function(t,e){void 0===e&&(e=null),this.calculatorData=t,this.attributes=t.prod_attrs,this.getCustomSizeSupport(),this.setCalculatorExceptions(),this.setCalculatorFactors(),e?this.selectedSpecs=e:this.setCalculatorDefaultSpecs(),this.setCalculatorData()},t.prototype.setInvalidSpecs=function(t){this.invalidSpecs=t},t.prototype.setCalculatorDefaultSpecs=function(){var t={},e=null,i=null;for(var r in this.attributes){var a=this.attributes[r];if(a.name=a.product_attribute_name?a.product_attribute_name:a.attribute_name,("s"==a.field_type||"r"==a.field_type)&&a.prod_attr_vals&&a.prod_attr_vals.length){var s=null,o=null;for(var n in a.prod_attr_vals){var l=(d=a.prod_attr_vals[n]).id;if(o||(o=d),d.value=d.product_attr_value?d.product_attr_value:d.attr_value,a.default_value&&l==a.default_value){s=l;break}}s||(s=o.prod_attr_val_id),a.default_value=s}if("t"==a.field_type){var u=a.default_value,c="n"==a.data_type||"w"==a.data_type;a.default_value=c?u?parseFloat(String(u).replace(/[^\d\.]/g,"")):9999999:u,this.attrContainsOrderSpec(a,"SEQSTART")&&a.prod_attr_vals&&a.prod_attr_vals[a.default_value]&&(a.default_value=1),"y"==a.width_flag&&"n"==a.height_flag&&a.default_value<this.calculatorData.start_width&&(a.default_value=this.calculatorData.start_width),"y"==a.height_flag&&"n"==a.width_flag&&a.default_value<this.calculatorData.start_height&&(a.default_value=this.calculatorData.start_height),"y"==a.width_flag&&"y"==a.height_flag&&a.default_value<this.calculatorData.start_width&&(a.default_value=this.calculatorData.start_width)}if("c"==a.field_type)for(var n in a.prod_attr_vals){var d;l=(d=a.prod_attr_vals[n]).id;d.value=d.product_attr_value?d.product_attr_value:d.attr_value}t[r]=a.default_value,a.qty_flag&&"y"==a.qty_flag&&(e=a),(this.attrContainsOrderSpec(a,"INSETSOF")||this.attrContainsOrderSpec(a,"SHRINKINSETOF"))&&(i=a),this.invalidSpecs&&void 0!==this.invalidSpecs[r]&&(t[a.attribute_id]=0)}e&&i&&this.updateSetsOfAttribute(e,i,t),this.selectedSpecs=t},t.prototype.getCustomSizeSupport=function(){for(var t=0,e=["width","height","width_ft","height_ft"];t<e.length;t++){if(e[t]in this.attributes){this.hasCustomSizeSupport=1;break}}if(!this.hasCustomSizeSupport)for(var i=0,r=["WD","HT"];i<r.length;i++){var a=r[i];for(var s in this.attributes)if(a in this.attributes[s].order_spec_code){this.hasCustomSizeSupport=1;break}}},t.prototype.setCalculatorExceptions=function(){var t={};for(var e in this.attributes){var i=this.attributes[e];void 0!==i.exceptions&&(t[i.attribute_id]=i.exceptions)}this.exceptions=t},t.prototype.setCalculatorFactors=function(){var t={};for(var e in this.attributes){var i=this.attributes[e];for(var r in t[i.attribute_id]={},i.prod_attr_vals)void 0!==i.prod_attr_vals[r].factors&&(t[i.attribute_id][r]=i.prod_attr_vals[r].factors)}this.factors=t},t.prototype.getSelectedFactors=function(){var t=this.selectedSpecs,e=this.factors,i={max_linear_height_d:null,max_linear_width_d:null,width:null,height:null};for(var r in t){var a=t[r];if(void 0!==e[r][a])for(var s in e[r][a])i[s]=e[r][a][s]}return i},t.prototype.setCalculatorData=function(){var t=JSON.stringify(this.selectedSpecs),e=this.applyCalculatorExceptions();e=this.applyCalculatorFactorExceptions(e),e=this.applyCalculatorSizeExceptions(e),e=this.applyCalculatorSpecs(e),e=this.applyCalculatorSorts(e),t!=JSON.stringify(this.selectedSpecs)?this.setCalculatorData():(this.isFirstLoad=!1,this.calculator=e)},t.prototype.applyCalculatorExceptions=function(){var t=this.selectedSpecs,e=JSON.parse(JSON.stringify(this.calculatorData)),i=this.exceptions;for(var r in this.excludeAttrs=[],i){var a=i[r],s=void 0;for(s in a)for(var o=0,n=a[s];o<n.length;o++){var l=n[o],u=0,c=0;if(Object.keys(l).length>1&&-1==s){var d=!0;for(var _ in l)t[_]!=l[_]&&(d=!1);d?(delete e.prod_attrs[r],this.excludeAttrs.push(r)):u+=1,c+=1}else for(var _ in l)t[_]==l[_]&&(-1==s?(delete e.prod_attrs[r],this.excludeAttrs.push(r)):u+=1),c+=1;if(c&&u&&c==u&&void 0!==e.prod_attrs[r]&&(delete e.prod_attrs[r].prod_attr_vals[s],t[r]==s))for(var h in e.prod_attrs[r].prod_attr_vals_sort)if(void 0!==e.prod_attrs[r].prod_attr_vals_sort&&void 0!==e.prod_attrs[r].prod_attr_vals[e.prod_attrs[r].prod_attr_vals_sort[h]]){t[r]=isNaN(e.prod_attrs[r].prod_attr_vals_sort[h])?e.prod_attrs[r].prod_attr_vals_sort[h]:1*e.prod_attrs[r].prod_attr_vals_sort[h],this.selectedSpecs=t;break}}}return e},t.prototype.applyCalculatorFactorExceptions=function(t){var e=this.getSelectedFactors(),i=this.factors;if(null!=e.max_linear_height_d&&null!=e.max_linear_width_d){var r=1*e.max_linear_height_d,a=1*e.max_linear_width_d,s=1*e.width,o=1*e.height,n=Math.floor(a/(s+.125))*Math.floor(r/(o+.125));for(var l in i){var u=i[l];for(var c in u){var d=u[c];for(var _ in d){var h=d[_];"qty"==_&&1*h>n&&delete t.prod_attrs[l].prod_attr_vals[c]}}}}return t},t.prototype.applyCalculatorSizeExceptions=function(t){this.calcFormNotif=r.CalculatorFormNotifModel;var e=this.selectedSpecs;
1if(this.calcFormError=[],this.customSize=this.isCustomSize(e,t),this.customTrim=this.isCustomTrim(e,t),this.customTrim||this.customSize){var i={min_width:parseFloat(t.start_width),max_width:parseFloat(t.end_width),min_height:parseFloat(t.start_height),max_height:parseFloat(t.end_height)};for(var a in t.product_size_exceptions){var s=t.product_size_exceptions[a];for(var o in s){var n=s[o];n.min_width=parseFloat(n.min_width),n.max_width=parseFloat(n.max_width),n.min_height=parseFloat(n.min_height),n.max_height=parseFloat(n.max_height),e[a]==o&&(n.min_width&&n.min_width>i.min_width&&(i.min_width=n.min_width),n.max_width&&n.max_width<i.max_width&&(i.max_width=n.max_width),n.min_height&&n.min_height>i.min_height&&(i.min_height=n.min_height),n.max_height&&n.max_height<i.max_height&&(i.max_height=n.max_height))}}if(this.customSize){if(void 0!==t.prod_attrs.width)for(var l in t.prod_attrs.width.prod_attr_vals){var u=t.prod_attrs.width.prod_attr_vals[l];(i.min_width&&1*u.prod_attr_val_id<i.min_width||i.max_width&&1*u.prod_attr_val_id>i.max_width)&&delete t.prod_attrs.width.prod_attr_vals[l]}if(void 0!==t.prod_attrs.height)for(var l in t.prod_attrs.height.prod_attr_vals){u=t.prod_attrs.height.prod_attr_vals[l];(i.min_height&&1*u.prod_attr_val_id<i.min_height||i.max_height&&1*u.prod_attr_val_id>i.max_height)&&delete t.prod_attrs.height.prod_attr_vals[l]}if(void 0!==t.prod_attrs.width_ft)for(var l in t.prod_attrs.width_ft.prod_attr_vals){u=t.prod_attrs.width_ft.prod_attr_vals[l];(i.min_width&&1*u.prod_attr_val_id<i.min_width||i.max_width&&1*u.prod_attr_val_id>i.max_width)&&delete t.prod_attrs.width_ft.prod_attr_vals[l]}if(void 0!==t.prod_attrs.height_ft)for(var l in t.prod_attrs.height_ft.prod_attr_vals){u=t.prod_attrs.height_ft.prod_attr_vals[l];(i.min_height&&1*u.prod_attr_val_id<i.min_height||i.max_height&&1*u.prod_attr_val_id>i.max_height)&&delete t.prod_attrs.height_ft.prod_attr_vals[l]}}var c=void 0,d=void 0,_=void 0,h=void 0,p=void 0,v=void 0;for(var f in t.prod_attrs){var m=t.prod_attrs[f],b=t.prod_attrs[f].field_type;"y"==m.width_flag&&"n"==m.height_flag&&(c=f,d=b),"y"==m.height_flag&&"n"==m.width_flag&&(_=f,h=b),"y"==m.width_flag&&"y"==m.height_flag&&(p=f,v=b)}if(c){var g=parseFloat(this.selectedSpecs[c]);if(g<i.min_width||isNaN(g))if("t"!=d||this.isFirstLoad)this.selectedSpecs[c]=i.min_width;else{var y={less_than_size:this.calcFormNotif.getErrorSizeLessThan(i.min_width,"width")};this.calcFormError[c]=y}if(g>i.max_width||isNaN(g))if("t"!=d||this.isFirstLoad)this.selectedSpecs[c]=i.max_width;else{var S={greater_than_size:this.calcFormNotif.getErrorSizeGreaterThan(i.max_width,"width")};this.calcFormError[c]=S}}if(_){var C=parseFloat(this.selectedSpecs[_]);if(C<i.min_height||isNaN(C))if("t"!=h||this.isFirstLoad)this.selectedSpecs[_]=i.min_height;else{var O={less_than_size:this.calcFormNotif.getErrorSizeLessThan(i.min_height,"height")};this.calcFormError[_]=O}if(C>i.max_height||isNaN(C))if("t"!=h||this.isFirstLoad)this.selectedSpecs[_]=i.max_height;else{var x={greater_than_size:this.calcFormNotif.getErrorSizeGreaterThan(i.max_height,"height")};this.calcFormError[_]=x}}if(p){var A=parseFloat(this.selectedSpecs[p]);if(A<i.min_width||isNaN(A))if("t"!=v||this.isFirstLoad)this.selectedSpecs[p]=i.min_width;else{var w={less_than_size:this.calcFormNotif.getErrorSizeLessThan(i.min_width,"diameter")};this.calcFormError[p]=w}if(A>i.max_width||isNaN(A))if("t"!=v||this.isFirstLoad)this.selectedSpecs[p]=i.max_width;else{var N={greater_than_size:this.calcFormNotif.getErrorSizeGreaterThan(i.max_width,"diameter")};this.calcFormError[p]=N}}}return t},t.prototype.applyCalculatorSpecs=function(t){var e=this.selectedSpecs,i=null,r=null;for(var a in t.prod_attrs){var s=t.prod_attrs[a];if("t"==s.field_type)t.prod_attrs[s.attribute_id].default_value=e[s.attribute_id];else if("size_unit"==s.attribute_id)t.prod_attrs[s.attribute_id].default_value=e[s.attribute_id],this.sizeUnit=e[s.attribute_id];else if("width"==s.attribute_id||"height"==s.attribute_id||"width_ft"==s.attribute_id||"height_ft"==s.attribute_id){for(var o in s.default_value=null,s.prod_attr_vals)if(void 0!==s.prod_attr_vals[o]&&(s.default_value||(s.default_value=s.prod_attr_vals[o].prod_attr_val_id),s.prod_attr_vals[o].prod_attr_val_id==e[s.attribute_id])){s.default_value=e[s.attribute_id];break}t.prod_attrs[s.attribute_id].default_value=s.default_value,this.selectedSpecs[s.attribute_id]=s.default_value}else if(void 0!==e[s.attribute_id]&&void 0!==s.prod_attr_vals&&void 0!==s.prod_attr_vals[e[s.attribute_id]])t.prod_attrs[s.attribute_id].default_value=e[s.attribute_id];else if(this.invalidSpecs&&void 0!==this.invalidSpecs[s.attribute_id])t.prod_attrs[s.attribute_id].default_value=0,e[s.attribute_id]=0;else{var n=void 0;for(var l in n=0,s.prod_attr_vals_sort)if(void 0!==s.prod_attr_vals_sort&&void 0!==s.prod_attr_vals[s.prod_attr_vals_sort[l]]){var u=isNaN(s.prod_attr_vals_sort[l])?s.prod_attr_vals_sort[l]:1*s.prod_attr_vals_sort[l],c=void 0!==s.prod_attr_vals[s.prod_attr_vals_sort[l]]?s.prod_attr_vals[s.prod_attr_vals_sort[l]]:null;if(n=n||u,null!=c&&"y"==c.default_value){n=u;break}}t.prod_attrs[s.attribute_id].default_value=n,this.selectedSpecs[s.attribute_id]=n}s.qty_flag&&"y"==s.qty_flag&&(i=s),(this.attrContainsOrderSpec(s,"INSETSOF")||this.attrContainsOrderSpec(s,"SHRINKINSETOF"))&&(r=s),this.attrContainsOrderSpec(s,"TA")&&t.shipping_computation_type_id&&2==t.shipping_computation_type_id&&(s.hide_flag="y")}return i&&r&&this.updateSetsOfAttribute(i,r,this.selectedSpecs),t},t.prototype.applyCalculatorSorts=function(t){for(var e in t.prod_attrs){var i=t.prod_attrs[e],r=[];for(var a in i.prod_attr_vals_sort)void 0!==i.prod_attr_vals[i.prod_attr_vals_sort[a]]&&r.push(i.prod_attr_vals_sort[a]);if(0==r.length)for(var s in i.prod_attr_vals)r.push(s);i.prod_attr_vals_sort=r}return t},t.prototype.attrContainsOrderSpec=function(t,e){if(t.order_spec_code&&Array.isArray(t.order_spec_code))for(var i in t.order_spec_code)if(t.order_spec_code[i]==e)return!0;return!1}
1,t.prototype.updateSetsOfAttribute=function(t,e,i){var r=t.default_value,a=t.prod_attr_vals[r];if(a&&"t"==e.field_type){var s=a.factors&&a.factors.qty?a.factors.qty:a.factors&&a.factors.no_groups?a.factors.no_groups:0,o=parseInt(s);e.default_value=parseInt(e.default_value),i[e.attribute_id]=e.default_value,(!e.default_value||e.default_value>o)&&(e.default_value=o,i[e.attribute_id]=o)}},t.prototype.isCustomSize=function(t,e){var i=0;if("y"==e.dynamic_size)i=1;else{var r=null,a=null;for(var s in t){if((l=e.prod_attrs[s])&&"Size"==l.attribute_name){r=l,a=t[s];break}}if(r){var o=r.attribute_id,n=r.prod_attr_vals;"custom"==t[o]||n&&n[a]&&n[a].attr_value.indexOf("Custom")>=0&&65796!=a?i=1:(i=0,delete e.prod_attrs.width,delete e.prod_attrs.height)}else for(var s in t){var l;if((l=e.prod_attrs[s])&&(l.width_flag&&"y"==l.width_flag||l.height_flag&&"y"==l.height_flag)){i=1;break}}}return i},t.prototype.isCustomTrim=function(t,e){var i=0;for(var r in t)if(void 0!==e.prod_attrs[r]&&"Custom Trim"==e.prod_attrs[r].attribute_name){var a=e.prod_attrs[r].prod_attr_vals;if(a[t[r]]&&"Yes"==a[t[r]].attr_value){i=1;break}i=0}return i},t}();e.CalculatorDataModel=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(7),a=i(8),s=i(9),o=function(){function t(t){this.config=t,this.selectedSpecs=null,this.priceData=null,this.addOnAttributes=[],this.addOnAttributeName=null,this.tierId=0,this.coupon=null,this.priceCallback=null,this.SessionStorageService=new a.SessionStorageService,this.HttpService=new r.HttpService,this.config.add_on_attributes&&(this.addOnAttributes=this.config.add_on_attributes),this.config.multi_price_attrs&&(this.addOnAttributes=this.config.multi_price_attrs),this.config.addon_attribute_name&&(this.addOnAttributeName=this.config.addon_attribute_name),this.setComputePriceUrl(this.config.compute_price_url+"?website_code="+this.config.website_code)}return t.prototype.setComputePriceUrl=function(t){this.computePriceUrl=t},t.prototype.setCalculatorSpecs=function(t){this.addOnAttributes.length&&(this.config.calc_api_enabled?t.addon_attributes=this.addOnAttributes.join(","):t.multi_price_attrs=this.addOnAttributes.join(",")),this.addOnAttributeName&&(t.addon_attribute_name=this.addOnAttributeName),this.selectedSpecs=t},t.prototype.getPriceFromServer=function(){var t={};if(this.config.calc_api_enabled){var e=s.CalcApiConfig[this.config.environment];t={Authorization:"Basic "+btoa(e.key+":"+e.secret)}}else{var i=this.readCookie(this.config.access_token_field);i&&(t={Authorization:"Bearer "+i})}return this.HttpService.ajax(this.computePriceUrl,"POST",this.selectedSpecs,t)},t.prototype.getPriceFromCache=function(){if(!this.priceCacheExpired()){var t=this.selectedSpecs,e=this.getSpecsCombination(t),i=this.SessionStorageService.getCalcPriceCache(e);if(i){if(i=JSON.parse(i),1==this.addOnAttributes.length)for(var r=0,a=t;r<a.length;r++){var s=a[r],o=this.getSingleAttrAddon(s);o&&(i.subtotal=i.addon_attrs[o.attribute_id][o.value].price)}return this.priceData=this.applyCoupon(i),!0}}return!1},t.prototype.recordPriceCache=function(t,e){var i=this.getSpecsCombination(t);i&&(this.SessionStorageService.getCalcPriceCache("calculator_timestamp")||this.SessionStorageService.setCalcPriceCache("calculator_timestamp",(new Date).getTime()),this.SessionStorageService.setCalcPriceCache(i,JSON.stringify(e)))},t.prototype.getSpecsCombination=function(t){var e=[],i=["product_id","width","height","qty_var","ab_test_bucket_id","tier_id","price_override_flag","proofing_options"];for(var r in t)(r.match(/attr[0-9]+/)&&!this.getSingleAttrAddon(t[r])||-1!==i.indexOf(r))&&e.push(r+":"+t[r]);return e.join("|")},t.prototype.priceCacheExpired=function(){var t=this.SessionStorageService.getCalcPriceCache("calculator_timestamp");if(t&&(new Date).getTime()-t<864e5)return!1;return this.SessionStorageService.clearCalcPriceCache(),!0},t.prototype.getSingleAttrAddon=function(t){var e=this.addOnAttributes;return 1==e.length&&t.name=="attr"+e[0]?{attribute_id:e[0],value:t.value}:null},t.prototype.applyCoupon=function(t){var e=this.coupon;if(null!=e&&void 0!==e&&void 0!==e.coupon_code){var i=e.discount_percentage?1*e.discount_percentage:0,r=e.max_discount?1*e.max_discount:0,a=e.discount_amount?1*e.discount_amount:0;
1i&&(a=t.subtotal*i/100),r&&(a=r<a?r:a),t.discount_price=a,t.total_price=1*t.total_price,a<t.total_price?t.total_price=t.total_price-a:(t.discount_price=t.subtotal,t.total_price=0)}return t},t.prototype.readCookie=function(t){for(var e=t+"=",i=document.cookie.split(";"),r=0;r<i.length;r++){for(var a=i[r];" "==a.charAt(0);)a=a.substring(1);if(0==a.indexOf(e))return a.substring(e.length,a.length)}return""},t}();e.CalculatorPriceModel=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.getNumericValue=function(t){var e=NaN,i=/^(-)?\s*(\d*)(\.\d+|(\s+\d*\s*)?\s*\/\s*\d+)?$/.exec(t);if(!i)return NaN;var r=i[1],a=i[2],s=i[3];if(!a&&!s)return NaN;if(e=!a&&s&&-1!==s.search(/^\./)?0:parseInt(a),isNaN(e))return NaN;if(!s)return e*("-"===r?-1:1);if(-1!==s.search(/^\./)){var o=parseFloat(s);e=Math.round(1e3*(e+o))/1e3}else if(-1!==s.search(/^\s*\//)){o=parseInt(a);var n=parseInt(s.replace("/",""));e=Math.round(1e3*o/n)/1e3}else{var l=s.split("/").map((function(t){return parseInt(t)}));o=l[0],n=l[1];e=Math.round(1e3*(e+o/n))/1e3}return e*("-"===r?-1:1)},t}();e.FractionDecimalSizeService=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(2);e.CalculatorDataModel=r.CalculatorDataModel;var a=i(3);e.CalculatorPriceModel=a.CalculatorPriceModel;var s=i(10);e.CalculatorFormComponent=s.CalculatorFormComponent;var o=i(11);e.CheckboxAttributeComponent=o.CheckboxAttributeComponent;var n=i(13);e.DropdownAttributeComponent=n.DropdownAttributeComponent;var l=i(14);e.DropdownOptgroupAttributeComponent=l.DropdownOptgroupAttributeComponent;var u=i(15);e.HiddenAttributeComponent=u.HiddenAttributeComponent;var c=i(16);e.RadioAttributeComponent=c.RadioAttributeComponent;var d=i(17);e.TextAttributeComponent=d.TextAttributeComponent;var _=i(18);e.CustomTrimAttributeComponent=_.CustomTrimAttributeComponent;var h=i(19);e.BoxAttributeComponent=h.BoxAttributeComponent;var p=i(20);e.CalculatorDataAddOnModel=p.CalculatorDataAddOnModel;var v=i(21);e.CalculatorWidgetModel=v.CalculatorWidgetModel},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.getErrorSizeLessThan=function(t,e){return"Minimum "+e+" is "+t},t.getErrorSizeGreaterThan=function(t,e){return"Maximum "+e+" is "+t},t}();e.CalculatorFormNotifModel=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){}return t.prototype.ajax=function(t,e,i,r){void 0===e&&(e="GET"),void 0===i&&(i={}),void 0===r&&(r={});var a=new XMLHttpRequest;return{promise:new Promise((function(s,o){if(a.open(e,t),a.setRequestHeader("Content-type","application/json"),r)for(var n in r)a.setRequestHeader(n,r[n]);a.onload=function(){4===a.readyState&&200===a.status?s(JSON.parse(this.responseText)):o(Error(a.statusText))},a.onerror=function(){o(Error("Network Error"))},a.send(JSON.stringify(i))})),http:a}},t}();e.HttpService=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.calcPriceCacheKey="cpc",this.storage="undefined"!=typeof Storage?sessionStorage:null}return t.prototype.get=function(t){return!(!this.storage||!this.storage[t])&&this.storage[t]},t.prototype.set=function(t,e){if(this.storage)try{this.storage[t]=e}catch(t){console.log("Exceeded storage limit : "+JSON.stringify(t))}},t.prototype.clear=function(){this.storage&&this.storage.clear()},t.prototype.setCalcPriceCache=function(t,e){if(this.storage)try{var i=this.storage[this.calcPriceCacheKey]&&this.storage[this.calcPriceCacheKey].length?JSON.parse(this.storage[this.calcPriceCacheKey]):{};i[t]=e,this.storage[this.calcPriceCacheKey]=JSON.stringify(i)}catch(t){console.log("Exceeded storage limit : "+JSON.stringify(t))}},t.prototype.getCalcPriceCache=function(t){if(this.storage&&this.storage[this.calcPriceCacheKey]){var e=JSON.parse(this.storage[this.calcPriceCacheKey]);if(e[t])return e[t]}return!1},t.prototype.clearCalcPriceCache=function(){this.storage&&this.storage[this.calcPriceCacheKey]&&this.storage.removeItem(this.calcPr
1iceCacheKey)},t}();e.SessionStorageService=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CalcApiConfig={qa:{key:"calculator.site",secret:"KEfm75#XjwSMux92zUWD9T8AafG!vwV6"},production:{key:"calculator.site",secret:"KEfm75#XjwSMux92zUWD9T8AafG!vwV6"}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(3),a=i(0),s=function(){function t(t,e,i,s){var o=this;this.computingPrice=!1,this.priceSubscription=null,this.events=new a.EventEmitter,this.model=t,this.price=new r.CalculatorPriceModel(s),this.config=s,this.elementRef=e,this.calc_index=i,this.prodAttrs=this.model.calculator.prod_attrs,this.prodAttrsSort=this.model.calculator.prod_attrs_sort,setTimeout((function(){o.computePrice()}),0)}return t.prototype.computePrice=function(){var t=this;if(this.priceSubscription&&this.priceSubscription.abort(),!this.price||!this.events)return!1;for(var e={},i=!1,r=this.elementRef.querySelectorAll("input[type='hidden'], select"),a=0;a<r.length;a++){var s=r[a];-1!==s.name.indexOf("attr")&&0==s.value&&(i=!0),e[s.name]=s.value}if(this.price.setCalculatorSpecs(e),!i)if(this.price.getPriceFromCache())this.events.emit(this.calc_index,"priceChange",this.price.priceData);else{this.computingPrice=!0,this.config.on_load_price&&(this.computingPrice=!1,delete this.config.on_load_price),this.events.emit(this.calc_index,"computing",this.computingPrice);var o=this.price.getPriceFromServer();o.promise.then((function(i){if(t.computingPrice=!1,t.events.emit(t.calc_index,"computing",!1),t.price.priceData=JSON.parse(JSON.stringify(i)),t.events.emit(t.calc_index,"priceChange",t.price.priceData),t.price.recordPriceCache(e,i),t.price.addOnAttributes.length&&i.addon_attrs){var r=i.addon_attrs,a=t.price.addOnAttributes;for(var s in a){var o=a[s],n=e["attr"+o],l=t.model.calculator.prod_attrs[o].prod_attr_vals_sort.map((function(t,e,i){return isNaN(t)?t:Number(t)}));if(o in r)for(var u in r[o]){var c=r[o][u];if(c.price&&c.item_data&&l.indexOf(Number(u))>=0&&u!=n){var d=JSON.parse(JSON.stringify(i));d.total_price=c.price,d.orig_price=c.price,d.unit_price=Number(c.price)/c.item_data.qty,d.turnaround=c.item_data.turnaround,d.price=c.price,d.price_data["attr"+o]=u,e["attr"+o]=u,t.price.recordPriceCache(e,d)}}}}})),this.priceSubscription=o.http}},t.prototype.updateSelectedSpecs=function(t){var e=this,i=JSON.parse(JSON.stringify(this.model.selectedSpecs));if(i[t.attribute_id]=t.prod_attr_val_id,this.model.previousSpecs=JSON.parse(JSON.stringify(this.model.selectedSpecs)),this.model.selectedSpecs=i,this.updatedSpecs={attribute_id:t.attribute_id,prod_attr_val_id:t.prod_attr_val_id},this.model.setCalculatorData(),this.prodAttrs=this.model.calculator.prod_attrs,this.prodAttrsSort=this.model.calculator.prod_attrs_sort,JSON.stringify(this.model.selectedSpecs)!=JSON.stringify(this.model.previousSpecs)){setTimeout((function(){e.computePrice()}),0);var r=this.getSelectedSpecs();this.events.emit(this.calc_index,"specsChange",r)}},t.prototype.getSelectedSpecs=function(){var t=JSON.parse(JSON.stringify(this.model.selectedSpecs));if(this.model.customSize?t.size_unit&&("ft"==t.size_unit?(t.height=t.height_ft,t.width=t.width_ft):(t.width_ft=t.width,t.height_ft=t.height)):(delete t.width,delete t.height,delete t.width_ft,delete t.height_ft,delete t.size_unit),this.model.excludeAttrs.length){var e=this.model.excludeAttrs;for(var i in e){var r=e[i];r in t&&delete t[r]}}return t},t.prototype.getCalculatorModel=function(){return JSON.parse(JSON.stringify(this.model))},t.prototype.destroy=function(){this.events.clear(),this.events=null,this.price=null,this.priceSubscription&&this.priceSubscription.abort()},t}();e.CalculatorFormComponent=s},function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=i(1),o=i(0),n=function(t){function e(e,i,r){var a=t.call(this)||this;return a.attribute=e,a.selected_value=i,a.elementRef=r,a.events=new o.EventEmitter,a.true_value=0,a.false_value=0,a}return a(e,t),e.prototype.updateAttributeValue=function(t){this.elementRef.querySelector("input[type='hidden']").value=t,this.events.emit(this.attribute.attribute_id,"update",{prod_attr_val_id:t})},e.prototype.updateOnChange=function(t){if(void 0===t.attribute)return!1;for(var e=0,i=this.attribute.prod_attr_vals_sort;e<i.length;e++){var r=i[e],a=this.attribute.prod_attr_vals[r];"y"==a.check_flag?(this.attr_value=a.product_attr_value||a.attr_value,this.true_value=a.prod_attr_val_id):this.false_value=a.prod_attr_val_id}},e.prototype.updateAfterViewChecked=function(){this.elementRef.querySelector("input[type='hidden']").value=this.selected_value,this.selected_value==this.true_value&&(this.elementRef.querySelector("input[type='checkbox']").checked="checked")},e.prototype.destroy=function(){this.events.clear(),this.events=null},e}(s.AttributeComponent);e.CheckboxAttributeComponent=n}
1,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=function(){function t(){this.focusedAttribute=new r.EventEmitter}return t.prototype.emitFocusedAttribute=function(t){this.focusedAttribute.emit(t,"focus",{})},t.prototype.isAttrValCustomSize=function(t){return"string"==typeof t?"Custom Size"==t.trim():"Custom Size"==t},t}();e.AttributeService=a},function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),o=function(t){function e(e,i,r,a,o){var n=t.call(this)||this;return n.attribute=e,n.disabled=i,n.selected_value=r,n.invalid_specs=a,n.elementRef=o,n.events=new s.EventEmitter,n}return a(e,t),e.prototype.updateAttributeValue=function(t){this.events.emit(this.attribute.attribute_id,"change",{prod_attr_val_id:t})},e.prototype.updateOnChange=function(t){void 0!==t.attribute&&(this.size_attribute=this.size_attributes.indexOf(this.attribute.attribute_id)>=0,this.size_attribute?this.setSizeAttributeValues():this.setAttributeValues())},e.prototype.updateAfterViewChecked=function(){this.elementRef.getElementsByTagName("SELECT")[0].value=this.selected_value},e.prototype.setAttributeValues=function(){this.attribute_name="attr"+this.attribute.attribute_id,this.attribute_values=[];for(var t=0,e=this.attribute.prod_attr_vals_sort;t<e.length;t++){var i=e[t],r=this.attribute.prod_attr_vals[i];"undefined"!=r.product_attr_value&&r.product_attr_value&&""!=r.product_attr_value.replace(/\s/g,"")&&(r.attr_value=r.product_attr_value),this.attribute_values.push(r)}},e.prototype.setSizeAttributeValues=function(){for(var t in this.attribute_name=this.attribute.attribute_id,this.attribute_name=["width_ft","height_ft"].indexOf(this.attribute_name)>=0?this.attribute_name.split("_").shift():this.attribute_name,this.attribute_values=[],this.attribute.prod_attr_vals)void 0!==this.attribute.prod_attr_vals[t].prod_attr_val_id&&this.attribute_values.push(this.attribute.prod_attr_vals[t])},e.prototype.destroy=function(){this.events.clear(),this.events=null},e}(i(1).AttributeComponent);e.DropdownAttributeComponent=o},function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),o=function(t){function e(e,i,r,a,o){var n=t.call(this)||this;return n.attribute=e,n.disabled=i,n.selected_value=r,n.invalid_specs=a,n.elementRef=o,n.events=new s.EventEmitter,n.group_attribute_values={},n.prod_attr_val_groups=[],n}return a(e,t),e.prototype.updateAttributeValue=function(t){this.events.emit(this.attribute.attribute_id,"change",{prod_attr_val_id:t})},e.prototype.updateOnChange=function(t){void 0!==t.attribute&&(this.size_attribute=this.size_attributes.indexOf(this.attribute.attribute_id)>=0,this.size_attribute?this.setSizeAttributeValues():this.setAttributeValues())},e.prototype.updateAfterViewChecked=function(){this.elementRef.nativeElement.getElementsByTagName("SELECT")[0].value=this.selected_value},e.prototype.setAttributeValues=function(){this.attribute_name="attr"+this.attribute.attribute_id,this.attribute_values=[],this.prod_attr_val_groups=[],this.group_attribute_values={};for(var t=0,e=this.attribute.prod_attr_vals_sort;t<e.length;t++){var i=e[t],r=this.attribute.prod_attr_vals[i];"undefined"!=r.product_attr_value&&r.product_attr_value&&""!=r.product_attr_value.replace(/\s/g,"")&&(r.attr_value=r.product_attr_value),r.prod_attr_val_group?(this.prod_attr_val_groups.indexOf(r.prod_attr_val_group)<0&&this.prod_attr_val_groups.push(r.prod_attr_val_group),this.group_attribute_values[r.prod_attr_val_group]||(this.group_attribute_values[r.prod_attr_val_group]=[]),this.group_attribute_values[r.prod_attr_val_group].push(r)):this.attribute_values.push(r)}},e.prototype.setSizeAttributeValues=function(){for(var t in this.attribute_name=this.attribute.attribute_id,this.attribute_name=["width_ft","height_ft"].indexOf(this.attribute_name)>=0?this.attribute_name.split("_").shift():this.attribute_name,this.attribute_values=[],this.attribute.prod_attr_vals)void 0!==this.attribute.prod_attr_vals[t].prod_attr_val_id&&this.attribute_values.push(this.attribute.prod_attr_vals[t])},e.prototype.destroy=function(){this.events.clear(),this.events=null},e}(i(1).AttributeComponent);e.DropdownOptgroupAttributeComponent=o}
1,function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),o=function(t){function e(e,i,r,a){var o=t.call(this)||this;return o.attribute=e,o.selected_value=i,o.show_attribute_value=r,o.elementRef=a,o.events=new s.EventEmitter,o}return a(e,t),Object.defineProperty(e.prototype,"attibuteValue",{get:function(){if(this.selected_value){var t=this.attribute.prod_attr_vals[this.selected_value];return t.product_attr_value||t.attr_value}return""},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.events.clear(),this.events=null},e}(i(1).AttributeComponent);e.HiddenAttributeComponent=o},function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=i(0),o=function(t){function e(e,i,r){var a=t.call(this)||this;return a.attribute=e,a.selected_value=i,a.elementRef=r,a.specChange=new s.EventEmitter,a}return a(e,t),e.prototype.updateAttributeValue=function(t){this.specChange.emit(this.attribute.attribute_id,"update",{prod_attr_val_id:t})},e.prototype.updateOnChange=function(t){if(void 0!==t.attribute){this.attribute_name="size_unit"==this.attribute.attribute_name?"size_unit":"attr"+this.attribute.attribute_name,this.attribute_values=[];for(var e=0,i=this.attribute.prod_attr_vals_sort;e<i.length;e++){var r=i[e],a=this.attribute.prod_attr_vals[r];"undefined"!=a.product_attr_value&&a.product_attr_value&&""!=a.product_attr_value.replace(/\s/g,"")&&(a.attr_value=a.product_attr_value),this.attribute_values.push(a)}}},e.prototype.updateAfterViewChecked=function(){this.elementRef.querySelector("input[type='hidden']").value=this.selected_value,this.elementRef.querySelector("input[value='"+this.selected_value+"']").checked="checked"},e.prototype.destroy=function(){this.specChange.clear(),this.specChange=null},e}(i(1).AttributeComponent);e.RadioAttributeComponent=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(4),s=function(){function t(t,e,i,s){this.attribute=t,this.selectedValue=e,this.defaultValue=i,this.elementRef=s,this.events=new r.EventEmitter,this.maxLength=6,this.dataType="n",this.FractionDecimalSizeService=new a.FractionDecimalSizeService,this.initialize()}return t.prototype.validate=function(t){var e=t;e.preventDefault();var i=e.target.value;if(["n","w"].indexOf(this.dataType)>=0){var r=this.FractionDecimalSizeService.getNumericValue(i);if(r&&"n"==this.dataType)this.selectedValue=r;else if(/^(0|[1-9]\d*)(\.\d+)?$/.test(i)){if("y"==this.attribute.qty_flag){var a=this.attribute.default_min_value?Number(this.attribute.default_min_value):1;Number(i)<a?this.events.emit(this.attribute.attribute_id,"min_qty",{min_qty:a,valid:!1}):this.events.emit(this.attribute.attribute_id,"min_qty",{valid:!0})}this.selectedValue=i}else e.returnValue=!1,this.attrContainsOrderSpec(this.attribute,"INSETSOF")||this.attrContainsOrderSpec(this.attribute,"SHRINKINSETOF")?this.selectedValue=i:(this.selectedValue=this.attribute.default_value,"y"==this.attribute.qty_flag&&this.events.emit(this.attribute.attribute_id,"min_qty",{valid:!0}))}else this.selectedValue=i},t.prototype.initialize=function(){this.attribute.maxlength&&(this.maxLength=this.attribute.maxlength),this.attribute.data_type&&(this.dataType=this.attribute.data_type);var t=this.elementRef.getElementsByTagName("INPUT")[0];this.inputEl=t,this.inputEl.value=this.selectedValue,this.inputEl.setAttribute("maxlength",this.maxLength),this.inputEl.addEventListener("change",this.emitChanges.bind(this)),this.inputEl.addEventListener("keypress",this.preventDefault.bind(this))},t.prototype.emitChanges=function(t){this.validate(t),this.events.emit(this.attribute.attribute_id,t.type,{prod_attr_val_id:this.selectedValue})},t.prototype.preventDefault=function(t){13==t.keyCode&&(t.preventDefault(),this.emitChanges(t))},t.prototype.attrContainsOrderSpec=function(t,e){if(t.order_spec_code&&Array.isArray(t.order_spec_code))for(var i in t.order_spec_code)if(t.order_spec_code[i]==e)return!0;return!1},t.prototype.destroy=function(){this.events.clear(),this.events=null,this.inputEl.removeEventListener("change",this.emitChanges.bind(this)),this.inputEl.removeEventListener("keypress",this.preventDefault.bind(this))},t}();e.TextAttributeComponent=s}
1,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=i(4),s=function(){function t(t,e,i){this.attribute=t,this.selectedValue=e,this.elementRef=i,this.events=new r.EventEmitter,this.maxLength=6,this.dataType="n",this.FractionDecimalSizeService=new a.FractionDecimalSizeService,this.initialize()}return t.prototype.validate=function(t){var e=t;e.preventDefault();var i=e.target.value;if(["n","w"].indexOf(this.dataType)>=0){var r=this.FractionDecimalSizeService.getNumericValue(i);r&&"n"==this.dataType?this.selectedValue=r:/^(0|[1-9]\d*)(\.\d+)?$/.test(i)?this.selectedValue=i:(e.returnValue=!1,this.selectedValue=this.attribute.default_value)}else this.selectedValue=i},t.prototype.initialize=function(){this.attribute.maxlength&&(this.maxLength=this.attribute.maxlength),this.attribute.data_type&&(this.dataType=this.attribute.data_type);var t=this.elementRef.getElementsByTagName("INPUT")[0];this.inputEl=t,this.inputEl.value=this.selectedValue,this.inputEl.setAttribute("maxlength",this.maxLength),this.inputEl.addEventListener("change",this.emitChanges.bind(this)),this.inputEl.addEventListener("keypress",this.preventDefault.bind(this))},t.prototype.emitChanges=function(t){this.validate(t),this.events.emit(this.attribute.attribute_id,"change",{prod_attr_val_id:this.selectedValue})},t.prototype.preventDefault=function(t){13==t.keyCode&&(t.preventDefault(),this.emitChanges(t))},t.prototype.destroy=function(){this.events.clear(),this.events=null,this.inputEl.removeEventListener("change",this.emitChanges.bind(this)),this.inputEl.removeEventListener("keypress",this.preventDefault.bind(this))},t}();e.CustomTrimAttributeComponent=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i(0),a=function(){function t(t,e,i,a){this.attribute=t,this.disabled=e,this.selected_value=i,this.elementRef=a,this.events=new r.EventEmitter}return t.prototype.updateAttributeValue=function(t){this.events.emit(this.attribute.attribute_id,"change",{prod_attr_val_id:t})},t.prototype.destroy=function(){this.events.clear(),this.events=null},t}();e.BoxAttributeComponent=a},function(t,e,i){"use strict";var r,a=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},function(t,e){function i(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)});Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.attributeAddOn=null,e.isFirstLoad=!0,e.calcFormError=[],e}return a(e,t),e.prototype.filterProdAttrValSort=function(t,e){var i=[];for(var r in t){e.indexOf(t[r])>=0&&i.push(t[r])}return i},e.prototype.cloneProdAttrVals=function(t,e){return JSON.parse(JSON.stringify(t.prod_attrs[e].prod_attr_vals_sort.map((function(t,e,i){return isNaN(t)?t:1*t}))))},e.prototype.setAddOns=function(t,e){var i={},r={},a=function(a){if(t.prod_attrs[a])if(s.attributeAddOn[a].DEPENDENCIES&&Object.keys(s.attributeAddOn[a].DEPENDENCIES.dependents).length){i[a]=s.attributeAddOn[a].DEPENDENCIES;var o=s.selectedSpecs[a],n=i[a].dependents,l=i[a].prod_attr_id.id,u=function(i){if(n[i].prod_attr_val_id.id==o&&t.prod_attrs[l]){var r=n[i].default_id.id,a=t.prod_attrs[l].prod_attr_vals_sort.map((function(t,e,i){return isNaN(t)?t:1*t}));if(n[i].prod_attr_val_ids.length||r&&!n[i].prod_attr_val_ids.length){var u=n[i].prod_attr_val_ids.map((function(t,e,i){return isNaN(t)?t:1*t})),c=s.filterProdAttrValSort(a,u);c.length&&(a=c)}var d=s.cloneProdAttrVals(t,l);t.prod_attrs[l].prod_attr_vals_sort=a;var _=d.filter((function(t){return a.indexOf(t)<0}));s.attributeAddOn[l]&&s.attributeAddOn[l].other_box&&_.length&&(t.prod_attrs[l].other_box=_);var h=t.prod_attrs[l].default_value;h=isNaN(h)?h:1*h;var p=a.concat(_),v=a[0];s.isFirstLoad&&(r&&h!=r&&s.attributeAddOn[l]&&!s.attributeAddOn[l].prod_val_ids[r].hide_flag&&(v=r),(-1==p.indexOf(v)&&s.selectedSpecs[l]&&!e||h!=r&&!e)&&(s.selectedSpecs[l]=v,t.prod_attrs[l].default_value=v))}};for(var c in n)u(c)}else if(s.attributeAddOn[a].FILTERS&&1==Object.keys(s.attributeAddOn[a].FILTERS.filters).length&&(r[a]=s.attributeAddOn[a].FILTERS.filters,Object.keys(r[a][0].attribute_vals).length>0&&r[a][0].other_box)){var d=t.prod_attrs[a].prod_attr_vals_sort.map((function(t,e,
1i){return isNaN(t)?t:1*t})),_=r[a][0].attribute_vals.map((function(t,e,i){return isNaN(t)?t:1*t})),h=s.filterProdAttrValSort(d,_);h.length&&(d=h);var p=s.cloneProdAttrVals(t,a);t.prod_attrs[a].prod_attr_vals_sort=d;var v=p.filter((function(t){return d.indexOf(t)<0}));v.length&&(t.prod_attrs[a].other_box=v)}},s=this;for(var o in this.attributeAddOn)a(o);return t},e}(i(2).CalculatorDataModel);e.CalculatorDataAddOnModel=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.calculatorData=null,this.calculatorWidget=null,this.activeCalcIndex=null,this.sharedCalcAttrs=null,this.AppCrossStorageService=null,this.calculatorDataClone={}}return t.prototype.initialize=function(t,e,i,r,a){this.calculatorData=t,this.calculatorWidget=e,this.activeCalcIndex=i,this.sharedCalcAttrs=r,this.AppCrossStorageService=a},t.prototype.setCalcVariantOverride=function(t){this.calculatorDataClone[this.activeCalcIndex]=JSON.parse(JSON.stringify(this.calculatorData[this.activeCalcIndex]));var e=this.calculatorDataClone[this.activeCalcIndex],i=(e.prod_attrs,["label","display_type"]),r=["description","emphasis","icon","label"];for(var a in t)if(e.prod_attrs[a]){t[a].default&&(void 0===this.sharedCalcAttrs[this.activeCalcIndex]||this.sharedCalcAttrs[this.activeCalcIndex].length<1)&&(e.prod_attrs[a].default_value=t[a].default.id);var s=Object.keys(t[a]);if(s.length)for(var o in s){var n=s[o];if(i.indexOf(n)>=0){var l=t[a][n];e.prod_attrs[a][n]=l}}if("object"==typeof t[a].prod_val_ids&&Object.keys(t[a].prod_val_ids).length){var u=e.prod_attrs[a].prod_attr_vals,c=e.prod_attrs[a].prod_attr_vals_sort,d=t[a].prod_val_ids;for(var _ in d)if(d[_].hide_flag)delete u[_],-1!=c.indexOf(_)&&c.splice(c.indexOf(_),1);else if(u[_]){var h=Object.keys(d[_]);if(h.length)for(var o in h){var p=h[o];r.indexOf(p)>=0&&(u[_][p]=d[_][p])}}this.calculatorDataClone[this.activeCalcIndex]=e}}return this.calculatorDataClone},t.prototype.setCalcWidgetData=function(){for(var t in this.calculatorWidget){var e=this.calculatorWidget[t].visible_attributes,i=this.calculatorWidget[t].product_id,r=this.calculatorWidget[t].prod_attrs,a=this.calculatorWidget[t].prod_attr_vals,s=["tooltip_id","tooltip_mode","tooltip_trigger_method","hide_flag","show_description","show_icon"],o=this.calculatorData[i].prod_attrs;for(var n in r){var l=r[n].attribute_id;if(o[l]){!r[n].default_prod_attr_val_id||this.sharedCalcAttrs[this.activeCalcIndex]&&void 0!==this.sharedCalcAttrs[this.activeCalcIndex][r[n].attribute_id]||Object.keys(o[l].prod_attr_vals).length>0&&(o[l].default_value=r[n].default_prod_attr_val_id),r[n].tooltip_text&&(o[l].tooltip_text=r[n].tooltip_text);var u=Object.keys(r[n]);if(u.length>0)for(var c in u){var d=u[c];if(s.indexOf(d)>=0){var _=r[n][d];e.length||"hide_flag"!=d||(_="n"),o[l][d]=_}}}}for(var h in a){var p=a[h];for(var d in p){var v=p[d];o[h]&&"y"==v.hide_flag&&o[h].prod_attr_vals[v.prod_attr_val_id]&&delete o[h].prod_attr_vals[v.prod_attr_val_id]}}this.calculatorData[i].prod_attrs=o}return this.calculatorData},t.prototype.setActiveCalcVariant=function(t,e,i){var r=this;if(void 0!==this.AppCrossStorageService&&null!=this.AppCrossStorageService&&void 0!==t.storage_keys.calc_variant){var a=new this.AppCrossStorageService({}),s="LIST";return new Promise((function(o){0!=i&&e[r.activeCalcIndex]&&i in e[r.activeCalcIndex]?o(i):a.model.storage.onConnect().then((function(){a.model.storage.get(t.storage_keys.calc_variant).then((function(t){if(void 0!==e[r.activeCalcIndex]&&Object.keys(e[r.activeCalcIndex]).length>0)if(null!=t&&void 0!==e[r.activeCalcIndex][t])s=t;else{var i="";for(var a in r.calculatorWidget)r.calculatorWidget[a].product_id==r.activeCalcIndex&&void 0!==r.calculatorWidget[a].default_calc&&(i=r.calculatorWidget[a].default_calc);i?s=i:"GRID"in e[r.activeCalcIndex]&&(s="GRID")}o(s)}))}))}))}},t.prototype.filterEnabledVariant=function(){var t={};for(var e in this.calculatorWidget){var i=this.calculatorWidget[e].calc_variants,r=this.calculatorWidget[e].product_id;if(i&&"object"==typeof i&&Object.keys(i).length>0){for(var a in i)void 0!==i[a].enable_flag&&"n"==i[a].enable_flag&&delete i[a];Object.keys(i).length>0&&(t[r]=i)}}return t}
1,t.prototype.setCalculatorSections=function(t,e,i){void 0===i&&(i={}),i=JSON.parse(JSON.stringify(i));var r="";Object.keys(i).length<1&&(i={standard:[],price:[]},r="standard");var a=["width","height","width_ft","height_ft","size_unit"],s=["QTY","TA"],o=[];if(t&&e[this.activeCalcIndex]&&e[this.activeCalcIndex][t]&&e[this.activeCalcIndex][t].attribute_sections){o=JSON.parse(JSON.stringify(this.calculatorData[this.activeCalcIndex].prod_attrs_sort));var n=e[this.activeCalcIndex][t].attribute_sections;for(var l in n.section){var u=n.section[l];for(var c in i[l.toLowerCase()]=u,u){var d=o.indexOf(u[c]);d>=0&&o.splice(d,1)}}}else{var _=JSON.parse(JSON.stringify(this.calculatorData[this.activeCalcIndex].prod_attrs_sort));for(var c in _){var h=this.calculatorData[this.activeCalcIndex].prod_attrs[_[c]],p=h.hasOwnProperty("order_spec_code")?h.order_spec_code[0]:null;void 0!==i.price&&p&&-1!=s.indexOf(p)?(void 0===i.price&&(i.price=[]),i.price.push(_[c])):(void 0===i[Object.keys(i)[0]]&&(i[Object.keys(i)[0]]=[]),i[Object.keys(i)[0]].push(_[c]))}}if(o.length>0){var v=null,f=null;for(var m in i)for(var b in i[m]){var g=i[m][b];this.calculatorData[this.activeCalcIndex].prod_attrs[g]&&void 0!==this.calculatorData[this.activeCalcIndex].prod_attrs[g].order_spec_code&&this.calculatorData[this.activeCalcIndex].prod_attrs[g].order_spec_code.indexOf("SZ")>=0&&(v=Number(b)+1,f=m,r=m)}if(v)for(var y in a){var S=o.indexOf(a[y]);S>=0?(-1==i[f].indexOf(a[y])&&i[f].splice(v,0,a[y]),v++):-1==i[r].indexOf(a[y])&&i[r].push(a[y]),S>=0&&o.splice(S,1)}i.unset=o}return i},t.prototype.setActiveCalcIndex=function(t){this.activeCalcIndex=t},t}();e.CalculatorWidgetModel=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.