PageSourceSearch

https://www.swd-ag.de/_next/static/chunks/3i9yjnjwflreh.js

js swd-ag.de collected 2026-10-02 03:04:43 UTC 46,493 bytes, 186 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,811705,e=>{"use strict";var t=e.i(632989),n=e.i(618566),i=e.i(271645);let r="_ts_script",o={"data-desktop-y-offset":"0","data-mobile-y-offset":"0","data-desktop-disable-reviews":"false","data-desktop-enable-custom":"false","data-desktop-position":"right","data-desktop-custom-width":"156","data-desktop-enable-fadeout":"false","data-disable-mobile":"false","data-disable-trustbadge":"false","data-mobile-custom-width":"156","data-mobile-disable-reviews":"false","data-mobile-enable-custom":"false","data-mobile-position":"left","data-mobile-enable-topbar":"false","data-mobile-enable-fadeout":"true","data-color-scheme":"light"},a=()=>{document.getElementById(r)?.remove(),document.querySelector('[id^="trustbadge-container-"]')?.remove()};e.s(["default",0,function(){let e=(0,n.usePathname)(),[s,l]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let e=()=>{let e=(0,t.checkConsentForServiceByName)("Trusted Shops Trustbadge");void 0!==e&&l(e)};e();let n=["UC_UI_INITIALIZED","onConsentStatusChange"].map(t=>{let n=()=>{e()};return window.addEventListener(t,n),{eventName:t,handler:n}});return()=>{n.forEach(({eventName:e,handler:t})=>{window.removeEventListener(e,t)})}},[]),(0,i.useEffect)(()=>{let e=()=>{document.querySelectorAll('[data-testid="trstd-login-toggle"]').forEach(e=>e.style.setProperty("display","none","important"))},t=new MutationObserver(e);return t.observe(document.body,{childList:!0,subtree:!0}),e(),()=>t.disconnect()},[]),(0,i.useEffect)(()=>{if(e){if(/^\/$|bestellprozess\/danke-seite|bestellprozess\/tarifuebersicht|bestellung\/produktauswahl|bestellung\/danke/.test(e)&&s){if(!document.getElementById(r)){let e=document.createElement("script");e.id=r,e.async=!0,e.setAttribute("charset","UTF-8"),Object.entries(o).forEach(([t,n])=>e.setAttribute(t,n)),e.src="https://widgets.trustedshops.com/js/XD651DC8FC9B6B4871E24532B5F493038.js",document.body.appendChild(e)}}else a();return()=>{a()}}},[e,s]),null}])},142952,e=>{"use strict";var t=e.i(399126);function n(e,t="smooth"){if("smooth"===("smooth"===t&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":t))return void e.scrollIntoView({block:"start",behavior:"smooth"});let i=document.documentElement,r=i.style.scrollBehavior;i.style.scrollBehavior="auto";try{let t,n;n=Math.max(0,e.getBoundingClientRect().top+window.scrollY-(t=Number.parseFloat(window.getComputedStyle(e).scrollMarginTop),Number.isFinite(t)?t:0)),window.scrollTo({top:n,behavior:"auto"})}finally{i.style.scrollBehavior=r}}var i=e.i(618566),r=e.i(271645);e.s(["default",0,()=>{let e;return e=(0,i.usePathname)(),(0,r.useEffect)(()=>{let e=e=>{let i=e.target?.closest("a[href]");if(!(i instanceof HTMLAnchorElement))return;let r=function(e){let n=window.location.pathname,i=e.getAttribute("href");if(i){let e=(0,t.getSamePageHashHref)(n,i);if(e)return e}try{let i=new URL(e.href);return(0,t.getSamePageHashHref)(n,`${i.pathname}${i.search}${i.hash}`)}catch{return null}}(i);if(r){let i;e.preventDefault(),!function(e){let i=(0,t.normalizeHashFragment)(e);if(!i)return!1;let r=decodeURIComponent(i.slice(1)),o=document.getElementById(r);return!!o&&((0,t.normalizeHashFragment)(window.location.hash)!==i&&window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${i}`),n(o),!0)}(r)&&(i=(0,t.normalizeHashFragment)(r))&&(0,t.normalizeHashFragment)(window.location.hash)!==i&&window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${i}`)}};return document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[]),(0,r.useEffect)(()=>{let e,i=()=>{let i,r,o,a,s,l,d;e?.(),(l=(0,t.normalizeHashFragment)(window.location.hash))&&window.location.hash!==l&&window.history.replaceState(null,"",`${window.location.pathname}${window.location.search}${l}`);let c=(d=(0,t.normalizeHashFragment)(window.location.hash))?decodeURIComponent(d.slice(1)):null;if(!c){e=void 0;return}let u=!1,g=!1,f=0,w=()=>{r?.disconnect(),a?.disconnect(),void 0!==o&&clearInterval(o),void 0!==i&&clearTimeout(i),void 0!==s&&clearTimeout(s)},h=async()=>
1{if(u)return;let e=document.getElementById(c);!e||(await function(e=2e3){return new Promise(t=>{let n=!1,i=()=>{n||(n=!0,t())},r=window.setTimeout(i,e);try{document.fonts?.ready.then(()=>{window.clearTimeout(r),i()})}catch{window.clearTimeout(r),i()}})}(),u||(await new Promise(e=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>e())})}),u||(f=Date.now()+300,n(e,"auto"),r?.disconnect(),r=void 0,void 0!==o&&(clearInterval(o),o=void 0),g=!0)))},p=()=>{u||(void 0!==i&&clearTimeout(i),i=window.setTimeout(()=>{h()},50))},y=()=>{!g||Date.now()<f||(u=!0,w())};h(),(a=new ResizeObserver(p)).observe(document.documentElement),(r=new MutationObserver(p)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["id"]}),o=window.setInterval(()=>{g||p()},250),window.addEventListener("load",p),window.addEventListener("scroll",y,{passive:!0}),s=window.setTimeout(()=>{u=!0,w()},2e4),e=()=>{u=!0,window.removeEventListener("load",p),window.removeEventListener("scroll",y),w()}};return i(),window.addEventListener("hashchange",i),window.addEventListener("popstate",i),()=>{window.removeEventListener("hashchange",i),window.removeEventListener("popstate",i),e?.()}},[e]),null}],142952)},85025,e=>{"use strict";var t=e.i(247167),n=e.i(843476);let i={noCookies:!0,recommendationContext:{type:"HOMEPAGE"}};function r(e){try{if(window.DY=window.DY||{...i},!window.DYO?.ActiveConsent)return window.__pendingDyConsent=e,!1;let t=window.DYO.ActiveConsent.isUserOptOut();return window.DY.userActiveConsent={accepted:e},window.DYO.ActiveConsent.updateConsentAcceptedStatus(e),window.dyUserActiveConsentOverride=!1,t&&window.DY.API&&window.DY.API("track_pageview"),window.__pendingDyConsent=void 0,!0}catch{return window.__pendingDyConsent=e,!1}}function o(){"boolean"==typeof window.__pendingDyConsent&&r(window.__pendingDyConsent)}function a(){window.__applyDyConsent=r,window.__onDyScriptLoad=o}a();var s=e.i(557105),l=e.i(3303);function d(){try{o()}catch(e){}}a(),e.s(["default",0,()=>{let e=(0,s.useSettings)(),i=t.default.env.NEXT_PUBLIC_USERLIKE_WIDGET_URL,r=t.default.env.NEXT_PUBLIC_GTM_CONTAINER_ID||"GTM-5FSVPSZ";return null==e?(0,n.jsx)(n.Fragment,{}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(l.default,{id:"userCentricsConsentBootstrap",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`
2            // Dynamic Yield in Cookie-less Mode vorbereiten
3            var DY={noCookies:!0, recommendationContext:{type: "HOMEPAGE"}};
4            window.DY = window.DY || DY;
5
6            window.addEventListener('onConsentStatusChange', function (event) {
7              if (!event.detail || event.detail.event !== 'consent_status') {
8                return;
9              }
10              const accepted = !!event.detail["FirstSpirit ICE"] || (event.detail.type === 'implicit' && typeof dyUserActiveConsentOverride === 'boolean' && dyUserActiveConsentOverride);
11              if (typeof window.__applyDyConsent === 'function') {
12                window.__applyDyConsent(accepted);
13              } else {
14                window.__pendingDyConsent = accepted;
15              }
16
17              if (event.detail["Google Tag Manager"]) {
18                // Persistent flag readable later by the GTM block
19                window.__gtmConsentGiven = true;
20
21                // Capture the first post-consent interaction (for immediate init if already interacted)
22                try {
23                  window.__gtmHadInteraction = false;
24                  
25                  ['pointerdown','scroll','mousemove','touchstart','click'].forEach(function(t){
26                    document.addEventListener(t, function markOnce(){
27                      window.__gtmHadInteraction = true;
28                    }, { passive: true, once: true });
29                  });
30
31                  document.addEventListener('keydown', function markOnceKey(){
32                    window.__gtmHadInteraction = true;
33                  }, { once: true });
34                } catch (e) {} 
35              
36                try { window.dispatchEvent(new CustomEvent('gtmConsentGiven')); } catch (e) {}
37              
38            }
39              if(!!event.detail["Userlike"]){
40                if (typeof initUserlike === 'function') {
41                  initUserlike();
42                }
43              }
44              if(!!event.detail["Sikom"]) {
45                if (typeof initSikom === 'function') {
46                  initSikom();
47                }
48              }
49            });
50
51          `}}),(0,n.jsx)(l.default,{id:"gtm",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`
52                (function () {
53                  var GTM_CONTAINER_ID = ${JSON.stringify(r)};
54                  var GTM_DELAY_MS = 2500;
55                  var gtmDidInit = false;
56                  var SCRIPT_ID = 'gtm-script';
57                  
58                  function markReady() {
59                    try { window.dispatchEvent(new CustomEvent('gtm-ready', { detail: { containerId: GTM_CONTAINER_ID } })); } catch (e) {}
60                  }
61                  
62                  // If GTM already exists (e.g., SPA nav or prerender), mark ready and skip reinjection
63                  try {
64                    if (window.google_tag_manager && Object.keys(window.google_tag_manager).length > 0) {
65                      markReady();
66                      return;
67                    }
68                  } catch (e) {}
69
70                  function injectGTM() {
71                    try {
72                      if (document.getElementById(SCRIPT_ID)) { markReady(); return; }
73                    } catch (e) {}
74                    (function (w, d, s, l, i) {
75                      w[l] = w[l] || [];
76                      w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
77                      var f = d.getElementsByTagName(s)[0],
78                          j = d.createElement(s),
79                          dl = l != "dataLayer" ? "&l=" + l : "";
80                      j.id = SCRIPT_ID;
81                      j.async = true;
82                      j.src = "https://sgtm.swd-ag.de/gtm.js?id=" + i + dl;
83                      j.onload = markReady;
84                      f.parentNode.insertBefore(j, f);
85                    })(window, document, "script", "dataLayer", GTM_CONTAINER_ID);
86                  }
87
88                  function reloadCustomerStatusCookie(){
89                    try {
90                      var linkElement = document.getElementById('customerStatusServerResource');
91                      if(!!linkElement){
92                        var href = '' + linkElement.href;
93                        linkElement.href = href + (href.indexOf('?') === -1 ? '?' : '&') + 'rnd=' + Math.random();
94                      }
95                    } catch (e) {}
96                  }
97
98                  function initGTMOnce() {
99                    if (gtmDidInit) return;
100                    gtmDidInit = true;
101                    injectGTM();
102                    reloadCustomerStatusCookie();
103                  }
104
105                  // Anti double-mount (StrictMode/React): listeners armed only once globally
106                  function armInteractionListenersOnce() {
107                    if (window.__gtmListenersArmed) return;
108                    window.__gtmListenersArmed = true;
109                    
110                    ['scroll','mousemove','touchstart','click','pointerdown'].forEach(function(type){
111                      document.addEventListener(type, function onAny(){
112                        initGTMOnce();
113                      }, { passive: true, once: true });
114                    });
115
116                    document.addEventListener('keydown', function onKeyDown() {
117                      initGTMOnce();
118                    }, { once: true }); 
119                  }
120
121                  // Fallback when the user leaves or hides the page right after consent
122                  document.addEventListener('visibilitychange', function(){
123                   if (document.visibilityState === 'hidden' && window.__gtmConsentGiven) {
124                      initGTMOnce();
125                    }
126                   }, { capture: true });
127
128                  window.addEventListener('pagehide', function(){
129                    if (window.__gtmConsentGiven) {
130                      initGTMOnce();
131                    }
132                   }, { once: true });
133
134                  function handleGTMInitAfterConsent() {
135                    // If interaction already happened post-consent: init immediately
136                    if (window.__gtmHadInteraction) { initGTMOnce(); return; }
137                    // Otherwise arm listeners and keep a timeout fallback
138                    armInteractionListenersOnce();
139                    setTimeout(initGTMOnce, GTM_DELAY_MS);
140                  }
141
142                  // If GTM block loads first: listen for the event
143                  window.addEventListener('gtmConsentGiven', handleGTMInitAfterConsent, { once: true });
144
145                  // If consent was already given before this block loaded
146                  if (window.__gtmConsentGiven) {
147                    handleGTMInitAfterConsent();
148                  }
149
150                  // Manual compat if needed
151                  window.initGTM = initGTMOnce;
152                })();
153              `}}),(0,n.jsx)(l.default,{src:`https://cdn-eu.dynamicyield.com/api/${e.dynamicYieldId}/api_dynamic.js`,strategy:"lazyOnload",onLoad:d}),(0,n.jsx)(l.default,{src:`https://cdn-eu.dynamicyield.com/api/${e.dynamicYieldId}/api_static.js`,strategy:"lazyOnload",onLoad:d}),(0,n.jsx)(l.default,{src:"https://app.usercentrics.eu/browser-ui/latest/loader.js",id:"usercentrics-cmp","data-settings-id":e.userCentricsSettingsId,"data-avoid-prefetch-services":"",strategy:"afterInteractive"}),(0,n.jsx)(l.default,{id:"userCentricsConsentDefaults",strategy:"lazyOnload",dangerouslySetInnerHTML:{__html:`
154                // create dataLayer
155                window.dataLayer = window.dataLayer || [];
156                function gtag() {
157                    dataLayer.push(arguments);
158                }
159
160                // set „denied" as default for both ad and analytics storage,
161                gtag("consent", "default", {
162                    ad_user_data: "denied",
163                    ad_personalization: "denied",
164                    ad_storage: "denied",
165                    analytics_storage: "denied",
166                    wait_for_update: 2000 // milliseconds to wait for update
167                });
168                `}}),(0,n.jsx)(l.default,{id:"userlike-loader",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:`
169                function initUserlike(){
170                  try {
171                    var src = ${JSON.stringify(i||"")};
172                    if (!src) { return; }
173                    if (document.getElementById('userlike-widget-script')) { return; }
174                    var s = document.createElement('script');
175                    s.id = 'userlike-widget-script';
176                    s.async = true;
177                    s.src = src;
178                    var head = document.getElementsByTagName('head')[0] || document.documentElement;
179                    head.appendChild(s);
180                  } catch (e) {
181                    // no-op
182                  }
183                }
184              `}})]})}],85025)},67347,e=>{"use strict";var t=e.i(843476),n=e.i(538783),i=e.i(121294),r=e.i(618566),o=e.i(271645);e.s(["GA4Provider",0,({children:e})=>{let a=(0,r.usePathname)(),s=(0,o.useRef)(1),l=(0,o.useRef)(!0),d=(0,i.useUserStore)(e=>!!e);return(0,o.useEffect)(()=>
184{if(d)if(l.current){window.dataLayer=window.dataLayer||[];let e=new URLSearchParams(window.location.search),t={};for(let[n,i]of e.entries())t[n]?Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]:t[n]=i;let n=new URLSearchParams(t).toString(),i=`${a}${n?`?${n}`:""}`,r={pageCategory:a.includes("gk")?"gk":"pk",initialPath:i};sessionStorage.setItem("initialPath",i),window.dataLayer.push(r),l.current=!1}else n.default.pageView(a,window.document.title),s.current+=1},[a,d]),(0,t.jsx)(t.Fragment,{children:e})}])},893588,e=>{"use strict";var t=e.i(638466),n=e.i(618566),i=e.i(271645),r=e.i(856116),o=e.i(766164);let a="swdOrderAbandonGuard",s=!1,l=!1;try{window.sessionStorage.removeItem("swd:order-abandon-shown")}catch{}function d(e){return!!e&&"object"==typeof e&&!0===e[a]}var c=e.i(717462),u=e.i(190263),g=e.i(111637);e.s(["OrderFlowLeaveWatcher",0,function(){let e,f,w,h,p,y,m,v;return e=(0,n.usePathname)(),f=(0,i.useRef)(l),w=(0,i.useRef)(!1),h=(0,u.useOrderStore)(e=>(0,c.isMeaningfulOrderCartData)({isBasicSupply:e.isBasicSupply,tariff:e.tariff,basicSupplyTariffSelection:e.basicSupplyTariffSelection})),p=(0,g.usePopupStore)(n=>(0,r.hasEligibleCustomEventPopup)(n.settings??[],t.GLOBAL_POPUP_EVENTS.ORDER_ABANDON,e,n.displayedPopups)),(0,i.useEffect)(()=>{if(!(0,o.isOrderFlowPath)(e)){f.current=!1,w.current=!1,l=!1,s=!1;return}if(!h||!p)return;f.current=l;let n=e=>{!f.current&&(f.current=!0,l=!0,(0,t.dispatchGlobalPopupEvent)(t.GLOBAL_POPUP_EVENTS.ORDER_ABANDON),e&&d(window.history.state)&&window.history.back())},i=e=>{var t;if(f.current||e.defaultPrevented||0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let i=e.target;if(!(i instanceof Element))return;let r=i.closest("a[href]");if(!(r instanceof HTMLAnchorElement)||"_blank"===r.target.toLowerCase())return;let a=r.getAttribute("href");if(!a)return;let s=function(e,t){let n=e.trim();if(!n||n.startsWith("#")||n.startsWith("mailto:")||n.startsWith("tel:"))return{kind:"ignore"};try{let e=new URL(n,t);if("http:"!==e.protocol&&"https:"!==e.protocol)return{kind:"ignore"};if(e.origin!==t)return{kind:"external"};return{kind:"internal",pathname:e.pathname}}catch{return{kind:"ignore"}}}(a,window.location.origin);"ignore"!==s.kind&&("external"!==s.kind&&(!(t=s.pathname)||(0,o.isOrderThankYouPath)(t)||(0,o.isOrderFlowPath)(t))||(e.preventDefault(),e.stopPropagation(),n(!0)))},r=()=>{f.current||n(!1)};return f.current||w.current||(w.current=function(){if(s)return!1;if(d(window.history.state)){let e={...window.history.state};delete e[a],window.history.replaceState(Object.keys(e).length>0?e:null,"",window.location.href)}let e=window.history.state&&"object"==typeof window.history.state?window.history.state:{};return window.history.pushState({...e,[a]:!0},"",window.location.href),s=!0,!0}()||d(window.history.state)),document.addEventListener("click",i,!0),window.addEventListener("popstate",r),()=>{document.removeEventListener("click",i,!0),window.removeEventListener("popstate",r)}},[e,h,p]),y=(0,n.usePathname)(),m=(0,i.useRef)(!1),(0,i.useEffect)(()=>{if(!(0,t.isLogoutPath)(y)){m.current=!1;return}m.current||(m.current=!0,(0,t.shouldDispatchLogoutPopup)()&&queueMicrotask(()=>{(0,t.dispatchGlobalPopupEvent)(t.GLOBAL_POPUP_EVENTS.LOGOUT)}))},[y]),v=(0,n.usePathname)(),(0,i.useEffect)(()=>{(0,t.consumePendingCancellationPopup)()&&queueMicrotask(()=>{(0,t.dispatchGlobalPopupEvent)(t.GLOBAL_POPUP_EVENTS.CANCELLATION_FORM)})},[v]),null}],893588)},432505,e=>{"use strict";var t=e.i(843476),n=e.i(946531),i=e.i(476678),r=e.i(655645),o=e.i(957931),a=e.i(121294),s=e.i(271645);let l="selfserviceDebug:events";function d(e){try{return c(JSON.stringify(e))}catch{return"[unserializable]"}}function c(e,t=400){return null==e?String(e):e.length>t?e.slice(0,t)+"…":e}let u={position:"fixed",width:520,zIndex:999999,boxShadow:"0 8px 24px rgba(0,0,0,0.25)",background:"#fff",border:"1px solid #e1e1e1",borderRadius:8,overflow:"hidden",fontFamily:"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial",fontSize:12},g={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:"var(--color-green-600)",color:"#fff",cursor:"move",userSelect:"none"},f={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8,padding:12,flex:1,minHeight:0,overflow:"hidden"},w={minWidth:0,display:"flex",flexDirection:"column",minHeight:0},h={margin:"6px 0"},p={margin:0,padding:8,background:"#f7f7f9",border:"1px solid #eee",borderRadius:4,overflow:"auto",flex:1,minHeight:0},y={margin:0,paddingLeft:16,overflow:"auto",flex:1,minHeight:0},m={fontSize:12,background:"#fff",color:"#0b6cde",border:"1px solid #fff",borderRadius:4,padding:"4px 8px",cursor:"pointer"},v={fontSize:11,background:"#f7f7f9",color:"#333",border:"1px solid #ddd",borderRadius:4,padding:"2px 6px",cursor:"pointer"},b={fontSize:11,lineHeight:1,width:18,height:18,textAlign:"center",background:"#f0f0f0",color:"#333",border:"1px solid #ddd",borderRadius:3,padding:0,cursor:"pointer"},S={margin:"6px 0 0 24px",padding:8,background:"#f7f7f9",border:"1px solid #eee",borderRadius:4,maxHeight:"30vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},x={position:"absolute",width:16,height:16,right:2,bottom:2,cursor:"nwse-resize",background:"linear-gradient(135deg, transparent 50%, #bbb 50%), linear-gradient(135deg, #bbb 50%, transparent 50%)",backgroundPosition:"0 0, 8px 8px",backgroundSize:"8px 8px",backgroundRepeat:"no-repeat",opacity:.7},E=()=>{let e=[{id:"user",label:"UserStore",useHook:()=>(0,a.useUserStore)(e=>e)},{id:"header",label:"HeaderStore",useHook:()=>(0,o.useHeaderStore)(e=>e)},{id:"b2b",label:"B2BStore",useHook:()=>(0,n.useB2BStore)(e=>e)},{id:"calculator",label:"CalculatorStore",useHook:()=>(0,i.useCalculatorStore)(e=>e)},{id:"flash",label:"FlashStore",useHook:()=>(0,r.useFlashStore)(e=>e)}
184],[E,k]=(0,s.useState)(()=>{try{return window.sessionStorage.getItem("selfserviceDebug:store")||"user"}catch{}return"user"}),I=e.find(e=>e.id===E)||e[0];(0,s.useEffect)(()=>{e.some(e=>e.id===E)||k(e[0].id)},[E]);let L=I.useHook(),j=(0,a.useUserStore)(e=>e),[C,D]=(0,s.useState)(!1),[O,_]=(0,s.useState)([]),M=(0,s.useRef)(j?.loggedIn),T=(0,s.useRef)(L),[$,P]=(0,s.useState)({}),[A,R]=(0,s.useState)({top:0,left:0}),[N,z]=(0,s.useState)({width:800,height:610}),[H,U]=(0,s.useState)(!1),[B,G]=(0,s.useState)(!1),F=(0,s.useRef)(null),Y={"store-change":{color:"#0b6cde",bg:"#e6f2ff",pillBg:"#f0f7ff",border:"#0b6cde"},gigya:{color:"#0aa2a1",bg:"#e6fffb",pillBg:"#f0fffd",border:"#0aa2a1"},bpc:{color:"#f39c12",bg:"#fff4e5",pillBg:"#fff8ee",border:"#f39c12"},custom:{color:"#8b5cf6",bg:"#f3e8ff",pillBg:"#f8f5ff",border:"#8b5cf6"},others:{color:"#6b7280",bg:"#f2f2f2",pillBg:"#f7f7f7",border:"#9ca3af"}},[J,W]=(0,s.useState)({"store-change":!0,gigya:!0,bpc:!0,custom:!0,others:!0}),[X,K]=(0,s.useState)({}),V=(0,s.useRef)(null),q=(0,s.useRef)(null);(0,s.useEffect)(()=>{try{let e=window.localStorage.getItem("selfserviceDebug:pos"),t=window.localStorage.getItem("selfserviceDebug:size"),n=window.localStorage.getItem("selfserviceDebug:minimized"),i=window.localStorage.getItem("selfserviceDebug:maximized");if(e){let t=JSON.parse(e);R(t)}if(t){let e=JSON.parse(t);z({width:Math.max(320,e.width),height:Math.max(220,e.height)})}n&&U("1"===n),i&&G("1"===i)}catch{}if(null==A){let e=window.innerWidth,t=window.innerHeight,n=N.width;R({top:Math.max(16,t-N.height-16),left:Math.max(16,e-n-16)})}},[]),(0,s.useEffect)(()=>{try{A&&window.localStorage.setItem("selfserviceDebug:pos",JSON.stringify(A)),N&&window.localStorage.setItem("selfserviceDebug:size",JSON.stringify(N)),window.localStorage.setItem("selfserviceDebug:minimized",H?"1":"0"),window.localStorage.setItem("selfserviceDebug:maximized",B?"1":"0")}catch{}},[A,N,H,B]);let Z=(0,s.useMemo)(()=>{if(!L||"object"!=typeof L)return L;let e={};return Object.keys(L).forEach(t=>{let n=L[t];"function"!=typeof n&&(e[t]=n)}),e},[L]);(0,s.useEffect)(()=>{try{let e=window.sessionStorage.getItem(l);if(e){let t=JSON.parse(e);Array.isArray(t)&&_(t)}}catch{}},[]),(0,s.useEffect)(()=>{try{window.sessionStorage.setItem(l,JSON.stringify(O))}catch{}},[O]),(0,s.useEffect)(()=>{try{window.sessionStorage.setItem("selfserviceDebug:store",E)}catch{}_(e=>[{ts:new Date().toISOString(),type:"store-init",details:`switched to ${I.label} — ${d(Z)}`},...e]),T.current=L},[E]),(0,s.useEffect)(()=>{try{let e=window.sessionStorage.getItem("selfserviceDebug:filters");if(e){let t=JSON.parse(e);t&&"object"==typeof t&&W(e=>({...e,...t}))}}catch{}},[]),(0,s.useEffect)(()=>{try{window.sessionStorage.setItem("selfserviceDebug:filters",JSON.stringify(J))}catch{}},[J]);let Q=e=>"store-change"===e?"store-change":"gigya-session"===e?"gigya":"bpc-event"===e||"bpc-notify"===e?"bpc":"custom"===e?"custom":"others",[ee,et]=(0,s.useState)(()=>{try{return window.sessionStorage.getItem("selfserviceDebug:search")||""}catch{}return""});(0,s.useEffect)(()=>{try{window.sessionStorage.setItem("selfserviceDebug:search",ee)}catch{}},[ee]);let en=ee.trim().toLowerCase(),ei=(0,s.useMemo)(()=>O.filter(e=>!!J[Q(e.type)]&&(!en||`${e.type} ${e.details??""}`.toLowerCase().includes(en))),[O,J,en]),[er,eo]=(0,s.useState)(()=>{try{let e=window.sessionStorage.getItem("selfserviceDebug:customListeners"),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{}return[]}),[ea,es]=(0,s.useState)("");(0,s.useEffect)(()=>{try{window.sessionStorage.setItem("selfserviceDebug:customListeners",JSON.stringify(er))}catch{}},[er]),(0,s.useEffect)(()=>{let e=[];return er.forEach(t=>{try{let n=e=>{let n=[];n.push(`event=${t}`);let i=e.target;if(i&&"object"==typeof i&&i.nodeName){let e=String(i.nodeName||"").toLowerCase(),t="string"==typeof i.id&&i.id?`#${i.id}`:"",r="string"==typeof i.className&&i.className?`.${i.className.split(/\s+/).join(".")}`:"";n.push(`target=${e}${t}${r}`)}(e.key||e.code)&&n.push(`key=${String(e.key||e.code)}`),"number"==typeof e.clientX&&"number"==typeof e.clientY&&n.push(`pos=${e.clientX},${e.clientY}`),void 0!==e.detail&&n.push(`detail=${d(e.detail)}`),_(e=>[{ts:new Date().toISOString(),type:"custom",details:n.join(" | ")},...e])};window.addEventListener(t,n),e.push(()=>window.removeEventListener(t,n))}catch{}}),()=>
184{e.forEach(e=>{try{e()}catch{}})}},[er]),(0,s.useEffect)(()=>{_(e=>[{ts:new Date().toISOString(),type:"store-init",details:d(Z)},...e])},[]),(0,s.useEffect)(()=>{let e=j?.loggedIn;void 0!==e&&void 0!==M.current&&e!==M.current&&_(t=>[{ts:new Date().toISOString(),type:e?"login":"logout"},...t]),M.current=e},[j?.loggedIn]),(0,s.useEffect)(()=>{let e=T.current;if(void 0!==e&&void 0!==L){var t,n;let i,r,o=(t=e,n=L,i=new Set([...Object.keys(t||{}),...Object.keys(n||{})]),r=[],i.forEach(e=>{Object.is(t[e],n[e])||r.push(e)}),r);o.length>0&&_(e=>[{ts:new Date().toISOString(),type:"store-change",details:`[${I.id}] ${o.join(", ")}`},...e])}T.current=L},[L,I.id]),(0,s.useEffect)(()=>{let e=["cos.homepage.services","cos.homepage.user","cos.homepage.personalization.storageData","cos.homepage.vtw.storageData"],t=null,n=null,i=null,r=!1,o=!1,a=!1;try{try{t=window.localStorage.setItem.bind(window.localStorage)}catch{}try{n=window.localStorage.removeItem.bind(window.localStorage)}catch{}try{i=window.localStorage.clear.bind(window.localStorage)}catch{}function s(e,t){try{let n=window.localStorage.getItem(t);_(i=>[{ts:new Date().toISOString(),type:"localStorage",details:`${e}: ${t} => ${c(n)}`},...i])}catch{_(n=>[{ts:new Date().toISOString(),type:"localStorage",details:`${e}: error reading ${t}`},...n])}}try{t&&(window.localStorage.setItem=function(n,i){let r=t(n,i);return e.includes(n)&&s("setItem",n),r},r=!0)}catch{}try{n&&(window.localStorage.removeItem=function(t){let i=n(t);return e.includes(t)&&s("removeItem",t),i},o=!0)}catch{}try{i&&(window.localStorage.clear=function(){let t=i();return e.forEach(e=>s("clear",e)),t},a=!0)}catch{}let l=t=>{t.key&&e.includes(t.key)&&s("storage",t.key)};try{window.addEventListener("storage",l)}catch{}return()=>{try{r&&t&&(window.localStorage.setItem=t)}catch{}try{o&&n&&(window.localStorage.removeItem=n)}catch{}try{a&&i&&(window.localStorage.clear=i)}catch{}try{window.removeEventListener("storage",l)}catch{}}}catch{let t=t=>{try{if(t.key&&e.includes(t.key)){let e=window.localStorage.getItem(t.key);_(n=>[{ts:new Date().toISOString(),type:"localStorage",details:`storage: ${t.key} => ${c(e)}`},...n])}}catch{}};try{window.addEventListener("storage",t)}catch{}return()=>{try{window.removeEventListener("storage",t)}catch{}}}},[]),(0,s.useEffect)(()=>{let e=()=>D(!0),t=()=>D(!1),n=()=>D(e=>!e),i=(e,t)=>{_(n=>[{ts:new Date().toISOString(),type:e||"info",details:t},...n])};{let r=Object.assign(function(){n()},{show:e,hide:t,toggle:n,log:i,addListener:e=>{let t=e.trim();t&&eo(e=>e.includes(t)?e:[...e,t])},removeListener:e=>{eo(t=>t.filter(t=>t!==e))},listeners:()=>{try{let e=window.sessionStorage.getItem("selfserviceDebug:customListeners"),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}});window.selfserviceDebug=r,window.swdShowUserStore=e,window.swdHideUserStore=t,window.swdToggleUserStore=n}return()=>{{let r=Object.assign(function(){n()},{show:e,hide:t,toggle:n,log:i,addListener:e=>{let t=e.trim();t&&eo(e=>e.includes(t)?e:[...e,t])},removeListener:e=>{eo(t=>t.filter(t=>t!==e))},listeners:()=>{try{let e=window.sessionStorage.getItem("selfserviceDebug:customListeners"),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(e=>"string"==typeof e):[]}catch{return[]}}});window.selfserviceDebug=r,window.swdShowUserStore=e,window.swdHideUserStore=t,window.swdToggleUserStore=n}}},[]),(0,s.useEffect)(()=>{let e,t,n=[];function i(){let t=window.bpcEvent;if(!t||!t.const||"function"!=typeof t.subscribe)return!1;try{Object.keys(t.const).forEach(e=>{let i=t.const[e];if(!i)return;let r=t.subscribe(i,e=>{_(t=>[{ts:new Date().toISOString(),type:"bpc-event",details:`${i}: ${d(e)}`},...t])});"function"==typeof r&&n.push(r)})}catch{}try{"function"==typeof t.notify&&(e=t.notify.bind(t),t.notify=function(t,n){return _(e=>[{ts:new Date().toISOString(),type:"bpc-notify",details:`${t}: ${d(n)}`},...e]),!!e&&e(t,n)})}catch{}return!0}return i()||(t=window.setInterval(()=>{i()&&(t&&window.clearInterval(t),t=void 0)},300),window.setTimeout(()=>{t&&window.clearInterval(t),t=void 0},1e4)),()=>
184{try{n.forEach(e=>e())}catch{}try{window.bpcEvent&&e&&(window.bpcEvent.notify=e)}catch{}t&&window.clearInterval(t)}},[]);let el=e=>{let t=V.current;if(!t||!t.dragging)return;let n=e.clientX-t.startX,i=e.clientY-t.startY,r=window.innerWidth,o=window.innerHeight;R({left:Math.min(Math.max(0,t.originLeft+n),r-Math.max(320,N.width)),top:Math.min(Math.max(0,t.originTop+i),o-Math.max(220,N.height))})},ed=()=>{V.current&&(V.current.dragging=!1),window.removeEventListener("mousemove",el),window.removeEventListener("mouseup",ed)},ec=e=>{if(!V.current||!V.current.dragging)return;let t=e.touches[0];if(!t)return;e.preventDefault();let n=t.clientX-V.current.startX,i=t.clientY-V.current.startY,r=window.innerWidth,o=window.innerHeight;R({left:Math.min(Math.max(0,V.current.originLeft+n),r-Math.max(320,N.width)),top:Math.min(Math.max(0,V.current.originTop+i),o-Math.max(220,N.height))})},eu=()=>{V.current&&(V.current.dragging=!1),window.removeEventListener("touchmove",ec),window.removeEventListener("touchend",eu)},eg=e=>{let t=q.current;if(!t||!t.resizing)return;let n=e.clientX-t.startX,i=e.clientY-t.startY,r=window.innerWidth,o=window.innerHeight;z({width:Math.min(Math.max(320,t.originW+n),r-(A?A.left:16)-16),height:Math.min(Math.max(220,t.originH+i),o-(A?A.top:16)-16)})},ef=()=>{q.current&&(q.current.resizing=!1),window.removeEventListener("mousemove",eg),window.removeEventListener("mouseup",ef)},ew=e=>{let t=q.current;if(!t||!t.resizing)return;let n=e.touches[0];if(!n)return;e.preventDefault();let i=n.clientX-t.startX,r=n.clientY-t.startY,o=window.innerWidth,a=window.innerHeight;z({width:Math.min(Math.max(320,t.originW+i),o-(A?A.left:16)-16),height:Math.min(Math.max(220,t.originH+r),a-(A?A.top:16)-16)})},eh=()=>{q.current&&(q.current.resizing=!1),window.removeEventListener("touchmove",ew),window.removeEventListener("touchend",eh)},ep={...u,width:Math.max(320,N.width),height:H?"auto":Math.max(220,N.height),top:A?.top,left:A?.left,display:"flex",flexDirection:"column"};if(!C)return null;let ey={fontFamily:'ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace',fontSize:12,lineHeight:1.4},em=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),ev=({name:e,value:n,path:i})=>{let r=Array.isArray(n),o=em(n),a=r||o,s=!!X[i];return(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[a?(0,t.jsx)("button",{type:"button",onClick:()=>K(e=>({...e,[i]:!e[i]})),"aria-label":s?"Expand":"Collapse",style:b,title:s?"Expand":"Collapse",children:s?"▶":"▼"}):(0,t.jsx)("span",{style:{width:18,display:"inline-block"}}),(0,t.jsxs)("div",{style:{whiteSpace:"pre",...ey},children:[void 0!==e?`${JSON.stringify(e)}: `:"",a?(0,t.jsxs)(t.Fragment,{children:[r?"[":"{",s?"…":"",r?"]":"}",r&&Array.isArray(n)?` (${n.length})`:"",o&&em(n)?` (${Object.keys(n).length})`:""]}):"string"==typeof n?JSON.stringify(n):"number"==typeof n||"boolean"==typeof n?String(n):null===n?"null":void 0===n?"undefined":String(n)]})]}),a&&!s&&(0,t.jsx)("div",{style:{paddingLeft:16},children:r&&Array.isArray(n)?n.map((e,n)=>(0,t.jsx)(ev,{name:String(n),value:e,path:`${i}[${n}]`},`${i}[${n}]`)):o&&em(n)?Object.keys(n).map(e=>(0,t.jsx)(ev,{name:e,value:n[e],path:i?`${i}.${e}`:e},`${i}.${e}`)):null})]})},eb=(e,t,n,i)=>{"object"!=typeof e||null===e||n.has(e)||(n.add(e),i.push(t),Array.isArray(e)?e.forEach((e,r)=>eb(e,`${t}[${r}]`,n,i)):Object.entries(e).forEach(([e,r])=>eb(r,t?`${t}.${e}`:e,n,i)))};return(0,t.jsxs)("div",{style:ep,role:"dialog","aria-label":"Selfservice Debug Overlay",children:[(0,t.jsxs)("div",{style:g,onMouseDown:e=>{A&&(e.preventDefault(),V.current={startX:e.clientX,startY:e.clientY,originLeft:A.left,originTop:A.top,dragging:!0},window.addEventListener("mousemove",el),window.addEventListener("mouseup",ed))},onTouchStart:e=>{if(!A)return;let t=e.touches[0];t&&(V.current={startX:t.clientX,startY:t.clientY,originLeft:A.left,originTop:A.top,dragging:!0},window.addEventListener("touchmove",ec,{passive:!1}),window.addEventListener("touchend",eu))},children:[(0,t.jsx)("strong",{children:"Selfservice Debug"}),(0,t.jsxs)("span",{style:{color:"#fff",opacity:.85,fontSize:12,marginLeft:8},children:["v","1.57.5-scroll-correction"]}),(0,t.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,t.jsxs)("label",{style:{color:"#fff",fontSize:12},children:["Store:",(0,t.jsx)("select",{value:E,onChange:e=>k(e.target.value),onMouseDown:e=>e.stopPropagation(),style:{marginLeft:6,fontSize:12},"aria-label":"Select store",children:e.map(e=>(0,t.jsx)("option",{value:e.id,children:e.label},e.id))})]}),(0,t.jsx)("span",{title:"user"===I.id?j?.loggedIn?"Logged in":j?.loggedIn===!1?"Logged out":"Unknown":"Status available for UserStore only",style:{width:10,height:10,borderRadius:6,background:"user"===I.id?j?.loggedIn?"#2ecc71":"#e74c3c":"#6c8ebf",display:"inline-block"}}),(0,t.jsx)("button",{type:"button","aria-label":"Export JSON",title:"Export JSON",style:m,onMouseDown:e=>e.stopPropagation(),onClick:()=>{try{let e={generatedAt:new Date().toISOString(),selectedStore:I.id,snapshot:Z,events:O},t=JSON.stringify(e,null,2),n=new Blob([t],{type:"application/json"}),i=URL.createObjectURL(n),r=new Date().toISOString().replace(/[:.]/g,"-"),o=document.createElement("a");o.href=i,o.download=`selfservice-debug-${r}.json`,document.body.appendChild(o),o.click(),document.body.removeChild(o),window.setTimeout(()=>URL.revokeObjectURL(i),1e3)}catch(e){console.error("Failed to export debug data",e)}},children:"Export"}),(0,t.jsx)("button",{type:"button","aria-label":H?"Restore":"Minimize",title:H?"Restore":"Minimize",style:m,onMouseDown:e=>e.stopPropagation(),onClick:()=>U(e=>!e),children:H?"▴":"–"}),(0,t.jsx)("button",{type:"button","aria-label":B?"Restore":"Maximize",title:B?"Restore":"Maximize",style:m,onMouseDown:e=>e.stopPropagation(),onClick:()=>
184{if(B){let e=F.current;e&&(R(e.pos),z(e.size)),G(!1)}else{A&&N&&(F.current={pos:A,size:N});let e=window.innerWidth,t=window.innerHeight;R({top:16,left:16}),z({width:Math.max(320,e-32),height:Math.max(220,t-32)}),G(!0),H&&U(!1)}},children:B?"🗗":"🗖"}),(0,t.jsx)("button",{type:"button",onMouseDown:e=>e.stopPropagation(),onClick:()=>D(!1),style:m,children:"Close"})]})]}),!H&&(0,t.jsxs)("div",{style:f,children:[(0,t.jsxs)("div",{style:w,children:[(0,t.jsx)("h4",{style:h,children:"State"}),(0,t.jsxs)("div",{style:{display:"flex",gap:6,marginBottom:6},children:[(0,t.jsx)("button",{type:"button",style:v,onClick:()=>K({}),title:"Unfold all",children:"Unfold all"}),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>{try{let e=[],t=new WeakSet;eb(Z,"root",t,e);let n={};e.forEach(e=>{n[e]=!0}),K(n)}catch{K({})}},title:"Fold all",children:"Fold all"})]}),(0,t.jsx)("div",{style:p,children:(0,t.jsx)(({value:e})=>(0,t.jsx)("div",{style:ey,children:(0,t.jsx)(ev,{value:e,path:"root"})}),{value:Z})})]}),(0,t.jsxs)("div",{style:w,children:[(0,t.jsx)("h4",{style:h,children:"Recent events"}),(0,t.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6,marginBottom:6,alignItems:"center"},children:[(0,t.jsx)("span",{style:{fontSize:11,color:"#333"},children:"Filters:"}),[{key:"store-change",label:"store-change"},{key:"gigya",label:"gigya"},{key:"bpc",label:"bpc"},{key:"custom",label:"custom"},{key:"others",label:"others"}].map(e=>{let n=J[e.key],i=Y[e.key];return(0,t.jsxs)("button",{type:"button",style:{...v,background:n?i.bg:v.background,borderColor:n?i.border:"#ddd",color:n?i.color:"#333"},onClick:()=>W(t=>({...t,[e.key]:!t[e.key]})),title:n?"Click to hide this category":"Click to show this category",children:[n?"✓ ":"",e.label]},e.key)}),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>W({"store-change":!0,gigya:!0,bpc:!0,custom:!0,others:!0}),title:"Enable all categories",children:"All"}),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>W({"store-change":!1,gigya:!1,bpc:!1,custom:!1,others:!1}),title:"Disable all categories",children:"None"}),(0,t.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11},children:[(0,t.jsx)("span",{style:{color:"#333"},children:"Search:"}),(0,t.jsx)("input",{type:"text",value:ee,onChange:e=>et(e.target.value),placeholder:"type or details…",onMouseDown:e=>e.stopPropagation(),style:{fontSize:12,padding:"2px 6px",border:"1px solid #ddd",borderRadius:4,minWidth:120},"aria-label":"Search events"})]}),(0,t.jsx)("span",{style:{flex:1,minWidth:8}}),(0,t.jsxs)("span",{style:{fontSize:11,color:"#666"},title:"Visible / Total",children:[ei.length," / ",O.length]}),(0,t.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:4,fontSize:11},children:[(0,t.jsx)("span",{style:{color:"#333"},children:"Listen:"}),(0,t.jsx)("input",{type:"text",value:ea,onChange:e=>es(e.target.value),placeholder:"event name (e.g., click)",onMouseDown:e=>e.stopPropagation(),style:{fontSize:12,padding:"2px 6px",border:"1px solid #ddd",borderRadius:4,minWidth:140},"aria-label":"Add custom event listener"}),(0,t.jsx)("button",{type:"button",style:v,onMouseDown:e=>e.stopPropagation(),onClick:()=>{let e=ea.split(/[,\s]+/).map(e=>e.trim()).filter(e=>e.length>0);0!==e.length&&(eo(t=>{let n=new Set(t);return e.forEach(e=>n.add(e)),Array.from(n)}),es(""))},title:"Add window event listener(s)",children:"Add"})]}),er.map(e=>(0,t.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",border:"1px solid #ddd",borderRadius:12,background:Y.custom.bg,color:Y.custom.color},children:[(0,t.jsx)("code",{children:e}),(0,t.jsx)("button",{type:"button","aria-label":`Remove ${e}`,title:`Remove ${e}`,onMouseDown:e=>e.stopPropagation(),onClick:()=>eo(t=>t.filter(t=>t!==e)),style:{...b,width:18,height:18},children:"×"})]},e)),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>{let e={};ei.forEach((t,n)=>e[`${t.ts}-${n}`]=!0),P(e)},title:"Expand all visible",children:"Expand all"}),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>P({}),title:"Collapse all",children:"Collapse all"}),(0,t.jsx)("button",{type:"button",style:v,onClick:()=>{_([]),P({});try{window.sessionStorage.removeItem(l)}catch{}},children:"Clear history"})]}),0===ei.length?(0,t.jsx)("div",{style:{fontStyle:"italic",color:"#666"},children:"No events for current filters"}):(0,t.jsx)("ul",{style:y,children:ei.map((e,n)=>{let i=`${e.ts}-${n}`,r=!!$[i],o=!!e.details,a=o?e.details.length>120?`${e.details.slice(0,120)}…`:e.details:"",s=Y[Q(e.type)];return(0,t.jsxs)("li",{style:{marginBottom:6,borderLeft:`4px solid ${s.border}`,paddingLeft:8,background:r?s.pillBg:void 0,borderRadius:3},children:[(0,t.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6},children:[o?(0,t.jsx)("button",{type:"button","aria-expanded":r,"aria-controls":`evt-${n}`,onClick:()=>P(e=>({...e,[i]:!e[i]})),style:b,title:r?"Collapse":"Expand",children:r?"▼":"▶"}):(0,t.jsx)("span",{style:{width:18,display:"inline-block"}}),(0,t.jsxs)("div",{style:{minWidth:0},children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("code",{children:e.ts})," — ",(0,t.jsx)("span",{style:{color:s.color},children:e.type})]}),o&&!r&&(0,t.jsx)("div",{style:{color:"#666",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})]}
184),o&&r&&(0,t.jsx)("pre",{id:`evt-${n}`,style:S,children:e.details})]},i)})})]})]}),!H&&!B&&(0,t.jsx)("div",{style:x,onMouseDown:e=>{e.preventDefault(),q.current={startX:e.clientX,startY:e.clientY,originW:N.width,originH:N.height,resizing:!0},window.addEventListener("mousemove",eg),window.addEventListener("mouseup",ef)},onTouchStart:e=>{let t=e.touches[0];t&&(e.preventDefault(),q.current={startX:t.clientX,startY:t.clientY,originW:N.width,originH:N.height,resizing:!0},window.addEventListener("touchmove",ew,{passive:!1}),window.addEventListener("touchend",eh))},"aria-label":"Resize",role:"separator"})]})},k=new Set(["localhost","127.0.0.1","[::1]"]);function I(e){var t;if(e&&(t=e.hostname,k.has(t.toLowerCase()))){let{protocol:t,hostname:n,port:i}=e;return`${t}//${n}${i?`:${i}`:""}`}return"https://www.swd-ag.de".trim().replace(/\/$/,"")??""}var L=e.i(571129),j=e.i(938061),C=e.i(834942);function D(e){if("object"!=typeof e||null===e)return!1;let t=e.address;return"string"==typeof e.numberContractAccount&&"string"==typeof e.numberContract&&"string"==typeof e.division&&"string"==typeof e.actualMeter&&"string"==typeof e.productText&&"string"==typeof e.terminationDate&&"boolean"==typeof e.terminationDateSpecial&&"object"==typeof t&&null!==t&&"string"==typeof t.zipcode&&"string"==typeof t.city&&"string"==typeof t.street&&"string"==typeof t.houseno}async function O(e){if(!(0,j.isCustomerContractsPocEnabled)())return;let t=(0,L.getCookieValue)("XSRF-TOKEN"),n=await fetch(`${e}${(0,C.buildSelfServicePath)("/api/external/user/termination")}`,{headers:t?{"X-XSRF-TOKEN":t}:{}});if(n.ok){var i=await n.json();return Array.isArray(i)&&i.every(D)?i:void 0}}let _=null;async function M(e){return 204===e.status?null:e.ok?await e.json():(console.warn("CDP profile failed",await e.text()),null)}e.s(["default",0,({children:e})=>{let{setCDPPrefillData:n,setUserBasedOnLogin:i,setCustomerContracts:r,businessPartnerNumber:o,loggedIn:l,logout:d,cdpPrefillData:c,hydrated:u,setLoggingIn:g}=(0,a.useUserStore)(e=>({setUserBasedOnLogin:e.setUserBasedOnLogin,setCDPPrefillData:e.setCDPPrefillData,setCustomerContracts:e.setCustomerContracts,setTrackingData:e.setTrackingData,loggedIn:e.loggedIn,businessPartnerNumber:e.businessPartnerNumber,name:e.name,logout:e.logout,cdpPrefillData:e.cdpPrefillData,hydrated:e.hydrated,login:e.login,setLoggingIn:e.setLoggingIn,loggingIn:e.loggingIn})),f=(0,s.useRef)(!1),w=(0,s.useRef)(!1);return(0,s.useEffect)(()=>{if(!u||f.current)return;f.current=!0;let e=async()=>{try{if(await (window.gigya&&window.gigya.isReady&&window.gigya.accounts?Promise.resolve(window.gigya):(!_&&(_=new Promise((e,t)=>{let n=setTimeout(()=>{window.gigya&&window.gigya.accounts&&window.gigya.isReady&&e(window.gigya),t(Error("Gigya wurde nicht innerhalb von 10 Sekunden geladen"))},1e4),i=()=>{clearTimeout(n),window.gigya?.isReady?e(window.gigya):t(Error("Gigya ist nicht verfügbar"))};window.gigya?.isReady?i():window.addEventListener("gigya-service-ready",()=>i(),{once:!0})})),_)),!window.gigya.isReady)throw Error("Gigya was not ready!");let e=await window.gigya?.hasSession();if(window.selfserviceDebug?.log?.("gigya-session",`gigya.hasSession -> ${String(e)}`),!e)return void g(!1);e&&!l&&o?.length>0&&!w.current&&(w.current=!0,window.selfserviceDebug?.log?.("gigya-session","gigya.hasSe
184ssion==true, calling login() now"),g(!0)),window.gigya.accounts.getJWT({expiration:30,fields:"profile.email",callback:async e=>{try{if(!e?.id_token){l&&d("Logging out, as there is no valid session");return}let{"profile.email":t}=function(e){try{let t=e.split(".");if(3!==t.length)return null;let n=t[1],i=n?.replace(/-/g,"+").replace(/_/g,"/");if(!i)throw Error("base64 not found");let r=decodeURIComponent(atob(i).split("").map(e=>"%"+e.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(r)}catch(e){return console.error("Decoding jwt payload failed",e),null}}(e.id_token)||{};if(!t)return void console.error("No valid email address found");if(l&&c?._id&&o?.length>0){console.info("There is already a session, bpc data and a profile");let e=I(window.location);r(await O(e));return}let a=I(window.location);g(!0);let s=await fetch(`${a}${(0,C.buildSelfServicePath)("/api/external/user/info")}`);if(s.ok)i(await s.json(),t),r(await O(a));else{window.selfserviceDebug?.log("bpc-session","gigya session present but no BPC session / selfservice api fetch failed"),l&&d("Logging out, as there is no valid session");return}g(!1);let u=await fetch(`${a}/api/cdp/profile`,{method:"POST",headers:{"content-type":"application/json","x-gigya-id-token":e.id_token},body:JSON.stringify({})}),f=await M(u);f&&n(f)}catch(e){console.error("Error while fetching login data",e)}finally{g(!1)}}}),window.gigya.accounts.addEventHandlers({onLogin:async()=>{try{g(!0),window.gigya.accounts.getJWT({expiration:30,fields:"profile.email",callback:async e=>{if(!e?.id_token)return;let t=I(window.location),i=await fetch(`${t}/api/cdp/profile`,{method:"POST",headers:{"content-type":"application/json","x-gigya-id-token":e.id_token},body:JSON.stringify({})}),o=await M(i);o&&n(o),r(await O(t))}})}finally{g(!1)}},onLogout:()=>{d()}})}catch(e){console.error("Error initializing Gigya:",e),g(!1)}};u&&e()},[u]),(0,t.jsxs)(t.Fragment,{children:[e,(0,t.jsx)(E,{})]})}],432505)}]);
185
186//# sourceMappingURL=3nz1_rg9pvwsn.js.map

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.