PageSourceSearch

https://assets.startupdaily.net/wp-content/themes/private-media-co…/build/js/zephr.js?ver=25ad072d5a5eedbeb5a3

js startupdaily.net collected 2026-09-24 18:03:57 UTC 16,328 bytes, 1 lines download raw bytes

1(()=>{var e={3702(e,t,n){"use strict";n.d(t,{A:()=>o});class i{constructor(){this.init()}init(){this.loginRegisterFormPreProcessors()}loginRegisterFormPreProcessors(){let e=null;document.querySelectorAll("div.zephr-registration-form").length<=0||window?.Blaize?.registerFormPreProcessor&&window.Blaize.registerFormPreProcessor("*",t=>{t.attributes&&(t.attributes["registration-timestamp"]=Math.floor(Date.now()/1e3),t.attributes["registration-status"]="complete"),t.identifiers=t.identifiers||{};const n=t.identifiers.email_address||"";for(let t=window.zephrDL.length-1;t>=0;t--)if("zephr_form_button_press"===window.zephrDL[t].event){e=window.zephrDL[t].formId;break}let i=null;if(e&&(i=document.getElementById(e)),!i)return t;let o=i.closest("div.zephr-registration-form");if(!o)return t;const r=o.querySelector(".zephr-form-error-message-email");if(r&&r.remove(),n.includes(" ")){const e=o.querySelector("input.zephr-form-input-email");if(e){const t=e.closest(".zephr-form-input-inner-container"),n=document.createElement("div");n.className="zephr-form-error-message-email zephr-form-error-message",n.textContent="Email address cannot contain spaces.",t&&t.parentNode&&t.insertAdjacentElement("afterend",n)}return!1}return t})}}document.addEventListener("DOMContentLoaded",()=>{new i});const o=i},6982(e,t,n){var i;n.amdD,i=function(e,n){function i(e,t,n,i,o){var r=new XMLHttpRequest;for(var s in r.onload=function(){var e,t;o(null,{status:r.status,headers:(e=r.getAllResponseHeaders()||"",t={},e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var n=e.split(":"),i=n.shift().trim();if(i){var o=n.join(":").trim();t[i]||(t[i]=[]),t[i].push(o)}}),t),body:r.responseText})},r.onerror=r.ontimeout=r.onabort=function(){o("HTTP "+e+" request to "+t+" failed.")},r.withCredentials=!0,r.open(e,t,!0),i.Accept||(i.Accept="application/json"),i)i.hasOwnProperty(s)&&r.setRequestHeader(s,i[s]);r.send(["get","delete","head","options"].includes(e.toLowerCase())?null:n)}function o(e,t){i("GET",e,null,{}
1,function(e,n){n.body=JSON.parse(n.body),t(e,n)})}function r(e,t,n){i("POST",e,JSON.stringify(t),{"Content-Type":"application/json"},function(e,t){t.body=JSON.parse(t.body),n(e,t)})}t.getAnonymousSession=function(){var e,t,n;if(1==arguments.length&&arguments[0]instanceof Function)e=arguments[0];else{if(!(3==arguments.length&&arguments[2]instanceof Function))return void console.error("Blaize SDK: getAnonymousSession requires a callback function.\nUsage:\n\tBlaizeSDK.getAnonymousSession(function(error, success) {})\n\tor\n\tBlaizeSDK.getAnonymousSession(token, fingerprint, callback)");t=arguments[0],n=arguments[1],e=arguments[2]}var o="/blaize/anonymous-session";t&&n&&(o+="?token="+t+"&fingerprint="+n),i("POST",o,null,{},function(t,n){t?e(t):201!=n.status?e(n.body.message):e(null,"Anonymous session created; a cookie has been set.")})},t.register=function(e,t){2==arguments.length&&arguments[1]instanceof Function?r("/blaize/register",e,function(e,n){e?t(e):200!=n.status?t(n.body.message):t(null,"User registered; a cookie has been set")}):console.error('Blaize SDK: register requires a UserModel and callback function.\n Usage\n\tlet body = {\n\t\tidentifiers: { email_address: "[email protected]" },\n\t\tvalidators: { password: "p@55w0rd" },\n\t\tattributes: { x: "y" }\n\t};\n\tBlaizeSDK.register(body, function(error, result) {};')},t.login=function(e,t){2==arguments.length&&arguments[1]instanceof Function?r("/blaize/login",e,function(e,n){e?t(e):200!=n.status?t(n.body.message):t(null,"User logged in; a cookie has been set")}):console.error('Blaize SDK: login requires a CoreUserDetails and callback function.\n Usage\n\tlet body = {\n\t\tidentifiers: { email_address: "[email protected]" },\n\t\tvalidators: { password: "p@55w0rd" }\n\t};\n\tBlaizeSDK.login(body, function(error, result) {};')},t.logout=function(e){1==arguments.length&&arguments[0]instanceof Function?i("POST","/blaize/logout",null,{},function(t,n){t?e(t):200!=n.status?e(n.body.message):(document.cookie="blaize_session= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",e(null,"User logged out; the blaize_session cookie has been removed"))}):console.error("Blaize SDK: logout requires a callback function.\n Usage\n\tBlaizeSDK.logout(function(error, result) {};")},t.forgetMe=function(e){1==arguments.length&&arguments[0]instanceof Function?i("POST","/blaize/forget-me",null,{},function(t,n){t?e(t):200!=n.status?e(n.body.message):(document.cookie="blaize_session= ; expires = Thu, 01 Jan 1970 00:00:00 GMT",e(null,"User deleted; the blaize_session cookie has been removed"))}):console.error("Blaize SDK: forgetMe requires a callback function.\n Usage\n\tBlaizeSDK.forgetMe(function(error, result) {};")},t.entitlementChallenge=function(e,t){2==arguments.length&&e instanceof Array&&arguments[1]instanceof Function?r("/blaize/authorization/challenge",{contentIdentifier:window.location.pathname,entitlementIds:e},function(e,n){e?t(e):200!=n.status?t(n.body.message):t(null,n.body)}):console.error('Blaize SDK: entitlementChallenge requires an array of entitlement IDs and callback function.\n Usage\n\tBlaizeSDK.entitlementChallenge(["00000000-0000-0000-0000-000000000000"], function(error, result) {};')},t.accessDecision=function(e,t){2==arguments.length&&arguments[1]instanceof Function?(e.path||(e.path=window.location.pathname),r("/blaize/decision-engine",e,t)):console.error("Blaize SDK: accessDecision requires a decision request and callback function. See API docs for full details of the request.\n Usage\n\tlet body = {\n\trequest_headers: { }\n\t};\n\tBlaizeSDK.accessDecision(body, function(error, result) {};")},t.getAccount=function(e){1==arguments.length&&arguments[0]instanceof Function?o("/blaize/account",function(t,n){t?e(t):200!=n.status?e(n.body.message):e(null,n.body)}):console.error("Blaize SDK: getAccount requires a callback function.\n Usage\n\tBlaizeSDK.getAccount(function(error, result) {};")},t.getProfile=function(e){1==arguments.length&&arguments[0]instanceof Function?o("/blaize/profile",function(t,n){t?e(t):200!=n.status?e(n.body.message):e(null,n.body)}):console.error("Blaize SDK: getProfile requires a callback function.\n Usage\n\tBlaizeSDK.getProfile(function(error, result) {};")},t.updateProfile=function(e,t,n){3==arguments.length&&"boolean"==typeof arguments[1]&&arguments[2]instanceof Function?i(t?"PATCH":"PUT","/blaize/profile",JSON.stringify(e),{"Content-Type":"application/json"},function(e,t){e?n(e):200!=t.status?n(t.body.message):n(null,"Profile updated")}):console.error('Blaize SDK: updateProfile requires a new profile (or part of one), a boolean indicating if the new profile should be merged with the old one (otherwise it will replace it) and a callback function.\n Usage\n\tBlaizeSDK.updateProfile({"x": "not y"}, true, function(error, result) {};')},t.getExtendedProfileDocument=function(e,t){2==arguments.length&&arguments[1]instanceof Function?o("/blaize/profile/"+e,function(e,n){e?t(e):200!=n.status?t(n.body.message):t(null,n.body)}):console.error('Blaize SDK: getExtendedProfileDocument requires a document ID and a callback function.\n Usage\n\tBlaizeSDK.getExtendedProfileDocument("savedThings", function(error, result) {};')},t.updateExtendedProfileDocument=function(e,t,n){3==arguments.length&&arguments[2]instanceof Function?i("PUT","/blaize/profile/"+e,JSON.stringify(t),{"Content-Type":"application/json"},function(e,t){e?n(e):200!=t.status?n(t.body.message):n(null,"Extended profile document updated")}):console.error('Blaize SDK: updateExtendedProfileDocument requires a document ID, a new profile and a callback function.\n Usage\n\tBlaizeSDK.updateExtendedProfileDocument("savedThing", {"x": "not y"}, function(error, result) {};')},t.listSubscriptions=function(e,t){2==arguments.length&&arguments[1]instanceof Function?"braintree"==e?o("/blaize/payment/"+e+"/subscriptions",function(e,n){e?t(e):200!=n.status?t(n.body.message):t(null,n.body)}
1):console.error("Blaize SDK: list subscriptions supports the following payment providers:\n\t* braintree"):console.error("Blaize SDK: listSubscriptions requires a callback function.\n Usage\n\tBlaizeSDK.listSubscriptions(function(error, result) {};")}}.call(t,n,t,e),void 0===i||(e.exports=i)}},t={};function n(i){var o=t[i];if(void 0!==o)return o.exports;var r=t[i]={exports:{}};return e[i](r,r.exports,n),r.exports}n.amdD=function(){throw new Error("define cannot be used indirect")},n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=(e=document,n=!1)=>{e.documentElement?e.documentElement.classList.toggle("stop-scroll"):e.classList.toggle("stop-scroll"),n&&t(document.body)},t=e=>{e.classList.toggle("stop-scroll-shift")},i={init(){this.header=document.querySelector("header"),this.zephrSideDrawer=document.querySelector(".zephr-side-drawer");const{adminBarHeight:e,wpAdminBarStyles:t,wpAdminBar:n}=(()=>{const e=document.querySelector("#wpadminbar");return e?{adminBarHeight:e.offsetHeight,wpAdminBarStyles:window.getComputedStyle(e),wpAdminBar:e}:{adminBarHeight:null,wpAdminBarStyles:null,wpAdminBar:null}})();this.adminBarHeight=e,this.wpAdminBarStyles=t,this.wpAdminBar=n,this.zephrSideDrawerOverlay=document.querySelector(".zephr-side-drawer-overlay"),this._bindedAddESCKeyAndTabTrap=this.addESCKeyAndTabTrap.bind(this),this.addEventListeners(),this.resizeAccountsMenu()},addEventListeners(){window.addEventListener("load",this.resizeAccountsMenu.bind(this)),window.addEventListener("resize",this.resizeAccountsMenu.bind(this)),window.addEventListener("scroll",this.resizeAccountsMenu.bind(this)),document.querySelectorAll(".zephr-side-drawer-toggle, .zephr-side-drawer-overlay").forEach(e=>{e.addEventListener("click",this.closeSidebar.bind(this))})},resizeAccountsMenu(){if(!this.header||!this.zephrSideDrawer)return;const e=(e=>{if(!e)return null;const t=e.getBoundingClientRect();return Math.max(0,t.bottom-Math.max(t.top,0))})(this.wpAdminBar),t=window.innerHeight-e;this.zephrSideDrawer.style.top=`${e}px`,this.zephrSideDrawer.style.height=`${t}px`;const n=document.body.classList.contains("zephr-side-drawer-active");this.zephrSideDrawerOverlay&&(n?(this.zephrSideDrawer.style.transform="translateX(0)",document.documentElement.style.height="calc(100% - var(--wp-admin--admin-bar--height, 0px))",this.zephrSideDrawer.setAttribute("aria-hidden","false"),this.zephrSideDrawer.removeAttribute("inert"),document.addEventListener("keydown",this._bindedAddESCKeyAndTabTrap),this.setupInitialFocus()):(this.zephrSideDrawer.style.transform="translateX(100%)",document.documentElement.style.height="auto",this.zephrSideDrawer.setAttribute("aria-hidden","true"),this.zephrSideDrawer.setAttribute("inert",""),document.removeEventListener("keydown",this._bindedAddESCKeyAndTabTrap),this.focusSet=!1))},addESCKeyAndTabTrap(e){"Escape"===e.key?this.closeSidebar(e):"Tab"===e.key&&this.tabTrap(e)},setupInitialFocus(){this.focusSet||(this.focusSet=!0,requestAnimationFrame(()=>{setTimeout(()=>{const e=this.zephrSideDrawer.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0&&e[0].focus()},50)}))},tabTrap(e){const t=this.zephrSideDrawer.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=t[0],i=t[t.length-1];e.shiftKey&&document.activeElement===n?(i.focus(),e.preventDefault()):e.shiftKey||document.activeElement!==i||(n.focus(),e.preventDefault())},closeSidebar(t){t.preventDefault(),document.body.classList.toggle("zephr-side-drawer-active"),e(),this.resizeAccountsMenu()},triggerSideDrawer(){const t=document.body.classList.contains("zephr-side-drawer-active");document.body.classList.toggle("zephr-side-drawer-active",!t),e(),this.resizeAccountsMenu()}};window.ZephrSideDrawer=i,i.init();const o=window.wp.i18n;var r=n(6982),s=n.n(r),a=n(3702);class l{constructor(){this.account=null,this.profile=null,this.zephrReady=!1,this.profileReady=!1,this.accountReady=!1,this.profileDefaults={"first-name":"","last-name":""},this.init()}init(){this.checkAccountPageAndRedirect(),window?.Zephr?.accessDetail
1s?.isAuthenticated&&(this.getCurrentUserData(),this.addEventListeners()),new a.A,this.loginByEmail()}addEventListeners(){const e=document.querySelectorAll(".zephr-logout-button");e&&e.forEach(e=>{e.addEventListener("click",this.handleLogout.bind(this))})}checkAccountPageAndRedirect(){const e=pmZephrVars?.isAccountPage,t=window?.Zephr?.accessDetails?.isAuthenticated;e&&!t&&(window.location.href="/")}handleLogout(){s().logout(function(e,t){e?window.console.log(e):window.location.href="/"})}getCurrentUserData(){window.BlaizeSDK.getAccount((e,t)=>{e||(this.account=t,this.accountReady=!0,this.setGlobalData("account",this.account),this.setGlobalData("accountReady",this.accountReady),document.dispatchEvent(new CustomEvent("pm.account_retrieved",{detail:this})),this.accountReady&&this.profileReady&&document.dispatchEvent(new CustomEvent("pm.zephr_ready",{detail:this})))}),window.BlaizeSDK.getProfile((e,t)=>{e||(this.profile=Object.assign({},this.profileDefaults,t),this.profileReady=!0,this.setGlobalData("profile",this.profile),document.dispatchEvent(new CustomEvent("pm.profile_retrieved",{detail:this})),this.accountReady&&this.profileReady&&(document.dispatchEvent(new CustomEvent("pm.zephr_ready",{detail:this})),this.updateAccountsMenuText()))})}updateAccountsMenuText(){const e=document.querySelector(".zephr-accounts__left .zephr-accounts-menu-head .zephr-header-welcome-text > h3");if(e){const t=window?.PMZephrData?.profile?.["first-name"],n=window?.Zephr?.accessDetail
1s?.isAuthenticated;e.textContent=n&&t?`${(0,o.__)("Welcome","private-media-core")} ${t}`:n?(0,o.__)("Welcome back","private-media-core"):(0,o.__)("Unlock more free content: Register Today!","private-media-core")}}setGlobalData(e,t){window.PMZephrData||(window.PMZephrData={}),window.PMZephrData[e]=t}static getZephrUsersRemainingCredits(){const e=window.Zephr?.accessDetails?.trials;if(!e)return null;let t=null;for(const n in e)if("anonymousmeter"===e[n]?.tracker||"registeredmeter"===e[n]?.tracker){t=e[n]?.remainingCredits;break}return t}loginByEmail(){window.zephrDL=window.zephrDL||[],window.dataLayer=window.dataLayer||[];const e=window.zephrDL.push,t=["zephr_form_button_press","zephr_form_section_change","zephr_form_render"];let n=null;window.zephrDL.push=function(...i){return i.forEach(e=>{if(t.includes(e.event))switch(e.event){case"zephr_form_render":n=e.formId,sessionStorage.removeItem("emailInputVal-"+n);break;case"zephr_form_button_press":if("email"==e.sectionId){n=e.formId;const t=document.querySelector("#"+n+" .zephr-form-input-email");t&&(sessionStorage.removeItem("emailInputVal-"+n),sessionStorage.setItem("emailInputVal-"+n,t.value))}break;case"zephr_form_section_change":n=e.formId,document.querySelector("#"+n+" .zephr-login-only-email-container")?.remove(),document.querySelector("#"+n+" .zephr-login-only-email-success")?.remove(),"login_password"===e.sectionId&&setTimeout(()=>{let e=document.querySelector("#"+n+" .zephr-form-reset-link-container");if(e){const t='<div class="zephr-form-flex-container zephr-login-only-email-container"><p class="zephr-login-only-email">or</p><button type="button" id="login-via-email" class="zephr-form-link underline zephr-login-only-email" data-form-id="'+n+'">Log In via Email</button></div>';e.insertAdjacentHTML("afterend",t)}let t=document.querySelector("#"+n+" #login-via-email");t&&t.addEventListener("click",function(){const t=this.getAttribute("data-form-id"),n={identifiers:{email_address:sessionStorage.getItem("emailInputVal-"+t)},action:"login",redirect:"/"};fetch("/blaize/token-exchange",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).then(e=>{if(!e.ok)throw new Error("Network response was not ok "+e.statusText);return e.json()}).then(n=>{document.querySelector("#"+t+" .zephr-login-only-email-container")?.remove(),e.insertAdjacentHTML("afterend",'<div class="zephr-login-only-email-success">'+n.message+"</div>")}).catch(e=>{document.querySelector("#"+t+" .zephr-login-only-email-container")?.remove()})})},100)}}),e.apply(this,i)}}}document.addEventListener("DOMContentLoaded",()=>{new l})})()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.