{"version":3,"file":"rpi.min.js","sources":["../src/config.js","../src/util/util.js","../node_modules/js-base64/base64.mjs","../src/SnowPlow/sp.js","../src/ui/defaultPaywall.js","../node_modules/universal-cookie/esm/index.mjs","../src/callbacks/validation.js","../src/callbacks/preservedParameterTracker.js","../src/callbacks/registration.js","../src/callbacks/piano.js","../src/callbacks/debug.js","../src/main.ts"],"sourcesContent":["export const config = {\n  portals: {\n    /* -- LIVE --- */\n    /* --- RN --- */\n    rn_live_nextgen: {\n      tp: { aid: 'qXvae8iVH6', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1139738195517256196' },\n      sp: {\n        appId: 'piano.rn.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-ruhrnachrichten',\n        endpoint: 'https://bdp.ruhrnachrichten.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: '2193834034220868' },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    /* --- C4 --- */\n    ha_live_nextgen: {\n      tp: { aid: 'ewNLizq3Rw', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1138612295681337565' },\n      sp: {\n        appId: 'piano.ha.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-hellwegeranzeiger',\n        endpoint: 'https://bdp.hellwegeranzeiger.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: '2861616800599939' },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    dz_live_nextgen: {\n      tp: { aid: 'cwtfIKSaKo', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1140864095101463815' },\n      sp: {\n        appId: 'piano.dz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-dorstenerzeitung',\n        endpoint: 'https://bdp.dorstenerzeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: '905845342873036' },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    hz_live_nextgen: {\n      tp: { aid: 'iee9dG5obP', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1137486393182558946' },\n      sp: {\n        appId: 'piano.hz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-halternerzeitung',\n        endpoint: 'https://bdp.halternerzeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: '297912450841780' },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    mlz_live_nextgen: {\n      tp: { aid: '4qyHvkPzKT', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1138612295681337567' },\n      sp: {\n        appId: 'piano.mlz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-muensterlandzeitung',\n        endpoint: 'https://bdp.muensterlandzeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: '1609732622460575' },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    /* --- MHB --- */\n    dm_live_nextgen: {\n      tp: { aid: 'pdw1TGv7pu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1152147302117119051' },\n      sp: {\n        appId: 'piano.dm.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-DattelnerMorgenpost',\n        endpoint: 'https://bdp.dattelner-morgenpost.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    hea_live_nextgen: {\n      tp: { aid: '2cvnUC6fpu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '4756152983676041470' },\n      sp: {\n        appId: 'piano.hea.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-HertenerAllgemeine',\n        endpoint: 'https://bdp.hertener-allgemeine.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    mz_live_nextgen: {\n      tp: { aid: 'claBVs9ipu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1151021425513094429' },\n      sp: {\n        appId: 'piano.mz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-MarlerZeitung',\n        endpoint: 'https://bdp.marler-zeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    rz_live_nextgen: {\n      tp: { aid: 'vvCzkFhCpu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1151021425513094428' },\n      sp: {\n        appId: 'piano.rz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RecklinghaeuserZeitung',\n        endpoint: 'https://bdp.recklinghaeuser-zeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    sz_live_nextgen: {\n      tp: { aid: 'rTXtq0xFpu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '1152147302117119050' },\n      sp: {\n        appId: 'piano.sz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-StimbergZeitung',\n        endpoint: 'https://bdp.stimberg-zeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    wz_live_nextgen: {\n      tp: { aid: 'AgMqOzIQpu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '4756152983676041469' },\n      sp: {\n        appId: 'piano.wz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-WaltroperZeitung',\n        endpoint: 'https://bdp.waltroper-zeitung.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    /* -- BBV --- */\n    bbv_live_nextgen: {\n      tp: { aid: 'o077dF4Wpu', baseUrl: 'buy.tinypass.com' },\n      cxense: { siteId: '5856224928417697117' },\n      sp: {\n        appId: 'piano.bbv.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-BBV',\n        endpoint: 'https://bdp.bbv-net.de/com.snowplowanalytics.snowplow/tp2',\n      },\n      endpoints: {\n        registerUser: 'https://ump-v2.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    /* -- UAT --- */\n    uat_apollo_rn_test: {\n      tp: { aid: 'p2lTX0NVsu', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rn.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RuhrNachrichten-apollo-test',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-test.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    uat_rn_test: {\n      tp: { aid: 'fHFAlM1Qsu', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rn.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RuhrNachrichten-test',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-test.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    uat_rz_test: {\n      tp: { aid: 'spd9gowzsu', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RecklinghaeuserZeitung-test',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-test.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    uat_bbv_test: {\n      tp: { aid: 'DV3C3eUMsu', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rz.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-BBV-test',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-test.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-test.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    /* -- DEV --- */\n    dev_apollo_rn_dev: {\n      tp: { aid: 'Ma5o7ta2su', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rn.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RuhrNachrichten-apollo-dev',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-dev.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-dev.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-dev.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n    dev_rn_dev: {\n      tp: { aid: 'rzfSvNznsu', baseUrl: 'sandbox.tinypass.com' },\n      cxense: { siteId: '' },\n      sp: {\n        appId: 'piano.rn.de',\n      },\n      spV3: {\n        appId: 'rumble-bdp-RuhrNachrichten-dev',\n        endpoint: 'https://bdp-staging.rumble.cool/com.snowplowanalytics.snowplow/tp2',\n      },\n      fb: { pixelId: undefined },\n      endpoints: {\n        registerUser: 'https://ump-v2-dev.azurewebsites.net/ump/v2/user',\n        trackingRegistration: 'https://ump-v2-dev.azurewebsites.net/ump/v1/apsf/event/registration',\n        trackingConversion: 'https://ump-v2-dev.azurewebsites.net/ump/v1/apsf/event/conversion',\n      },\n    },\n  },\n};\n","//remove Elements/Nodes from DOM\nexport const removeElement = (element) => {\n  if (element && element.parentNode) {\n    element.remove();\n  }\n};\n\n// check if dom is ready (like jquery.ready()\nexport const domIsReady = (callback) => {\n  let isBrowserIeOrNot = () => {\n    return !document.attachEvent || document.attachEvent === undefined ? 'not-ie' : 'ie';\n  };\n\n  const domIsReady = (callback) => {\n    if (callback && typeof callback === 'function') {\n      if (isBrowserIeOrNot() === 'ie') {\n        document.attachEvent('onreadystatechange', function () {\n          if (document.readyState === 'complete') {\n            return callback();\n          }\n        });\n      } else {\n        document.addEventListener('DOMContentLoaded', function () {\n          return callback();\n        });\n      }\n    } else {\n      console.error('The callback is not a function!');\n    }\n  };\n\n  return domIsReady(callback);\n};\n\n// get cookies by name; used for SP-tracking\nexport const getCookie = (cname) => {\n  let name = cname + '=';\n  let decodedCookie = decodeURIComponent(document.cookie);\n  let ca = decodedCookie.split(';');\n  for (let c of ca) {\n    while (c.charAt(0) === ' ') {\n      c = c.slice(1);\n    }\n    if (c.indexOf(name) === 0) {\n      return c.slice(name.length);\n    }\n  }\n  return '';\n};\n\nexport const uuidv4 = () => {\n  return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replaceAll(/[018]/g, (c) =>\n    (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n  );\n};\n","/**\n *  base64.ts\n *\n *  Licensed under the BSD 3-Clause License.\n *    http://opensource.org/licenses/BSD-3-Clause\n *\n *  References:\n *    http://en.wikipedia.org/wiki/Base64\n *\n * @author Dan Kogai (https://github.com/dankogai)\n */\nconst version = '3.7.7';\n/**\n * @deprecated use lowercase `version`.\n */\nconst VERSION = version;\nconst _hasBuffer = typeof Buffer === 'function';\nconst _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;\nconst _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;\nconst b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\nconst b64chs = Array.prototype.slice.call(b64ch);\nconst b64tab = ((a) => {\n    let tab = {};\n    a.forEach((c, i) => tab[c] = i);\n    return tab;\n})(b64chs);\nconst b64re = /^(?:[A-Za-z\\d+\\/]{4})*?(?:[A-Za-z\\d+\\/]{2}(?:==)?|[A-Za-z\\d+\\/]{3}=?)?$/;\nconst _fromCC = String.fromCharCode.bind(String);\nconst _U8Afrom = typeof Uint8Array.from === 'function'\n    ? Uint8Array.from.bind(Uint8Array)\n    : (it) => new Uint8Array(Array.prototype.slice.call(it, 0));\nconst _mkUriSafe = (src) => src\n    .replace(/=/g, '').replace(/[+\\/]/g, (m0) => m0 == '+' ? '-' : '_');\nconst _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n/**\n * polyfill version of `btoa`\n */\nconst btoaPolyfill = (bin) => {\n    // console.log('polyfilled');\n    let u32, c0, c1, c2, asc = '';\n    const pad = bin.length % 3;\n    for (let i = 0; i < bin.length;) {\n        if ((c0 = bin.charCodeAt(i++)) > 255 ||\n            (c1 = bin.charCodeAt(i++)) > 255 ||\n            (c2 = bin.charCodeAt(i++)) > 255)\n            throw new TypeError('invalid character found');\n        u32 = (c0 << 16) | (c1 << 8) | c2;\n        asc += b64chs[u32 >> 18 & 63]\n            + b64chs[u32 >> 12 & 63]\n            + b64chs[u32 >> 6 & 63]\n            + b64chs[u32 & 63];\n    }\n    return pad ? asc.slice(0, pad - 3) + \"===\".substring(pad) : asc;\n};\n/**\n * does what `window.btoa` of web browsers do.\n * @param {String} bin binary string\n * @returns {string} Base64-encoded string\n */\nconst _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)\n    : _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')\n        : btoaPolyfill;\nconst _fromUint8Array = _hasBuffer\n    ? (u8a) => Buffer.from(u8a).toString('base64')\n    : (u8a) => {\n        // cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326\n        const maxargs = 0x1000;\n        let strs = [];\n        for (let i = 0, l = u8a.length; i < l; i += maxargs) {\n            strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));\n        }\n        return _btoa(strs.join(''));\n    };\n/**\n * converts a Uint8Array to a Base64 string.\n * @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5\n * @returns {string} Base64 string\n */\nconst fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const utob = (src: string) => unescape(encodeURIComponent(src));\n// reverting good old fationed regexp\nconst cb_utob = (c) => {\n    if (c.length < 2) {\n        var cc = c.charCodeAt(0);\n        return cc < 0x80 ? c\n            : cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))\n                + _fromCC(0x80 | (cc & 0x3f)))\n                : (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))\n                    + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n                    + _fromCC(0x80 | (cc & 0x3f)));\n    }\n    else {\n        var cc = 0x10000\n            + (c.charCodeAt(0) - 0xD800) * 0x400\n            + (c.charCodeAt(1) - 0xDC00);\n        return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))\n            + _fromCC(0x80 | ((cc >>> 12) & 0x3f))\n            + _fromCC(0x80 | ((cc >>> 6) & 0x3f))\n            + _fromCC(0x80 | (cc & 0x3f)));\n    }\n};\nconst re_utob = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFFF]|[^\\x00-\\x7F]/g;\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-8 string\n * @returns {string} UTF-16 string\n */\nconst utob = (u) => u.replace(re_utob, cb_utob);\n//\nconst _encode = _hasBuffer\n    ? (s) => Buffer.from(s, 'utf8').toString('base64')\n    : _TE\n        ? (s) => _fromUint8Array(_TE.encode(s))\n        : (s) => _btoa(utob(s));\n/**\n * converts a UTF-8-encoded string to a Base64 string.\n * @param {boolean} [urlsafe] if `true` make the result URL-safe\n * @returns {string} Base64 string\n */\nconst encode = (src, urlsafe = false) => urlsafe\n    ? _mkUriSafe(_encode(src))\n    : _encode(src);\n/**\n * converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.\n * @returns {string} Base64 string\n */\nconst encodeURI = (src) => encode(src, true);\n// This trick is found broken https://github.com/dankogai/js-base64/issues/130\n// const btou = (src: string) => decodeURIComponent(escape(src));\n// reverting good old fationed regexp\nconst re_btou = /[\\xC0-\\xDF][\\x80-\\xBF]|[\\xE0-\\xEF][\\x80-\\xBF]{2}|[\\xF0-\\xF7][\\x80-\\xBF]{3}/g;\nconst cb_btou = (cccc) => {\n    switch (cccc.length) {\n        case 4:\n            var cp = ((0x07 & cccc.charCodeAt(0)) << 18)\n                | ((0x3f & cccc.charCodeAt(1)) << 12)\n                | ((0x3f & cccc.charCodeAt(2)) << 6)\n                | (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;\n            return (_fromCC((offset >>> 10) + 0xD800)\n                + _fromCC((offset & 0x3FF) + 0xDC00));\n        case 3:\n            return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)\n                | ((0x3f & cccc.charCodeAt(1)) << 6)\n                | (0x3f & cccc.charCodeAt(2)));\n        default:\n            return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)\n                | (0x3f & cccc.charCodeAt(1)));\n    }\n};\n/**\n * @deprecated should have been internal use only.\n * @param {string} src UTF-16 string\n * @returns {string} UTF-8 string\n */\nconst btou = (b) => b.replace(re_btou, cb_btou);\n/**\n * polyfill version of `atob`\n */\nconst atobPolyfill = (asc) => {\n    // console.log('polyfilled');\n    asc = asc.replace(/\\s+/g, '');\n    if (!b64re.test(asc))\n        throw new TypeError('malformed base64.');\n    asc += '=='.slice(2 - (asc.length & 3));\n    let u24, bin = '', r1, r2;\n    for (let i = 0; i < asc.length;) {\n        u24 = b64tab[asc.charAt(i++)] << 18\n            | b64tab[asc.charAt(i++)] << 12\n            | (r1 = b64tab[asc.charAt(i++)]) << 6\n            | (r2 = b64tab[asc.charAt(i++)]);\n        bin += r1 === 64 ? _fromCC(u24 >> 16 & 255)\n            : r2 === 64 ? _fromCC(u24 >> 16 & 255, u24 >> 8 & 255)\n                : _fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255);\n    }\n    return bin;\n};\n/**\n * does what `window.atob` of web browsers do.\n * @param {String} asc Base64-encoded string\n * @returns {string} binary string\n */\nconst _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))\n    : _hasBuffer ? (asc) => Buffer.from(asc, 'base64').toString('binary')\n        : atobPolyfill;\n//\nconst _toUint8Array = _hasBuffer\n    ? (a) => _U8Afrom(Buffer.from(a, 'base64'))\n    : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));\n/**\n * converts a Base64 string to a Uint8Array.\n */\nconst toUint8Array = (a) => _toUint8Array(_unURI(a));\n//\nconst _decode = _hasBuffer\n    ? (a) => Buffer.from(a, 'base64').toString('utf8')\n    : _TD\n        ? (a) => _TD.decode(_toUint8Array(a))\n        : (a) => btou(_atob(a));\nconst _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));\n/**\n * converts a Base64 string to a UTF-8 string.\n * @param {String} src Base64 string.  Both normal and URL-safe are supported\n * @returns {string} UTF-8 string\n */\nconst decode = (src) => _decode(_unURI(src));\n/**\n * check if a value is a valid Base64 string\n * @param {String} src a value to check\n  */\nconst isValid = (src) => {\n    if (typeof src !== 'string')\n        return false;\n    const s = src.replace(/\\s+/g, '').replace(/={0,2}$/, '');\n    return !/[^\\s0-9a-zA-Z\\+/]/.test(s) || !/[^\\s0-9a-zA-Z\\-_]/.test(s);\n};\n//\nconst _noEnum = (v) => {\n    return {\n        value: v, enumerable: false, writable: true, configurable: true\n    };\n};\n/**\n * extend String.prototype with relevant methods\n */\nconst extendString = function () {\n    const _add = (name, body) => Object.defineProperty(String.prototype, name, _noEnum(body));\n    _add('fromBase64', function () { return decode(this); });\n    _add('toBase64', function (urlsafe) { return encode(this, urlsafe); });\n    _add('toBase64URI', function () { return encode(this, true); });\n    _add('toBase64URL', function () { return encode(this, true); });\n    _add('toUint8Array', function () { return toUint8Array(this); });\n};\n/**\n * extend Uint8Array.prototype with relevant methods\n */\nconst extendUint8Array = function () {\n    const _add = (name, body) => Object.defineProperty(Uint8Array.prototype, name, _noEnum(body));\n    _add('toBase64', function (urlsafe) { return fromUint8Array(this, urlsafe); });\n    _add('toBase64URI', function () { return fromUint8Array(this, true); });\n    _add('toBase64URL', function () { return fromUint8Array(this, true); });\n};\n/**\n * extend Builtin prototypes with relevant methods\n */\nconst extendBuiltins = () => {\n    extendString();\n    extendUint8Array();\n};\nconst gBase64 = {\n    version: version,\n    VERSION: VERSION,\n    atob: _atob,\n    atobPolyfill: atobPolyfill,\n    btoa: _btoa,\n    btoaPolyfill: btoaPolyfill,\n    fromBase64: decode,\n    toBase64: encode,\n    encode: encode,\n    encodeURI: encodeURI,\n    encodeURL: encodeURI,\n    utob: utob,\n    btou: btou,\n    decode: decode,\n    isValid: isValid,\n    fromUint8Array: fromUint8Array,\n    toUint8Array: toUint8Array,\n    extendString: extendString,\n    extendUint8Array: extendUint8Array,\n    extendBuiltins: extendBuiltins\n};\n// makecjs:CUT //\nexport { version };\nexport { VERSION };\nexport { _atob as atob };\nexport { atobPolyfill };\nexport { _btoa as btoa };\nexport { btoaPolyfill };\nexport { decode as fromBase64 };\nexport { encode as toBase64 };\nexport { utob };\nexport { encode };\nexport { encodeURI };\nexport { encodeURI as encodeURL };\nexport { btou };\nexport { decode };\nexport { isValid };\nexport { fromUint8Array };\nexport { toUint8Array };\nexport { extendString };\nexport { extendUint8Array };\nexport { extendBuiltins };\n// and finally,\nexport { gBase64 as Base64 };\n","import { getCookie, uuidv4 } from '../util/util';\nimport { Base64 } from 'js-base64';\nimport { config as gconfig } from '../config';\n\n/**\n * SnowPlow tracking the given data\n *\n * @param function_ The Function Type e.g. 'trackStructEvent'.\n * @param {string} identifier The Event Identifier.\n * @param {string} category The Event Category.\n * @param {string} action The Event Action.\n * @param {string} label The Event Label.\n * @param {string} property The Event Property.\n * @param  {...any} arguments_ Any other Arguments.\n */\nexport const sp = (function_, identifier, category, action, label, property, ...arguments_) => {\n  // -- spV3 --\n  if (function_ === 'trackStructEvent') {\n    try {\n      console.log('sending trackSelfDescribingEvent', action);\n      globalThis.schneepflug3('trackSelfDescribingEvent', {\n        event: {\n          schema: 'iglu:com.rumble/rumble_event/jsonschema/1-1-0',\n          data: {\n            event_id: identifier.toString(),\n            se_ca: (category || '').toString(),\n            se_ac: (action || '').toString(),\n            se_la: (label || '').toString(),\n            se_pr: (property || '').toString(),\n            se_va: arguments_.length <= 1 ? (arguments_[0] || '').toString() : JSON.stringify(arguments_),\n          },\n        },\n      });\n    } catch (error) {\n      console.warn('spV3 failed:', error);\n    }\n  } else {\n    console.warn('unhandled spV3 func/type: ' + function_);\n  }\n};\n\n/**\n * SnowPlow tracking the Subscription data\n *\n * @param {string} function_ The Function Type e.g. 'trackSelfDescribingEvent'\n * @param {string} action The Event Action.\n * @param {string} label The Event Label.\n * @param {string} product The Event Product.\n * @param {string} price The Event Price\n * @param {string} payment_method The Event Payment Method.\n */\nexport const spDriveSubscriptionEvents = (function_, action, label, product, price, payment_method) => {\n  const { snowplow } = globalThis;\n  if (snowplow && function_ === 'trackSelfDescribingEvent') {\n    try {\n      console.log('sending trackSelfDescribingEvent', action);\n      snowplow('trackSelfDescribingEvent', {\n        schema: 'iglu:de.drive/subscription_context/jsonschema/1-0-0',\n        data: {\n          action: (action || '').toString(),\n          label: (label || '').toString(),\n          product: (product || '').toString(),\n          price: (price || '').toString(),\n          payment_method: (payment_method || '').toString(),\n        },\n      });\n    } catch (error) {\n      console.warn('spDrive failed:', error);\n    }\n  } else {\n    console.warn(`unhandled spDrive func/type ${function_} or window.snowplow not available`);\n  }\n};\n\n/**\n * SnowPlow force tracking the given Data\n *\n * @param {string} function_ The Function Type e.g. 'trackStructEvent'\n * @param {string} identifier The Event Identifier.\n * @param {string} category The Event Category.\n * @param {string} action The Event Action.\n * @param {string} label The Event Label.\n * @param {string} property The Event Property.\n * @param  {...any} arguments_ Any other Arguments.\n */\nexport const spForce = (function_, identifier, category, action, label, property, ...arguments_) => {\n  console.log('spForceV3');\n  if (function_ === 'trackStructEvent') {\n    try {\n      const config = gconfig.portals[window['portal']];\n      let xhr = new XMLHttpRequest();\n\n      const eventData = {\n        schema: 'iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0',\n        data: {\n          schema: 'iglu:com.rumble/rumble_event/jsonschema/1-1-0',\n          data: {\n            event_id: identifier.toString(),\n            se_ca: (category || '').toString(),\n            se_ac: (action || '').toString(),\n            se_la: (label || '').toString(),\n            se_pr: (property || '').toString(),\n            se_va: arguments_.length <= 1 ? (arguments_[0] || '').toString() : JSON.stringify(arguments_),\n          },\n        },\n      };\n\n      const snowPlowPayload = {\n        schema: 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4',\n        data: [\n          {\n            e: 'ue',\n            eid: uuidv4(),\n            dtm: Date.now().toString(),\n            tv: 'js-3.2-0',\n            tna: 'rumble_bdp',\n            p: 'web',\n            cookie: '1',\n            // eslint-disable-next-line unicorn/text-encoding-identifier-case\n            cs: 'UTF-8',\n            lang: 'de-DE',\n            aid: config.spV3.appId,\n            uid: globalThis.tp.customVariables.uidGUID || getCookie('user_guid') || '',\n            ue_px: Base64.encode(JSON.stringify(eventData)),\n            stm: Date.now().toString(),\n          },\n        ],\n      };\n\n      xhr.open('POST', config.spV3.endpoint);\n      xhr.setRequestHeader('Content-Type', 'application/json; charset=UTF-8');\n      xhr.send(JSON.stringify(snowPlowPayload));\n    } catch (error) {\n      console.warn(error);\n    }\n  } else {\n    console.warn('unhandled spV3 func/type: ' + function_);\n  }\n};\n","import { removeElement } from '../util/util';\n\nconst getPremiumContentType = (element) => {\n  // TODO: is there a safer alternative?\n  if (element.classList.contains('PictureGalleryImage')) return 'gallery';\n  else if (element.classList.contains('VideoShowPlayer')) return 'video';\n  return 'article';\n};\n\n// utility function to apply Paywall Styles like dropshadows etc. to Templates\nexport const applyArticlePaywallStyles = (event, constraint) => {\n  if (event.displayMode === 'inline' && event.containerSelector === constraint) {\n    let selectedElements = document.querySelectorAll(event.containerSelector);\n\n    if (selectedElements.length > 1) {\n      //console.log('Multiple elements that match containerSelector: ' + event.containerSelector + ' found on page');\n      //console.log('Removing all elements except the first');\n      for (let index = selectedElements.length - 1; index > 0; index--) {\n        let currentElement = selectedElements[index];\n        switch (getPremiumContentType(currentElement)) {\n          case 'gallery': {\n            //console.log('Found Content of type Gallery', curElement);\n            removeElement(currentElement.parentNode.parentNode);\n            break;\n          }\n          case 'video': {\n            //console.log('Found Content of type Video', curElement);\n            break;\n          }\n          //default also means articles (case 'article':)!\n          default: {\n            //console.log('Content classifyed as Article', curElement);\n            removeElement(currentElement);\n            break;\n          }\n        }\n      }\n    }\n\n    const targetElement = selectedElements[0];\n    if (targetElement) {\n      targetElement.parentElement.classList.add('paywalled');\n      // widen container by 20px (l/r)\n      targetElement.style.marginLeft = '-10px';\n      targetElement.style.marginRight = '-10px';\n\n      // add drop shadow\n      targetElement.style.boxShadow = '0 2px 20px 0 rgba(0, 0, 0, 0.3)';\n\n      //Case: Video Plus Content\n      if (targetElement.classList.contains('VideoShowPlayer')) {\n        targetElement.style.maxWidth = 'none';\n        targetElement.style.width = 'auto';\n        removeElement(document.querySelector('.VideoShowTags'));\n      }\n\n      //Case: Picture Gallery Plus Content\n      if (targetElement.classList.contains('PictureGalleryImage')) {\n        removeElement(document.querySelector('.PictureGalleryShowTags'));\n      }\n\n      // trigger resize to ensure iframe takes up 100% of container width after widening\n      if (typeof Event === 'function') {\n        globalThis.dispatchEvent(new Event('resize'));\n      } else {\n        // for IE and other old browsers; causes deprecation warn on modern\n        let event_ = globalThis.document.createEvent('UIEvents');\n        event_.initUIEvent('resize', true, false, globalThis, 0);\n        globalThis.dispatchEvent(event_);\n      }\n\n      //clear remaining plus content/elements\n      removeElement(document.querySelector('.StoryShowBody>.StoryShowBox'));\n      removeElement(\n        document.querySelector('.StoryShowInlineBox:not(.InlinePictureGalleryBox):not(.InlineVideoSHowModule)')\n      );\n      removeElement(document.querySelector('#m_wctrlTalkData'));\n\n      // add white gradient/text fade out above paywall\n      const textElement = document.querySelector('#BaseTextFirstParagraph');\n      if (textElement) {\n        textElement.style.position = 'relative';\n        // [1478] CR - 02.05.2019 - Add min-height style property\n        textElement.style.minHeight = '82px';\n        const gradient = document.createElement('div');\n        gradient.classList.add('PaywallGradient');\n        textElement.append(gradient);\n      }\n    }\n  } else {\n    console.warn('Element-selector not found: ' + event.containerSelector);\n  }\n};\n","var cookie = {};\n\n/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\nvar hasRequiredCookie;\n\nfunction requireCookie () {\n\tif (hasRequiredCookie) return cookie;\n\thasRequiredCookie = 1;\n\n\t/**\n\t * Module exports.\n\t * @public\n\t */\n\n\tcookie.parse = parse;\n\tcookie.serialize = serialize;\n\n\t/**\n\t * Module variables.\n\t * @private\n\t */\n\n\tvar __toString = Object.prototype.toString;\n\tvar __hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\t/**\n\t * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n\t * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n\t * which has been replaced by the token definition in RFC 7230 appendix B.\n\t *\n\t * cookie-name       = token\n\t * token             = 1*tchar\n\t * tchar             = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n\t *                     \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n\t *                     \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n\t */\n\n\tvar cookieNameRegExp = /^[!#$%&'*+\\-.^_`|~0-9A-Za-z]+$/;\n\n\t/**\n\t * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n\t *\n\t * cookie-value      = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n\t * cookie-octet      = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n\t *                     ; US-ASCII characters excluding CTLs,\n\t *                     ; whitespace DQUOTE, comma, semicolon,\n\t *                     ; and backslash\n\t */\n\n\tvar cookieValueRegExp = /^(\"?)[\\u0021\\u0023-\\u002B\\u002D-\\u003A\\u003C-\\u005B\\u005D-\\u007E]*\\1$/;\n\n\t/**\n\t * RegExp to match domain-value in RFC 6265 sec 4.1.1\n\t *\n\t * domain-value      = <subdomain>\n\t *                     ; defined in [RFC1034], Section 3.5, as\n\t *                     ; enhanced by [RFC1123], Section 2.1\n\t * <subdomain>       = <label> | <subdomain> \".\" <label>\n\t * <label>           = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n\t *                     Labels must be 63 characters or less.\n\t *                     'let-dig' not 'letter' in the first char, per RFC1123\n\t * <ldh-str>         = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n\t * <let-dig-hyp>     = <let-dig> | \"-\"\n\t * <let-dig>         = <letter> | <digit>\n\t * <letter>          = any one of the 52 alphabetic characters A through Z in\n\t *                     upper case and a through z in lower case\n\t * <digit>           = any one of the ten digits 0 through 9\n\t *\n\t * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n\t *\n\t * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n\t * character is not permitted, but a trailing %x2E (\".\"), if present, will\n\t * cause the user agent to ignore the attribute.)\n\t */\n\n\tvar domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n\n\t/**\n\t * RegExp to match path-value in RFC 6265 sec 4.1.1\n\t *\n\t * path-value        = <any CHAR except CTLs or \";\">\n\t * CHAR              = %x01-7F\n\t *                     ; defined in RFC 5234 appendix B.1\n\t */\n\n\tvar pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n\n\t/**\n\t * Parse a cookie header.\n\t *\n\t * Parse the given cookie header string into an object\n\t * The object has the various cookies as keys(names) => values\n\t *\n\t * @param {string} str\n\t * @param {object} [opt]\n\t * @return {object}\n\t * @public\n\t */\n\n\tfunction parse(str, opt) {\n\t  if (typeof str !== 'string') {\n\t    throw new TypeError('argument str must be a string');\n\t  }\n\n\t  var obj = {};\n\t  var len = str.length;\n\t  // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n\t  if (len < 2) return obj;\n\n\t  var dec = (opt && opt.decode) || decode;\n\t  var index = 0;\n\t  var eqIdx = 0;\n\t  var endIdx = 0;\n\n\t  do {\n\t    eqIdx = str.indexOf('=', index);\n\t    if (eqIdx === -1) break; // No more cookie pairs.\n\n\t    endIdx = str.indexOf(';', index);\n\n\t    if (endIdx === -1) {\n\t      endIdx = len;\n\t    } else if (eqIdx > endIdx) {\n\t      // backtrack on prior semicolon\n\t      index = str.lastIndexOf(';', eqIdx - 1) + 1;\n\t      continue;\n\t    }\n\n\t    var keyStartIdx = startIndex(str, index, eqIdx);\n\t    var keyEndIdx = endIndex(str, eqIdx, keyStartIdx);\n\t    var key = str.slice(keyStartIdx, keyEndIdx);\n\n\t    // only assign once\n\t    if (!__hasOwnProperty.call(obj, key)) {\n\t      var valStartIdx = startIndex(str, eqIdx + 1, endIdx);\n\t      var valEndIdx = endIndex(str, endIdx, valStartIdx);\n\n\t      if (str.charCodeAt(valStartIdx) === 0x22 /* \" */ && str.charCodeAt(valEndIdx - 1) === 0x22 /* \" */) {\n\t        valStartIdx++;\n\t        valEndIdx--;\n\t      }\n\n\t      var val = str.slice(valStartIdx, valEndIdx);\n\t      obj[key] = tryDecode(val, dec);\n\t    }\n\n\t    index = endIdx + 1;\n\t  } while (index < len);\n\n\t  return obj;\n\t}\n\n\tfunction startIndex(str, index, max) {\n\t  do {\n\t    var code = str.charCodeAt(index);\n\t    if (code !== 0x20 /*   */ && code !== 0x09 /* \\t */) return index;\n\t  } while (++index < max);\n\t  return max;\n\t}\n\n\tfunction endIndex(str, index, min) {\n\t  while (index > min) {\n\t    var code = str.charCodeAt(--index);\n\t    if (code !== 0x20 /*   */ && code !== 0x09 /* \\t */) return index + 1;\n\t  }\n\t  return min;\n\t}\n\n\t/**\n\t * Serialize data into a cookie header.\n\t *\n\t * Serialize a name value pair into a cookie string suitable for\n\t * http headers. An optional options object specifies cookie parameters.\n\t *\n\t * serialize('foo', 'bar', { httpOnly: true })\n\t *   => \"foo=bar; httpOnly\"\n\t *\n\t * @param {string} name\n\t * @param {string} val\n\t * @param {object} [opt]\n\t * @return {string}\n\t * @public\n\t */\n\n\tfunction serialize(name, val, opt) {\n\t  var enc = (opt && opt.encode) || encodeURIComponent;\n\n\t  if (typeof enc !== 'function') {\n\t    throw new TypeError('option encode is invalid');\n\t  }\n\n\t  if (!cookieNameRegExp.test(name)) {\n\t    throw new TypeError('argument name is invalid');\n\t  }\n\n\t  var value = enc(val);\n\n\t  if (!cookieValueRegExp.test(value)) {\n\t    throw new TypeError('argument val is invalid');\n\t  }\n\n\t  var str = name + '=' + value;\n\t  if (!opt) return str;\n\n\t  if (null != opt.maxAge) {\n\t    var maxAge = Math.floor(opt.maxAge);\n\n\t    if (!isFinite(maxAge)) {\n\t      throw new TypeError('option maxAge is invalid')\n\t    }\n\n\t    str += '; Max-Age=' + maxAge;\n\t  }\n\n\t  if (opt.domain) {\n\t    if (!domainValueRegExp.test(opt.domain)) {\n\t      throw new TypeError('option domain is invalid');\n\t    }\n\n\t    str += '; Domain=' + opt.domain;\n\t  }\n\n\t  if (opt.path) {\n\t    if (!pathValueRegExp.test(opt.path)) {\n\t      throw new TypeError('option path is invalid');\n\t    }\n\n\t    str += '; Path=' + opt.path;\n\t  }\n\n\t  if (opt.expires) {\n\t    var expires = opt.expires;\n\n\t    if (!isDate(expires) || isNaN(expires.valueOf())) {\n\t      throw new TypeError('option expires is invalid');\n\t    }\n\n\t    str += '; Expires=' + expires.toUTCString();\n\t  }\n\n\t  if (opt.httpOnly) {\n\t    str += '; HttpOnly';\n\t  }\n\n\t  if (opt.secure) {\n\t    str += '; Secure';\n\t  }\n\n\t  if (opt.partitioned) {\n\t    str += '; Partitioned';\n\t  }\n\n\t  if (opt.priority) {\n\t    var priority = typeof opt.priority === 'string'\n\t      ? opt.priority.toLowerCase() : opt.priority;\n\n\t    switch (priority) {\n\t      case 'low':\n\t        str += '; Priority=Low';\n\t        break\n\t      case 'medium':\n\t        str += '; Priority=Medium';\n\t        break\n\t      case 'high':\n\t        str += '; Priority=High';\n\t        break\n\t      default:\n\t        throw new TypeError('option priority is invalid')\n\t    }\n\t  }\n\n\t  if (opt.sameSite) {\n\t    var sameSite = typeof opt.sameSite === 'string'\n\t      ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n\t    switch (sameSite) {\n\t      case true:\n\t        str += '; SameSite=Strict';\n\t        break;\n\t      case 'lax':\n\t        str += '; SameSite=Lax';\n\t        break;\n\t      case 'strict':\n\t        str += '; SameSite=Strict';\n\t        break;\n\t      case 'none':\n\t        str += '; SameSite=None';\n\t        break;\n\t      default:\n\t        throw new TypeError('option sameSite is invalid');\n\t    }\n\t  }\n\n\t  return str;\n\t}\n\n\t/**\n\t * URL-decode string value. Optimized to skip native call when no %.\n\t *\n\t * @param {string} str\n\t * @returns {string}\n\t */\n\n\tfunction decode (str) {\n\t  return str.indexOf('%') !== -1\n\t    ? decodeURIComponent(str)\n\t    : str\n\t}\n\n\t/**\n\t * Determine if value is a Date.\n\t *\n\t * @param {*} val\n\t * @private\n\t */\n\n\tfunction isDate (val) {\n\t  return __toString.call(val) === '[object Date]';\n\t}\n\n\t/**\n\t * Try decoding a string using a decoding function.\n\t *\n\t * @param {string} str\n\t * @param {function} decode\n\t * @private\n\t */\n\n\tfunction tryDecode(str, decode) {\n\t  try {\n\t    return decode(str);\n\t  } catch (e) {\n\t    return str;\n\t  }\n\t}\n\treturn cookie;\n}\n\nvar cookieExports = requireCookie();\n\nfunction hasDocumentCookie() {\n    const testingValue = typeof global === 'undefined'\n        ? undefined\n        : global.TEST_HAS_DOCUMENT_COOKIE;\n    if (typeof testingValue === 'boolean') {\n        return testingValue;\n    }\n    // Can we get/set cookies on document.cookie?\n    return typeof document === 'object' && typeof document.cookie === 'string';\n}\nfunction parseCookies(cookies) {\n    if (typeof cookies === 'string') {\n        return cookieExports.parse(cookies);\n    }\n    else if (typeof cookies === 'object' && cookies !== null) {\n        return cookies;\n    }\n    else {\n        return {};\n    }\n}\nfunction readCookie(value, options = {}) {\n    const cleanValue = cleanupCookieValue(value);\n    if (!options.doNotParse) {\n        try {\n            return JSON.parse(cleanValue);\n        }\n        catch (e) {\n            // At least we tried\n        }\n    }\n    // Ignore clean value if we failed the deserialization\n    // It is not relevant anymore to trim those values\n    return value;\n}\nfunction cleanupCookieValue(value) {\n    // express prepend j: before serializing a cookie\n    if (value && value[0] === 'j' && value[1] === ':') {\n        return value.substr(2);\n    }\n    return value;\n}\n\nclass Cookies {\n    constructor(cookies, defaultSetOptions = {}) {\n        this.changeListeners = [];\n        this.HAS_DOCUMENT_COOKIE = false;\n        this.update = () => {\n            if (!this.HAS_DOCUMENT_COOKIE) {\n                return;\n            }\n            const previousCookies = this.cookies;\n            this.cookies = cookieExports.parse(document.cookie);\n            this._checkChanges(previousCookies);\n        };\n        const domCookies = typeof document === 'undefined' ? '' : document.cookie;\n        this.cookies = parseCookies(cookies || domCookies);\n        this.defaultSetOptions = defaultSetOptions;\n        this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\n    }\n    _emitChange(params) {\n        for (let i = 0; i < this.changeListeners.length; ++i) {\n            this.changeListeners[i](params);\n        }\n    }\n    _checkChanges(previousCookies) {\n        const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));\n        names.forEach((name) => {\n            if (previousCookies[name] !== this.cookies[name]) {\n                this._emitChange({\n                    name,\n                    value: readCookie(this.cookies[name]),\n                });\n            }\n        });\n    }\n    _startPolling() {\n        this.pollingInterval = setInterval(this.update, 300);\n    }\n    _stopPolling() {\n        if (this.pollingInterval) {\n            clearInterval(this.pollingInterval);\n        }\n    }\n    get(name, options = {}) {\n        if (!options.doNotUpdate) {\n            this.update();\n        }\n        return readCookie(this.cookies[name], options);\n    }\n    getAll(options = {}) {\n        if (!options.doNotUpdate) {\n            this.update();\n        }\n        const result = {};\n        for (let name in this.cookies) {\n            result[name] = readCookie(this.cookies[name], options);\n        }\n        return result;\n    }\n    set(name, value, options) {\n        if (options) {\n            options = Object.assign(Object.assign({}, this.defaultSetOptions), options);\n        }\n        else {\n            options = this.defaultSetOptions;\n        }\n        const stringValue = typeof value === 'string' ? value : JSON.stringify(value);\n        this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });\n        if (this.HAS_DOCUMENT_COOKIE) {\n            document.cookie = cookieExports.serialize(name, stringValue, options);\n        }\n        this._emitChange({ name, value, options });\n    }\n    remove(name, options) {\n        const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\n        this.cookies = Object.assign({}, this.cookies);\n        delete this.cookies[name];\n        if (this.HAS_DOCUMENT_COOKIE) {\n            document.cookie = cookieExports.serialize(name, '', finalOptions);\n        }\n        this._emitChange({ name, value: undefined, options });\n    }\n    addChangeListener(callback) {\n        this.changeListeners.push(callback);\n        if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {\n            if (typeof window === 'object' && 'cookieStore' in window) {\n                window.cookieStore.addEventListener('change', this.update);\n            }\n            else {\n                this._startPolling();\n            }\n        }\n    }\n    removeChangeListener(callback) {\n        const idx = this.changeListeners.indexOf(callback);\n        if (idx >= 0) {\n            this.changeListeners.splice(idx, 1);\n        }\n        if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {\n            if (typeof window === 'object' && 'cookieStore' in window) {\n                window.cookieStore.removeEventListener('change', this.update);\n            }\n            else {\n                this._stopPolling();\n            }\n        }\n    }\n}\n\nexport { Cookies as default };\n","export class Validation {\n  /**\n   * An array to store the validation errors objects.\n   * The validation errors object has the following structure:\n   * <br>{\n   *  <br>id: string,\n   *  <br>message: string\n   *  <br>(optional) code: string\n   * <br> }\n   *\n   * @type {array}\n   */\n  validationErrors = [];\n\n  /**\n   * The key for the email id.\n   *\n   * @type {string}\n   */\n  emailIdKey = 'email';\n\n  /**\n   * The key for the password id.\n   *\n   * @type {string}\n   */\n  passwordIdKey = 'password';\n\n  /**\n   * The key for the password2 id.\n   *\n   * @type {string}\n   */\n  password2IdKey = 'password2';\n\n  /**\n   * The key for the salutation id.\n   *\n   * @type {string}\n   */\n  salutationIdKey = 'salutation';\n\n  /**\n   * The key for the firstname id.\n   *\n   * @type {string}\n   */\n  firstNameIdKey = 'firstname';\n\n  /**\n   * The key for the lastname id.\n   *\n   * @type {string}\n   */\n  lastNameIdKey = 'lastname';\n\n  /**\n   * The key for the zipcode id.\n   *\n   * @type {string}\n   */\n  addressZipCodeIdKey = 'zipcode';\n\n  /**\n   * The key for the Street id.\n   *\n   * @type {string}\n   */\n  addressStreetIdKey = 'street';\n\n  /**\n   * The key for the House Number id.\n   *\n   * @type {string}\n   */\n  addressHouseNoIdKey = 'hnumber';\n\n  /**\n   * The key for the City id.\n   *\n   * @type {string}\n   */\n  addressCityIdKey = 'city';\n\n  /**\n   * The Generic function to validate the form data.\n   *\n   * @param {object} formData The form data to validate.\n   * The object <b>can have</b> the following structure:\n   * <br><h5>Keys:</h5> {\n   *   <li>email: string,</li>\n   *   <li>password: string,</li>\n   *   <li>password2: string,</li>\n   *   <li>zipcode: string,</li>\n   *   <li>firstname: string,</li>\n   *   <li>lastname: string</li>\n   *   <li>street: string</li>\n   *   <li>hnumber: string</li>\n   *   <li>city: string</li>\n   * }\n   *\n   * @returns {array} The validation errors.\n   */\n  validate(formData) {\n    for (let key in formData) {\n      switch (key) {\n        case this.emailIdKey: {\n          this.validateEmailFormat(formData[key]);\n          break;\n        }\n\n        case this.passwordIdKey: {\n          this.validatePassword(formData[key]);\n          break;\n        }\n\n        case this.password2IdKey: {\n          this.validatePasswordsMatch(formData[this.passwordIdKey], formData[key]);\n          break;\n        }\n\n        case this.addressZipCodeIdKey: {\n          this.validateZipCode(formData[key]);\n          break;\n        }\n\n        case this.salutationIdKey: {\n          this.isSet(formData[key], key, 'Bitte wählen Sie eine Anrede aus.');\n          break;\n        }\n\n        case this.firstNameIdKey: {\n          this.isSet(formData[key], key, 'Bitte geben Sie Ihren Vornamen ein.');\n          break;\n        }\n\n        case this.lastNameIdKey: {\n          this.isSet(formData[key], key, 'Bitte geben Sie Ihren Nachnamen ein.');\n          break;\n        }\n\n        case this.addressStreetIdKey: {\n          this.isSet(formData[key], key, 'Bitte geben Sie die Straße ein.');\n          break;\n        }\n\n        case this.addressHouseNoIdKey: {\n          this.isSet(formData[key], key, 'Bitte geben Sie die Hausnummer ein.');\n          break;\n        }\n\n        case this.addressCityIdKey: {\n          this.isSet(formData[key], key, 'Bitte geben Sie die Stadt ein.');\n          break;\n        }\n      }\n    }\n\n    return this.validationErrors;\n  }\n\n  /**\n   * Returns an array with error Objects for specific error code, or default message.\n   *\n   * @param {object} response The response object from the middleware.\n   * @returns {array}\n   */\n  validateMiddlewareResponse(response) {\n    if (response.error && response.error.code) {\n      switch (response.error.code) {\n        case '400-002':\n        case '400-010': {\n          this.validationErrors.push({\n            id: undefined,\n            message: 'Bitte überprüfen Sie Ihre Eingaben.',\n            code: response.error.code,\n          });\n          break;\n        }\n        case '400-004': {\n          this.validationErrors.push({\n            id: this.emailIdKey,\n            message: 'Die von Ihnen gewählte E-Mail Adresse existiert bereits.',\n            code: response.error.code,\n          });\n          break;\n        }\n        case '400-005':\n        case '400-011': {\n          this.validationErrors.push({\n            id: this.passwordIdKey,\n            message: 'Das von Ihnen gewählte Passwort entspricht nicht unseren Passwortrichtlinien.',\n            code: response.error.code,\n          });\n          break;\n        }\n        case '400-006':\n        case '400-012': {\n          this.validationErrors.push({\n            id: this.passwordIdKey,\n            message: 'Das von Ihnen gewählte Passwort ist zu kurz (mind. 8 Zeichen).',\n            code: response.error.code,\n          });\n          break;\n        }\n        case '400-013': {\n          this.validationErrors.push({\n            id: this.password2IdKey,\n            message: 'Die von Ihnen gewählten Passwörter stimmen nicht überein.',\n            code: response.error.code,\n          });\n          break;\n        }\n        case '400-021': {\n          this.validationErrors.push({\n            id: undefined,\n            message: 'Die gewählte Anrede ist ungültig.',\n            code: response.error.code,\n          });\n          break;\n        }\n\n        default: {\n          this.validationErrors.push({\n            id: undefined,\n            message:\n              'Unerwarteter Fehler, versuchen Sie es später erneut oder wenden Sie sich an unseren Leserservice.',\n            code: response.error.code,\n          });\n        }\n      }\n\n      console.log('Error Code:', response.error.code);\n    }\n\n    return this.validationErrors;\n  }\n\n  /**\n   * Check if the email has a valid format.\n   * If not, we push an error object to the validationErrors array.\n   *\n   * @param {string} email\n   */\n  validateEmailFormat(email) {\n    let emailValidate =\n      // eslint-disable-next-line sonarjs/regex-complexity\n      /^(([^\\s\"(),.:;<>@[\\\\\\]]+(\\.[^\\s\"(),.:;<>@[\\\\\\]]+)*)|(\".+\"))@((\\[(?:\\d{1,3}\\.){3}\\d{1,3}])|(([\\dA-Za-z-]+\\.)+[A-Za-z]{2,}))$/;\n\n    if (email.match(emailValidate) === null) {\n      this.validationErrors.push({\n        id: this.emailIdKey,\n        message: 'Bitte geben Sie eine gültige E-Mail-Adresse ein.',\n      });\n    }\n  }\n\n  /**\n   * Validate the password.\n   * If the password does not meet the requirements, we push an error object to the validationErrors array.\n   *\n   * @param stringData The password to validate.\n   */\n  validatePassword(stringData) {\n    this.validatePasswordLength(stringData);\n    this.validateCapitalLetters(stringData);\n    this.validateNumber(stringData);\n    this.validateSpecialCharacter(stringData);\n  }\n\n  /**\n   * Check if a string has at least 8 characters.\n   *\n   * @param {string} stringData The string to check.\n   */\n  validatePasswordLength(stringData) {\n    if (stringData.length < 8) {\n      this.validationErrors.push({\n        id: this.passwordIdKey,\n        message: 'Das Passwort muss mind. 8 Zeichen enthalten.',\n      });\n    }\n  }\n\n  /**\n   * Check if a string has at least one capital letter.\n   *\n   * @param {string} stringData The string to check.\n   */\n  validateCapitalLetters(stringData) {\n    if (stringData.match(/[A-Z]/) === null) {\n      this.validationErrors.push({\n        id: this.passwordIdKey,\n        message: 'Das Passwort muss mind. einen Großbuchstaben enthalten.',\n      });\n    }\n  }\n\n  /**\n   * Check if a string has at least one number.\n   *\n   * @param {string} stringData The string to check.\n   */\n  validateNumber(stringData) {\n    if (stringData.match(/\\d/) === null) {\n      this.validationErrors.push({\n        id: this.passwordIdKey,\n        message: 'Das Passwort muss mind. eine Zahl enthalten.',\n      });\n    }\n  }\n\n  /**\n   * Check if a string has at least one special character.\n   *\n   * @param {string} stringData The string to check.\n   */\n  validateSpecialCharacter(stringData) {\n    if (stringData.match(/[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]/) === null) {\n      this.validationErrors.push({\n        id: this.passwordIdKey,\n        message: 'Das Passwort muss mind. ein Sonderzeichen enthalten.',\n      });\n    }\n  }\n\n  /**\n   * Check if two passwords are equal.\n   * If not, we push an error object to the validationErrors array.\n   *\n   * @param {string} firstPassword The first password.\n   * @param {string} secondPassword The second password.\n   */\n  validatePasswordsMatch(firstPassword, secondPassword) {\n    if (secondPassword === '' && firstPassword === secondPassword) {\n      this.validationErrors.push({\n        id: this.passwordIdKey,\n        message: 'Sie müssen ein Passwort eingeben.',\n      });\n    } else if (firstPassword !== secondPassword) {\n      this.validationErrors.push({\n        id: this.password2IdKey,\n        message: 'Die Passwörter stimmen nicht überein.',\n      });\n    }\n  }\n\n  /**\n   * Check if a zip code has a valid format.\n   * If not, we push an error object to the validationErrors array.\n   *\n   * @param {string} stringData The form data to validate.\n   */\n  validateZipCode(stringData) {\n    if (stringData.match(/^\\d{5}$/) === null) {\n      this.validationErrors.push({\n        id: this.addressZipCodeIdKey,\n        message: 'Bitte geben Sie eine gültige 5-stellige Postleitzahl ein.',\n      });\n    }\n  }\n\n  /**\n   * Check if the stringData is set.\n   *\n   * @param {string} stringData The form data to validate.\n   * @param {string} id The id of the element.\n   * @param {string} message The error message.\n   */\n  isSet(stringData, id, message) {\n    if (stringData === null || stringData.length === 0 || stringData === '') {\n      this.validationErrors.push({\n        id: id,\n        message: message,\n      });\n    }\n  }\n}\n","import { config } from '../config';\nimport { Registration } from './registration';\n\nexport class PreservedParameterTracker {\n  /**\n   * The URL search parameters object.\n   *\n   * @type {URLSearchParams}\n   */\n  urlSearchParameters = new URLSearchParams(globalThis.location.search);\n\n  /**\n   * An array of preserved parameter names that should be grabbed from the URL.\n   *\n   * @type {array}\n   */\n  preservedParameter = ['ma', 'si'];\n\n  /**\n   * The endpoints object from the Config.\n   *\n   * @type {object}\n   */\n  endpoints = {};\n\n  /**\n   * The default Conversion marketing ID.\n   *\n   * @type {string}\n   */\n  defaultConversionId = 'MA00000379';\n\n  /**\n   * The default Registration marketing ID.\n   *\n   * @type {string}\n   */\n  defaultRegistrationId = 'MA00000030';\n\n  /**\n   * The app name. Or Portal short name.\n   *\n   * @type {string}\n   */\n  app = '';\n\n  /**\n   * The consent types object.\n   *\n   * @type {{promotional: 1, existing_customer: 2, data_privacy_declaration: 3, terms_and_conditions: 4}}\n   */\n  consentTypes = {\n    promotional: 1,\n    existing_customer: 2,\n    data_privacy_declaration: 3,\n    terms_and_conditions: 4,\n  };\n\n  constructor() {\n    let mainConfig = config.portals[window['portal']];\n    this.endpoints = mainConfig.endpoints;\n    this.app = new Registration(mainConfig).getPortal();\n  }\n\n  /**\n   * The method returns all needed parameters that are present in the URL.\n   *\n   * @returns {object} An object of existing parameters or an empty object if nothing founds.\n   */\n  grabNeededParameters() {\n    const existingParameters = {};\n    for (const parameter of this.preservedParameter) {\n      if (this.urlSearchParameters.has(parameter)) {\n        existingParameters[parameter] = this.urlSearchParameters.get(parameter);\n      }\n    }\n\n    return existingParameters;\n  }\n\n  /**\n   * The method tracks all preserved parameters that are present in the URL.\n   *\n   * @param {string} uuid The user ID.\n   * @param {boolean} promotional The user opt-in status.\n   */\n  trackMarketingEventRegistration(uuid, promotional) {\n    let existingParameters = this.grabNeededParameters();\n\n    let dataToTrack = {\n      app: this.app,\n      uid: uuid,\n      marketingActionId: existingParameters.ma ?? this.defaultRegistrationId,\n      sourceId: existingParameters.si ?? this.defaultRegistrationId,\n      consents: this.getConsents(promotional, true, false),\n    };\n\n    this.trackData(this.endpoints.trackingRegistration, dataToTrack);\n  }\n\n  /**\n   * The method tracks the marketing event conversion.\n   *\n   * @param {object} conversionEvent\n   */\n  trackMarketingEventConversion(conversionEvent) {\n    let existingParameters = this.grabNeededParameters();\n\n    let dataToTrack = {\n      app: this.app,\n      paymentId: conversionEvent.paymentId,\n      promotionId: conversionEvent.promotionId,\n      rid: conversionEvent.rid,\n      termConversionId: conversionEvent.termConversionId,\n      termId: conversionEvent.termId,\n      uid: conversionEvent.uid,\n      marketingActionId: existingParameters.ma ?? this.defaultConversionId,\n      sourceId: existingParameters.si ?? this.defaultConversionId,\n      consents: this.getConsents(null, false, true),\n    };\n\n    this.trackData(this.endpoints.trackingConversion, dataToTrack);\n  }\n\n  /**\n   * The method returns the consents object.\n   * Data privacy declaration is always true.\n   *\n   * @param {boolean|null} promotional only in the registration\n   * @param {boolean} existingCustomer only in the registration\n   * @param {boolean} termsAndConditions only in the checkout\n   *\n   * @returns {[{type: 1, value: boolean},{type: 3, value: boolean},{type: 4, value: boolean}]}\n   */\n  getConsents(promotional, existingCustomer, termsAndConditions) {\n    let consents = [\n      {\n        type: this.consentTypes.data_privacy_declaration,\n        value: true,\n      },\n    ];\n\n    if (promotional !== null) {\n      consents.push({\n        type: this.consentTypes.promotional,\n        value: promotional,\n      });\n    }\n\n    if (existingCustomer === true) {\n      consents.push({\n        type: this.consentTypes.existing_customer,\n        value: true,\n      });\n    }\n\n    if (termsAndConditions === true) {\n      consents.push({\n        type: this.consentTypes.terms_and_conditions,\n        value: true,\n      });\n    }\n\n    return consents;\n  }\n\n  /**\n   * The method tracks data to the tracking endpoint.\n   *\n   * @param {string} url The tracking endpoint url.\n   * @param {object} data The data object to be tracked.\n   */\n  trackData(url, data) {\n    console.log('trackData:', url, data);\n\n    let requestOptions = {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n      },\n      body: JSON.stringify(data),\n    };\n\n    fetch(url, requestOptions)\n      .then((response) => {\n        if (!response.ok) {\n          if (response.status === 404) {\n            throw new Error('404 - Data Endpoint not found');\n          } else if (response.status === 500) {\n            throw new Error('500 - Server error');\n          } else {\n            throw new Error('Network response was not ok');\n          }\n        }\n\n        return response.json();\n      })\n      .then((data) => {\n        console.log('Marketing Tracker Success:', data);\n      })\n      .catch((error) => {\n        console.error('Error:', error);\n      });\n  }\n}\n","import { sp as snowPlow } from '../SnowPlow/sp';\nimport { Validation } from './validation';\nimport { PreservedParameterTracker } from './preservedParameterTracker';\n\nexport class Registration {\n  /**\n   * The Config\n   *\n   * @property {object}\n   */\n  config;\n\n  /**\n   * The Registration Endpoint\n   *\n   * @property {string}\n   */\n  registrationEndpoint;\n\n  /**\n   * The Constructor\n   *\n   * @param {object} config\n   */\n  constructor(config) {\n    this.config = config;\n    this.registrationEndpoint = this.config.endpoints.registerUser || '';\n  }\n\n  /**\n   * Returns the Personal Registration Data, collected from the given event Object.\n   *\n   * @param {object} event\n   * @returns {object}\n   */\n  // eslint-disable-next-line sonarjs/cognitive-complexity\n  getPersonalRegData(event) {\n    let fields = event.params;\n\n    return {\n      anrede: fields.anr !== undefined && fields.anr.length > 0 ? fields.anr : undefined,\n      vorname: fields.vname !== undefined && fields.vname.length > 0 ? fields.vname : undefined,\n      nachname: fields.nname !== undefined && fields.nname.length > 0 ? fields.nname : undefined,\n      email: fields.email !== undefined && fields.email.length > 0 ? fields.email : undefined,\n      confirmEmail: fields.emailconf !== undefined && fields.emailconf.length > 0 ? fields.emailconf : undefined,\n      password: fields.pass !== undefined && fields.pass.length > 0 ? fields.pass : undefined,\n      confirmPassword: fields.passconf !== undefined && fields.passconf.length > 0 ? fields.passconf : undefined,\n      street: fields.street !== undefined && fields.street.length > 0 ? fields.street : undefined,\n      number: fields.hnumber !== undefined && fields.hnumber.length > 0 ? fields.hnumber : undefined,\n      zipCode: fields.zipcode !== undefined && fields.zipcode.length > 0 ? fields.zipcode : undefined,\n      city: fields.city !== undefined && fields.city.length > 0 ? fields.city : undefined,\n      offerOptIn: fields.angebotoptin !== undefined,\n      dayOfBirth: fields.bday !== undefined && fields.bday.length > 0 ? fields.bday : undefined,\n      monthOfBirth: fields.bmonth !== undefined && fields.bmonth.length > 0 ? fields.bmonth : undefined,\n      yearOfBirth: fields.byear !== undefined && fields.byear.length > 0 ? fields.byear : undefined,\n    };\n  }\n\n  /**\n   * The Registration Event\n   *\n   * @param {object} event\n   */\n  registrationEvent(event) {\n    const { formArray, iframeId } = event.data.payload;\n    const regData = {};\n\n    formArray.map((field) => {\n      regData[field.name] = field.value;\n    });\n\n    this.register(iframeId, {\n      anrede: regData.anr ?? 1, // ToDo remove default value.\n      vorname: regData.vname,\n      nachname: regData.nname,\n      email: regData.email,\n      password: regData.pass,\n      confirmPassword: regData.passconf,\n      street: regData.street,\n      number: regData.hnumber,\n      zipCode: regData.zipcode,\n      city: regData.city,\n      offerOptIn: regData.angebotoptin !== undefined,\n    });\n  }\n\n  /**\n   * The Registration Process\n   *\n   * @param {string} iframeId\n   * @param {object} personalRegData The registration Data Object.\n   * <br>{\n   *  <li>anrede,</li>\n   *  <li>vorname,</li>\n   *  <li>nachname,</li>\n   *  <li>email,</li>\n   *  <li>confirmEmail,</li>\n   *  <li>password,</li>\n   *  <li>confirmPassword,</li>\n   *  <li>street,</li>\n   *  <li>number,</li>\n   *  <li>zipCode,</li>\n   *  <li>city,</li>\n   *  <li>dayOfBirth,</li>\n   *  <li>monthOfBirth,</li>\n   * <li>yearOfBirth</li>\n   * }\n   */\n  register(iframeId, personalRegData) {\n    console.log('iframeId:', iframeId);\n    console.dir(personalRegData);\n\n    /**\n     * 20191024 CR, Tracking für Registration started (buttonClicked) via Snowplow\n     */\n    // Yep, we're sending multiple data points in one event\n    snowPlow(\n      'trackStructEvent',\n      'registration_started',\n      'registration',\n      'registrationStarted',\n      personalRegData.email,\n      ''\n    );\n\n    let errorMessage = new Validation().validate({\n      email: personalRegData.email,\n      password: personalRegData.password,\n      password2: personalRegData.confirmPassword,\n      zipcode: personalRegData.zipCode,\n      salutation: personalRegData.anrede,\n      firstname: personalRegData.vorname,\n      lastname: personalRegData.nachname,\n      street: personalRegData.street,\n      hnumber: personalRegData.number,\n      city: personalRegData.city,\n    });\n\n    if (errorMessage.length > 0) {\n      console.log(personalRegData.email, 'post message sent to iFrame!');\n      this.sendPostMessageToPiano(iframeId, false, errorMessage, 'error');\n      return;\n    }\n\n    console.log('UMP Registration');\n    this.sendRegistrationToUMP(personalRegData, iframeId);\n  }\n\n  /**\n   * Sends the Given Data to the UMP Registration\n   *\n   * @param {object} data_json\n   * @param {string} iframeId\n   */\n  sendRegistrationToUMP(data_json, iframeId) {\n    const ump_json = {\n      app: this.getPortal(),\n      email: data_json.email,\n      password: data_json.password,\n      password2: data_json.password,\n      salutation: Number.parseInt(data_json.anrede),\n      firstName: data_json.vorname,\n      lastName: data_json.nachname,\n      addressStreet: data_json.street,\n      addressHouseNo: data_json.number,\n      addressCity: data_json.city,\n      addressZipCode: data_json.zipCode,\n      birthdayDay: data_json.birthdayDay || 1,\n      birthdayMonth: data_json.birthdayMonth || 1,\n      birthdayYear: data_json.birthdayYear || 1900,\n      doi_success_redirect: globalThis.location.href,\n    };\n\n    let xhr = new XMLHttpRequest();\n    xhr.open('POST', this.registrationEndpoint, true);\n    XMLHttpRequest.responseType = 'json';\n    xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n    // Ajax READY:\n    xhr.addEventListener('load', () => {\n      let response = JSON.parse(xhr.responseText);\n      console.log(response);\n\n      // Fehlerfall: message-Listener ansprechen und Fehlermeldung senden\n      if (response.status === 'error') {\n        this.sendPostMessageToPiano(iframeId, false, new Validation().validateMiddlewareResponse(response), 'email');\n      }\n\n      // On Success.\n      if (response.status === 'success') {\n        new PreservedParameterTracker().trackMarketingEventRegistration(\n          response.user.primaryUuid,\n          data_json.offerOptIn\n        );\n\n        this.handleResponse({ userguid: response.user.primaryUuid, userref: response.userref }, iframeId);\n      }\n    });\n\n    xhr.send(JSON.stringify(ump_json));\n  }\n\n  /**\n   * Send the given Data to Piano\n   *\n   * @param {string} iframeId The iFrame-Id\n   * @param {boolean} success\n   * @param {string|object} message\n   * @param {string|object} messageType\n   */\n  sendPostMessageToPiano(iframeId, success, message, messageType) {\n    // eslint-disable-next-line unicorn/prefer-query-selector\n    let iframe = document.getElementById(iframeId);\n\n    if (!iframe) {\n      // Workaround to mitigate lowercase transformation by FI LB\n      console.log('destination iframe not found, trying case insensitive search');\n      iframe = document.querySelector('[id=\"' + iframeId + '\" i]');\n      console.log('found..', iframe);\n    }\n\n    if (iframe) {\n      console.log(\n        'postMessage:',\n        { piano: { success: success, message: message, object: messageType } },\n        'to iframe:',\n        iframe\n      );\n\n      iframe.contentWindow.postMessage({ piano: { success: success, message: message, object: messageType } }, '*');\n    }\n  }\n\n  /**\n   * Handle the Response\n   *\n   * @param {object} response\n   * @param {string} iframeId\n   */\n  handleResponse(response, iframeId) {\n    let registration = this;\n    // push strGuid und userref to TP; used by \"resend\"\n    let tp = window['tp'];\n    tp.push(\n      ['setCustomVariable', 'strGuid', response.userguid],\n      ['setCustomVariable', 'strUserref', response.userref],\n      ['setCustomVariable', 'userState', 'RegisteredEmailNotConfirmed'],\n      ['setCustomVariable', 'showCheckout', 1],\n      ['setUserRef', response.userref]\n    );\n\n    /**\n     * 20191024 CR, Tracking für abgeschlossene Registrationen via Snowplow\n     */\n    // Yep, we're sending multiple datapoints in one event\n    snowPlow('trackStructEvent', 'registration_complete', 'registration', 'registrationComplete', response.userguid);\n\n    /**\n     * 20191024 CR, Tracking für abgeschlossene registrationen via GTM\n     */\n    globalThis.dataLayer = globalThis.dataLayer || [];\n    globalThis.dataLayer.push({\n      event: 'registrationComplete',\n    });\n\n    /**\n     * 20200320 CR, Tracking für abgeschlossene registrationen via FB\n     */\n    if (globalThis.fbq && this.config.fb && this.config.fb.pixelId) {\n      globalThis.fbq('track', 'CompleteRegistration', { value: 0, currency: 'EUR' });\n    }\n\n    // why 'email'?\n    registration.sendPostMessageToPiano(iframeId, true, '', 'email');\n\n    if (/amp-subscribe/.test(globalThis.location.pathname)) {\n      // sending the term object in customVars is too much for the piano amp login api,\n      // clearing field so that we can do the amp login here - not needed with amp anyway\n      const ampCustomVariables = globalThis.tp.customVariables;\n      ampCustomVariables.term = null;\n      globalThis.tp.amp.login({\n        userToken: globalThis.tp.userRef,\n        userState: ampCustomVariables,\n        userProvider: globalThis.tp.user.getProvider().getName(),\n        loginSuccess: function () {\n          console.log('amp login after registration worked!');\n        },\n        loginFail: function () {\n          console.log('amp login after registration failed!');\n          console.log(globalThis.tp.userRef);\n          console.log(ampCustomVariables);\n          console.log(globalThis.tp.user.getProvider().getName());\n        },\n      });\n    }\n\n    if (!tp.customVariables.term || !tp.customVariables.offerId) {\n      //the legacy way of starting the checkout.\n      console.log('registration success - triggering experience execute');\n      tp.experience.execute();\n    } else {\n      console.log('registration success');\n\n      if (tp.customVariables.originIframeId) {\n        console.log('originIframeId found - send message to originIframe');\n\n        tp.offer.reloadAll();\n        registration.sendPostMessageToPiano(\n          tp.customVariables.originIframeId,\n          true,\n          {\n            type: 'notifyRegistrationSuccess',\n            termIndex: tp.customVariables.termIndex,\n          },\n          'object'\n        );\n      } else {\n        console.log('originIframeId not found - triggering deprecated checkout ');\n\n        tp.offer.startCheckout({\n          offerId: tp.customVariables.offerId,\n          mode: 'modal',\n          termId: tp.customVariables.term.termId,\n        });\n      }\n    }\n  }\n\n  /**\n   * Returns the Portal Shortcut\n   *\n   * @returns {string}\n   */\n  getPortal() {\n    const regex = new RegExp('rn|dz|hz|mlz|ha|rz|mz|sz|hea|dm|wz|bbv', 'i');\n    let searchResult;\n    let result = 'Unknown Portal';\n\n    if ((searchResult = regex.exec(window['portal'])) !== null) {\n      for (const match of searchResult) {\n        result = match.toUpperCase();\n      }\n    }\n\n    if (result === 'RN') {\n      let apolloRegex = /apollo-rn/i;\n      if (apolloRegex.exec(globalThis.location.origin) !== null) {\n        result = 'APRN';\n      }\n    }\n\n    console.log('getPortal() return: ' + result);\n    return result;\n  }\n\n  /**\n   * The process for standalone registrations\n   *\n   * @param {MessageEvent} messageEvent\n   * @param {string} iframeId\n   */\n  standaloneRegistrationEvent(messageEvent, iframeId) {\n    const formJson = JSON.parse(messageEvent.data.form);\n\n    let errorMessages = new Validation().validate({\n      email: formJson.email,\n      password: formJson.password,\n      password2: formJson.password2,\n      zipcode: formJson.zipcode,\n      salutation: formJson.salutation ?? 1, // ToDo remove default value.\n      firstname: formJson.firstname,\n      lastname: formJson.lastname,\n    });\n\n    if (errorMessages.length > 0) {\n      console.log(errorMessages);\n      this.sendPostMessageToPiano(iframeId, false, errorMessages, 'error');\n      return;\n    }\n\n    this.sendStandaloneRegistrationToUMP(\n      {\n        app: this.getPortal(),\n        email: formJson.email,\n        password: formJson.password,\n        password2: formJson.password2,\n        salutation: Number.parseInt(formJson.salutation) || 1, // ToDo remove default value.\n        firstName: formJson.firstname,\n        lastName: formJson.lastname,\n        offerOptIn: formJson.angebotoptin !== undefined,\n        addressStreet: formJson.street || null,\n        addressHouseNo: formJson.hnumber || null,\n        addressZipCode: formJson.zipcode,\n        addressCity: formJson.city || null,\n      },\n      iframeId\n    );\n  }\n\n  /**\n   * Sends the Given Data to the UMP Registration\n   * This function can be used for standalone registrations.\n   *\n   * @param {object} data_json\n   * @param {string} iframeId\n   */\n  sendStandaloneRegistrationToUMP(data_json, iframeId) {\n    let xhr = new XMLHttpRequest();\n    xhr.open('POST', this.registrationEndpoint, true);\n    XMLHttpRequest.responseType = 'json';\n    xhr.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n\n    xhr.addEventListener('load', () => {\n      let response = JSON.parse(xhr.responseText);\n\n      // Fehlerfall: message-Listener ansprechen und Fehlermeldung senden\n      if (response.status === 'error') {\n        this.sendPostMessageToPiano(iframeId, false, new Validation().validateMiddlewareResponse(response), 'email');\n      }\n\n      if (response.status === 'success') {\n        new PreservedParameterTracker().trackMarketingEventRegistration(\n          response.user.primaryUuid,\n          data_json.offerOptIn\n        );\n\n        console.log('Registration successfull.');\n        let tp = window['tp'];\n        tp.push(\n          ['setCustomVariable', 'strGuid', response.user.primaryUuid],\n          ['setCustomVariable', 'strUserref', response.userref],\n          ['setCustomVariable', 'userState', 'RegisteredEmailNotConfirmed'],\n          ['setUserRef', response.userref]\n        );\n        this.sendPostMessageToPiano(iframeId, true, '', 'email');\n        tp.experience.execute();\n      }\n    });\n\n    xhr.send(JSON.stringify(data_json));\n  }\n}\n","import { applyArticlePaywallStyles } from '../ui/defaultPaywall';\nimport { sp as snowPlow, spDriveSubscriptionEvents as snowPlowDriveSubscriptionEvents } from '../SnowPlow/sp';\nimport Cookies from 'universal-cookie';\nimport { Registration } from './registration';\nimport { removeElement } from '../util/util';\nimport { PreservedParameterTracker } from './preservedParameterTracker';\nimport { config } from '../config.js';\n\nexport class Piano {\n  /**\n   * The config Object\n   *\n   * @property {object}\n   */\n  config;\n\n  /**\n   * @property {Registration}\n   */\n  registration;\n\n  /**\n   * The Constructor\n   */\n  constructor() {\n    this.config = config.portals[window['portal']];\n    this.registration = new Registration(this.config);\n  }\n\n  /**\n   * Initialize the experience\n   */\n  initExperience() {\n    console.log('initExperience()');\n\n    let tp = window['tp'];\n    tp.experience.init();\n  }\n\n  /**\n   * The startCheckout event fires when a user begins checkout on a term.\n   *\n   * @param {object} data\n   */\n  onStartCheckout(data) {\n    console.log('Event startCheckout:', data);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_checkout_start',\n      'piano',\n      'startCheckout',\n      data.experienceId,\n      data.offerid,\n      data.url\n    );\n\n    if (globalThis.fbq && this.config.fb && this.config.fb.pixelId) {\n      globalThis.fbq('track', 'InitiateCheckout');\n    }\n  }\n\n  /**\n   * The checkoutStateChange event fires when the state of checkout is changed for the user (e.g. the user enters the payment components screen).\n   *\n   * @param {object} event\n   */\n  onCheckoutStateChange(event) {\n    console.log('EVENT: checkoutStateChange', event);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_checkout_statechange',\n      'piano',\n      'checkoutStateChange',\n      'Zustandswechsel',\n      'checkoutStage',\n      event.stateName\n    );\n  }\n\n  /**\n   * The checkoutSelectTerm event fires when a user selects a term within an offer.\n   *\n   * @param {object} termDetails\n   * @param {string} iframeId\n   */\n  onCheckoutSelectTerm(termDetails, iframeId) {\n    console.log('EVENT: checkoutSelectTerm', termDetails, iframeId);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_checkout_selectTerm',\n      'piano',\n      'checkoutSelectTerm',\n      termDetails.termName,\n      termDetails.resourceId,\n      termDetails.resourceName\n    );\n  }\n\n  /**\n   * The showTemplate event fires when a user is presented with a template.\n   * This callback does not fire when a Show Offer card is used in Composer, it is fired only for the Show Template card.\n   *\n   * @param {object} templateParameters\n   */\n  onShowTemplate(templateParameters) {\n    console.log('EVENT: showTemplate', templateParameters);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_action_showtemplate',\n      'piano',\n      'showTemplate',\n      templateParameters.experienceExecutionId,\n      templateParameters.templateId,\n      templateParameters.offerId\n    );\n\n    applyArticlePaywallStyles(templateParameters, '.PremiumContent');\n\n    if (templateParameters.containerSelector === '.bottomOfferTargetContainer') {\n      window.addEventListener('message', this.handleMessageEventForBottomOfferTargetContainer);\n      window.addEventListener('resize', this.handleResizeForBottomOfferTargetContainer);\n    }\n  }\n\n  /**\n   * The showOffer event fires when a user is presented with an offer.\n   * This callback does not fire when a Show Template card is used in Composer, it is fired only for the Show Offer card.\n   *\n   * @param {object} offerParameters\n   */\n  onShowOffer(offerParameters) {\n    console.log('EVENT: showOffer', offerParameters);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_action_showoffer',\n      'piano',\n      'showOffer',\n      offerParameters.experienceId,\n      offerParameters.templateId,\n      offerParameters.offerId\n    );\n\n    // CR - Adjust Styles when offer is displayed on top of an article (if #BaseText element is available)\n    // TODO: refactor check for correct restrictor, don't call this function if not needed\n    applyArticlePaywallStyles(offerParameters, '.PremiumContent');\n  }\n\n  /**\n   * The loginRequired event fires when a user is not logged in and attempts to start checkout.\n   * If you're using Piano ID or Gigya for user management, you don't need to worry about the loginRequired callback\n   * (your user management system will trigger login automatically when you use Piano's login() method in an offer template).\n   * For all other user management providers, you will need to implement this callback to redirect the user to your login/registration page or to display your login/registration modal.\n   * Once the user is logged in, checkout can continue.\n   *\n   * @param {object} event\n   * @returns {boolean}\n   */\n  onLoginRequired(event) {\n    console.dir('onLoginRequired:');\n    console.dir(event);\n    // TODO: benötigt oder nur bei Piano ID!?\n    // CR: hat nichts mit Piano ID zutun. Siehe: https://docs.piano.io/user-management-integration/#alluserref\n\n    // TODO: this really needs to be redone - onLoginRequired should trigger the registration. currently it's more or less the other way around\n    if (globalThis.tp.user.isUserValid()) {\n      console.log('valid user: true');\n      globalThis.tp.offer.startCheckout(event);\n    }\n\n    // return false - because the piano docs say so\n    // https://docs.piano.io/user-management-integration/#userrefmodal\n    return false;\n  }\n\n  /**\n   * Callback executed after an experience executed successfully.\n   * The experienceExecute event fires when an experience fires for a user pageview.\n   *\n   * @param {object} event\n   */\n  onExperienceExecute(event) {\n    console.log('EVENT: experienceExecute', event);\n\n    if (event.user && event.user.uid !== 'anon') {\n      this.tp.push(['setCustomVariable', 'strGuid', event.user.uid]);\n      // 20200528, SB: Test:push GUID to CP-object\n      CleverPush.push(['setAttribute', 'user_id', event.user.uid]);\n    }\n\n    snowPlow(\n      'trackStructEvent',\n      'piano',\n      'experienceExecute',\n      event.offerId,\n      event.templateId,\n      event.experienceExecutionId\n    );\n  }\n\n  /**\n   * Callback executed if external checkout has been completed successfully\n   *\n   * @param {object} event\n   */\n  onExternalCheckoutComplete(event) {\n    console.dir('onExternalCheckoutComplete:');\n    console.dir(event);\n\n    /* Default behavior is to refresh the page on successful checkout */\n    location.reload();\n  }\n\n  /**\n   * The checkoutComplete event fires when the conversion process has completed.\n   * Clients often use this event in order to redirect a user after checkout.\n   *\n   * @param {object} conversion\n   */\n  onCheckoutComplete(conversion) {\n    console.log('EVENT: checkoutComplete', conversion);\n\n    try {\n      snowPlow(\n        'trackStructEvent',\n        'piano_checkout_complete',\n        'piano',\n        'checkoutComplete',\n        conversion.uid,\n        conversion.termId,\n        conversion.chargeAmount\n      );\n\n      snowPlowDriveSubscriptionEvents(\n        'trackSelfDescribingEvent',\n        'conversion',\n        'thankyou-modal',\n        conversion.termId,\n        conversion.chargeAmount,\n        'null'\n      );\n\n      if (this.config.fb && this.config.fb.pixelId && globalThis.fbq) {\n        globalThis.fbq('track', 'Purchase', { value: conversion.chargeAmount, currency: conversion.chargeCurrency });\n      }\n\n      new PreservedParameterTracker().trackMarketingEventConversion(conversion);\n\n      let tp = window['tp'] || [];\n      tp.template.close();\n      tp.push(\n        ['setCustomVariable', 'userState', 'RegisteredEmailNotConfirmed'],\n        ['setCustomVariable', 'showCheckout', 2]\n      );\n      tp.experience.execute();\n    } catch (error) {\n      console.dir(error);\n    }\n  }\n\n  /**\n   * The checkoutClose event fires when the modal/lightbox closes.\n   * Because the event object includes information about whether or not a purchase occurred before the modal closed,\n   * you could hook onto the checkoutClose event to present the user with an abandonment prevention offer.\n   *\n   * @param {object} event\n   */\n  onCheckoutClose(event) {\n    console.log('onCheckoutClose:');\n    console.dir(event);\n\n    snowPlow(\n      'trackStructEvent',\n      'piano_checkout_close',\n      'piano',\n      'checkoutClose',\n      event.uid,\n      event.termId,\n      event.chargeAmount\n    );\n\n    /* Default behavior is to refresh the page on successful checkout */\n    if (event && (event.state === 'checkoutCompleted' || event.state === 'alreadyHasAccess')) {\n      let regex = /verlag\\/abo-digital/i;\n      if (regex.test(globalThis.location.pathname)) {\n        globalThis.location.href = globalThis.location.origin;\n      } else {\n        // CR 20191219: in case of directcheckout not on p.o.-page try\n        // to rerun the experiences instead of reloading the whole page\n        let ltp = window['tp'];\n        if (\n          ltp.customVariables &&\n          ltp.customVariables.showCheckout &&\n          (ltp.customVariables.showCheckout === 1 || ltp.customVariables.showCheckout === '1')\n        ) {\n          ltp.push(\n            ['setCustomVariable', 'userState', 'RegisteredEmailNotConfirmed'],\n            ['setCustomVariable', 'showCheckout', 0]\n          );\n\n          ltp.experience.execute();\n        } else {\n          location.reload();\n        }\n      }\n    }\n  }\n\n  /**\n   * On Checkout Cancel.\n   *\n   * @param {object} event\n   * @param {any} arguments_\n   */\n  onCheckoutCancel(event, ...arguments_) {\n    console.log('onCheckoutCancel:');\n    console.dir(event);\n\n    snowPlow('trackStructEvent', 'piano_checkout_cancel', 'piano', 'checkoutCancel', ...arguments_);\n  }\n\n  /**\n   * Callback on Meter Active.\n   * The meterActive event fires when user is being metered but the meter limit has not yet been reached.\n   *\n   * @param {object} meterData\n   */\n  onMeterActive(meterData) {\n    snowPlow(\n      'trackStructEvent',\n      'piano_meter',\n      'piano',\n      'meterActive',\n      meterData.meterName,\n      meterData.maxViews,\n      meterData.views\n    );\n  }\n\n  /**\n   * Callback when meter expires.\n   * The meterExpired event fires when a user has reached the allowed number of views.\n   *\n   * @param {object} meterData\n   */\n  onMeterExpired(meterData) {\n    snowPlow(\n      'trackStructEvent',\n      'piano',\n      'meterExpired',\n      meterData.meterName,\n      meterData.maxViews,\n      meterData.totalViews\n    );\n  }\n\n  /**\n   * The Custom Event\n   *\n   * @param {object} event\n   */\n  onCustomEvent(event) {\n    console.dir('customEvent:' + event.eventName);\n    console.dir(event);\n\n    // nps cookie vars\n    // TODO: refactor\n    const cookies = new Cookies();\n    const cName = '_pc_didNPS';\n    const cMaxValue = 2; // FIXME TODO!! SB: Why? This needs an explanation!\n    const cValue = Number(cookies.get(cName) || 0);\n    // TODO maybe use some kind of fixed date? next quarter?\n    // if we establish a fixed period we wouldn't need to manually\n    // turn it on and off\n    // 20191216, SB: I actually did that in my version - but nevertheless would I prefer\n    //    to turn it of manually, too. When the cookie is blocked/deleted, the reader\n    //    might not bee too happy with beeing asked over and over again!\n    const cookieExpiry = 1000 * 60 * 60 * 24 * 30 * 4; //ms\n\n    switch (event.eventName) {\n      case 'schnellregistrierung': {\n        console.warn('Deprecated: Support for usage of external-events for registration will soon be removed');\n\n        let addterm =\n          event.params.addterm !== undefined && event.params.addterm.length > 0 ? event.params.addterm : undefined;\n        // Parameter parsen und iframeID erfassen:\n        let parameters = JSON.parse(event.params.params);\n        let iframeId = parameters.iframeId;\n        let validate = event.params.validate ? JSON.parse(decodeURIComponent(event.params.validate)) : undefined;\n        let personalRegData = this.registration.getPersonalRegData(event);\n\n        this.registration.register(iframeId, personalRegData, addterm, validate);\n        break;\n      }\n\n      case 'offer-scrollToTop': {\n        window.scrollTo(0, 0);\n        break;\n      }\n\n      case 'offer-cta-login': {\n        // But why address? is this required?\n        globalThis.location.href =\n          globalThis.location.origin +\n          '/login/?redirect_to=' +\n          encodeURIComponent(globalThis.location.pathname + globalThis.location.search);\n        break;\n      }\n\n      case 'topbar-offer-close':\n      case 'offertopbar-close': {\n        let topBarTargetContainer = document.querySelector('.topOfferTargetContainer');\n        if (topBarTargetContainer) {\n          removeElement(topBarTargetContainer);\n        }\n        break;\n      }\n\n      case 'offer-goToUrl': {\n        if (event.params.url) {\n          globalThis.location.href = event.params.url;\n        }\n        break;\n      }\n\n      case 'nps-abort':\n      case 'nps-cancel': {\n        // handle nps events and set or update cookies\n        if (!Number.isNaN(cValue)) {\n          if (cValue < cMaxValue) {\n            cookies.set(cName, cValue + 1, {\n              expires: new Date(Date.now() + cookieExpiry),\n              path: '/',\n            });\n          } else {\n            cookies.set(cName, cMaxValue, {\n              expires: new Date(Date.now() + cookieExpiry),\n              path: '/',\n            });\n          }\n        }\n        break;\n      }\n\n      case 'nps-done':\n      case 'nps-submit': {\n        cookies.set(cName, cMaxValue, {\n          expires: new Date(Date.now() + cookieExpiry),\n          path: '/',\n        });\n        break;\n      }\n\n      case 'paywallTermSelected':\n      case 'lp-cta-1':\n      case 'lp-cta-2':\n      case 'lp-cta-3': {\n        if (event.params && event.params.term && event.params.offer) {\n          console.log('paywallTermSelected - data:', event.params);\n          let {\n            term: termDataString,\n            offer: offerId,\n            checkouttemplate: checkoutTemplateId,\n            termindex: termIndex = -1,\n            params: parametersDataString,\n          } = event.params;\n          let parameters = {};\n\n          if (parametersDataString) {\n            parameters = JSON.parse(parametersDataString);\n          }\n\n          let iframeId = null;\n          let termData = {};\n\n          if (parameters.iframeId) {\n            iframeId = parameters.iframeId;\n          }\n\n          try {\n            let fullTermData = JSON.parse(termDataString);\n            termData = {\n              name: fullTermData.name,\n              termId: fullTermData.termId,\n              description: fullTermData.description,\n              firstRealPrice: fullTermData.firstRealPrice,\n              firstPeriod: fullTermData.firstPeriod,\n              hasFreeTrial: fullTermData.hasFreeTrial,\n            };\n          } catch (error) {\n            console.error(error);\n          }\n\n          globalThis.tp.push(['setCustomVariable', 'term', termData], ['setCustomVariable', 'offerId', offerId]);\n          console.log('!!! setting originIframeId:', iframeId);\n          globalThis.tp.push(\n            ['setCustomVariable', 'originIframeId', iframeId],\n            ['setCustomVariable', 'termIndex', termIndex]\n          );\n\n          try {\n            snowPlowDriveSubscriptionEvents(\n              'trackSelfDescribingEvent',\n              'funnel-entry',\n              event.eventName === 'paywallTermSelected' ? 'paywall' : 'landingpage',\n              termData.termId,\n              termData.firstRealPrice,\n              'null'\n            );\n          } catch (error) {\n            console.error(error);\n          }\n\n          globalThis.tp.template.show({\n            templateId: checkoutTemplateId,\n            displayMode: 'modal',\n            loginRequired: function () {\n              console.log('login Required');\n            },\n            close: function () {\n              console.log('close');\n            },\n            complete: function (parameters) {\n              console.log('complete, with params:');\n              console.log(parameters);\n            },\n            customEvent: function (parameters) {\n              console.log('custom Event(?), with params:');\n              console.log(parameters);\n            },\n          });\n        }\n        break;\n      }\n\n      case 'goToLogin': {\n        console.log('loginparams:', event.params.loginparams);\n        let loginBaseUrl = globalThis.location.origin;\n\n        if (/amp-subscribe/.test(globalThis.location.pathname)) {\n          let p = new URLSearchParams(globalThis.location.search);\n          loginBaseUrl += '/amp-login/?';\n\n          if (p.get('reader_id')) {\n            loginBaseUrl += 'reader_id=' + p.get('reader_id') + '&';\n          }\n          loginBaseUrl += 'ampLoginRedirect=';\n        } else {\n          loginBaseUrl += '/login/?redirect_to=';\n        }\n\n        if (event.params && event.params.loginparams) {\n          //super hack..\n          console.log('%c -----------[LOGIN]-------------', 'background: #FF6442; color: #000000');\n          console.log('%c continue here after login:', 'background: #FF6442; color: #000000');\n          console.log(\n            '%c' +\n              globalThis.location.origin +\n              globalThis.location.pathname +\n              '?' +\n              event.params.loginparams +\n              (globalThis.location.search ? '&' + globalThis.location.search.slice(1) : ''),\n            'background: #FF6442; color: #000000'\n          );\n          console.log('%c-------------------------------', 'background: #FF6442; color: #000000');\n          globalThis.location.href =\n            loginBaseUrl +\n            encodeURIComponent(globalThis.location.pathname + '?' + event.params.loginparams) +\n            (globalThis.location.search ? encodeURIComponent('&' + globalThis.location.search.slice(1)) : '');\n        } else {\n          globalThis.location.href =\n            loginBaseUrl + encodeURIComponent(globalThis.location.pathname) + globalThis.location.search;\n        }\n        break;\n      }\n\n      // CR 20200709 - allows us to set custom variables via external-event directives in templates\n      case 'setCustomVariable': {\n        console.log('setCustomVariable:', event.params.customVarKey, event.params.customVarValue);\n        if (event.params && event.params.customVarKey && event.params.customVarValue) {\n          let tp = globalThis.tp || [];\n          if (!tp.custom.customVarKey || event.params.customVarForce === 'true') {\n            tp.push(['setCustomVariable', event.params.customVarKey, event.params.customVarValue]);\n          } else {\n            console.error(\n              `customVariable with name ${event.params.customVarKey} already exists, use customVarForce if required`\n            );\n          }\n        }\n        break;\n      }\n\n      default: {\n        console.log('unprocessed external-event directive');\n        break;\n      }\n    }\n  }\n\n  /* \"Private\" Functions */\n\n  /**\n   * Handle the Message Event for the Bottom Offer Target Container\n   *\n   * @param {object} messageEvent\n   */\n  handleMessageEventForBottomOfferTargetContainer(messageEvent) {\n    console.log('handleMessageEventForBottomOfferTargetContainer(messageEvent)', messageEvent);\n\n    if (typeof messageEvent.data === 'string' && new RegExp('.*resize.*').test(messageEvent.data)) {\n      // Here is this an unknown function call.\n      new Piano().handleResizeForBottomOfferTargetContainer();\n    }\n  }\n\n  /**\n   * Handle Resize for the Bottom Offer Target Container\n   */\n  handleResizeForBottomOfferTargetContainer() {\n    console.log('handleResizeForBottomOfferTargetContainer()');\n\n    const breakPointBottomOfferTargetContainerFullWidth = 1200;\n    const cmpBoxElement = document.querySelector('#cmpboxrecall');\n    const cleverPushBell = document.querySelector('.cleverpush-bell');\n\n    if (window.innerWidth < breakPointBottomOfferTargetContainerFullWidth) {\n      let bottomExclusionArea = document.querySelector('.bottomOfferTargetContainer').getBoundingClientRect().height;\n\n      if (cmpBoxElement) cmpBoxElement.style.bottom = bottomExclusionArea + 10 + 'px';\n      if (cleverPushBell) cleverPushBell.style.bottom = bottomExclusionArea + 20 + 'px';\n    } else {\n      if (cmpBoxElement) cmpBoxElement.style.bottom = '';\n      if (cleverPushBell) cleverPushBell.style.bottom = '';\n    }\n  }\n}\n","export const debug = {\n  /**\n   * The  callback can be used to track custom events within the checkout process.\n   * When editing your offer templates, any element with the external-event directive will trigger a custom event.\n   * Custom events are typically triggered on click. Since, as the name implies, custom events are customizable,\n   * you can use them for whatever purpose you want and create as many custom events as you need.\n   *\n   *  @param {object} event\n   */\n  onCheckoutCustomEvent: function (event) {\n    console.log('onCheckoutCustomEvent:');\n    console.dir(event);\n\n    /* a sample snippet\n    switch (event.eventName) {\n      case 'login': {\n        // Do stuff here!\n        break;\n      }\n    }*/\n  },\n\n  /**\n   * Callback executed after a tinypassAccounts login.\n   * The loginSuccess event fires when a user completes the login process using Piano ID.\n   *\n   * @param {object} data\n   */\n  onLoginSuccess: function (data) {\n    console.dir('onLoginSuccess:');\n    console.dir(data);\n  },\n\n  /**\n   * Callback executed if experience execution has been failed.\n   *\n   * @param {object} event\n   */\n  onExperienceExecutionFailed: function (event) {\n    console.dir('onExperienceExecutionFailed:');\n    console.dir(event);\n  },\n\n  /**\n   * The checkoutError event fires if a terminal error occurs during the checkout.\n   * For example, when the offerId or aid is invalid or the offer is empty and doesn't contain any terms.\n   *\n   * @param {object} errorData\n   */\n  onCheckoutError: function (errorData) {\n    console.dir('onCheckoutError:');\n    console.dir(errorData);\n  },\n};\n","import { config as gconfig } from './config.js';\nimport { spForce } from './SnowPlow/sp.js';\nimport { Piano } from './callbacks/piano.js';\nimport { Registration } from './callbacks/registration.js';\nimport { debug } from './callbacks/debug.js';\nimport Cookies from 'universal-cookie';\n\n// SETUP / GLOBAL VARS\nconst config = gconfig.portals[window['portal']];\nconst TP_AID = config.tp.aid;\nconst SP_APPID = config.sp.appId;\nconst FB_PXLID = config.fb ? config.fb.pixelId : undefined;\nconst TP_API_EP = 'https://' + config.tp.baseUrl + '/api/v3';\nconst TP_SCRIPT = '//' + config.tp.baseUrl + '/api/tinypass.min.js';\nconst CXENSE_SITEID = config.cxense.siteId;\n\nconst piano = new Piano();\nconst registration = new Registration(config);\n\n// 20190903, SB: Cookiebot auf Infoscreens beenden:\nif (\n  new RegExp('/(verlag/infoscreendo|verlag/infoscreencr|verlag/infoscreen-ohne-rn|verlag/infoscreen-small)', 'i').test(\n    location.pathname\n  )\n) {\n  const cmp = window['__cmp'];\n  const Cookiebot = globalThis.Cookiebot;\n  if (cmp) {\n    cmp('close');\n  }\n\n  if (Cookiebot) {\n    Cookiebot.hide();\n  }\n}\n\n// 20170718, SB: Cleverpush auf Infoscreens ausblenden:\nglobalThis.cleverPushConfig = {\n  showNotificationBell: !new RegExp(\n    '/(verlag/)?(infoscreen(do|cr|-ohne-rn|-small)|googleamp(login|register|subscription)|amp-(login(-success)?|subscriptions|subscribe))',\n    'i'\n  ).test(location.pathname),\n};\n\nif (FB_PXLID && globalThis.fbq) {\n  globalThis.fbq('trackSingleCustom', FB_PXLID, 'CustomPageView');\n}\n\n// Piano callbacks\n(function () {\n  const tp = window['tp'] || [];\n\n  // CR - 04.07.2019: Try to add UserAgent as Custom Variable\n  if (globalThis.navigator && globalThis.navigator.userAgent) {\n    if (\n      globalThis.navigator.userAgent ===\n        'Mozilla/5.0 (compatible; EchoboxBot/1.0; hash/w4mwnpbXf3MFAbxOkJRw; +[http://www.echobox.com](http://www.echobox.com/))' ||\n      globalThis.navigator.userAgent.toLowerCase().includes('publication-access-for-facebook')\n    ) {\n      tp.push(['setCustomVariable', 'userAgent', 'EchoboxBot'], ['setCustomVariable', 'knownBot', 'true']);\n    }\n\n    if (globalThis.navigator.userAgent.toLowerCase().includes('cxensebot')) {\n      const cmp = window['__cmp'];\n      if (cmp) {\n        cmp('close');\n      }\n    }\n  }\n  // CR - 04.07.2019 END\n\n  // CR - 17.04.2020: Write sT & sO url params (selectedTerm/Offer) into custom variables\n  // this was introduced due to the new TBO checkout flow, which requires us to start a checkout\n  // right after the user comes back from the FI login pages\n  // we've modified the following getParameterByName to search for the param case insensitive\n  // as we can't 100% certainly tell what FI does with the URLs\n  function getParameterByName(name, url?) {\n    if (!url) url = globalThis.location.href;\n    name = name.replaceAll(/[[\\]]/g, String.raw`\\$&`);\n    const regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'),\n      results = regex.exec(url);\n    if (!results) return null;\n    if (!results[2]) return '';\n    return decodeURIComponent(results[2].replaceAll('+', ' '));\n  }\n\n  if (globalThis.location.search) {\n    // Set custom Vars needed for checkout init after Login\n    const sT = getParameterByName('sT');\n    const sO = getParameterByName('sO');\n    const sTindex = getParameterByName('sTindex');\n    // TODO: remove when completely migrated to new checkout flow (Conversion FIX)\n    if (sT && sO) {\n      tp.push(\n        ['setCustomVariable', 'startCheckoutTerm', sT.toUpperCase()],\n        ['setCustomVariable', 'startCheckoutOffer', sO.toUpperCase()],\n        ['setCustomVariable', 'startCheckoutTBO', 1]\n      );\n    }\n\n    if (sTindex) {\n      tp.push(['setCustomVariable', 'termIndex', sTindex], ['setCustomVariable', 'startCheckoutTBO', 1]);\n    }\n  }\n  // CR - 17.04.2020 END\n\n  // CR - Read strRegisterData on Product Offer Page (~if pathname eq. /verlag/abo-digital\n  // 20190402, SB: PATTERN MATCHING!!!\n  const regex = /verlag\\/(abo-digital)|(bvb-digital)|(googleampregister)/i;\n  if (regex.test(globalThis.location.pathname)) {\n    const regData: HTMLDataElement = document.querySelector('#strRegisterData');\n    if (regData) {\n      tp.push(['setCustomVariable', 'Register', regData.value]);\n    }\n  }\n\n  // TP SETUP:\n  tp.push(['setAid', TP_AID], ['setEndpoint', TP_API_EP]);\n  if (CXENSE_SITEID) {\n    tp.push(['setCxenseSiteId', CXENSE_SITEID]);\n  }\n  tp.push(\n    ['setUseTinypassAccounts', false],\n    ['addHandler', 'checkoutComplete', piano.onCheckoutComplete.bind(piano)],\n    ['addHandler', 'checkoutClose', piano.onCheckoutClose],\n    ['addHandler', 'checkoutCustomEvent', debug.onCheckoutCustomEvent],\n    ['addHandler', 'checkoutCancel', piano.onCheckoutCancel],\n    ['addHandler', 'checkoutError', debug.onCheckoutError],\n    ['addHandler', 'startCheckout', piano.onStartCheckout.bind(piano)],\n    ['addHandler', 'checkoutStateChange', piano.onCheckoutStateChange],\n    ['addHandler', 'checkoutSelectTerm', piano.onCheckoutSelectTerm],\n    ['addHandler', 'loginRequired', piano.onLoginRequired],\n    ['addHandler', 'loginSuccess', debug.onLoginSuccess],\n    ['addHandler', 'meterExpired', piano.onMeterExpired],\n    ['addHandler', 'meterActive', piano.onMeterActive],\n    ['addHandler', 'experienceExecute', piano.onExperienceExecute.bind(piano)],\n    ['addHandler', 'experienceExecutionFailed', debug.onExperienceExecutionFailed],\n    ['addHandler', 'externalCheckoutComplete', piano.onExternalCheckoutComplete],\n    ['addHandler', 'showOffer', piano.onShowOffer],\n    ['addHandler', 'showTemplate', piano.onShowTemplate.bind(piano)],\n    ['addHandler', 'customEvent', piano.onCustomEvent.bind(piano)],\n    ['init', piano.initExperience.bind(piano)]\n  );\n\n  window['tp'] = tp;\n})();\n\n// do not change this section\n// |BEGIN INCLUDE TINYPASS JS|\n(function (source) {\n  const a = document.createElement('script');\n  a.type = 'text/javascript';\n  a.async = true;\n  a.src = source;\n  const b = document.querySelectorAll('script')[0];\n  b.parentNode.insertBefore(a, b);\n})(TP_SCRIPT);\n// |END   INCLUDE TINYPASS JS|\n\n// Scripts for communication between frames\n\n/**\n * Write custom-vars to cookies\n *\n * @param {string} name\n * @param {*} value\n */\nfunction pianoSetCustomVariableCookie(name, value) {\n  // hole alle existierenden Werte aus Cookie\n  const cookieValue = pianoReadCustomVariableCookie();\n  cookieValue[name] = value;\n\n  // expiration in 3 years\n  const d = new Date();\n  d.setTime(d.getTime() + 94_608_000_000);\n  const expires = 'expires=' + d.toUTCString();\n\n  // schreibe Keks!\n  globalThis.cookie = '__pcvc=' + JSON.stringify(cookieValue) + ';' + expires + ';path=/';\n}\n\n/**\n * Read custom-vars from cookies\n *\n * @param {string} specificName\n * @returns {{}|*|null}\n */\nfunction pianoReadCustomVariableCookie(specificName?) {\n  let cookieValue;\n  try {\n    // Alle Cookies mit _pcvc erfassen\n    const match = document.cookie.match(new RegExp('(^| )__pcvc=([^;]+)'));\n    // Wenn gefunden, versuche zu parsen\n    if (match) {\n      cookieValue = JSON.parse(match[2]);\n    }\n  } catch {\n    cookieValue = {};\n  }\n  if (!cookieValue) {\n    cookieValue = {};\n  }\n  if (specificName !== undefined) {\n    // gewünschten Wert zurückgeben\n    if (cookieValue[specificName] !== undefined) {\n      return cookieValue[specificName];\n    }\n    return null;\n  }\n  return cookieValue;\n}\n\n// ALLE \"CV-COOKIES\" zu customVars!\nconst cookieValues = pianoReadCustomVariableCookie();\nconst tp = globalThis.tp || [];\nfor (const index in cookieValues) {\n  tp.push(['setCustomVariable', index, cookieValues[index]]);\n}\n\n//CR 2020-04-03 implemented to log buttonclicks via a logic app\nfunction laLog(name, payload) {\n  const xhr = new XMLHttpRequest();\n  const body = { name: name, payload: payload };\n\n  xhr.open(\n    'POST',\n    'https://prod-40.westeurope.logic.azure.com:443/workflows/60832338fb6d46acad3b4e1fce682376/triggers/request/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Frequest%2Frun&sv=1.0&sig=G-vretkv71d3KPEMtsrpxqCNwdA1Z_-0gOmvaEI7OZg',\n    true\n  );\n  xhr.setRequestHeader('Content-type', 'application/json');\n  xhr.addEventListener('load', () => {\n    console.info('log transmitted successfully');\n  });\n  xhr.onerror = () => {\n    console.info('log transmission failed');\n  };\n\n  xhr.send(JSON.stringify(body));\n}\n\n/**\n * Set Piano Cookie\n *\n * @param {object} event\n */\nfunction setPianoCookie(event) {\n  const {\n    pianoCookieName,\n    pianoCookieValue,\n    pianoCookieExpires = '0',\n    pianoCookieCustomVar: pianoCookieCustomVariable = 'false',\n    pianoExperienceExecute = 'false',\n  } = event.data.payload;\n\n  const expires = new Date();\n  expires.setTime(expires.getTime() + Number.parseInt(pianoCookieExpires));\n\n  if (pianoCookieCustomVariable) {\n    pianoSetCustomVariableCookie(pianoCookieName, pianoCookieValue);\n    const tp = globalThis.tp || [];\n    tp.push(['setCustomVariable', pianoCookieName, pianoCookieValue]);\n  } else {\n    const cookies = new Cookies();\n    cookies.set('_pc_' + pianoCookieName, pianoCookieValue, { expires: expires, path: '/' });\n  }\n\n  if (pianoExperienceExecute === 'true') {\n    globalThis.tp.experience.execute();\n  }\n}\n\n/**\n * Log message to console\n *\n * @param {Object} event - The event object.\n */\nfunction logMessage(event: object) {\n  const allowedOrigins =\n    /https?:\\/\\/(((www|test|nextgen)\\.(ruhrnachrichten|(halterner|dorstener|muensterland)zeitung|hellwegeranzeiger).de)|(sandbox|api)\\.tinypass\\.com)/i;\n  if (event.origin && allowedOrigins.test(event.origin)) {\n    console.log('EB Received (post)Message-Event:', event);\n  }\n}\n\n// RECEIVE MESSAGES I.E. FROM MY ACCOUNT WINDOW\nwindow.addEventListener('message', (event) => {\n  logMessage(event);\n\n  if (event.data.type) {\n    switch (event.data.type) {\n      case 'registration': {\n        registration.registrationEvent(event);\n        break;\n      }\n      case 'standaloneRegistration': {\n        const iframeId = event.data.iframeId;\n        if (iframeId !== undefined) {\n          registration.standaloneRegistrationEvent(event, iframeId);\n        }\n        break;\n      }\n      case 'setPianoCookie': {\n        setPianoCookie(event);\n        break;\n      }\n      case 'cancellation': {\n        console.log('received cancellation message:', event.data.payload);\n        const { formArray, iframeId, actionButton } = event.data.payload;\n        const formData = formArray.reduce(function (accumulator, current) {\n          if (current.formItem) {\n            return { ...accumulator, [current.formPart + '-' + current.formItem]: current.formItemState };\n          }\n          if (current.freeTextItem) {\n            return { ...accumulator, [current.freeTextItem]: current.freeTextValue };\n          }\n          return accumulator;\n        }, {});\n        formData.cancellationExecuted = actionButton !== 'btn-submit-cancellation-keepSubscription';\n        formData.portal = globalThis.location.host;\n        const tp = globalThis.tp || [];\n        formData.uidGuid = tp.customVariables.uidGUID;\n        formData.termId = tp.customVariables.cancellationItemId;\n        formData.termName = tp.customVariables.cancellationItemName;\n        // close cancellation modal\n        tp.template.close(iframeId);\n\n        // try to resolve myAccount iframe id\n        const iframe = document.querySelector('.WcmsContentHeader>iframe');\n\n        if (!iframe) {\n          console.log('no iframe found at .WcmsContentHeader>iframe');\n        }\n\n        const myAccountIframeId = iframe.id;\n\n        // I love repeating myself\n        // transmit data to azure logic apps and Excel sheet :S\n        const xhr = new XMLHttpRequest();\n        const body = { payload: formData };\n\n        xhr.open(\n          'POST',\n          'https://prod-127.westeurope.logic.azure.com:443/workflows/774dbe1929cd4e319796326bda1d485b/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Ts1whLaDYo7QfCXRsLtBuCS7jr2ZOJcOWtAHip444S8',\n          true\n        );\n        xhr.setRequestHeader('Content-type', 'application/json');\n        xhr.addEventListener('load', () => {\n          console.info('log transmitted successfully');\n        });\n        xhr.onerror = () => {\n          console.info('log transmission failed');\n        };\n\n        xhr.send(JSON.stringify(body));\n\n        // send success to iframe\n        if (actionButton === 'btn-submit-cancellation-keepSubscription') {\n          registration.sendPostMessageToPiano(myAccountIframeId, true, 'keepSubscription', {\n            itemIndex: tp.customVariables.cancellationItemIndex || 0,\n          });\n        } else {\n          registration.sendPostMessageToPiano(myAccountIframeId, true, 'executeCancellation', {\n            itemIndex: tp.customVariables.cancellationItemIndex || 0,\n          });\n        }\n\n        break;\n      }\n      case 'init-cancellation': {\n        const tp = globalThis.tp || [];\n        console.info('received message: init-cancellation');\n        tp.push(\n          ['setCustomVariable', 'showCancellationModal', '1'],\n          ['setCustomVariable', 'cancellationItemIndex', event.data.payload.itemIndex],\n          ['setCustomVariable', 'cancellationItemId', event.data.payload.itemId],\n          ['setCustomVariable', 'cancellationItemName', event.data.payload.itemName]\n        );\n        tp.experience.execute();\n\n        break;\n      }\n      default: {\n        console.log(`unhandled event type: ${event.data.type}`);\n      }\n    }\n  } else {\n    const { data: message } = event;\n\n    switch (message) {\n      case 'cancel-renewal': {\n        console.info('received message: cancel-renewal');\n        spForce('trackStructEvent', 'piano', 'cancel-renewal', SP_APPID);\n        laLog('cancel-renewal', { SP_APPID });\n        break;\n      }\n      case 'reactivate-renewal': {\n        console.info('received message: reactivate-renewal');\n        spForce('trackStructEvent', 'piano', 'reactivate-renewal', SP_APPID);\n        laLog('reactivate-renewal', { SP_APPID });\n        break;\n      }\n      case 'goToLogin': {\n        // quick hack\n        globalThis.location.href =\n          globalThis.location.origin +\n          '/login/?redirect_to=' +\n          encodeURIComponent(globalThis.location.pathname) +\n          globalThis.location.search;\n        break;\n      }\n    }\n  }\n});\n"],"names":["config","removeElement","element","getCookie","cname","name","ca","c","uuidv4","version","VERSION","_hasBuffer","_TD","_TE","b64chs","b64tab","a","tab","i","b64re","_fromCC","_U8Afrom","it","_mkUriSafe","src","m0","_tidyB64","btoaPolyfill","bin","u32","c0","c1","c2","asc","pad","_btoa","_fromUint8Array","u8a","strs","l","fromUint8Array","urlsafe","cb_utob","cc","re_utob","utob","u","_encode","encode","encodeURI","re_btou","cb_btou","cccc","cp","offset","btou","b","atobPolyfill","u24","r1","r2","_atob","_toUint8Array","toUint8Array","_unURI","_decode","decode","isValid","s","_noEnum","v","extendString","_add","body","extendUint8Array","gBase64","sp","function_","identifier","category","action","label","property","arguments_","spDriveSubscriptionEvents","product","price","payment_method","snowplow","spForce","gconfig","xhr","eventData","snowPlowPayload","Base64","getPremiumContentType","applyArticlePaywallStyles","event","constraint","selectedElements","index","currentElement","targetElement","event_","textElement","gradient","cookie","hasRequiredCookie","requireCookie","parse","serialize","__toString","__hasOwnProperty","cookieNameRegExp","cookieValueRegExp","domainValueRegExp","pathValueRegExp","str","opt","obj","len","dec","eqIdx","endIdx","keyStartIdx","startIndex","keyEndIdx","endIndex","key","valStartIdx","valEndIdx","val","tryDecode","max","code","min","enc","value","maxAge","expires","isDate","priority","sameSite","cookieExports","hasDocumentCookie","testingValue","parseCookies","cookies","readCookie","options","cleanValue","cleanupCookieValue","Cookies","defaultSetOptions","previousCookies","domCookies","params","result","stringValue","finalOptions","callback","idx","Validation","__publicField","formData","response","email","emailValidate","stringData","firstPassword","secondPassword","id","message","PreservedParameterTracker","mainConfig","Registration","existingParameters","parameter","uuid","promotional","dataToTrack","conversionEvent","existingCustomer","termsAndConditions","consents","url","data","requestOptions","error","fields","formArray","iframeId","regData","field","personalRegData","snowPlow","errorMessage","data_json","ump_json","success","messageType","iframe","registration","tp","ampCustomVariables","regex","searchResult","match","messageEvent","formJson","errorMessages","Piano","termDetails","templateParameters","offerParameters","conversion","snowPlowDriveSubscriptionEvents","ltp","meterData","cName","cMaxValue","cValue","cookieExpiry","addterm","validate","topBarTargetContainer","termDataString","offerId","checkoutTemplateId","termIndex","parametersDataString","parameters","termData","fullTermData","loginBaseUrl","p","breakPointBottomOfferTargetContainerFullWidth","cmpBoxElement","cleverPushBell","bottomExclusionArea","debug","errorData","TP_AID","SP_APPID","FB_PXLID","TP_API_EP","TP_SCRIPT","CXENSE_SITEID","piano","cmp","Cookiebot","getParameterByName","results","sT","sO","sTindex","source","pianoSetCustomVariableCookie","cookieValue","pianoReadCustomVariableCookie","d","specificName","cookieValues","laLog","payload","setPianoCookie","pianoCookieName","pianoCookieValue","pianoCookieExpires","pianoCookieCustomVariable","pianoExperienceExecute","logMessage","allowedOrigins","actionButton","accumulator","current","myAccountIframeId"],"mappings":"mQAAO,MAAMA,EAAS,CACpB,QAAS,CAGP,gBAAiB,CACf,GAAI,CAAE,IAAK,aAAc,QAAS,kBAAoB,EACtD,OAAQ,CAAE,OAAQ,qBAAuB,EACzC,GAAI,CACF,MAAO,aACR,EACD,KAAM,CACJ,MAAO,6BACP,SAAU,mEACX,EACD,GAAI,CAAE,QAAS,kBAAoB,EACnC,UAAW,CACT,aAAc,+CACd,qBAAsB,kEACtB,mBAAoB,+DACrB,CACF,EAED,gBAAiB,CACf,GAAI,CAAE,IAAK,aAAc,QAAS,kBAAoB,EACtD,OAAQ,CAAE,OAAQ,qBAAuB,EACzC,GAAI,CACF,MAAO,aACR,EACD,KAAM,CACJ,MAAO,+BACP,SAAU,qEACX,EACD,GAAI,CAAE,QAAS,kBAAoB,EACnC,UAAW,CACT,aAAc,+CACd,qBAAsB,kEACtB,mBAAoB,+DACrB,CACF,EACD,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