PageSourceSearch

https://strand-shop.de/wp-content/plugins/smg-customer-portal//inc…/scripts/script.js?ver=7.1

js strand-shop.de collected 2026-10-07 05:41:30 UTC 6,636 bytes, 206 lines download raw bytes

1var notification_center_html = `
2<gs-notification-center
3	id="notification-center"
4	test="false"
5	apiurl="/portal/notification-center"
6	appid="2b48abc4-4444-4b9a-a5a8-4109260a0396"
7	class="kupo-notification-center-button"
8>
9	<style>
10		:host {
11			display: flex;
12			justify-content: center;
13			align-items: center;
14			flex-flow: row nowrap;
15			position: relative;
16			width: 160px;
17			height: 70px;
18			margin: 0 auto;
19		}
20
21		:host * {
22			font-family: var(--smgCupoFontFamily, "Montserrat", Arial, sans-serif);
23		}
24
25		:host {
26			appearance: none;
27			border: none;
28			background: transparent;
29			padding: 0;
30			margin: 0;
31			box-sizing: border-box;
32			display: flex;
33			justify-content: center;
34			align-items: center;
35			flex-flow: column wrap;
36			gap: 5px;
37			outline: none;
38			flex: 0 0 auto;
39			position: relative;
40		}
41
42		:host .kupo-new-notifications-count {
43			position: absolute;
44			background: var(--smgCupoSecondaryColor, #0068af);
45			color: #fff;
46			right: 0;
47			top: 0;
48			width: 10px;
49			height: 10px;
50			border-radius: 50%;
51			font-size: 14px;
52			line-height: 20px;
53			font-weight: bold;
54			text-align: center;
55		}
56
57		:host span {
58			font-size: 15px;
59			line-height: 20px;
60			color: var(--smgCupoSecondaryColor, #0068af);
61		}
62
63		:host svg {
64			fill: var(--smgCupoSecondaryColor, #0068af);
65			width: 35px;
66			height: 35px;
67			scale: 3;
68		}
69	</style>
70	<span class="kupo-new-notifications-count" style="display: none;"></span>
71	<svg class="cupo_icon cupo_icon_dark cupo_profile_icon" xmlns="http://www.w3.org/2000/svg" xml:space="preserve" viewBox="0 0 800 800">
72		<path d="M486.892578,449.464844c2.041992-4.929688.923828-10.553711-2.848633-14.327148l-31.836914-31.835938v-44.335938c0-28.786133-23.419922-52.206055-52.207031-52.206055-28.786621,0-52.206543,23.419922-52.206543,52.206055v44.269531l-31.836426,31.836914c-3.772949,3.772461-4.891602,9.396484-2.849609,14.326172s6.809082,8.115234,12.143066,8.115234l49.073669.021484c-.014282.153809-.046326.302246-.046326.459961,0,14.47168,11.773438,26.245117,26.245117,26.245117,14.472168,0,26.245605-11.773438,26.245605-26.245117,0-.149902-.031189-.290527-.044067-.437012l48.022583.020996c5.335938,0,10.103516-3.185547,12.145508-8.114258Z"/>
73	</svg>
74	<span>Benachrichtigungen</span>
75</gs-notification-center>
76`;
77
78function startCupoNotifyWebComponent() {
79	const notificationCenter = document.querySelector('gs-notification-center');
80	const notificationCenterRoot = notificationCenter.shadowRoot;
81
82	function updateUnreadBadge(count) {
83		if (count > 0) {
84			//notificationCenterRoot.querySelector('.kupo-new-notifications-count').innerText = count;
85			notificationCenterRoot.querySelector('.kupo-new-notifications-count').style.display = 'block';
86			notificationCenterRoot.querySelector('.kupo-new-notifications-count').dataset.count = count;
87			Array.from(document.querySelectorAll('.notification-indicator')).forEach(el => el.style.display = 'block');
88		} else {
89			notificationCenterRoot.querySelector('.kupo-new-notifications-count').style.display = 'none';
90			Array.from(document.querySelectorAll('.notification-indicator')).forEach(el => el.style.display = 'none');
91		}
92	}
93
94	notificationCenter.addEventListener('unread', function (e) {
95		updateUnreadBadge(e.detail);
96	});
97
98	notificationCenter.addEventListener('updateReadStatus', function (e) {
99		const newCount = parseInt(notificationCenterRoot.querySelector('.kupo-new-notifications-count').dataset.count ?? 0) - 1;
100		updateUnreadBadge(newCount);
101	});
102
103	notificationCenter.addEventListener('onAction', function (e) {
104		switch (e && e.detail && e.detail.name) {
105			case 'openDocuments':
106				let documentId = null;
107				let signature = false;
108
109				if (e.detail.params && e.detail.params.documentIds && e.detail.params.documentIds.length === 1) {
110					documentId = e.detail.params.documentIds[0];
111				}
112
113				signature = e.detail.params && e.detail.params.kind && e.detail.params.kind === 'signature';
114
115				if (!window.location.pathname.startsWith('/portal/documents')) {
116					let location = '/portal/documents/';
117
118					if (documentId) {
119						location += `?doc=${documentId}`;
120
121						if (signature) {
122							location += `&signature=true`;
123						}
124					}
125
126					window.location.href = location;
127				} else {
128					// already in documents view
129					if (documentId) {
130						openDocView(documentId, signature);
131					}
132				}
133
134				break;
135
136			case 'openProfile':
137				if (!window.location.pathname.startsWith('/portal/profile')) {
138					window.location.href = '/portal/profile/';
139				}
140				break;
141
142			case 'openUrvIbe':
143				if (typeof e.detail.params === 'object' && e.detail.params.containerNo) {
144					window.location.href = `/portal/upselling?travel_id=${e.detail.params.containerNo}&upselling_type=insurance`;
145				}
146				break;
147
148			case 'openTuiExcursionIbe':
149				if (typeof e.detail.params === 'object' && e.detail.params.containerNo) {
150					window.location.href = `/portal/upselling?travel_id=${e.detail.params.containerNo}&upselling_type=tui-excursion`;
151				}
152				break;
153
154			case 'openRegiondoExcursions':
155				if (typeof e.detail.params === 'object' && e.detail.params.regiondoIds) {
156					window.location.href = `/site/erlebnisse/?re-filter-categories=${e.detail.params.regiondoIds}`;
157				}
158				break;
159		}
160	});
161
162	notificationCenter.addEventListener('notificationsFetched', function (e) {
163		const countUnreadNotifications = (e.detail ?? []).filter(notification => notification && !notification.viewed).length;
164		updateUnreadBadge(countUnreadNotifications);
165	});
166}
167
168window.jQuery(document).ready(function() {
169	var $ = window.jQuery;
170
171	window.portalLoginState.then(function(data) {
172		data = typeof data === 'string' ? JSON.parse(data) : data;
173
174		if (data && data.logged_in === true && typeof data.username === 'string') {
175			var $notifier = $($.parseHTML(notification_center_html));
176
177			$notifier.attr('agent', data.agent_id);
178			$notifier.attr('customer', data.customer_id);
179
180			$('section.kupo-notification-center').append($notifier);
181			$('section.kupo-notification-center').show();
182
183			startCupoNotifyWebComponent();
184
185			$('button.kupo-notification-center-button').on('click', function() {
186				if ($('.kupo-notification-center-dropdown').is(':visible')) {
187					$('.kupo-notification-center-dropdown').hide();
188				} else {
189					$('.kupo-notification-center-dropdown').show();
190				}
191			});
192
193			$(window).on('click', function(e) {
194				var kupoNotificationCenter = $('section.kupo-notification-center');
195
196				if (
197					kupoNotificationCenter[0]
198					&& !kupoNotificationCenter[0].isSameNode(e.target)
199					&& !kupoNotificationCenter[0].contains(e.target)
200				) {
201					$('.kupo-notification-center-dropdown').hide();
202				}
203			});
204		}
205	});
206});

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.