Socket
Socket
Sign inDemoInstall

@adv-ui/vendor-by-consents-loader

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.4.0

tsconfig.json

3

lib/client.js
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["name"];
import { dispatchVendorLoadedEvent } from './events';

@@ -56,3 +57,3 @@ import { checkConsentsAreAccepted, createSubscriptionOnConsentsChange } from './tcf';

var vendorName = vendor.name,
vendorConfig = _objectWithoutPropertiesLoose(vendor, ["name"]);
vendorConfig = _objectWithoutPropertiesLoose(vendor, _excluded);

@@ -59,0 +60,0 @@ var vendors = [{

{
"name": "@adv-ui/vendor-by-consents-loader",
"version": "1.3.0",
"version": "1.4.0",
"description": "Load vendors according to the allowed user's consents",

@@ -11,2 +11,3 @@ "main": "lib/index.js",

"prepare": "npm run lib && npm run umd",
"phoenix": "rm -rf node_modules package-lock.json && npm install --legacy-peer-deps",
"umd": "sui-bundler lib src-umd/index.js -o umd/ -p --root",

@@ -24,6 +25,6 @@ "test": "echo \"Error: no test specified\""

"@babel/cli": "7",
"@s-ui/bundler": "6",
"@s-ui/bundler": "7",
"@s-ui/lint": "3",
"@s-ui/mono": "1",
"@s-ui/test": "4",
"@s-ui/mono": "2",
"@s-ui/test": "6",
"babel-preset-sui": "3"

@@ -30,0 +31,0 @@ },

@@ -1,1 +0,1 @@

!function(n){var e={};function o(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=n,o.c=e,o.d=function(n,e,t){o.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:t})},o.r=function(n){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"===typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(e,"a",e),e},o.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},o.p="true",o(o.s="phIc")}({phIc:function(n,e,o){"use strict";o.r(e);var t=function(n){return n?new Promise((function(e){var o=document.createElement("script");o.src=n,o.defer=!0,document.head.appendChild(o),o.addEventListener("load",e)})):Promise.resolve()},r=function(){return"undefined"!==typeof window},i={VENDOR_LOADED:"__mpi_vendor_loaded"};function u(n){var e=n.vendor;!function(n){var e,o=n.eventName,t=n.detail,r=void 0===t?{}:t;window.CustomEvent&&"function"===typeof window.CustomEvent?e=new window.CustomEvent(o,{detail:r}):(e=document.createEvent("CustomEvent")).initCustomEvent(o,!0,!0,r),window.document.dispatchEvent(e)}({eventName:i.VENDOR_LOADED,detail:{vendor:e}})}var d="loading",s={LOADED:"tcloaded",USER_ACTION_COMPLETE:"useractioncomplete",UI_SHOWN:"cmpuishown"},c=[s.USER_ACTION_COMPLETE,s.LOADED],a=function(){var n=r()&&!!window.__tcfapi;return!n&&console.warn("window.__tcfapi is not available"),n},v=function(n){var e=n.userConsents;return n.neededConsentsIds.every((function(n){return!0===e[n]}))},f=function(n){var e=void 0===n?{}:n,o=e.allowInconclusiveConsents,t=void 0!==o&&o,r=e.once,i=void 0!==r&&r;return function(n){var e;e=function(e,o){if(d!==e.cmpStatus){var r=e.eventStatus,u=e.listenerId,v=e.purpose.consents,f=t?Object.values(s):c;o&&f.includes(r)&&(n({purposeConsents:v}),i&&function(n){a()&&window.__tcfapi("removeEventListener",2,!1,n)}(u))}},a()&&window.__tcfapi("addEventListener",2,e)}},l=function(n){r()&&f()((function(e){var o=e.purposeConsents;n.map((function(n){var e=n.vendorConfig,t=n.vendorName;return function(n){var e=n.purposeConsents,o=n.vendorConfig,t=n.vendorName,r=o.consents.purposes;return v({userConsents:e,neededConsentsIds:void 0===r?[]:r})?[t,o]:[]}({purposeConsents:o,vendorConfig:e,vendorName:t})})).filter((function(n){return n.length})).forEach((function(n){var e=n[0],o=n[1].script;t(o).then((function(){return u({vendor:e})}))}))}))};function p(){return(p=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}return n}).apply(this,arguments)}var m={c1:"2",cs_ucfr:"1"},w=[1,7,9,10],C=window;C.sui=C.sui||{},C.sui.vendors=C.sui.vendors||{addVendorLoadedEventListener:function(n,e){var o=(void 0===e?{}:e).once,t=void 0!==o&&o;if(r)return window.document.addEventListener(i.VENDOR_LOADED,u),d;function u(e){n(e.detail),t&&d()}function d(){window.document.removeEventListener(i.VENDOR_LOADED,u)}console.warn("Tried to call addVendorLoadedEventListener but you are not on the client")},initVendorConsentsLoader:function(n){var e,o,t=(void 0===n?{}:n).vendors;if(r()){if(t=t||(null==(e=window.__mpi)||null==(o=e.vendorByConsentsLoader)?void 0:o.vendors)){var i=Object.entries(t).map((function(n){var e=n[0];return{vendorConfig:n[1],vendorName:e}}));return l(i)}console.error("vendorByConsentsLoader not provided. Pass it by parameter or use window.__mpi config with vendorByConsentsLoader property.")}},loadSingleVendorByConsent:function(n){var e=n.name,o=function(n,e){if(null==n)return{};var o,t,r={},i=Object.keys(n);for(t=0;t<i.length;t++)o=i[t],e.indexOf(o)>=0||(r[o]=n[o]);return r}(n,["name"]);return l([{vendorConfig:o,vendorName:e}])},loadComscore:function(n){var e=n.comscoreClientId;r?f({once:!0})((function(n){var o=n.purposeConsents;if(v({userConsents:o,neededConsentsIds:w}))return window._comscore=[p({},m,{c2:e})],t("https://sb.scorecardresearch.com/beacon.js").then((function(){return u({vendor:"comscore"}),!0}))})):console.warn("[vendor-by-consents-loader]: You can't loadComscore from the server")}}}});
!function(n){var e={};function o(t){if(e[t])return e[t].exports;var r=e[t]={i:t,l:!1,exports:{}};return n[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=n,o.c=e,o.d=function(n,e,t){o.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:t})},o.r=function(n){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},o.t=function(n,e){if(1&e&&(n=o(n)),8&e)return n;if(4&e&&"object"===typeof n&&n&&n.__esModule)return n;var t=Object.create(null);if(o.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var r in n)o.d(t,r,function(e){return n[e]}.bind(null,r));return t},o.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return o.d(e,"a",e),e},o.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},o.p="true",o(o.s=0)}([function(n,e,o){"use strict";o.r(e);var t=function(n){return n?new Promise((function(e){var o=document.createElement("script");o.src=n,o.defer=!0,document.head.appendChild(o),o.addEventListener("load",e)})):Promise.resolve()},r=function(){return"undefined"!==typeof window},i={VENDOR_LOADED:"__mpi_vendor_loaded"};function u(n){var e=n.vendor;!function(n){var e,o=n.eventName,t=n.detail,r=void 0===t?{}:t;window.CustomEvent&&"function"===typeof window.CustomEvent?e=new window.CustomEvent(o,{detail:r}):(e=document.createEvent("CustomEvent")).initCustomEvent(o,!0,!0,r),window.document.dispatchEvent(e)}({eventName:i.VENDOR_LOADED,detail:{vendor:e}})}var d="loading",s={LOADED:"tcloaded",USER_ACTION_COMPLETE:"useractioncomplete",UI_SHOWN:"cmpuishown"},c=[s.USER_ACTION_COMPLETE,s.LOADED],a=function(){var n=r()&&!!window.__tcfapi;return!n&&console.warn("window.__tcfapi is not available"),n},v=function(n){var e=n.userConsents;return n.neededConsentsIds.every((function(n){return!0===e[n]}))},f=function(n){var e=void 0===n?{}:n,o=e.allowInconclusiveConsents,t=void 0!==o&&o,r=e.once,i=void 0!==r&&r;return function(n){var e;e=function(e,o){if(d!==e.cmpStatus){var r=e.eventStatus,u=e.listenerId,v=e.purpose.consents,f=t?Object.values(s):c;o&&f.includes(r)&&(n({purposeConsents:v}),i&&function(n){a()&&window.__tcfapi("removeEventListener",2,!1,n)}(u))}},a()&&window.__tcfapi("addEventListener",2,e)}},l=["name"],p=function(n){r()&&f()((function(e){var o=e.purposeConsents;n.map((function(n){var e=n.vendorConfig,t=n.vendorName;return function(n){var e=n.purposeConsents,o=n.vendorConfig,t=n.vendorName,r=o.consents.purposes;return v({userConsents:e,neededConsentsIds:void 0===r?[]:r})?[t,o]:[]}({purposeConsents:o,vendorConfig:e,vendorName:t})})).filter((function(n){return n.length})).forEach((function(n){var e=n[0],o=n[1].script;t(o).then((function(){return u({vendor:e})}))}))}))};function m(){return m=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])}return n},m.apply(this,arguments)}var w={c1:"2",cs_ucfr:"1"},C=[1,7,9,10],_=window;_.sui=_.sui||{},_.sui.vendors=_.sui.vendors||{addVendorLoadedEventListener:function(n,e){var o=(void 0===e?{}:e).once,t=void 0!==o&&o;if(r)return window.document.addEventListener(i.VENDOR_LOADED,u),d;function u(e){n(e.detail),t&&d()}function d(){window.document.removeEventListener(i.VENDOR_LOADED,u)}console.warn("Tried to call addVendorLoadedEventListener but you are not on the client")},initVendorConsentsLoader:function(n){var e,o,t=(void 0===n?{}:n).vendors;if(r()){if(t=t||(null==(e=window.__mpi)||null==(o=e.vendorByConsentsLoader)?void 0:o.vendors)){var i=Object.entries(t).map((function(n){var e=n[0];return{vendorConfig:n[1],vendorName:e}}));return p(i)}console.error("vendorByConsentsLoader not provided. Pass it by parameter or use window.__mpi config with vendorByConsentsLoader property.")}},loadSingleVendorByConsent:function(n){var e=n.name,o=function(n,e){if(null==n)return{};var o,t,r={},i=Object.keys(n);for(t=0;t<i.length;t++)o=i[t],e.indexOf(o)>=0||(r[o]=n[o]);return r}(n,l);return p([{vendorConfig:o,vendorName:e}])},loadComscore:function(n){var e=n.comscoreClientId;r?f({once:!0})((function(n){var o=n.purposeConsents;if(v({userConsents:o,neededConsentsIds:C}))return window._comscore=[m({},w,{c2:e})],t("https://sb.scorecardresearch.com/beacon.js").then((function(){return u({vendor:"comscore"}),!0}))})):console.warn("[vendor-by-consents-loader]: You can't loadComscore from the server")}}}]);
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc