PageSourceSearch

https://www.panini.es/static/version1789974502/frontend/Webformat/…/Dotdigitalgroup_Chat/js/chatProfile.js

js panini.es collected 2026-09-24 19:12:24 UTC 1,322 bytes, 34 lines download raw bytes

1/**
2 * Configuration for chat profile.
3 */
4const chatProfileConfig = JSON.parse(document.getElementById('dotdigital-chat-profile-config').textContent);
5const {apiSpaceId, isEnabled, apiHost, profileEndpoint, cookieName} = chatProfileConfig;
6
7if(isEnabled) {
8    window.addEventListener ('message', (event) => {
9        const {type, show} = event.data;
10
11        if (type !== 'SetWidgetState') return;
12
13        if (show === 'hidden') {
14            sessionStorage.removeItem (cookieName);
15        } else if (!sessionStorage.getItem (cookieName)) {
16            window.COMAPI_WIDGET_API.profile.getProfile ()
17                .then (profile => {
18                    fetch (profileEndpoint, {
19                        method: 'POST',
20                        body: "profileId=" + profile.id,
21                        headers: {
22                            'Content-Type': 'application/x-www-form-urlencoded',
23                            'X-Requested-With': 'XMLHttpRequest'
24                        },
25                    })
26                        .then (() => {
27                            sessionStorage.setItem (cookieName, profile.id);
28                            document.cookie = `${cookieName}=${profile.id}`;
29                        })
30                        .catch (console.error);
31                });
32        }
33    });
34}

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.