@drip-apex/sdk 0.2.0 → 0.3.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/drip.mjs CHANGED
@@ -1178,6 +1178,7 @@ function readConsentCookie(name) {
1178
1178
  function readConfiguredConsent(provider, requiredGroup, getter) {
1179
1179
  const root = globalThis;
1180
1180
  if (provider === "cookiescript") return readCookieScriptConsent(requiredGroup);
1181
+ if (provider === "borlabs") return readBorlabsConsent(requiredGroup);
1181
1182
  if (provider === "usercentrics") {
1182
1183
  const uc = root.UC_UI ?? root.window?.UC_UI;
1183
1184
  if (typeof uc?.getServicesBaseInfo !== "function") return null;
@@ -1230,6 +1231,26 @@ function readConfiguredConsent(provider, requiredGroup, getter) {
1230
1231
  }
1231
1232
  return null;
1232
1233
  }
1234
+ function readBorlabsConsent(requiredGroup) {
1235
+ const root = globalThis;
1236
+ const borlabs = root.BorlabsCookie ?? root.window?.BorlabsCookie;
1237
+ if (!borlabs) return null;
1238
+ const required = requiredGroup?.trim() || "statistics";
1239
+ const consents = borlabs.Consents;
1240
+ try {
1241
+ if (typeof consents?.hasConsent === "function" && consents.hasConsent(required)) return true;
1242
+ } catch {
1243
+ }
1244
+ try {
1245
+ if (typeof consents?.hasConsentForServiceGroup === "function") return Boolean(consents.hasConsentForServiceGroup(required));
1246
+ } catch {
1247
+ }
1248
+ try {
1249
+ if (typeof borlabs.checkCookieConsent === "function") return Boolean(borlabs.checkCookieConsent(required));
1250
+ } catch {
1251
+ }
1252
+ return null;
1253
+ }
1233
1254
  function readCookieScriptConsent(requiredGroup) {
1234
1255
  const root = globalThis;
1235
1256
  const requested = (requiredGroup?.trim() || "analytics").toLowerCase();
@@ -18187,7 +18208,7 @@ function shouldPollConfiguredConsent5(config) {
18187
18208
  const consent = config.consentMode;
18188
18209
  if (!consent?.enabled || state.consentGranted) return false;
18189
18210
  if (consent.provider && EVENT_DRIVEN_CONSENT_PROVIDERS5.has(consent.provider)) return false;
18190
- return consent.provider === "custom" || consent.provider === "pandectes" || consent.provider === "cookiescript" || typeof consent.getter === "string";
18211
+ return consent.provider === "custom" || consent.provider === "pandectes" || consent.provider === "cookiescript" || consent.provider === "borlabs" || typeof consent.getter === "string";
18191
18212
  }
18192
18213
  function installConsentChangeListeners2(config) {
18193
18214
  if (!config.consentMode?.enabled || typeof window === "undefined") return null;