/*! @version: ad237d6 */ "use strict";(self.webpackChunk_spark_front_templates=self.webpackChunk_spark_front_templates||[]).push([[6362],{3873:(e,t,o)=>{o.d(t,{U:()=>i});const n="sfauthr";var s=o(359),r=o(1093);const i=()=>{(0,s.TV)(n,"true",365),window.location.href=(0,r.d)("auth")}},1093:(e,t,o)=>{o.d(t,{d:()=>r});var n=o(359),s=o(7139);const r=(e,t,o)=>{var r,i,a,c,p;let d,l,u="",m="";if(""!==(null!=(r=null==t?void 0:t.pageUrl)?r:"")&&t){const e=o||t.pageUrl;e&&({domain:u,pathname:m}=(e=>{const t=e.replace(/^(https?:\/\/)/,""),[o,...n]=t.split("/");return{domain:o,pathname:`/${n.join("/")}`}})(e))}const w="undefined"!=typeof window&&("true"===(0,n.Ri)("ssoSandbox")||(0,s.$)().ssoSandbox||(null==t?void 0:t.sandbox)||!1),f="undefined"!=typeof window?null==(a=null==(i=window.SPARK)?void 0:i.sso)?void 0:a.clientId:t?t.clientId:"",h="undefined"!=typeof window?null==(p=null==(c=window.SPARK)?void 0:c.sso)?void 0:p.auth0Realm:t?t.auth0Realm:"";if("undefined"==typeof window)l=encodeURIComponent(`https://${u}`);else{d=(()=>{if("undefined"==typeof window)return;if(["sf-dev","sf-test","sf-uat","sf-prod","sparknews-dev","sparknews-test","sparknews-uat","sparknews"].some((e=>window.location.host.includes(e))))return;const e=window.location.host.split(".");return 3===e.length&&"www"!==e[0]?e[0]:e.length>3?e[1]:void 0})();const e=d?(e=>{const t=e.split(".");return t.length>2?t.slice(-2).join("."):e})(window.location.host):window.location.host;l=encodeURIComponent(`${d?"https://www.":"https://"}${e}`)}const P=encodeURIComponent(encodeURIComponent("undefined"!=typeof window?window.location.pathname+window.location.search:m)),v="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),x=w?`https://login-stage.funkemedien.de/realms/${h}`:`https://login.funkemedien.de/realms/${h}`;d=d?encodeURIComponent(`/${d}/`):d;return"reset-credentials"===e?`${x}/login-actions/${e}?client_id=${f}`:`${x}/protocol/openid-connect/${"registrations"===e?e:"auth"}?client_id=${f}${"registrations"===e||"auth"===e?"":`&kc_action=${e}`}&scope=openid%20profile%20email&response_type=id_token%20token&response_mode=form_post&nonce=${v}&${`redirect_uri=${l}%2Fredirect.html%3Fo%3D${d||P}`}`}},2219:(e,t,o)=>{o.d(t,{l:()=>n});const n=e=>{const t="sandbox_info";let o=document.getElementById(t);const n=o&&Array.from(o.getElementsByTagName("span")).find((t=>{return o=e,t.textContent.includes(o);var o}));if(o||(o=document.createElement("div"),o.className="fixed bottom-4 left-2 rounded-md z-50",o.id=t,document.body.appendChild(o)),n)return;const s=document.createElement("span");s.innerText=e,s.className="text-copy-negative bg-background-900 p-2 rounded-md mr-2",o.appendChild(s)}},7139:(e,t,o)=>{o.d(t,{$:()=>p});var n=o(359),s=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,c=(e,t,o)=>t in e?s(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;const p=()=>{const e=["pcAccess","epAccess","debug"],t=["empty"],o=["ssoSandbox","pianoSandbox"];return window.location.search.slice(1).split("&").reduce(((s,r)=>{const[i,a]=r.split("=").map(decodeURIComponent);return s[i]="true"===a||"false"===a?"true"===a:a,e.includes(i)&&sessionStorage.setItem(i,a),t.includes(i)&&localStorage.setItem(i,a),o.includes(i)&&(0,n.TV)(i,a,1),"ssoSandbox"!==i&&"pianoSandbox"!==i||"false"!==a||(0,n.Yj)(i),s}),((e,t)=>{for(var o in t||(t={}))i.call(t,o)&&c(e,o,t[o]);if(r)for(var o of r(t))a.call(t,o)&&c(e,o,t[o]);return e})({},{pcAccess:!1,epAccess:!1,debug:!1,pianoSandbox:!1,ssoSandbox:!1}))}},6362:(e,t,o)=>{o.r(t),o.d(t,{PianoScriptModule:()=>E});var n=o(2193);const s=["c6294","s23","s65","s1429","s905"],r="purAccess",i=(0,n.A)("PianoPurResolver"),a=e=>{const t=window.SPARK.piano.purRid;e&&t||i.error("purRid not found or tp not found");const o=sessionStorage.getItem(r);if(o){p(o)?i.info("checkValidity - Pur Access Valid"):(i.info("checkValidity - Pur Access Expired"),sessionStorage.removeItem(r),a(e))}else e.api.callApi("/access/check",{rid:t},(e=>{c(e)}))},c=e=>{if(!window.SPARK.piano.purRid||!e)return;const{access:{granted:t,expire_date:o}}=e;i.info("handleAccessObject - accessObject: ",e),t&&(sessionStorage.setItem(r,String(o)),u(!0))},p=e=>{if(!e)return!1;return Math.floor(Date.now()/1e3){const t=sessionStorage.getItem(r);p(t)?(i.info("cmpCheckPurAccess - Pur Access Valid"),l(e),u(!0)):(i.info("cmpCheckPurAccess - No Pur Access or Pur Access Expired"),u(!1))},l=e=>{for(const t of s)e("setVendorConsent",t,1)},u=e=>{window.cmp_pur_loggedin=!0,window.cmp_pur_enable=e,!0===e&&(localStorage.setItem("tpPreset","opt-out"),window.tp.push(["setCustomVariable","__cm_composer","opt-out"]),window.__cmp("close"))};var m=o(7139),w=o(359),f=o(861),h=o(2219),P=o(1093),v=o(3873),x=o(9907);const b=(0,n.A)("simulatePcAccess");var g=Object.defineProperty,S=Object.defineProperties,_=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable,I=(e,t,o)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,$=(e,t)=>{for(var o in t||(t={}))y.call(t,o)&&I(e,o,t[o]);if(A)for(var o of A(t))C.call(t,o)&&I(e,o,t[o]);return e};const R=(0,n.A)("PianoScriptModule"),O="opt-in",U="opt-out",k="temp-opt-out",E=()=>{R.info("running");const{pianoSandbox:e,temporaryOptOut:t}=(0,m.$)(),o="true"===(0,w.Ri)("pianoSandbox")||e||!1,n=o?window.SPARK.piano.aidSandbox:window.SPARK.piano.aid,s=window.SPARK.piano.applePayMerchantId||"",r=window.SPARK.piano.cXenseSiteId||"",i=(0,f.v)("sfauthp")||"";o&&(0,h.l)(`pianoSandbox = ${o}`),t&&localStorage.setItem("tpPreset",k);const c=setInterval((()=>{window.tp&&(p(),clearInterval(c))}),50),p=()=>{var e,t;const c="undefined"!=typeof window&&window.tp||void 0;if(window.SPARK.piano.pdlConsent?void 0!==window.pdl&&void 0!==window.pdl.requireConsent&&(window.pdl.requireConsent="v2"):c&&c.push(["setCustomVariable","__cm_composer",O]),c){c.push(["setAid",n]),c.push(["setApplePayMerchantId",s]),c.push(["setUseTinypassAccounts",!1]),c.push(["setSandbox",o]),c.push(["setUsePianoIdUserProvider",!1]),c.push(["setUsePianoIdLiteUserProvider",!0]),c.push(["setExternalJWT",i]),c.push(["setCxenseSiteId",r]),c.push(["setCustomVariable","loginUrl",(0,P.d)("auth")]),c.push(["setCustomVariable","registerUrl",(0,P.d)("registrations")]),c.push(["setCustomVariable","lostPasswordUrl",(0,P.d)("reset-credentials")]),c.push(["setCustomVariable","resetPasswordUrl",(0,P.d)("UPDATE_PASSWORD")]),c.push(["setCustomVariable","configureTOTPUrl",(0,P.d)("CONFIGURE_TOTP")]),c.push(["setCustomVariable","verifyEmailUrl",(0,P.d)("VERIFY_EMAIL")]),c.push(["setCustomVariable","updateProfileUrl",(0,P.d)("UPDATE_PROFILE")]),c.push(["addHandler","checkoutCustomEvent",e=>{if("receipt-reload"===e.eventName)R.info("Checkout complete",e),(0,v.U)()}]);const u=(0,f.v)("sfautht");if(u){const e=(0,f.$)(u);c.push(["setCustomVariable","userDetails",JSON.stringify((p=$({},e),l={email:void 0},S(p,_(l))))]),e.accessRights.forEach((e=>{for(const t in e)"type"!==t&&c.push(["setCustomVariable",`${e.type}_${t}`,e[t]||null])})),window.SPARK.sso.jwtDecode=e=>{if(null!==e)return JSON.parse(atob(e.split(".")[1]))},window.SPARK.sso.getCookie=e=>{const t=document.cookie.split("; ");for(const o of t){const[t,n]=o.split("=");if(t===e)return decodeURIComponent(n)}return null}}const h=(0,f.v)("sfauthp");if(h){const o=(0,f.$)(h),n=void 0!==window.SPARK&&(null==(t=null==(e=window.SPARK)?void 0:e.sso)?void 0:t.sandbox)?"https://subscriptions-stage.funkemedien.de/public/pushpianoex":"https://subscriptions.funkemedien.de/public/pushpianoex",s=(o.email||"").substring(0,3);document.createElement("img").src=`${n}/${o.evolverid}/${encodeURIComponent(s)}`}c.push(["addHandler","customEvent",e=>{const t=e.params.trackingvars.replace(/'/g,'"'),o=JSON.parse("{"+t+"}");o.fe_environment="decoupled",window.dataLayer.push(o)}]),c.push(["addHandler","checkoutComplete",()=>{window.dataLayer.push({fe_environment:"decoupled",level:"purchase",template:"Thank you",event:"piano_view"})}]);const g=()=>{c.consent.setAllPurposes&&(void 0===window.__cmp("getCMPData").vendorConsents[412]?(c.consent.setAllPurposes(U),localStorage.setItem("tpPreset",U)):(c.consent.setAllPurposes(O),localStorage.setItem("tpPreset",O)),setTimeout((()=>{R.info("tp.experience.execute() - consent from window.__cmp (vendor 412)"),c.experience.execute()}),50))};if("function"==typeof window.__cmp){o&&d(window.__cmp);["consent","consentapproved","consentrejected","consentcustom"].forEach((e=>{window.__cmp("addEventListener",[e,()=>{o&&d(window.__cmp),("consent"===e&&null===localStorage.getItem("tpPreset")||"consentcustom"===e||"consentapproved"===e||"consentrejected"===e)&&g()},!1],null)}))}c.push(["init",()=>{o&&a(c);const e=localStorage.getItem("tpPreset");if(e&&c.consent.setAllPurposes){const t=e===U?200:50;if(e===(O||k))c.consent.setAllPurposes(e);else R.warn("invalidating tpPreset because its not a valid tpPreset or temporary: tpPreset=",e),c.consent.setAllPurposes(U),localStorage.removeItem("tpPreset");setTimeout((()=>{R.info("tp.experience.execute() and consent from localStorage (tpPreset)",c.consent.get()),c.experience.execute()}),t)}},!1]),(()=>{const{pcAccess:e,epAccess:t}=(0,m.$)(),{href:o}=window.location,n=new URL(o),s=x.env.SFAUTHT_COOKIE_PC,r=x.env.SFAUTHP_COOKIE_PC,i=x.env.SFAUTHT_COOKIE_EP,a=x.env.SFAUTHP_COOKIE_EP;if(s&&r&&i&&a)if(e||t){const o=e?s:i,c=e?r:a;(0,w.Ri)("sfautht")||(0,w.Ri)("sfauthp")||((0,w.TV)("sfautht",o,1),(0,w.TV)("sfauthp",c,1),window.location.replace(`${n.origin}${n.pathname}${e?"?pcAccess=true":"?epAccess=true"}`)),b.info(e||t,"sfauthp:",(0,f.$)(c),"sfautht:",(0,f.$)(o))}else(0,w.LD)("sfautht")&&(0,w.LD)("sfauthp")&&((0,w.Yj)("sfautht"),(0,w.Yj)("sfauthp"),window.location.replace(`${n.origin}${n.pathname}`))})(),R.info("tp Object",c)}var p,l}}}}]);