window.__BECHTLE_SERVER_CTX__ = {"country":"AT","language":"fr","bid":"e6f4fbb0ecd442d3acb2ae77f62144f8_1783049946936_e7126240712ca2e0782ef68322af22d1","vid":"0868f9977328491bb0c5f3ca31435181","user":{"context":"anonymous","xInternal":false,"isInCustomerContext":false,"isInternalUser":false},"tenant":"bechtle"};
(function(){"use strict";function x(){document.cookie.indexOf("_dy_cs_gcg")<0&&(!(Math.floor(Math.random()*100)<5)||document.cookie.indexOf("autotest=true")>=0?D("Dynamic Yield Experiences"):D("Control Group"))}function D(n){const e=new Date(Date.now()+3154e10);document.cookie=`_dy_cs_gcg=${n};path=/;expires=${e};`}function S(){document.cookie="_dy_cs_gcg=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function U(){const n={},e={BECHTLE_SERVER_CTX_READY:[],CONSENT_CHANGE:[],PAGE_TYPE_READY:[],GTM_ID_READY:[],PERSISTENCE_ID_CHANGE:[],REALTIME_FILTER_READY:[],BEUS_TRACKING_CTX_READY:[]};return{get currentState(){return n},get listeners(){return e},on(t,o){const i=n[t];i!==void 0&&o(i),e[t].push({listener:o,isOnce:!1})},once(t,o){const i=n[t];if(i!==void 0)return o(i);e[t].push({listener:o,isOnce:!0})},off(t,o){const i=e[t].map(s=>s.listener).indexOf(o);e[t].splice(i,1)},dispatch(t,o){n[t]=o,e[t].forEach(({listener:s})=>{s(o)});const i=e[t].filter(({isOnce:s})=>!s).map(s=>s);e[t]=i},reset(t){n[t]=void 0,e[t].forEach(({listener:o})=>o(void 0))}}}const k=n=>typeof n=="string",L=(n,e,t)=>n&&k(n)?n.split(";").reduce((o,i)=>{const[s,p]=i.split("=").map(l=>l.trim());return o[decodeURIComponent(s)]=decodeURIComponent(p),o},{})[e]:t,r=[];for(let n=0;n<256;++n)r.push((n+256).toString(16).slice(1));function N(n,e=0){return(r[n[e+0]]+r[n[e+1]]+r[n[e+2]]+r[n[e+3]]+"-"+r[n[e+4]]+r[n[e+5]]+"-"+r[n[e+6]]+r[n[e+7]]+"-"+r[n[e+8]]+r[n[e+9]]+"-"+r[n[e+10]]+r[n[e+11]]+r[n[e+12]]+r[n[e+13]]+r[n[e+14]]+r[n[e+15]]).toLowerCase()}let y;const G=new Uint8Array(16);function H(){if(!y){if(typeof crypto=="undefined"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");y=crypto.getRandomValues.bind(crypto)}return y(G)}var f={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Y(n,e,t){var i,s,p;if(f.randomUUID&&!e&&!n)return f.randomUUID();n=n||{};const o=(p=(s=n.random)!=null?s:(i=n.rng)==null?void 0:i.call(n))!=null?p:H();if(o.length<16)throw new Error("Random bytes length must be >= 16");if(o[6]=o[6]&15|64,o[8]=o[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let l=0;l<16;++l)e[t+l]=o[l];return e}return N(o)}const M=()=>{if(document.cookie.includes("bechtle-p"))return L(document.cookie,"bechtle-p","");{const n=new Date;n.setMonth(n.getMonth()+13);const e=Y();return document.cookie=`bechtle-p=${e};path=/;expires=${n};`,e}},P=()=>{document.cookie="bechtle-p=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT;"};function B(n){window.addEventListener("UC_EVENT",function(e){n(e.detail)})}const V=()=>{window.ACC=window.ACC||{config:{}}},g={portfolioType:0,showDynamicContent:!0};async function O(){return fetch("/api/beus/context/tracking",{credentials:"include",headers:new Headers({accept:"application/json"})}).then(async n=>n.status===200?await n.json():(console.error("Response status was not successful, using default TrackingContext"),g)).catch(()=>(console.error("Error fetching from BeUS, using default TrackingContext"),g))}const F=async n=>{var e,t,o,i;const s=n?await O():g;(t=(e=window.bechtle)==null?void 0:e.events)==null||t.dispatch("BEUS_TRACKING_CTX_READY",s);const{portfolioType:p,showDynamicContent:l}=s,h=p===1?"portfolio":p===2?"special_portfolio":"no_portfolio";(i=(o=window.bechtle)==null?void 0:o.analytics)==null||i.data("init_preferences",{event:"init_preferences",dc_preferences:{portfolio_type:h,show_dynamic_content:l}})},$=n=>{var e,t;const{language:o,country:i,vid:s,user:p}=n,{partnerId:l,hashedEMail:h,customer:w,context:_,seco:C,isProcurementUser:v,xInternal:R,xCustomer:T}=p,c=R?"intern":"extern",a=v?"punchout":"public",d=_==="admin"?"employee-global":_.length!==0?_:"anonymous",u={shop_country:i,shop_language:o,vid:s,context:d,procurement:a,intern:c};l&&(u.partner=l),h&&(u.logged_in="login",u.modus=C?"self":"care",u.hashed_email=h,u.be_nr=T||w),(t=(e=window.bechtle)==null?void 0:e.analytics)==null||t.data("init_session_data",{event:"init_session_data",session_data:u})},X=["init_session_data","init_preferences"],W=()=>{var n;const e=window.dataLayer=(n=window.dataLayer)!=null?n:[],t=[{"gtm.start":new Date().getTime(),event:"gtm.js"}];let o=!1,i=!1;const s=()=>{for(i=!0;t.length;){const c=t.shift();c&&e.push(c)}},p=c=>i?e.push(c):t.push(c),l={};let h=[];const w=c=>c.every(a=>l[a]!==void 0),_=(c,a)=>{const d=typeof c=="function"?c(l):c;a?i=!0:o=!0,Array.isArray(d)?d.forEach(u=>e.push(u)):e.push(d),a&&s()},C=()=>{const{allDepsReady:c,stillWaiting:a}=h.reduce((d,u)=>(w(u.dependentFrom)?d.allDepsReady.push(u):d.stillWaiting.push(u),d),{allDepsReady:[],stillWaiting:[]});h=a,c.forEach(d=>_(d.callback,d.flush))},v=(c,a,d)=>{i&&!d&&e.push(a),l[c]=a,C()},R=(c,a)=>{var d,u;if(typeof c!="function"&&!a){const j=c;c=I=>[I.init_session_data,j,I.init_preferences]}const m={callback:c,dependentFrom:(d=a==null?void 0:a.dependentFrom)!=null?d:X,flush:(u=a==null?void 0:a.flush)!=null?u:!0};w(m.dependentFrom)?_(m.callback,m.flush):h.push(m)},T=window.dataLayer.push;return window.dataLayer.push=function(c){return i||o?(o&&(o=!1),T.apply(window.dataLayer,[c])):(t.push(c),t.length)},{data:v,ready:R,push:p,queue:t,waitingForData:h,dataStorage:l}},b=U(),A=W();window.bechtle?(window.bechtle.events=b,window.bechtle.analytics=A):window.bechtle={events:b,analytics:A},window.dispatchEvent(new CustomEvent("BECHTLE_LIB_READY"));const E=window.__BECHTLE_SERVER_CTX__;window.bechtle.events.dispatch("BECHTLE_SERVER_CTX_READY",E),window.dispatchEvent(new CustomEvent("BECHTLE_SERVER_CTX_READY",{detail:E})),$(E),F(!!E.user.hashedEMail),V(),B(n=>{if(window.bechtle.events.dispatch("CONSENT_CHANGE",n),n["Persistence ID"]){const e=M();window.bechtle.events.dispatch("PERSISTENCE_ID_CHANGE",e)}else P(),window.bechtle.events.dispatch("PERSISTENCE_ID_CHANGE",null);n["Dynamic Yield"]?x():S()})})();
