{"version":3,"file":"default/js/search.js","mappings":";;;;;;;;;AAAA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA,uCAAuC;AACvC;AACA,UAAU;AACV;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;;;;;;;;;;;AClEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA,0CAA0C,SAAS;AACnD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB,cAAc;AACd;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY;AACZ;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;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;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,wBAAwB,0BAA0B;AAClD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,0BAA0B;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,IAAI;;AAE3E;AACA;AACA;AACA,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,0CAA0C,sBAAsB;AAChE,SAAS;;AAET;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB,2BAA2B;AACnD;AACA;AACA;AACA;;AAEA,+CAA+C,oBAAoB;AACnE;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;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;AC7nBa;;AAEb;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClCa;;AAEb,kBAAkB,mBAAO,CAAC,6GAAqB;;AAE/C;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,WAAW,OAAO;AAClB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,sBAAsB;AACpC;;AAEA;AACA;AACA;AACA,WAAW,yBAAyB;AACpC,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,UAAU;AACrB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB,WAAW,UAAU;AACrB,WAAW,UAAU;AACrB,WAAW,SAAS;AACpB;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,MAAM;AACN;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAc,SAAS;AACvB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;;AAEA;AACA;AACA,WAAW,mBAAmB;AAC9B,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA,YAAY,QAAQ;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA,YAAY,QAAQ;AACpB;AACA;AACA;;AAEA;AACA;;AAEA,aAAa;AACb;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAY,UAAU;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,QAAQ;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;;AAEA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,sBAAsB;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;;AAEL;AACA;AACA;AACA;;;;;;;;;;;;ACv1Ba;;AAEb,WAAW,mBAAO,CAAC,4FAAQ;AAC3B,kBAAkB,mBAAO,CAAC,6GAAqB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa,QAAQ;AACrB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;;AAEA;AACA;AACA;AACA,WAAW,QAAQ;AACnB,YAAY,eAAe;AAC3B;AACA;AACA;;AAEA;AACA;;AAEA,aAAa;AACb;;AAEA;AACA;AACA,WAAW,QAAQ;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA,cAAc;AACd;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,6CAA6C,mCAAmC;;AAEhF;AACA,6CAA6C,wCAAwC;;AAErF;AACA;AACA;;AAEA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;AC3Ma;;AAEb;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;UCZA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA,eAAe,4BAA4B;WAC3C,eAAe;WACf,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA,8CAA8C;;;;;WCA9C;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;;;;;;;;;;;;;;;;ACNuC;AACF;AACU;AACK;;AAEpD;AACA,IAAI,gDAAc,CAAC,uDAAM;AACzB,IAAI,gDAAc,CAAC,+DAAS;AAC5B,IAAI,gDAAc,CAAC,+DAAa;;AAEhC;AACA;AACA;AACA;AACA;AACA,CAAC","sources":["webpack://sfra-startup-kit/./cartridges/app_cwf/cartridge/client/default/js/product/wishlistHeart.js","webpack://sfra-startup-kit/./cartridges/app_cwf/cartridge/client/default/js/search/search.js","webpack://sfra-startup-kit/./cartridges/app_storefront_base/cartridge/client/default/js/components/focus.js","webpack://sfra-startup-kit/./cartridges/app_storefront_base/cartridge/client/default/js/product/base.js","webpack://sfra-startup-kit/./cartridges/app_storefront_base/cartridge/client/default/js/product/quickView.js","webpack://sfra-startup-kit/./cartridges/app_storefront_base/cartridge/client/default/js/util.js","webpack://sfra-startup-kit/webpack/bootstrap","webpack://sfra-startup-kit/webpack/runtime/compat get default export","webpack://sfra-startup-kit/webpack/runtime/define property getters","webpack://sfra-startup-kit/webpack/runtime/hasOwnProperty shorthand","webpack://sfra-startup-kit/webpack/runtime/make namespace object","webpack://sfra-startup-kit/./cartridges/app_cwf/cartridge/client/default/js/search.js"],"sourcesContent":["/**\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 = \"alert-success\";\n        if (icon.hasClass(\"cwf-star-empty\")) {\n            icon.removeClass(\"cwf-star-empty\").addClass(\"cwf-star\");\n        }\n    } else {\n        status = \"alert-danger\";\n    }\n\n    if ($(\".add-to-wishlist-messages\").length === 0) {\n        if ($(window).width() > 992) { // NOSONAR\n            $(\"body\").append(\"<div class=\\\"add-to-wishlist-messages \\\"></div>\");\n        } else {\n            $(\"body\").append(\"<div class=\\\"add-to-wishlist-messages \\\"></div>\");\n        }\n    }\n    $(\".add-to-wishlist-messages\")\n        .append(\"<div class=\\\"add-to-wishlist-alert text-center \" + status + \"\\\">\" + data.msg + \"</div>\");\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\"));\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","/**\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 * Update current and canonical URL\n *\n * @param {string} response - Ajax response HTML code\n * @return {undefined}\n */\nfunction updateUrls(response) {\n    let $canonicalLink = $(\"link[rel^='canonical']\");\n    let $prevLink = $(\"link[rel^='prev']\");\n    let $nextLink = $(\"link[rel^='next']\");\n    let $permaLinkUrl = null;\n\n    let $nextUrl = $(\".next\").val();\n    let $prevUrl = $(\".prev\").val() === \"null\" ? null : $(\".prev\").val();\n\n    if (response) {\n        $permaLinkUrl = $(\".permalink\", response).val();\n    } else {\n        $permaLinkUrl = window.location.href;\n    }\n\n    if ($permaLinkUrl) {\n        let $permalink = $permaLinkUrl;\n\n        let $canonicalUrl = $permalink;\n\n        $canonicalLink.attr(\"href\", $canonicalUrl);\n\n        // set current URL\n        window.history.pushState(null, null, $permalink);\n    }\n\n    if ($nextUrl) {\n        $nextLink.attr(\"href\", $nextUrl);\n    }\n\n    if ($prevUrl) {\n        if ($prevLink.length > 0) {\n            $prevLink.attr(\"href\", $prevUrl);\n        } else {\n            $nextLink.after(\n                `<link rel=\"prev\" href=\"${$prevUrl}\" />`\n            );\n        }\n    }\n}\n\n/**\n * Parse query string\n *\n * @param {string} query - permalink\n * @return {Object} - return object with page size\n */\n// function parseQueryString(query) {\n//     var vars = query.split('&');\n//     var queryString = {};\n//     for (var i = 0; i < vars.length; i++) {\n//         var pair = vars[i].split('=');\n//         var key = decodeURIComponent(pair[0]);\n//         var value = decodeURIComponent(pair[1]);\n//         if (typeof queryString[key] === 'undefined') {\n//             queryString[key] = decodeURIComponent(value);\n//         } else if (typeof queryString[key] === 'string') {\n//             var arr = [queryString[key], decodeURIComponent(value)];\n//             queryString[key] = arr;\n//         } else {\n//             queryString[key].push(decodeURIComponent(value));\n//         }\n//     }\n//     return queryString;\n// }\n\n/**\n * scroll horizontally (categories on plp)\n */\n/**\n * Parse Ajax results and updated select DOM elements\n *\n * @param {string} target - scrolling element target\n * @return {undefined}\n */\nconst scrollHorizontally = (target) => {\n    const element = document.querySelector(target);\n\n\n    if (element) {\n        element.addEventListener(\"wheel\", (event) => {\n            event.preventDefault();\n            const isTouchPad = event.wheelDeltaY ? event.wheelDeltaY === -3 * event.deltaY : event.deltaMode === 0;\n\n            if (!isTouchPad) {\n                element.scrollBy({\n                    left: event.deltaY < 0 ? -30 : 30\n                });\n            } else {\n                element.scrollBy({\n                    left: event.deltaX < 0 ? -30 : 30\n                });\n            }\n        });\n    }\n};\nscrollHorizontally(\".cat-first > .scroll-horizontally\");\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        $(\".refinement.sort-order-menu\").addClass(\"active\");\n        activeDiv.addClass(\"active\");\n        activeDiv.find(\"button.title\").attr(\"aria-expanded\", \"true\");\n    });\n    updateDom($results, \".refinements\");\n    if ($(\".refinements\").text() === \"\") {\n        $(\".refinement-bar button.close\").trigger(\"click\");\n        $(\".grid-header__bottom\").addClass(\"d-none\");\n        $(\".content-body\").removeClass(\"pt-3 pt-lg-5\").addClass(\"pt-0 pt-lg-0\");\n    }\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__top\",\n        \".footer-bar\",\n        \".product-grid\",\n        \".show-more\",\n        \".filter-bar\",\n        \".view-all\",\n        \".sub-categories__list\",\n        \".content-body\"\n\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 * 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 = $(\"<div>\").append($(response));\n\n    if ($(\".grid-footer\").length > 0) {\n        var sortOptions = $tempDom.find(\".grid-footer\").data(\"sort-options\").options;\n\n        $(\".search-refinement-panel\").removeClass(\"d-none\");\n        sortOptions.forEach(function (option) {\n            $(\"input.\" + option.id).val(option.url);\n        });\n    } else {\n        $(\".search-refinement-panel\").addClass(\"d-none\");\n    }\n}\n\nmodule.exports = {\n    initPage: function () {\n        updateUrls();\n    },\n\n    filter: function () {\n        // Display refinements bar when Menu icon clicked\n        $(\".container\").on(\"click\", \"button.filter-results\", function () {\n            $(\".refinement-bar\").addClass(\"open-refinement-bar\");\n            $(\".modal-background\").fadeIn();\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        });\n    },\n\n    closeRefinements: function () {\n        // Refinements close button\n        $(\"body\").on(\"click\", \".refinement-bar button.close, .modal-background, .refinement-bar button.view-all\", function () {\n            $(\".refinement-bar\").removeClass(\"open-refinement-bar\");\n            $(\".modal-background\").fadeOut();\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    resize: function () {\n        // Close refinement bar and hide modal background if user resizes browser\n        $(window).resize(function () {\n            $(\".refinement-bar\").removeClass(\"open-refinement-bar\");\n            $(\".modal-background\").fadeOut();\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(\"click\", \"[name=sort-order]\", function (e) {\n            e.preventDefault();\n            $.spinner().start();\n\n            var activeItem = $(\".sort-order-menu\").find(\".active-item\");\n            var buttonLi = $(this).closest(\"li\");\n\n            if (activeItem.length > 0 && !$(buttonLi).hasClass(\"active-item\")) {\n                $(activeItem).removeClass(\"active-item\");\n                $(buttonLi).addClass(\"active-item\");\n                sessionStorage.setItem(\"sortOption\", $(this).attr(\"class\"));\n            } else if ($(buttonLi).hasClass(\"active-item\")) {\n                $(buttonLi).removeClass(\"active-item\");\n                sessionStorage.removeItem(\"sortOption\");\n            } else {\n                $(buttonLi).addClass(\"active-item\");\n                sessionStorage.setItem(\"sortOption\", $(this).attr(\"class\"));\n            }\n            $(this).trigger(\"search:sort\", this.value);\n\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            e.preventDefault();\n\n            var showMoreUrl = $(this).data(\"url\");\n            sessionStorage.removeItem(\"windowLocation\");\n            sessionStorage.removeItem(\"catPathname\");\n            sessionStorage.removeItem(\"productPid\");\n\n            $.spinner().start();\n            $(this).trigger(\"search:showMore\", e);\n\n            $.ajax({\n                url: showMoreUrl,\n                data: { selectedUrl: showMoreUrl },\n                method: \"GET\",\n                success: function (response) {\n                    $(\".grid-footer\").replaceWith(response);\n                    updateUrls(response);\n                    updateSortOptions(response);\n\n                    // Insert marketing tiles every n products\n                    marketTiles.init();\n                    module.exports.setNavHistory();\n\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-selected button, .swatch-filter button, .filter-bar button.reset, .all-products-wrapper button.all-products\",\n            function (e) {\n                e.preventDefault();\n                e.stopPropagation();\n\n                var element = $(this);\n\n                $.spinner().start();\n                $(this).trigger(\"search:filter\", e);\n                let filtersLength;\n\n                $.ajax({\n                    url: $(this).data(\"href\"),\n                    data: {\n                        page: $(\".grid-footer\").data(\"page-number\"),\n                        selectedUrl: $(this).data(\"href\"),\n                        target: $(this).parent().hasClass(\"filter-selected\") || $(this).hasClass(\"reset\"),\n                    },\n                    method: \"GET\",\n                    success: function (response) {\n                        parseResults(response);\n                        updateUrls(response);\n                        updateSortOptions(response);\n\n                        $.spinner().stop();\n\n                        let buttonRoot = $(\".filter-selected button[data-href*=\\\"root\\\"]\");\n                        let btnSort = $(\".refinement-sort .active-item\");\n                        let $sortOption = sessionStorage.getItem(\"sortOption\");\n\n                        if (btnSort.length > 0) {\n                            btnSort.removeClass(\"active-item\");\n                        }\n\n                        if (buttonRoot.length > 0) {\n                            filtersLength = $(\".filter-selected\").length - 1;\n                        } else {\n                            filtersLength = $(\".filter-selected\").length;\n                        }\n\n                        if (filtersLength > 0) {\n                            if (!(element.parent().hasClass(\"filter-selected\") || element.hasClass(\"reset\"))) {\n                                $(\".modal-background\").css(\"display\", \"block\");\n                            }\n                            $(\".nbr-filters\").text(\"(\" + filtersLength + \")\");\n                            $(\".reset-link\").fadeIn();\n                            if ($sortOption !== null) {\n                                $(\".\" + $sortOption).closest(\"li\").addClass(\"active-item\");\n                            }\n                            $(\".filter-bar .reset-link\").fadeIn();\n                            $(\"li.active-item\").each(function () {\n                                $(this).closest(\".refinement\").addClass(\"active\");\n                            });\n                        } else {\n                            $(\".refinement-bar\").removeClass(\"open-refinement-bar\");\n                            $(\".nbr-filters\").text(\"\");\n                            $(\".reset-link\").fadeOut();\n                            sessionStorage.removeItem(\"reapplyFilters\");\n                            sessionStorage.removeItem(\"filtersApplied\");\n                            sessionStorage.removeItem(\"sortOption\");\n                            $(\".modal-background\").fadeOut();\n                        }\n\n                        scrollHorizontally(\".cat-first > .scroll-horizontally\");\n\n                        $(\".tab-content\").removeClass(\"invisible\");\n                    },\n                    error: function () {\n                        $.spinner().stop();\n                    }\n                });\n            }\n        );\n    },\n\n    applyFilterCat: function () {\n        // Handle subcategories value selection\n        $(document).on(\n            \"click\",\n            \".sub-categories__list li button, .sub-categories__list .values li button\",\n            function (e) {\n                e.preventDefault();\n                e.stopPropagation();\n\n                $.spinner().start();\n                $(this).trigger(\"search:filter\", e);\n\n                let listItem = $(this).parent(\"li\");\n                let attributeId = \"#\" + $(this).find(\"span\").last().attr(\"id\");\n\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                        updateUrls(response);\n                        updateSortOptions(response);\n\n                        $.spinner().stop();\n                        $(attributeId).parent(\"button\").focus();\n                        $(listItem).addClass(\"is-active\");\n\n                        let filtersLength = $(\".filter-selected\").length;\n\n                        if (filtersLength > 0) {\n                            $(\".nbr-filters\").text(\"(\" + filtersLength + \")\");\n                            $(\".reset-link\").fadeIn();\n                        }\n\n                        if ($(\".slider-recommendations\").length > 0) {\n                            $(\".grid-header\").removeClass(\"border-bottom\").addClass(\"no-results justify-content-start\");\n                            recosSlider.init();\n                        }\n\n                        scrollHorizontally(\".cat-first > .scroll-horizontally\");\n                        $(\".tab-content\").removeClass(\"invisible\");\n                    },\n                    error: function () {\n                        $.spinner().stop();\n                        $(attributeId).parent(\"button\").focus();\n                    }\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    initAppliedFilters: function () {\n        let doNotPushHistory = false;\n        let $filters = sessionStorage.getItem(\"filtersApplied\");\n        let $sortOption = sessionStorage.getItem(\"sortOption\");\n\n        /**\n         * Listen to all possible AJAX calls on a search page\n         */\n        $(document).ajaxSuccess(\n            function (event, xhr) {\n                if (xhr.responseText.indexOf(\"<div class=\\\"product-tile\\\">\") >= 0) {\n                    if (!doNotPushHistory) {\n                        setTimeout(function () {\n                            let filtersApplied = decodeURI($(\".permalink\").val().split(\"?\")[1]);\n                            filtersApplied = filtersApplied.replace(/&{0,1}start.*&sz.+?(?=&|$)/g, \"\");\n\n                            sessionStorage.setItem(\"filtersApplied\", filtersApplied);\n                            sessionStorage.setItem(\"reapplyFilters\", true);\n                            sessionStorage.setItem(\"pid\", $(\".page\").data(\"querystring\"));\n                        });\n                    }\n\n                    doNotPushHistory = false;\n                }\n            }\n        );\n        /**\n         * Retrieve all filters applied\n         */\n        $(document).ready(function () {\n            const $resetButton = $(\".refinement-bar button.reset\");\n            const $resetUrl = $resetButton.data(\"href\");\n            const $pid = $(\".page\").data(\"querystring\");\n            const $newResetUrl = $resetUrl + \"?\" + $pid + \"&\" + sessionStorage.getItem(\"filtersApplied\");\n\n            if ($filters !== null) {\n                doNotPushHistory = true;\n                $resetButton.data(\"href\", decodeURI($newResetUrl));\n                $resetButton.trigger(\"click\");\n            } else {\n                sessionStorage.removeItem(\"pid\");\n                sessionStorage.removeItem(\"reapplyFilters\");\n                sessionStorage.removeItem(\"filtersApplied\");\n                sessionStorage.removeItem(\"sortOption\");\n                $(\".\" + $sortOption).closest(\".best-matches-btn\").removeClass(\"active-item\");\n                $(\".filter-bar .reset-link\").fadeOut();\n                $(\".tab-content\").removeClass(\"invisible\");\n            }\n        });\n    },\n\n    setNavHistory: function () {\n        var windowLocation;\n        var catPathname;\n        var productPid;\n\n        $(\".product-tile\").on(\"click\", \"a\", function () {\n            catPathname = window.location.pathname;\n            // Modify the current url to have the complete catalog\n            var url = new URL(window.location);\n            var queryString = url.search;\n            var urlParams = new URLSearchParams(queryString);\n            if (urlParams.has(\"sz\")) {\n                var size = parseInt(urlParams.get(\"sz\"), 10);\n                urlParams.set(\"sz\", size);\n                url.search = urlParams.toString();\n            }\n            windowLocation = url.href;\n            productPid = $(this).closest(\".product\").attr(\"data-pid\");\n\n            sessionStorage.setItem(\"windowLocation\", windowLocation);\n            sessionStorage.setItem(\"catPathname\", catPathname);\n            sessionStorage.setItem(\"productPid\", productPid);\n\n            // window.history.pushState({ page: 'previous PLP' }, document.title, url.href);\n        });\n\n        if (sessionStorage.getItem(\"catPathname\") !== window.location.pathname) {\n            sessionStorage.removeItem(\"windowLocation\");\n            sessionStorage.removeItem(\"catPathname\");\n            sessionStorage.removeItem(\"productPid\");\n        }\n\n        if (sessionStorage.getItem(\"windowLocation\") !== null && windowLocation !== sessionStorage.getItem(\"windowLocation\")) {\n            $(document).ready(function () {\n                var productTile = $(\".product[data-pid=\" + sessionStorage.getItem(\"productPid\") + \"]\");\n                if (productTile.offset()) {\n                    var scrollToProd = productTile.offset().top;\n\n                    $(\".tab-content\").removeClass(\"invisible\");\n\n                    $(\"html, body\").animate(\n                        {\n                            scrollTop: scrollToProd\n                        },\n                        750\n                    );\n                }\n            });\n        }\n    }\n};\n/**\n * insert marketing tiles on \"show more\" click\n *\n */\nconst marketTiles = {\n    init() {\n        const marketingTiles = $(\".promo-region\").find(\"[data-id^=productListTile-]\");\n        const productsLength = $(\".region-product\").length;\n\n        for (var i = 0; i < marketingTiles.length; i++) {\n            const marketingTile = $(marketingTiles[i]);\n            const dataRec = $(marketingTile).closest(\".promo-region\").data(\"rec\");\n            const pageSize = Number($(\".grid-footer\").data(\"page-size\"));\n            const pageNbr = $(\".grid-footer\").data(\"page-number\");\n\n            for (var j = (pageSize * pageNbr); j < productsLength; j++) {\n                if (j % dataRec === 0) {\n                    var marketingRegion = $(marketingTile).closest(\".promo-region\");\n                    $(marketingRegion).clone().insertAfter($(\".region-product\").eq(j)).removeClass(\"promo-region\");\n                }\n            }\n        }\n    }\n};\n\nconst recosSlider = {\n    init() {\n        $(\".slider-recommendations\").slick({\n            infinite: true,\n            cssEase: \"linear\",\n            slidesToShow: 4,\n            slidesToScroll: 1,\n            arrows: true,\n            dots: false,\n            responsive: [\n                {\n                    breakpoint: 992,\n                    settings: {\n                        infinite: true,\n                        cssEase: \"linear\",\n                        slidesToShow: 2,\n                        slidesToScroll: 1,\n                        arrows: false,\n                        dots: true\n                    }\n                },\n                {\n                    breakpoint: 480,\n                    settings: {\n                        infinite: true,\n                        cssEase: \"linear\",\n                        slidesToShow: 1,\n                        slidesToScroll: 1,\n                        arrows: false,\n                        dots: true\n                    }\n                }\n            ]\n        });\n    }\n};\n","'use strict';\n\nmodule.exports = {\n    setTabNextFocus: function (focusParams) {\n        var KEYCODE_TAB = 9;\n        var isTabPressed = (focusParams.event.key === 'Tab' || focusParams.event.keyCode === KEYCODE_TAB);\n\n        if (!isTabPressed) {\n            return;\n        }\n\n        var firstFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.firstElementSelector);\n        var lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.lastElementSelector);\n\n        if ($(focusParams.containerSelector + ' ' + focusParams.lastElementSelector).is(':disabled')) {\n            lastFocusableEl = $(focusParams.containerSelector + ' ' + focusParams.nextToLastElementSelector);\n            if ($('.product-quickview.product-set').length > 0) {\n                var linkElements = $(focusParams.containerSelector + ' a#fa-link.share-icons');\n                lastFocusableEl = linkElements[linkElements.length - 1];\n            }\n        }\n\n        if (focusParams.event.shiftKey) /* shift + tab */ {\n            if ($(':focus').is(firstFocusableEl)) {\n                lastFocusableEl.focus();\n                focusParams.event.preventDefault();\n            }\n        } else /* tab */ {\n            if ($(':focus').is(lastFocusableEl)) { // eslint-disable-line\n                firstFocusableEl.focus();\n                focusParams.event.preventDefault();\n            }\n        }\n    }\n};\n","'use strict';\n\nvar focusHelper = require('../components/focus');\n\nvar location = window.location;\n\n/**\n * Retrieves the relevant pid value\n * @param {jquery} $el - DOM container for a given add to cart button\n * @return {string} - value to be used when adding product to cart\n */\nfunction getPidValue($el) {\n    var pid;\n\n    if ($('#quickViewModal').hasClass('show') && !$('.product-set').length) {\n        pid = $($el).closest('.modal-content').find('.product-quickview').data('pid');\n    } else if ($('.product-set-detail').length || $('.product-set').length) {\n        pid = $($el).closest('.product-detail').find('.product-id').text();\n    } else {\n        pid = $('.product-detail:not(\".bundle-item\")').data('pid');\n    }\n\n    return pid;\n}\n\n/**\n * Retrieve contextual quantity selector\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {jquery} - quantity selector DOM container\n */\nfunction getQuantitySelector($el) {\n    var quantitySelected;\n    if ($el && $('.set-items').length) {\n        quantitySelected = $($el).closest('.product-detail').find('.quantity-select');\n    } else if ($el && $('.product-bundle').length) {\n        var quantitySelectedModal = $($el).closest('.modal-footer').find('.quantity-select');\n        var quantitySelectedPDP = $($el).closest('.bundle-footer').find('.quantity-select');\n        if (quantitySelectedModal.val() === undefined) {\n            quantitySelected = quantitySelectedPDP;\n        } else {\n            quantitySelected = quantitySelectedModal;\n        }\n    } else {\n        quantitySelected = $('.quantity-select');\n    }\n    return quantitySelected;\n}\n\n/**\n * Retrieves the value associated with the Quantity pull-down menu\n * @param {jquery} $el - DOM container for the relevant quantity\n * @return {string} - value found in the quantity input\n */\nfunction getQuantitySelected($el) {\n    return getQuantitySelector($el).val();\n}\n\n/**\n * Process the attribute values for an attribute that has image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction processSwatchValues(attr, $productContainer, msgs) {\n    attr.values.forEach(function (attrValue) {\n        var $attrValue = $productContainer.find('[data-attr=\"' + attr.id + '\"] [data-attr-value=\"'\n            + attrValue.value + '\"]');\n        var $swatchButton = $attrValue.parent();\n\n        if (attrValue.selected) {\n            $attrValue.addClass('selected');\n            $attrValue.siblings('.selected-assistive-text').text(msgs.assistiveSelectedText);\n        } else {\n            $attrValue.removeClass('selected');\n            $attrValue.siblings('.selected-assistive-text').empty();\n        }\n\n        if (attrValue.url) {\n            $swatchButton.attr('data-url', attrValue.url);\n        } else {\n            $swatchButton.removeAttr('data-url');\n        }\n\n        // Disable if not selectable\n        $attrValue.removeClass('selectable unselectable');\n\n        $attrValue.addClass(attrValue.selectable ? 'selectable' : 'unselectable');\n    });\n}\n\n/**\n * Process attribute values associated with an attribute that does not have image swatches\n *\n * @param {Object} attr - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {Object[]} attr.values - Array of attribute value objects\n * @param {string} attr.values.value - Attribute coded value\n * @param {string} attr.values.url - URL to de/select an attribute value of the product\n * @param {boolean} attr.values.isSelectable - Flag as to whether an attribute value can be\n *     selected.  If there is no variant that corresponds to a specific combination of attribute\n *     values, an attribute may be disabled in the Product Detail Page\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction processNonSwatchValues(attr, $productContainer) {\n    var $attr = '[data-attr=\"' + attr.id + '\"]';\n    var $defaultOption = $productContainer.find($attr + ' .select-' + attr.id + ' option:first');\n    $defaultOption.attr('value', attr.resetUrl);\n\n    attr.values.forEach(function (attrValue) {\n        var $attrValue = $productContainer\n            .find($attr + ' [data-attr-value=\"' + attrValue.value + '\"]');\n        $attrValue.attr('value', attrValue.url)\n            .removeAttr('disabled');\n\n        if (!attrValue.selectable) {\n            $attrValue.attr('disabled', true);\n        }\n    });\n}\n\n/**\n * Routes the handling of attribute processing depending on whether the attribute has image\n *     swatches or not\n *\n * @param {Object} attrs - Attribute\n * @param {string} attr.id - Attribute ID\n * @param {jQuery} $productContainer - DOM element for a given product\n * @param {Object} msgs - object containing resource messages\n */\nfunction updateAttrs(attrs, $productContainer, msgs) {\n    // Currently, the only attribute type that has image swatches is Color.\n    var attrsWithSwatches = ['color'];\n\n    attrs.forEach(function (attr) {\n        if (attrsWithSwatches.indexOf(attr.id) > -1) {\n            processSwatchValues(attr, $productContainer, msgs);\n        } else {\n            processNonSwatchValues(attr, $productContainer);\n        }\n    });\n}\n\n/**\n * Updates the availability status in the Product Detail Page\n *\n * @param {Object} response - Ajax response object after an\n *                            attribute value has been [de]selected\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction updateAvailability(response, $productContainer) {\n    var availabilityValue = '';\n    var availabilityMessages = response.product.availability.messages;\n    if (!response.product.readyToOrder) {\n        availabilityValue = '<li><div>' + response.resources.info_selectforstock + '</div></li>';\n    } else {\n        availabilityMessages.forEach(function (message) {\n            availabilityValue += '<li><div>' + message + '</div></li>';\n        });\n    }\n\n    $($productContainer).trigger('product:updateAvailability', {\n        product: response.product,\n        $productContainer: $productContainer,\n        message: availabilityValue,\n        resources: response.resources\n    });\n}\n\n/**\n * Generates html for product attributes section\n *\n * @param {array} attributes - list of attributes\n * @return {string} - Compiled HTML\n */\nfunction getAttributesHtml(attributes) {\n    if (!attributes) {\n        return '';\n    }\n\n    var html = '';\n\n    attributes.forEach(function (attributeGroup) {\n        if (attributeGroup.ID === 'mainAttributes') {\n            attributeGroup.attributes.forEach(function (attribute) {\n                html += '<div class=\"attribute-values\">' + attribute.label + ': '\n                    + attribute.value + '</div>';\n            });\n        }\n    });\n\n    return html;\n}\n\n/**\n * @typedef UpdatedOptionValue\n * @type Object\n * @property {string} id - Option value ID for look up\n * @property {string} url - Updated option value selection URL\n */\n\n/**\n * @typedef OptionSelectionResponse\n * @type Object\n * @property {string} priceHtml - Updated price HTML code\n * @property {Object} options - Updated Options\n * @property {string} options.id - Option ID\n * @property {UpdatedOptionValue[]} options.values - Option values\n */\n\n/**\n * Updates DOM using post-option selection Ajax response\n *\n * @param {OptionSelectionResponse} optionsHtml - Ajax response optionsHtml from selecting a product option\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction updateOptions(optionsHtml, $productContainer) {\n    // Update options\n    $productContainer.find('.product-options').empty().html(optionsHtml);\n}\n\n/**\n * Dynamically creates Bootstrap carousel from response containing images\n * @param {Object[]} imgs - Array of large product images,along with related information\n * @param {jQuery} $productContainer - DOM element for a given product\n */\nfunction createCarousel(imgs, $productContainer) {\n    var carousel = $productContainer.find('.carousel');\n    $(carousel).carousel('dispose');\n    var carouselId = $(carousel).attr('id');\n    $(carousel).empty().append('<ol class=\"carousel-indicators\"></ol><div class=\"carousel-inner\" role=\"listbox\"></div><a class=\"carousel-control-prev\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"prev\"><span class=\"fa icon-prev\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('prev') + '</span></a><a class=\"carousel-control-next\" href=\"#' + carouselId + '\" role=\"button\" data-slide=\"next\"><span class=\"fa icon-next\" aria-hidden=\"true\"></span><span class=\"sr-only\">' + $(carousel).data('next') + '</span></a>');\n    for (var i = 0; i < imgs.length; i++) {\n        $('<div class=\"carousel-item\"><img src=\"' + imgs[i].url + '\" class=\"d-block img-fluid\" alt=\"' + imgs[i].alt + ' image number ' + parseInt(imgs[i].index, 10) + '\" title=\"' + imgs[i].title + '\" itemprop=\"image\" /></div>').appendTo($(carousel).find('.carousel-inner'));\n        $('<li data-target=\"#' + carouselId + '\" data-slide-to=\"' + i + '\" class=\"\"></li>').appendTo($(carousel).find('.carousel-indicators'));\n    }\n    $($(carousel).find('.carousel-item')).first().addClass('active');\n    $($(carousel).find('.carousel-indicators > li')).first().addClass('active');\n    if (imgs.length === 1) {\n        $($(carousel).find('.carousel-indicators, a[class^=\"carousel-control-\"]')).detach();\n    }\n    $(carousel).carousel();\n    $($(carousel).find('.carousel-indicators')).attr('aria-hidden', true);\n}\n\n/**\n * Parses JSON from Ajax call made whenever an attribute value is [de]selected\n * @param {Object} response - response from Ajax call\n * @param {Object} response.product - Product object\n * @param {string} response.product.id - Product ID\n * @param {Object[]} response.product.variationAttributes - Product attributes\n * @param {Object[]} response.product.images - Product images\n * @param {boolean} response.product.hasRequiredAttrsSelected - Flag as to whether all required\n *     attributes have been selected.  Used partially to\n *     determine whether the Add to Cart button can be enabled\n * @param {jQuery} $productContainer - DOM element for a given product.\n */\nfunction handleVariantResponse(response, $productContainer) {\n    var isChoiceOfBonusProducts = $productContainer.parents('.choose-bonus-product-dialog').length > 0;\n    var isVaraint;\n    if (response.product.variationAttributes) {\n        updateAttrs(response.product.variationAttributes, $productContainer, response.resources);\n        isVaraint = response.product.productType === 'variant';\n        if (isChoiceOfBonusProducts && isVaraint) {\n            $productContainer.parent('.bonus-product-item')\n                .data('pid', response.product.id);\n\n            $productContainer.parent('.bonus-product-item')\n                .data('ready-to-order', response.product.readyToOrder);\n        }\n    }\n\n    // Update primary images\n    var primaryImageUrls = response.product.images.large;\n    createCarousel(primaryImageUrls, $productContainer);\n\n    // Update pricing\n    if (!isChoiceOfBonusProducts) {\n        var $priceSelector = $('.prices .price', $productContainer).length\n            ? $('.prices .price', $productContainer)\n            : $('.prices .price');\n        $priceSelector.replaceWith(response.product.price.html);\n    }\n\n    // Update promotions\n    $productContainer.find('.promotions').empty().html(response.product.promotionsHtml);\n\n    updateAvailability(response, $productContainer);\n\n    if (isChoiceOfBonusProducts) {\n        var $selectButton = $productContainer.find('.select-bonus-product');\n        $selectButton.trigger('bonusproduct:updateSelectButton', {\n            product: response.product, $productContainer: $productContainer\n        });\n    } else {\n        // Enable \"Add to Cart\" button if all required attributes have been selected\n        $('button.add-to-cart, button.add-to-cart-global, button.update-cart-product-global').trigger('product:updateAddToCart', {\n            product: response.product, $productContainer: $productContainer\n        }).trigger('product:statusUpdate', response.product);\n    }\n\n    // Update attributes\n    $productContainer.find('.main-attributes').empty()\n        .html(getAttributesHtml(response.product.attributes));\n}\n\n/**\n * @typespec UpdatedQuantity\n * @type Object\n * @property {boolean} selected - Whether the quantity has been selected\n * @property {string} value - The number of products to purchase\n * @property {string} url - Compiled URL that specifies variation attributes, product ID, options,\n *     etc.\n */\n\n/**\n * Updates the quantity DOM elements post Ajax call\n * @param {UpdatedQuantity[]} quantities -\n * @param {jQuery} $productContainer - DOM container for a given product\n */\nfunction updateQuantities(quantities, $productContainer) {\n    if ($productContainer.parent('.bonus-product-item').length <= 0) {\n        var optionsHtml = quantities.map(function (quantity) {\n            var selected = quantity.selected ? ' selected ' : '';\n            return '<option value=\"' + quantity.value + '\"  data-url=\"' + quantity.url + '\"'\n                + selected + '>' + quantity.value + '</option>';\n        }).join('');\n        getQuantitySelector($productContainer).empty().html(optionsHtml);\n    }\n}\n\n/**\n * updates the product view when a product attribute is selected or deselected or when\n *         changing quantity\n * @param {string} selectedValueUrl - the Url for the selected variation value\n * @param {jQuery} $productContainer - DOM element for current product\n */\nfunction attributeSelect(selectedValueUrl, $productContainer) {\n    if (selectedValueUrl) {\n        $('body').trigger(\n            'product:beforeAttributeSelect',\n            { url: selectedValueUrl, container: $productContainer }\n        );\n\n        $.ajax({\n            url: selectedValueUrl,\n            method: 'GET',\n            success: function (data) {\n                handleVariantResponse(data, $productContainer);\n                updateOptions(data.product.optionsHtml, $productContainer);\n                updateQuantities(data.product.quantities, $productContainer);\n                $('body').trigger(\n                    'product:afterAttributeSelect',\n                    { data: data, container: $productContainer }\n                );\n                $.spinner().stop();\n            },\n            error: function () {\n                $.spinner().stop();\n            }\n        });\n    }\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @return {string} - The provided URL to use when adding a product to the cart\n */\nfunction getAddToCartUrl() {\n    return $('.add-to-cart-url').val();\n}\n\n/**\n * Parses the html for a modal window\n * @param {string} html - representing the body and footer of the modal window\n *\n * @return {Object} - Object with properties body and footer.\n */\nfunction parseHtml(html) {\n    var $html = $('<div>').append($.parseHTML(html));\n\n    var body = $html.find('.choice-of-bonus-product');\n    var footer = $html.find('.modal-footer').children();\n\n    return { body: body, footer: footer };\n}\n\n/**\n * Retrieves url to use when adding a product to the cart\n *\n * @param {Object} data - data object used to fill in dynamic portions of the html\n */\nfunction chooseBonusProducts(data) {\n    $('.modal-body').spinner().start();\n\n    if ($('#chooseBonusProductModal').length !== 0) {\n        $('#chooseBonusProductModal').remove();\n    }\n    var bonusUrl;\n    if (data.bonusChoiceRuleBased) {\n        bonusUrl = data.showProductsUrlRuleBased;\n    } else {\n        bonusUrl = data.showProductsUrlListBased;\n    }\n\n    var htmlString = '<!-- Modal -->'\n        + '<div class=\"modal fade\" id=\"chooseBonusProductModal\" tabindex=\"-1\" role=\"dialog\">'\n        + '<span class=\"enter-message sr-only\" ></span>'\n        + '<div class=\"modal-dialog choose-bonus-product-dialog\" '\n        + 'data-total-qty=\"' + data.maxBonusItems + '\"'\n        + 'data-UUID=\"' + data.uuid + '\"'\n        + 'data-pliUUID=\"' + data.pliUUID + '\"'\n        + 'data-addToCartUrl=\"' + data.addToCartUrl + '\"'\n        + 'data-pageStart=\"0\"'\n        + 'data-pageSize=\"' + data.pageSize + '\"'\n        + 'data-moreURL=\"' + data.showProductsUrlRuleBased + '\"'\n        + 'data-bonusChoiceRuleBased=\"' + data.bonusChoiceRuleBased + '\">'\n        + '<!-- Modal content-->'\n        + '<div class=\"modal-content\">'\n        + '<div class=\"modal-header\">'\n        + '    <span class=\"\">' + data.labels.selectprods + '</span>'\n        + '    <button type=\"button\" class=\"close pull-right\" data-dismiss=\"modal\">'\n        + '        <span aria-hidden=\"true\">&times;</span>'\n        + '        <span class=\"sr-only\"> </span>'\n        + '    </button>'\n        + '</div>'\n        + '<div class=\"modal-body\"></div>'\n        + '<div class=\"modal-footer\"></div>'\n        + '</div>'\n        + '</div>'\n        + '</div>';\n    $('body').append(htmlString);\n    $('.modal-body').spinner().start();\n\n    $.ajax({\n        url: bonusUrl,\n        method: 'GET',\n        dataType: 'json',\n        success: function (response) {\n            var parsedHtml = parseHtml(response.renderedTemplate);\n            $('#chooseBonusProductModal .modal-body').empty();\n            $('#chooseBonusProductModal .enter-message').text(response.enterDialogMessage);\n            $('#chooseBonusProductModal .modal-header .close .sr-only').text(response.closeButtonText);\n            $('#chooseBonusProductModal .modal-body').html(parsedHtml.body);\n            $('#chooseBonusProductModal .modal-footer').html(parsedHtml.footer);\n            $('#chooseBonusProductModal').modal('show');\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\n/**\n * Updates the Mini-Cart quantity value after the customer has pressed the \"Add to Cart\" button\n * @param {string} response - ajax response from clicking the add to cart button\n */\nfunction handlePostCartAdd(response) {\n    $('.minicart').trigger('count:update', response);\n    var messageType = response.error ? 'alert-danger' : 'alert-success';\n    // show add to cart toast\n    if (response.newBonusDiscountLineItem\n        && Object.keys(response.newBonusDiscountLineItem).length !== 0) {\n        chooseBonusProducts(response.newBonusDiscountLineItem);\n    } else {\n        if ($('.add-to-cart-messages').length === 0) {\n            $('body').append(\n                '<div class=\"add-to-cart-messages\"></div>'\n            );\n        }\n\n        $('.add-to-cart-messages').append(\n            '<div class=\"alert ' + messageType + ' add-to-basket-alert text-center\" role=\"alert\">'\n            + response.message\n            + '</div>'\n        );\n\n        setTimeout(function () {\n            $('.add-to-basket-alert').remove();\n        }, 5000);\n    }\n}\n\n/**\n * Retrieves the bundle product item ID's for the Controller to replace bundle master product\n * items with their selected variants\n *\n * @return {string[]} - List of selected bundle product item ID's\n */\nfunction getChildProducts() {\n    var childProducts = [];\n    $('.bundle-item').each(function () {\n        childProducts.push({\n            pid: $(this).find('.product-id').text(),\n            quantity: parseInt($(this).find('label.quantity').data('quantity'), 10)\n        });\n    });\n\n    return childProducts.length ? JSON.stringify(childProducts) : [];\n}\n\n/**\n * Retrieve product options\n *\n * @param {jQuery} $productContainer - DOM element for current product\n * @return {string} - Product options and their selected values\n */\nfunction getOptions($productContainer) {\n    var options = $productContainer\n        .find('.product-option')\n        .map(function () {\n            var $elOption = $(this).find('.options-select');\n            var urlValue = $elOption.val();\n            var selectedValueId = $elOption.find('option[value=\"' + urlValue + '\"]')\n                .data('value-id');\n            return {\n                optionId: $(this).data('option-id'),\n                selectedValueId: selectedValueId\n            };\n        }).toArray();\n\n    return JSON.stringify(options);\n}\n\n/**\n * Makes a call to the server to report the event of adding an item to the cart\n *\n * @param {string | boolean} url - a string representing the end point to hit so that the event can be recorded, or false\n */\nfunction miniCartReportingUrl(url) {\n    if (url) {\n        $.ajax({\n            url: url,\n            method: 'GET',\n            success: function () {\n                // reporting urls hit on the server\n            },\n            error: function () {\n                // no reporting urls hit on the server\n            }\n        });\n    }\n}\n\nmodule.exports = {\n    attributeSelect: attributeSelect,\n    methods: {\n        editBonusProducts: function (data) {\n            chooseBonusProducts(data);\n        }\n    },\n\n    focusChooseBonusProductModal: function () {\n        $('body').on('shown.bs.modal', '#chooseBonusProductModal', function () {\n            $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'true');\n            $('#chooseBonusProductModal .close').focus();\n        });\n    },\n\n    onClosingChooseBonusProductModal: function () {\n        $('body').on('hidden.bs.modal', '#chooseBonusProductModal', function () {\n            $('#chooseBonusProductModal').siblings().attr('aria-hidden', 'false');\n        });\n    },\n\n    trapChooseBonusProductModalFocus: function () {\n        $('body').on('keydown', '#chooseBonusProductModal', function (e) {\n            var focusParams = {\n                event: e,\n                containerSelector: '#chooseBonusProductModal',\n                firstElementSelector: '.close',\n                lastElementSelector: '.add-bonus-products'\n            };\n            focusHelper.setTabNextFocus(focusParams);\n        });\n    },\n\n    colorAttribute: function () {\n        $(document).on('click', '[data-attr=\"color\"] button', function (e) {\n            e.preventDefault();\n\n            if ($(this).attr('disabled')) {\n                return;\n            }\n            var $productContainer = $(this).closest('.set-item');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.product-detail');\n            }\n\n            attributeSelect($(this).attr('data-url'), $productContainer);\n        });\n    },\n\n    selectAttribute: function () {\n        $(document).on('change', 'select[class*=\"select-\"], .options-select', function (e) {\n            e.preventDefault();\n\n            var $productContainer = $(this).closest('.set-item');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.product-detail');\n            }\n            attributeSelect(e.currentTarget.value, $productContainer);\n        });\n    },\n\n    availability: function () {\n        $(document).on('change', '.quantity-select', function (e) {\n            e.preventDefault();\n\n            var $productContainer = $(this).closest('.product-detail');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.modal-content').find('.product-quickview');\n            }\n\n            if ($('.bundle-items', $productContainer).length === 0) {\n                attributeSelect(\n                    $(e.currentTarget).find('option:selected').data('url'),\n                    $productContainer\n                );\n            }\n        });\n    },\n\n    addToCart: function () {\n        $(document).on('click', 'button.add-to-cart, button.add-to-cart-global', function () {\n            var addToCartUrl;\n            var pid;\n            var pidsObj;\n            var setPids;\n\n            $('body').trigger('product:beforeAddToCart', this);\n\n            if ($('.set-items').length && $(this).hasClass('add-to-cart-global')) {\n                setPids = [];\n\n                $('.product-detail').each(function () {\n                    if (!$(this).hasClass('product-set-detail')) {\n                        setPids.push({\n                            pid: $(this).find('.product-id').text(),\n                            qty: $(this).find('.quantity-select').val(),\n                            options: getOptions($(this))\n                        });\n                    }\n                });\n                pidsObj = JSON.stringify(setPids);\n            }\n\n            pid = getPidValue($(this));\n\n            var $productContainer = $(this).closest('.product-detail');\n            if (!$productContainer.length) {\n                $productContainer = $(this).closest('.quick-view-dialog').find('.product-detail');\n            }\n\n            addToCartUrl = getAddToCartUrl();\n\n            var form = {\n                pid: pid,\n                pidsObj: pidsObj,\n                childProducts: getChildProducts(),\n                quantity: getQuantitySelected($(this))\n            };\n\n            if (!$('.bundle-item').length) {\n                form.options = getOptions($productContainer);\n            }\n\n            $(this).trigger('updateAddToCartFormData', form);\n            if (addToCartUrl) {\n                $.ajax({\n                    url: addToCartUrl,\n                    method: 'POST',\n                    data: form,\n                    success: function (data) {\n                        handlePostCartAdd(data);\n                        $('body').trigger('product:afterAddToCart', data);\n                        $.spinner().stop();\n                        miniCartReportingUrl(data.reportingURL);\n                    },\n                    error: function () {\n                        $.spinner().stop();\n                    }\n                });\n            }\n        });\n    },\n    selectBonusProduct: function () {\n        $(document).on('click', '.select-bonus-product', function () {\n            var $choiceOfBonusProduct = $(this).parents('.choice-of-bonus-product');\n            var pid = $(this).data('pid');\n            var maxPids = $('.choose-bonus-product-dialog').data('total-qty');\n            var submittedQty = parseInt($choiceOfBonusProduct.find('.bonus-quantity-select').val(), 10);\n            var totalQty = 0;\n            $.each($('#chooseBonusProductModal .selected-bonus-products .selected-pid'), function () {\n                totalQty += $(this).data('qty');\n            });\n            totalQty += submittedQty;\n            var optionID = $choiceOfBonusProduct.find('.product-option').data('option-id');\n            var valueId = $choiceOfBonusProduct.find('.options-select option:selected').data('valueId');\n            if (totalQty <= maxPids) {\n                var selectedBonusProductHtml = ''\n                + '<div class=\"selected-pid row\" '\n                + 'data-pid=\"' + pid + '\"'\n                + 'data-qty=\"' + submittedQty + '\"'\n                + 'data-optionID=\"' + (optionID || '') + '\"'\n                + 'data-option-selected-value=\"' + (valueId || '') + '\"'\n                + '>'\n                + '<div class=\"col-sm-11 col-9 bonus-product-name\" >'\n                + $choiceOfBonusProduct.find('.product-name').html()\n                + '</div>'\n                + '<div class=\"col-1\"><i class=\"fa fa-times\" aria-hidden=\"true\"></i></div>'\n                + '</div>';\n                $('#chooseBonusProductModal .selected-bonus-products').append(selectedBonusProductHtml);\n                $('.pre-cart-products').html(totalQty);\n                $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n            } else {\n                $('.selected-bonus-products .bonus-summary').addClass('alert-danger');\n            }\n        });\n    },\n    removeBonusProduct: function () {\n        $(document).on('click', '.selected-pid', function () {\n            $(this).remove();\n            var $selected = $('#chooseBonusProductModal .selected-bonus-products .selected-pid');\n            var count = 0;\n            if ($selected.length) {\n                $selected.each(function () {\n                    count += parseInt($(this).data('qty'), 10);\n                });\n            }\n\n            $('.pre-cart-products').html(count);\n            $('.selected-bonus-products .bonus-summary').removeClass('alert-danger');\n        });\n    },\n    enableBonusProductSelection: function () {\n        $('body').on('bonusproduct:updateSelectButton', function (e, response) {\n            $('button.select-bonus-product', response.$productContainer).attr(\n                'disabled',\n                (!response.product.readyToOrder || !response.product.available)\n            );\n            var pid = response.product.id;\n            $('button.select-bonus-product', response.$productContainer).data('pid', pid);\n        });\n    },\n    showMoreBonusProducts: function () {\n        $(document).on('click', '.show-more-bonus-products', function () {\n            var url = $(this).data('url');\n            $('.modal-content').spinner().start();\n            $.ajax({\n                url: url,\n                method: 'GET',\n                success: function (html) {\n                    var parsedHtml = parseHtml(html);\n                    $('.modal-body').append(parsedHtml.body);\n                    $('.show-more-bonus-products:first').remove();\n                    $('.modal-content').spinner().stop();\n                },\n                error: function () {\n                    $('.modal-content').spinner().stop();\n                }\n            });\n        });\n    },\n    addBonusProductsToCart: function () {\n        $(document).on('click', '.add-bonus-products', function () {\n            var $readyToOrderBonusProducts = $('.choose-bonus-product-dialog .selected-pid');\n            var queryString = '?pids=';\n            var url = $('.choose-bonus-product-dialog').data('addtocarturl');\n            var pidsObject = {\n                bonusProducts: []\n            };\n\n            $.each($readyToOrderBonusProducts, function () {\n                var qtyOption = parseInt($(this)\n                    .data('qty'), 10);\n\n                var option = null;\n                if (qtyOption > 0) {\n                    if ($(this).data('optionid') && $(this).data('option-selected-value')) {\n                        option = {};\n                        option.optionId = $(this).data('optionid');\n                        option.productId = $(this).data('pid');\n                        option.selectedValueId = $(this).data('option-selected-value');\n                    }\n                    pidsObject.bonusProducts.push({\n                        pid: $(this).data('pid'),\n                        qty: qtyOption,\n                        options: [option]\n                    });\n                    pidsObject.totalQty = parseInt($('.pre-cart-products').html(), 10);\n                }\n            });\n            queryString += JSON.stringify(pidsObject);\n            queryString = queryString + '&uuid=' + $('.choose-bonus-product-dialog').data('uuid');\n            queryString = queryString + '&pliuuid=' + $('.choose-bonus-product-dialog').data('pliuuid');\n            $.spinner().start();\n            $.ajax({\n                url: url + queryString,\n                method: 'POST',\n                success: function (data) {\n                    $.spinner().stop();\n                    if (data.error) {\n                        $('#chooseBonusProductModal').modal('hide');\n                        if ($('.add-to-cart-messages').length === 0) {\n                            $('body').append('<div class=\"add-to-cart-messages\"></div>');\n                        }\n                        $('.add-to-cart-messages').append(\n                            '<div class=\"alert alert-danger add-to-basket-alert text-center\"'\n                            + ' role=\"alert\">'\n                            + data.errorMessage + '</div>'\n                        );\n                        setTimeout(function () {\n                            $('.add-to-basket-alert').remove();\n                        }, 3000);\n                    } else {\n                        $('.configure-bonus-product-attributes').html(data);\n                        $('.bonus-products-step2').removeClass('hidden-xl-down');\n                        $('#chooseBonusProductModal').modal('hide');\n\n                        if ($('.add-to-cart-messages').length === 0) {\n                            $('body').append('<div class=\"add-to-cart-messages\"></div>');\n                        }\n                        $('.minicart-quantity').html(data.totalQty);\n                        $('.add-to-cart-messages').append(\n                            '<div class=\"alert alert-success add-to-basket-alert text-center\"'\n                            + ' role=\"alert\">'\n                            + data.msgSuccess + '</div>'\n                        );\n                        setTimeout(function () {\n                            $('.add-to-basket-alert').remove();\n                            if ($('.cart-page').length) {\n                                location.reload();\n                            }\n                        }, 1500);\n                    }\n                },\n                error: function () {\n                    $.spinner().stop();\n                }\n            });\n        });\n    },\n\n    getPidValue: getPidValue,\n    getQuantitySelected: getQuantitySelected,\n    miniCartReportingUrl: miniCartReportingUrl\n};\n","'use strict';\n\nvar base = require('./base');\nvar focusHelper = require('../components/focus');\n\n/**\n * Generates the modal window on the first call.\n *\n */\nfunction getModalHtmlElement() {\n    if ($('#quickViewModal').length !== 0) {\n        $('#quickViewModal').remove();\n    }\n    var htmlString = '<!-- Modal -->'\n        + '<div class=\"modal fade\" id=\"quickViewModal\" role=\"dialog\">'\n        + '<span class=\"enter-message sr-only\" ></span>'\n        + '<div class=\"modal-dialog quick-view-dialog\">'\n        + '<!-- Modal content-->'\n        + '<div class=\"modal-content\">'\n        + '<div class=\"modal-header\">'\n        + '    <a class=\"full-pdp-link\" href=\"\"></a>'\n        + '    <button type=\"button\" class=\"close pull-right\" data-dismiss=\"modal\">'\n        + '        <span aria-hidden=\"true\">&times;</span>'\n        + '        <span class=\"sr-only\"> </span>'\n        + '    </button>'\n        + '</div>'\n        + '<div class=\"modal-body\"></div>'\n        + '<div class=\"modal-footer\"></div>'\n        + '</div>'\n        + '</div>'\n        + '</div>';\n    $('body').append(htmlString);\n}\n\n/**\n * @typedef {Object} QuickViewHtml\n * @property {string} body - Main Quick View body\n * @property {string} footer - Quick View footer content\n */\n\n/**\n * Parse HTML code in Ajax response\n *\n * @param {string} html - Rendered HTML from quickview template\n * @return {QuickViewHtml} - QuickView content components\n */\nfunction parseHtml(html) {\n    var $html = $('<div>').append($.parseHTML(html));\n\n    var body = $html.find('.product-quickview');\n    var footer = $html.find('.modal-footer').children();\n\n    return { body: body, footer: footer };\n}\n\n/**\n * replaces the content in the modal window on for the selected product variation.\n * @param {string} selectedValueUrl - url to be used to retrieve a new product model\n */\nfunction fillModalElement(selectedValueUrl) {\n    $('.modal-body').spinner().start();\n    $.ajax({\n        url: selectedValueUrl,\n        method: 'GET',\n        dataType: 'json',\n        success: function (data) {\n            var parsedHtml = parseHtml(data.renderedTemplate);\n\n            $('.modal-body').empty();\n            $('.modal-body').html(parsedHtml.body);\n            $('.modal-footer').html(parsedHtml.footer);\n            $('.full-pdp-link').text(data.quickViewFullDetailMsg);\n            $('#quickViewModal .full-pdp-link').attr('href', data.productUrl);\n            $('#quickViewModal .size-chart').attr('href', data.productUrl);\n            $('#quickViewModal .modal-header .close .sr-only').text(data.closeButtonText);\n            $('#quickViewModal .enter-message').text(data.enterDialogMessage);\n            $('#quickViewModal').modal('show');\n            $('body').trigger('quickview:ready');\n\n            $.spinner().stop();\n        },\n        error: function () {\n            $.spinner().stop();\n        }\n    });\n}\n\nmodule.exports = {\n    showQuickview: function () {\n        $('body').on('click', '.quickview', function (e) {\n            e.preventDefault();\n            var selectedValueUrl = $(this).closest('a.quickview').attr('href');\n            $(e.target).trigger('quickview:show');\n            getModalHtmlElement();\n            fillModalElement(selectedValueUrl);\n        });\n    },\n    focusQuickview: function () {\n        $('body').on('shown.bs.modal', '#quickViewModal', function () {\n            $('#quickViewModal .close').focus();\n        });\n    },\n    trapQuickviewFocus: function () {\n        $('body').on('keydown', '#quickViewModal', function (e) {\n            var focusParams = {\n                event: e,\n                containerSelector: '#quickViewModal',\n                firstElementSelector: '.full-pdp-link',\n                lastElementSelector: '.add-to-cart-global',\n                nextToLastElementSelector: '.modal-footer .quantity-select'\n            };\n            focusHelper.setTabNextFocus(focusParams);\n        });\n    },\n    availability: base.availability,\n    addToCart: base.addToCart,\n    showSpinner: function () {\n        $('body').on('product:beforeAddToCart', function (e, data) {\n            $(data).closest('.modal-content').spinner().start();\n        });\n    },\n    hideDialog: function () {\n        $('body').on('product:afterAddToCart', function () {\n            $('#quickViewModal').modal('hide');\n        });\n    },\n    beforeUpdateAttribute: function () {\n        $('body').on('product:beforeAttributeSelect', function () {\n            $('.modal.show .modal-content').spinner().start();\n        });\n    },\n    updateAttribute: function () {\n        $('body').on('product:afterAttributeSelect', function (e, response) {\n            if ($('.modal.show .product-quickview>.bundle-items').length) {\n                $('.modal.show').find(response.container).data('pid', response.data.product.id);\n                $('.modal.show').find(response.container)\n                    .find('.product-id').text(response.data.product.id);\n            } else if ($('.set-items').length) {\n                response.container.find('.product-id').text(response.data.product.id);\n            } else {\n                $('.modal.show .product-quickview').data('pid', response.data.product.id);\n                $('.modal.show .full-pdp-link')\n                    .attr('href', response.data.product.selectedProductUrl);\n            }\n        });\n    },\n    updateAddToCart: function () {\n        $('body').on('product:updateAddToCart', function (e, response) {\n            // update local add to cart (for sets)\n            $('button.add-to-cart', response.$productContainer).attr(\n                'disabled',\n                (!response.product.readyToOrder || !response.product.available)\n            );\n\n            // update global add to cart (single products, bundles)\n            var dialog = $(response.$productContainer)\n                .closest('.quick-view-dialog');\n\n            $('.add-to-cart-global', dialog).attr(\n                'disabled',\n                !$('.global-availability', dialog).data('ready-to-order')\n                || !$('.global-availability', dialog).data('available')\n            );\n        });\n    },\n    updateAvailability: function () {\n        $('body').on('product:updateAvailability', function (e, response) {\n            // bundle individual products\n            $('.product-availability', response.$productContainer)\n                .data('ready-to-order', response.product.readyToOrder)\n                .data('available', response.product.available)\n                .find('.availability-msg')\n                .empty()\n                .html(response.message);\n\n            var dialog = $(response.$productContainer)\n                .closest('.quick-view-dialog');\n\n            if ($('.product-availability', dialog).length) {\n                // bundle all products\n                var allAvailable = $('.product-availability', dialog).toArray()\n                    .every(function (item) { return $(item).data('available'); });\n\n                var allReady = $('.product-availability', dialog).toArray()\n                    .every(function (item) { return $(item).data('ready-to-order'); });\n\n                $('.global-availability', dialog)\n                    .data('ready-to-order', allReady)\n                    .data('available', allAvailable);\n\n                $('.global-availability .availability-msg', dialog).empty()\n                    .html(allReady ? response.message : response.resources.info_selectforstock);\n            } else {\n                // single product\n                $('.global-availability', dialog)\n                    .data('ready-to-order', response.product.readyToOrder)\n                    .data('available', response.product.available)\n                    .find('.availability-msg')\n                    .empty()\n                    .html(response.message);\n            }\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","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import processInclude from \"base/util\";\nimport search from \"./search/search\";\nimport quickView from \"base/product/quickView\";\nimport wishlistHeart from \"./product/wishlistHeart\";\n\n$(document).ready(() => {\n    processInclude(search);\n    processInclude(quickView);\n    processInclude(wishlistHeart);\n\n    if ($(window).width() > 992) {\n        if ($(\".search-field\")[0].value !== null && $(\".search-field\")[0].value !== \"\") {\n            $(\".search-header.js-toggle-search\").trigger(\"click\");\n        }\n    }\n});\n"],"names":[],"sourceRoot":""}