// Netstudio insights. (function(window, document){"use strict";var t="object"==typeof global&&global&&global.Object===Object&&global,e="object"==typeof self&&self&&self.Object===Object&&self,n=(t||e||Function("return this")()).Symbol,c=Object.prototype,o=c.hasOwnProperty,i=c.toString,r=n?n.toStringTag:void 0;var u=Object.prototype.toString;var l=n?n.toStringTag:void 0;function a(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":l&&l in Object(t)?function(t){var e=o.call(t,r),n=t[r];try{t[r]=void 0;var c=!0}catch(t){}var u=i.call(t);return c&&(e?t[r]=n:delete t[r]),u}(t):function(t){return u.call(t)}(t)}function d(t){return null!=t&&"object"==typeof t}function s(t){if(!function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}(t))return!1;var e=a(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}const w=new URL(document.currentScript.src).origin+"/insights/collect";let f=null,m=null,p=null,b=!1;const j=t=>{const e=Object.assign({sr:window.screen.width+"x"+window.screen.height,dl:window.location.href,dt:document.title,de:document.characterSet,vp:window.innerWidth+"x"+window.innerHeight,et:p||(new Date).getTime()},t);document.referrer&&(e.dr=document.referrer),f&&(e.cs=f),b&&((g.user_id||g.userId||g.uid)&&(e.uid=g.user_id||g.userId||g.uid),m&&(e.cid=m)),Object.keys(e).forEach((t=>{null!==e[t]&&void 0!==e[t]&&""!==e[t]||delete e[t]}));const n=new XMLHttpRequest;n.open("POST",w,!0),n.setRequestHeader("Content-Type","application/json"),n.send(JSON.stringify(e))},v=(t,e,n)=>{let c="";if(n){const t=new Date;t.setTime(t.getTime()+24*n*60*60*1e3),c="; expires="+t.toUTCString()}document.cookie=t+"="+(e||"")+c+"; path=/; domain="+(()=>{const t=window.location.hostname.split(".");return t.length>2&&t.shift(),`.${t.join(".")}`})()};const _=({items:t})=>t?.reduce(((t,e,n)=>(t[`tp${n+1}id`]=e.item_id,t[`tp${n+1}nm`]=e.item_name||"",t[`tp${n+1}va`]=e.item_variant||"",t[`tp${n+1}br`]=e.item_brand||"",t[`tp${n+1}c1`]=e.item_category||"",t[`tp${n+1}c2`]=e.item_category2||"",t[`tp${n+1}c3`]=e.item_category3||"",t[`tp${n+1}c4`]=e.item_category4||"",t[`tp${n+1}c5`]=e.item_category5||"",t[`tp${n+1}cu`]=e.currency||"",e.price&&(t[`tp${n+1}pr`]=e.price),e.quantity&&(t[`tp${n+1}qt`]=e.quantity),e.index&&(t[`tp${n+1}ps`]=e.index),t)),{}),y=()=>j({en:"pageview"}),g={},O={"insights.js":y,consent(t,{functionality_storage:e,analytics_storage:n,ad_storage:c}){f=("default"==t?"D":"U")+("granted"===e?"1":"0")+("granted"===n?"1":"0")+("granted"===c?"1":"0"),b="granted"===c||"update"===t,m=(t=>{const e=t+"=",n=document.cookie.split(";");for(let t=0;t{const n=t.toString(16).padStart(2,"0");return 4===e||6===e||8===e||10===e?"-"+n:n})).join("")}()),v("_nicid",m,400)),"update"===t&&j({en:"consent"})},view_item_list:({ecommerce:t})=>j(Object.assign({en:"view_item_list",li:t.item_list_id,ln:t.item_list_name},_(t))),select_item:({ecommerce:t})=>j(Object.assign({en:"select_item",li:t.item_list_id,ln:t.item_list_name},_(t))),view_item:({ecommerce:t})=>j(Object.assign({en:"view_item",cu:t.currency,tr:t.value},_(t))),add_to_cart:({ecommerce:t})=>j(Object.assign({en:"add_to_cart",cu:t.currency,tr:t.value},_(t))),removeFromCart:({ecommerce:t})=>j(Object.assign({en:"remove_from_cart",cu:t.currency,tr:t.value},_(t))),view_cart:({ecommerce:t})=>j(Object.assign({en:"view_cart",cu:t.currency,tr:t.value},_(t))),begin_checkout:({ecommerce:t})=>j(Object.assign({en:"begin_checkout",cu:t.currency,tr:t.value},_(t))),purchase:({ecommerce:t})=>j(Object.assign({en:"purchase",cu:t.currency,ti:t.transaction_id,tr:t.value,ts:t.shipping,tt:t.tax},_(t)))},$=(t,...e)=>{if("function"==typeof O[t])try{O[t](...e)}catch(t){console.error(t)}},h=t=>{for(const n of t)if(void 0===n["insights.processed"]){if(null!=(e=n)&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(e.length)&&!s(e))$(n[0],...Array.from(n).slice(1));else if(s(n))n.apply();else{if(!d(n))continue;n.event?$(n.event,n):Object.assign(g,n)}n["insights.processed"]=!0}var e};if(window.history?.pushState){const t=window.history.pushState;window.history.pushState=function(){t.apply(this,arguments),y()},window.addEventListener("popstate",y)}const F=new Promise((t=>{document.hidden?document.addEventListener("visibilitychange",t,{once:!0}):t()}));!async function(){await F;const t=window.dataLayer.push;window.dataLayer=window.dataLayer||[],window.dataLayer.push=function(...e){try{return t.apply(this,arguments)}finally{h(e)}},p=(new Date).getTime(),h(window.dataLayer),p=null}();})(window, document);