@financial-times/cmp-client 6.15.0 → 6.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs
CHANGED
|
@@ -559,17 +559,8 @@ function createSourceScript(src) {
|
|
|
559
559
|
const scriptSources = {
|
|
560
560
|
cmpFrames: "https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"
|
|
561
561
|
};
|
|
562
|
-
|
|
563
|
-
tcfStub: `"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();`,
|
|
564
|
-
gppStub: `window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));
|
|
565
|
-
`
|
|
566
|
-
};
|
|
567
|
-
function getCmpScripts(options) {
|
|
562
|
+
function getCmpScripts() {
|
|
568
563
|
const fragment = document.createDocumentFragment();
|
|
569
|
-
fragment.appendChild(createContentScript("tcf", scriptContent.tcfStub));
|
|
570
|
-
if (options.includeUsNat) {
|
|
571
|
-
fragment.appendChild(createContentScript("gpp", scriptContent.gppStub));
|
|
572
|
-
}
|
|
573
564
|
fragment.appendChild(createSourceScript(scriptSources.cmpFrames));
|
|
574
565
|
return fragment;
|
|
575
566
|
}
|
|
@@ -588,7 +579,19 @@ function bootstrapCmp(config, options) {
|
|
|
588
579
|
const runtimeConfig = applyOptionsToConfig(spConfig, options);
|
|
589
580
|
window._sp_ = { config: runtimeConfig };
|
|
590
581
|
window._sp_queue ?? (window._sp_queue = []);
|
|
591
|
-
document.head.appendChild(getCmpScripts(
|
|
582
|
+
document.head.appendChild(getCmpScripts());
|
|
583
|
+
}
|
|
584
|
+
function addAPIStubsToDocument(options) {
|
|
585
|
+
const scriptContent = {
|
|
586
|
+
tcfStub: `"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();`,
|
|
587
|
+
gppStub: `window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));`
|
|
588
|
+
};
|
|
589
|
+
const fragment = document.createDocumentFragment();
|
|
590
|
+
fragment.appendChild(createContentScript("tcf", scriptContent.tcfStub));
|
|
591
|
+
if (options.includeUsNat) {
|
|
592
|
+
fragment.appendChild(createContentScript("gpp", scriptContent.gppStub));
|
|
593
|
+
}
|
|
594
|
+
document.head.appendChild(fragment);
|
|
592
595
|
}
|
|
593
596
|
function getConsentPayload(parsedConsent, updateConsentStore, isUserInitiated, { formOfWordsId, cookieDomain }) {
|
|
594
597
|
const categoryNames = Object.keys(parsedConsent);
|
|
@@ -1085,7 +1088,7 @@ function setupFTConsentCookieAuditStorage() {
|
|
|
1085
1088
|
localStorage.setItem("__lastFtc", ftConsentCookieValue);
|
|
1086
1089
|
});
|
|
1087
1090
|
}
|
|
1088
|
-
const version = "6.
|
|
1091
|
+
const version = "6.16.0";
|
|
1089
1092
|
async function initSourcepointCmp(options) {
|
|
1090
1093
|
const {
|
|
1091
1094
|
useFTSession = true,
|
|
@@ -1103,6 +1106,7 @@ async function initSourcepointCmp(options) {
|
|
|
1103
1106
|
return;
|
|
1104
1107
|
}
|
|
1105
1108
|
window.FT_CMP_CLIENT_VERSION = version;
|
|
1109
|
+
addAPIStubsToDocument({ includeUsNat });
|
|
1106
1110
|
if (!userId && useFTSession) {
|
|
1107
1111
|
try {
|
|
1108
1112
|
const response = await getUuid();
|
package/dist/index.js
CHANGED
|
@@ -557,17 +557,8 @@ function createSourceScript(src) {
|
|
|
557
557
|
const scriptSources = {
|
|
558
558
|
cmpFrames: "https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"
|
|
559
559
|
};
|
|
560
|
-
|
|
561
|
-
tcfStub: `"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();`,
|
|
562
|
-
gppStub: `window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));
|
|
563
|
-
`
|
|
564
|
-
};
|
|
565
|
-
function getCmpScripts(options) {
|
|
560
|
+
function getCmpScripts() {
|
|
566
561
|
const fragment = document.createDocumentFragment();
|
|
567
|
-
fragment.appendChild(createContentScript("tcf", scriptContent.tcfStub));
|
|
568
|
-
if (options.includeUsNat) {
|
|
569
|
-
fragment.appendChild(createContentScript("gpp", scriptContent.gppStub));
|
|
570
|
-
}
|
|
571
562
|
fragment.appendChild(createSourceScript(scriptSources.cmpFrames));
|
|
572
563
|
return fragment;
|
|
573
564
|
}
|
|
@@ -586,7 +577,19 @@ function bootstrapCmp(config, options) {
|
|
|
586
577
|
const runtimeConfig = applyOptionsToConfig(spConfig, options);
|
|
587
578
|
window._sp_ = { config: runtimeConfig };
|
|
588
579
|
window._sp_queue ?? (window._sp_queue = []);
|
|
589
|
-
document.head.appendChild(getCmpScripts(
|
|
580
|
+
document.head.appendChild(getCmpScripts());
|
|
581
|
+
}
|
|
582
|
+
function addAPIStubsToDocument(options) {
|
|
583
|
+
const scriptContent = {
|
|
584
|
+
tcfStub: `"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();`,
|
|
585
|
+
gppStub: `window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));`
|
|
586
|
+
};
|
|
587
|
+
const fragment = document.createDocumentFragment();
|
|
588
|
+
fragment.appendChild(createContentScript("tcf", scriptContent.tcfStub));
|
|
589
|
+
if (options.includeUsNat) {
|
|
590
|
+
fragment.appendChild(createContentScript("gpp", scriptContent.gppStub));
|
|
591
|
+
}
|
|
592
|
+
document.head.appendChild(fragment);
|
|
590
593
|
}
|
|
591
594
|
function getConsentPayload(parsedConsent, updateConsentStore, isUserInitiated, { formOfWordsId, cookieDomain }) {
|
|
592
595
|
const categoryNames = Object.keys(parsedConsent);
|
|
@@ -1083,7 +1086,7 @@ function setupFTConsentCookieAuditStorage() {
|
|
|
1083
1086
|
localStorage.setItem("__lastFtc", ftConsentCookieValue);
|
|
1084
1087
|
});
|
|
1085
1088
|
}
|
|
1086
|
-
const version = "6.
|
|
1089
|
+
const version = "6.16.0";
|
|
1087
1090
|
async function initSourcepointCmp(options) {
|
|
1088
1091
|
const {
|
|
1089
1092
|
useFTSession = true,
|
|
@@ -1101,6 +1104,7 @@ async function initSourcepointCmp(options) {
|
|
|
1101
1104
|
return;
|
|
1102
1105
|
}
|
|
1103
1106
|
window.FT_CMP_CLIENT_VERSION = version;
|
|
1107
|
+
addAPIStubsToDocument({ includeUsNat });
|
|
1104
1108
|
if (!userId && useFTSession) {
|
|
1105
1109
|
try {
|
|
1106
1110
|
const response = await getUuid();
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
(function(){"use strict";const j=(t,{credentials:e="omit"}={})=>fetch(`https://session-next.ft.com${t}`,{credentials:e,useCorsProxy:!0}).then(n=>n.ok?n.json():n.text().then(o=>{throw new Error(`Next session responded with "${o}" (${n.status})`)})).catch(n=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:n,info:{component:"next-session-client"}}}))});let I={};const S=(t,e)=>{if(typeof t=="object"){I=t;return}if(typeof t=="string"&&typeof e=="string"){I[t]=e;return}if(typeof t=="string"&&typeof e>"u")return I[t]||null;if(typeof t>"u"&&typeof e>"u")return I;throw new Error("Invalid arguments")};S.clear=()=>{I={}};const b={},x=()=>{const[,t]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return t},H=()=>{const t=S("uuid");if(t)return Promise.resolve({uuid:t});const e=x();return e?(b.uuid||(b.uuid=j(`/sessions/s/${e}`).then(({uuid:n}={})=>(delete b.uuid,n&&S("uuid",n),{uuid:n}))),b.uuid):Promise.resolve({uuid:void 0})},h="sourcepoint-cmp",G="FTPINK",B="FTConsent",q="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",W=".ft.com",$="https://consent.ft.com",k={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},cookies:{purposes:[1,2,3,4,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},y=Object.keys(k),u={joinHref:!0,gdpr:{}},T={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com",includeUsNat:!0}},v={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,usnatPrivacyManagerId:1143274,ccpaPrivacyManagerId:944882,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com",includeUsNat:!0}},K={...u,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com",includeUsNat:!0}},J={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com",includeUsNat:!0}},z={...u,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com",includeUsNat:!0}},X={...u,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com",includeUsNat:!0}},Y={...u,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com",includeUsNat:!0}},Z={...u,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com",includeUsNat:!0}},Q={...u,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk",includeUsNat:!0}},tt={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},et={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},nt={...u,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com",includeUsNat:!0}},ot={...u,accountId:1906,baseEndpoint:"https://consent-manager.ftlocations.com",propertyId:37407,_clientOptions:{rootDomain:"ftlocations.com",cookieDomain:".ftlocations.com",consentProxyHost:"https://consent.ftlocations.com",includeUsNat:!0}},st={...u,accountId:1906,baseEndpoint:"https://consent-manager.financialadviserserviceawards.com",propertyId:38297,_clientOptions:{rootDomain:"financialadviserserviceawards.com",includeUsNat:!0}},at={...u,accountId:1906,baseEndpoint:"https://consent-manager.celebrationofinvestment.co.uk",propertyId:38296,_clientOptions:{rootDomain:"celebrationofinvestment.co.uk",includeUsNat:!0}},it={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalprivatebankingawards.com",propertyId:38295,_clientOptions:{rootDomain:"globalprivatebankingawards.com",includeUsNat:!0}},ct={...u,accountId:1906,baseEndpoint:"https://consent-manager.thenextweb.com",propertyId:37672,_clientOptions:{rootDomain:"thenextweb.com"}},rt={...u,accountId:1906,baseEndpoint:"https://consent-manager.invisso.org",propertyId:38851,_clientOptions:{rootDomain:"invisso.org"}},pt={...u,accountId:1906,baseEndpoint:"https://consent-manager.abseast.com",propertyId:38888,_clientOptions:{rootDomain:"abseast.com"}},ut={...u,accountId:1906,baseEndpoint:"https://consent-manager.absasia.org",propertyId:38887,_clientOptions:{rootDomain:"absasia.org"}},dt={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalcoveredbonds.com",propertyId:38886,_clientOptions:{rootDomain:"globalcoveredbonds.com"}},lt={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalborrowers.com",propertyId:38885,_clientOptions:{rootDomain:"globalborrowers.com"}},ft={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalabs.org",propertyId:38884,_clientOptions:{rootDomain:"globalabs.org"}},mt={...u,accountId:1906,baseEndpoint:"https://consent-manager.creditrisk-transfer.com",propertyId:38883,_clientOptions:{rootDomain:"creditrisk-transfer.com"}},_t={...u,accountId:1906,baseEndpoint:"https://consent-manager.significantrisktransfer.com",propertyId:38882,_clientOptions:{rootDomain:"significantrisktransfer.com"}},gt={...u,accountId:1906,baseEndpoint:"https://consent-manager.theceeforum.com",propertyId:38882,_clientOptions:{rootDomain:"theceeforum.com"}},It={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdimarkets.com",propertyId:40508,_clientOptions:{rootDomain:"fdimarkets.com",cookieDomain:".fdimarkets.com",consentProxyHost:"https://consent.fdimarkets.com",includeUsNat:!0}},bt={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdibenchmark.com",propertyId:40509,_clientOptions:{rootDomain:"fdibenchmark.com",cookieDomain:".fdibenchmark.com",consentProxyHost:"https://consent.fdibenchmark.com",includeUsNat:!0}},yt=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:v,FT_DOTCOM_TEST:T,INVISSO:rt,INV_ABSASIA:ut,INV_ABSEAST:pt,INV_CEE_FORUM:gt,INV_CREDITRISK_TRANSFER:mt,INV_GLOBAL_ABS:ft,INV_GLOBAL_BORROWERS:lt,INV_GLOBAL_COVERED_BONDS:dt,MM_IGNITES_ASIA:tt,MM_IGNITES_EUROPE:et,SIGRISK_TRANSFER:_t,SP_BANKING_RR:X,SP_CELEBRATION_OF_INVESTMENT:at,SP_FDI_BENCHMARK:bt,SP_FDI_INTELLIGENCE:J,SP_FDI_MARKETS:It,SP_FTA_SERVICE_AWARDS:st,SP_FT_ADVISER:Z,SP_FT_LOCATIONS:ot,SP_GLOBAL_PRIVATE_BANKING_AWARDS:it,SP_INVESTORS_CHRONICLE:Q,SP_MANDATE_WIRE:nt,SP_PWMNET:K,SP_SUSTAINABLE_VIEWS:Y,SP_THE_BANKER:z,TNW:ct},Symbol.toStringTag,{value:"Module"}));function A(t,e){const n=document.createElement("script");return n.dataset.cmpScript=t,n.innerHTML=e,n}function vt(t){const e=document.createElement("script");return e.src=t,e}const wt={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},D={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",r.title = "__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',gppStub:`window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usvav1","10:uscov1","11:usutv1","12:usctv1"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));
|
|
2
|
-
`};function St(t){const e=document.createDocumentFragment();return e.appendChild(A("tcf",D.tcfStub)),t.includeUsNat&&e.appendChild(A("gpp",D.gppStub)),e.appendChild(vt(wt.cmpFrames)),e}function ht(t,e){const{userId:n,includeUsNat:o}=e;return n&&(t.authId=n),o&&(t.usnat=t.usnat||{}),t}function Ct(t,e){const{_clientOptions:n,...o}=t,s=ht(o,e);window._sp_={config:s},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(St(e))}function Ot(t,e,n,{formOfWordsId:o,cookieDomain:s}){const i=Object.keys(t).reduce((r,c)=>(r[c]={onsite:{status:t[c],lbi:!1,source:h,fow:o}},c==="cookies"&&(r.cookies.userAccept={status:t[c],lbi:!1,source:h,fow:o}),r),{});return e?{setConsentCookie:!0,formOfWordsId:o,consentSource:h,cookieDomain:s,skipDuplicateUpdates:!n,data:i}:{data:i,cookieDomain:s}}const g={CALIFORNIA:"usca",US_NATIONAL:"usnat"},P={[g.CALIFORNIA]:{excludedCategories:{}},[g.US_NATIONAL]:{excludedCategories:{personalisedMarketing:!0}}};function Et(t){const{applicableSections:e,supportedAPIs:n}=t,o=e[0];if(o===-1||typeof o>"u")return;const s=n.find(i=>i.startsWith(`${o}:`));return s==null?void 0:s.split(":")[1]}function Nt(t){const{SaleOptOut:e,SharingOptOut:n,Gpc:o}=t,{excludedCategories:s}=P[g.CALIFORNIA],a=e!==1&&n!==1&&!o,i={};for(const r of y){if(r in s){i[r]=!0;continue}i[r]=a}return i}function kt(t){const{SaleOptOut:e,SharingOptOut:n,TargetedAdvertisingOptOut:o}=t,{excludedCategories:s}=P[g.US_NATIONAL],a=JSON.parse(localStorage.getItem("ft_sp_marketing_optout")||"{}"),i=e!==1&&n!==1&&o!==1,r={};for(const c of y){if(c in s){r[c]=!0;continue}r[c]=i}if(a.usnat)for(const c of y)r[c]=!1;return r}const Tt={[g.CALIFORNIA]:Nt,[g.US_NATIONAL]:kt};async function L(){return new Promise((t,e)=>{try{window.__gpp?window.__gpp("ping",t):e(new Error("GPP API is not available on page"))}catch(n){e(n)}})}async function At(){const t=await L(),{parsedSections:e}=t,n=Et(t);if(!n||!e[n])throw new Error("GPP parser was called without an applicable section");const o=e[n],s=Tt[n];if(!s||typeof s!="function")throw new Error(`No parser found for applicable GPP section: ${n}`);return s(o)}function Dt(t,{purpose:e,vendor:n,specialFeatureOptins:o={}}){const s=k[t],a=(e==null?void 0:e.consents)||{},i=(e==null?void 0:e.legitimateInterests)||{},r=(n==null?void 0:n.consents)||{},c=(n==null?void 0:n.legitimateInterests)||{},p=s.purposes.every(l=>a[l]||i[l]),f=s.iabVendors.every(l=>r[l]||c[l]),d=s.specialFeatures.every(l=>o[l]===!0),_=s.purposes.every(l=>a[l]===!0);return t==="cookies"?_&&f&&d:p&&f&&d}async function M(){return new Promise((t,e)=>{try{window.__tcfapi?window.__tcfapi("addEventListener",2,t):e(new Error("TCF API is not available on page"))}catch(n){e(n)}})}async function Pt(){const t=await M(),e={};for(const n of y)e[n]=Dt(n,t);return e}async function Lt(t){const n={gdpr:Pt,usnat:At}[t];if(!n)throw new Error("Unable to update user consent. Unsupported consent legislation.");return n()}function Mt(){const e=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[B];if(!e)return{};const n=decodeURIComponent(e);return Object.fromEntries(n.split(",").map(o=>{const[s,a]=o.split(":");return[s,a==="on"]}))}function Ft(t,e){return Object.keys(t).some(o=>{const s=`${o.toLowerCase()}Onsite`;return t[o]!==e[s]})}function Rt({userId:t,useConsentStore:e}){return!!t&&e===!0}function Ut(t,e){return t?`${e.consentProxyHost}/__consent/consent-record/${G}/${e.userId}?updateFtConsentCookie=true`:`${e.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${e.cookieDomain}`}const F={gdpr:!1,usnat:!1},C=Object.assign({},F);function R(t){C[t]=!0}function Vt(t){return C[t]}function jt(){Object.assign(C,F)}async function xt(t){return Vt(t)?t==="gdpr"?(await M()).eventStatus==="useractioncomplete":t==="usnat"?(await L()).cmpDisplayStatus==="hidden":!1:!1}function Ht(){window.__tcfapi&&window.__tcfapi("addEventListener",2,t=>{t.eventStatus==="cmpuishown"&&R("gdpr")}),window.__gpp&&window.__gpp("addEventListener",({pingData:t})=>{t.cmpDisplayStatus==="visible"&&R("usnat")})}async function Gt(t,e){try{const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}finally{document.dispatchEvent(new CustomEvent("onCmpConsentSaveCompleted",{bubbles:!0}))}}const Bt=()=>{document.dispatchEvent(new CustomEvent("onCmpConsentReady",{bubbles:!0}))};function qt(t){return async function(n,o,s,a){if(Bt(),a.applies&&!window._FTConsentReady_&&(window._FTConsentReady_=n),t.disableFTCookies||!t.includeUsNat&&n==="usnat"||!a.applies||!s)return;let i;try{i=await Lt(n)}catch(_){console.error(_)}if(!i||!Ft(i,Mt()))return;window.dataLayer=(window==null?void 0:window.dataLayer)||[],window.dataLayer.push({event:"consentUpdate",consentUpdateBehaviouralAds:i.behaviouralAds,consentUpdateCookies:i.cookies});const c=await xt(n),p=Rt(t),f=Ut(p,t),d=Ot(i,p,c,t);await Gt(f,d),c&&jt(),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const O="cookie-message",Wt="manage-cookies";let E=Object.freeze({activeComponent:O,messageId:0,privacyManagerId:0});function $t(t){return typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]"}const Kt=()=>({...E}),N=t=>{if(!$t(t)){console.error("Invalid state changes");return}E={...E,...t}},Jt=["adsDisableInternalCMP","pwm.cmp"];function zt(t,e){const n=Xt(t.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[a,i]of Object.entries(Zt))(s=(o=window._sp_).addEventListener)==null||s.call(o,a,i({...t,flags:n}))}),Qt({...t,flags:n},e),te()}function Xt(t){const e={};return typeof t=="object"&&Jt.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}function Yt(t){if(!t)return;const e=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:t.detail});e.dispatchEvent(n)}function w({trackingProps:t,action:e,triggerAction:n}){let o;const s=Kt(),{product:a,app:i,flags:r}=t;s.activeComponent===O?o=s.messageId:o=s.privacyManagerId;const c={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:e,...n&&{trigger_action:n},...a&&{product:a},...i&&{app:i},custom:[{cookie_toggle_flag:r}],url:window.document.location.href||null}};Yt(c)}const Zt={onMessageChoiceSelect:t=>(e,n,o)=>{const a={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];a&&w({trackingProps:t,action:"click",triggerAction:a})},onMessageReady:t=>()=>{w({trackingProps:t,action:"view"})},onMessageReceiveData:()=>(t,e)=>{const{messageId:n}=e;n&&N({messageId:n})},onError:t=>(e,n)=>{w({trackingProps:t,action:"error",triggerAction:n})},onPMCancel:()=>()=>{N({activeComponent:O})}};function Qt(t,e){window.addEventListener("message",function(n){if(n.origin!==e)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:a,messageId:i="0"}={}}=n;s&&(+i&&N({activeComponent:Wt,privacyManagerId:+i}),!(!a||!o[a])&&w({trackingProps:t,action:"click",triggerAction:o[a]}))},!1)}function te(){document.addEventListener("onCmpConsentSaveCompleted",()=>{const t=document.cookie.match(/FTConsent=([^;]+)/);if(!t)return;const e=t[1];localStorage.setItem("__lastFtc",e)})}const ee="6.15.0";async function ne(t){const{useFTSession:e=!0,consentProxyHost:n=$,cookieDomain:o=W,formOfWordsId:s=q,useConsentStore:a=!0,trackingContext:i={},disableFTCookies:r=!1,includeUsNat:c=!1}=t||{};let{propertyConfig:p=v,userId:f}=t||{};if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=ee,!f&&e)try{const d=await H();f=d==null?void 0:d.uuid}catch(d){console.error(d)}p=oe(p),Ct(p,{userId:f,includeUsNat:c}),Ht(),window._sp_queue.push(()=>{var d,_;(_=(d=window._sp_)==null?void 0:d.addEventListener)==null||_.call(d,"onConsentReady",qt({userId:f,consentProxyHost:n,cookieDomain:o,formOfWordsId:s,useConsentStore:a,disableFTCookies:r,includeUsNat:c}))}),zt(i,p.baseEndpoint)}function oe(t){if(!(t!=null&&t.accountId))throw new Error("Please pass a valid property config");return t.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete t.events),t}function U(t,e,n,o,s,a){const{text:i,onClick:r}=o[e],c=document.querySelectorAll(`a[href*="${a}"]`);for(const p of c)(n||t)&&(s.has(p)&&p.removeEventListener("click",s.get(p)),p.innerText=i,p.addEventListener("click",r),s.set(p,r))}function se({_clientOptions:t}=v){const{privacyManagerId:e,ccpaPrivacyManagerId:n,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=t??v._clientOptions,a={usnat:{text:"Do Not Sell My Personal Information",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.usnat)==null||p.loadPrivacyManagerModal(o)}},ccpa:{text:"Do Not Sell My Personal Information",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.ccpa)==null||p.loadPrivacyManagerModal(n)}},gdpr:{text:"Manage Cookies",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.gdpr)==null||p.loadPrivacyManagerModal(e)}}},i=new Map,r=function(c,p,f,d){U(!1,c,d.applies,a,i,s),d.applies&&window._sp_queue.push(()=>{var _,l;(l=(_=window._sp_).removeEventListener)==null||l.call(_,"onConsentReady",r)})};U(!0,"gdpr",!1,a,i,s),window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var c,p;(p=(c=window._sp_).addEventListener)==null||p.call(c,"onConsentReady",r)})}function ae(t){return t._clientOptions??{}}const ie={"ft.com":ae};function ce(t){return new Promise((e,n)=>{const{rootDomain:o}=t._clientOptions||{};if(!o)return e({});const s=ie[o];if(!s||typeof s!="function")return e({...t._clientOptions});const a=()=>{try{e(s(t))}catch(i){n(i)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})}const re={...{joinHref:!0,gdpr:{}},accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:41863,propertyHref:"https://globalbondsummit.live.ft.com",_clientOptions:{subDomain:"globalbondsummit.live.ft.com",includeUsNat:!0}},pe=Object.freeze(Object.defineProperty({__proto__:null,INV_GLOBAL_BONDS_SUMMIT:re},Symbol.toStringTag,{value:"Module"}));function V(t,e){if(!e||Number.isFinite(parseFloat(e)))return!1;const n=t===e,o=t.endsWith(`.${e}`);return n||o}function ue(t){if(!t)throw new Error("Invalid hostname provided");const e=Object.values(yt),o=Object.values(pe).find(a=>{var r;const i=(r=a==null?void 0:a._clientOptions)==null?void 0:r.subDomain;return i&&V(t,i)});if(o)return o;let s=e.find(a=>{var r;if(a.propertyHref)return!1;const i=(r=a._clientOptions)==null?void 0:r.rootDomain;return i&&V(t,i)});return s??(s=T),s}const de=new URL(window.location.href).hostname,m=ue(de);(async()=>{var t,e;try{const n=await ce(m);ne({propertyConfig:m,...n}),(t=m==null?void 0:m._clientOptions)!=null&&t.privacyManagerId&&((e=m==null?void 0:m._clientOptions)!=null&&e.manageCookiesLinkOverride)&&se(m)}catch(n){console.error("Error: CMP package configure + initialise Sourcepoint failed.",n)}})()})();
|
|
1
|
+
(function(){"use strict";const V=(t,{credentials:e="omit"}={})=>fetch(`https://session-next.ft.com${t}`,{credentials:e,useCorsProxy:!0}).then(n=>n.ok?n.json():n.text().then(o=>{throw new Error(`Next session responded with "${o}" (${n.status})`)})).catch(n=>{document.body.dispatchEvent(new CustomEvent("oErrors.log",{bubbles:!0,detail:{error:n,info:{component:"next-session-client"}}}))});let I={};const S=(t,e)=>{if(typeof t=="object"){I=t;return}if(typeof t=="string"&&typeof e=="string"){I[t]=e;return}if(typeof t=="string"&&typeof e>"u")return I[t]||null;if(typeof t>"u"&&typeof e>"u")return I;throw new Error("Invalid arguments")};S.clear=()=>{I={}};const b={},j=()=>{const[,t]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return t},x=()=>{const t=S("uuid");if(t)return Promise.resolve({uuid:t});const e=j();return e?(b.uuid||(b.uuid=V(`/sessions/s/${e}`).then(({uuid:n}={})=>(delete b.uuid,n&&S("uuid",n),{uuid:n}))),b.uuid):Promise.resolve({uuid:void 0})},h="sourcepoint-cmp",H="FTPINK",G="FTConsent",B="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",q=".ft.com",W="https://consent.ft.com",k={permutiveAds:{purposes:[2,4,8,9],iabVendors:[361],customVendors:[],specialFeatures:[]},demographicAds:{purposes:[7,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},behaviouralAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},programmaticAds:{purposes:[2,4,8,9],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]},cookies:{purposes:[1,2,3,4,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},y=Object.keys(k),u={joinHref:!0,gdpr:{}},T={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyHref:"https://local.ft.com",_clientOptions:{privacyManagerId:827767,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com",includeUsNat:!0}},w={...u,accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:31642,_clientOptions:{privacyManagerId:827767,usnatPrivacyManagerId:1143274,ccpaPrivacyManagerId:944882,manageCookiesLinkOverride:"ft.com/preferences/manage-cookies",rootDomain:"ft.com",includeUsNat:!0}},$={...u,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com",includeUsNat:!0}},K={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com",includeUsNat:!0}},J={...u,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com",includeUsNat:!0}},z={...u,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com",includeUsNat:!0}},X={...u,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com",includeUsNat:!0}},Y={...u,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com",includeUsNat:!0}},Z={...u,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk",includeUsNat:!0}},Q={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},tt={...u,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},et={...u,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com",includeUsNat:!0}},nt={...u,accountId:1906,baseEndpoint:"https://consent-manager.ftlocations.com",propertyId:37407,_clientOptions:{rootDomain:"ftlocations.com",cookieDomain:".ftlocations.com",consentProxyHost:"https://consent.ftlocations.com",includeUsNat:!0}},ot={...u,accountId:1906,baseEndpoint:"https://consent-manager.financialadviserserviceawards.com",propertyId:38297,_clientOptions:{rootDomain:"financialadviserserviceawards.com",includeUsNat:!0}},st={...u,accountId:1906,baseEndpoint:"https://consent-manager.celebrationofinvestment.co.uk",propertyId:38296,_clientOptions:{rootDomain:"celebrationofinvestment.co.uk",includeUsNat:!0}},at={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalprivatebankingawards.com",propertyId:38295,_clientOptions:{rootDomain:"globalprivatebankingawards.com",includeUsNat:!0}},it={...u,accountId:1906,baseEndpoint:"https://consent-manager.thenextweb.com",propertyId:37672,_clientOptions:{rootDomain:"thenextweb.com"}},ct={...u,accountId:1906,baseEndpoint:"https://consent-manager.invisso.org",propertyId:38851,_clientOptions:{rootDomain:"invisso.org"}},rt={...u,accountId:1906,baseEndpoint:"https://consent-manager.abseast.com",propertyId:38888,_clientOptions:{rootDomain:"abseast.com"}},pt={...u,accountId:1906,baseEndpoint:"https://consent-manager.absasia.org",propertyId:38887,_clientOptions:{rootDomain:"absasia.org"}},ut={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalcoveredbonds.com",propertyId:38886,_clientOptions:{rootDomain:"globalcoveredbonds.com"}},dt={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalborrowers.com",propertyId:38885,_clientOptions:{rootDomain:"globalborrowers.com"}},lt={...u,accountId:1906,baseEndpoint:"https://consent-manager.globalabs.org",propertyId:38884,_clientOptions:{rootDomain:"globalabs.org"}},mt={...u,accountId:1906,baseEndpoint:"https://consent-manager.creditrisk-transfer.com",propertyId:38883,_clientOptions:{rootDomain:"creditrisk-transfer.com"}},ft={...u,accountId:1906,baseEndpoint:"https://consent-manager.significantrisktransfer.com",propertyId:38882,_clientOptions:{rootDomain:"significantrisktransfer.com"}},gt={...u,accountId:1906,baseEndpoint:"https://consent-manager.theceeforum.com",propertyId:38882,_clientOptions:{rootDomain:"theceeforum.com"}},_t={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdimarkets.com",propertyId:40508,_clientOptions:{rootDomain:"fdimarkets.com",cookieDomain:".fdimarkets.com",consentProxyHost:"https://consent.fdimarkets.com",includeUsNat:!0}},It={...u,accountId:1906,baseEndpoint:"https://consent-manager.fdibenchmark.com",propertyId:40509,_clientOptions:{rootDomain:"fdibenchmark.com",cookieDomain:".fdibenchmark.com",consentProxyHost:"https://consent.fdibenchmark.com",includeUsNat:!0}},bt=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:w,FT_DOTCOM_TEST:T,INVISSO:ct,INV_ABSASIA:pt,INV_ABSEAST:rt,INV_CEE_FORUM:gt,INV_CREDITRISK_TRANSFER:mt,INV_GLOBAL_ABS:lt,INV_GLOBAL_BORROWERS:dt,INV_GLOBAL_COVERED_BONDS:ut,MM_IGNITES_ASIA:Q,MM_IGNITES_EUROPE:tt,SIGRISK_TRANSFER:ft,SP_BANKING_RR:z,SP_CELEBRATION_OF_INVESTMENT:st,SP_FDI_BENCHMARK:It,SP_FDI_INTELLIGENCE:K,SP_FDI_MARKETS:_t,SP_FTA_SERVICE_AWARDS:ot,SP_FT_ADVISER:Y,SP_FT_LOCATIONS:nt,SP_GLOBAL_PRIVATE_BANKING_AWARDS:at,SP_INVESTORS_CHRONICLE:Z,SP_MANDATE_WIRE:et,SP_PWMNET:$,SP_SUSTAINABLE_VIEWS:X,SP_THE_BANKER:J,TNW:it},Symbol.toStringTag,{value:"Module"}));function A(t,e){const n=document.createElement("script");return n.dataset.cmpScript=t,n.innerHTML=e,n}function yt(t){const e=document.createElement("script");return e.src=t,e}const wt={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"};function vt(){const t=document.createDocumentFragment();return t.appendChild(yt(wt.cmpFrames)),t}function St(t,e){const{userId:n,includeUsNat:o}=e;return n&&(t.authId=n),o&&(t.usnat=t.usnat||{}),t}function ht(t,e){const{_clientOptions:n,...o}=t,s=St(o,e);window._sp_={config:s},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(vt())}function Ct(t){const e={tcfStub:'"use strict";function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement("iframe");r.style.cssText="display:none",r.name="__tcfapiLocator",e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;"setGdprApplies"===n[0]?n.length>3&&2===parseInt(n[1],10)&&"boolean"==typeof n[3]&&(e=n[3],"function"==typeof n[2]&&n[2]("set",!0)):"ping"===n[0]?"function"==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:"stub"}):o.push(n)},n.addEventListener("message",(function(t){var e="string"==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n="object"===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,"*")}),n.parameter)}),!1))};"undefined"!=typeof module?module.exports=t:t()}();',gppStub:'window.__gpp_addFrame=function(e){if(!window.frames[e])if(document.body){var t=document.createElement("iframe");t.style.cssText="display:none",t.name=e,document.body.appendChild(t)}else window.setTimeout(window.__gpp_addFrame,10,e)},window.__gpp_stub=function(){var e=arguments;if(__gpp.queue=__gpp.queue||[],__gpp.events=__gpp.events||[],!e.length||1==e.length&&"queue"==e[0])return __gpp.queue;if(1==e.length&&"events"==e[0])return __gpp.events;var t=e[0],p=e.length>1?e[1]:null,s=e.length>2?e[2]:null;if("ping"===t)p({gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}},!0);else if("addEventListener"===t){"lastId"in __gpp||(__gpp.lastId=0),__gpp.lastId++;var n=__gpp.lastId;__gpp.events.push({id:n,callback:p,parameter:s}),p({eventName:"listenerRegistered",listenerId:n,data:!0,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else if("removeEventListener"===t){for(var a=!1,i=0;i<__gpp.events.length;i++)if(__gpp.events[i].id==s){__gpp.events.splice(i,1),a=!0;break}p({eventName:"listenerRemoved",listenerId:s,data:a,pingData:{gppVersion:"1.1",cmpStatus:"stub",cmpDisplayStatus:"hidden",signalStatus:"not ready",supportedAPIs:["2:tcfeuv2","5:tcfcav1","6:uspv1","7:usnat","8:usca","9:usva","10:usco","11:usut","12:usct"],cmpId:0,sectionList:[],applicableSections:[],gppString:"",parsedSections:{}}},!0)}else"hasSection"===t?p(!1,!0):"getSection"===t||"getField"===t?p(null,!0):__gpp.queue.push([].slice.apply(e))},window.__gpp_msghandler=function(e){var t="string"==typeof e.data;try{var p=t?JSON.parse(e.data):e.data}catch(e){p=null}if("object"==typeof p&&null!==p&&"__gppCall"in p){var s=p.__gppCall;window.__gpp(s.command,(function(p,n){var a={__gppReturn:{returnValue:p,success:n,callId:s.callId}};e.source.postMessage(t?JSON.stringify(a):a,"*")}),"parameter"in s?s.parameter:null,"version"in s?s.version:"1.1")}},"__gpp"in window&&"function"==typeof window.__gpp||(window.__gpp=window.__gpp_stub,window.addEventListener("message",window.__gpp_msghandler,!1),window.__gpp_addFrame("__gppLocator"));'},n=document.createDocumentFragment();n.appendChild(A("tcf",e.tcfStub)),t.includeUsNat&&n.appendChild(A("gpp",e.gppStub)),document.head.appendChild(n)}function Ot(t,e,n,{formOfWordsId:o,cookieDomain:s}){const i=Object.keys(t).reduce((r,c)=>(r[c]={onsite:{status:t[c],lbi:!1,source:h,fow:o}},c==="cookies"&&(r.cookies.userAccept={status:t[c],lbi:!1,source:h,fow:o}),r),{});return e?{setConsentCookie:!0,formOfWordsId:o,consentSource:h,cookieDomain:s,skipDuplicateUpdates:!n,data:i}:{data:i,cookieDomain:s}}const _={CALIFORNIA:"usca",US_NATIONAL:"usnat"},D={[_.CALIFORNIA]:{excludedCategories:{}},[_.US_NATIONAL]:{excludedCategories:{personalisedMarketing:!0}}};function Et(t){const{applicableSections:e,supportedAPIs:n}=t,o=e[0];if(o===-1||typeof o>"u")return;const s=n.find(i=>i.startsWith(`${o}:`));return s==null?void 0:s.split(":")[1]}function Nt(t){const{SaleOptOut:e,SharingOptOut:n,Gpc:o}=t,{excludedCategories:s}=D[_.CALIFORNIA],a=e!==1&&n!==1&&!o,i={};for(const r of y){if(r in s){i[r]=!0;continue}i[r]=a}return i}function kt(t){const{SaleOptOut:e,SharingOptOut:n,TargetedAdvertisingOptOut:o}=t,{excludedCategories:s}=D[_.US_NATIONAL],a=JSON.parse(localStorage.getItem("ft_sp_marketing_optout")||"{}"),i=e!==1&&n!==1&&o!==1,r={};for(const c of y){if(c in s){r[c]=!0;continue}r[c]=i}if(a.usnat)for(const c of y)r[c]=!1;return r}const Tt={[_.CALIFORNIA]:Nt,[_.US_NATIONAL]:kt};async function P(){return new Promise((t,e)=>{try{window.__gpp?window.__gpp("ping",t):e(new Error("GPP API is not available on page"))}catch(n){e(n)}})}async function At(){const t=await P(),{parsedSections:e}=t,n=Et(t);if(!n||!e[n])throw new Error("GPP parser was called without an applicable section");const o=e[n],s=Tt[n];if(!s||typeof s!="function")throw new Error(`No parser found for applicable GPP section: ${n}`);return s(o)}function Dt(t,{purpose:e,vendor:n,specialFeatureOptins:o={}}){const s=k[t],a=(e==null?void 0:e.consents)||{},i=(e==null?void 0:e.legitimateInterests)||{},r=(n==null?void 0:n.consents)||{},c=(n==null?void 0:n.legitimateInterests)||{},p=s.purposes.every(l=>a[l]||i[l]),m=s.iabVendors.every(l=>r[l]||c[l]),d=s.specialFeatures.every(l=>o[l]===!0),g=s.purposes.every(l=>a[l]===!0);return t==="cookies"?g&&m&&d:p&&m&&d}async function L(){return new Promise((t,e)=>{try{window.__tcfapi?window.__tcfapi("addEventListener",2,t):e(new Error("TCF API is not available on page"))}catch(n){e(n)}})}async function Pt(){const t=await L(),e={};for(const n of y)e[n]=Dt(n,t);return e}async function Lt(t){const n={gdpr:Pt,usnat:At}[t];if(!n)throw new Error("Unable to update user consent. Unsupported consent legislation.");return n()}function Ft(){const e=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[G];if(!e)return{};const n=decodeURIComponent(e);return Object.fromEntries(n.split(",").map(o=>{const[s,a]=o.split(":");return[s,a==="on"]}))}function Mt(t,e){return Object.keys(t).some(o=>{const s=`${o.toLowerCase()}Onsite`;return t[o]!==e[s]})}function Rt({userId:t,useConsentStore:e}){return!!t&&e===!0}function Ut(t,e){return t?`${e.consentProxyHost}/__consent/consent-record/${H}/${e.userId}?updateFtConsentCookie=true`:`${e.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${e.cookieDomain}`}const F={gdpr:!1,usnat:!1},C=Object.assign({},F);function M(t){C[t]=!0}function Vt(t){return C[t]}function jt(){Object.assign(C,F)}async function xt(t){return Vt(t)?t==="gdpr"?(await L()).eventStatus==="useractioncomplete":t==="usnat"?(await P()).cmpDisplayStatus==="hidden":!1:!1}function Ht(){window.__tcfapi&&window.__tcfapi("addEventListener",2,t=>{t.eventStatus==="cmpuishown"&&M("gdpr")}),window.__gpp&&window.__gpp("addEventListener",({pingData:t})=>{t.cmpDisplayStatus==="visible"&&M("usnat")})}async function Gt(t,e){try{const n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}finally{document.dispatchEvent(new CustomEvent("onCmpConsentSaveCompleted",{bubbles:!0}))}}const Bt=()=>{document.dispatchEvent(new CustomEvent("onCmpConsentReady",{bubbles:!0}))};function qt(t){return async function(n,o,s,a){if(Bt(),a.applies&&!window._FTConsentReady_&&(window._FTConsentReady_=n),t.disableFTCookies||!t.includeUsNat&&n==="usnat"||!a.applies||!s)return;let i;try{i=await Lt(n)}catch(g){console.error(g)}if(!i||!Mt(i,Ft()))return;window.dataLayer=(window==null?void 0:window.dataLayer)||[],window.dataLayer.push({event:"consentUpdate",consentUpdateBehaviouralAds:i.behaviouralAds,consentUpdateCookies:i.cookies});const c=await xt(n),p=Rt(t),m=Ut(p,t),d=Ot(i,p,c,t);await Gt(m,d),c&&jt(),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const O="cookie-message",Wt="manage-cookies";let E=Object.freeze({activeComponent:O,messageId:0,privacyManagerId:0});function $t(t){return typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]"}const Kt=()=>({...E}),N=t=>{if(!$t(t)){console.error("Invalid state changes");return}E={...E,...t}},Jt=["adsDisableInternalCMP","pwm.cmp"];function zt(t,e){const n=Xt(t.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[a,i]of Object.entries(Zt))(s=(o=window._sp_).addEventListener)==null||s.call(o,a,i({...t,flags:n}))}),Qt({...t,flags:n},e),te()}function Xt(t){const e={};return typeof t=="object"&&Jt.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}function Yt(t){if(!t)return;const e=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:t.detail});e.dispatchEvent(n)}function v({trackingProps:t,action:e,triggerAction:n}){let o;const s=Kt(),{product:a,app:i,flags:r}=t;s.activeComponent===O?o=s.messageId:o=s.privacyManagerId;const c={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:e,...n&&{trigger_action:n},...a&&{product:a},...i&&{app:i},custom:[{cookie_toggle_flag:r}],url:window.document.location.href||null}};Yt(c)}const Zt={onMessageChoiceSelect:t=>(e,n,o)=>{const a={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];a&&v({trackingProps:t,action:"click",triggerAction:a})},onMessageReady:t=>()=>{v({trackingProps:t,action:"view"})},onMessageReceiveData:()=>(t,e)=>{const{messageId:n}=e;n&&N({messageId:n})},onError:t=>(e,n)=>{v({trackingProps:t,action:"error",triggerAction:n})},onPMCancel:()=>()=>{N({activeComponent:O})}};function Qt(t,e){window.addEventListener("message",function(n){if(n.origin!==e)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:a,messageId:i="0"}={}}=n;s&&(+i&&N({activeComponent:Wt,privacyManagerId:+i}),!(!a||!o[a])&&v({trackingProps:t,action:"click",triggerAction:o[a]}))},!1)}function te(){document.addEventListener("onCmpConsentSaveCompleted",()=>{const t=document.cookie.match(/FTConsent=([^;]+)/);if(!t)return;const e=t[1];localStorage.setItem("__lastFtc",e)})}const ee="6.16.0";async function ne(t){const{useFTSession:e=!0,consentProxyHost:n=W,cookieDomain:o=q,formOfWordsId:s=B,useConsentStore:a=!0,trackingContext:i={},disableFTCookies:r=!1,includeUsNat:c=!1}=t||{};let{propertyConfig:p=w,userId:m}=t||{};if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=ee,Ct({includeUsNat:c}),!m&&e)try{const d=await x();m=d==null?void 0:d.uuid}catch(d){console.error(d)}p=oe(p),ht(p,{userId:m,includeUsNat:c}),Ht(),window._sp_queue.push(()=>{var d,g;(g=(d=window._sp_)==null?void 0:d.addEventListener)==null||g.call(d,"onConsentReady",qt({userId:m,consentProxyHost:n,cookieDomain:o,formOfWordsId:s,useConsentStore:a,disableFTCookies:r,includeUsNat:c}))}),zt(i,p.baseEndpoint)}function oe(t){if(!(t!=null&&t.accountId))throw new Error("Please pass a valid property config");return t.events&&(console.warn("[cmp-client] Passing an events map in the config is not supported and will be ignored. Please use window._sp_.addEventListener() to listen for events"),delete t.events),t}function R(t,e,n,o,s,a){const{text:i,onClick:r}=o[e],c=document.querySelectorAll(`a[href*="${a}"]`);for(const p of c)(n||t)&&(s.has(p)&&p.removeEventListener("click",s.get(p)),p.innerText=i,p.addEventListener("click",r),s.set(p,r))}function se({_clientOptions:t}=w){const{privacyManagerId:e,ccpaPrivacyManagerId:n,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=t??w._clientOptions,a={usnat:{text:"Do Not Sell My Personal Information",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.usnat)==null||p.loadPrivacyManagerModal(o)}},ccpa:{text:"Do Not Sell My Personal Information",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.ccpa)==null||p.loadPrivacyManagerModal(n)}},gdpr:{text:"Manage Cookies",onClick:c=>{var p;c.preventDefault(),(p=window._sp_.gdpr)==null||p.loadPrivacyManagerModal(e)}}},i=new Map,r=function(c,p,m,d){R(!1,c,d.applies,a,i,s),d.applies&&window._sp_queue.push(()=>{var g,l;(l=(g=window._sp_).removeEventListener)==null||l.call(g,"onConsentReady",r)})};R(!0,"gdpr",!1,a,i,s),window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var c,p;(p=(c=window._sp_).addEventListener)==null||p.call(c,"onConsentReady",r)})}function ae(t){return t._clientOptions??{}}const ie={"ft.com":ae};function ce(t){return new Promise((e,n)=>{const{rootDomain:o}=t._clientOptions||{};if(!o)return e({});const s=ie[o];if(!s||typeof s!="function")return e({...t._clientOptions});const a=()=>{try{e(s(t))}catch(i){n(i)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a()})}const re={...{joinHref:!0,gdpr:{}},accountId:1906,baseEndpoint:"https://consent-manager.ft.com",propertyId:41863,propertyHref:"https://globalbondsummit.live.ft.com",_clientOptions:{subDomain:"globalbondsummit.live.ft.com",includeUsNat:!0}},pe=Object.freeze(Object.defineProperty({__proto__:null,INV_GLOBAL_BONDS_SUMMIT:re},Symbol.toStringTag,{value:"Module"}));function U(t,e){if(!e||Number.isFinite(parseFloat(e)))return!1;const n=t===e,o=t.endsWith(`.${e}`);return n||o}function ue(t){if(!t)throw new Error("Invalid hostname provided");const e=Object.values(bt),o=Object.values(pe).find(a=>{var r;const i=(r=a==null?void 0:a._clientOptions)==null?void 0:r.subDomain;return i&&U(t,i)});if(o)return o;let s=e.find(a=>{var r;if(a.propertyHref)return!1;const i=(r=a._clientOptions)==null?void 0:r.rootDomain;return i&&U(t,i)});return s??(s=T),s}const de=new URL(window.location.href).hostname,f=ue(de);(async()=>{var t,e;try{const n=await ce(f);ne({propertyConfig:f,...n}),(t=f==null?void 0:f._clientOptions)!=null&&t.privacyManagerId&&((e=f==null?void 0:f._clientOptions)!=null&&e.manageCookiesLinkOverride)&&se(f)}catch(n){console.error("Error: CMP package configure + initialise Sourcepoint failed.",n)}})()})();
|
package/dist/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,uBAAuB,CAAC;AAYtE,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAY,MAAM,uBAAuB,CAAC;AAYtE,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,cAAc,iBAwD/D"}
|
|
@@ -4,4 +4,10 @@ import type { CMPInitOptions, SPConfig } from "../../typings/types";
|
|
|
4
4
|
* Then add the vendor scripts to the head of the document
|
|
5
5
|
*/
|
|
6
6
|
export declare function bootstrapCmp(config: SPConfig, options: CMPInitOptions): void;
|
|
7
|
+
/**
|
|
8
|
+
* Set up the legislation API (TCF & GPP) stubs
|
|
9
|
+
* These are create as early as possible
|
|
10
|
+
* This helps to avoid vendors attempting to interact with the APIs before they ready
|
|
11
|
+
*/
|
|
12
|
+
export declare function addAPIStubsToDocument(options: CMPInitOptions): void;
|
|
7
13
|
//# sourceMappingURL=cmp-scripts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmp-scripts.d.ts","sourceRoot":"","sources":["../../../src/html/cmp-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"cmp-scripts.d.ts","sourceRoot":"","sources":["../../../src/html/cmp-scripts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AA6BpE;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,QAOrE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,cAAc,QAe5D"}
|