{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_core/cartridge/client/default/js/helpers/common.js","webpack:///./cartridges/app_core/cartridge/client/default/js/product/compare.js","webpack:///./cartridges/app_core/cartridge/client/default/js/product/wishlistHeart.js","webpack:///./cartridges/app_core/cartridge/client/default/js/search.js","webpack:///./cartridges/app_core/cartridge/client/default/js/search/search.js","webpack:///./sfra/cartridges/app_storefront_base/cartridge/client/default/js/search/search.js","webpack:///./sfra/cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack:///./vendor/app_storefront_core/cartridge/client/default/js/product/compare.js","webpack:///./vendor/app_storefront_core/cartridge/client/default/js/search/search.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA,gDAAgD;AAChD;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA,C;;;;;;;;;;;;ACfa;;AAEb,cAAc,mBAAO,CAAC,yGAAsB;;AAE5C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,+CAA+C,mBAAmB;AAClE,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA,iEAAiE,IAAI;AACrE;AACA,gCAAgC,eAAe;AAC/C;AACA;AACA,kBAAkB;AAClB,kBAAkB;AAClB,kBAAkB;AAClB;AACA,yCAAyC,KAAK,WAAW,IAAI;AAC7D;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sD;AACA;;AAEA;AACA;AACA;AACA;AACA,0D;AACA,SAAS;AACT;AACA;AACA;AACA,0D;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,uDAAuD,WAAW;AAClE,iBAAiB;AACjB;AACA,yDAAyD,WAAW;AACpE;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,+CAA+C,WAAW;AAC1D,SAAS;AACT;AACA,iDAAiD,WAAW;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uD;AACA,wC;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA,8BAA8B,iCAAiC;AAC/D;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qB;AACA,wB;AACA,oB;AACA,4B;AACA,wB;AACA,oC;AACA,6B;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D,iBAAiB;AACjB,2DAA2D;;AAE3D,iBAAiB;AACjB,2DAA2D;AAC3D;AACA;AACA,SAAS;;AAET,KAAK;AACL;AACA;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;;AAEA,iBAAiB;AACjB;AACA;;AAEA,iBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,KAAK,E;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,8CAA8C,WAAW;AACzD,IAAI;AACJ;;AAEA;;;;;;;;;;;;;AC7tBa;;AAEb;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;;;;;;;;;;;;;AC7Ea;;AAEb,qBAAqB,mBAAO,CAAC,4FAAW;;AAExC;AACA,mBAAmB,mBAAO,CAAC,2FAAiB;AAC5C,mBAAmB,mBAAO,CAAC,2GAAyB;AACpD,mBAAmB,mBAAO,CAAC,+FAAmB;AAC9C,CAAC;;;;;;;;;;;;;ACRY;;AAEb,aAAa,mBAAO,CAAC,qGAAoB;AACzC,mBAAmB,mBAAO,CAAC,8FAAmB;;AAE9C;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oCAAoC,QAAQ;;AAE5C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4CAA4C;AAC5C,qBAAqB;AACrB;AACA,oBAAoB;AACpB,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uBAAuB;AAClE,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;;AAEA,gFAAgF;AAChF;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,2BAA2B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;;AAEA;;;;;;;;;;;;;AChYa;;AAEb;AACA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,uBAAuB,2BAA2B;AAClD;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;AC9Na;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;ACZa;;AAEb;AACA;AACA;AACA;;AAEA;;;AAGA;AACA;AACA;AACA,cAAc,OAAO;AACrB,cAAc,OAAO;AACrB;;AAEA;AACA;AACA;AACA,WAAW,sBAAsB;AACjC,WAAW,OAAO;AAClB,YAAY,OAAO;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA,uBAAuB,uBAAuB;AAC9C;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,YAAY,yBAAyB;AACrC;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;;AAET;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,OAAO;AAClB,YAAY,yBAAyB;AACrC;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,+CAA+C,mBAAmB;AAClE,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qDAAqD,WAAW;AAChE,aAAa;AACb;AACA,uDAAuD,WAAW;AAClE;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,WAAW;AAC9D,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,WAAW;AAChE,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,gFAAgF,gBAAgB,EAAE;AAClG,gCAAgC;AAChC;;AAEA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;ACpTA,KAAK,6CAA6C;;AAElD,eAAe,mBAAO,CAAC,8GAAoB;;AAE3C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,uBAAuB;AAClE,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA,wB","file":"default/js/search.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./cartridges/app_core/cartridge/client/default/js/search.js\");\n","'use strict';\n\nmodule.exports ={\n updateCanonicalURL: function (el) {\n var canonical = el.html().replace(/&/g, '&');\n var $canonicalTag = $('link[rel=\"canonical\"]');\n\n if ($canonicalTag.length) {\n $canonicalTag.attr('href', canonical);\n } else {\n var $canonicalTagExample = '';\n $('head').append($canonicalTagExample);\n }\n\n }\n}","'use strict';\n\nvar Compare = require('core/product/compare');\n\nvar timer;\nvar tilesOnPage = 2;\n\nvar $compareBar = $('.compare-bar-wrapper');\nvar compareButtonText = $('button.compare').text();\nvar productsForComparison = [];\nvar maxSlots = parseInt($('.compare-bar').data('max-slots'), 10);\n\n/**\n * Clears the Compare Bar and hides it\n * @return {undefined}\n */\n function clearCompareBar() {\n productsForComparison.forEach(function (product) {\n $(this).trigger('compare:deselected', { pid: product.pid });\n });\n\n productsForComparison = [];\n $('.compare-bar .product-slots').empty();\n \n $('.compare input').prop('checked', false);\n $('.compare input[type=checkbox]:not(:checked)').removeAttr('disabled');\n $compareBar.hide();\n \n window.location.replace(location.pathname);\n}\n\n/**\n * Compiles the HTML for a single slot\n *\n * @param {ProductComparisonList} product - Selected product to compare\n * @param {number} idx - Slot number (zero-based)\n * @return {string} - HTML for a single slot\n */\n function compileSlot(product, idx) {\n var pid = product.pid;\n var name = 'pid' + idx;\n\n return '' +\n `
\n
\n
\n \n
\n \n ${product.familyName ? '
' + product.familyName + '
' : ''}\n ${product.productName ? '
' + product.productName + '
' : ''}\n ${product.price ? '
' + product.price + '
' : ''}\n
\n \n
\\n`;\n}\n\n/**\n * Enables/disables the Compare button, depending on whether at least two products have been\n * selected for comparison\n *\n * @param {number} numProducts - Number of products selected for comparison\n */\n function setCompareButton(numProducts) {\n if (numProducts > 0) {\n $('button.compare').text(compareButtonText + '(' + numProducts + '/4)');\n } else {\n $('button.compare').text(compareButtonText);\n }\n if (numProducts < 2) {\n $('button.compare').attr('disabled', true);\n } else {\n $('button.compare').removeAttr('disabled');\n }\n}\n\n/**\n * Draw and render the Compare Bar product slots\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n */\n function redrawCompareSlots(productsToCompare) {\n var html = productsToCompare.map(function (product, idx) {\n return compileSlot(product, idx);\n }).join('');\n $('.compare-bar .product-slots').empty().append(html);\n}\n\n/**\n * Returns a copy of a list of products to compare\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\n function copyProducts(productsToCompare) {\n return productsToCompare.map(function (product) {\n var proxy = {};\n\n Object.keys(product).forEach(function (key) {\n proxy[key] = product[key];\n });\n\n return proxy;\n });\n}\n\n/**\n * Handles the selection of a product for comparison\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @param {string} imgSrc - Image URL for selected product\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction selectProduct(products, pid, imgSrc, productName, familyName, price) {\n var productsToCompare = copyProducts(products) || [];\n \n if (productsToCompare.length < maxSlots) {\n productsToCompare.push({\n pid: pid,\n imgSrc: imgSrc,\n productName: productName,\n familyName: familyName,\n price: price\n });\n\n if (productsToCompare.length === maxSlots) {\n $('input[type=checkbox]:not(:checked)').attr('disabled', true);\n }\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n $compareBar.show();\n }\n\n return productsToCompare;\n}\n\n/**\n * Handles the deselection of a product\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\n function deselectProduct(products, pid) {\n var productsToCompare = copyProducts(products) || [];\n\n productsToCompare = productsToCompare.filter(function (product) {\n return product.pid !== pid;\n });\n\n if (productsToCompare.length === 0) {\n $compareBar.hide();\n }\n\n $('input#' + pid).prop('checked', false);\n $('input[type=checkbox]:not(:checked)').removeAttr('disabled');\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n return productsToCompare;\n}\n\n\n/**\n * Moving table rows on mobile\n * @param {Object} $this - Slider arrow jQuery object\n * @param {Object} $tableRows - Table rows jQuery object\n * @param {Number} step - moving step number \n */\nfunction moveTableRow($this, $tableRows, step) {\n var translateValue = (100 / $('.js-compare-product-cell').length) * step;\n $tableRows.css('transform', 'translateX(-'+ translateValue +'%)');\n $this.closest('.js-compare-tile').data('step', step);\n}\n\n/**\n * Toggle slider arrows\n * @param {Number} productLength - compared product quantity\n * @param {Number} step - moving step number \n * @param {Number} tilesOnPage - quantity of products showing on page on mobile\n */\nfunction toggleArrows(productLength, step, tilesOnPage) {\n if (step === (productLength - tilesOnPage)) {\n $('.m-next').removeClass('m-visible').addClass('m-invisible');\n $('.m-prev').removeClass('m-invisible').addClass('m-visible');\n } else if (step === 0) {\n $('.m-prev').removeClass('m-visible').addClass('m-invisible');\n $('.m-next').removeClass('m-invisible').addClass('m-visible');\n } else {\n $('.m-next, .m-prev').removeClass('m-invisible').addClass('m-visible');\n }\n}\n\n/**\n * Redirecting after removing product\n * @param {String} productId - Product ID\n */\nfunction changePageLocationAddress(productId) {\n var newSearchStr = '?' + window.location.search.substr(1).split('&').map((item) => {\n if(item.indexOf(productId) === -1) {\n return item;\n };\n }).filter(item => item !== undefined).join('&');\n\n location.href = (location.origin + location.pathname + newSearchStr);\n}\n\n/**\n * Mowing table after swiping on mobile\n * @param {Object} $this - Table row with product tiles\n * @param {Number} clientSwipeStart - swiping start position\n * @param {Number} clientSwipeEnd - swiping finish position\n */\nfunction swipeTranslateTable($this, clientSwipeStart, clientSwipeEnd) {\n \n var containerWidth = parseInt($this.width());\n var tilesLength = $('.js-compare-product-cell').length;\n var step = parseInt($this.data('step'));\n \n var swipingPercentageStep = 100 / tilesLength;\n var tileWidth = containerWidth / tilesLength;\n var swipingLength = tileWidth - (tileWidth * 0.3); \n var translateValue;\n\n if (clientSwipeEnd > clientSwipeStart && \n Math.abs(clientSwipeEnd - clientSwipeStart) > swipingLength) \n {\n step > 0 ? step-- : step;\n translateValue = swipingPercentageStep * step; \n } else if (clientSwipeEnd < clientSwipeStart && \n Math.abs(clientSwipeEnd - clientSwipeStart) > swipingLength) \n {\n step < (tilesLength - tilesOnPage) ? step++ : step;\n translateValue = swipingPercentageStep * step; \n }\n\n $this.data('step', step);\n checkBorder();\n function checkBorder() {\n $('.js-compare-table-row').css('transform', 'translateX(-'+ (translateValue) +'%)');\n \n $('.js-compare-table-row .js-compare-table-cell:not(\".js-compare-product-cell\")').eq(2).css('border-right', 'none');\n $('.js-compare-table-row .js-compare-table-cell:not(\".js-compare-product-cell\")').eq(3).css('border-left', '1px solid #979797');\n if (step === 0) {\n $('.js-compare-table-row .js-compare-table-cell:not(\".js-compare-product-cell\")').eq(1).css('border-right', '1px solid #979797');\n }\n if (step === 1) {\n $('.js-compare-table-row .js-compare-table-cell:not(\".js-compare-product-cell\")').eq(1).css('border-right', 'none');\n }\n if (step === 2) {\n $('.js-compare-table-row .js-compare-table-cell:not(\".js-compare-product-cell\")').eq(1).css('border-right', '1px solid #979797');\n }\n }\n toggleArrows(tilesLength, step, tilesOnPage)\n}\n\n/**\n * Creating object with data for compare product\n * @param {Object} $this - jQuery checkbox object\n * @param {boolean} checked - checked flag\n */\nfunction createCompareProductObj($this, checked) {\n var pid = $this.attr('id');\n\n if (imgSrc === undefined) {\n var imgSrc = $this.closest('.modal-content').find('.placeholder .placeholder').prop('src');\n var productName = $this.closest('.modal').parent().find('.js-product-tile-name').html();\n var familyName = $this.closest('.modal').parent().find('.js-product-tile-family-name').html();\n var price = $this.closest('.modal').parent().find('.js-product-tile-price').html();\n } else {\n var imgSrc = $this.closest('.js-product-tile').find('.tile-image').prop('src');\n var productName = $this.closest('.js-product-tile').find('.js-product-tile-name').html();\n var familyName = $this.closest('.js-product-tile').find('.js-product-tile-family-name').html();\n var price = $this.closest('.js-product-tile').find('.js-product-tile-price').html();\n }\n //check if back button has already activated the tray\n if ($('.compare-bar-wrapper').css('display') === 'block'){\n var executed = true;\n } else {\n var executed = false;\n }\n\n var url = $this.parent().data('href');\n if (location.hash && !executed) {\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n success:function (data) {\n imgSrc = data.product.images.small[0].absURL;\n productName = data.product.productName;\n familyName = data.product.familyName;\n if(data.product.price.list !== null) {\n price = data.product.price.list\n } else {\n price = data.product.price.sales.formatted\n }\n if (checked) {\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc, productName, familyName, price);\n $this.trigger('compare:selected', { pid: pid });\n } else {\n productsForComparison = deselectProduct(productsForComparison, pid);\n $this.trigger('compare:deselected', { pid: pid });\n }\n }\n });\n } else {\n if (checked) {\n if (imgSrc === undefined) {\n imgSrc = $this.closest('.modal-content').find('img:nth-of-type(1)').prop('src');\n \n productName = $this.closest('.js-product-tile').find('.js-product-tile-name').html();\n familyName = $this.closest('.js-product-tile').find('.js-product-tile-family-name').html();\n price = $this.closest('.js-product-tile').find('.js-product-tile-price').html();\n if (imgSrc === undefined) {\n imgSrc = $this.closest('.js-product-tile').find('.tile-image').prop('src');\n }\n } else {\n if ($('.carousel').hasClass('slick-initialized')) {\n imgSrc = $this.closest('.modal-content').find('img:nth-of-type(1)').prop('src');\n } else {\n imgSrc = $this.closest('.modal-content').find('.placeholder .placeholder').prop('src');\n }\n }\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc, productName, familyName, price);\n $this.trigger('compare:selected', { pid: pid });\n } else {\n productsForComparison = deselectProduct(productsForComparison, pid);\n $this.trigger('compare:deselected', { pid: pid });\n }\n }\n}\n// Compare page sticky element tricks\n// get the sticky element\nif ($('.sticky-top').length > 0){\n const stickyDiv = document.querySelector('.sticky-top');\n const stickyDivScrollableParent = getScrollParent(stickyDiv);\n setStickyTopLocation(stickyDiv);\n // stickiness has begun.\n stickyDiv._originalOffsetTop = stickyDiv.offsetTop;\n // compare scrollTop\n const detectStickiness = (theElement, cb) => () => cb & cb(theElement.offsetTop != theElement._originalOffsetTop)\n\n const onSticky = isSticky => {\n stickyDiv.classList.toggle('isSticky', isSticky)\n }\n\n const scrollCallback = throttle(detectStickiness(stickyDiv, onSticky), 100);\n stickyDivScrollableParent.addEventListener('scroll', scrollCallback);\n window.addEventListener('resize', function(event) { \n setStickyTopLocation(stickyDiv); \n }, true);\n}\n\nfunction getScrollParent(element, includeHidden) {\n var style = getComputedStyle(element),\n excludeStaticParent = style.position === \"absolute\",\n overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;\n\n if (style.position !== \"fixed\") \n for (var parent = element; (parent = parent.parentElement); ){\n style = getComputedStyle(parent);\n if (excludeStaticParent && style.position === \"static\") \n continue;\n if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) \n return parent;\n }\n\n return window\n}\nfunction setStickyTopLocation(element){\n const pencilBanner = document.querySelector('.header-banner');\n const mainHeader = document.getElementById('header-main');\n element.style.top = pencilBanner.offsetHeight + mainHeader.offsetHeight + \"px\";\n}\n// Throttle to prevent frequent invocations\nfunction throttle (callback, limit) {\n var wait = false; \n return function () { \n if (!wait) { \n callback.call(); \n wait = true; \n setTimeout(function () { \n wait = false; \n }, limit);\n }\n }\n}\n\n/**\n * retrieve and create array of all product attributes to compare\n * @param {string} specCategory - compare category object name\n */\nfunction getComponents(specCategory){\n var components = {}\n productsArr.forEach((product, productIndex) => {\n [specCategory].forEach(specType => {\n for (var key in product[specType]) {\n \n if (!components[key]) {\n components[key] = {\n name: product[specType][key].name,\n specs: Array(productsArr.length).fill(null)\n };\n }\n if (product[specType][key].specs === 'N/A'){\n components[key].specs[productIndex] = { displayValue: product[specType][key].name, value: '-', id: product.id};\n } else if (product[specType][key].specs){\n components[key].specs[productIndex] = { displayValue: product[specType][key].name, value: product[specType][key].specs, id: product.id };\n \n } else {\n components[key].specs[productIndex] = { displayValue: product[specType][key].name, value: '-', id: product.id };\n }\n }\n });\n \n });\n return components;\n}\n\n/**\n * Adds compare table for each section\n * @param {Object} specComponents - object attribute compare category\n * @param {string} specCategory - compare group title\n * @param {string} specSectionID - compare group element id\n */\n\nfunction addCompareSpecs(specComponents, specCategory, specSectionID){\n var tableContainer = document.getElementById('comparisonTable');\n var specsLength = Object.keys(specComponents).length;\n var viewMoreHTML = '
';\n viewMoreHTML += '
';\n\n var index = 0;\n if (specsLength > 0){\n \n for (var component in specComponents) {\n \n var allNA = specComponents[component].specs.every(spec => spec.value === '-');\n specsLength--;\n if (!allNA) {\n \n if (index == 0){\n var headerRow = document.createElement('div');\n headerRow.className = 'compare-table__charact-header';\n\n var div = document.createElement('h3');\n div.className = 'compare-table__heading';\n div.textContent = specCategory;\n headerRow.appendChild(div);\n\n tableContainer.appendChild(headerRow);\n\n var bodyRow = document.createElement('div');\n bodyRow.className = 'compare-table__body';\n bodyRow.id = specSectionID;\n tableContainer.appendChild(bodyRow);\n \n // Build the rows dynamically\n }\n \n var row = document.createElement('div');\n row.className = 'compare-table__row';\n\n var rowHeading = document.createElement('div');\n rowHeading.className = 'compare-table__cell compare-table__cell-heading';\n rowHeading.textContent = specComponents[component].name\n row.appendChild(rowHeading);\n \n document.getElementById(specSectionID).appendChild(row);\n\n var rowAttributes = document.createElement('div');\n rowAttributes.className = 'compare-table__row js-compare-table-row';\n \n specComponents[component].specs.forEach(spec => {\n \n var cellBlankHeader = document.createElement('div');\n cellBlankHeader.className = 'compare-table__cell compare-table__cell-heading js-compare-table-cell';\n cellBlankHeader.dataset.id = spec.id;\n cellBlankHeader.textContent = '';\n row.appendChild(cellBlankHeader);\n\n var cellValue = document.createElement('div');\n cellValue.className = 'compare-table__cell js-compare-table-cell';\n cellValue.innerHTML = spec.value;\n cellValue.dataset.id = spec.id;\n cellValue.dataset.compare = spec.value;\n rowAttributes.appendChild(cellValue);\n });\n\n if (index == 5){\n var hiddenRow = document.createElement('div');\n hiddenRow.className = 'hidden-rows js-hidden-rows ' + specSectionID+\"-attributes\";\n document.getElementById(specSectionID).appendChild(hiddenRow);\n hiddenRow.appendChild(row);\n hiddenRow.appendChild(rowAttributes);\n \n } else if (index >= 6){\n hiddenRow.appendChild(row);\n hiddenRow.appendChild(rowAttributes);\n \n } else{\n document.getElementById(specSectionID).appendChild(row);\n document.getElementById(specSectionID).appendChild(rowAttributes);\n }\n \n index++;\n }\n if (index >= 6 && specsLength == 0){\n // document.getElementById(specSectionID).append += viewMoreHTML;\n document.getElementById(specSectionID).insertAdjacentHTML(\n 'beforeend',\n viewMoreHTML,\n );\n }\n }\n }\n}\nfunction updateEditLink(){\n let editSelection = document.querySelector('a.compare-page__back');\n const urlObj = new URL(location);\n // Get the search parameters\n const searchParams = new URLSearchParams(urlObj.search);\n\n // Filter and map the parameters that start with 'pid'\n const pidValues = Array.from(searchParams.entries())\n .filter(([key]) => key.startsWith('pid'))\n .map(([, value]) => value);\n\n if (editSelection) {\n editSelection.href += \"#\"+ pidValues.join(',');\n }\n}\nCompare.createCompareTable = function (){\n if ( $('#comparisonTable').length >0 ) {\n var keyComponents = getComponents('keySpecs');\n var genComponents = getComponents('genSpecs');\n addCompareSpecs(keyComponents, 'Key Specs', 'keySection');\n addCompareSpecs(genComponents, 'General Specs', 'genSection');\n // Compare.showDifferentCharacteristic();\n updateEditLink();\n }\n}\nCompare.quantityOfProductItems = function () {\n var tilesLength = $('.js-compare-product-cell').length;\n $('.js-compare-table, .js-compare-tile').addClass('m-width-'+tilesLength);\n if (tilesLength < 3) {\n $('.js-compare-btn-container').hide();\n }\n}\n\nCompare.touchSwipe = function () {\n var clientSwipeEnd = 0;\n var clientSwipeStart = 0;\n\n $('.js-compare-tile').on('touchstart', function(e) {\n clientSwipeStart = parseInt(e.targetTouches[0].pageX.toFixed(0));\n clientSwipeEnd = parseInt(e.targetTouches[0].pageX.toFixed(0));\n });\n $('.js-compare-tile').on('touchmove', function(e) {\n clientSwipeEnd = parseInt(e.targetTouches[0].pageX.toFixed(0));\n timer = setTimeout(function () {\n clientSwipeStart = parseInt(e.targetTouches[0].pageX.toFixed(0));\n }, 500);\n });\n $('.js-compare-tile').on('touchend', function(e) {\n clearTimeout(timer);\n var $this = $(this);\n swipeTranslateTable($this, clientSwipeStart, clientSwipeEnd);\n });\n}\n\nCompare.showDifferentCharacteristic = function () {\n var $tableRows = $('.js-compare-table-row');\n var dataArray = [];\n\n $tableRows.each(function (index, tableRow) {\n dataArray = [];\n $(tableRow).find('.js-compare-table-cell:not(.js-compare-product-cell)').map(function(ind,item) {\n dataArray.push($(item).data('compare'));\n return true;\n });\n\n const isSame = (dataArray) => dataArray.every(item => item === dataArray[0]);\n\n // Check if all items are the same\n // const result = areItemsSame(array);\n\n $(tableRow).removeClass('m-common-characteristic');\n\n if (dataArray.length > 0) {\n if(isSame(dataArray)) $(tableRow).addClass('m-common-characteristic');\n }\n }); \n};\n\nCompare.toggleHighlightCompare = function () {\n $('.js-compare-toggler').on('change', function () {\n var $table = $('.js-compare-table');\n var isEnabled = $(this).prop('checked');\n if (isEnabled) {\n $table.addClass('m-highlight-compare');\n } else {\n $table.removeClass('m-highlight-compare');\n }\n Compare.showDifferentCharacteristic();\n });\n};\n\nCompare.removeComparedProduct = function () {\n $('.js-compare-remove').on('click', function () {\n var $product = $('.js-compare-product-cell');\n var productId = $(this).data('id');\n\n if ($product.length === 1) {\n $('.js-compare-table-cell').remove();\n } else {\n $('.js-compare-table-heading[data-id=\"' + (productId) + '\"]').remove();\n $('.js-compare-table-cell[data-id=\"' + productId + '\"]').remove();\n }\n $('.js-product-counter').html($product.length - 1);\n changePageLocationAddress(productId);\n Compare.quantityOfProductItems();\n Compare.showDifferentCharacteristic();\n });\n};\n\nCompare.toggleCharacteristics = function () {\n $('#keySection .js-view-more').on('click', function () {\n if ($(this).is('.m-active')) {\n $('.keySection-attributes.js-hidden-rows').slideUp();\n $(this).removeClass('m-active');\n } else {\n $('.keySection-attributes.js-hidden-rows').slideDown();\n $(this).addClass('m-active');\n }\n });\n $('#genSection .js-view-more').on('click', function () {\n if ($(this).is('.m-active')) {\n $('.genSection-Section-attributes.js-hidden-rows').slideUp();\n $(this).removeClass('m-active');\n } else {\n $('.genSection-attributes.js-hidden-rows').slideDown();\n $(this).addClass('m-active');\n }\n });\n};\n\nCompare.moveCompareTable = function () {\n $('.js-compare-arrow').on('click', function () {\n var $this = $(this);\n var step = parseInt($this.closest('.js-compare-tile').data('step'));\n var productLength = $('.js-compare-product-cell').length;\n var $tableRows = $('.js-compare-table-row');\n\n if ($this.is('.m-next') && step < (productLength - tilesOnPage)) {\n step++;\n moveTableRow($this, $tableRows, step);\n } else if ($this.is('.m-prev') && step > 0) {\n step--;\n moveTableRow($this, $tableRows, step);\n }\n toggleArrows(productLength, step, tilesOnPage);\n });\n};\n\nCompare.selectCheckedProducts = function () {\n $('.product-grid').ready(function () {\n if (location.hash) {\n location.hash.replace('#', '').split(',').forEach(function (id) {\n if($('input#' + id).length) {\n $('input#' + id).prop('checked', 'checked');\n } else {\n $('input.js-compare-checkbox').each(function (){\n // if ($('input[data-variants*=\"' + id +'\"]')){\n if ($(this).is('[data-variants*=\"' + id +'\"]')){\n var uselessId = $(this).attr('id');\n var currTileUrl = $(this).parent().attr('href');\n var updateCurrUrl = currTileUrl.replace(uselessId, id);\n $(this).parent().attr('href', updateCurrUrl);\n $(this).parent().attr('data-href', updateCurrUrl);\n $(this).attr('id', id);\n $('input#' + id).parent().find('.js-compare-modal-btn').attr('id', id).prop('checked', 'checked');\n // $('input#' + id).prop('checked', 'checked');\n }\n });\n }\n });\n }\n $('.compare input:checked').each(function () {\n var $this = $(this);\n var checked = true;\n createCompareProductObj($this, checked);\n });\n });\n};\n\nCompare.handleCompareClick = function () {\n $('div.page').on('change', '.compare input[type=checkbox]', function () {\n var $this = $(this);\n var checked = $(this).is(':checked');\n createCompareProductObj($this, checked);\n });\n};\n\nCompare.handleClearAll = function () {\n $('.compare-bar a.clear-all').on('click', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n};\n\nCompare.catchFilterChange = function () {\n $('.container').on('click', '.refinements li:not(.js-cat-li) a, .refinement-bar a.reset', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n};\n\nCompare.deselectProductOnCompareBar = function () {\n $('.compare-bar').on('click', '.close', function () {\n var pid = $(this).closest('.slot').data('pid').toString();\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n });\n};\n\nmodule.exports = Compare;\n","'use strict';\n\n/**\n * appends params to a url\n * @param {string} data - data returned from the server's ajax call\n * @param {Object} icon - icon that was clicked to add a product to the wishlist\n */\nfunction displayMessageAndChangeIcon(data, icon) {\n $.spinner().stop();\n var status;\n if (data.success) {\n status = 'success';\n\n if (icon.is('#checkbox-wishlist')) {\n if (!icon.is('[checked]')) {\n icon.prop('checked', true);\n }\n } else {\n if (icon.hasClass('fa-heart-o')) {\n icon.removeClass('fa-heart-o').addClass('fa-heart');\n }\n }\n } else {\n status = 'danger';\n }\n\n if ($('.add-to-wishlist-messages').length === 0) {\n $('body').append(\n '
'\n );\n }\n $('.add-to-wishlist-messages')\n .append('
'\n + ''\n + data.msg\n + ''\n + '
');\n\n setTimeout(function () {\n $('.add-to-wishlist-messages').remove();\n }, 5000);\n}\n\nmodule.exports = {\n addToWishlist: function () {\n $('body').on('click', '.wishlistTile', function (e) {\n e.preventDefault();\n var icon = $(this).find($('i')).length ? $(this).find($('i')) : $(this).find($('#checkbox-wishlist'));\n var url = $(this).attr('href');\n var pid = $(this).closest('.product').data('pid');\n var optionId = $(this).closest('.product-detail').find('.product-option').attr('data-option-id');\n var optionVal = $(this).closest('.product-detail').find('.options-select option:selected').attr('data-value-id');\n optionId = optionId || null;\n optionVal = optionVal || null;\n if (!url || !pid) {\n return;\n }\n\n $.spinner().start();\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: {\n pid: pid,\n optionId: optionId,\n optionVal: optionVal\n },\n success: function (data) {\n displayMessageAndChangeIcon(data, icon);\n },\n error: function (err) {\n displayMessageAndChangeIcon(err, icon);\n }\n });\n });\n }\n};\n","'use strict';\n\nvar processInclude = require('base/util');\n\n$(document).ready(function () {\n processInclude(require('./search/search'));\n processInclude(require('./product/wishlistHeart'));\n processInclude(require('./product/compare'));\n});\n","'use strict';\n\nvar Search = require('core/search/search');\nvar commonHelper = require('../helpers/common');\n\nvar isMobile;\n\n/**\n * Update DOM elements with Ajax results\n *\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n $(selector).empty().html($updates.html());\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n var activeDiv = $results.find('.' + $(this)[0].className.replace(/ /g, '.'));\n activeDiv.addClass('active');\n activeDiv.find('button.title').attr('aria-expanded', 'true');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\n function parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements\n };\n\n // Update DOM elements that do not require special handling\n [\n '.grid-sort',\n '.mobile-sort-trigger',\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar',\n '.secondary-bar .result-count',\n '.js-canonical-url'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * Set Variable for Mobile logic\n */\nfunction checkBreakpoint() {\n if (window.matchMedia('(max-width: 62em)').matches) {\n isMobile = true;\n } else {\n isMobile = false;\n }\n}\n\n/**\n * Align tile elements\n */\nfunction syncTiles() {\n var $productTile = $('.product-grid .product');\n\n if ($productTile.length === 0) { return; }\n\n var tilesPerRow = 2;\n var totalTiles = $productTile.length;\n var totalRows = Math.ceil(totalTiles / tilesPerRow);\n var tileCount = 1;\n var rowCount = 1;\n var rowNum = 1;\n\n // Redefine variable for desktop\n if (window.matchMedia('(min-width: 544px)').matches) {\n tilesPerRow = 3;\n }\n\n // Add same class to all tiles in a row\n $productTile.each(function () {\n // Add row data attribute to each tile per row\n $(this).attr('data-row', 'row' + rowNum);\n\n if (tileCount % tilesPerRow === 0) { // check if a new row is starting\n rowNum++; // increase row number\n }\n tileCount++; // increase tile count\n });\n\n while (rowCount <= totalRows) {\n $('.product-grid .product[data-row=\"row' + rowCount + '\"]').find('.product-tile__family-name').matchHeight();\n $('.product-grid .product[data-row=\"row' + rowCount + '\"]').find('.product-tile__main').matchHeight();\n // $('.product-grid .product[data-row=\"row' + rowCount + '\"]').find('.product-tile__name').matchHeight();\n // $('.product-grid .product[data-row=\"row' + rowCount + '\"]').find('.tile-body').matchHeight();\n // $('.product-grid .product[data-row=\"row' + rowCount + '\"]').matchHeight();\n rowCount++;\n }\n}\n\n/**\n * Dismiss Refinement pane\n */\nfunction dismissRefinements() {\n $('body').removeClass('filter-active');\n $('.refinement-bar').removeClass('show').addClass('hidden');\n $('.grid-wrapper').parents('.grid-main').removeClass('refinements-active');\n $('.modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n $('.btn.filter-results').focus();\n $('.grid-header .hide-filters').hide();\n $('.grid-header .show-filters').show();\n}\n\n/**\n * Open Refinement pane\n */\nfunction openRefinements() {\n $('body').addClass('filter-active');\n $('.refinement-bar').removeClass('hidden').addClass('show');\n $('.grid-wrapper').parents('.grid-main').addClass('refinements-active');\n if (isMobile) {\n $('.modal-background').show();\n }\n $('.refinement-bar').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', true);\n $('.refinement-bar .close').focus();\n $('.grid-header .show-filters').hide();\n $('.grid-header .hide-filters').show();\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\n function updateSortOptions(response) {\n var $tempDom = $('
').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n}\n\n/**\n * Opening refinements block with active filters\n */\nfunction openRefinementsBlocks() {\n var refinementsElements = $('.refinements .checkbox-selector, .refinements .custom-control-input, .refinements .radio-selector');\n $.each(refinementsElements, function () {\n var $el = $(this);\n var isActive = $el.is('.selected');\n\n if (isActive) {\n $el.closest('.collapse').collapse('show');\n }\n });\n}\n\nSearch.initHistory = function () {\n let previousHistoryState;\n let doNotPushHistory = false;\n\n /**\n * Listen to all possible AJAX calls on a search page (Filters, sorting, show more, ...).\n */\n $(document).ajaxSuccess(\n function (event, xhr) {\n // Make the assumption that the existence of data attribute means being present in the response means a grid-refresh\n if (xhr.responseText.indexOf('data-titlereturn=\"true\"') >= 0) {\n if (!doNotPushHistory) {\n setTimeout(function () {\n history.pushState({ reapplyFilters: true }, document.title, decodeURI($('.permalink').val()));\n });\n }\n\n doNotPushHistory = false;\n }\n }\n );\n\n /**\n * Listen to the back and forward button of the browser to detect URL changes.\n */\n window.addEventListener('popstate', () => {\n if ((history.state && history.state.reapplyFilters)\n || (previousHistoryState && previousHistoryState.reapplyFilters)) {\n const $resetButton = $('.refinement-bar button.reset');\n\n previousHistoryState = history.state;\n\n // This async call should not cause a new history state to be pushed.\n doNotPushHistory = true;\n\n // Use the reset button listeners to do a refresh\n $resetButton.data('href', decodeURI(window.location.href));\n $resetButton.trigger('click');\n }\n });\n};\n\nSearch.init = function () {\n if (!isMobile && $('.grid-main').hasClass('has-refinements')) {\n if (!$('.refinement-bar').hasClass('show')) {\n openRefinements();\n }\n }\n syncTiles();\n};\n\n// remove old filter function to remove event delegation\ndelete Search.filter;\n\nSearch.filter = function () {\n $('.refinement-bar').on(\"animationend\", function () {\n syncTiles();\n });\n // Display refinements bar when Menu icon clicked\n $('.grid-header').on('click', 'button.filter-results', function () {\n if ($('.refinement-bar').hasClass('show')) {\n dismissRefinements();\n } else {\n openRefinements();\n }\n });\n};\n\nSearch.sort = function () {\n // Handle sort order menu selection\n $('.container').on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:sort', this.value);\n $.ajax({\n url: this.value,\n data: { selectedUrl: this.value },\n method: 'GET',\n success: function (response) {\n $('.product-grid').empty().html(response);\n syncTiles();\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n\n $('.mobile-sort-trigger .sort-by-label').on('click', function () {\n $('.grid-sort').toggleClass('js-show');\n });\n};\n\nSearch.closeRefinements = function () {\n // Refinements close button\n $('.container').on('click', '.refinement-bar button.close, .modal-background, .refinements-footer .apply-filters', function () {\n dismissRefinements();\n syncTiles();\n });\n};\n\nSearch.mobileResetRefinements = function () {\n $('.refinements-footer').on('click', '.reset-filters', function () {\n if (isMobile) {\n $('.refinement-bar button.reset').trigger('click');\n dismissRefinements();\n syncTiles();\n }\n });\n};\n\nSearch.resize = function () {\n checkBreakpoint();\n var currBreakpoint = isMobile ? 'mobile' : 'desktop';\n\n // Close refinement bar and hide modal background if user resizes browser\n $(window).smartresize(function () {\n checkBreakpoint();\n var newBreakpoint = isMobile ? 'mobile' : 'desktop';\n\n if (newBreakpoint === 'desktop') {\n $('.modal-background').hide();\n }\n\n if (newBreakpoint !== currBreakpoint) {\n currBreakpoint = newBreakpoint;\n\n if(newBreakpoint !== 'desktop') {\n dismissRefinements();\n } else {\n openRefinements();\n }\n }\n syncTiles();\n });\n};\n\nSearch.applyFilter = function () {\n // Handle refinement value selection and reset click\n $('.container').on(\n 'click',\n '.refinements li button, .refinement-bar button.reset, .filter-value button, .swatch-filter button',\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $.spinner().start();\n $(this).trigger('search:filter', e);\n $.ajax({\n url: $(this).data('href'),\n data: {\n page: $('.grid-footer').data('page-number'),\n selectedUrl: $(this).data('href')\n },\n method: 'GET',\n success: function (response) {\n parseResults(response);\n openRefinementsBlocks();\n\n var canonical = $('.js-canonical-url').html().replace(/&/g, '&');\n $('link[rel=\"canonical\"]').attr('href', canonical);\n commonHelper.updateCanonicalURL($('.js-canonical-url'));\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n};\n\nSearch.showMore = function () {\n // Show more products\n $('.container').on('click', '.show-more button', function (e) {\n e.stopPropagation();\n var showMoreUrl = $(this).data('url');\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:showMore', e);\n $.ajax({\n url: showMoreUrl,\n data: { selectedUrl: showMoreUrl },\n method: 'GET',\n success: function (response) {\n $('.grid-footer').replaceWith(response);\n updateSortOptions(response);\n commonHelper.updateCanonicalURL($('.js-canonical-url').last());\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n};\n\nmodule.exports = Search;\n","'use strict';\n\n/**\n * Update DOM elements with Ajax results\n *\n * @param {Object} $results - jQuery DOM element\n * @param {string} selector - DOM element to look up in the $results\n * @return {undefined}\n */\nfunction updateDom($results, selector) {\n var $updates = $results.find(selector);\n $(selector).empty().html($updates.html());\n}\n\n/**\n * Keep refinement panes expanded/collapsed after Ajax refresh\n *\n * @param {Object} $results - jQuery DOM element\n * @return {undefined}\n */\nfunction handleRefinements($results) {\n $('.refinement.active').each(function () {\n $(this).removeClass('active');\n var activeDiv = $results.find('.' + $(this)[0].className.replace(/ /g, '.'));\n activeDiv.addClass('active');\n activeDiv.find('button.title').attr('aria-expanded', 'true');\n });\n\n updateDom($results, '.refinements');\n}\n\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction parseResults(response) {\n var $results = $(response);\n var specialHandlers = {\n '.refinements': handleRefinements\n };\n\n // Update DOM elements that do not require special handling\n [\n '.grid-header',\n '.header-bar',\n '.header.page-title',\n '.product-grid',\n '.show-more',\n '.filter-bar'\n ].forEach(function (selector) {\n updateDom($results, selector);\n });\n\n Object.keys(specialHandlers).forEach(function (selector) {\n specialHandlers[selector]($results);\n });\n}\n\n/**\n * This function retrieves another page of content to display in the content search grid\n * @param {JQuery} $element - the jquery element that has the click event attached\n * @param {JQuery} $target - the jquery element that will receive the response\n * @return {undefined}\n */\nfunction getContent($element, $target) {\n var showMoreUrl = $element.data('url');\n $.spinner().start();\n $.ajax({\n url: showMoreUrl,\n method: 'GET',\n success: function (response) {\n $target.append(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n}\n\n/**\n * Update sort option URLs from Ajax response\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateSortOptions(response) {\n var $tempDom = $('
').append($(response));\n var sortOptions = $tempDom.find('.grid-footer').data('sort-options').options;\n sortOptions.forEach(function (option) {\n $('option.' + option.id).val(option.url);\n });\n}\n\nmodule.exports = {\n filter: function () {\n // Display refinements bar when Menu icon clicked\n $('.container').on('click', 'button.filter-results', function () {\n $('.refinement-bar, .modal-background').show();\n $('.refinement-bar').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', true);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', true);\n $('.refinement-bar .close').focus();\n });\n },\n\n closeRefinements: function () {\n // Refinements close button\n $('.container').on('click', '.refinement-bar button.close, .modal-background', function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n $('.btn.filter-results').focus();\n });\n },\n\n resize: function () {\n // Close refinement bar and hide modal background if user resizes browser\n $(window).resize(function () {\n $('.refinement-bar, .modal-background').hide();\n $('.refinement-bar').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.row').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.tab-pane.active').siblings().attr('aria-hidden', false);\n $('.refinement-bar').closest('.container.search-results').siblings().attr('aria-hidden', false);\n });\n },\n\n sort: function () {\n // Handle sort order menu selection\n $('.container').on('change', '[name=sort-order]', function (e) {\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:sort', this.value);\n $.ajax({\n url: this.value,\n data: { selectedUrl: this.value },\n method: 'GET',\n success: function (response) {\n $('.product-grid').empty().html(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n showMore: function () {\n // Show more products\n $('.container').on('click', '.show-more button', function (e) {\n e.stopPropagation();\n var showMoreUrl = $(this).data('url');\n e.preventDefault();\n\n $.spinner().start();\n $(this).trigger('search:showMore', e);\n $.ajax({\n url: showMoreUrl,\n data: { selectedUrl: showMoreUrl },\n method: 'GET',\n success: function (response) {\n $('.grid-footer').replaceWith(response);\n updateSortOptions(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n applyFilter: function () {\n // Handle refinement value selection and reset click\n $('.container').on(\n 'click',\n '.refinements li button, .refinement-bar button.reset, .filter-value button, .swatch-filter button',\n function (e) {\n e.preventDefault();\n e.stopPropagation();\n\n $.spinner().start();\n $(this).trigger('search:filter', e);\n $.ajax({\n url: $(this).data('href'),\n data: {\n page: $('.grid-footer').data('page-number'),\n selectedUrl: $(this).data('href')\n },\n method: 'GET',\n success: function (response) {\n parseResults(response);\n $.spinner().stop();\n },\n error: function () {\n $.spinner().stop();\n }\n });\n });\n },\n\n showContentTab: function () {\n // Display content results from the search\n $('.container').on('click', '.content-search', function () {\n if ($('#content-search-results').html() === '') {\n getContent($(this), $('#content-search-results'));\n }\n });\n\n // Display the next page of content results from the search\n $('.container').on('click', '.show-more-content button', function () {\n getContent($(this), $('#content-search-results'));\n $('.show-more-content').remove();\n });\n }\n};\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n};\n","'use strict';\n\nvar $compareBar = $('.compare-bar-wrapper');\nvar maxSlots = parseInt($('.compare-bar').data('max-slots'), 10);\nvar productsForComparison = [];\nvar compareButtonText = $('button.compare').text();\n\nvar lastKnownUrl = location.href;\n\n\n/**\n * @typedef ProductComparisonList\n * @type Object\n * @property {string} pid - ID for product to compare\n * @property {string} imgSrc - Image URL for selected product\n */\n\n/**\n * Compiles the HTML for a single slot\n *\n * @param {ProductComparisonList} product - Selected product to compare\n * @param {number} idx - Slot number (zero-based)\n * @return {string} - HTML for a single slot\n */\nfunction compileSlot(product, idx) {\n var pid = product.pid;\n var name = 'pid' + idx;\n\n return '' +\n '
' +\n '
' +\n '' +\n '
' +\n '' +\n '
' +\n '
' +\n '' +\n '
\\n';\n}\n\n/**\n * Draw and render the Compare Bar product slots\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n */\nfunction redrawCompareSlots(productsToCompare) {\n var html = productsToCompare.map(function (product, idx) {\n return compileSlot(product, idx);\n }).join('');\n\n // Render empty slots\n if (productsToCompare.length < maxSlots) {\n var numAvailableSlots = maxSlots - productsToCompare.length;\n\n for (var i = 0; i < numAvailableSlots; i++) {\n if (i === 0 && productsToCompare.length < 2) {\n html += '
' +\n '
' + $('.compare-bar').data('min-products-msg') +\n '
';\n } else {\n html += '
';\n }\n }\n }\n\n $('.compare-bar .product-slots').empty().append(html);\n}\n\n/**\n * Enables/disables the Compare button, depending on whether at least two products have been\n * selected for comparison\n *\n * @param {number} numProducts - Number of products selected for comparison\n */\nfunction setCompareButton(numProducts) {\n if (numProducts > 0) {\n $('button.compare').text(compareButtonText + '(' + numProducts + ')');\n } else {\n $('button.compare').text(compareButtonText);\n }\n if (numProducts < 2) {\n $('button.compare').attr('disabled', true);\n } else {\n $('button.compare').removeAttr('disabled');\n }\n}\n\n/**\n * Returns a copy of a list of products to compare\n *\n * @param {ProductComparisonList []} productsToCompare - List of ID's of the products to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction copyProducts(productsToCompare) {\n return productsToCompare.map(function (product) {\n var proxy = {};\n\n Object.keys(product).forEach(function (key) {\n proxy[key] = product[key];\n });\n\n return proxy;\n });\n}\n\n/**\n * Handles the selection of a product for comparison\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @param {string} imgSrc - Image URL for selected product\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction selectProduct(products, pid, imgSrc) {\n var productsToCompare = copyProducts(products) || [];\n\n if (productsToCompare.length < maxSlots) {\n productsToCompare.push({\n pid: pid,\n imgSrc: imgSrc\n });\n\n if (productsToCompare.length === maxSlots) {\n $('input[type=checkbox]:not(:checked)').attr('disabled', true);\n }\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n $compareBar.show();\n }\n\n return productsToCompare;\n}\n\n/**\n * Handles the deselection of a product\n *\n * @param {ProductComparisonList []} products - List of ID's of the products to compare\n * @param {string} pid - ID for product to compare\n * @return {ProductComparisonList []} List of ID's of the products to compare\n */\nfunction deselectProduct(products, pid) {\n var productsToCompare = copyProducts(products) || [];\n\n productsToCompare = productsToCompare.filter(function (product) {\n return product.pid !== pid;\n });\n\n if (productsToCompare.length === 0) {\n $compareBar.hide();\n }\n\n $('input#' + pid).prop('checked', false);\n $('input[type=checkbox]:not(:checked)').removeAttr('disabled');\n\n redrawCompareSlots(productsToCompare);\n setCompareButton(productsToCompare.length);\n return productsToCompare;\n}\n\n/**\n * Clears the Compare Bar and hides it\n * @return {undefined}\n */\nfunction clearCompareBar() {\n productsForComparison.forEach(function (product) {\n $(this).trigger('compare:deselected', { pid: product.pid });\n });\n\n productsForComparison = [];\n $('.compare input').prop('checked', false);\n $('.compare input[type=checkbox]:not(:checked)').removeAttr('disabled');\n $compareBar.hide();\n}\n\n/**\n * Update form action url to not have query string\n * @returns {undefined}\n */\nfunction updateSubmitUrl() {\n var form = $('.compare-products-form');\n var targetUrl = form.attr('action');\n var urlParts = targetUrl.split('?');\n if (urlParts[1]) {\n urlParts[1].split('&').forEach(function (keyValue) {\n var splittedValues = keyValue.split('=');\n var key = decodeURIComponent(splittedValues[0]);\n var value = decodeURIComponent(splittedValues[1]);\n if (key && value) {\n if (form.find('[name=\"' + key + '\"]').length === 0) {\n form.append('');\n }\n }\n });\n form.attr('action', urlParts[0]);\n }\n}\n\nmodule.exports = {\n /**\n * Handles Compare checkbox click\n */\n handleCompareClick: function () {\n $('div.page').on('click', '.compare input[type=checkbox]', function () {\n var pid = $(this).attr('id');\n var checked = $(this).is(':checked');\n var imgSrc = $(this).closest('.product-tile')\n .find('.tile-image')\n .prop('src');\n\n if (checked) {\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc);\n $(this).trigger('compare:selected', { pid: pid });\n } else {\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n }\n });\n },\n\n /**\n * Handles the Clear All link\n */\n handleClearAll: function () {\n $('.compare-bar a.clear-all').on('click', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n\n /**\n * Show/Hide Compare bar on PLP\n */\n toggleCompareBar: function () {\n $('.compare-bar-wrapper').on('click', '.toggle-compare', function () {\n $(this).parent('.compare-bar-wrapper').toggleClass('hidden');\n $(this).find('.fa').toggleClass('fa-angle-down fa-angle-up');\n });\n },\n\n /**\n * Handles deselection of a product on the Compare Bar\n */\n deselectProductOnCompareBar: function () {\n $('.compare-bar').on('click', '.close', function () {\n var pid = $(this).closest('.slot').data('pid').toString();\n productsForComparison = deselectProduct(productsForComparison, pid);\n $(this).trigger('compare:deselected', { pid: pid });\n });\n },\n\n /**\n * Selects products for comparison based on the checked status of the Compare checkboxes in\n * each product tile. Used when user goes back from the Compare Products page.\n */\n selectCheckedProducts: function () {\n $('.product-grid').ready(function () {\n if (location.hash) {\n location.hash.replace('#', '').split(',').forEach(function (id) {\n $('input#' + id).prop('checked', 'checked');\n });\n }\n $('.compare input:checked').each(function () {\n var pid = $(this).prop('id');\n var imgSrc = $(this).closest('.product-tile')\n .find('img.tile-image')\n .prop('src');\n productsForComparison = selectProduct(productsForComparison, pid, imgSrc);\n $(this).trigger('compare:selected', { pid: pid });\n });\n });\n },\n\n /**\n * Sets the \"backUrl\" property to the last attribute selected URL to ensure that when the user\n * goes back from the Compare Products page, the previously selected attributes are still\n * selected and applied to the previous search.\n */\n setBackUrl: function () {\n $('.search-results').on('click', '.refinements a', function () {\n $('input[name=\"backUrl\"]').val($(this).prop('href'));\n });\n },\n\n /**\n * Sets the history.pushState for history.back() to work from the Compare Products page.\n */\n setPushState: function () {\n $('.compare-products-form').on('submit', function () {\n updateSubmitUrl();\n var selectedProducts = $('.compare input:checked').map(function () { return this.id; }).get().join(',');\n history.pushState({}, document.title, lastKnownUrl + '#' + selectedProducts);\n location.hash = selectedProducts;\n\n $(this).find('input[name=\"cgid\"]').attr('value', $('input.category-id').val());\n });\n },\n catchFilterChange: function () {\n $('.container').on('click', '.refinements li a, .refinement-bar a.reset', function (e) {\n e.preventDefault();\n clearCompareBar();\n });\n },\n listenToFilterChange: function () {\n $('body').on('search:filter', function (e, data) {\n lastKnownUrl = data.currentTarget.href;\n });\n }\n};\n","/** {@link github:taurgis/plugin_filternavigation} **/\n\nconst Search = require('base/search/search');\n\nSearch.initHistory = function () {\n let previousHistoryState;\n let doNotPushHistory = false;\n\n /**\n * Listen to all possible AJAX calls on a search page (Filters, sorting, show more, ...).\n */\n $(document).ajaxSuccess(\n function (event, xhr) {\n // Make the assumption that a product-tile being present in the response means a grid-refresh\n if (xhr.responseText.indexOf('data-titlereturn=\"true\"') >= 0) {\n if (!doNotPushHistory) {\n setTimeout(function () {\n history.pushState({ reapplyFilters: true }, document.title, decodeURI($('.permalink').val()));\n });\n }\n\n doNotPushHistory = false;\n }\n }\n );\n\n /**\n * Listen to the back and forward button of the browser to detect URL changes.\n */\n window.addEventListener('popstate', () => {\n if ((history.state && history.state.reapplyFilters)\n || (previousHistoryState && previousHistoryState.reapplyFilters)) {\n const $resetButton = $('.refinement-bar button.reset');\n\n previousHistoryState = history.state;\n\n // This async call should not cause a new history state to be pushed.\n doNotPushHistory = true;\n\n // Use the reset button listeners to do a refresh\n $resetButton.data('href', decodeURI(window.location.href));\n $resetButton.trigger('click');\n }\n });\n};\n\nSearch.resetRefinementsBtn = function () {\n\n /**\n * Listen to all possible AJAX calls on a search page (Filters, sorting, show more, ...).\n */\n $(document).ajaxSuccess(\n function (event, xhr) {\n // Make the assumption that if there are values in \".filter-bar\" that there are refinements applied,\n // Of there are, show the reset button, if not hide it\n if ($('.filter-bar .swatch-filter, .filter-bar .filter-value').length > 0) {\n $('.secondary-bar').removeClass('hide').addClass('show');\n } else {\n $('.secondary-bar').removeClass('show').addClass('hide');\n }\n }\n );\n};\n\nmodule.exports = Search;"],"sourceRoot":""}