!function(n,t){"use strict";function v(n,t,r){var e=n.children(),o=!1,u,s,f;for(n.empty(),u=0,s=e.length;u<s;u++){if(f=e.eq(u),n.append(f),r&&n.append(r),i(n,t)){f.remove();o=!0;break}r&&r.detach()}return o}function e(t,r,u,f,o){var s=!1,h="a, table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",c="script, .dotdotdot-keep";return t.contents().detach().each(function(){var a=this,l=n(a);if("undefined"==typeof a)return!0;if(l.is(c))t.append(l);else{if(s)return!0;t.append(l);!o||l.is(f.after)||l.find(f.after).length||t[t.is(h)?"after":"append"](o);i(u,f)&&(s=3==a.nodeType?y(l,r,u,f,o):e(l,r,u,f,o));s||o&&o.detach()}}),r.addClass("is-truncated"),s}function y(t,e,o,h,c){var l=t[0],nt,k,d,tt;if(!l)return!1;var a=s(l),it=a.indexOf(" ")!==-1?" ":"　",p="letter"==h.wrap?"":it,v=a.split(p),g=-1,w=-1,b=0,y=v.length-1;if(h.fallbackToLetter&&0===b&&0===y&&(p="",v=a.split(p),y=v.length-1),h.maxLength)a=f(a.trim().substr(0,h.maxLength),h),r(l,a);else{for(;b<=y&&(0!==b||0!==y);){if(nt=Math.floor((b+y)/2),nt==w)break;w=nt;r(l,v.slice(0,w+1).join(p)+h.ellipsis);o.children().each(function(){n(this).toggle().toggle()});i(o,h)?(y=w,h.fallbackToLetter&&0===b&&0===y&&(p="",v=v[0].split(p),g=-1,w=-1,b=0,y=v.length-1)):(g=w,b=w)}g==-1||1===v.length&&0===v[0].length?(k=t.parent(),t.detach(),d=c&&c.closest(k).length?c.length:0,(k.contents().length>d?l=u(k.contents().eq(-1-d),e):(l=u(k,e,!0),d||k.detach()),l&&(a=f(s(l),h),r(l,a),d&&c))&&(tt=c.parent(),n(l).parent().append(c),n.trim(tt.html())||tt.remove())):(a=f(v.slice(0,g+1).join(p),h),r(l,a))}return!0}function i(n,t){return n.innerHeight()>t.maxHeight||t.maxLength&&n.text().trim().length>t.maxLength}function f(t,i){for(;n.inArray(t.slice(-1),i.lastCharacter.remove)>-1;)t=t.slice(0,-1);return n.inArray(t.slice(-1),i.lastCharacter.noEllipsis)<0&&(t+=i.ellipsis),t}function o(n){return{width:n.innerWidth(),height:n.innerHeight()}}function r(n,t){n.innerText?n.innerText=t:n.nodeValue?n.nodeValue=t:n.textContent&&(n.textContent=t)}function s(n){return n.innerText?n.innerText:n.nodeValue?n.nodeValue:n.textContent?n.textContent:""}function h(n){do n=n.previousSibling;while(n&&1!==n.nodeType&&3!==n.nodeType);return n}function u(t,i,r){var f,e=t&&t[0];if(e){if(!r){if(3===e.nodeType)return e;if(n.trim(t.text()))return u(t.contents().last(),i)}for(f=h(e);!f;){if(t=t.parent(),t.is(i)||!t.length)return!1;f=h(t[0])}if(f)return u(n(f),i)}return!1}function p(t,i){return!!t&&("string"==typeof t?(t=n(t,i),!!t.length&&t):!!t.jquery&&t)}function w(n){for(var t,r=n.innerHeight(),u=["paddingTop","paddingBottom"],i=0,f=u.length;i<f;i++)t=parseInt(n.css(u[i]),10),isNaN(t)&&(t=0),r-=t;return r}var c,l,a;n.fn.dotdotdot||(n.fn.dotdotdot=function(t){var r,h;if(0===this.length)return n.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){n(this).dotdotdot(t)});r=this;h=r.contents();r.data("dotdotdot")&&r.trigger("destroy.dot");r.data("dotdotdot-style",r.attr("style")||"");r.css("word-wrap","break-word");"nowrap"===r.css("white-space")&&r.css("white-space","normal");r.bind_events=function(){return r.bind("update.dot",function(t,o){switch(r.removeClass("is-truncated"),t.preventDefault(),t.stopPropagation(),typeof u.height){case"number":u.maxHeight=u.height;break;case"function":u.maxHeight=u.height.call(r[0]);break;default:u.maxHeight=w(r)}u.maxHeight+=u.tolerance;"undefined"!=typeof o&&(("string"==typeof o||"nodeType"in o&&1===o.nodeType)&&(o=n("<div />").append(o).contents()),o instanceof n&&(h=o));s=r.wrapInner('<div class="dotdotdot" />').children();s.contents().detach().end().append(h.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var c=!1,l=!1;return f.afterElement&&(c=f.afterElement.clone(!0),c.show(),f.afterElement.detach()),i(s,u)&&(l="children"==u.wrap?v(s,u,c):e(s,r,s,u,c)),s.replaceWith(s.contents()),s=null,n.isFunction(u.callback)&&u.callback.call(r[0],l,h),f.isTruncated=l,l}).bind("isTruncated.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),"function"==typeof t&&t.call(r[0],f.isTruncated),f.isTruncated}).bind("originalContent.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),"function"==typeof t&&t.call(r[0],h),h}).bind("destroy.dot",function(n){n.preventDefault();n.stopPropagation();r.unwatch().unbind_events().contents().detach().end().append(h).attr("style",r.data("dotdotdot-style")||"").removeClass("is-truncated").data("dotdotdot",!1)}),r};r.unbind_events=function(){return r.unbind(".dot"),r};r.watch=function(){if(r.unwatch(),"window"==u.watch){var t=n(window),i=t.width(),e=t.height();t.bind("resize.dot"+f.dotId,function(){i==t.width()&&e==t.height()&&u.windowResizeFix||(i=t.width(),e=t.height(),l&&clearInterval(l),l=setTimeout(function(){r.trigger("update.dot")},100))})}else a=o(r),l=setInterval(function(){if(r.is(":visible")){var n=o(r);a.width==n.width&&a.height==n.height||(r.trigger("update.dot"),a=n)}},500);return r};r.unwatch=function(){return n(window).unbind("resize.dot"+f.dotId),l&&clearInterval(l),r};var u=n.extend(!0,{},n.fn.dotdotdot.defaults,t),f={},a={},l=null,s=null;return u.lastCharacter.remove instanceof Array||(u.lastCharacter.remove=n.fn.dotdotdot.defaultArrays.lastCharacter.remove),u.lastCharacter.noEllipsis instanceof Array||(u.lastCharacter.noEllipsis=n.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),f.afterElement=p(u.after,r),f.isTruncated=!1,f.dotId=c++,r.data("dotdotdot",!0).bind_events().trigger("update.dot"),u.watch&&r.watch(),r},n.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0,maxLength:null},n.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","　",",",";",".","!","?"],noEllipsis:[]}},n.fn.dotdotdot.debug=function(){},c=1,l=n.fn.html,n.fn.html=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?this.trigger("update",[i]):l.apply(this,arguments)},a=n.fn.text,n.fn.text=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?(i=n("<div />").text(i).html(),this.trigger("update",[i])):a.apply(this,arguments)})}(jQuery);jQuery(document).ready(function(n){n(".dot-ellipsis").each(function(){var r=n(this).hasClass("dot-resize-update"),u=n(this).hasClass("dot-timer-update"),i=0,f=n(this).attr("class").split(/\s+/),t;n.each(f,function(n,t){var r=t.match(/^dot-height-(\d+)$/);null!==r&&(i=Number(r[1]))});t={};u&&(t.watch=!0);r&&(t.watch="window");i>0&&(t.height=i);n(this).dotdotdot(t)})});jQuery(window).on("load",function(){jQuery(".dot-ellipsis.dot-load-update").trigger("update.dot")}),function(n,t){"use strict";var r=t.document,i=function(r,u){u=u||{};n.extend(this,i.options,u);this.console("Running GridFix with options:",u);this.$el=n(r);this.element=r;this.items=undefined;this.winWidth=n(t).width();this._init();var f=n.proxy(this._resizeHandler,this);n(t).on("resize",f);t.onorientationchange=f};i.options={itemSelector:"",excludeItemsSelector:"",adjustGrid:!0,swapUp:!1,fixHeight:!0,adjustHeightSelector:"",disableOnWidth:0,debug:!1,useProfiler:!1};i.EventType={LOADING:"loading",DONE:"done"};i.prototype._init=function(){this.running=!0;(n(".row.is-equalHeight > [class*='col-']:not(.promo)").first().height()<40||n(".row.is-equalHeight > [class*='col-']:not(.promo)").first().hasClass("IOS10_fixed"))&&n("#productList .row.is-equalHeight").removeClass("is-equalHeight");this._triggerEvent(i.EventType.LOADING);this.parentWidth=this.$el.outerWidth();var r=this._getItemsAsRows();this.adjustGrid&&this._adjustRows(r);r.adjusted&&this._replaceParent(r);t.setTimeout(n.proxy(function(){this.running=!1;this._triggerEvent(i.EventType.DONE)},this),16)};i.prototype.isRunning=function(){return this.running};i.prototype.destroy=function(){this.$el=null;this.element=null;this.items=null;n(t).off("resize",n.proxy(this._resizeHandler,this))};i.prototype._getItems=function(){return this.items?this.console("Already have items, no need to requery, items:"+this.items.length):this.items=this.excludeItemsSelector?this.$el.children(this.itemSelector).not(this.excludeItemsSelector):this.$el.children(this.itemSelector),this.items};i.prototype._getItemsAsRows=function(){var s=this._getItems(),f=[],e=[],t=0,o,i,r,u;for(this.console("Found "+s.length+" items"),u=0;u<s.length;u=u+1)i=n(s[u]),r=i.outerWidth(!0),i.get(0).getClientRects()[0]!==undefined&&i.get(0).getClientRects()[0].width!==undefined&&r!==Math.floor(i.get(0).getClientRects()[0].width)&&(r-=1),t+r>this.parentWidth&&(o=t>=this.parentWidth?!0:!1,f.push({items:e,rowWidth:t,isFull:o}),e=[],t=0),e.push({element:i,width:r}),t+=r;return o=t>=this.parentWidth?!0:!1,f.push({items:e,rowWidth:t,isFull:o}),this.console("That resulted in "+f.length+" rows"),f};i.prototype._adjustRows=function(n){for(var t,e,f,u,r=0;r<n.length;r=r+1){if(t=n[r],e=undefined,t.items.length==0)break;for(u=r+1;u<n.length;u=u+1)if(n[u].items.length>0){e=n[u];break}for(this.swapUp&&!t.isFull&&(n.adjusted=!0,i.swapRowItems(e,0,t,t.items.length-1,this.parentWidth));!t.isFull;)if(f=this._findNextItemForWidth(n,r,this.parentWidth-t.rowWidth),f)n.adjusted=!0,t.items.push(f),t.rowWidth+=f.width,t.isFull=t.rowWidth>=this.parentWidth?!0:!1;else{this.console("No more items, we are done");break}}};i.prototype._findNextItemForWidth=function(n,t,i){for(var r,e,u,f=t+1;f<n.length;f=f+1)for(r=n[f],u=0;u<r.items.length;u=u+1)if(e=r.items[u],e.width<=i+4)return r.rowWidth-=e.width,r.isFull=r.rowWidth>=this.parentWidth?!0:!1,r.items.splice(u,1),e;return undefined};i.prototype._replaceParent=function(t){var e=this.fixHeight,o=this.adjustHeightSelector,u,f,i;u=n.map(t,function(n){var i,t;if(e)for(t=0;t<n.items.length;t=t+1)i=n.items[t],i.element.children(o).first().height(n.rowHeight);return n.items});f=n.map(u,function(n){return n.element});i=n(r.createDocumentFragment());i.append(f);this.$el.empty().append(i)};i.prototype._resizeHandler=function(){var r=n(t).width(),i;this._shouldRun()?this.isRunning()||this.winWidth===r||(this.timeoutId&&(t.clearTimeout(this.timeoutId),delete this.timeoutId),i=this,this.timeoutId=t.setTimeout(function(){t.requestAnimationFrame(function(){i._init();delete i.timeoutId})},32)):(this.timeoutId&&(t.clearTimeout(this.timeoutId),delete this.timeoutId),this.items===undefined&&this._getItems());this.winWidth=r};i.prototype._shouldRun=function(){return this.disableOnWidth===0?!0:t.matchMedia("screen and (min-width: "+this.disableOnWidth+"px)").matches};i.prototype.console=function(){this.debug&&t.console.log.apply(t.console,arguments)};i.prototype._triggerEvent=function(n,t){var i=n+".GridFix",r=t&&t.length?t:[this];this.$el.trigger(i,r)};i.swapRowItems=function(n,t,r,u,f){if(i.canSwapItems(n,t,r,u,f)){var e=r.items[u];n.rowWidth-=n.items[t].width;r.rowWidth-=r.items[u].width;r.items[u]=n.items[t];n.items[t]=e;n.rowWidth+=n.items[t].width;r.rowWidth+=r.items[u].width;n.isFull=n.rowWidth>=f?!0:!1;r.isFull=r.rowWidth>=f?!0:!1}};i.canSwapItems=function(n,t,i,r,u){if(n&&i&&n.items&&i.items&&n.items[t]&&i.items[r]){var f=i.rowWidth-i.items[r].width;if(f<=u)return!0}return!1};i.startProfiler=function(){t.console.timeline&&t.console.timeline("GridFix._init()");t.console.profile&&t.console.profile()};i.stopProfiler=function(){t.setTimeout(function(){t.console.timelineEnd&&t.console.timelineEnd("GridFix._init()");t.console.profileEnd&&t.console.profileEnd()},1e3)};n.fn.gridFix=function(t){var u=Array.prototype.slice.call(arguments,1),r=null;return this.each(function(){var e=n(this),f=e.data("gridFix");f?typeof t=="string"&&f[t]&&(r=f[t].apply(f,u)):(f=new i(this,t),e.data("gridFix",f))}),r!==null?r:this}}(jQuery,window)