1'use strict'; 2 3const Usercentrics = (() => { 4 const isServiceIdAvailable = (serviceId) => { 5 const service = getServiceForId(serviceId); 6 return typeof service !== 'undefined'; 7 } 8 9 const getServiceNameForId = (serviceId) => { 10 if (isServiceIdAvailable(serviceId)) { 11 return getServiceForId(serviceId).name; 12 } 13 return 'undefined'; 14 } 15 16 const getConsentStatusForId = (serviceId) => { 17 if (isServiceIdAvailable(serviceId)) { 18 return getServiceForId(serviceId).consent.status; 19 } 20 return 'undefined'; 21 } 22 23 const getServiceForId = (serviceId) => { 24 return UC_UI.getServicesBaseInfo().find(data => data.id === serviceId) 25 } 26 27 return { 28 isServiceIdAvailable, 29 getServiceNameForId, 30 getConsentStatusForId, 31 getServiceForId 32 } 33})(); 34 35// Fallback for Safari < 15.4 which does not support :has(). 36// Syncs has-uc-overlay on .videoFrame/.videoFrameInner with the presence of .uc-embedding-wrapper 37// so that aspect-ratio is restored correctly after consent is accepted. 38(function () { 39 function syncVideoUcOverlay() { 40 document.querySelectorAll('.videoFrameInner').forEach(function (inner) { 41 var hasOverlay = !!inner.querySelector('.uc-embedding-wrapper'); 42 var frame = inner.parentElement; 43 inner.classList.toggle('has-uc-overlay', hasOverlay); 44 if (frame && frame.classList.contains('videoFrame')) { 45 frame.classList.toggle('has-uc-overlay', hasOverlay); 46 } 47 }); 48 } 49 50 document.addEventListener('DOMContentLoaded', function () { 51 syncVideoUcOverlay(); 52 new MutationObserver(syncVideoUcOverlay).observe(document.body, { childList: true, subtree: true }); 53 }); 54}());
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.