@financial-times/cmp-client 5.7.0 → 5.7.2
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 +5 -4
- package/dist/index.js +5 -4
- package/dist/scripts/cmp-static.js +2 -2
- package/dist/src/lib/properties.d.ts +1 -0
- package/dist/src/lib/properties.d.ts.map +1 -1
- package/dist/src/utils/url.d.ts +1 -0
- package/dist/src/utils/url.d.ts.map +1 -1
- package/package.json +1 -1
- package/typings/types.d.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -169,7 +169,8 @@ const SP_FT_LOCATIONS = {
|
|
|
169
169
|
propertyId: 37407,
|
|
170
170
|
_clientOptions: {
|
|
171
171
|
rootDomain: "ftlocations.com",
|
|
172
|
-
cookieDomain: ".ftlocations.com"
|
|
172
|
+
cookieDomain: ".ftlocations.com",
|
|
173
|
+
consentProxyHost: "https://consent.ftlocations.com"
|
|
173
174
|
}
|
|
174
175
|
};
|
|
175
176
|
const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -384,7 +385,7 @@ const scriptSources = {
|
|
|
384
385
|
};
|
|
385
386
|
const scriptContent = {
|
|
386
387
|
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()}();`,
|
|
387
|
-
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:
|
|
388
|
+
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:uscav1","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:uscav1","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:uscav1","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"));
|
|
388
389
|
`
|
|
389
390
|
};
|
|
390
391
|
function getCmpScripts(options) {
|
|
@@ -443,7 +444,7 @@ function getConsentPayload(parsedConsent, updateConsentStore, isUserInitiated, {
|
|
|
443
444
|
}
|
|
444
445
|
const sections = {
|
|
445
446
|
CALIFORNIA: "uscav1",
|
|
446
|
-
US_NATIONAL: "
|
|
447
|
+
US_NATIONAL: "usnat"
|
|
447
448
|
};
|
|
448
449
|
const sectionConfig = {
|
|
449
450
|
[sections.CALIFORNIA]: {
|
|
@@ -874,7 +875,7 @@ function setupPmTracking(trackingProps, cmpBaseEndpoint) {
|
|
|
874
875
|
false
|
|
875
876
|
);
|
|
876
877
|
}
|
|
877
|
-
const version = "5.7.
|
|
878
|
+
const version = "5.7.2";
|
|
878
879
|
async function initSourcepointCmp(options) {
|
|
879
880
|
const {
|
|
880
881
|
useFTSession = true,
|
package/dist/index.js
CHANGED
|
@@ -167,7 +167,8 @@ const SP_FT_LOCATIONS = {
|
|
|
167
167
|
propertyId: 37407,
|
|
168
168
|
_clientOptions: {
|
|
169
169
|
rootDomain: "ftlocations.com",
|
|
170
|
-
cookieDomain: ".ftlocations.com"
|
|
170
|
+
cookieDomain: ".ftlocations.com",
|
|
171
|
+
consentProxyHost: "https://consent.ftlocations.com"
|
|
171
172
|
}
|
|
172
173
|
};
|
|
173
174
|
const properties = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -382,7 +383,7 @@ const scriptSources = {
|
|
|
382
383
|
};
|
|
383
384
|
const scriptContent = {
|
|
384
385
|
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()}();`,
|
|
385
|
-
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:
|
|
386
|
+
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:uscav1","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:uscav1","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:uscav1","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"));
|
|
386
387
|
`
|
|
387
388
|
};
|
|
388
389
|
function getCmpScripts(options) {
|
|
@@ -441,7 +442,7 @@ function getConsentPayload(parsedConsent, updateConsentStore, isUserInitiated, {
|
|
|
441
442
|
}
|
|
442
443
|
const sections = {
|
|
443
444
|
CALIFORNIA: "uscav1",
|
|
444
|
-
US_NATIONAL: "
|
|
445
|
+
US_NATIONAL: "usnat"
|
|
445
446
|
};
|
|
446
447
|
const sectionConfig = {
|
|
447
448
|
[sections.CALIFORNIA]: {
|
|
@@ -872,7 +873,7 @@ function setupPmTracking(trackingProps, cmpBaseEndpoint) {
|
|
|
872
873
|
false
|
|
873
874
|
);
|
|
874
875
|
}
|
|
875
|
-
const version = "5.7.
|
|
876
|
+
const version = "5.7.2";
|
|
876
877
|
async function initSourcepointCmp(options) {
|
|
877
878
|
const {
|
|
878
879
|
useFTSession = true,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";const V=(
|
|
2
|
-
`};function ae(e){const t=document.createDocumentFragment();return t.appendChild(P("tcf",A.tcfStub)),e.includeUsNat&&t.appendChild(P("gpp",A.gppStub)),t.appendChild(se(ie.cmpFrames)),t}function re(e,t){const{userId:n,includeUsNat:o}=t;return n&&(e.authId=n),o&&(e.usnat=e.usnat||{}),e}function ce(e,t){const{_clientOptions:n,...o}=e,s=re(o,t);window._sp_={config:s},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(ae(t))}function pe(e,t,n,{formOfWordsId:o,cookieDomain:s}){const r=Object.keys(e).reduce((c,a)=>(c[a]={onsite:{status:e[a],lbi:!1,source:T,fow:o}},c),{});return t?{setConsentCookie:!0,formOfWordsId:o,consentSource:T,cookieDomain:s,skipDuplicateUpdates:!n,data:r}:{data:r,cookieDomain:s}}const m={CALIFORNIA:"uscav1",US_NATIONAL:"usnatv1"},D={[m.CALIFORNIA]:{excludedCategories:{personalisedMarketing:!0}},[m.US_NATIONAL]:{excludedCategories:{personalisedMarketing:!0}}};function ue(e){const{applicableSections:t,supportedAPIs:n}=e,o=t[0];if(o===-1||typeof o>"u")return;const s=n.find(r=>r.startsWith(`${o}:`));return s==null?void 0:s.split(":")[1]}function de(e){const{SaleOptOut:t,SharingOptOut:n,Gpc:o}=e,{excludedCategories:s}=D[m.CALIFORNIA],i=t!==1&&n!==1&&!o,r={};for(const c of v){if(c in s){r[c]=!0;continue}r[c]=i}return r}function le(e){const{SaleOptOut:t,SharingOptOut:n,TargetedAdvertisingOptOut:o}=e,{excludedCategories:s}=D[m.US_NATIONAL],i=JSON.parse(localStorage.getItem("ft_sp_marketing_optout")||"{}"),r=t!==1&&n!==1&&o!==1,c={};for(const a of v){if(a in s){c[a]=!0;continue}c[a]=r}if(i.usnat)for(const a of v)c[a]=!1;return c}const fe={[m.CALIFORNIA]:de,[m.US_NATIONAL]:le};async function M(){return new Promise((e,t)=>{try{window.__gpp?window.__gpp("ping",e):t(new Error("GPP API is not available on page"))}catch(n){t(n)}})}async function ge(){const e=await M(),{parsedSections:t}=e,n=ue(e);if(!n||!t[n])throw new Error("GPP parser was called without an applicable section");const o=t[n],s=fe[n];if(!s||typeof s!="function")throw new Error(`No parser found for applicable GPP section: ${n}`);return s(o)}function me(e,{purpose:t,vendor:n,specialFeatureOptins:o}){const s=k[e],i=s.purposes.every(a=>(t==null?void 0:t.consents[a])||(t==null?void 0:t.legitimateInterests[a])),r=s.iabVendors.every(a=>(n==null?void 0:n.consents[a])||(n==null?void 0:n.legitimateInterests[a])),c=s.specialFeatures.every(a=>(o==null?void 0:o[a])===!0);return i&&r&&c}async function L(){return new Promise((e,t)=>{try{window.__tcfapi?window.__tcfapi("addEventListener",2,e):t(new Error("TCF API is not available on page"))}catch(n){t(n)}})}async function _e(){const e=await L(),t={};for(const n of v)t[n]=me(n,e);return t}async function ye(e){const n={gdpr:_e,usnat:ge}[e];if(!n)throw new Error("Unable to update user consent. Unsupported consent legislation.");return n()}function ve(){const t=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[q];if(!t)return{};const n=decodeURIComponent(t);return Object.fromEntries(n.split(",").map(o=>{const[s,i]=o.split(":");return[s,i==="on"]}))}function we(e,t){return Object.keys(e).some(o=>{const s=`${o.toLowerCase()}Onsite`;return e[o]!==t[s]})}function Ie({userId:e,useConsentStore:t}){return!!e&&t===!0}function Ce(e,t){return e?`${t.consentProxyHost}/__consent/consent-record/${H}/${t.userId}?updateFtConsentCookie=true`:`${t.consentProxyHost}/__consent/consent-record-cookie?cookieDomain=${t.cookieDomain}`}const F={gdpr:!1,usnat:!1},b=Object.assign({},F);function R(e){b[e]=!0}function Se(e){return b[e]}function be(){Object.assign(b,F)}async function he(e){return Se(e)?e==="gdpr"?(await L()).eventStatus==="useractioncomplete":e==="usnat"?(await M()).cmpDisplayStatus==="hidden":!1:!1}function Oe(){window.__tcfapi&&window.__tcfapi("addEventListener",2,e=>{e.eventStatus==="cmpuishown"&&R("gdpr")}),window.__gpp&&window.__gpp("addEventListener",({pingData:e})=>{e.cmpDisplayStatus==="visible"&&R("usnat")})}async function Ee(e,t){try{const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),credentials:"include"});n.ok||console.error("Unable to save consent preferences",n.status)}catch(n){console.error("An error occurred while saving consent",n)}}const Te=()=>{document.dispatchEvent(new CustomEvent("onCmpConsentReady",{bubbles:!0}))};function ke(e){return async function(n,o,s,i){if(Te(),e.disableFTCookies||!e.includeUsNat&&n==="usnat")return;const r=i.applies?n:"gdpr";if(r!==n||!s)return;let c;try{c=await ye(r)}catch(C){console.error(C)}if(!c||!we(c,ve()))return;const p=await he(r),f=Ie(e),u=Ce(f,e),g=pe(c,f,p,e);await Ee(u,g),p&&be(),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const h="cookie-message",Ne="manage-cookies";let O=Object.freeze({activeComponent:h,messageId:0,privacyManagerId:0});function Pe(e){return typeof e=="object"&&e!==null&&e.constructor===Object&&Object.prototype.toString.call(e)==="[object Object]"}const Ae=()=>({...O}),E=e=>{if(!Pe(e)){console.error("Invalid state changes");return}O={...O,...e}},De=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function Me(e,t){const n=Le(e.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[i,r]of Object.entries(Re))(s=(o=window._sp_).addEventListener)==null||s.call(o,i,r({...e,flags:n}))}),Ue({...e,flags:n},t)}function Le(e){const t={};return typeof e=="object"&&De.forEach(n=>{Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}),t}function Fe(e){if(!e)return;const t=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:e.detail});t.dispatchEvent(n)}function I({trackingProps:e,action:t,triggerAction:n}){let o;const s=Ae(),{product:i,app:r,flags:c}=e;s.activeComponent===h?o=s.messageId:o=s.privacyManagerId;const a={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:t,...n&&{trigger_action:n},...i&&{product:i},...r&&{app:r},custom:[{cookie_toggle_flag:c}],url:window.document.location.href||null}};Fe(a)}const Re={onMessageChoiceSelect:e=>(t,n,o)=>{const i={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];i&&I({trackingProps:e,action:"click",triggerAction:i})},onMessageReady:e=>()=>{I({trackingProps:e,action:"view"})},onMessageReceiveData:()=>(e,t)=>{const{messageId:n}=t;n&&E({messageId:n})},onError:e=>(t,n)=>{I({trackingProps:e,action:"error",triggerAction:n})},onPMCancel:()=>()=>{E({activeComponent:h})}};function Ue(e,t){window.addEventListener("message",function(n){if(n.origin!==t)return;const o={1:"save_and_close",11:"accept_all",13:"reject_all"},{data:{fromPM:s,actionType:i,messageId:r="0"}={}}=n;s&&(+r&&E({activeComponent:Ne,privacyManagerId:+r}),!(!i||!o[i])&&I({trackingProps:e,action:"click",triggerAction:o[i]}))},!1)}const Ve="5.7.0";async function xe(e){const{useFTSession:t=!0,consentProxyHost:n=W,cookieDomain:o=$,formOfWordsId:s=G,useConsentStore:i=!0,trackingContext:r={},disableFTCookies:c=!1,includeUsNat:a=!1}=e||{};let{propertyConfig:p=w,userId:f}=e||{};if(typeof window>"u"){console.error("The CMP client can only be initialised in a browser context");return}if(window.FT_CMP_CLIENT_VERSION=Ve,!f&&t)try{const u=await j();f=u==null?void 0:u.uuid}catch(u){console.error(u)}p=je(p),ce(p,{userId:f,includeUsNat:a}),Oe(),window._sp_queue.push(()=>{var u,g;(g=(u=window._sp_)==null?void 0:u.addEventListener)==null||g.call(u,"onConsentReady",ke({userId:f,consentProxyHost:n,cookieDomain:o,formOfWordsId:s,useConsentStore:i,disableFTCookies:c,includeUsNat:a}))}),Me(r,p.baseEndpoint)}function je(e){if(!(e!=null&&e.accountId))throw new Error("Please pass a valid property config");return e.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 e.events),e}function U(e,t,n,o,s,i){const{text:r,onClick:c}=o[t],a=document.querySelectorAll(`a[href*="${i}"]`);for(const p of a)(n||e)&&(s.has(p)&&p.removeEventListener("click",s.get(p)),p.innerText=r,p.addEventListener("click",c),s.set(p,c))}function He({_clientOptions:e}=w){const{privacyManagerId:t,ccpaPrivacyManagerId:n,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=e??w._clientOptions,i={usnat:{text:"Do Not Sell My Personal Information",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.usnat)==null||p.loadPrivacyManagerModal(o)}},ccpa:{text:"Do Not Sell My Personal Information",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.ccpa)==null||p.loadPrivacyManagerModal(n)}},gdpr:{text:"Manage Cookies",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.gdpr)==null||p.loadPrivacyManagerModal(t)}}},r=new Map,c=function(a,p,f,u){U(!1,a,u.applies,i,r,s),u.applies&&window._sp_queue.push(()=>{var g,C;(C=(g=window._sp_).removeEventListener)==null||C.call(g,"onConsentReady",c)})};U(!0,"gdpr",!1,i,r,s),window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var a,p;(p=(a=window._sp_).addEventListener)==null||p.call(a,"onConsentReady",c)})}function qe(e){const t=document.querySelector(e);return t?JSON.parse(t.textContent||"{}"):{}}function Ge(){return{flags:qe("script#page-kit-flags-embed")}}function $e(e){const{includeUsNat:t}=e._clientOptions||{},{flags:n}=Ge();return n!=null&&n.adsEnableGpp||t?{includeUsNat:!0}:{}}const We={"ft.com":$e};function Je(e){return new Promise((t,n)=>{const{rootDomain:o}=e._clientOptions||{};if(!o)return t({});const s=We[o];if(!s||typeof s!="function")return t({...e._clientOptions});const i=()=>{try{t(s(e))}catch(r){n(r)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i()})}function Ke(e,t){if(!t||Number.isFinite(parseFloat(t))||!e.endsWith(t))return!1;const n=e.indexOf(t),o=e[n-1];return o==="."||o===void 0}function Be(e){if(!e)throw new Error("Invalid hostname provided");let n=Object.values(oe).find(o=>{var i;if(o.propertyHref)return!1;const s=(i=o._clientOptions)==null?void 0:i.rootDomain;return s&&Ke(e,s)});return n??(n=N),n}const Xe=new URL(window.location.href).hostname,l=Be(Xe);(async()=>{var e,t;try{const n=await Je(l);xe({propertyConfig:l,...n}),(e=l==null?void 0:l._clientOptions)!=null&&e.privacyManagerId&&((t=l==null?void 0:l._clientOptions)!=null&&t.manageCookiesLinkOverride)&&He(l)}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 _={};const S=(t,e)=>{if(typeof t=="object"){_=t;return}if(typeof t=="string"&&typeof e=="string"){_[t]=e;return}if(typeof t=="string"&&typeof e>"u")return _[t]||null;if(typeof t>"u"&&typeof e>"u")return _;throw new Error("Invalid arguments")};S.clear=()=>{_={}};const y={},x=()=>{const[,t]=/FTSession_s=([^;]+)/.exec(document.cookie)||[];return t},j=()=>{const t=S("uuid");if(t)return Promise.resolve({uuid:t});const e=x();return e?(y.uuid||(y.uuid=V(`/sessions/s/${e}`).then(({uuid:n}={})=>(delete y.uuid,n&&S("uuid",n),{uuid:n}))),y.uuid):Promise.resolve({uuid:void 0})},T="sourcepoint-cmp",H="FTPINK",q="FTConsent",G="sourcepointCmp/VngD.XycZut.595cp9fWdp5XYP9vlFvk",$=".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],iabVendors:[],customVendors:[],specialFeatures:[]},personalisedMarketing:{purposes:[2,7,8,9,10],iabVendors:[],customVendors:[],specialFeatures:[]}},v=Object.keys(k),d={joinHref:!0,gdpr:{}},P={...d,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"}},w={...d,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"}},J={...d,accountId:1906,baseEndpoint:"https://consent-manager.pwmnet.com",propertyId:33414,_clientOptions:{rootDomain:"pwmnet.com"}},K={...d,accountId:1906,baseEndpoint:"https://consent-manager.fdiintelligence.com",propertyId:34061,_clientOptions:{rootDomain:"fdiintelligence.com"}},B={...d,accountId:1906,baseEndpoint:"https://consent-manager.thebanker.com",propertyId:34060,_clientOptions:{rootDomain:"thebanker.com"}},X={...d,accountId:1906,baseEndpoint:"https://consent-manager.bankingriskandregulation.com",propertyId:34059,_clientOptions:{rootDomain:"bankingriskandregulation.com"}},Y={...d,accountId:1906,baseEndpoint:"https://consent-manager.sustainableviews.com",propertyId:34058,_clientOptions:{rootDomain:"sustainableviews.com"}},z={...d,accountId:1906,baseEndpoint:"https://consent-manager.ftadviser.com",propertyId:33416,_clientOptions:{rootDomain:"ftadviser.com"}},Z={...d,accountId:1906,baseEndpoint:"https://consent-manager.investorschronicle.co.uk",propertyId:33415,_clientOptions:{rootDomain:"investorschronicle.co.uk"}},Q={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33947,_clientOptions:{rootDomain:"ignitesasia.com"}},tt={...d,accountId:1906,baseEndpoint:"https://cdn.privacy-mgmt.com",propertyId:33946,_clientOptions:{rootDomain:"igniteseurope.com"}},et={...d,accountId:1906,baseEndpoint:"https://consent-manager.mandatewire.com",propertyId:35490,_clientOptions:{rootDomain:"mandatewire.com"}},nt={...d,accountId:1906,baseEndpoint:"https://consent-manager.ftlocations.com",propertyId:37407,_clientOptions:{rootDomain:"ftlocations.com",cookieDomain:".ftlocations.com",consentProxyHost:"https://consent.ftlocations.com"}},ot=Object.freeze(Object.defineProperty({__proto__:null,FT_DOTCOM_PROD:w,FT_DOTCOM_TEST:P,MM_IGNITES_ASIA:Q,MM_IGNITES_EUROPE:tt,SP_BANKING_RR:X,SP_FDI_INTELLIGENCE:K,SP_FT_ADVISER:z,SP_FT_LOCATIONS:nt,SP_INVESTORS_CHRONICLE:Z,SP_MANDATE_WIRE:et,SP_PWMNET:J,SP_SUSTAINABLE_VIEWS:Y,SP_THE_BANKER:B},Symbol.toStringTag,{value:"Module"}));function N(t,e){const n=document.createElement("script");return n.dataset.cmpScript=t,n.innerHTML=e,n}function st(t){const e=document.createElement("script");return e.src=t,e}const it={cmpFrames:"https://consent-manager.ft.com/unified/wrapperMessagingWithoutDetection.js"},A={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:uscav1","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:uscav1","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:uscav1","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 at(t){const e=document.createDocumentFragment();return e.appendChild(N("tcf",A.tcfStub)),t.includeUsNat&&e.appendChild(N("gpp",A.gppStub)),e.appendChild(st(it.cmpFrames)),e}function rt(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=rt(o,e);window._sp_={config:s},window._sp_queue??(window._sp_queue=[]),document.head.appendChild(at(e))}function pt(t,e,n,{formOfWordsId:o,cookieDomain:s}){const r=Object.keys(t).reduce((c,a)=>(c[a]={onsite:{status:t[a],lbi:!1,source:T,fow:o}},c),{});return e?{setConsentCookie:!0,formOfWordsId:o,consentSource:T,cookieDomain:s,skipDuplicateUpdates:!n,data:r}:{data:r,cookieDomain:s}}const m={CALIFORNIA:"uscav1",US_NATIONAL:"usnat"},D={[m.CALIFORNIA]:{excludedCategories:{personalisedMarketing:!0}},[m.US_NATIONAL]:{excludedCategories:{personalisedMarketing:!0}}};function ut(t){const{applicableSections:e,supportedAPIs:n}=t,o=e[0];if(o===-1||typeof o>"u")return;const s=n.find(r=>r.startsWith(`${o}:`));return s==null?void 0:s.split(":")[1]}function dt(t){const{SaleOptOut:e,SharingOptOut:n,Gpc:o}=t,{excludedCategories:s}=D[m.CALIFORNIA],i=e!==1&&n!==1&&!o,r={};for(const c of v){if(c in s){r[c]=!0;continue}r[c]=i}return r}function lt(t){const{SaleOptOut:e,SharingOptOut:n,TargetedAdvertisingOptOut:o}=t,{excludedCategories:s}=D[m.US_NATIONAL],i=JSON.parse(localStorage.getItem("ft_sp_marketing_optout")||"{}"),r=e!==1&&n!==1&&o!==1,c={};for(const a of v){if(a in s){c[a]=!0;continue}c[a]=r}if(i.usnat)for(const a of v)c[a]=!1;return c}const ft={[m.CALIFORNIA]:dt,[m.US_NATIONAL]:lt};async function M(){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 gt(){const t=await M(),{parsedSections:e}=t,n=ut(t);if(!n||!e[n])throw new Error("GPP parser was called without an applicable section");const o=e[n],s=ft[n];if(!s||typeof s!="function")throw new Error(`No parser found for applicable GPP section: ${n}`);return s(o)}function mt(t,{purpose:e,vendor:n,specialFeatureOptins:o}){const s=k[t],i=s.purposes.every(a=>(e==null?void 0:e.consents[a])||(e==null?void 0:e.legitimateInterests[a])),r=s.iabVendors.every(a=>(n==null?void 0:n.consents[a])||(n==null?void 0:n.legitimateInterests[a])),c=s.specialFeatures.every(a=>(o==null?void 0:o[a])===!0);return i&&r&&c}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 _t(){const t=await L(),e={};for(const n of v)e[n]=mt(n,t);return e}async function yt(t){const n={gdpr:_t,usnat:gt}[t];if(!n)throw new Error("Unable to update user consent. Unsupported consent legislation.");return n()}function vt(){const e=Object.fromEntries(document.cookie.split("; ").map(o=>o.split("=")))[q];if(!e)return{};const n=decodeURIComponent(e);return Object.fromEntries(n.split(",").map(o=>{const[s,i]=o.split(":");return[s,i==="on"]}))}function wt(t,e){return Object.keys(t).some(o=>{const s=`${o.toLowerCase()}Onsite`;return t[o]!==e[s]})}function It({userId:t,useConsentStore:e}){return!!t&&e===!0}function Ct(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},b=Object.assign({},F);function R(t){b[t]=!0}function St(t){return b[t]}function bt(){Object.assign(b,F)}async function ht(t){return St(t)?t==="gdpr"?(await L()).eventStatus==="useractioncomplete":t==="usnat"?(await M()).cmpDisplayStatus==="hidden":!1:!1}function Ot(){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 Et(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)}}const Tt=()=>{document.dispatchEvent(new CustomEvent("onCmpConsentReady",{bubbles:!0}))};function kt(t){return async function(n,o,s,i){if(Tt(),t.disableFTCookies||!t.includeUsNat&&n==="usnat")return;const r=i.applies?n:"gdpr";if(r!==n||!s)return;let c;try{c=await yt(r)}catch(C){console.error(C)}if(!c||!wt(c,vt()))return;const p=await ht(r),f=It(t),u=Ct(f,t),g=pt(c,f,p,t);await Et(u,g),p&&bt(),document.dispatchEvent(new CustomEvent("oCookieMessage.act",{bubbles:!0}))}}const h="cookie-message",Pt="manage-cookies";let O=Object.freeze({activeComponent:h,messageId:0,privacyManagerId:0});function Nt(t){return typeof t=="object"&&t!==null&&t.constructor===Object&&Object.prototype.toString.call(t)==="[object Object]"}const At=()=>({...O}),E=t=>{if(!Nt(t)){console.error("Invalid state changes");return}O={...O,...t}},Dt=["adsDisableInternalCMP","pwm.cmp","messageSlotBottom"];function Mt(t,e){const n=Lt(t.flags);window._sp_queue=window._sp_queue??[],window._sp_queue.push(()=>{var o,s;for(const[i,r]of Object.entries(Rt))(s=(o=window._sp_).addEventListener)==null||s.call(o,i,r({...t,flags:n}))}),Ut({...t,flags:n},e)}function Lt(t){const e={};return typeof t=="object"&&Dt.forEach(n=>{Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}),e}function Ft(t){if(!t)return;const e=document.body,n=new CustomEvent("oTracking.event",{bubbles:!0,cancelable:!0,detail:t.detail});e.dispatchEvent(n)}function I({trackingProps:t,action:e,triggerAction:n}){let o;const s=At(),{product:i,app:r,flags:c}=t;s.activeComponent===h?o=s.messageId:o=s.privacyManagerId;const a={detail:{component:{id:o,name:s.activeComponent,type:"overlay",subtype:"cmp"},category:"component",action:e,...n&&{trigger_action:n},...i&&{product:i},...r&&{app:r},custom:[{cookie_toggle_flag:c}],url:window.document.location.href||null}};Ft(a)}const Rt={onMessageChoiceSelect:t=>(e,n,o)=>{const i={11:"accept_all",12:"manage_cookies",13:"reject_all"}[o];i&&I({trackingProps:t,action:"click",triggerAction:i})},onMessageReady:t=>()=>{I({trackingProps:t,action:"view"})},onMessageReceiveData:()=>(t,e)=>{const{messageId:n}=e;n&&E({messageId:n})},onError:t=>(e,n)=>{I({trackingProps:t,action:"error",triggerAction:n})},onPMCancel:()=>()=>{E({activeComponent:h})}};function Ut(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:i,messageId:r="0"}={}}=n;s&&(+r&&E({activeComponent:Pt,privacyManagerId:+r}),!(!i||!o[i])&&I({trackingProps:t,action:"click",triggerAction:o[i]}))},!1)}const Vt="5.7.2";async function xt(t){const{useFTSession:e=!0,consentProxyHost:n=W,cookieDomain:o=$,formOfWordsId:s=G,useConsentStore:i=!0,trackingContext:r={},disableFTCookies:c=!1,includeUsNat:a=!1}=t||{};let{propertyConfig:p=w,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=Vt,!f&&e)try{const u=await j();f=u==null?void 0:u.uuid}catch(u){console.error(u)}p=jt(p),ct(p,{userId:f,includeUsNat:a}),Ot(),window._sp_queue.push(()=>{var u,g;(g=(u=window._sp_)==null?void 0:u.addEventListener)==null||g.call(u,"onConsentReady",kt({userId:f,consentProxyHost:n,cookieDomain:o,formOfWordsId:s,useConsentStore:i,disableFTCookies:c,includeUsNat:a}))}),Mt(r,p.baseEndpoint)}function jt(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,i){const{text:r,onClick:c}=o[e],a=document.querySelectorAll(`a[href*="${i}"]`);for(const p of a)(n||t)&&(s.has(p)&&p.removeEventListener("click",s.get(p)),p.innerText=r,p.addEventListener("click",c),s.set(p,c))}function Ht({_clientOptions:t}=w){const{privacyManagerId:e,ccpaPrivacyManagerId:n,usnatPrivacyManagerId:o,manageCookiesLinkOverride:s}=t??w._clientOptions,i={usnat:{text:"Do Not Sell My Personal Information",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.usnat)==null||p.loadPrivacyManagerModal(o)}},ccpa:{text:"Do Not Sell My Personal Information",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.ccpa)==null||p.loadPrivacyManagerModal(n)}},gdpr:{text:"Manage Cookies",onClick:a=>{var p;a.preventDefault(),(p=window._sp_.gdpr)==null||p.loadPrivacyManagerModal(e)}}},r=new Map,c=function(a,p,f,u){U(!1,a,u.applies,i,r,s),u.applies&&window._sp_queue.push(()=>{var g,C;(C=(g=window._sp_).removeEventListener)==null||C.call(g,"onConsentReady",c)})};U(!0,"gdpr",!1,i,r,s),window._sp_queue??(window._sp_queue=[]),window._sp_queue.push(()=>{var a,p;(p=(a=window._sp_).addEventListener)==null||p.call(a,"onConsentReady",c)})}function qt(t){const e=document.querySelector(t);return e?JSON.parse(e.textContent||"{}"):{}}function Gt(){return{flags:qt("script#page-kit-flags-embed")}}function $t(t){const{includeUsNat:e}=t._clientOptions||{},{flags:n}=Gt();return n!=null&&n.adsEnableGpp||e?{includeUsNat:!0}:{}}const Wt={"ft.com":$t};function Jt(t){return new Promise((e,n)=>{const{rootDomain:o}=t._clientOptions||{};if(!o)return e({});const s=Wt[o];if(!s||typeof s!="function")return e({...t._clientOptions});const i=()=>{try{e(s(t))}catch(r){n(r)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",i):i()})}function Kt(t,e){if(!e||Number.isFinite(parseFloat(e))||!t.endsWith(e))return!1;const n=t.indexOf(e),o=t[n-1];return o==="."||o===void 0}function Bt(t){if(!t)throw new Error("Invalid hostname provided");let n=Object.values(ot).find(o=>{var i;if(o.propertyHref)return!1;const s=(i=o._clientOptions)==null?void 0:i.rootDomain;return s&&Kt(t,s)});return n??(n=P),n}const Xt=new URL(window.location.href).hostname,l=Bt(Xt);(async()=>{var t,e;try{const n=await Jt(l);xt({propertyConfig:l,...n}),(t=l==null?void 0:l._clientOptions)!=null&&t.privacyManagerId&&((e=l==null?void 0:l._clientOptions)!=null&&e.manageCookiesLinkOverride)&&Ht(l)}catch(n){console.error("Error: CMP package configure + initialise Sourcepoint failed.",n)}})()})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAY1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAQrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;CAQhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;CAQ7B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../../../src/lib/properties.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;CAU1B,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;CAY1B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;CAQrB,CAAC;AAEF,eAAO,MAAM,mBAAmB;;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;CAQhC,CAAC;AAEF,eAAO,MAAM,aAAa;;;;;;;;;CAQzB,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;CAQlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;CAQ7B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;CAQ3B,CAAC;AAEF,eAAO,MAAM,eAAe;;;;;;;;;;;CAU3B,CAAC"}
|
package/dist/src/utils/url.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../../src/utils/url.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAWtE;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiB3D"}
|
package/package.json
CHANGED