PageSourceSearch

https://libs.platform.latimes.com/meteringjs/gshowcase.js

js latimes.com collected 2026-10-09 22:41:49 UTC 5,651 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e,t;!function(e){e.SUBSCRIBER="subscriber",e.METERING="metering",e.EXEMPT="exempt"}(e||(e={})),function(e){e[e.ERROR=0]="ERROR",e[e.OVERRIDE=1]="OVERRIDE",e[e.BYPASS=2]="BYPASS"}(t||(t={}));const o=!!(window.location.host.match(/caltimes\.io|psdops\.com|localhost/)||window.location.hash&&window.location.hash.includes("_debugmode=true"));function n(...e){o&&console.debug("MeteringJS:",...e)}const i=new URL(window.location.href).searchParams,s=e=>i.get(e);function r(){return o&&s("__statedebug")?function(){let e={};try{e=JSON.parse(atob(s("__statedebug")))}catch(e){n("failed to decode debug token",e)}const t=new URL(window.location.href);return t.searchParams.delete("__statedebug"),window.history.replaceState({},"",t),Object.fromEntries(Object.entries(e).filter(([e])=>["id","registrationTimestamp","subscriptionTimestamp","granted","grantReason"].includes(e)))}():function(){const t=(()=>{const e={...window.meteringjs.getUserMeterData()},t=window.meteringjs.getUserGeoData();return t&&(e.geoData={...t}),e.termsAccepted=window.meteringjs.getTosAcceptedStatus(),e})(),{showPaywall:o,grantReason:n,lastRecordedSubscriptionExpiration:i}=t.attributes,s={granted:!o},r=window.registration.user.getMasterId(),a=window.registration.user.getRegistrationDate();return o||(s.grantReason=n===e.SUBSCRIBER?"SUBSCRIBER":"METERING",n===e.SUBSCRIBER&&i&&i>Math.floor(Date.now()/1e3)&&(s.subscriptionTimestamp=Math.floor(Date.now()/1e3)-2592e3)),r&&(s.id=r),a&&a>0&&(s.registrationTimestamp=a),s}()}var a,c,l,d,g,u;!function(e){e.PRIVATE_MODE="privateMode",e.LOGGED_IN="loggedIn",e.MOBILE="mobile",e.NOT_MOBILE="notMobile",e.NONE=""}(a||(a={})),function(e){e.FREE="free",e.METERED="metered",e.REGISTERED_ONLY="registered-only",e.SUBSCRIBER_ONLY="subscriber-only"}(c||(c={})),function(e){e.DYNAMIC_METER_POLICY_V1_5="DYNAMIC_METER_POLICY_V1_5",e.DYNAMIC_METER_POLICY_V2A="DYNAMIC_METER_POLICY_V2A",e.DYNAMIC_METER_POLICY_V2B="DYNAMIC_METER_POLICY_V2B"}(l||(l={})),function(e){e.NEVER_SUBSCRIBERS="never",e.NON_SUBSCRIBERS="premium",e.EVERYONE="free",e.GUESTS="register",e.SUBSCRIBERS="upgrade"}(d||(d={})),function(e){e.WITHIN="within",e.EXCEED="exceed",e.ABANDON="abandon"}(g||(g={}));class w{basekey="meteringjs";constructor(){try{localStorage.getItem(this.basekey)||this.setupMeteringStore()}catch(e){n("MeteringStore localStorage initialization failed",e)}}getCache(){let e=localStorage.getItem(this.basekey);return e||(this.setupMeteringStore(),e=localStorage.getItem(this.basekey)),e?JSON.parse(e):null}get(e){try{const t=this.getCache(),o=t?.[e];return o&&w.isExpired(o)?void this.delete(e):o}catch(e){n("MeteringStore localStorage (get) failed",e)}}set(e,t){try{const o=this.getCache();o&&(o[e]=t,localStorage.setItem(this.basekey,JSON.stringify(o)))}catch(e){n("MeteringStore localStorage (set) failed",e)}}multiSet(e){try{const t=this.getCache();t&&(e.forEach(({key:e,value:o})=>{t[e]=o}),localStorage.setItem(this.basekey,JSON.stringify(t)))}catch(e){n("MeteringStore localStorage (set) failed",e)}}delete(e){try{if(e){const t=localStorage.getItem(this.basekey);if(t){const o=JSON.parse(t);delete o[e],localStorage.setItem(this.basekey,JSON.stringify(o))}}else localStorage.removeItem(this.basekey)}catch(e){n("MeteringStore localStorage (delete) failed",e)}}setupMeteringStore(){localStorage.setItem(this.basekey,JSON.stringify({rules:{}}))}static getNewExpirationDate(e=1){const t=new Date;return t.setDate(t.getDate()+e),t}static isExpired(e){return void 0!==e.expiration&&new Date>new Date(e.expiration)}}new w,function(e){e.DESKTOP="desktop",e.MOBILE="mobile",e.TABLET="tablet"}(u||(u={}));const m="subscriber-content",E=()=>{const e=window.meteringjs.getUserMeterData().attributes;if(e&&e.showPaywall){const t=e.paywallRuleId,o=window.meteringjs.getShownReactions().find(e=>{const o=e.getRule();if(o)return o.id.toString()===t});if(!o)return void document.addEventListener("modality:walled",()=>{E()});o.getComponent()?.close(),window.meteringjs.removeShownReaction(o),document.querySelectorAll(".met-sub-link").forEach(e=>{e.remove()}),document.querySelectorAll(`.${m}
1.hidden`).forEach(e=>{e.classList.remove(m,"hidden")})}};[{src:"https://accounts.google.com/gsi/client",id:"gsi-client",options:{async:!0,defer:!0}},{src:"https://news.google.com/swg/js/v1/swg.js",id:"swgjs",options:{async:!0,attrs:{"subscriptions-control":"manual"}}},{src:"https://news.google.com/swg/js/v1/swg-gaa.js",id:"swg-gaa",options:{async:!0,onload:()=>{window.meteringjs.push({status:()=>function(){const e=r(),t=new Promise(e=>{e(r())}),o=new Promise(()=>{window.GaaMetering.getLoginPromise().then(()=>{const e=document.createElement("style");e.textContent="#reg-overlay { z-index: 2147483647; }",document.head.appendChild(e),(window.registration||(window.registration=[])).push(e=>{e.manager.showLoginDialog()})})});(window.registration||(window.registration=[])).push(n=>{window.GaaMetering.init({authorizationUrl:n.utils.getSocialUrl("google-oauth2"),userState:e,allowedReferrers:["accounts.youtube.com"].concat(["www.latimes.com"]),handleLoginPromise:o,publisherEntitlementPromise:t,paywallType:"CLIENT_SIDE",unlockArticle:E,showPaywall:()=>{}})})}()})}}}
1].forEach(e=>{if(!document.getElementById(e.id)){const o=((e,t,o)=>{const n=document.createElement("script");n.src=e,n.onerror=e=>{console.error("failed to inject script",e)},t&&(n.id=t);const{async:i,defer:s,attrs:r,onload:a}=o;return i&&(n.async=i),s&&(n.defer=s),r&&Object.entries(r).forEach(([e,t])=>{n.setAttribute(e,t)}),a&&n.addEventListener("load",a),n})(e.src,e.id,e.options);t=()=>{document.head.appendChild(o)},window.fastdom?window.fastdom.mutate(t):t()}var t})})();

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.