1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[57374],{857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?o(Array.isArray(t)?[]:{},t,e):t}function i(t,e,r){return t.concat(e).map(function(t){return s(t,r)})}function n(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function a(t,e){try{return e in t}catch(t){return!1}}function o(t,r,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=s;var l,u,d=Array.isArray(r);return d!==Array.isArray(t)?s(r,c):d?c.arrayMerge(t,r,c):(u={},(l=c).isMergeableObject(t)&&n(t).forEach(function(e){u[e]=s(t[e],l)}),n(r).forEach(function(e){(!a(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(a(t,e)&&l.isMergeableObject(r[e])?u[e]=(function(t,e){if(!e.customMerge)return o;var r=e.customMerge(t);return"function"==typeof r?r:o})(e,l)(t[e],r[e],l):u[e]=s(r[e],l))}),u)}o.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,r){return o(t,r,e)}
1,{})},t.exports=o},374:(t,e,r)=>{r.r(e),r.d(e,{default:()=>n});var s=r(293),i=r(107);class n extends s.Z{init(){this._client=new i.Z,this._sessionId=this._getOrCreateSession(),this._currentAnalyticsId=sessionStorage.getItem(this.options.analyticsIdKey),this._lastTrackedTerm=sessionStorage.getItem(this.options.lastSearchTermKey),this._productAnalyticsMap=this._loadProductAnalyticsMap(),this._isObserving=!1,this._isTrackingInProgress=!1,this._pendingTrackTerm=null,this._lastInputTime=0,this._pendingSearchTerm=null,this._basePath=this._getBasePath(),this._clearLastClickedIfNotOnPDP(),this._registerEventListeners(),this._observeSearchPopup(),this._trackSearchPageIfNeeded(),this._trackConversionIfOnFinishPage()}_getOrCreateSession(){let t=sessionStorage.getItem(this.options.sessionKey);return t||(t=this._generateUUID(),sessionStorage.setItem(this.options.sessionKey,t)),t}_loadProductAnalyticsMap(){try{let t=sessionStorage.getItem(this.options.productAnalyticsMapKey);return t?JSON.parse(t):{}}catch(t){return{}}}_saveProductAnalyticsMap(){sessionStorage.setItem(this.options.productAnalyticsMapKey,JSON.stringify(this._productAnalyticsMap))}_registerEventListeners(){this._registerClickTracking(),this._registerCartTracking()}_observeSearchPopup(){this._isObserving||(this._isObserving=!0,new MutationObserver(t=>{t.forEach(t=>{t.addedNodes.forEach(t=>{t.nodeType===Node.ELEMENT_NODE&&(t.matches&&(t.matches(this.options.searchPopupSelector)||t.querySelector&&t.querySelector(this.options.searchPopupSelector))&&this._onSearchPopupAppeared(),t.matches&&(t.matches(this.options.searchContainerSelector)||t.querySelector&&t.querySelector(this.options.searchContainerSelector))&&this._onSearchPopupAppeared())})})}).observe(document.body,{childList:!0,subtree:!0}),document.addEventListener("input",t=>{let e=t.target.closest(this.options.searchInputSelector);e&&(clearTimeout(this._searchDebounce),clearTimeout(this._popupDebounce),this._lastInputTime=Date.now(),this._pendingSearchTerm=e.value.trim(),this._searchDebounce=setTimeout(()=>{this._checkAndTrackSearch()},1500))}),document.addEventListener("focusout",t=>{t.target.closest(this.options.searchInputSelector)&&this._pendingSearchTerm&&(clearTimeout(this._searchDebounce),clearTimeout(this._popupDebounce),this._checkAndTrackSearch())}))}_onSearchPopupAppeared(){}_checkAndTrackSearch(){let t=this._getSearchTerm();!t||t.length<2||t===this._lastTrackedTerm||this._isTrackingInProgress&&this._pendingTrackTerm===t||this._waitForResultsAndTrack(t)}_waitForResultsAndTrack(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=document.querySelector(this.options.searchContainerSelector);if(r&&(r.querySelector(this.options.resultCountSelector)||r.querySelector(".search-suggest-product, .js-result, [data-search-position]"))||e>=10){let e=this._getResultCount();this._trackSearch(t,e)}else setTimeout(()=>{this._getSearchTerm()===t&&this._waitForResultsAndTrack(t,e+1)},200)}_trackSearchPageIfNeeded(){let t=new URLSearchParams(window.location.search).get("search");if(!t||t===this._lastTrackedTerm)return;let e=0;for(let t of[".search-result-count",".listing-pagination-total","[data-listing-pagination] .pagination-total",this.options.resultCountSelector]){let r=document.querySelector(t);if(r){let t=r.textContent.match(/\d+/);if(t){e=parseInt(t[0],10);break}}}0===e&&(e=document.querySelectorAll(".product-box, .cms-listing-row .card").length),this._trackSearch(t,e)}_getSearchTerm(){for(let t of document.querySelectorAll(this.options.searchInputSelector))if(t.value&&t.value.trim().length>0)return t.value.trim();return""}_getResultCount(){let t=document.querySelector(this.options.searchContainerSelector);if(!t)return 0;let e=t.querySelector(this.options.resultCountSelector);if(e){let t=e.textContent.match(/\d+/);if(t)return parseInt(t[0],10)}let r=t.getAttribute("data-max");return r?parseInt(r,10):t.querySelectorAll(".search-suggest-product, .js-result").length}_trackSearch(t,e){this._isTrackingInProgress=!0,this._pendingTrackTerm=t,this._lastTrackedTerm=t,sessionStorage.setItem(this.options.lastSearchTermKey,t);let r={sessionId:this._sessionId,searchTerm:t,resultCount:e};this._client.post(this._getTrackingUrl("search"),JSON.stringify(r),t=>{this._isTrackingInProgress=!1,this._pendingTrackTerm=null;try{let e=JSON.parse(t);e.success&&e.analyticsId&&(this._currentAnalyticsId=e.analyticsId,sessionStorage.setItem(this.options.analyticsIdKey,e.analyticsId))}catch(t){}})}_registerClickTracking(){document.addEventListener("click",t=>{let e=t.target.closest("[data-search-position]");if(!e)return;let r=this._currentAnalyticsId;if(!r)return;let s=parseInt(e.dataset.searchPosition,10),i=e.dataset.productId||"",n=e.dataset.productNumber||e.dataset.number||"",a=e.dataset.productName||e.title||"";s>0&&i&&(this._productAnalyticsMap[i]=r,this._saveProductAnalyticsMap(),sessionStorage.setItem(this.options.lastClickedAnalyticsKey,r),this._trackClick(i,n,a,s))})}
1_trackClick(t,e,r,s){let i={analyticsId:this._currentAnalyticsId,productId:t,productNumber:e,productName:r,position:s};this._client.post(this._getTrackingUrl("click"),JSON.stringify(i),()=>{})}_registerCartTracking(){document.addEventListener("click",t=>{let e=t.target.closest(this.options.addToCartSelector);if(!e||!this._sessionId)return;let r=this._findProductId(e);if(r){if(!this._productAnalyticsMap[r]){let t=sessionStorage.getItem(this.options.lastClickedAnalyticsKey);t&&(this._productAnalyticsMap[r]=t,this._saveProductAnalyticsMap())}this._trackAddToCart(r)}}),document.$emitter&&document.$emitter.subscribe("cart:add",t=>{if(t.detail&&t.detail.productId){let e=t.detail.productId;if(!this._productAnalyticsMap[e]){let t=sessionStorage.getItem(this.options.lastClickedAnalyticsKey);t&&(this._productAnalyticsMap[e]=t,this._saveProductAnalyticsMap())}this._trackAddToCart(e)}})}_findProductId(t){if(t.dataset.productId)return t.dataset.productId;let e=t.closest("form");if(e){let t=e.querySelector('input[name="productId"], input[name="id"], input[name="lineItems[0][id]"]');if(t)return t.value}let r=t.closest("[data-product-id]");if(r)return r.dataset.productId;let s=document.querySelector('[itemprop="productID"]');return s?s.content||s.getAttribute("content"):null}_trackAddToCart(t){let e={sessionId:this._sessionId,productId:t};this._client.post(this._getTrackingUrl("cart"),JSON.stringify(e),()=>{})}_trackConversionIfOnFinishPage(){if(!(window.location.pathname.includes("/checkout/finish")||document.querySelector(".checkout-finish-page")||document.querySelector(".finish-order")||document.querySelector("[data-checkout-finish]"))||!this._sessionId||0===Object.keys(this._productAnalyticsMap).length)return;let t=this._getPurchasedProductIds(),e=new Set;for(let r of t)this._productAnalyticsMap[r]&&e.add(this._productAnalyticsMap[r]);if(0!==e.size){for(let t of e)this._trackConversion(t);this._productAnalyticsMap={},this._saveProductAnalyticsMap()}}_getPurchasedProductIds(){let t=[];for(let e of["[data-product-id]",".line-item[data-id]",".line-item-product[data-id]",'[itemprop="orderedItem"] [data-product-id]',".checkout-finish-product[data-product-id]"])document.querySelectorAll(e).forEach(e=>{let r=e.dataset.productId||e.dataset.id;r&&!t.includes(r)&&t.push(r)});return document.querySelectorAll('input[name*="productId"], input[name*="product-id"]').forEach(e=>{e.value&&!t.includes(e.value)&&t.push(e.value)}),t}_trackConversion(t){let e={sessionId:this._sessionId,analyticsId:t};this._client.post(this._getTrackingUrl("conversion"),JSON.stringify(e),()=>{})}_generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}_clearLastClickedIfNotOnPDP(){document.querySelector(".product-detail")||document.querySelector(".product-detail-page")||document.querySelector('[itemprop="productID"]')||window.location.pathname.includes("/detail/")||sessionStorage.removeItem(this.options.lastClickedAnalyticsKey)}_getBasePath(){let t=document.getElementById("sisi-analytics-config");if(t&&void 0!==t.dataset.basePath)return t.dataset.basePath;if(window.router&&window.router["frontend.home.page"])try{return new URL(window.router["frontend.home.page"],window.location.origin).pathname.replace(/\/$/,"")||""}catch(t){}return""}_getTrackingUrl(t){return"".concat(this._basePath).concat(this.options.trackingEndpoint,"/").concat(t)}}n.options={trackingEndpoint:"/sisi-track",sessionKey:"sisi_analytics_session",analyticsIdKey:"sisi_analytics_id",lastSearchTermKey:"sisi_last_search_term",productAnalyticsMapKey:"sisi_product_analytics_map",lastClickedAnalyticsKey:"sisi_last_clicked_analytics",searchInputSelector:'.header-search-input, [data-search-widget] input[type="search"], input[name="search"]',searchPopupSelector:".search-suggest, .js-search-result",searchContainerSelector:".search-suggest-container, .sisi-search-suggest-container",resultCountSelector:".search-suggest-total-count",productLinkSelector:".search-suggest-product-link[data-search-position]",addToCartSelector:".btn-buy, [data-add-to-cart]"}},49:(t,e,r)=>{r.d(e,{Z:()=>i});var s=r(140);
1class i{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!i.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===i.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=e.replace(/^data(|-)/,""),a=s.Z.toLowerCamelCase(n,"-");if(!i.isNode(t)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let o=t.dataset[a];if(void 0===o){if(r)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return o}return s.Z.parsePrimitive(o)}static querySelector(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelector(e)||!1;if(r&&!1===s)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return s}static querySelectorAll(t,e){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(t))throw Error("The parent node is not a valid HTML Node!");let s=t.querySelectorAll(e);if(0===s.length&&(s=!1),r&&!1===s)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return s}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.querySelectorAll('\n input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n select:not([tabindex^="-"]):not([disabled]),\n textarea:not([tabindex^="-"]):not([disabled]),\n button:not([tabindex^="-"]):not([disabled]),\n a[href]:not([tabindex^="-"]):not([disabled]),\n [tabindex]:not([tabindex^="-"]):not([disabled])\n ')}static getFirstFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}},140:(t,e,r)=>{r.d(e,{Z:()=>s});class s{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let r=s.toUpperCamelCase(t,e);return s.lcFirst(r)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>s.ucFirst(t.toLowerCase())).join(""):s.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}},293:(t,e,r)=>{r.d(e,{Z:()=>c});var s=r(857),i=r.n(s),n=r(49),a=r(140);class o{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(t,{detail:e,cancelable:r});return this.el.dispatchEvent(s),s}subscribe(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,i=t.split("."),n=r.scope?e.bind(r.scope):e;if(r.once&&!0===r.once){let e=n;n=function(r){s.unsubscribe(t),e(r)}}return this.el.addEventListener(i[0],n),this.listeners.push({splitEventName:i,opts:r,cb:n}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,r)=>([...r.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):t.push(r),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}
1class c{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(t){let e=a.Z.toDashCase(this._pluginName),r=n.Z.getDataAttribute(this.el,"data-".concat(e,"-config"),!1),s=n.Z.getAttribute(this.el,"data-".concat(e,"-options"),!1),o=[this.constructor.options,this.options,t];r&&o.push(window.PluginConfigManager.get(this._pluginName,r));try{s&&o.push(JSON.parse(s))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(e,'-options" could not be parsed to json: ').concat(t.message))}return i().all(o.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},r=!1){if(!n.Z.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}},107:(t,e,r)=>{r.d(e,{Z:()=>s});class s{get(t,e){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,r);return this._sendRequest(s,null,e)}post(t,e,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("POST",t,s);return this._sendRequest(i,e,r)}delete(t,e,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(i,e,r)}patch(t,e,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let i=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(i,e,r)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,r){return this._registerOnLoaded(t,r),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,r){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.