1!function(){"use strict";const n=window.pmdNavigaPaywallConfig||{};if(!window.pmdAnalytics||"function"!=typeof window.pmdAnalytics.trackEvent)return;const t="pmd:naviga-engage-event",e={onPaywallShown:"paywall_shown",onConversationDetermined:"meter_conversation_determined",onActionClosed:"paywall_closed",onButtonClick:"paywall_click",onLoginShown:"paywall_login_shown",onLoginSuccess:"paywall_login_success",onLoginError:"paywall_login_error",onRegistrationSuccess:"registration_success",onMeterLevelSet:"meter_level_set",onActivationSuccess:"subscription_activation_success"},o=["paywall_shown","paywall_closed","paywall_click"],i={onAuthorized:"registered",onLoggedIn:"registered"};let a=null,c=!1,r=!1,s=null,u=!1,l=!1;const d=[];function f(n){if(u&&window.amplitude)return void n(window.amplitude);if(d.push(n),l)return;l=!0;let t=0;!function n(){t++;const e=window.amplitude;if(e&&"function"==typeof e.identify&&"function"==typeof e.Identify&&"function"==typeof e.setUserId)for(u=!0;d.length;)try{d.shift()(e)}catch(n){console.warn("PMD Analytics: Naviga bridge Amplitude call failed.",n)}else t<100&&setTimeout(n,100)}()}const p={Aui:"naviga_anonymous_id",CampaignId:"campaign_id",CampaignName:"campaign_name",ConversationId:"conversation_id",ConversationName:"conversation_name",ActionType:"action_type",ActionTypeId:"action_type_id",ActionName:"action_name",ActionDescription:"action_description",MeterLevel:"meter_level",UserState:"user_state",Views:"conversation_views",ViewCount:"view_count",Limit:"paywall_limit"};function m(n,t){const e={paywall_vendor:"naviga"};"string"==typeof window.pageTag&&window.pageTag&&(e.page_tag=window.pageTag),function(n){if(!n||"object"!=typeof n)return[];const t=n.EventData,e=[n];return t&&"object"==typeof t&&(e.push(t),t.Properties&&"object"==typeof t.Properties&&e.push(t.Properties)),e}
1(n).forEach(function(n){Object.keys(p).forEach(function(t){const o=n[t],i=p[t];"string"!=typeof o&&"number"!=typeof o&&"boolean"!=typeof o||i in e||(e[i]=o)})});const i=function(n){const t=n&&n.EventData?n.EventData:null,e=t&&t.Properties?t.Properties:null,o=e?e.PaywallInfo:null,i=o&&o.ArticleLeft?o.ArticleLeft:null;let a=e?e.ArticleLeft:void 0;return i&&o.MinView&&void 0!==i[o.MinView]&&(a=i[o.MinView]),"unlimited"===a?-1:"number"==typeof a?a:null}(n);null!==i&&(e.articles_left=i),Object.assign(e,function(n){const t=n&&n.EventData?n.EventData:null,e={};if(!t||"object"!=typeof t)return e;"string"==typeof t.Method&&""!==t.Method&&(e.meter_level_method=t.Method),"number"==typeof t.Id&&(e.meter_level_id=t.Id);const o=t.Rule;return o&&"object"==typeof o&&"string"==typeof o.Name&&""!==o.Name&&(e.meter_rule_name=o.Name),e}(n));const a=function(n,t){if(!o.includes(t)||!n||!n.EventData)return{};const e={};return"string"==typeof n.EventData.Name&&(e.action_name=n.EventData.Name),"string"==typeof n.EventData.Description&&(e.action_description=n.EventData.Description),e}(n,t);return!e.action_name&&a.action_name&&(e.action_name=a.action_name),!e.action_description&&a.action_description&&(e.action_description=a.action_description),e}function w(n){a!==n&&(a=n,window.pmdAnalyticsConfig&&window.pmdAnalyticsConfig.defaultProperties&&(window.pmdAnalyticsConfig.defaultProperties.user_status=n),f(function(t){const e=new t.Identify;e.set("user_status",n),t.identify(e)}),"anonymous"!==n&&y())}function y(){if(!n.setUserId||r)return;const t=function(n){const t=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e=document.cookie.match(new RegExp("(?:^|;\\s*)"+t+"=([^;]*)"));try{return e?decodeURIComponent(e[1]):""}catch(n){return e?e[1]:""}}(n.sessionCookie||"auth0_sub");var e;t&&(r=!0,(e=t,window.crypto&&window.crypto.subtle&&void 0!==window.TextEncoder?window.crypto.subtle.digest("SHA-256",(new TextEncoder).encode(e)).then(function(n){return Array.prototype.map.call(new Uint8Array(n),function(n){return n.toString(16).padStart(2,"0")}).join("")}):Promise.reject(new Error("WebCrypto unavailable"))).then(function(n){s="a0_"+n,f(function(n){n.setUserId(s)})}).catch(function(){}))}document.documentElement.classList.contains("naviga-state--registered")?w("registered"):w("anonymous");const g={};
1Object.keys(i).forEach(function(n){g[n]=function(){w(i[n])}}),g.onNotAuthorized=function(){c=!1,w("anonymous")},g.onHasNoActiveSubscription=function(){c=!0,w("registered")},g.onHasAccess=function(){"registered"!==a||c||w("subscribed")},Object.keys(e).forEach(function(n){g[n]=function(t){const o=e[n];window.pmdAnalytics.trackEvent(o,m(t,o))}}),["onLoginSuccess","onRegistrationSuccess","onActivationSuccess"].forEach(function(n){const t=g[n];g[n]=function(n){t(n),y()}}),function(n){document.addEventListener(t,function(t){const e=t&&t.detail?t.detail:null;e&&n[e.name]&&n[e.name](e.payload)})}(g),y(),n.debug&&document.addEventListener(t,function(n){const t=n&&n.detail?n.detail:null;console.log("[PMD Analytics] Engage event: "+(t?t.name:"?"),e[t&&t.name]||"(not tracked)",t?m(t.payload,e[t.name]):null)}),function(){const t=function(n){return(Array.isArray(n)?n:[]).filter(function(n){return"string"==typeof n&&""!==n}).map(function(n){return n.toLowerCase()})},e=t(n.checkoutHosts),o=t(n.checkoutHostPatterns);if(!e.length&&!o.length)return;const i=n.deviceIdParam||"amp_device_id",a=n.userIdParam||"amp_user_id",c=function(n){const t=n.target;if(!(t instanceof Element))return;const c=t.closest("a[href]");if(!c)return;let r;try{r=new URL(c.href,location.href)}catch(n){return}if(!function(n){const t=n.toLowerCase();if(t===location.hostname.toLowerCase())return!1;if(-1!==e.indexOf(t))return!0;const i=t.split(".");return o.some(function(n){return i.some(function(t){return-1!==t.indexOf(n)})})}(r.hostname))return;let u=!1;if(!r.searchParams.has(i)){const n=function(){if(window.pmdAmplitudeDeviceId)return window.pmdAmplitudeDeviceId;try{const n=localStorage.getItem("pmd_amplitude_device_id");if(n)return n}catch(n){}try{if(window.amplitude&&"function"==typeof window.amplitude.getDeviceId)return window.amplitude.getDeviceId()||null}catch(n){}return null}();n&&(r.searchParams.set(i,n),u=!0)}s&&!r.searchParams.has(a)&&(r.searchParams.set(a,s),u=!0),u&&(c.href=r.toString())};document.addEventListener("click",c,!0),document.addEventListener("auxclick",c,!0)}()}(); 2//# sourceMappingURL=naviga-paywall-bridge.js.map
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.