PageSourceSearch

https://businessday.ng/wp-content/uploads/sdk/1.0.4/aeropaywall.global.js?ver=1.0.4

js businessday.ng collected 2026-10-02 02:19:32 UTC 217,230 bytes, 2,999 lines download raw bytes

1"use strict";var AeroPaywall=(()=>{var lt=Object.defineProperty;var ko=Object.getOwnPropertyDescriptor;var To=Object.getOwnPropertyNames;var So=Object.prototype.hasOwnProperty;var Lo=(e,t)=>{for(var a in t)lt(e,a,{get:t[a],enumerable:!0})},Co=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of To(t))!So.call(e,o)&&o!==a&&lt(e,o,{get:()=>t[o],enumerable:!(r=ko(t,o))||r.enumerable});return e};var Po=e=>Co(lt({},"__esModule",{value:!0}),e);var ns={};Lo(ns,{ACCESS_TOKEN_COOKIE:()=>ze,ACCESS_TOKEN_MAX_AGE_SECONDS:()=>tr,SDK_VERSION:()=>os,addPasswordToggles:()=>Q,applyRenderPlan:()=>Rt,attachPasswordToggle:()=>or,buildAccountProfileFormElement:()=>Nt,buildAuthDividerElement:()=>J,buildChangePasswordFormElement:()=>Vt,buildConfirmResetFormElement:()=>Xt,buildOAuthButtonsElement:()=>W,buildProfileFormElement:()=>_t,buildRegisterFormElement:()=>te,buildRequestResetFormElement:()=>$e,buildSlideInElement:()=>br,buildWelcomePopupElement:()=>so,clearAccessToken:()=>de,derivePostTarget:()=>Ta,detectPrivateMode:()=>xr,ensureValidAccessToken:()=>Pt,fetchArticleEntitlement:()=>$t,fetchComments:()=>no,fetchFollows:()=>Ge,followTerm:()=>je,getAccessTokenFromCookie:()=>M,getDeviceId:()=>Mt,initAdFree:()=>jt,initBookmarkButton:()=>La,initChangePasswordForm:()=>Yt,initComments:()=>Pa,initConfirmResetForm:()=>Zt,initCorporateSubscription:()=>Ma,initEditionDownload:()=>ka,initFollowButton:()=>oa,initGiftButton:()=>ma,initMyAccount:()=>Ne,initNavMenu:()=>ya,initNewsletterOptIn:()=>Aa,initOAuthButtons:()=>G,initPrivateModeGuard:()=>Ut,initProfileForm:()=>Ae,initReaderSettings:()=>nt,initRegisterForm:()=>ae,initRequestResetForm:()=>He,initSlideInAlert:()=>Wt,injectStyles:()=>ha,isApplePlatform:()=>lr,loadScriptOnce:()=>Ot,logoutRequest:()=>At,mountPromptForm:()=>Bt,openInterestPickerModal:()=>Re,planRenderForStage:()=>Ht,recordReadingHistoryView:()=>Sa,refreshAccessToken:()=>ar,renderAccountSection:()=>Nr,renderCommentReplyEmailToggle:()=>la,renderInterestPicker:()=>Xe,renderNewsBriefToggle:()=>_e,renderPrivateModeCard:()=>Er,renderSignedOutFollowLink:()=>na,renderSubscribeTab:()=>rt,renderTeamTab:()=>ie,resolveAndRender:()=>Kt,resolveDefaultCurrency:()=>Yi,run:()=>co,setFollowAlert:()=>ra,shouldShowSlideIn:()=>wr,showWelcomePopup:()=>Zi,storeAccessToken:()=>D,submitOAuthToken:()=>Dt,unfollowTerm:()=>Ue,verifyAccessToken:()=>Pe});var fe=crypto,Oe=e=>e instanceof CryptoKey;var ge=new TextEncoder,V=new TextDecoder,cs=2**32;function $a(...e){let t=e.reduce((o,{length:n})=>o+n,0),a=new Uint8Array(t),r=0;for(let o of e)a.set(o,r),r+=o.length;return a}var Ao=e=>{let t=atob(e),a=new Uint8Array(t.length);for(let r=0;r<t.length;r++)a[r]=t.charCodeAt(r);return a},B=e=>{let t=e;t instanceof Uint8Array&&(t=V.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return Ao(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};var O=class extends Error{constructor(t,a){super(t,a),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}};O.code="ERR_JOSE_GENERIC";var z=class extends O{constructor(t,a,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:a}}),this.code="ERR_JWT_CLAIM_VALIDATION_FAILED",this.claim=r,this.reason=o,this.payload=a}};z.code="ERR_JWT_CLAIM_VALIDATION_FAILED";var ye=class extends O{constructor(t,a,r="unspecified",o="unspecified"){super(t,{cause:{claim:r,reason:o,payload:a}}),this.code="ERR_JWT_EXPIRED",this.claim=r,this.reason=o,this.payload=a}};ye.code="ERR_JWT_EXPIRED";var Te=class extends O{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}};Te.code="ERR_JOSE_ALG_NOT_ALLOWED";var q=class extends O{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}};q.code="ERR_JOSE_NOT_SUPPORTED";var ct=class extends O{constructor(t="decryption operation failed",a){super(t,a),this.code="ERR_JWE_DECRYPTION_FAILED"}};ct.code="ERR_JWE_DECRYPTION_FAILED";var dt=class extends O{constructor(){super(...arguments),this.code="ERR_JWE_INVALID"}};dt.code="ERR_JWE_INVALID";var R=class extends O{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}};
vendor: 15,868 bytes, line 1
1R.code="ERR_JWS_INVALID";var ce=class extends O{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}};ce.code="ERR_JWT_INVALID";var pt=class extends O{constructor(){super(...arguments),this.code="ERR_JWK_INVALID"}};pt.code="ERR_JWK_INVALID";var ut=class extends O{constructor(){super(...arguments),this.code="ERR_JWKS_INVALID"}};ut.code="ERR_JWKS_INVALID";var mt=class extends O{constructor(t="no applicable key found in the JSON Web Key Set",a){super(t,a),this.code="ERR_JWKS_NO_MATCHING_KEY"}};mt.code="ERR_JWKS_NO_MATCHING_KEY";var ft=class extends O{constructor(t="multiple matching keys found in the JSON Web Key Set",a){super(t,a),this.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS"}};ft.code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";var gt=class extends O{constructor(t="request timed out",a){super(t,a),this.code="ERR_JWKS_TIMEOUT"}};gt.code="ERR_JWKS_TIMEOUT";var Se=class extends O{constructor(t="signature verification failed",a){super(t,a),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}};Se.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";function Y(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Le(e,t){return e.name===t}function yt(e){return parseInt(e.name.slice(4),10)}function Ho(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function Ro(e,t){if(t.length&&!t.some(a=>e.usages.includes(a))){let a="CryptoKey does not support this operation, its usages must include ";if(t.length>2){let r=t.pop();a+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?a+=`one of ${t[0]} or ${t[1]}.`:a+=`${t[0]}.`;throw new TypeError(a)}}function Ha(e,t,...a){switch(t){case"HS256":case"HS384":case"HS512":{if(!Le(e.algorithm,"HMAC"))throw Y("HMAC");let r=parseInt(t.slice(2),10);if(yt(e.algorithm.hash)!==r)throw Y(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Le(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Y("RSASSA-PKCS1-v1_5");let r=parseInt(t.slice(2),10);if(yt(e.algorithm.hash)!==r)throw Y(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Le(e.algorithm,"RSA-PSS"))throw Y("RSA-PSS");let r=parseInt(t.slice(2),10);if(yt(e.algorithm.hash)!==r)throw Y(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":{if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw Y("Ed25519 or Ed448");break}case"Ed25519":{if(!Le(e.algorithm,"Ed25519"))throw Y("Ed25519");break}case"ES256":case"ES384":case"ES512":{if(!Le(e.algorithm,"ECDSA"))throw Y("ECDSA");let r=Ho(t);if(e.algorithm.namedCurve!==r)throw Y(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}Ro(e,a)}function Ra(e,t,...a){if(a=a.filter(Boolean),a.length>2){let r=a.pop();e+=`one of type ${a.join(", ")}, or ${r}.`}else a.length===2?e+=`one of type ${a[0]} or ${a[1]}.`:e+=`of type ${a[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var ht=(e,...t)=>Ra("Key must be ",e,...t);function wt(e,t,...a){return Ra(`Key for the ${e} algorithm must be `,t,...a)}var bt=e=>Oe(e)?!0:e?.[Symbol.toStringTag]==="KeyObject",he=["CryptoKey"];var _o=(...e)=>{let t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let a;for(let r of t){let o=Object.keys(r);if(!a||a.size===0){a=new Set(o);continue}for(let n of o){if(a.has(n))return!1;a.add(n)}}return!0},_a=_o;function No(e){return typeof e=="object"&&e!==null}function K(e){if(!No(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}var Na=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:a}=t.algorithm;if(typeof a!="number"||a<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}};function Z(e){return K(e)&&typeof e.kty=="string"}function Ia(e){return e.kty!=="oct"&&typeof e.d=="string"}function Oa(e){return e.kty!=="oct"&&typeof e.d>"u"}function Da(e){return Z(e)&&e.kty==="oct"&&typeof e.k=="string"}function Oo(e){let t,a;switch(e.kty){case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},a=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},a=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},a=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new q('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":t={name:"ECDSA",namedCurve:"P-256"},a=e.d?["sign"]:["verify"];break;case"ES384":t={name:"ECDSA",namedCurve:"P-384"},a=e.d?["sign"]:["verify"];break;case"ES512":t={name:"ECDSA",namedCurve:"P-521"},a=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},a=e.d?["deriveBits"]:[];break;default:throw new q('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":t={name:"Ed25519"},a=e.d?["sign"]:["verify"];break;case"EdDSA":t={name:e.crv},a=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},a=e.d?["deriveBits"]:[];break;default:throw new q('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new q('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:a}}var Do=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:a}=Oo(e),r=[t,e.ext??!1,e.key_ops??a],o={...e};return delete o.alg,delete o.use,fe.subtle.importKey("jwk",o,...r)},De=Do;var qa=e=>B(e),we,be,za=e=>e?.[Symbol.toStringTag]==="KeyObject",qe=async(e,t,a,r,o=!1)=>{let n=e.get(t);if(n?.[r])return n[r];let i=await De({...a,alg:r});return o&&Object.freeze(t),n?n[r]=i:e.set(t,{[r]:i}),i},qo=(e,t)=>{if(za(e)){let a=e.export({format:"jwk"});return delete a.d,delete a.dp,delete a.dq,delete a.p,delete a.q,delete a.qi,a.k?qa(a.k):(be||(be=new WeakMap),qe(be,e,a,t))}return Z(e)?e.k?B(e.k):(be||(be=new WeakMap),qe(be,e,e,t,!0)):e},zo=(e,t)=>{if(za(e)){let a=e.export({format:"jwk"});return a.k?qa(a.k):(we||(we=new WeakMap),qe(we,e,a,t))}return Z(e)?e.k?B(e.k):(we||(we=new WeakMap),qe(we,e,e,t,!0)):e},vt={normalizePublicKey:qo,normalizePrivateKey:zo};async function Ce(e,t){if(!K(e))throw new TypeError("JWK must be an object");switch(t||(t=e.alg),e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return B(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new q('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return De({...e,alg:t});default:throw new q('Unsupported "kty" (Key Type) Parameter value')}}var ve=e=>e?.[Symbol.toStringTag],xt=(e,t,a)=>{if(t.use!==void 0&&t.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(t.key_ops!==void 0&&t.key_ops.includes?.(a)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${a}`);if(t.alg!==void 0&&t.alg!==e)throw new TypeError(`Invalid key for this operation, when present its alg must be ${e}`);return!0},Fo=(e,t,a,r)=>{if(!(t instanceof Uint8Array)){if(r&&Z(t)){if(Da(t)&&xt(e,t,a))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!bt(t))throw new TypeError(wt(e,t,...he,"Uint8Array",r?"JSON Web Key":null));if(t.type!=="secret")throw new TypeError(`${ve(t)} instances for symmetric algorithms must be of type "secret"`)}},Bo=(e,t,a,r)=>{if(r&&Z(t))switch(a){case"sign":if(Ia(t)&&xt(e,t,a))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(Oa(t)&&xt(e,t,a))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!bt(t))throw new TypeError(wt(e,t,...he,r?"JSON Web Key":null));if(t.type==="secret")throw new TypeError(`${ve(t)} instances for asymmetric algorithms must not be of type "secret"`);if(a==="sign"&&t.type==="public")throw new TypeError(`${ve(t)} instances for asymmetric algorithm signing must be of type "private"`);if(a==="decrypt"&&t.type==="public")throw new TypeError(`${ve(t)} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&a==="verify"&&t.type==="private")throw new TypeError(`${ve(t)} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&a==="encrypt"&&t.type==="private")throw new TypeError(`${ve(t)} instances for asymmetric algorithm encryption must be of type "public"`)};function Fa(e,t,a,r){t.startsWith("HS")||t==="dir"||t.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(t)?Fo(t,a,r,e):Bo(t,a,r,e)}var _s=Fa.bind(void 0,!1),Et=Fa.bind(void 0,!0);function Ko(e,t,a,r,o){if(o.crit!==void 0&&r?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(i=>typeof i!="string"||i.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let n;a!==void 0?n=new Map([...Object.entries(a),...t.entries()]):n=t;for(let i of r.crit){if(!n.has(i))throw new q(`Extension Header Parameter "${i}" is not recognized`);if(o[i]===void 0)throw new e(`Extension Header Parameter "${i}" is missing`);if(n.get(i)&&r[i]===void 0)throw new e(`Extension Header Parameter "${i}" MUST be integrity protected`)}return new Set(r.crit)}var Ba=Ko;var Wo=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(a=>typeof a!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)},Ka=Wo;function kt(e,t){let a=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:a,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:a,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:a,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:a,name:"ECDSA",namedCurve:t.namedCurve};case"Ed25519":return{name:"Ed25519"};case"EdDSA":return{name:t.name};default:throw new q(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function Tt(e,t,a){if(a==="sign"&&(t=await vt.normalizePrivateKey(t,e)),a==="verify"&&(t=await vt.normalizePublicKey(t,e)),Oe(t))return Ha(t,e,a),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(ht(t,...he));return fe.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[a])}throw new TypeError(ht(t,...he,"Uint8Array","JSON Web Key"))}var Jo=async(e,t,a,r)=>{let o=await Tt(e,t,"verify");Na(e,o);let n=kt(e,o.algorithm);try{return await fe.subtle.verify(n,o,a,r)}catch{return!1}},Wa=Jo;async function Ja(e,t,a){if(!K(e))throw new R("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new R('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new R("JWS Protected Header incorrect type");if(e.payload===void 0)throw new R("JWS Payload missing");if(typeof e.signature!="string")throw new R("JWS Signature missing or incorrect type");if(e.header!==void 0&&!K(e.header))throw new R("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{let k=B(e.protected);r=JSON.parse(V.decode(k))}catch{throw new R("JWS Protected Header is invalid")}if(!_a(r,e.header))throw new R("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let o={...r,...e.header},n=Ba(R,new Map([["b64",!0]]),a?.crit,r,o),i=!0;if(n.has("b64")&&(i=r.b64,typeof i!="boolean"))throw new R('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:s}=o;if(typeof s!="string"||!s)throw new R('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=a&&Ka("algorithms",a.algorithms);if(l&&!l.has(s))throw new Te('"alg" (Algorithm) Header Parameter value not allowed');if(i){if(typeof e.payload!="string")throw new R("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new R("JWS Payload must be a string or an Uint8Array instance");let c=!1;typeof t=="function"?(t=await t(r,e),c=!0,Et(s,t,"verify"),Z(t)&&(t=await Ce(t,s))):Et(s,t,"verify");let d=$a(ge.encode(e.protected??""),ge.encode("."),typeof e.payload=="string"?ge.encode(e.payload):e.payload),p;try{p=B(e.signature)}catch{throw new R("Failed to base64url decode the signature")}if(!await Wa(s,t,p,d))throw new Se;let m;if(i)try{m=B(e.payload)}catch{throw new R("Failed to base64url decode the payload")}else typeof e.payload=="string"?m=ge.encode(e.payload):m=e.payload;let g={payload:m};return e.protected!==void 0&&(g.protectedHeader=r),e.header!==void 0&&(g.unprotectedHeader=e.header),c?{...g,key:t}:g}async function Ga(e,t,a){if(e instanceof Uint8Array&&(e=V.decode(e)),typeof e!="string")throw new R("Compact JWS must be a string or Uint8Array");let{0:r,1:o,2:n,length:i}=e.split(".");if(i!==3)throw new R("Invalid Compact JWS");let s=await Ja({payload:o,protected:r,signature:n},t,a),l={payload:s.payload,protectedHeader:s.protectedHeader};return typeof t=="function"?{...l,key:s.key}:l}var ja=e=>Math.floor(e.getTime()/1e3);var Go=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,St=e=>{let t=Go.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");let a=parseFloat(t[2]),r=t[3].toLowerCase(),o;switch(r){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(a);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(a*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(a*3600);break;case"day":case"days":case"d":o=Math.round(a*86400);break;case"week":case"weeks":case"w":o=Math.round(a*604800);break;default:o=Math.round(a*31557600);break}return t[1]==="-"||t[4]==="ago"?-o:o};var Ua=e=>e.toLowerCase().replace(/^application\//,""),jo=(e,t)=>typeof e=="string"?t.includes(e):Array.isArray(e)?t.some(Set.prototype.has.bind(new Set(e))):!1,Va=(e,t,a={})=>{let r;try{r=JSON.parse(V.decode(t))}catch{}if(!K(r))throw new ce("JWT Claims Set must be a top-level JSON object");let{typ:o}=a;if(o&&(typeof e.typ!="string"||Ua(e.typ)!==Ua(o)))throw new z('unexpected "typ" JWT header value',r,"typ","check_failed");let{requiredClaims:n=[],issuer:i,subject:s,audience:l,maxTokenAge:c}=a,d=[...n];c!==void 0&&d.push("iat"),l!==void 0&&d.push("aud"),s!==void 0&&d.push("sub"),i!==void 0&&d.push("iss");for(let g of new Set(d.reverse()))if(!(g in r))throw new z(`missing required "${g}" claim`,r,g,"missing");if(i&&!(Array.isArray(i)?i:[i]).includes(r.iss))throw new z('unexpected "iss" claim value',r,"iss","check_failed");if(s&&r.sub!==s)throw new z('unexpected "sub" claim value',r,"sub","check_failed");if(l&&!jo(r.aud,typeof l=="string"?[l]:l))throw new z('unexpected "aud" claim value',r,"aud","check_failed");let p;switch(typeof a.clockTolerance){case"string":p=St(a.clockTolerance);break;case"number":p=a.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:f}=a,m=ja(f||new Date);if((r.iat!==void 0||c)&&typeof r.iat!="number")throw new z('"iat" claim must be a number',r,"iat","invali
1d");if(r.nbf!==void 0){if(typeof r.nbf!="number")throw new z('"nbf" claim must be a number',r,"nbf","invalid");if(r.nbf>m+p)throw new z('"nbf" claim timestamp check failed',r,"nbf","check_failed")}if(r.exp!==void 0){if(typeof r.exp!="number")throw new z('"exp" claim must be a number',r,"exp","invalid");if(r.exp<=m-p)throw new ye('"exp" claim timestamp check failed',r,"exp","check_failed")}if(c){let g=m-r.iat,k=typeof c=="number"?c:St(c);if(g-p>k)throw new ye('"iat" claim timestamp check failed (too far in the past)',r,"iat","check_failed");if(g<0-p)throw new z('"iat" claim timestamp check failed (it should be in the past)',r,"iat","check_failed")}return r};async function Lt(e,t,a){let r=await Ga(e,t,a);if(r.protectedHeader.crit?.includes("b64")&&r.protectedHeader.b64===!1)throw new ce("JWTs MUST NOT use unencoded payload");let n={payload:Va(r.protectedHeader,r.payload,a),protectedHeader:r.protectedHeader};return typeof t=="function"?{...n,key:r.key}:n}var Ya=B;function Ct(e){let t;if(typeof e=="string"){let a=e.split(".");(a.length===3||a.length===5)&&([t]=a)}else if(typeof e=="object"&&e)if("protected"in e)t=e.protected;else throw new TypeError("Token does not contain a Protected Header");try{if(typeof t!="string"||!t)throw new Error;let a=JSON.parse(V.decode(Ya(t)));if(!K(a))throw new Error;return a}catch{throw new TypeError("Invalid Token or Protected Header formatting")}}function Xa(e){let t=document.cookie.match(new RegExp(`(?:^|; )${e}=([^;]*)`));return t?decodeURIComponent(t[1]):null}function Za(e,t,a){document.cookie=`${e}=${encodeURIComponent(t)}; path=/; max-age=${a}; SameSite=Lax`}function Qa(e){document.cookie=`${e}=; path=/; max-age=0`}var ze="ap_access_token",er="aero_paywall_jwks_cache_v1",Vo=1440*60*1e3;async function Yo(e){let t=Xo();if(t&&t.jwksUrl===e&&Date.now()-t.fetchedAt<Vo)return t.keys;let a=await fetch(e);if(!a.ok){if(t)return t.keys;throw new Error(`Failed to fetch JWKS: ${a.status}`)}let r=await a.json();return Zo({jwksUrl:e,keys:r.keys,fetchedAt:Date.now()}),r.keys}function Xo(){try{let e=localStorage.getItem(er);return e?JSON.parse(e):null}catch{return null}}function Zo(e){try{localStorage.setItem(er,JSON.stringify(e))}catch{}}async function Pe(e,t){try{let a=Ct(e),o=(await Yo(t)).find(s=>s.kid===a.kid);if(!o||!o.alg)return null;let n=await Ce(o,o.alg),{payload:i}=await Lt(e,n,{algorithms:[o.alg]});return i}catch{return null}}function M(){return Xa(ze)}function D(e,t){Za(ze,e,t)}function de(){Qa(ze)}var tr=900;async function ar(e){try{let t=await fetch(`${e}/auth/refresh`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!t.ok)return de(),null;let r=(await t.json().catch(()=>null))?.data?.accessToken;return r?(D(r,tr),r):(de(),null)}catch{return null}}async function Pt(e){let t=M();return t||ar(e)}async function At(e){try{await fetch(`${e}/auth/logout`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})}catch{}}var Fe="aero_paywall_device_id";function Mt(){try{let e=localStorage.getItem(Fe);return e||(e=crypto.randomUUID(),localStorage.setItem(Fe,e)),e}catch{try{let e=sessionStorage.getItem(Fe);return e||(e=crypto.randomUUID(),sessionStorage.setItem(Fe,e)),e}catch{return crypto.randomUUID()}}}async function $t(e,t,a,r){let o={"X-Device-Id":a};t&&(o.Authorization=`Bearer ${t}`),r&&(o["X-Gift-Token"]=r);let n=await fetch(`/wp-json/aeropaywall/v1/articles/${e}`,{headers:o});if(!n.ok)throw new Error(`Entitlement check failed: ${n.status}`);let i=await n.json();return{stage:i.stage,remaining:i.remaining,remainingToRegister:i.remainingToRegister??null,isSubscriber:i.isSubscriber,content:i.content}}function Ht(e,t){switch(e){case"open":return{reveal:"full",mount:null,remaining:t};case"register_prompt":return{reveal:"blur",mount:"register",remaining:t};case"profile_prompt":return{reveal:"blur",mount:"profile",remaining:t};case"paid_lock":return{reveal:"none",mount:"checkout",remaining:t}}}function Rt(e,t,a=null){let r=e.querySelector(".aero-paywall-locked");if(r&&t.reveal==="full"&&a!==null){r.innerHTML=a,r.classList.add("aero-paywall-revealed");let n=e.querySelector(".aero-paywall-preview");n&&(n.hidden=!0)}let o={register:".aero-paywall-mount-register",profile:".aero-paywall-mount-profile",checkout:".aero-paywall-mount-checkout"};for(let[n,i]of Object.entries(o)){let s=e.querySelector(i);s&&(s.hidden=t.mount!==n)}if(t.mount!==null){let n=e.querySelector(".aero-paywall-locked-placeholder");n&&(n.hidden=!0)}}var rr='<svg width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"/><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"/></svg>',Qo='<svg width="16" height="16" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"/></svg>';function or(e){if(e.type!=="password"||e.dataset.aeroToggleAttached)return;e.dataset.aeroToggleAttached="1";let t=document.createElement("span");t.className="aero-paywall-password-wrapper",t.style.cssText="position:relative;display:inline-block;width:100%",e.parentNode?.insertBefore(t,e),t.appendChild(e);let a=document.createElement("button");a.type="button",a.className="aero-paywall-password-toggle",a.setAttribute("aria-label","Show password"),a.innerHTML=rr,a.style.cssText="position:absolute;right:8px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;line-height:0;color:inherit;",t.appendChild(a),a.addEventListener("click",()=>{let r=e.type==="text";e.type=r?"password":"text",a.setAttribute("aria-label",r?"Show password":"Hide password"),a.innerHTML=r?rr:Qo})}function Q(e){e.querySelectorAll('input[type="password"]').forEach(or)}var nr={recaptcha:"aero-paywall-recaptcha-script",turnstile:"aero-paywall-turnstile-script"},en={recaptcha:"https://www.google.com/recaptcha/api.js?render=explicit",turnstile:"https://challenges.cloudflare.com/turnstile/v0/api.js"};function tn(e){return new Promise(t=>{if(document.getElementById(nr[e])){t();return}let a=document.createElement("script");a.id=nr[e],a.src=en[e],a.async=!0,a.defer=!0,a.onload=()=>t(),document.head.appendChild(a)})}function ir(e,t=5e3,a=100){return new Promise((r,o)=>{let n=Date.now(),i=()=>
1{if(e()){r();return}if(Date.now()-n>t){o(new Error("Captcha script did not become ready in time"));return}setTimeout(i,a)};i()})}async function xe(e,t){if(!t)return Object.assign(()=>{},{reset:()=>{}});if(await tn(t.provider),t.provider==="recaptcha"){await ir(()=>!!window.grecaptcha?.render);let o=window.grecaptcha.render(e,{sitekey:t.siteKey});return Object.assign(()=>window.grecaptcha.getResponse(o)||void 0,{reset:()=>window.grecaptcha?.reset?.(o)})}await ir(()=>!!window.turnstile?.render);let a,r=window.turnstile.render(e,{sitekey:t.siteKey,callback:o=>{a=o}});return Object.assign(()=>a,{reset:()=>{a=void 0,window.turnstile?.reset?.(r)}})}var an="#1a73e8",rn=900;function on(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function te(e=an,t){let a=document.createElement("form");return a.className="aero-paywall-form aero-paywall-register-form",a.noValidate=!0,a.innerHTML=`
2    <p class="aero-paywall-form-title">Create a free account to keep reading</p>
3    <label>First name<input type="text" name="firstName" autocomplete="given-name" /></label>
4    <label>Email<input type="email" name="email" autocomplete="email" required /></label>
5    <label>Password<input type="password" name="password" autocomplete="new-password" minlength="8" required /></label>
6    ${t?'<div class="aero-paywall-captcha-mount"></div>':""}
7    <button type="submit" style="background:${e}">Continue</button>
8    <p class="aero-paywall-form-error" role="alert" hidden></p>
9  `,Q(a),a}function ae(e,t,a,r){let o=e.querySelector(".aero-paywall-form-error"),n=e.querySelector('button[type="submit"]'),i=e.querySelector(".aero-paywall-captcha-mount"),s=i?xe(i,r):Promise.resolve(()=>{});e.addEventListener("submit",c=>{c.preventDefault(),l()});async function l(){o&&(o.hidden=!0,o.textContent=""),n&&(n.disabled=!0);let c=new FormData(e),d=typeof window<"u"?new URLSearchParams(window.location.search).get("ref"):null,p=(await s)(),f={email:String(c.get("email")??""),password:String(c.get("password")??""),firstName:String(c.get("firstName")??"")||void 0,referralCode:d||void 0,captchaToken:p};try{let m=await fetch(`${t}/auth/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(f)}),g=await m.json().catch(()=>null);if(!m.ok||!g?.data)throw new Error(on(g,"Registration failed"));D(g.data.accessToken,rn),a(g.data)}catch(m){o&&(o.textContent=m instanceof Error?m.message:"Registration failed",o.hidden=!1)}finally{n&&(n.disabled=!1)}}}var nn="#1a73e8",sn=900;function ln(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function re(e=nn){let t=document.createElement("form");return t.className="aero-paywall-form aero-paywall-login-form",t.noValidate=!0,t.innerHTML=`
10    <p class="aero-paywall-form-title">Log in to your account</p>
11    <label>Email<input type="email" name="email" autocomplete="email" required /></label>
12    <label>Password<input type="password" name="password" autocomplete="current-password" required /></label>
13    <button type="submit" style="background:${e}">Log in</button>
14    <p class="aero-paywall-form-error" role="alert" hidden></p>
15  `,Q(t),t}function oe(e,t,a){let r=e.querySelector(".aero-paywall-form-error"),o=e.querySelector('button[type="submit"]');e.addEventListener("submit",i=>{i.preventDefault(),n()});async function n(){r&&(r.hidden=!0,r.textContent=""),o&&(o.disabled=!0);let i=new FormData(e),s={email:String(i.get("email")??""),password:String(i.get("password")??"")};try{let l=await fetch(`${t}/auth/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)}),c=await l.json().catch(()=>null);if(!l.ok||!c?.data)throw new Error(ln(c,"Login failed"));D(c.data.accessToken,sn),a(c.data)}catch(l){r&&(r.textContent=l instanceof Error?l.message:"Login failed",r.hidden=!1)}finally{o&&(o.disabled=!1)}}}var sr="#1a73e8",cn=900;function dn(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;
15if(typeof a=="string")return a}return t}function _t(e=sr){let t=document.createElement("form");return t.className="aero-paywall-form aero-paywall-profile-form",t.noValidate=!0,t.innerHTML=`
16    <p class="aero-paywall-form-title">A few more details to continue reading</p>
17    <label>Last name<input type="text" name="lastName" autocomplete="family-name" required /></label>
18    <label>Phone (optional)<input type="tel" name="phone" autocomplete="tel" /></label>
19    <label>Company (optional)<input type="text" name="company" autocomplete="organization" /></label>
20    <button type="submit" style="background:${e}">Continue</button>
21    <p class="aero-paywall-form-error" role="alert" hidden></p>
22  `,t}function Nt(e,t=sr){let a=document.createElement("form");a.className="aero-paywall-form aero-paywall-profile-form aero-paywall-account-profile-form",a.noValidate=!0;let r=o=>o.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;");return a.innerHTML=`
23    <label>Last name<input type="text" name="lastName" autocomplete="family-name" value="${r(e.lastName??"")}" /></label>
24    <label>Phone<input type="tel" name="phone" autocomplete="tel" value="${r(e.phone??"")}" /></label>
25    <label>Company<input type="text" name="company" autocomplete="organization" value="${r(e.company??"")}" /></label>
26    <button type="submit" style="background:${t}">Save changes</button>
27    <p class="aero-paywall-form-error" role="alert" hidden></p>
28    <p class="aero-paywall-form-success" role="status" hidden></p>
29  `,a}function Ae(e,t,a,r){let o=e.querySelector(".aero-paywall-form-error"),n=e.querySelector(".aero-paywall-form-success"),i=e.querySelector('button[type="submit"]');e.addEventListener("submit",l=>{l.preventDefault(),s()});async function s(){o&&(o.hidden=!0,o.textContent=""),n&&(n.hidden=!0),i&&(i.disabled=!0);let l=new FormData(e),c={};for(let p of["lastName","phone","company"]){let f=String(l.get(p)??"").trim();f&&(c[p]=f)}if(e.querySelector('input[name="lastName"]')?.required&&!c.lastName){o&&(o.textContent="Please enter your last name to continue.",o.hidden=!1),i&&(i.disabled=!1);return}try{let p=await fetch(`${t}/me`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(c)}),f=await p.json().catch(()=>null);if(!p.ok||!f?.data)throw new Error(dn(f,"Could not save profile"));f.data.accessToken&&D(f.data.accessToken,cn),n&&(n.textContent="Profile updated.",n.hidden=!1),r(f.data)}catch(p){o&&(o.textContent=p instanceof Error?p.message:"Could not save profile",o.hidden=!1)}finally{i&&(i.disabled=!1)}}}var pn=900,un="https://accounts.google.com/gsi/client",mn="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js";function fn(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function lr(e=typeof navigator<"u"?navigator.userAgent:""){return/iPhone|iPad|iPod|Macintosh/.test(e)}function W(e,t,a){let r=!!t&&lr(a);if(!e&&!r)return null;let o=document.createElement("div");if(o.className="aero-paywall-oauth-buttons",e){let n=document.createElement("div");n.className="aero-paywall-oauth-google",o.appendChild(n)}if(r){let n=document.createElement("button");n.type="button",n.className="aero-paywall-oauth-apple",n.textContent="Continue with Apple",o.appendChild(n)}return o}function J(){let e=document.createElement("div");e.className="aero-paywall-prompt-divider";let t=document.createElement("span");return t.textContent="or",e.appendChild(t),e}var It=new Map;function Ot(e){let t=It.get(e);if(t)return t;let a=new Promise((r,o)=>{let n=document.createElement("script");n.src=e,n.async=!0,n.onload=()=>r(),n.onerror=()=>{It.delete(e),o(new Error(`Failed to load ${e}`))},document.head.appendChild(n)});return It.set(e,a),a}async function Dt(e,t,a,r,o){try{let n=await fetch(`${a}/auth/oauth/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({idToken:t})}),i=await n.json().catch(()=>null);if(!n.ok||!i?.data)throw new Error(fn(i,"Sign-in failed"));D(i.data.accessToken,pn),r(i.data)}catch(n){o(n instanceof Error?n.message:"Sign-in failed")}}function G(e,t,a,r,o,n){let i=e.querySelector(".aero-paywall-oauth-google");a&&i&&Ot(un).then(()=>{window.google&&(window.google.accounts.id.initialize({client_id:a,callback:l=>{Dt("google",l.credential,t,o,n)}}),window.google.accounts.id.renderButton(i,{theme:"outline",size:"large",width:280}))});let s=e.querySelector(".aero-paywall-oauth-apple");r&&s&&s.addEventListener("click",()=>
29{Ot(mn).then(async()=>{if(!window.AppleID)return;window.AppleID.auth.init({clientId:r,scope:"email name",redirectURI:window.location.href,usePopup:!0});let l=await window.AppleID.auth.signIn();await Dt("apple",l.authorization.id_token,t,o,n)}).catch(l=>n(l instanceof Error?l.message:"Sign-in failed"))})}var qt={register:".aero-paywall-mount-register",profile:".aero-paywall-mount-profile",checkout:".aero-paywall-mount-checkout"},gn={register_prompt:{headline:"Create a free account to keep reading",subcopy:"It's quick, free, and only takes a moment.",cta:"Continue",offerBadge:""},profile_prompt:{headline:"One more step to keep reading",subcopy:"Complete your profile \u2014 it only takes a moment.",cta:"Continue",offerBadge:""},paid_lock:{headline:"Subscribe to keep reading",subcopy:"Get unlimited access to every story.",cta:"Subscribe now",offerBadge:""}};function zt(e,t){return e.promptCopy?.[t]??gn[t]}function Me(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Ft(e,t){return e.innerHTML=`
30    <div class="aero-paywall-prompt-card">
31      <div class="aero-paywall-prompt-icon" aria-hidden="true"></div>
32      ${t.offerBadge?`<p class="aero-paywall-prompt-eyebrow">${Me(t.offerBadge)}</p>`:""}
33      <p class="aero-paywall-prompt-headline">${Me(t.headline)}</p>
34      ${t.subcopy?`<p class="aero-paywall-prompt-subcopy">${Me(t.subcopy)}</p>`:""}
35      <div class="aero-paywall-prompt-card-body"></div>
36    </div>
37  `,e.querySelector(".aero-paywall-prompt-card-body")}function Bt(e,t,a){if(e==="register"){pr(t,a);return}if(e==="profile"){yn(t,a);return}e==="checkout"&&hn(t,a)}function pr(e,t){let a=e.querySelector(qt.register);if(!a||a.dataset.aeroMounted)return;a.dataset.aeroMounted="1",a.hidden=!1;let r=zt(t,"register_prompt"),o=Ft(a,r),n=()=>{window.location.reload()};i();function i(){o.innerHTML="",o.appendChild(dr("Already have an account?","Log in",s));let l=te(t.accentColor,t.captcha);o.appendChild(l),ae(l,t.apiBaseUrl,n,t.captcha),ur(l,r.cta),cr(o,t,n)}function s(){o.innerHTML="",o.appendChild(dr("Don't have an account?","Register",i));let l=re(t.accentColor);o.appendChild(l),oe(l,t.apiBaseUrl,n),cr(o,t,n)}}function cr(e,t,a){let r=W(t.googleClientId,t.appleClientId);if(!r)return;let o=n=>{let i=e.querySelector(".aero-paywall-form-error");i&&(i.textContent=n,i.hidden=!1)};e.appendChild(J()),e.appendChild(r),G(r,t.apiBaseUrl,t.googleClientId,t.appleClientId,a,o)}function ur(e,t){let a=e.querySelector('button[type="submit"]');a&&(a.textContent=t)}function dr(e,t,a){let r=document.createElement("div");r.className="aero-paywall-auth-footer";let o=document.createElement("span");o.textContent=e,r.appendChild(o);let n=document.createElement("button");return n.type="button",n.className="aero-paywall-auth-toggle-link aero-paywall-auth-footer-link",n.textContent=t,n.addEventListener("click",a),r.appendChild(n),r}function yn(e,t){let a=e.querySelector(qt.profile);if(!a||a.dataset.aeroMounted)return;let r=M();if(!r){pr(e,t);return}a.dataset.aeroMounted="1";let o=zt(t,"profile_prompt"),n=Ft(a,o),i=_t(t.accentColor);n.appendChild(i),Ae(i,t.apiBaseUrl,r,()=>window.location.reload()),ur(i,o.cta)}function hn(e,t){let a=e.querySelector(qt.checkout);if(!a||a.dataset.aeroMounted)return;a.dataset.aeroMounted="1";let r=zt(t,"paid_lock"),o=Ft(a,r),n=M()!==null,i=wn(t.accountUrl);if(o.innerHTML=`
38    ${i?`<a class="aero-paywall-prompt-cta" href="${Me(i)}">${Me(r.cta)}</a>`:""}
39    ${n?"":`
40    <div class="aero-paywall-prompt-divider"><span>or</span></div>
41    <button type="button" class="aero-paywall-auth-toggle-link aero-paywall-prompt-login-toggle">Already a subscriber? Log in</button>
42    <div class="aero-paywall-prompt-login-mount" hidden></div>
43    `}
44  `,n)return;let s=o.querySelector(".aero-paywall-prompt-login-toggle"),l=o.querySelector(".aero-paywall-prompt-login-mount");s.addEventListener("click",()=>{if(l.dataset.aeroMounted){l.hidden=!1,s.hidden=!0;return}l.dataset.aeroMounted="1",s.hidden=!0,l.hidden=!1;let c=()=>window.location.reload(),d=m=>{let g=l.querySelector(".aero-paywall-form-error");g&&(g.textContent=m,g.hidden=!1)},p=W(t.googleClientId,t.appleClientId);p&&(l.appendChild(p),G(p,t.apiBaseUrl,t.googleClientId,t.appleClientId,c,d),l.appendChild(J()));let f=re(t.accentColor);l.appendChild(f),oe(f,t.apiBaseUrl,c)})}function wn(e){if(!e)return null;let t=new URL(e,typeof window<"u"?window.location.href:void 0);return t.searchParams.set("tab","subscribe"),typeof window<"u"&&t.searchParams.set("return_to",window.location.href),t.toString()}var mr="aero-paywall-funnel-counter",fr="aero_paywall_counter_dismissed_at",gr="aero_paywall_counter_position";function bn(){try{let e=window.localStorage.getItem(fr);if(e===null)return null;let t=Number(e);return Number.isFinite(t)?t:null}catch{return null}}function vn(e){try{window.localStorage.setItem(fr,String(e))}catch{}}function xn(){try{let e=window.localStorage.getItem(gr);return e?JSON.parse(e):null}catch{return null}}function En(e){try{window.localStorage.setItem(gr,JSON.stringify(e))}catch{}}function kn(e){let t=!1,a=0,r=0,o=0,n=0,i=4,s=!1;e.addEventListener("pointerdown",c=>{if(c.target.closest(".aero-paywall-counter-close"))return;t=!0,s=!1;let d=e.getBoundingClientRect();o=d.left,n=d.top,a=c.clientX,r=c.clientY,e.setPointerCapture(c.pointerId)}),e.addEventListener("pointermove",c=>
44{if(!t)return;let d=c.clientX-a,p=c.clientY-r;if((Math.abs(d)>i||Math.abs(p)>i)&&(s=!0),!s)return;let f=e.getBoundingClientRect(),m=window.innerWidth-f.width,g=window.innerHeight-f.height,k=Math.min(Math.max(o+d,0),Math.max(m,0)),A=Math.min(Math.max(n+p,0),Math.max(g,0));e.style.left=`${k}px`,e.style.top=`${A}px`,e.style.right="auto",e.style.bottom="auto"});let l=c=>{t&&(t=!1,s&&En({left:parseFloat(e.style.left),top:parseFloat(e.style.top)}),e.releasePointerCapture(c.pointerId))};e.addEventListener("pointerup",l),e.addEventListener("pointercancel",l)}function Tn(){let e=document.createElement("div");e.id=mr,e.className="aero-paywall-counter",e.setAttribute("role","status"),e.innerHTML=`
45    <span class="aero-paywall-counter-dot" aria-hidden="true"></span>
46    <span class="aero-paywall-counter-text"></span>
47    <button type="button" class="aero-paywall-counter-close" aria-label="Dismiss">&times;</button>
48  `;let t=xn();return t&&(e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.right="auto",e.style.bottom="auto"),kn(e),document.body.appendChild(e),e}function yr(e,t,a){if(typeof document>"u"||typeof window>"u")return;let r=e?t:a,o=document.getElementById(mr);if(r===null){o?.remove();return}let n=bn();if(n!==null&&n===r){o?.remove();return}let i=o??Tn(),s=i.querySelector(".aero-paywall-counter-text");if(s){let c=r===1?"article":"articles";s.innerHTML=e?`<strong>${r}</strong> free ${c} left before you need to subscribe`:`<strong>${r}</strong> free ${c} left before you must register`}let l=i.querySelector(".aero-paywall-counter-close");l&&!l.dataset.bound&&(l.dataset.bound="true",l.addEventListener("click",()=>{vn(r),i.remove()}))}var Sn="[data-bd-article-body]";function Ln(e,t){if(e.querySelector(".aero-paywall-locked"))return;let a=e.querySelector(Sn);if(!a)return;let r=document.createElement("div");r.className="aero-paywall-locked aero-paywall-hard-wall",t.postId!==null&&(r.dataset.aeroPostId=String(t.postId));let o=document.createElement("p");o.className="aero-paywall-locked-placeholder",o.textContent=t.promptCopy?.paid_lock?.headline??"Subscribe to keep reading this article.",r.appendChild(o);for(let n of["register","profile","checkout"]){let i=document.createElement("div");i.className=`aero-paywall-mount aero-paywall-mount-${n}`,i.hidden=!0,r.appendChild(i)}a.replaceChildren(r)}async function Kt(e,t=document){if(e.postId===null)return null;let a=M(),r=Mt(),o=typeof window<"u"?new URLSearchParams(window.location.search).get("aero_gift"):null,n=await $t(String(e.postId),a,r,o),i=Ht(n.stage,n.remaining);i.reveal!=="full"&&Ln(t,e),Rt(t,i,n.content),Bt(i.mount,t,e);let s=!!e.isPremium;return yr(!!a,a&&!s?null:n.remaining,n.remainingToRegister),{plan:i,isSubscriber:n.isSubscriber}}var hr="aero_paywall_slide_in_shown";var Cn="#1a73e8";function wr(){try{return sessionStorage.getItem(hr)!=="1"}catch{return!0}}function Pn(){try{sessionStorage.setItem(hr,"1")}catch{}}function br(e,t=Cn){let a=document.createElement("div");a.className="aero-paywall-slide-in",a.setAttribute("role","status"),a.style.cssText=["position:fixed","right:16px","bottom:16px","max-width:320px","padding:16px","border-radius:12px","background:rgba(255,255,255,0.7)","backdrop-filter:blur(12px)","-webkit-backdrop-filter:blur(12px)","box-shadow:0 8px 32px rgba(0,0,0,0.15)",`border:1px solid ${t}33`,"transform:translateY(120%)","transition:transform 0.4s ease-out","z-index:2147483000","font:14px/1.4 system-ui,sans-serif"].join(";");let r=document.createElement("span");r.textContent=e>0?`${e} free article${e===1?"":"s"} remaining`:"You have reached your free article limit",a.appendChild(r);let o=document.createElement("button");return o.setAttribute("aria-label","Dismiss"),o.textContent="\xD7",o.style.cssText="margin-left:12px;background:none;border:none;cursor:pointer;font-size:16px;color:inherit;",o.addEventListener("click",()=>a.remove()),a.appendChild(o),a}function Wt(e,t,a,r=document){if(t||e===null||!wr())return;let o=r.querySelector(".aero-paywall-mount-slide-in-alert"),n=br(e,a);(o??document.body).appendChild(n),Pn(),setTimeout(()=>{n.style.transform="translateY(0)"},1500)}var Jt="ins.adsbygoogle",Gt='script[src*="adsbygoogle"], script[src*="pagead"]';function An(){window.adsbygoogle={push:()=>{},loaded:!0}}function Mn(e){e.querySelectorAll(Jt).forEach(t=>t.remove()),e.querySelectorAll(Gt).forEach(t=>t.remove())}function $n(e){let t=new MutationObserver(a=>
48{for(let r of a)r.addedNodes.forEach(o=>{if(o instanceof Element){if(o.matches(Jt)||o.matches(Gt)){o.remove();return}o.querySelectorAll(`${Jt}, ${Gt}`).forEach(n=>n.remove())}})});return t.observe(e,{childList:!0,subtree:!0}),t}function jt(e=document){return An(),Mn(e),$n(e.documentElement??e)}var vr="aero_paywall_private_guard_dismissed";async function Hn(){try{if(!navigator.storage?.estimate)return!1;let{quota:e}=await navigator.storage.estimate();return typeof e=="number"&&e>0&&e<125829120}catch{return!1}}async function Rn(){return typeof indexedDB>"u"?!0:new Promise(e=>{try{let t=indexedDB.open("aero_paywall_private_probe");t.onerror=()=>e(!0),t.onsuccess=()=>{t.result.close(),e(!1)}}catch{e(!0)}})}async function xr(){let[e,t]=await Promise.all([Hn(),Rn()]);return e||t}function _n(){try{return sessionStorage.getItem(vr)==="1"}catch{return!1}}function Er(e){let t=document.createElement("div");t.className="aero-paywall-private-guard",t.style.cssText=["position:fixed","inset:0","z-index:2147483001","display:flex","align-items:center","justify-content:center","background:rgba(0,0,0,0.7)","font:16px/1.5 system-ui,sans-serif"].join(";");let a=document.createElement("div");if(a.style.cssText="background:#fff;border-radius:12px;padding:32px;max-width:400px;text-align:center;",a.innerHTML="<p>It looks like you\u2019re browsing privately. Please log in or subscribe to continue reading.</p>",e==="soft"){let r=document.createElement("button");r.textContent="Continue browsing",r.style.cssText="margin-top:16px;",r.addEventListener("click",()=>{t.remove(),document.body.style.overflow="";try{sessionStorage.setItem(vr,"1")}catch{}}),a.appendChild(r)}return t.appendChild(a),document.body.style.overflow="hidden",t}async function Ut(e,t){e==="off"||!t||_n()||!await xr()||document.body.appendChild(Er(e==="hard"?"hard":"soft"))}var Nn="#1a73e8",In=900;function On(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function Vt(e=Nn){let t=document.createElement("form");return t.className="aero-paywall-form aero-paywall-change-password-form",t.noValidate=!0,t.innerHTML=`
49    <p class="aero-paywall-form-title">Change password</p>
50    <label>Current password<input type="password" name="currentPassword" autocomplete="current-password" required /></label>
51    <label>New password<input type="password" name="newPassword" autocomplete="new-password" minlength="8" required /></label>
52    <label>Confirm new password<input type="password" name="confirmPassword" autocomplete="new-password" minlength="8" required /></label>
53    <button type="submit" style="background:${e}">Update password</button>
54    <p class="aero-paywall-form-error" role="alert" hidden></p>
55    <p class="aero-paywall-form-success" role="status" hidden></p>
56  `,Q(t),t}function Yt(e,t,a){let r=e.querySelector(".aero-paywall-form-error"),o=e.querySelector(".aero-paywall-form-success"),n=e.querySelector('button[type="submit"]');e.addEventListener("submit",s=>{s.preventDefault(),i()});async function i(){r&&(r.hidden=!0,r.textContent=""),o&&(o.hidden=!0);let s=new FormData(e),l=String(s.get("currentPassword")??""),c=String(s.get("newPassword")??""),d=String(s.get("confirmPassword")??"");if(c!==d){r&&(r.textContent="New password and confirmation do not match.",r.hidden=!1);return}let p=M();if(!p){r&&(r.textContent="Your session has expired. Please log in again.",r.hidden=!1);return}n&&(n.disabled=!0);try{let f=await fetch(`${t}/me/password`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${p}`},body:JSON.stringify({currentPassword:l,newPassword:c})}),m=await f.json().catch(()=>null);if(!f.ok||!m?.data)throw new Error(On(m,"Could not change password"));D(m.data.accessToken,In),e.reset(),o&&(o.textContent="Password updated. Your other sessions have been signed out.",o.hidden=!1),a?.()}catch(f){r&&(r.textContent=f instanceof Error?f.message:"Could not change password",r.hidden=!1)}finally{n&&(n.disabled=!1)}}}var kr="#1a73e8";function Dn(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;
56if(typeof a=="string")return a}return t}function $e(e=kr){let t=document.createElement("form");return t.className="aero-paywall-form aero-paywall-request-reset-form",t.noValidate=!0,t.innerHTML=`
57    <p class="aero-paywall-form-title">Reset your password</p>
58    <label>Email<input type="email" name="email" autocomplete="email" required /></label>
59    <button type="submit" style="background:${e}">Send reset link</button>
60    <p class="aero-paywall-form-error" role="alert" hidden></p>
61    <p class="aero-paywall-form-success" role="status" hidden></p>
62  `,t}function He(e,t){let a=e.querySelector(".aero-paywall-form-error"),r=e.querySelector(".aero-paywall-form-success"),o=e.querySelector('button[type="submit"]');e.addEventListener("submit",i=>{i.preventDefault(),n()});async function n(){a&&(a.hidden=!0),r&&(r.hidden=!0),o&&(o.disabled=!0);let i=String(new FormData(e).get("email")??"");try{if(!(await fetch(`${t}/auth/password-reset/request`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:i})})).ok)throw new Error("Could not process your request right now. Please try again.");e.reset(),r&&(r.textContent="If an account exists for that email, a reset link is on its way.",r.hidden=!1)}catch(s){a&&(a.textContent=s instanceof Error?s.message:"Could not process your request",a.hidden=!1)}finally{o&&(o.disabled=!1)}}}function Xt(e=kr){let t=document.createElement("form");return t.className="aero-paywall-form aero-paywall-confirm-reset-form",t.noValidate=!0,t.innerHTML=`
63    <p class="aero-paywall-form-title">Choose a new password</p>
64    <label>New password<input type="password" name="newPassword" autocomplete="new-password" minlength="8" required /></label>
65    <label>Confirm new password<input type="password" name="confirmPassword" autocomplete="new-password" minlength="8" required /></label>
66    <button type="submit" style="background:${e}">Set new password</button>
67    <p class="aero-paywall-form-error" role="alert" hidden></p>
68  `,Q(t),t}function Zt(e,t,a,r){let o=e.querySelector(".aero-paywall-form-error"),n=e.querySelector('button[type="submit"]');e.addEventListener("submit",s=>{s.preventDefault(),i()});async function i(){o&&(o.hidden=!0);let s=new FormData(e),l=String(s.get("newPassword")??""),c=String(s.get("confirmPassword")??"");if(l!==c){o&&(o.textContent="New password and confirmation do not match.",o.hidden=!1);return}n&&(n.disabled=!0);try{let d=await fetch(`${t}/auth/password-reset/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a,newPassword:l})}),p=await d.json().catch(()=>null);if(!d.ok||!p?.data)throw new Error(Dn(p,"This reset link is invalid or has expired."));r()}catch(d){o&&(o.textContent=d instanceof Error?d.message:"This reset link is invalid or has expired.",o.hidden=!1)}finally{n&&(n.disabled=!1)}}}var ta="Failed to load team";function ne(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Be(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}async function Qt(e,t,a){let r=await fetch(`${e}${t}`,{headers:{Authorization:`Bearer ${a}`}}),o=await r.json().catch(()=>null);if(!r.ok||!o?.data)throw new Error(Be(o,ta));return o.data}async function qn(e,t,a,r){let o=await fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r)}),n=await o.json().catch(()=>null);if(!o.ok||!n?.data)throw new Error(Be(n,"Request failed"));return n.data}async function zn(e,t,a,r){let o=await fetch(`${e}${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r)}),n=await o.json().catch(()=>null);if(!o.ok||!n?.data)throw new Error(Be(n,"Request failed"));return n.data}async function Tr(e,t,a){let r=await fetch(`${e}${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}});if(!r.ok){let o=await r.json().catch(()=>null);throw new Error(Be(o,"Request failed"))}}async function ie(e,t,a,r,o,n,i){if(n!=="admin"){try{let s=await Qt(t,`/orgs/${o}`,a);e.innerHTML=`
69        <p class="aero-paywall-account-current">You're on <strong>${ne(s.name)}</strong>'s team subscription.</p>
70        <p class="aero-paywall-account-current-note">Only the team's owner can invite or manage members. Want your own individual subscription instead?</p>
71        <button type="button" class="aero-paywall-switch-to-individual" style="background:${r}">Switch to individual subscription</button>
72      `,e.querySelector(".aero-paywall-switch-to-individual")?.addEventListener("click",()=>{i?.()})}catch(s){e.innerHTML=`<p class="aero-paywall-form-error">${ne(s instanceof Error?s.message:ta)}</p>`}return}try{let s=await Qt(t,`/orgs/${o}`,a),l=await Qt(t,`/orgs/${o}/invites`,a);e.innerHTML=`
73      <p class="aero-paywall-form-title">${ne(s.name)}</p>
74      <p class="aero-paywall-account-current-note">${s.members.length} / ${s.seatsCap} seats used</p>
75      <div class="aero-paywall-history-table-wrap">
76        <table class="aero-paywall-history-table">
77          <thead><tr><th>
77Email</th><th>Name</th><th>Role</th><th></th></tr></thead>
78          <tbody>
79            ${s.members.map(p=>`
80              <tr data-member-id="${p.id}">
81                <td>${ne(p.user.email)}</td>
82                <td>${ne(p.user.firstName??"\u2014")}</td>
83                <td>${ne(p.role)}</td>
84                <td>
85                  <button type="button" class="aero-paywall-cancel-subscription-link" data-team-action="toggle-role" data-role="${p.role}">Make ${p.role==="admin"?"member":"admin"}</button>
86                  <button type="button" class="aero-paywall-cancel-subscription-link" data-team-action="remove">Remove</button>
87                </td>
88              </tr>
89            `).join("")}
90          </tbody>
91        </table>
92      </div>
93      <div class="aero-paywall-account-current-wrap">
94        <p class="aero-paywall-form-title">Pending invites</p>
95        ${l.length===0?'<p class="aero-paywall-account-current-note">No pending invites.</p>':l.map(p=>`
96              <p class="aero-paywall-account-current-note" data-invite-id="${p.id}">
97                ${ne(p.email)}
98                <button type="button" class="aero-paywall-cancel-subscription-link" data-team-action="revoke-invite">Revoke</button>
99              </p>
100            `).join("")}
101      </div>
102      <form class="aero-paywall-upgrade-form" data-team-invite-form>
103        <label>Invite a teammate<input type="email" name="email" required placeholder="[email protected]" /></label>
104        <button type="submit" style="background:${r}">Send invite</button>
105        <p class="aero-paywall-form-error" role="alert" hidden></p>
106      </form>
107    `;let c=e.querySelector(".aero-paywall-upgrade-form .aero-paywall-form-error");e.querySelectorAll('[data-team-action="toggle-role"]').forEach(p=>{p.addEventListener("click",()=>{let f=p.closest("[data-member-id]"),m=p.dataset.role==="admin"?"member":"admin";zn(t,`/orgs/${o}/members/${f.dataset.memberId}`,a,{role:m}).then(()=>ie(e,t,a,r,o,n)).catch(g=>ea(e,g))})}),e.querySelectorAll('[data-team-action="remove"]').forEach(p=>{p.addEventListener("click",()=>{let f=p.closest("[data-member-id]");Tr(t,`/orgs/${o}/members/${f.dataset.memberId}`,a).then(()=>ie(e,t,a,r,o,n)).catch(m=>ea(e,m))})}),e.querySelectorAll('[data-team-action="revoke-invite"]').forEach(p=>{p.addEventListener("click",()=>{let f=p.closest("[data-invite-id]");Tr(t,`/orgs/${o}/invites/${f.dataset.inviteId}`,a).then(()=>ie(e,t,a,r,o,n)).catch(m=>ea(e,m))})});let d=e.querySelector("[data-team-invite-form]");d?.addEventListener("submit",p=>{p.preventDefault(),c&&(c.hidden=!0);let f=new FormData(d).get("email");qn(t,`/orgs/${o}/invites`,a,{email:f}).then(()=>ie(e,t,a,r,o,n)).catch(m=>{c&&(c.textContent=m instanceof Error?m.message:"Failed to send invite",c.hidden=!1)})})}catch(s){e.innerHTML=`<p class="aero-paywall-form-error">${ne(s instanceof Error?s.message:ta)}</p>`}}function ea(e,t){let a=e.querySelector(".aero-paywall-upgrade-form .aero-paywall-form-error");a&&(a.textContent=t instanceof Error?t.message:"Action failed",a.hidden=!1)}var Ke=new WeakMap;function Ee(e){return Ke.get(e)?.panel??e}function Sr(e){let t=Ee(e);return t===e?[e]:[e,t]}function We(e=new Date){let t=e.getHours();return t<12?"Good morning":t<18?"Good afternoon":"Good evening"}function Je(e,t){if(t&&t.trim())return t.trim();let a=e.split("@")[0]||e;return a.charAt(0).toUpperCase()+a.slice(1)}var aa="[data-aero-nav-root]";async function pe(e,t){let a=typeof document<"u"?document.querySelectorAll(aa):null;if(!a||a.length===0)return null;let r=M();if(!r||!e)return null;let o=await Pe(r,e);if(!o)return null;let n=Je(o.email,o.firstName);return o.subscriptionStatus!=="active"||document.querySelectorAll("[data-aero-subscribe-cta]").forEach(s=>{s.style.display="none"}),a.forEach(s=>{let l=Ee(s);l.querySelectorAll('[data-aero-nav-state="out"]').forEach(d=>{d.hidden=!0}),l.querySelectorAll('[data-aero-nav-state="in"]').forEach(d=>{d.hidden=!1}),Sr(s).forEach(d=>{d.querySelectorAll("[data-aero-nav-name]").forEach(p=>{p.textContent=n})}),l.querySelectorAll("[data-aero-nav-greeting]").forEach(d=>{d.textContent=`${We()},`}),l.querySelectorAll("[data-aero-nav-email]").forEach(d=>{d.textContent=o.email}),l.querySelectorAll("[data-aero-nav-logout]").forEach(d=>{d.dataset.aeroBound||(d.dataset.aeroBound="1",d.addEventListener("click",p=>{p.preventDefault(),At(t).finally(()=>{de(),window.location.reload()})}))})}),o}async function Ge(e,t){try{let a=await fetch(`${e}/me/follows`,{headers:{Authorization:`Bearer ${t}`}});if(!a.ok)return[];let r=await a.json().catch(()=>null);return Array.isArray(r?.data)?r.data:[]}catch{return[]}}async function je(e,t,a){if(!(await fetch(`${e}/me/follows`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)})).ok)throw new Error("Could not follow")}async function Ue(e,t,a,r){if(!(await fetch(`${e}/me/follows/${encodeURIComponent(a)}/${encodeURIComponent(r)}`,{method:"DELETE",headers:{Authorization:`Bearer ${t}`}})).ok)throw new Error("Could not unfollow")}async function ra(e,t,a,r,o){if(!(await fetch(`${e}/me/follows/${encodeURIComponent(a)}/${encodeURIComponent(r)}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({notifyImmediately:o})})).ok)throw new Error("Could not update alert setting")}function oa(e,t,a,r){let o=!1,n=!1,i=document.createElement("button");i.type="button",i.className="aero-paywall-follow-button",i.disabled=!0,l();let s=document.createElement("span");s.className="aero-paywall-follow-status",s.setAttribute("role","status"),s.hidden=!0,i.addEventListener("click",()=>{c()}),e.appendChild(i),e.appendChild(s),Ge(t,a).then(d=>{o=d.some(p=>p.taxonomy===r.taxonomy&&p.termId===r.termId),n=!0,i.disabled=!1,l()});function l(){i.classList.toggle("is-following",o),i.setAttribute("aria-pressed",String(o));let d=o?"Following":"Follow";i.innerHTML=`<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true"><path fill="${o?"currentColor":"none"}" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" d="M12 5v14M5 12h14"/></svg><span>${d}</span>`}async function c(){if(n){i.disabled=!0,s.hidden=!0;try{o?(await Ue(t,a,r.taxonomy,r.termId),o=!1):(await je(t,a,r),o=!0),l()}catch(d){s.textContent=d instanceof Error?d.message:"Something went wrong",s.hidden=!1}finally{i.disabled=!1}}}}function na(e,t){let a=document.createElement("a");a.className="aero-paywall-follow-button aero-paywall-follow-button--signed-out",a.href=`${t}?tab=register`,a.innerHTML='<svg viewBox="0 0 24 24" width="14" height="14" aria-hidden="true"><path fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" d="M12 5v14M5 12h14"/></svg><span>Follow</span>',e.appendChild(a)}var Lr="/wp-admin/admin-ajax.php",ia={lists:[],alertEligibleCategoryIds:[],nonce:""};async function Ve(){try{let e=await fetch(`${Lr}?action=bday_newsletter_options`);if(!e.ok)return ia;let t=await e.json().catch(()=>null);return t?.success&&t.data?t.data:ia}catch{return ia}}async function Cr(e,t,a){let r=new URLSearchParams;r.set("action","bday_newsletter_subscribe"),r.set("nonce",e),r.set("email",t.email),r.set("first_name",t.firstName),r.set("last_name",t.lastName),a.forEach(i=>
107r.append("list_ids[]",String(i)));let o=await fetch(Lr,{method:"POST",body:r}),n=await o.json().catch(()=>null);if(!o.ok||!n?.success)throw new Error(n?.data?.message??"Could not save your newsletter preferences")}function Fn(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}async function Ye(e,t,a,r,o){e.innerHTML='<p class="aero-paywall-account-current-note">Loading newsletters\u2026</p>';let n,i=null;try{[n,i]=await Promise.all([Ve(),fetch(`${t}/me`,{headers:{Authorization:`Bearer ${a}`}}).then(f=>f.ok?f.json():null).then(f=>f?.data??null).catch(()=>null)])}catch{e.innerHTML='<p class="aero-paywall-form-error">Could not load newsletters right now.</p>';return}if(n.lists.length===0){e.innerHTML='<p class="aero-paywall-account-current-note">No newsletters are available to subscribe to right now.</p>';return}if(!i){e.innerHTML='<p class="aero-paywall-form-error">Could not load your account details.</p>';return}e.innerHTML=`
108    <div class="aero-paywall-interest-grid" role="group" aria-label="Newsletters"></div>
109    <p class="aero-paywall-form-error" role="alert" hidden></p>
110    <p class="aero-paywall-form-success" role="status" hidden></p>
111    <button type="button" class="aero-paywall-interest-save"${r?` style="background:${r}"`:""}>Save newsletters</button>
112  `;let s=e.querySelector(".aero-paywall-interest-grid"),l=e.querySelector(".aero-paywall-form-error"),c=e.querySelector(".aero-paywall-form-success"),d=e.querySelector(".aero-paywall-interest-save");n.lists.forEach(f=>{let m=document.createElement("label");m.className="aero-paywall-interest-topic-label aero-paywall-newsletter-chip",m.title=f.description,m.innerHTML=`<input type="checkbox" value="${f.id}"><span>${Fn(f.title)}</span>`,s.appendChild(m)}),d.addEventListener("click",()=>{p()});async function p(){if(!i)return;d.disabled=!0,l.hidden=!0,c.hidden=!0;let f=Array.from(s.querySelectorAll('input[type="checkbox"]:checked')).map(m=>Number(m.value));try{await Cr(n.nonce,{email:i.email,firstName:i.firstName??"",lastName:i.lastName??""},f),c.textContent="Newsletters updated.",c.hidden=!1,o?.()}catch(m){l.textContent=m instanceof Error?m.message:"Could not save your newsletters",l.hidden=!1}finally{d.disabled=!1}}}var sa=5;async function Bn(){if(typeof window>"u")return[];try{let e=await fetch("/wp-json/wp/v2/categories?per_page=100&orderby=name&order=asc&_fields=id,name,count");if(!e.ok)return[];let t=await e.json().catch(()=>null);return Array.isArray(t)?t.filter(a=>a.count>0).map(a=>({id:a.id,name:Kn(a.name)})):[]}catch{return[]}}function Kn(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value}function Pr(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}async function Xe(e,t,a,r,o){e.innerHTML='<p class="aero-paywall-interest-loading">Loading categories\u2026</p>';let n=[],i=[],s=new Set;try{let[y,x,L]=await Promise.all([Bn(),Ge(t,a),Ve()]);n=y,i=x,s=new Set(L.alertEligibleCategoryIds.map(String))}catch{}let l=new Set(i.filter(y=>y.taxonomy==="category").map(y=>y.termId)),c=new Set(i.filter(y=>y.taxonomy==="category"&&y.notifyImmediately).map(y=>y.termId));if(n.length===0){e.innerHTML='<p class="aero-paywall-form-error">Could not load categories right now.</p>';return}e.innerHTML=`
113    <p class="aero-paywall-interest-hint">Pick up to ${sa} topics you care about most \u2014 we'll use these to personalize what you see. For topics marked \u{1F514}, you can also get an email the moment a new story goes up.</p>
114    <div class="aero-paywall-interest-grid" role="group" aria-label="Interests"></div>
115    <p class="aero-paywall-interest-count"></p>
116    <p class="aero-paywall-form-error" role="alert" hidden></p>
117    <button type="button" class="aero-paywall-interest-save"${r?` style="background:${r}"`:""}>Save interests</button>
118  `;let d=e.querySelector(".aero-paywall-interest-grid"),p=e.querySelector(".aero-paywall-interest-count"),f=e.querySelector(".aero-paywall-form-error"),m=e.querySelector(".aero-paywall-interest-save");n.forEach(y=>{let x=String(y.id),L=s.has(x),P=document.createElement("div");P.className="aero-paywall-interest-chip",P.dataset.termId=x,P.innerHTML=`<label class="aero-paywall-interest-topic-label"><input type="checkbox" class="aero-paywall-interest-topic" value="${x}" data-name="${Pr(y.name)}" ${l.has(x)?"checked":""}><span>${Pr(y.name)}</span></label>`+(L?`<label class="aero-paywall-interest-alert-label"><input type="checkbox" class="aero-paywall-interest-alert-toggle" value="${x}" ${c.has(x)?"checked":""} ${l.has(x)?"":"disabled"}><span>\u{1F514} Instant alerts</span></label>`:""),d.appendChild(P)});let g=Array.from(d.querySelectorAll(".aero-paywall-interest-topic")),k=new Map(Array.from(d.querySelectorAll(".aero-paywall-interest-alert-toggle")).map(y=>[y.value,y]));function A(){let y=g.filter(x=>x.checked).length;p.textContent=`${y} / ${sa} selected`,g.forEach(x=>{x.disabled=!x.checked&&y>=sa,x.closest(".aero-paywall-interest-chip")?.classList.toggle("is-disabled",x.disabled);let L=k.get(x.value);
118L&&(L.disabled=!x.checked,x.checked||(L.checked=!1))})}g.forEach(y=>y.addEventListener("change",A)),A(),m.addEventListener("click",()=>{S()});async function S(){m.disabled=!0,f.hidden=!0;let y=new Set(g.filter(x=>x.checked).map(x=>x.value));try{let x=g.filter(u=>y.has(u.value)&&!l.has(u.value)),L=Array.from(l).filter(u=>!y.has(u)),P=Array.from(k.entries()).filter(([u,w])=>l.has(u)&&y.has(u)&&w.checked!==c.has(u));await Promise.all([...x.map(u=>je(t,a,{taxonomy:"category",termId:u.value,termLabel:u.dataset.name??u.value,notifyImmediately:k.get(u.value)?.checked??!1})),...L.map(u=>Ue(t,a,"category",u)),...P.map(([u,w])=>ra(t,a,"category",u,w.checked))]),l.clear(),y.forEach(u=>l.add(u)),c.clear(),k.forEach((u,w)=>{u.checked&&c.add(w)}),o?.()}catch(x){f.textContent=x instanceof Error?x.message:"Could not save your interests",f.hidden=!1}finally{m.disabled=!1}}}function Re(e,t,a){if(typeof document>"u")return;let r=document.createElement("div");r.className="aero-paywall-interest-modal-backdrop",r.innerHTML=`
119    <div class="aero-paywall-interest-modal" role="dialog" aria-modal="true" aria-label="Pick your interests and newsletters">
120      <button type="button" class="aero-paywall-interest-modal-skip">Done</button>
121      <h2>Welcome! What are you into?</h2>
122      <div class="aero-paywall-interest-modal-body"></div>
123      <h2 class="aero-paywall-interest-modal-newsletters-heading">Newsletters</h2>
124      <div class="aero-paywall-interest-modal-newsletters"></div>
125    </div>
126  `,document.body.appendChild(r);let o=()=>r.remove();r.querySelector(".aero-paywall-interest-modal-skip")?.addEventListener("click",o),r.addEventListener("click",s=>{s.target===r&&o()});let n=r.querySelector(".aero-paywall-interest-modal-body");Xe(n,e,t,a);let i=r.querySelector(".aero-paywall-interest-modal-newsletters");Ye(i,e,t,a).then(()=>{i.textContent?.includes("No newsletters")&&r.querySelector(".aero-paywall-interest-modal-newsletters-heading")?.remove()})}async function Wn(e,t,a,r){try{let o=await fetch(`${e}/me/notification-preferences`,{headers:{Authorization:`Bearer ${t}`}});return o.ok?(await o.json().catch(()=>null))?.data?.[a]??r:r}catch{return r}}async function Jn(e,t,a,r){if(!(await fetch(`${e}/me/notification-preferences`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({[a]:r})})).ok)throw new Error("Could not save your preference")}async function Ar(e,t,a,r,o,n){e.innerHTML=`
127    <h3>${n.title}</h3>
128    <label class="aero-paywall-notif-toggle">
129      <input type="checkbox" class="aero-paywall-notif-toggle-input">
130      <span class="aero-paywall-notif-toggle-track"><span class="aero-paywall-notif-toggle-thumb"></span></span>
131      <span class="aero-paywall-notif-toggle-label">${n.label}</span>
132    </label>
133    <p class="aero-paywall-notif-status" role="status" hidden></p>
134  `;let i=e.querySelector(".aero-paywall-notif-toggle-input"),s=e.querySelector(".aero-paywall-notif-status");i.disabled=!0,i.checked=await Wn(t,a,r,o),i.disabled=!1,i.addEventListener("change",()=>{l()});async function l(){let c=i.checked;i.disabled=!0,s.hidden=!0;try{await Jn(t,a,r,c),s.textContent=c?n.onMessage:n.offMessage,s.hidden=!1}catch(d){i.checked=!c,s.textContent=d instanceof Error?d.message:"Could not save your preference",s.hidden=!1}finally{i.disabled=!1}}}async function _e(e,t,a){await Ar(e,t,a,"briefEnabled",!1,{title:"News Brief",label:"Send me a periodic email brief of stories I might have missed",onMessage:"News Brief enabled.",offMessage:"News Brief turned off."})}async function la(e,t,a){await Ar(e,t,a,"commentReplyEmailEnabled",!0,{title:"Comment replies",label:"Email me when someone replies to my comment",onMessage:"Reply emails enabled.",offMessage:"Reply emails turned off."})}var Gn="#1a73e8",Ze=900;function b(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function jn(e){return fetch(`${e}/public/gateways`).then(t=>t.ok?t.json():null).then(t=>({stripe:!!t?.data?.stripe,paypal:!!t?.data?.paypal,paystack:!!t?.data?.paystack,flutterwave:!!t?.data?.flutterwave})).catch(()=>({stripe:!1,paypal:!1,paystack:!1,flutterwave:!1}))}async function Qe(e,t){if(!(!!t&&t!=="NG")){let l={gateway:"paystack",currency:"NGN",label:"Paystack"};
134return{options:[l],gateway:l.gateway,currency:l.currency}}let r=await jn(e),o={gateway:"stripe",currency:"USD",label:"Card (USD, via Stripe)"},n={gateway:"paystack",currency:"USD",label:"Card (USD, via Paystack)"},i=[];r.stripe&&i.push(o),r.paystack&&i.push(n),i.length===0&&i.push(o);let s=i[0];return{options:i,gateway:s.gateway,currency:s.currency}}function da(e,t,a){return e.length<=1?"":`
135    <div class="aero-paywall-payment-option-picker" role="radiogroup" aria-label="Payment method">
136      ${e.map(r=>`
137            <label>
138              <input type="radio" name="${a}" value="${r.gateway}" ${r.gateway===t?"checked":""} />
139              <span>${b(r.label)}</span>
140            </label>
141          `).join("")}
142    </div>
143  `}function Un(e,t){let r=`${t==="USD"?`$${e.priceUsd}`:`\u20A6 ${e.priceNgn}`} / ${e.durationDays} days`;if(e.trialDays)return{headline:`Free for ${e.trialDays} days`,sub:`then ${r}`,isPromo:!0};let o=t==="USD"?e.introPriceUsd:e.introPriceNgn;if(o){let n=e.introDurationDays??e.durationDays;return{headline:`${t==="USD"?`$${o}`:`\u20A6${o}`} for ${n} days`,sub:`then ${r}`,isPromo:!0}}return{headline:r,sub:null,isPromo:!1}}function et(e,t,a,r,o=!1){let n=Un(e,t),i=!o&&!!a&&a.planName===e.name,s=o?"Talk to sales":i?"Current plan":a?"Switch to this plan":"Subscribe";return`
144    <div class="aero-paywall-plan-card${n.isPromo?" aero-paywall-plan-card--promo":""}${i?" aero-paywall-plan-card--current":""}" data-plan-id="${e.id}" ${o?'data-plan-kind="b2b"':""}>
145      ${n.isPromo?'<span class="aero-paywall-plan-badge">Limited offer</span>':""}
146      ${i?'<span class="aero-paywall-plan-badge aero-paywall-plan-badge--current">Current plan</span>':""}
147      <h3>${b(e.name)}</h3>
148      <p class="aero-paywall-plan-price">${b(n.headline)}</p>
149      ${n.sub?`<p class="aero-paywall-plan-price-sub">${b(n.sub)}</p>`:""}
150      ${e.featureBullets?`<ul>${e.featureBullets.map(l=>`<li>${b(l)}</li>`).join("")}</ul>`:""}
151      <button type="button" style="background:${r}" ${i?"disabled":""}>${b(s)}</button>
152    </div>
153  `}var Vn=[{value:"too_expensive",label:"Too expensive"},{value:"not_using_it",label:"Not using it enough"},{value:"missing_features",label:"Missing features I need"},{value:"switching_provider",label:"Switching to another provider"},{value:"technical_issues",label:"Technical issues"},{value:"other",label:"Other"}];function at(e,t){if(typeof e?.message=="string")return e.message;let a=e?.message?.message;return typeof a=="string"?a:Array.isArray(a)&&a.every(r=>typeof r=="string")?a.join(", "):t}async function U(e,t,a){let r=await fetch(`${e}${t}`,{headers:{Authorization:`Bearer ${a}`}}),o=await r.json().catch(()=>null);if(!r.ok||!o?.data)throw new Error(at(o,`Request failed: ${t}`));return o.data}async function _r(e,t,a,r){let o=await fetch(`${e}${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r)}),n=await o.json().catch(()=>null);if(!o.ok||!n?.data)throw new Error(at(n,`Request failed: ${t}`));return n.data}async function F(e,t,a,r){let o=await fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r)}),n=await o.json().catch(()=>null);if(!o.ok||!n?.data)throw new Error(at(n,`Request failed: ${t}`));return n.data}async function Nr(e,t,a,r,o,n,i,s,l,c){switch(e){case"subscribe":return rt(t,a,r,o,n,i,void 0,c);case"history":return Fr(t,a,r);case"upgrade":return Kr(t,a,r,o);case"referrals":return ni(t,a,r,o);case"bookmarks":return pa(t,a,r);case"reading-history":return Br(t,a,r);case"gift":return ua(t,a,r,o,n,i);case"team":if(!s||!l){t.innerHTML=`<p class="aero-paywall-form-error">${b("You're not part of a team.")}</p>`;return}return ie(t,a,r,o,s,l,()=>{Nr("subscribe",t,a,r,o,n,i,s,l,c)})}}async function Ne(e,t,a=Gn,r,o,n,i,s,l,c){let d=typeof window<"u"?new URLSearchParams(window.location.search).get("token"):null;if(d){Yn(e,t,d,a,r,o,n,i,s,l);return}let p=typeof window<"u"?new URLSearchParams(window.location.search).get("verify_email_token"):null;if(p){await Xn(e,t,p);let E=new URL(window.location.href);E.searchParams.delete("verify_email_token"),window.history.replaceState({},"",E.toString())}let f=(typeof window<"u"?new URLSearchParams(window.location.search).get("tab"):null)??e.dataset.aeroDefaultTab??null,m=M();if(!m){if(f==="subscribe")return Qn(e,t,a,r,o,n,i,s,l,c);Ir(e,t,a,r,o,n,i,s,f==="register"?"register":f==="reset"?"reset":"login",l);return}let g=typeof window<"u"?new URLSearchParams(window.location.search).get("aero_invite_token"):null,k=!1;if(g){try{let $=await F(t,`/orgs/invites/${g}/accept`,m,{});D($.accessToken,Ze),m=$.accessToken,k=!0,pe(l,t)}catch{}let E=new URL(window.location.href);E.searchParams.delete("aero_invite_token"),window.history.replaceState({},"",E.toString())}let A=typeof window<"u"?new URLSearchParams(window.location.search).get("aero_gift_plan"):null;if(A){let E=await Zn(t,m,A);E.accessToken&&(D(E.accessToken,Ze),m=E.accessToken);let $=new URL(window.location.href);$.searchParams.delete("aero_gift_plan"),window.history.replaceState({},"",$.toString());let I=document.createElement("p");I.className=E.ok?"aero-paywall-form-success":"aero-paywall-form-error",I.textContent=E.message,e.parentElement?.insertBefore(I,e)}let S=typeof window<"u"?new URLSearchParams(window.location.search):null,y=S?.get("aero_gift_purchase")==="1",x=S?.get("aero_gift_renewal")==="1",L=y||x,P=L?S?.get("aero_checkout_ref")??null:null;if(L&&P){let E;try{if(y){let X=await tt(P,t,m,"/me/gift-links/plan-checkout/verify");if(!X.token)throw new Error("no token");let ee=new URL(window.location.origin);ee.searchParams.set("aero_gift_plan",X.token),E={ok:!0,message:`Payment c
153onfirmed \u2014 your gift link is ready: ${ee.toString()}`}}else await tt(P,t,m,"/me/gift-links/renew-checkout/verify"),E={ok:!0,message:"Payment confirmed \u2014 the gifted subscription has been extended."}}catch{E={ok:!1,message:"We could not confirm that payment. If you were charged, contact support."}}let $=new URL(window.location.href);$.searchParams.delete("aero_gift_purchase"),$.searchParams.delete("aero_gift_renewal"),$.searchParams.delete("aero_checkout_ref"),window.history.replaceState({},"",$.toString());let I=document.createElement("p");I.className=E.ok?"aero-paywall-form-success":"aero-paywall-form-error",I.textContent=E.message,e.parentElement?.insertBefore(I,e)}else if(L){let E=new URL(window.location.href);E.searchParams.delete("aero_gift_purchase"),E.searchParams.delete("aero_gift_renewal"),window.history.replaceState({},"",E.toString())}let u=L?null:S?.get("aero_checkout_ref")??null;if(u){let E=!1;try{let X=await F(t,"/checkout/verify",m,{reference:u});X.accessToken&&(D(X.accessToken,Ze),E=!0)}catch{}let $=E?new URLSearchParams(window.location.search).get("return_to"):null;if($&&new URL($,window.location.href).origin===window.location.origin){window.location.href=$;return}let I=new URL(window.location.href);I.searchParams.delete("aero_checkout_ref"),I.searchParams.delete("return_to"),window.history.replaceState({},"",I.toString())}let[w,T]=await Promise.all([U(t,"/me",m).catch(()=>null),U(t,"/comments/notifications",m).then(E=>E.filter($=>!$.read).length).catch(()=>0)]),h=w?.org??null,C=w?Je(w.email,w.firstName):"",H=["dashboard","subscribe","history","upgrade","bookmarks","reading-history","comments","gift","team","profile","password","personalization","email-alerts"],_=typeof window<"u"&&!!window.aeroPaywallContext?.followEnabled,se=H.find(E=>E===f&&(E!=="team"||h)&&(E!=="personalization"||_)),N=k&&h?"team":se??"dashboard",ke=[{tab:"dashboard",label:"Dashboard"},{tab:"subscribe",label:"Subscribe",group:"Subscription"},{tab:"history",label:"Subscription History",group:"Subscription"},{tab:"upgrade",label:"Upgrade Account",group:"Subscription"},{tab:"gift",label:"Gift a Subscription",group:"Subscription"},{tab:"bookmarks",label:"Bookmarks",group:"Reading"},{tab:"reading-history",label:"Reading History",group:"Reading"},{tab:"comments",label:"My Comments",group:"Reading"},{tab:"profile",label:"My Profile",group:"Account"},{tab:"password",label:"Change Password",group:"Account"},{tab:"personalization",label:"Personalization",group:"Preferences"},{tab:"email-alerts",label:"News Brief & Newsletters",group:"Preferences"},{tab:"team",label:"Team",teamOnly:!0,group:"Team"}],ue,Ie=ke.filter(E=>(!E.teamOnly||h)&&(E.tab!=="personalization"||_)).map(E=>{let $=E.group&&E.group!==ue?`<span class="aero-paywall-account-sidebar-group">${b(E.group)}</span>`:"";ue=E.group;let I=E.tab==="comments"&&T>0?`<span class="aero-paywall-account-sidebar-badge">${T}</span>`:"";return`${$}<button type="button" data-tab="${E.tab}" data-active="${String(N===E.tab)}">${b(E.label)}${I}</button>`}).join("");e.innerHTML=`
154    <div class="aero-paywall-account-shell">
155      <h1 class="aero-paywall-account-title">My Account</h1>
156      <div class="aero-paywall-account-layout">
157        <nav class="aero-paywall-account-sidebar" role="tablist">
158          ${Ie}
159          <button type="button" class="aero-paywall-account-sidebar-logout" data-aero-account-logout>Log Out</button>
160        </nav>
161        <div class="aero-paywall-account-content">
162          <div class="aero-paywall-account-panel" data-panel="dashboard" ${N==="dashboard"?"":"hidden"}></div>
163          <div class="aero-paywall-account-panel" data-panel="subscribe" ${N==="subscribe"?"":"hidden"}></div>
164          <div class="aero-paywall-account-panel" data-panel="history" ${N==="history"?"":"hidden"}></div>
165          <div class="aero-paywall-account-panel" data-panel="upgrade" ${N==="upgrade"?"":"hidden"}></div>
166          <div class="aero-paywall-account-panel" data-panel="bookmarks" ${N==="bookmarks"?"":"hidden"}></div>
167          <div class="aero-paywall-account-panel" data-panel="reading-history" ${N==="reading-history"?"":"hidden"}></div>
168          <div class="aero-paywall-account-panel" data-panel="comments" ${N==="comments"?"":"hidden"}></div>
169          <div class="aero-paywall-account-panel" data-panel="gift" ${N==="gift"?"":"hidden"}></div>
170          ${h?`<div class="aero-paywall-account-panel" data-panel="team" ${N==="team"?"":"hidden"}></div>`:""}
171          <div class="aero-paywall-account-panel" data-panel="profile" ${N==="profile"?"":"hidden"}></div>
172          <div class="aero-paywall-account-panel" data-panel="password" ${N==="password"?"":"hidden"}></div>
173          ${_?`<div class="aero-paywall-account-panel" data-panel="personalization" ${N==="personalization"?"":"hidden"}></div>`:""}
174          <div class="aero-paywall-account-panel" data-panel="email-alerts" ${N==="email-alerts"?"":"hidden"}></div>
175        </div>
176      </div>
177    </div>
178  `;let me=e.querySelectorAll("[data-tab]"),le=e.querySelectorAll("[data-panel]");me.forEach(E=>{E.addEventListener("click",()=>{me.forEach(ee=>ee.dataset.active=String(ee===E)),le.forEach(ee=>
178ee.hidden=ee.dataset.panel!==E.dataset.tab);let $=document.querySelector(".bd-header"),I=$?$.getBoundingClientRect().height:0,X=e.getBoundingClientRect();(X.top<I||X.top>window.innerHeight*.5)&&window.scrollTo({top:Math.max(window.scrollY+X.top-I-16,0),behavior:"smooth"})})}),e.querySelectorAll("[data-aero-account-logout]").forEach(E=>{E.addEventListener("click",$=>{$.preventDefault(),de(),window.location.reload()})});let po=e.querySelector('[data-panel="dashboard"]'),uo=j(e,"subscribe"),mo=j(e,"history"),fo=j(e,"upgrade"),go=j(e,"bookmarks"),yo=j(e,"reading-history"),ho=j(e,"comments"),wo=j(e,"gift"),bo=j(e,"profile"),vo=j(e,"password"),xo=j(e,"email-alerts"),Eo=()=>{e.querySelector('[data-tab="upgrade"]')?.click()};di(po,C,E=>{e.querySelector(`[data-tab="${E}"]`)?.click()},_);let st=[rt(uo,t,m,a,i,s,Eo,c),Fr(mo,t,m),Kr(fo,t,m,a),pa(go,t,m),Br(yo,t,m),oi(ho,t,m),ua(wo,t,m,a,i,s),ui(bo,t,m,a),Promise.resolve(mi(vo,t,a)),Promise.resolve(gi(xo,t,m,a))];if(_){let E=j(e,"personalization");st.push(Promise.resolve(fi(E,t,m,a)))}if(h){let E=j(e,"team"),$=()=>{e.querySelector('[data-tab="subscribe"]')?.click()};st.push(ie(E,t,m,a,h.id,h.role,$))}await Promise.all(st)}function Yn(e,t,a,r,o,n,i,s,l,c){e.innerHTML="";let d=Xt(r);e.appendChild(d),Zt(d,t,a,()=>{let p=new URL(window.location.href);p.searchParams.delete("token"),window.history.replaceState({},"",p.toString()),Ir(e,t,r,o,n,i,s,l,"login",c)})}async function Xn(e,t,a){let r="Your email address has been verified.",o=!1;try{let i=await fetch(`${t}/auth/verify-email/confirm`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:a})}),s=await i.json().catch(()=>null);if(!i.ok||!s?.data)throw new Error(at(s,"This verification link is invalid or has expired."))}catch(i){r=i instanceof Error?i.message:"This verification link is invalid or has expired.",o=!0}let n=document.createElement("p");n.className=o?"aero-paywall-form-error":"aero-paywall-form-success",n.textContent=r,e.parentElement?.insertBefore(n,e)}async function Zn(e,t,a){try{let r=await F(e,"/gift/redeem-plan",t,{token:a});return{ok:!0,message:`You've been gifted a ${r.planName} subscription \u2014 enjoy!`,accessToken:r.accessToken}}catch(r){return{ok:!1,message:r instanceof Error?r.message:"This gift link is invalid or has expired."}}}var ca="aero_pending_plan";async function Qn(e,t,a,r,o,n,i,s,l,c){try{let L=function(){let h=x.querySelectorAll("[data-plan-type-tab]"),C=x.querySelectorAll("[data-plan-type-panel]");h.forEach(H=>{H.addEventListener("click",()=>{h.forEach(_=>_.dataset.active=String(_===H)),C.forEach(_=>_.hidden=_.dataset.planTypePanel!==H.dataset.planTypeTab)})})},T=function(h){P.hidden=!1,P.innerHTML=`
179        <p class="aero-paywall-subscribe-auth-prompt__title">Sign in or create an account to continue subscribing to <strong>${b(h)}</strong></p>
180        <nav class="aero-paywall-auth-tabs" role="tablist">
181          <button type="button" data-auth-tab="login" data-active="false">Log in</button>
182          <button type="button" data-auth-tab="register" data-active="true">Create account</button>
183        </nav>
184        <div class="aero-paywall-auth-panel" data-auth-panel="login" hidden></div>
185        <div class="aero-paywall-auth-panel" data-auth-panel="register"></div>
186      `;let C=P.querySelectorAll("[data-auth-tab]"),H=P.querySelectorAll("[data-auth-panel]");C.forEach(me=>{me.addEventListener("click",()=>{C.forEach(le=>le.dataset.active=String(le===me)),H.forEach(le=>le.hidden=le.dataset.authPanel!==me.dataset.authTab)})});let _=P.querySelector('[data-auth-panel="login"]'),se=W(r,o);se&&(_.appendChild(se),G(se,t,r,o,u,w),_.appendChild(J()));let N=re(a);_.appendChild(N),oe(N,t,u);let ke=P.querySelector('[data-auth-panel="register"]'),ue=W(r,o);ue&&(ke.appendChild(ue),G(ue,t,r,o,u,w),ke.appendChild(J()));let Ie=te(a,n);ke.appendChild(Ie),ae(Ie,t,u,n),P.scrollIntoView({behavior:"smooth",block:"start"})};var d=L,p=T;let[f,m]=await Promise.all([fetch(`${t}/plans`).then(h=>h.json()).then(h=>h.data),Qe(t,s)]),g=f.filter(h=>!h.isB2b),k=f.filter(h=>h.isB2b),A={currency:m.currency,gateway:m.gateway},S=`
187      <div class="aero-paywall-corporate-intro">
188        <p>Cover your whole team under one organization account \u2014 priority pricing, centralized billing, and admin-managed seats. Our sales team will help you pick the right plan.</p>
189        ${c?`<a href="${b(c)}">Talk to our corporate sales team</a>`:""}
190      </div>
191    `,y=h=>`<div class="aero-paywall-plan-type-tabs" role="tablist">
192         <button type="button" data-plan-type-tab="individual" data-active="true">Individual</button>
193         <button type="button" data-plan-type-tab="corporate" data-active="false">Corporate</button>
194       </div><div class="aero-paywall-plan-tier-grid aero-paywall-plan-tier-grid--wide" data-plan-type-panel="individual">`+g.map(C=>et(C,h,null,a)).join("")+"</div>"+(k.length>0?'<div class="aero-paywall-plan-tier-grid aero-paywall-plan-tier-grid--wide" data-plan-type-panel="corporate" hidden>'+k.map(C=>
194et(C,h,null,a,!0)).join("")+"</div>":`<div data-plan-type-panel="corporate" hidden>${S}</div>`);e.innerHTML=da(m.options,A.gateway,"aero-public-subscribe-payment-option")+`<div class="aero-paywall-plan-section">${y(A.currency)}</div><div class="aero-paywall-subscribe-auth-prompt" data-subscribe-auth-prompt hidden></div>`;let x=e.querySelector(".aero-paywall-plan-section");L(),e.querySelectorAll('input[name="aero-public-subscribe-payment-option"]').forEach(h=>{h.addEventListener("change",()=>{if(!h.checked)return;let C=m.options.find(H=>H.gateway===h.value);C&&(A.currency=C.currency,A.gateway=C.gateway,x.innerHTML=y(C.currency),L())})});let P=e.querySelector("[data-subscribe-auth-prompt]"),u=()=>{pe(l,t);let h=M(),C=null;try{let H=sessionStorage.getItem(ca);H&&(C=JSON.parse(H)),sessionStorage.removeItem(ca)}catch{}if(h&&C){e.innerHTML='<p class="aero-paywall-subscribe-resuming">Completing your subscription&hellip;</p>',Or(C.planId,C.gateway,C.currency,t,h,null,i);return}Ne(e,t,a,r,o,n,i,s,l)},w=h=>{let C=P.querySelector('[data-auth-panel="login"] .aero-paywall-form-error');C&&(C.textContent=h,C.hidden=!1)};x.addEventListener("click",h=>{let C=h.target.closest("button"),H=C?.closest(".aero-paywall-plan-card");if(!C||!H)return;let _=H.dataset.planId,se=f.find(N=>N.id===_);if(H.dataset.planKind==="b2b"){c?window.location.href=`${c}${c.includes("?")?"&":"?"}aero_corp_plan=${encodeURIComponent(_)}`:window.location.href=`${i??""}?tab=register`;return}try{sessionStorage.setItem(ca,JSON.stringify({planId:_,gateway:A.gateway,currency:A.currency}))}catch{}T(se?.name??"this plan")})}catch{e.innerHTML='<p class="aero-paywall-form-error">Unable to load subscription plans right now. Please refresh and try again.</p>'}}function Ir(e,t,a,r,o,n,i,s,l="login",c){e.innerHTML=`
195    <div class="aero-paywall-account-signed-out">
196      <nav class="aero-paywall-auth-tabs" role="tablist">
197        <button type="button" data-auth-tab="login" data-active="${String(l==="login")}">Log in</button>
198        <button type="button" data-auth-tab="register" data-active="${String(l==="register")}">Create account</button>
199      </nav>
200      <div class="aero-paywall-auth-panel" data-auth-panel="login" ${l==="login"?"":"hidden"}></div>
201      <div class="aero-paywall-auth-panel" data-auth-panel="register" ${l==="register"?"":"hidden"}></div>
202      <div class="aero-paywall-auth-panel" data-auth-panel="reset" ${l==="reset"?"":"hidden"}></div>
203    </div>
204  `;let d=e.querySelectorAll("[data-auth-tab]"),p=e.querySelectorAll("[data-auth-panel]");d.forEach(T=>{T.addEventListener("click",()=>{d.forEach(h=>h.dataset.active=String(h===T)),p.forEach(h=>h.hidden=h.dataset.authPanel!==T.dataset.authTab)})});let f=()=>{let T=new URLSearchParams(window.location.search).get("return_to");if(T)try{if(new URL(T,window.location.href).origin===window.location.origin){window.location.href=T;return}}catch{}pe(c,t),Ne(e,t,a,r,o,n,i,s,c)},m=()=>{if(f(),!(typeof window<"u"&&!!window.aeroPaywallContext?.followEnabled))return;let h=M();h&&Re(t,h,a)},g=T=>{let h=e.querySelector('[data-auth-panel="login"] .aero-paywall-form-error');h&&(h.textContent=T,h.hidden=!1)},k=e.querySelector('[data-auth-panel="login"]'),A=W(r,o);A&&(k.appendChild(A),G(A,t,r,o,f,g),k.appendChild(J()));let S=re(a);k.appendChild(S),oe(S,t,f);let y=document.createElement("button");y.type="button",y.className="aero-paywall-forgot-password-link",y.textContent="Forgot password?",y.addEventListener("click",()=>{d.forEach(T=>T.dataset.active="false"),p.forEach(T=>T.hidden=T.dataset.authPanel!=="reset")}),k.appendChild(y);let x=e.querySelector('[data-auth-panel="register"]'),L=W(r,o);L&&(x.appendChild(L),G(L,t,r,o,m,g),x.appendChild(J()));let P=te(a,n);x.appendChild(P),ae(P,t,m,n);let u=e.querySelector('[data-auth-panel="reset"]'),w=$e(a);u.appendChild(w),He(w,t)}async function rt(e,t,a,r,o,n,i,s){try{let P=function(){let u=L.querySelectorAll("[data-plan-type-tab]"),w=L.querySelectorAll("[data-plan-type-panel]");u.forEach(T=>{T.addEventListener("click",()=>{u.forEach(h=>h.dataset.active=String(h===T)),w.forEach(h=>h.hidden=h.dataset.planTypePanel!==T.dataset.planTypeTab)})})};var l=P;let[c,d,p]=await Promise.all([U(t,"/me",a),fetch(`${t}/plans`).then(u=>u.json()).then(u=>u.data),Qe(t,n)]),f=d.filter(u=>!u.isB2b),m=d.filter(u=>u.isB2b),g={currency:p.currency,gateway:p.gateway},k=c.subscription,A=u=>{c.billingCurrency!==u&&_r(t,"/me",a,{billingCurrency:u}).catch(()=>{})};A(g.currency);let S=u=>(m.length>0?`<div class="aero-paywall-plan-type-tabs" role="tablist">
205             <button type="button" data-plan-type-tab="individual" data-active="true">Individual</button>
206             <button type="button" data-plan-type-tab="corporate" data-active="false">Corporate</button>
207           </div>`:"")+'<div class="aero-paywall-plan-tier-grid" data-plan-type-panel="individual">'+f.map(w=>et(w,u,k,r)).join("")+"</div>"+(m.length>0?'<div class="aero-paywall-plan-tier-grid" data-plan-type-panel="corporate" hidden>'+m.map(w=>et(w,u,k,r,!0)).join("")+"</div>":"");e.innerHTML=(k?`<div class="aero-paywall-account-current-wrap">
208             <p class="aero-paywall-account-current">Current plan: <strong>${b(k.planName)}</strong> <span class="aero-paywall-status-badge" data-status="${b(k.status)}">${b(k.status)}</span></p>
209             ${k.status==="active"&&k.autoRenew?'<button type="button" class="aero-paywall-cancel-subscription-link">Cancel subscription</button>':k.status==="active"?`<p class="aero-paywall-account-current-note">Cancelled \u2014 access continues until ${k.expiresAt?new Date(k.expiresAt).toLocaleDateString():"the end of the current period"}.</p>`:""}
210             <div class="aero-paywall-cancel-form" hidden>
211               <label>Why are you cancelling? (optional)
212                 <select name="cancelReason">
213                   <option value="">Prefer not to say</option>
214                   ${Vn.map(u=>`<option value="${u.value}">${b(u.label)}</option>`).join("")}
215                 </select>
216               </label>
217               <div class="aero-paywall-cancel-form-actions">
218                 <button type="button" class="aero-paywall-cancel-confirm" style="background:${r}">Confirm cancellation</button>
219                 <button type="button" class="aero-paywall-cancel-dismiss">Keep subscription</button>
220               </div>
221             </div>
222           </div>`:"")+da(p.options,g.gateway,"aero-subscribe-payment-option")+`<div class="aero-paywall-plan-section">${S(g.currency)}</div><div class="aero-paywall-coupon-row">
223         <label for="aero-paywall-coupon-input">Coupon code</label>
224         <input type="text" id="aero-paywall-coupon-input" class="aero-paywall-coupon-input" placeholder="Optional" autocomplete="off" />
225       </div><p class="aero-paywall-form-error" role="alert" hidden></p>`;let y=e.querySelector(".aero-paywall-form-error"),x=e.querySelector(".aero-paywall-coupon-input"),L=e.querySelector(".aero-paywall-plan-section");if(P(),e.querySelectorAll('input[name="aero-subscribe-payment-option"]').forEach(u=>{u.addEventListener("change",()=>{if(!u.checked)return;let w=p.options.find(T=>T.gateway===u.value);w&&(g.currency=w.currency,g.gateway=w.gateway,A(w.currency),L.innerHTML=S(w.currency),P())})}),L.addEventListener("click",u=>{let w=u.target.closest("button"),T=w?.closest(".aero-paywall-plan-card");if(!(!w||!T)){if(T.dataset.planKind==="b2b"){s?window.location.href=`${s}${s.includes("?")?"&":"?"}aero_corp_plan=${encodeURIComponent(T.dataset.planId)}`:i?i():o&&(window.location.href=`${o}?tab=upgrade`);return}Or(T.dataset.planId,g.gateway,g.currency,t,a,y,o,x?.value.trim()||void 0)}}),k){let u=e.querySelector(".aero-paywall-cancel-subscription-link"),w=e.querySelector(".aero-paywall-cancel-form"),T=e.querySelector(".aero-paywall-cancel-confirm"),h=e.querySelector(".aero-paywall-cancel-dismiss"),C=e.querySelector('select[name="cancelReason"]');u?.addEventListener("click",()=>
225{w&&(w.hidden=!1),u.hidden=!0}),h?.addEventListener("click",()=>{w&&(w.hidden=!0),u&&(u.hidden=!1)}),T?.addEventListener("click",()=>{T&&(T.disabled=!0),F(t,`/me/subscriptions/${k.id}/cancel`,a,{reason:C?.value||void 0}).then(()=>rt(e,t,a,r,o,n,i,s)).catch(H=>{y&&(y.textContent=H instanceof Error?H.message:"Failed to cancel subscription",y.hidden=!1),T&&(T.disabled=!1)})})}}catch(c){e.innerHTML=`<p class="aero-paywall-form-error">${b(c instanceof Error?c.message:"Failed to load plans")}</p>`}}function ei(e){if(!e||typeof window>"u")return e;let t=new URLSearchParams(window.location.search).get("return_to");if(!t)return e;try{if(new URL(t,window.location.href).origin!==window.location.origin)return e}catch{return e}let a=new URL(e,window.location.href);return a.searchParams.set("return_to",t),a.toString()}async function Or(e,t,a,r,o,n,i,s){try{n&&(n.hidden=!0),await _r(r,"/me",o,{billingCurrency:a});let l=await F(r,"/checkout/init",o,{planId:e,gateway:t,returnUrl:ei(i),couponCode:s});await ti(l.checkout,t,r,o)}catch(l){n&&(n.textContent=l instanceof Error?l.message:"Checkout failed",n.hidden=!1)}}var Dr={paystack:"https://js.paystack.co/v1/inline.js",flutterwave:"https://checkout.flutterwave.com/v3.js"},Mr=new Map;function qr(e){let t=Mr.get(e);return t||(t=new Promise((a,r)=>{let o=document.createElement("script");o.src=e,o.async=!0,o.onload=()=>a(),o.onerror=()=>r(new Error(`Failed to load ${e}`)),document.head.appendChild(o)}),Mr.set(e,t)),t}async function ti(e,t,a,r){if(e.mode==="redirect"){window.location.href=e.url;return}if(e.mode==="inline"){await ai(e,t,a,r);return}let o=await F(a,"/checkout/verify",r,{reference:e.reference});zr(o)}function zr(e){e.accessToken&&D(e.accessToken,Ze);let t=new URLSearchParams(window.location.search).get("return_to");if(t)try{if(new URL(t,window.location.href).origin===window.location.origin){window.location.href=t;return}}catch{}window.location.reload()}function ai(e,t,a,r){let o=Dr[t];if(!o)return Promise.reject(new Error(`No inline checkout widget available for ${t}`));let n=()=>{F(a,"/checkout/verify",r,{reference:e.reference}).then(zr)};return qr(o).then(()=>{if(t==="paystack"){if(!window.PaystackPop)throw new Error("Paystack widget failed to load");window.PaystackPop.setup({key:e.publicKey,email:e.customerEmail,amount:e.amount,currency:e.currency,ref:e.reference,callback:n,onClose:()=>{}}).openIframe();return}if(t==="flutterwave"){if(!window.FlutterwaveCheckout)throw new Error("Flutterwave widget failed to load");window.FlutterwaveCheckout({public_key:e.publicKey,tx_ref:e.reference,amount:e.amount,currency:e.currency,customer:{email:e.customerEmail},callback:n,onclose:()=>{}})}})}function $r(e,t,a,r,o){return e.mode==="redirect"?(window.location.href=e.url,new Promise(()=>{})):e.mode==="inline"?ri(e,t,a,r,o):tt(e.reference,a,r,o)}async function tt(e,t,a,r){let o=await F(t,r,a,{reference:e});if(!o.activated)throw new Error("Payment could not be verified");return{token:o.giftLink?.token}}function ri(e,t,a,r,o){let n=Dr[t];return n?new Promise((i,s)=>{let l=()=>{tt(e.reference,a,r,o).then(i,s)};qr(n).then(()=>{if(t==="paystack"){if(!window.PaystackPop)throw new Error("Paystack widget failed to load");window.PaystackPop.setup({key:e.publicKey,email:e.customerEmail,amount:e.amount,currency:e.currency,ref:e.reference,callback:l,onClose:()=>{}}).openIframe();return}if(t==="flutterwave"){if(!window.FlutterwaveCheckout)throw new Error("Flutterwave widget failed to load");window.FlutterwaveCheckout({public_key:e.publicKey,tx_ref:e.reference,amount:e.amount,currency:e.currency,customer:{email:e.customerEmail},callback:l,onclose:()=>{}})}}).catch(s)}):Promise.reject(new Error(`No inline checkout widget available for ${t}`))}async function Fr(e,t,a){try{let r=await U(t,"/me/subscriptions",a);if(r.length===0){e.innerHTML="<p>No subscriptions yet.</p>";return}e.innerHTML=`
226      <div class="aero-paywall-history-table-wrap">
227        <table class="aero-paywall-history-table">
228          <thead><tr><th>Plan</th><th>Status</th><th>Expires</th><th>Payments</th></tr></thead>
229          <tbody>
230            ${r.map(o=>`
231              <tr>
232                <td>${b(o.planName)}</td>
233                <td><span class="aero-paywall-status-badge" data-status="${b(o.status)}">${b(o.status)}</span></td>
234                <td>${o.expiresAt?new Date(o.expiresAt).toLocaleDateString():"\u2014"}</td>
235                <td>${o.payments.map(n=>`${b(n.gateway)}: ${n.amount} ${b(n.currency)} (${b(n.status)})`).join("<br/>")}</td>
236              </tr>
237            `).join("")}
238          </tbody>
239        </table>
240      </div>
241    `}catch(r){e.innerHTML=`<p class="aero-paywall-form-error">${b(r instanceof Error?r.message:"Failed to load history")}</p>`}}async function pa(e,t,a){try{let r=await U(t,"/me/bookmarks",a);if(r.length===0){e.innerHTML='<p>Nothing saved yet \u2014 tap "Save" on an article to bookmark it here.</p>';return}e.innerHTML=`
242      <ul class="aero-paywall-saved-list">
243        ${r.map(o=>`
244          <li data-post-id="${b(o.postId)}">
245            ${o.imageUrl?`<a href="${b(o.url)}" class="aero-paywall-saved-list-media"><img src="${b(o.imageUrl)}" alt=""></a>`:""}
246            <div class="aero-paywall-saved-list-body">
247              <a href="${b(o.url)}">${b(o.title)}</a>
248              <span>${new Date(o.createdAt).toLocaleDateString()}</span>
249            </div>
250            <button type="button" class="aero-paywall-saved-list-remove" data-remove-bookmark="${b(o.postId)}" aria-label="Remove bookmark">&times;</button>
251          </li>
252        `).join("")}
253      </ul>
254    `,e.querySelectorAll("[data-remove-bookmark]").forEach(o=>{o.addEventListener("click",()=>{(async()=>{o.disabled=!0;try{let n=o.dataset.removeBookmark;(await fetch(`${t}/me/bookmarks/${encodeURIComponent(n)}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}})).ok&&(o.closest("li")?.remove(),e.querySelector("li")||pa(e,t,a))}finally{o.disabled=!1}})()})})}catch(r){e.innerHTML=`<p class="aero-paywall-form-error">${b(r instanceof Error?r.message:"Failed to load bookmarks")}</p>`}}async function Br(e,t,a){try{let r=await U(t,"/me/reading-history",a);if(r.length===0){e.innerHTML="<p>Articles you read while signed in will show up here.</p>";return}e.innerHTML=`
255      <ul class="aero-paywall-saved-list">
256        ${r.map(o=>`
257          <li>
258            ${o.imageUrl?`<a href="${b(o.url)}" class="aero-paywall-saved-list-media"><img src="${b(o.imageUrl)}" alt=""></a>`:""}
259            <div class="aero-paywall-saved-list-body">
260              <a href="${b(o.url)}">${b(o.title)}</a>
261              <span>${new Date(o.viewedAt).toLocaleDateString()}</span>
262            </div>
263          </li>
264        `).join("")}
265      </ul>
266    `}catch(r){e.innerHTML=`<p class="aero-paywall-form-error">${b(r instanceof Error?r.message:"Failed to load reading history")}</p>`}}function Hr(e){return`${window.location.origin}/?p=${encodeURIComponent(e)}`}async function oi(e,t,a){e.innerHTML='<div class="aero-paywall-comments-email-toggle"></div><div class="aero-paywall-comments-results"></div>';let r=e.querySelector(".aero-paywall-comments-email-toggle"),o=e.querySelector(".aero-paywall-comments-results");la(r,t,a);try{let[n,i]=await Promise.all([U(t,"/comments/mine",a),U(t,"/comments/notifications",a)]),s=i.length===0?"":`
267      <div class="aero-paywall-comment-notifications">
268        <p class="aero-paywall-form-title">Replies to your comments</p>
269        <ul class="aero-paywall-saved-list">
270          ${i.map(c=>`
271            <li class="${c.read?"":"aero-paywall-comment-notification--unread"}">
272              <div class="aero-paywall-saved-list-body">
273                <a href="${b(Hr(c.postId))}"><strong>${b(c.replyAuthor)}</strong> replied: &ldquo;${b(c.commentBody)}&rdquo;</a>
274                <span>${new Date(c.createdAt).toLocaleDateString()}</span>
275              </div>
276            </li>
277          `).join("")}
278        </ul>
279      </div>
280    `,l=n.comments.length===0?"<p>Comments you post on articles will show up here.</p>":`
281      <p class="aero-paywall-form-title">Your comments</p>
282      <ul class="aero-paywall-saved-list">
283        ${n.comments.map(c=>`
284          <li>
285            <div class="aero-paywall-saved-list-body">
286              <a href="${b(Hr(c.postId))}">${b(c.body)}</a>
287              <span>${c.parentId?"Reply \xB7 ":""}${new Date(c.createdAt).toLocaleDateString()}</span>
288            </div>
289          </li>
290        `).join("")}
291      </ul>
292    `;o.innerHTML=s+l,i.some(c=>!c.read)&&F(t,"/comments/notifications/read",a,{}).catch(()=>{})}catch(n){o.innerHTML=`<p class="aero-paywall-form-error">${b(n instanceof Error?n.message:"Failed to load your comments")}</p>`}}async function ni(e,t,a,r){try{let[{code:o},n]=await Promise.all([U(t,"/me/referrals/code",a),U(t,"/me/referrals",a)]),i=new URL(window.location.origin);i.searchParams.set("ref",o),e.innerHTML=`
293      <p class="aero-paywall-form-title">Share your code, earn a reward</p>
294      <p>Give friends your link \u2014 when they sign up, you get a discount on your next renewal.</p>
295      <div class="aero-paywall-referral-code-row">
296        <input type="text" readonly value="${b(i.toString())}" class="aero-paywall-referral-code-input" />
297        <button type="button" class="aero-paywall-referral-copy-button" style="background:${r}">Copy link</button>
298      </div>
299      <p class="aero-paywall-referral-count">${n.length} friend${n.length===1?"":"s"} referred so far</p>
300    `;let s=e.querySelector(".aero-paywall-referral-copy-button"),l=e.querySelector(".aero-paywall-referral-code-input");s?.addEventListener("click",()=>{l?.select(),navigator.clipboard?.writeText(i.toString())})}catch(o){e.innerHTML=`<p class="aero-paywall-form-error">${b(o instanceof Error?o.message:"Failed to load referral info")}</p>`}}async function ua(e,t,a,r,o,n){try{let[i,s,l]=await Promise.all([fetch(`${t}/plans`).then(u=>u.json()).then(u=>u.data),U(t,"/me/gift-links",a),Qe(t,n)]),c=i.filter(u=>!u.isB2b),d=s.filter(u=>u.type==="plan").sort((u,w)=>new Date(w.createdAt).getTime()-new Date(u.createdAt).getTime()),p={currency:l.currency,gateway:l.gateway};if(c.length===0){e.innerHTML="<p>No plans are currently available to gift.</p>";return}let f=u=>c.map(w=>`<option value="${w.id}">${b(w.name)} (${w.durationDays}d) \u2014 ${u==="USD"?`$${w.priceUsd}`:`\u20A6 ${w.priceNgn}`}</option>`).join("");e.innerHTML=`
301      <p class="aero-paywall-form-title">Gift a subscription</p>
302      <p>
302Buy a friend full access \u2014 enter their email, pick a plan, pay for it. They redeem the link themselves; the link only works for that email. There's no limit on how many you can send.</p>
303      <form class="aero-paywall-form aero-paywall-gift-form">
304        <label>Recipient's email
305          <input type="email" name="recipientEmail" required placeholder="[email protected]" />
306        </label>
307        <label>Plan
308          <select name="planId">${f(p.currency)}</select>
309        </label>
310        ${da(l.options,p.gateway,"aero-gift-payment-option")}
311        <button type="submit" style="background:${r}">Buy &amp; create gift link</button>
312        <p class="aero-paywall-form-error" role="alert" hidden></p>
313        <p class="aero-paywall-form-success" role="status" hidden></p>
314      </form>
315      <div class="aero-paywall-referral-code-row aero-paywall-gift-result" hidden>
316        <input type="text" readonly class="aero-paywall-gift-result-input aero-paywall-referral-code-input" />
317        <button type="button" class="aero-paywall-referral-copy-button aero-paywall-gift-copy-button" style="background:${r}">Copy link</button>
318      </div>
319      <p class="aero-paywall-gift-history-title">${d.length} gift link${d.length===1?"":"s"} sent so far</p>
320      ${d.length>0?`<ul class="aero-paywall-gift-history">
321              ${d.map(u=>ii(u,r)).join("")}
322            </ul>`:""}
323    `;let m=e.querySelector(".aero-paywall-gift-form"),g=m.querySelector(".aero-paywall-form-error"),k=m.querySelector('button[type="submit"]'),A=m.querySelector('select[name="planId"]'),S=e.querySelector(".aero-paywall-gift-result"),y=e.querySelector(".aero-paywall-gift-result-input");e.querySelector(".aero-paywall-gift-copy-button")?.addEventListener("click",()=>{y.select(),navigator.clipboard?.writeText(y.value).catch(()=>{})}),m.querySelectorAll('input[name="aero-gift-payment-option"]').forEach(u=>{u.addEventListener("change",()=>{if(!u.checked)return;let w=l.options.find(h=>h.gateway===u.value);if(!w)return;p.currency=w.currency,p.gateway=w.gateway;let T=A.value;A.innerHTML=f(w.currency),A.value=T})}),m.addEventListener("submit",u=>{u.preventDefault(),L()});let L=async()=>{g&&(g.hidden=!0);let u=new FormData(m),w=String(u.get("planId")??""),T=String(u.get("recipientEmail")??"").trim();if(!(!w||!T)){k&&(k.disabled=!0);try{let{gateway:h}=p,C=await F(t,"/me/gift-links/plan-checkout/init",a,{planId:w,gateway:h,recipientEmail:T,returnUrl:Rr(o,"purchase")}),H=await $r(C.checkout,h,t,a,"/me/gift-links/plan-checkout/verify");if(!H.token)throw new Error("Payment was confirmed, but no gift link came back \u2014 refresh this page to check your history.");si(H.token,y,S)}catch(h){g&&(g.textContent=h instanceof Error?h.message:"Could not complete the purchase",g.hidden=!1)}finally{k&&(k.disabled=!1)}}};e.querySelectorAll(".aero-paywall-gift-renew-button").forEach(u=>{u.addEventListener("click",()=>{P(u)})});let P=async u=>{let w=u.dataset.giftLinkId,T=m.querySelector(".aero-paywall-form-success");g&&(g.hidden=!0),u.disabled=!0,u.textContent="Renewing\u2026";try{let{gateway:h}=await Qe(t,n),C=await F(t,`/me/gift-links/${w}/renew-checkout/init`,a,{gateway:h,returnUrl:Rr(o,"renewal")});await $r(C.checkout,h,t,a,"/me/gift-links/renew-checkout/verify"),T&&(T.textContent="Renewed \u2014 the gifted subscription has been extended.",T.hidden=!1),ua(e,t,a,r,o,n)}catch(h){g&&(g.textContent=h instanceof Error?h.message:"Could not renew this gift",g.hidden=!1),u.disabled=!1,u.textContent="Renew"}}}catch(i){e.innerHTML=`<p class="aero-paywall-form-error">${b(i instanceof Error?i.message:"Failed to load gift options")}</p>`}}function ii(e,t){let a=new Date(e.createdAt).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"}),r=e.redemptionCount>0,o;return r&&e.subscription?.status==="active"&&e.subscription.expiresAt?o=`Active until ${new Date(e.subscription.expiresAt).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}`:r&&e.subscription?.status==="expired"?o="Expired":r?o="Redeemed":new Date(e.expiresAt)<new Date?o="Expired, unredeemed":o="Waiting to be redeemed",`
324    <li class="aero-paywall-gift-history-row">
325      <div class="aero-paywall-gift-history-main">
326        <span class="aero-paywall-gift-history-plan">${b(e.plan?.name??"Plan")}</span>
327        ${e.recipientEmail?`<span class="aero-paywall-gift-history-recipient">to ${b(e.recipientEmail)}</span>`:""}
328        <span class="aero-paywall-gift-history-meta">Bought ${a} \xB7 ${b(o)}</span>
329      </div>
330      ${r?`<button type="button" class="aero-paywall-gift-renew-button" data-gift-link-id="${e.id}" style="background:${t}">Renew</button>`:""}
331    </li>
332  `}function si(e,t,a){let r=new URL(window.location.origin);r.searchParams.set("aero_gift_plan",e),t.value=r.toString(),a.hidden=!1,t.select(),navigator.clipboard?.writeText(r.toString()).catch(()=>{})}function Rr(e,t){if(!e)return e;let a=new URL(e,window.location.href);return a.searchParams.set("tab","gift"),a.searchParams.set(t==="purchase"?"aero_gift_purchase":"aero_gift_renewal","1"),a.toString()}async function Kr(e,t,a,r){try{let n=(await fetch(`${t}/plans`).then(c=>c.json()).then(c=>c.data)).filter(c=>c.isB2b);e.innerHTML=`
333      <form class="aero-paywall-upgrade-form">
334        <label>Company name<input type="text" name="orgName" required /></label>
335        <label>Whitelisted domains (comma-separated)<input type="text" name="domains" /></label>
336        <label>Plan
337          <select name="planId">
338            ${n.map(c=>`<option value="${c.id}">${b(c.name)} (${c.durationDays}d)</option>`).join("")}
339          </select>
340        </label>
341        <label>Seats<input type="number" name="seats" min="1" value="1" required /></label>
342        <button type="submit" style="background:${r}">Upgrade to Corporate</button>
343        <p class="aero-paywall-form-error" role="alert" hidden></p>
344      </form>
345    `;let i=e.querySelector(".aero-paywall-upgrade-form"),s=i.querySelector(".aero-paywall-form-error");i.addEventListener("submit",c=>{c.preventDefault(),l()});let l=async()=>{s&&(s.hidden=!0);let c=new FormData(i),d=String(c.get("planId")??""),p=Number(c.get("seats")??1),f=String(c.get("orgName")??""),m=String(c.get("domains")??"").split(",").map(g=>g.trim()).filter(Boolean);try{let{checkout:g}=await F(t,"/checkout/init",a,{planId:d,seats:p,gateway:"stripe"});if(g.mode!=="mock")throw new Error("This payment method requires a checkout flow not yet available here.");await F(t,"/checkout/upgrade-to-b2b",a,{reference:g.reference,orgName:f,domains:m}),window.location.reload()}catch(g){s&&(s.textContent=g instanceof Error?g.message:"Upgrade failed",s.hidden=!1)}}}catch(o){e.innerHTML=`<p class="aero-paywall-form-error">${b(o instanceof Error?o.message:"Failed to load upgrade options")}</p>`}}var li={subscribe:'<circle cx="12" cy="12" r="9"/><path d="M9 12l2 2 4-4"/>',history:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3.5 2"/>',bookmarks:'<path d="M6 3.5h12a.5.5 0 0 1 .5.5v16.5l-6.5-4-6.5 4V4a.5.5 0 0 1 .5-.5z"/>',"reading-history":'<path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/>',referrals:'<path d="M20 12v9H4v-9"/><path d="M2 7h20v5H2z"/><path d="M12 22V7"/><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"/><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"/>',profile:'<path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"/><circle cx="12" cy="7" r="4"/>',password:'<rect x="3" y="11" width="18" height="11" rx="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',personalization:'<line x1="4" y1="21" x2="4" y2="14"/><line x1="4" y1="10" x2="4" y2="3"/><line x1="12" y1="21" x2="12" y2="12"/><line x1="12" y1="8" x2="12" y2="3"/><line x1="20" y1="21" x2="20" y2="16"/><line x1="20" y1="12" x2="20" y2="3"/><line x1="1" y1="14" x2="7" y2="14"/><line x1="9" y1="8" x2="15" y2="8"/><line x1="17" y1="16" x2="23" y2="16"/>',"email-alerts":'<rect x="2" y="4" width="20" height="16" rx="2"/><path d="m2 7 10 6 10-6"/>'},ci=[{tab:"subscribe",title:"Subscribe",description:"View plans and manage your subscription"},{tab:"history",title:"Subscription History",description:"See your past billing and plan changes"},{tab:"bookmarks",title:"Bookmarks",description:"Articles you have saved to read later"},{tab:"reading-history",title:"Reading History",description:"Articles you have read while signed in"},{tab:"profile",title:"My Profile",description:"View and update your account details"},{tab:"password",title:"Change Password",description:"Update your account password"},{tab:"personalization",title:"Personalization",description:"Pick up to 5 topics you care about most"},{tab:"email-alerts",title:"News Brief & Newsletters",description:"Opt into email briefs and newsletters"}];function di(e,t,a,r){e.innerHTML=`
346    ${t?`<p class="aero-paywall-account-welcome">${b(We())}, ${b(t)}</p>`:""}
347    <p class="aero-paywall-dashboard-intro">From here you can manage your subscription, revisit saved and previously read articles, and update your account details.</p>
348    <div class="aero-paywall-dashboard-grid">
349      ${ci.filter(o=>o.tab!=="personalization"||r).map(o=>`
350        <button type="button" class="aero-paywall-dashboard-card" data-dashboard-card="${o.tab}">
351          <span class="aero-paywall-dashboard-card-icon"><svg viewBox="0 0 24 24" width="22" height="22" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">${li[o.tab]??""}</svg></span>
352          <span class="aero-paywall-dashboard-card-title">${b(o.title)}</span>
353          <span class="aero-paywall-dashboard-card-desc">${b(o.description)}</span>
354        </button>
355      `).join("")}
356    </div>
357  `,e.querySelectorAll("[data-dashboard-card]").forEach(o=>{o.addEventListener("click",()=>a(o.dataset.dashboardCard))})}var pi={subscribe:"Compare individual and corporate plans, and start or manage your subscription.",history:"A record of your past subscriptions, renewals, and payments.",upgrade:"Move from an individual plan to a corporate/team plan with multiple seats for colleagues.",referrals:"Share your referral link or code \u2014 earn rewards when a friend subscribes using it.",bookmarks:'Articles you\u2019ve saved to read later. Tap "Save" on any article to add it here.',"reading-history":"Articles you\u2019ve read while signed in, most recent first.",profile:"Your account details. Email and first name are set when you register and can\u2019t be changed here; everything else you can update any time.",password:"Change the password you use to sign in to your account.",personalization:'Pick up to 5 topics you care about most \u2014 used to personalize what you see, including your "My News" feed in the account flyout.',"email-alerts":"Opt into a periodic News Brief of stories you might have missed, and manage which newsletters you receive.",team:"Manage your organization\u2019s members and seats. Owners/admins get full access; members see a read-only view."};
357function j(e,t){let a=e.querySelector(`[data-panel="${t}"]`),r=pi[t];return r?(a.innerHTML=`
358    <div class="aero-paywall-panel-layout">
359      <div class="aero-paywall-panel-main"></div>
360      <aside class="aero-paywall-panel-aside"><p>${b(r)}</p></aside>
361    </div>
362  `,a.querySelector(".aero-paywall-panel-main")):a}async function ui(e,t,a,r){e.innerHTML=`
363    <div class="aero-paywall-profile-split">
364      <div class="aero-paywall-profile-readonly"></div>
365      <div class="aero-paywall-profile-editable"></div>
366    </div>
367  `;let o=e.querySelector(".aero-paywall-profile-readonly"),n=e.querySelector(".aero-paywall-profile-editable");function i(s){let l=[["Email",s.email],["First name",s.firstName??"\u2014"],["Last name",s.lastName??"\u2014"],["Phone",s.phone??"\u2014"],["Company",s.company??"\u2014"],["Member since",new Date(s.createdAt).toLocaleDateString()]];s.subscription&&l.push(["Current plan",`${s.subscription.planName} (${s.subscription.status})`]),s.org&&l.push(["Organization",s.org.role==="admin"?"Owner/Admin":"Member"]),o.innerHTML=`
368      <h3>Your profile</h3>
369      <dl class="aero-paywall-profile-readonly-list">
370        ${l.map(([p,f])=>`<div><dt>${b(p)}</dt><dd>${b(f)}</dd></div>`).join("")}
371        <div>
372          <dt>Email verified</dt>
373          <dd class="aero-paywall-verify-email-row">
374            ${s.emailVerifiedAt?"Yes":'<span>No</span><button type="button" class="aero-paywall-verify-email-btn">Verify email</button>'}
375            <span class="aero-paywall-verify-email-status" role="status" hidden></span>
376          </dd>
377        </div>
378      </dl>
379      <p class="aero-paywall-profile-readonly-note">Email and first name are set when you register and can't be changed here.</p>
380    `;let c=o.querySelector(".aero-paywall-verify-email-btn"),d=o.querySelector(".aero-paywall-verify-email-status");c?.addEventListener("click",()=>{c.disabled=!0,d.hidden=!0,F(t,"/me/verify-email/request",a,{}).then(()=>{d.textContent="Verification email sent \u2014 check your inbox.",d.hidden=!1}).catch(p=>{d.textContent=p instanceof Error?p.message:"Could not send verification email.",d.hidden=!1,c.disabled=!1})})}try{let s=await U(t,"/me",a);i(s),n.innerHTML="<h3>Update your details</h3>";let l=Nt({lastName:s.lastName,phone:s.phone,company:s.company},r);n.appendChild(l),Ae(l,t,a,c=>{s={...s,...c},i(s)})}catch(s){o.innerHTML=`<p class="aero-paywall-form-error">${b(s instanceof Error?s.message:"Failed to load profile")}</p>`}}function mi(e,t,a){e.innerHTML="<h3>Change password</h3>";let r=Vt(a);e.appendChild(r),Yt(r,t)}function fi(e,t,a,r){e.innerHTML="<h3>Personalization</h3>";let o=document.createElement("div");e.appendChild(o),Xe(o,t,a,r)}function gi(e,t,a,r){e.innerHTML=`
381    <div class="aero-paywall-email-alerts-digest"></div>
382    <div class="aero-paywall-email-alerts-newsletters">
383      <h4>Newsletters</h4>
384      <div class="aero-paywall-email-alerts-newsletters-picker"></div>
385    </div>
386  `;let o=e.querySelector(".aero-paywall-email-alerts-digest");_e(o,t,a);let n=e.querySelector(".aero-paywall-email-alerts-newsletters-picker");Ye(n,t,a,r)}var yi="aero-paywall-gift-mount";function hi(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}var wi='<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M20 12v10H4V12"/><path d="M2 7h20v5H2z"/><path d="M12 22V7"/><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"/><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"/></svg>';function ma(e,t,a){let r=typeof document<"u"?document.getElementById(yi):null;if(!r)return;let o=document.createElement("button");o.type="button",o.className="aero-paywall-gift-button",o.innerHTML=`${wi}<span>Gift</span>`;let n=document.createElement("span");n.className="aero-paywall-gift-status",n.setAttribute("role","status"),n.hidden=!0,o.addEventListener("click",()=>{i()});async function i(){o.disabled=!0,n.hidden=!0;try{let s=await fetch(`${e}/me/gift-links`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({postId:a})}),l=await s.json().catch(()=>null);if(!s.ok||!l?.data)throw new Error(hi(l,"Could not create a gift link"));let c=new URL(window.location.href);c.searchParams.set("aero_gift",l.data.token),await bi(c.toString()),n.textContent="Link copied \u2014 share it with anyone",n.hidden=!1}catch(s){n.textContent=s instanceof Error?s.message:"Could not create a gift link",
386n.hidden=!1}finally{o.disabled=!1}}r.appendChild(o),r.appendChild(n)}async function bi(e){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(e);return}let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}async function ya(e){let t=typeof document<"u"?document.querySelectorAll(aa):null;!t||t.length===0||(t.forEach(r=>vi(r)),t.forEach(r=>Li(r,e)),!await pe(e.jwksUrl,e.apiBaseUrl))||t.forEach(r=>Vr(r,e))}var ga="aero-paywall-nav-panel--open",Jr="aero-paywall-nav-backdrop--visible",Gr="aero-paywall-nav-scroll-lock";function vi(e){let t=e.querySelector("[data-aero-nav-trigger]"),a=e.querySelector("[data-aero-nav-panel]");if(!t||!a||t.dataset.aeroBound)return;t.dataset.aeroBound="1";let r=e.querySelector("[data-aero-nav-backdrop]");typeof document<"u"&&a.parentElement!==document.body&&(document.body.appendChild(a),r&&r.parentElement!==document.body&&document.body.appendChild(r),Ke.set(e,{panel:a,backdrop:r}));let o=a.querySelectorAll("[data-aero-nav-close]"),n=()=>a.classList.contains(ga),i=()=>{a.classList.add(ga),r?.classList.add(Jr),document.body.classList.add(Gr),t.setAttribute("aria-expanded","true")},s=()=>xi(e);t.addEventListener("click",()=>n()?s():i()),r?.addEventListener("click",s),o.forEach(l=>l.addEventListener("click",s)),document.addEventListener("keydown",l=>{l.key==="Escape"&&n()&&s()})}function xi(e){let t=e.querySelector("[data-aero-nav-trigger]"),a=Ke.get(e),r=a?.panel??e.querySelector("[data-aero-nav-panel]"),o=a?.backdrop??e.querySelector("[data-aero-nav-backdrop]");r?.classList.remove(ga),o?.classList.remove(Jr),document.body.classList.remove(Gr),t?.setAttribute("aria-expanded","false")}function jr(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}function Ur(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function Ei(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value}var ki=720*60*60*1e3,Ti={saved:"Saved Articles",history:"Read History","my-news":"My News"};function Vr(e,t){let a=Ee(e),r=a.querySelector("[data-aero-nav-menu]"),o=a.querySelector("[data-aero-nav-detail]"),n=a.querySelector("[data-aero-nav-detail-title]"),i=a.querySelectorAll("[data-aero-nav-card-toggle]"),s=a.querySelector("[data-aero-nav-back]");if(!r||!o||i.length===0)return;let l=M(),c={saved:a.querySelector("[data-aero-nav-saved-list]"),history:a.querySelector("[data-aero-nav-history-list]"),"my-news":a.querySelector("[data-aero-nav-my-news-list]")};i.forEach(d=>{if(d.dataset.aeroBound)return;d.dataset.aeroBound="1";let p=d.dataset.aeroNavCardToggle,f=p?c[p]:null;!p||!f||d.addEventListener("click",()=>{r.hidden=!0,o.hidden=!1,n&&(n.textContent=Ti[p]??""),Object.values(c).forEach(m=>{m&&(m.hidden=m!==f)}),!f.dataset.aeroLoaded&&(f.dataset.aeroLoaded="1",l&&(p==="saved"?Wr(f,`${t.apiBaseUrl}/me/bookmarks`,l,"createdAt",'Nothing saved yet \u2014 tap "Save" on an article to bookmark it here.'):p==="history"?Wr(f,`${t.apiBaseUrl}/me/reading-history`,l,"viewedAt","Articles you read while signed in will show up here.",ki):p==="my-news"&&Si(f,t,l)))})}),s&&!s.dataset.aeroBound&&(s.dataset.aeroBound="1",s.addEventListener("click",()=>{o.hidden=!0,r.hidden=!1}))}function Wr(e,t,a,r,o,n){e.innerHTML='<p class="aero-paywall-nav-summary-loading">Loading\u2026</p>',fetch(t,{headers:{Authorization:`Bearer ${a}`}}).then(i=>i.ok?i.json():null).then(i=>{let s=Array.isArray(i?.data)?i.data:[];if(n){let l=Date.now()-n;s=s.filter(c=>new Date(c[r]).getTime()>=l)}if(s.length===0){e.innerHTML=`<p class="aero-paywall-nav-summary-empty">${o}</p>`;return}e.innerHTML=`
387        <ul class="aero-paywall-nav-summary-list">
388          ${s.map(l=>`
389            <li>
390              <a href="${Ur(l.url)}">${jr(l.title)}</a>
391              <span>${new Date(l[r]).toLocaleDateString()}</span>
392            </li>
393          `).join("")}
394        </ul>
395      `}).catch(()=>{e.innerHTML='<p class="aero-paywall-nav-summary-empty">Could not load right now.</p>'})}function Si(e,t,a){e.innerHTML='<p class="aero-paywall-nav-summary-loading">Loading\u2026</p>',fetch(`${t.apiBaseUrl}/me/follows`,{headers:{Authorization:`Bearer ${a}`}}).then(r=>r.ok?r.json():null).then(async r=>{let o=(r?.data??[]).filter(l=>l.taxonomy==="category").map(l=>l.termId);if(o.length===0){e.innerHTML='<p class="aero-paywall-nav-summary-empty">Pick a few interests in Personalization and your latest stories will show up here.</p>';return}let n=new URLSearchParams({categories:o.join(","),per_page:"10",orderby:"date",_fields:"link,title,date"}),i=await fetch(`/wp-json/wp/v2/posts?${n.toString()}`);if(!i.ok)throw new Error("failed");let s=await i.json();if(!Array.isArray(s)||s.length===0){e.innerHTML='<p class="aero-paywall-nav-summary-empty">No recent stories in your picked interests yet.</p>';return}e.innerHTML=`
396        <ul class="aero-paywall-nav-summary-list">
397          ${s.map(l=>`
398            <li>
399              <a href="${Ur(l.link)}">${jr(Ei(l.title.rendered))}</a>
400              <span>${new Date(l.date).toLocaleDateString()}</span>
401            </li>
402          `).join("")}
403        </ul>
404      `}).catch(()=>{e.innerHTML='<p class="aero-paywall-nav-summary-empty">Could not load right now.</p>'})}function Li(e,t){let a=Ee(e).querySelector("[data-aero-nav-auth-mount]");if(!a||a.dataset.aeroBound)return;a.dataset.aeroBound="1";let r=()=>{pe(t.jwksUrl,t.apiBaseUrl).then(c=>{c&&Vr(e,t)})},o=()=>{if(r(),!t.followEnabled)return;let c=M();c&&Re(t.apiBaseUrl,c,t.accentColor)},n=c=>{let d=a.querySelector(".aero-paywall-form-error");d&&(d.textContent=c,d.hidden=!1)},i=()=>{a.innerHTML="";let c=W(t.googleClientId,t.appleClientId);c&&(a.appendChild(c),G(c,t.apiBaseUrl,t.googleClientId,t.appleClientId,r,n),a.appendChild(J()));let d=re(t.accentColor);a.appendChild(d),oe(d,t.apiBaseUrl,r),a.appendChild(Ci(Yr("Forgot password?",l))),a.appendChild(fa("Don't have an account?","Sign up",s))},s=()=>{a.innerHTML="";let c=W(t.googleClientId,t.appleClientId);c&&(a.appendChild(c),G(c,t.apiBaseUrl,t.googleClientId,t.appleClientId,o,n),a.appendChild(J()));let d=te(t.accentColor,t.captcha);a.appendChild(d),ae(d,t.apiBaseUrl,o,t.captcha),a.appendChild(fa("Already have an account?","Log in",i))},l=()=>{a.innerHTML="";let c=$e(t.accentColor);a.appendChild(c),He(c,t.apiBaseUrl),a.appendChild(fa("Remembered it?","Back to log in",i))};i()}function Ci(...e){let t=document.createElement("div");return t.className="aero-paywall-auth-links-row",e.forEach(a=>t.appendChild(a)),t}function fa(e,t,a){let r=document.createElement("div");r.className="aero-paywall-auth-footer";let o=document.createElement("span");return o.textContent=e,r.appendChild(o),r.appendChild(Yr(t,a,"aero-paywall-auth-footer-link")),r}function Yr(e,t,a){let r=document.createElement("button");return r.type="button",r.className=a?`aero-paywall-auth-toggle-link ${a}`:"aero-paywall-auth-toggle-link",r.textContent=e,r.addEventListener("click",t),r}var Xr="aero-paywall-styles",v="#1a73e8",Pi=`
405.aero-paywall-form {
406  display: flex;
407  flex-direction: column;
408  gap: 14px;
409  max-width: 400px;
410  margin: 0 auto;
411  padding: 26px;
412  border-radius: 14px;
413  background: var(--color-bg-raised, #fff);
414  border: 1px solid var(--color-border, #e5e7eb);
415  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
416  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
417  box-sizing: border-box;
418}
419.aero-paywall-form * {
420  box-sizing: border-box;
421}
422.aero-paywall-form-title {
423  margin: 0 0 4px;
424  font-family: Georgia, "Times New Roman", Times, serif;
425  font-size: 19px;
426  font-weight: 700;
427  color: var(--color-ink-1, #111827);
428}
429.aero-paywall-form label {
430  display: flex;
431  flex-direction: column;
432  gap: 6px;
433  font-size: 13px;
434  font-weight: 500;
435  color: var(--color-ink-2, #374151);
436}
437.aero-paywall-form input,
438.aero-paywall-form select {
439  width: 100%;
440  padding: 10px 12px;
441  border: 1px solid var(--color-border, #d1d5db);
442  border-radius: 8px;
443  font-size: 14px;
444  font-family: inherit;
445  color: var(--color-ink-1, #111827);
446  background: var(--color-bg-raised, #fff);
447  transition: border-color 0.15s ease, box-shadow 0.15s ease;
448}
449.aero-paywall-form input:focus,
450.aero-paywall-form select:focus {
451  outline: none;
452  border-color: var(--aero-accent, ${v});
453  box-shadow: 0 0 0 3px var(--aero-accent-soft, rgba(26, 115, 232, 0.15));
454}
455.aero-paywall-form button[type="submit"] {
456  margin-top: 4px;
457  padding: 11px 16px;
458  border: none;
459  border-radius: 8px;
460  color: #fff;
461  font-size: 14px;
462  font-weight: 600;
463  cursor: pointer;
464  transition: opacity 0.15s ease, transform 0.05s ease;
465}
466.aero-paywall-form button[type="submit"]:hover {
467  opacity: 0.92;
468}
469.aero-paywall-form button[type="submit"]:active {
470  transform: translateY(1px);
471}
472.aero-paywall-form button[type="submit"]:disabled {
473  opacity: 0.6;
474  cursor: not-allowed;
475}
476.aero-paywall-oauth-buttons {
477  display: flex;
478  flex-direction: column;
479  gap: 8px;
480}
481.aero-paywall-oauth-google {
482  display: flex;
483  justify-content: center;
484}
485.aero-paywall-oauth-apple {
486  padding: 10px 16px;
487  border: 1px solid #000;
488  border-radius: 8px;
489  background: #000;
490  color: #fff;
491  font-size: 14px;
492  font-weight: 600;
493  cursor: pointer;
494  transition: opacity 0.15s ease;
495}
496.aero-paywall-oauth-apple:hover {
497  opacity: 0.85;
498}
499/* Reader-requested placement: inline in the byline row beside Save
500   (aero-paywall-bookmark-mount), not its own block \u2014 no margin needed,
501   .bday-byline's own flex gap spaces every child identically. */
502.aero-paywall-gift-button {
503  display: inline-flex;
504  align-items: center;
505  gap: 6px;
506  padding: 8px 14px;
507  border: 1px solid #d1d5db;
508  border-radius: 999px;
509  background: #fff;
510  /* !important: same theme-bleed-through risk as .aero-paywall-prompt-cta
511     \u2014 this is a <button>, but the same class of theme rule that hit that
512     <a> has already been observed hitting a plain-class <button> too
513     (see .aero-paywall-referral-copy-button's identical note). */
514  color: #374151 !important;
515  font-size: 13px;
516  font-weight: 600;
517  cursor: pointer;
518  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
519}
520.aero-paywall-gift-button:hover {
521  border-color: var(--aero-accent, ${v});
522  color: var(--aero-accent, ${v}) !important;
523}
524.aero-paywall-gift-button:disabled {
525  opacity: 0.6;
526  cursor: not-allowed;
527}
528.aero-paywall-gift-status {
529  display: block;
530  margin-top: 6px;
531  font-size: 12px;
532  color: #6b7280;
533}
534.aero-paywall-gift-history-title {
535  margin: 20px 0 8px;
536  font-size: 13px;
537  font-weight: 600;
538  color: var(--color-ink-2, #374151);
539}
540.aero-paywall-gift-history {
541  list-style: none;
542  margin: 0;
543  padding: 0;
544  display: flex;
545  flex-direction: column;
546  gap: 8px;
547}
548.aero-paywall-gift-history-row {
549  display: flex;
550  align-items: center;
551  justify-content: space-between;
552  gap: 12px;
553  padding: 10px 12px;
554  border: 1px solid var(--color-border, #e5e7eb);
555  border-radius: 8px;
556  background: var(--color-bg-raised, #fff);
557}
558.aero-paywall-gift-history-main {
559  display: flex;
560  flex-direction: column;
561  gap: 2px;
562  min-width: 0;
563}
564.aero-paywall-gift-history-plan {
565  font-size: 13px;
566  font-weight: 600;
567  color: var(--color-ink-1, #111827);
568}
569.aero-paywall-gift-history-recipient {
570  font-size: 12px;
571  color: var(--color-ink-3, #6b7280);
572  overflow: hidden;
573  text-overflow: ellipsis;
574  white-space: nowrap;
575}
576.aero-paywall-gift-history-meta {
577  font-size: 12px;
578  color: var(--color-ink-3, #9ca3af);
579}
580.aero-paywall-gift-renew-button {
581  flex-shrink: 0;
582  padding: 8px 14px;
583  border: none;
584  border-radius: 8px;
585  color: #fff !important;
586  font-size: 12px;
587  font-weight: 600;
588  cursor: pointer;
589  transition: opacity 0.15s ease;
590}
591.aero-paywall-gift-renew-button:hover {
592  opacity: 0.9;
593}
594.aero-paywall-gift-renew-button:disabled {
595  opacity: 0.6;
596  cursor: not-allowed;
597}
598.aero-paywall-coupon-row {
599  display: flex;
600  align-items: center;
601  gap: 8px;
602  margin: 16px 0;
603}
604.aero-paywall-coupon-row label {
605  font-size: 13px;
606  color: #6b7280;
607  white-space: nowrap;
608}
609.aero-paywall-coupon-input {
610  flex: 1;
611  max-width: 220px;
612  padding: 10px 12px;
613  border: 1px solid #d1d5db;
614  border-radius: 8px;
615  font-size: 13px;
616  color: #374151;
617  background: #f9fafb;
618  transition: border-color 0.15s ease, box-shadow 0.15s ease;
619}
620/* Brand-accent focus ring, not the browser's default blue outline \u2014
621   same treatment .aero-paywall-form input:focus already gets; this
622   input lives outside any .aero-paywall-form-scoped form so it never
623   inherited that rule. */
624.aero-paywall-coupon-input:focus {
625  outline: none;
626  border-color: var(--aero-accent, ${v});
627  box-shadow: 0 0 0 3px var(--aero-accent-soft, rgba(26, 115, 232, 0.15));
628}
629.aero-paywall-referral-code-row {
630  display: flex;
631  gap: 8px;
632  margin: 12px 0;
633}
634.aero-paywall-referral-code-input {
635  flex: 1;
636  padding: 10px 12px;
637  border: 1px solid #d1d5db;
638  border-radius: 8px;
639  font-size: 13px;
640  color: #374151;
641  background: #f9fafb;
642}
643.aero-paywall-referral-copy-button {
644  padding: 10px 16px;
645  border: none;
646  border-radius: 8px;
647  /* !important: same theme-bleed-through risk as .aero-paywall-prompt-cta
648     \u2014 a single class here can lose to a more specific theme rule. */
649  color: #fff !important;
650  font-size: 13px;
651  font-weight: 600;
652  cursor: pointer;
653  white-space: nowrap;
654}
655.aero-paywall-referral-count {
656  font-size: 13px;
657  color: #6b7280;
658}
659.aero-paywall-counter {
660  position: fixed;
661  bottom: 24px;
662  right: 24px;
663  z-index: 2147483000;
664  display: flex;
665  align-items: center;
666  gap: 10px;
667  padding: 12px 14px;
668  border-radius: 999px;
669  background: var(--color-bg-raised, #fff);
670  border: 1px solid var(--color-border, #e5e7eb);
671  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.12);
672  font-size: 13px;
673  color: #374151;
674  cursor: grab;
675  user-select: none;
676  max-width: min(320px, calc(100vw - 32px));
677}
678.aero-paywall-counter:active {
679  cursor: grabbing;
680}
681.aero-paywall-counter-dot {
682  flex-shrink: 0;
683  width: 8px;
684  height: 8px;
685  border-radius: 50%;
686  background: var(--aero-accent, #1a73e8);
687}
688.aero-paywall-counter-text {
689  line-height: 1.35;
690}
691.aero-paywall-counter-text strong {
692  color: #111827;
693}
694.aero-paywall-counter-close {
695  flex-shrink: 0;
696  width: 20px;
697  height: 20px;
698  display: flex;
699  align-items: center;
700  justify-content: center;
701  border: none;
702  background: none;
703  border-radius: 50%;
704  color: #9ca3af;
705  font-size: 14px;
706  line-height: 1;
707  cursor: pointer;
708  padding: 0;
709}
710.aero-paywall-counter-close:hover {
711  background: #f3f4f6;
712  color: #374151;
713}
714.aero-paywall-form-error {
715  margin: 0;
716  padding: 10px 12px;
717  border-radius: 8px;
718  background: #fef2f2;
719  color: #b91c1c;
720  font-size: 13px;
721}
722.aero-paywall-form-success {
723  margin: 0;
724  padding: 10px 12px;
725  border-radius: 8px;
726  background: #f0fdf4;
727  color: #15803d;
728  font-size: 13px;
729}
730
731/* Password visibility toggle (password-toggle.ts) */
732.aero-paywall-password-wrapper input {
733  padding-right: 40px;
734}
735.aero-paywall-password-toggle {
736  color: #6b7280;
737}
738.aero-paywall-password-toggle:hover {
739  color: #374151;
740}
741
742/* Auth toggle link ("Already have an account? Log in") */
743.aero-paywall-auth-toggle-link,
744.aero-paywall-forgot-password-link {
745  background: none;
746  border: none;
747  padding: 0;
748  margin-top: -4px;
749  font-size: 13px;
750  color: var(--aero-accent, ${v});
751  cursor: pointer;
752  text-align: left;
753  text-decoration: underline;
754}
755
756/* Inline auth links in the flyout panel (nav-menu.ts's bindInlineAuth):
757   a right-aligned link row under the field it relates to, and a
758   divider-topped footer for the primary "switch forms" action \u2014 kept as
759   two distinct rows so they never read as one run-on sentence. */
760.aero-paywall-auth-links-row {
761  display: flex;
762  justify-content: flex-end;
763  margin: 4px 0 0;
764}
765.aero-paywall-auth-links-row .aero-paywall-auth-toggle-link {
766  margin-top: 0;
767}
768.aero-paywall-auth-footer {
769  display: flex;
770  align-items: center;
771  justify-content: center;
772  gap: 5px;
773  margin-top: 18px;
774  padding-top: 16px;
775  border-top: 1px solid #e5e7eb;
776  font-size: 13px;
777  color: #6b7280;
778}
779.aero-paywall-auth-footer-link {
780  margin-top: 0;
781  font-weight: 600;
782  text-decoration: underline;
783}
784
785/* Signed-out state: login/register toggle on the My Account page.
786   Reader-requested: no boxed card here \u2014 .aero-paywall-form's own
787   card chrome (background/border/shadow/padding, styled a few rules
788   up) is stripped specifically in this standalone-page context so the
789   form reads as native page content, not a floating card. Left
790   untouched everywhere else .aero-paywall-form appears (the flyout's
791   own inline login \u2014 a separate implementation in nav-menu.ts that
792   never uses this wrapper class \u2014 funnel gating prompts, the subscribe
793   page's inline auth prompt), where a visually separated card is still
794   the right call since those forms interrupt other page content rather
795   than being the page's own primary content. */
796.aero-paywall-account-signed-out {
797  max-width: 400px;
798  margin: 0 auto;
799}
800/* #aero-paywall-account-mount, not just .aero-paywall-account-signed-out
801   \u2014 the same mount element renders both the signed-out login/register
802   forms and, once authenticated, the Settings tab's profile/password
803   forms; both should read as plain page content, not a card, on this
804   page specifically. */
805#aero-paywall-account-mount .aero-paywall-form {
806  background: none;
807  border: none;
808  box-shadow: none;
809  padding: 0;
810  max-width: none;
811  margin: 0;
812}
813.aero-paywall-auth-tabs {
814  display: flex;
815  gap: 4px;
816  margin-bottom: 16px;
817  border-bottom: 1px solid var(--color-border, #e5e7eb);
818}
819.aero-paywall-auth-tabs button {
820  flex: 1;
821  padding: 10px 12px;
822  background: none;
823  border: none;
824  border-bottom: 2px solid transparent;
825  font-size: 14px;
826  font-weight: 600;
827  color: var(--color-ink-1, #6b7280);
828  cursor: pointer;
829  transition: color 0.15s ease, border-color 0.15s ease;
830}
831.aero-paywall-auth-tabs button[data-active="true"] {
832  color: var(--aero-accent, ${v});
833  border-bottom-color: var(--aero-accent, ${v});
834}
835
836/* Individual/Corporate toggle above the plan grid (renderSubscribeTab()) */
837.aero-paywall-plan-type-tabs {
838  display: inline-flex;
839  gap: 4px;
840  margin-bottom: 20px;
841  padding: 4px;
842  background: #f3f4f6;
843  border-radius: 999px;
844}
845.aero-paywall-plan-type-tabs button {
846  padding: 8px 20px;
847  background: none;
848  border: none;
849  border-radius: 999px;
850  font-size: 14px;
851  font-weight: 600;
852  color: #6b7280;
853  cursor: pointer;
854  transition: background-color 0.15s ease, color 0.15s ease;
855}
856.aero-paywall-plan-type-tabs button[data-active="true"] {
857  background: #fff;
858  color: #111827;
859  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
860}
861
862/* Payment-method picker (renderSubscribeTab()/renderPublicSubscribeTab()/renderGiftTab()) \u2014 shown
863   only when a reader outside Nigeria has more than one real, configured gateway to choose between
864   (see resolvePaymentOptions() in my-account.ts). Same segmented-pill language as the
865   Individual/Corporate toggle just above, radio inputs instead of buttons since exactly one
866   payment method is always selected, never none. */
867.aero-paywall-payment-option-picker {
868  display: inline-flex;
869  gap: 4px;
870  margin-bottom: 20px;
871  padding: 4px;
872  background: #f3f4f6;
873  border-radius: 999px;
874}
875.aero-paywall-payment-option-picker label {
876  display: flex;
877  flex-direction: row;
878  align-items: center;
879  gap: 6px;
880  padding: 8px 16px;
881  border-radius: 999px;
882  font-size: 14px;
883  font-weight: 600;
884  color: #6b7280;
885  cursor: pointer;
886  transition: background-color 0.15s ease, color 0.15s ease;
887}
888.aero-paywall-payment-option-picker label:has(input:checked) {
889  background: #fff;
890  color: #111827;
891  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
892}
893.aero-paywall-payment-option-picker input[type="radio"] {
894  width: auto;
895  margin: 0;
896  accent-color: var(--aero-accent, ${v});
897}
898
899/* Public /subscribe/ page's Corporate tab (renderPublicSubscribeTab()) \u2014
900   a brief intro + CTA into the sales-assisted Corporate Subscription
901   page, not a self-serve plan grid (that stays on the Individual tab and
902   on My Account's own Corporate tab for a reader who already knows their
903   plan). */
904.aero-paywall-corporate-intro {
905  max-width: 480px;
906  margin: 0 auto;
907  padding: 32px 16px;
908  text-align: center;
909}
910.aero-paywall-corporate-intro p {
911  margin: 0 0 20px;
912  font-size: 15px;
913  line-height: 1.6;
914  color: #4b5563;
915}
916.aero-paywall-corporate-intro a {
917  display: inline-block;
918  padding: 12px 28px;
919  border-radius: 8px;
920  background: var(--aero-accent, #1a73e8);
921  color: #fff;
922  font-size: 14px;
923  font-weight: 700;
924  text-decoration: none;
925}
926.aero-paywall-corporate-intro a:hover {
927  opacity: 0.92;
928}
929
930/* My Account dashboard */
931#aero-paywall-account-mount {
932  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
933  max-width: 720px;
934  margin: 0 auto;
935}
936#aero-paywall-account-mount [hidden],
937.aero-paywall-account-signed-out [hidden] {
938  /* Belt-and-braces against a host theme's own [hidden] { display: block }
939     reset (some do this to make the attribute easier to override) \u2014
940     without this, tab switching silently stops hiding inactive panels. */
941  display: none !important;
942}
943/* Reader-requested full-page redesign: no boxed card, no top tabs \u2014 a
944   persistent left sidebar (the reference layout the reader shared) with
945   a Dashboard overview as the default landing section instead of
946   jumping straight into Subscribe. */
947.aero-paywall-account-shell {
948  background: none;
949  border: none;
950  box-shadow: none;
951}
952.aero-paywall-account-title {
953  margin: 0 0 28px;
954  font-size: 30px;
955  font-weight: 800;
956  color: var(--color-ink-1, #111827);
957}
958/* Reader-requested: bigger \u2014 this is the Dashboard's own page-level
959   greeting now (the only place it shows at all), not a small caption
960   line shared with every other tab. No more inline "(Log out)" either;
961   Log Out already has its own place at the bottom of the sidebar. */
962.aero-paywall-account-welcome {
963  margin: 0 0 20px;
964  font-size: 26px;
965  font-weight: 700;
966  color: var(--color-ink-1, #111827);
967}
968.aero-paywall-account-layout {
969  display: grid;
970  grid-template-columns: 220px 1fr;
971  gap: 40px;
972  align-items: start;
973}
974.aero-paywall-account-sidebar {
975  display: flex;
976  flex-direction: column;
977  gap: 2px;
978  position: sticky;
979  top: 20px;
980}
981/* Reader-requested: sidebar items grouped by similarity under a small
982   uppercase label (Subscription/Reading/Account/Preferences/Team) \u2014
983   inserted inline before the first button of each group
984   (my-account.ts's own sidebarItemsHtml construction). */
985.aero-paywall-account-sidebar-group {
986  margin: 18px 0 4px;
987  padding: 0 14px;
988  font-size: 11px;
989  font-weight: 700;
990  color: var(--color-ink-3, #9ca3af);
991  text-transform: uppercase;
992  letter-spacing: 0.06em;
993}
994.aero-paywall-account-sidebar-group:first-child {
995  margin-top: 0;
996}
997.aero-paywall-account-sidebar button {
998  display: flex;
999  align-items: center;
1000  justify-content: space-between;
1001  gap: 8px;
1002  padding: 11px 14px;
1003  background: none;
1004  border: none;
1005  border-left: 3px solid transparent;
1006  border-radius: 0;
1007  font-size: 14px;
1008  font-weight: 600;
1009  color: var(--color-ink-2, #4b5563);
1010  text-align: left;
1011  cursor: pointer;
1012  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
1013}
1014/* Reader-requested: unread-reply count on "My Comments" \u2014 flex+
1015   justify-content:space-between above puts it flush right in the nav
1016   item without needing its own wrapper markup. */
1017.aero-paywall-account-sidebar-badge {
1018  display: inline-flex;
1019  align-items: center;
1020  justify-content: center;
1021  min-width: 18px;
1022  height: 18px;
1023  padding: 0 5px;
1024  border-radius: 999px;
1025  background: var(--aero-accent, ${v});
1026  color: #fff;
1027  font-size: 11px;
1028  font-weight: 700;
1029  line-height: 1;
1030}
1031.aero-paywall-account-sidebar button:hover {
1032  color: var(--color-ink-1, #111827);
1033  background: var(--color-bg, #f9fafb);
1034}
1035.aero-paywall-account-sidebar button[data-active="true"] {
1036  color: var(--aero-accent, ${v});
1037  background: color-mix(in srgb, var(--aero-accent, ${v}) 8%, var(--color-bg-raised, white));
1038  border-left-color: var(--aero-accent, ${v});
1039}
1040/* Every tab except Dashboard \u2014 a short description of that section on
1041   the right, "depending on the space available" (collapses to a single
1042   column, description moving below the content, under ~860px). */
1043.aero-paywall-panel-layout {
1044  display: grid;
1045  grid-template-columns: 1fr 240px;
1046  gap: 32px;
1047  align-items: start;
1048}
1049.aero-paywall-panel-aside {
1050  padding: 16px 18px;
1051  border-radius: 10px;
1052  background: var(--color-bg, #f9fafb);
1053}
1054.aero-paywall-panel-aside p {
1055  margin: 0;
1056  font-size: 13px;
1057  line-height: 1.55;
1058  color: var(--color-ink-3, #6b7280);
1059}
1060@media (max-width: 860px) {
1061  .aero-paywall-panel-layout {
1062    grid-template-columns: 1fr;
1063  }
1064}
1065.aero-paywall-account-sidebar-logout {
1066  margin-top: 14px;
1067  padding-top: 14px;
1068  border-top: 1px solid var(--color-border, #e5e7eb);
1069  color: var(--color-ink-3, #9ca3af) !important;
1070}
1071.aero-paywall-account-sidebar-logout:hover {
1072  color: var(--color-ink-2, #6b7280) !important;
1073  background: none !important;
1074}
1075.aero-paywall-account-content {
1076  min-width: 0;
1077}
1078.aero-paywall-account-panel {
1079  display: flex;
1080  flex-direction: column;
1081  gap: 18px;
1082}
1083.aero-paywall-account-panel[data-panel="settings"] {
1084  display: grid;
1085  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
1086  align-items: start;
1087  gap: 18px;
1088}
1089.aero-paywall-account-panel[data-panel="settings"] .aero-paywall-form {
1090  max-width: 100%;
1091  margin: 0;
1092}
1093
1094/* Dashboard overview panel (the default landing section) */
1095.aero-paywall-dashboard-intro {
1096  margin: 0 0 24px;
1097  font-size: 15px;
1098  color: #4b5563;
1099  max-width: 640px;
1100}
1101.aero-paywall-dashboard-grid {
1102  display: grid;
1103  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
1104  gap: 16px;
1105}
1106.aero-paywall-dashboard-card {
1107  display: flex;
1108  flex-direction: column;
1109  align-items: flex-start;
1110  gap: 10px;
1111  padding: 22px;
1112  border: 1px solid #e5e7eb;
1113  border-radius: 12px;
1114  background: #fff;
1115  text-align: left;
1116  cursor: pointer;
1117  transition: border-color 0.15s ease, box-shadow 0.15s ease;
1118}
1119.aero-paywall-dashboard-card:hover {
1120  border-color: var(--aero-accent, ${v});
1121  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
1122}
1123.aero-paywall-dashboard-card-icon {
1124  display: inline-flex;
1125  align-items: center;
1126  justify-content: center;
1127  width: 44px;
1128  height: 44px;
1129  border-radius: 50%;
1130  background: color-mix(in srgb, var(--aero-accent, ${v}) 10%, white);
1131  color: var(--aero-accent, ${v});
1132}
1133.aero-paywall-dashboard-card-title {
1134  font-size: 15px;
1135  font-weight: 700;
1136  color: #111827;
1137}
1138.aero-paywall-dashboard-card-desc {
1139  font-size: 13px;
1140  color: #6b7280;
1141  line-height: 1.4;
1142}
1143@media (max-width: 700px) {
1144  .aero-paywall-account-layout {
1145    grid-template-columns: 1fr;
1146  }
1147  .aero-paywall-account-sidebar {
1148    position: static;
1149    flex-direction: row;
1150    flex-wrap: wrap;
1151    gap: 4px;
1152    border-bottom: 1px solid #e5e7eb;
1153    padding-bottom: 8px;
1154    margin-bottom: 8px;
1155  }
1156  .aero-paywall-account-sidebar button {
1157    border-left: none;
1158    border-bottom: 2px solid transparent;
1159  }
1160  .aero-paywall-account-sidebar button[data-active="true"] {
1161    border-left-color: transparent;
1162    border-bottom-color: var(--aero-accent, ${v});
1163  }
1164  .aero-paywall-account-sidebar-logout {
1165    margin-top: 0;
1166    padding-top: 11px;
1167    border-top: none;
1168  }
1169  /* The group labels read fine in a vertical sidebar; wrapped into a
1170     horizontal row of buttons they'd just be visual noise between them. */
1171  .aero-paywall-account-sidebar-group {
1172    display: none;
1173  }
1174}
1175.aero-paywall-account-current {
1176  margin: 0;
1177  padding: 14px 16px;
1178  border-radius: 10px;
1179  background: #f3f4f6; /* fallback for browsers without color-mix() */
1180  background: color-mix(in srgb, var(--aero-accent, ${v}) 8%, white);
1181  border: 1px solid #e5e7eb;
1182  border: 1px solid color-mix(in srgb, var(--aero-accent, ${v}) 25%, white);
1183  font-size: 13px;
1184  color: #374151;
1185}
1186.aero-paywall-account-current-wrap {
1187  margin-bottom: 16px;
1188}
1189.aero-paywall-account-current-note {
1190  font-size: 12px;
1191  color: #6b7280;
1192  margin: 6px 2px 0;
1193}
1194.aero-paywall-cancel-subscription-link {
1195  background: none;
1196  border: none;
1197  padding: 6px 2px 0;
1198  font-size: 12px;
1199  color: #9ca3af;
1200  text-decoration: underline;
1201  cursor: pointer;
1202}
1203.aero-paywall-cancel-form {
1204  margin-top: 10px;
1205  padding: 12px 14px;
1206  border-radius: 10px;
1207  border: 1px solid #e5e7eb;
1208  font-size: 13px;
1209}
1210.aero-paywall-cancel-form select {
1211  display: block;
1212  width: 100%;
1213  margin-top: 4px;
1214  padding: 8px 10px;
1215  border-radius: 8px;
1216  border: 1px solid #d1d5db;
1217  font-size: 13px;
1218}
1219.aero-paywall-cancel-form-actions {
1220  display: flex;
1221  gap: 8px;
1222  margin-top: 10px;
1223}
1224.aero-paywall-cancel-confirm {
1225  color: #fff;
1226  border: none;
1227  border-radius: 8px;
1228  padding: 8px 14px;
1229  font-size: 13px;
1230  cursor: pointer;
1231}
1232.aero-paywall-cancel-dismiss {
1233  background: none;
1234  border: 1px solid #d1d5db;
1235  border-radius: 8px;
1236  padding: 8px 14px;
1237  font-size: 13px;
1238  cursor: pointer;
1239}
1240
1241/* Tiered plan cards (Subscribe tab / subscribe-modal.ts) \u2014 no currency
1242   toggle, no gateway picker: both are fully geography-derived
1243   (my-account.ts's resolveCurrencyAndGateway()), never a reader choice,
1244   so there's nothing to render a control for. */
1245.aero-paywall-plan-tier-grid {
1246  display: grid;
1247  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
1248  gap: 16px;
1249  align-items: stretch;
1250}
1251/* Reader-requested/reverted: the fixed 3-column row below is specific to
1252   the public /subscribe/ page's wider layout (--wide modifier, added by
1253   renderPublicSubscribeTab() only) \u2014 applying it to the base class
1254   affected My Account's own Subscribe tab too, which renders into the
1255   same #aero-paywall-account-mount at a much narrower ~720px max-width,
1256   where 3 fixed columns crushed the cards instead of fitting them. The
1257   base class stays auto-fit, matching My Account's original behavior.
1258   With minmax(220px, 1fr), a real card renders wider than that floor, so
1259   3 never actually shared a public-page row either \u2014 that's what --wide
1260   fixes there specifically. */
1261.aero-paywall-plan-tier-grid--wide {
1262  grid-template-columns: repeat(3, 1fr);
1263}
1264@media (max-width: 900px) {
1265  .aero-paywall-plan-tier-grid--wide {
1266    grid-template-columns: repeat(2, 1fr);
1267  }
1268}
1269@media (max-width: 560px) {
1270  .aero-paywall-plan-tier-grid--wide {
1271    grid-template-columns: 1fr;
1272  }
1273}
1274/* The public /subscribe/ page's post-plan-selection sign-in/create-
1275   account prompt (renderPublicSubscribeTab()) \u2014 visually set apart from
1276   the plan grid above it with a top divider, since it only appears once
1277   a reader has actually clicked a plan's Subscribe button. */
1278.aero-paywall-subscribe-auth-prompt {
1279  margin-top: 32px;
1280  padding-top: 32px;
1281  border-top: 1px solid #e5e7eb;
1282}
1283.aero-paywall-subscribe-auth-prompt__title {
1284  margin: 0 0 16px;
1285  font-size: 15px;
1286  color: #374151;
1287  text-align: center;
1288}
1289.aero-paywall-subscribe-resuming {
1290  padding: 40px 0;
1291  text-align: center;
1292  font-size: 14px;
1293  color: #6b7280;
1294}
1295.aero-paywall-plan-card {
1296  position: relative;
1297  display: flex;
1298  flex-direction: column;
1299  gap: 8px;
1300  padding: 20px 22px;
1301  border: 1px solid #e5e7eb;
1302  border-radius: 14px;
1303  background: #fff;
1304  transition: border-color 0.15s ease, box-shadow 0.15s ease;
1305}
1306.aero-paywall-plan-card:hover {
1307  border-color: var(--aero-accent, ${v});
1308  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
1309}
1310.aero-paywall-plan-card--current {
1311  border-color: var(--aero-accent, ${v});
1312  background: color-mix(in srgb, var(--aero-accent, ${v}) 4%, #fff);
1313}
1314.aero-paywall-plan-card h3 {
1315  margin: 0;
1316  font-size: 16px;
1317  font-weight: 700;
1318  color: #111827;
1319}
1320.aero-paywall-plan-card--promo h3,
1321.aero-paywall-plan-card--current h3 {
1322  padding-right: 90px; /* room for the badge */
1323}
1324.aero-paywall-plan-badge {
1325  position: absolute;
1326  top: 20px;
1327  right: 22px;
1328  padding: 3px 10px;
1329  border-radius: 999px;
1330  font-size: 11px;
1331  font-weight: 700;
1332  letter-spacing: 0.02em;
1333  text-transform: uppercase;
1334  color: #fff;
1335  background: var(--aero-accent, ${v});
1336}
1337.aero-paywall-plan-badge--current {
1338  background: #111827;
1339}
1340.aero-paywall-plan-price {
1341  margin: 0;
1342  font-size: 20px;
1343  font-weight: 700;
1344  color: var(--aero-accent, ${v});
1345}
1346.aero-paywall-plan-price-sub {
1347  margin: -4px 0 0;
1348  font-size: 12px;
1349  color: #6b7280;
1350}
1351.aero-paywall-plan-card ul {
1352  list-style: none;
1353  margin: 4px 0;
1354  padding: 0;
1355  display: flex;
1356  flex-direction: column;
1357  gap: 6px;
1358  flex: 1;
1359}
1360.aero-paywall-plan-card ul li {
1361  position: relative;
1362  padding-left: 22px;
1363  font-size: 13px;
1364  color: #4b5563;
1365}
1366.aero-paywall-plan-card ul li::before {
1367  content: "\u2713";
1368  position: absolute;
1369  left: 0;
1370  color: var(--aero-accent, ${v});
1371  font-weight: 700;
1372}
1373.aero-paywall-plan-card button[type="button"] {
1374  margin-top: 6px;
1375  padding: 10px 16px;
1376  border: none;
1377  border-radius: 8px;
1378  color: #fff;
1379  font-size: 14px;
1380  font-weight: 600;
1381  cursor: pointer;
1382  width: 100%;
1383  transition: opacity 0.15s ease;
1384}
1385.aero-paywall-plan-card button[type="button"]:hover {
1386  opacity: 0.92;
1387}
1388.aero-paywall-plan-card button[type="button"]:disabled {
1389  background: #e5e7eb !important;
1390  color: #9ca3af;
1391  cursor: default;
1392  opacity: 1;
1393}
1394
1395/* Subscription history table */
1396.aero-paywall-history-table-wrap {
1397  border: 1px solid #e5e7eb;
1398  border-radius: 12px;
1399  overflow: hidden;
1400}
1401.aero-paywall-history-table {
1402  width: 100%;
1403  border-collapse: collapse;
1404  font-size: 13px;
1405}
1406.aero-paywall-history-table th,
1407.aero-paywall-history-table td {
1408  padding: 10px 12px;
1409  text-align: left;
1410  border-bottom: 1px solid #e5e7eb;
1411}
1412.aero-paywall-history-table thead {
1413  background: #f9fafb;
1414}
1415.aero-paywall-history-table th {
1416  font-weight: 600;
1417  color: #6b7280;
1418  font-size: 12px;
1419  text-transform: uppercase;
1420  letter-spacing: 0.02em;
1421}
1422.aero-paywall-history-table td {
1423  color: #111827;
1424}
1425.aero-paywall-history-table tbody tr:last-child td {
1426  border-bottom: none;
1427}
1428.aero-paywall-history-table tbody tr:nth-child(even) {
1429  background: #fafafa;
1430}
1431.aero-paywall-status-badge {
1432  display: inline-block;
1433  padding: 2px 9px;
1434  border-radius: 999px;
1435  font-size: 11px;
1436  font-weight: 600;
1437  text-transform: capitalize;
1438  background: #f3f4f6;
1439  color: #374151;
1440}
1441.aero-paywall-status-badge[data-status="active"] {
1442  background: #dcfce7;
1443  color: #15803d;
1444}
1445.aero-paywall-status-badge[data-status="expired"],
1446.aero-paywall-status-badge[data-status="cancelled"] {
1447  background: #fee2e2;
1448  color: #b91c1c;
1449}
1450.aero-paywall-status-badge[data-status="pending"] {
1451  background: #fef3c7;
1452  color: #b45309;
1453}
1454
1455/* Bookmarks / Reading History tabs (my-account.ts's renderBookmarksTab()/
1456   renderReadingHistoryTab()) */
1457.aero-paywall-saved-list {
1458  list-style: none;
1459  margin: 0;
1460  padding: 0;
1461  display: flex;
1462  flex-direction: column;
1463  gap: 4px;
1464}
1465.aero-paywall-saved-list li {
1466  display: flex;
1467  align-items: center;
1468  gap: 12px;
1469  padding: 10px 4px;
1470  border-bottom: 1px solid #e5e7eb;
1471}
1472.aero-paywall-saved-list li:last-child {
1473  border-bottom: none;
1474}
1475.aero-paywall-saved-list-media {
1476  flex-shrink: 0;
1477  width: 56px;
1478  height: 56px;
1479  border-radius: 8px;
1480  overflow: hidden;
1481  display: block;
1482}
1483.aero-paywall-saved-list-media img {
1484  width: 100%;
1485  height: 100%;
1486  object-fit: cover;
1487  display: block;
1488}
1489.aero-paywall-saved-list-body {
1490  flex: 1;
1491  min-width: 0;
1492  display: flex;
1493  flex-direction: column;
1494  gap: 2px;
1495}
1496.aero-paywall-saved-list-body a {
1497  font-size: 14px;
1498  font-weight: 600;
1499  color: #111827;
1500  text-decoration: none;
1501}
1502.aero-paywall-saved-list-body a:hover {
1503  text-decoration: underline;
1504}
1505.aero-paywall-saved-list-body span {
1506  font-size: 12px;
1507  color: #6b7280;
1508}
1509.aero-paywall-saved-list-remove {
1510  flex-shrink: 0;
1511  width: 28px;
1512  height: 28px;
1513  border: none;
1514  border-radius: 50%;
1515  background: none;
1516  color: #9ca3af;
1517  font-size: 18px;
1518  line-height: 1;
1519  cursor: pointer;
1520}
1521.aero-paywall-saved-list-remove:hover {
1522  background: #fee2e2;
1523  color: #b91c1c;
1524}
1525
1526/* My Comments tab (my-account.ts's renderCommentsTab()) \u2014 reuses
1527   .aero-paywall-saved-list for both its "replies to you" and "your
1528   comments" lists, plus a small amount of its own on top. */
1529.aero-paywall-comment-notifications {
1530  margin-bottom: 24px;
1531  padding-bottom: 20px;
1532  border-bottom: 1px solid #e5e7eb;
1533}
1534.aero-paywall-comment-notification--unread {
1535  background: color-mix(in srgb, var(--aero-accent, ${v}) 5%, white);
1536  border-radius: 8px;
1537}
1538.aero-paywall-comment-notification--unread .aero-paywall-saved-list-body a {
1539  font-weight: 700;
1540}
1541
1542/* Bookmark toggle (bookmark-button.ts), mounted on the article page */
1543.aero-paywall-bookmark-button {
1544  display: inline-flex;
1545  align-items: center;
1546  gap: 6px;
1547  padding: 8px 14px;
1548  border: 1px solid #d1d5db;
1549  border-radius: 999px;
1550  background: #fff;
1551  color: #374151;
1552  font-size: 13px;
1553  font-weight: 600;
1554  cursor: pointer;
1555  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
1556}
1557.aero-paywall-bookmark-button:hover {
1558  border-color: var(--aero-accent, ${v});
1559  color: var(--aero-accent, ${v});
1560}
1561.aero-paywall-bookmark-button.is-saved {
1562  background: var(--aero-accent, ${v});
1563  border-color: var(--aero-accent, ${v});
1564  color: #fff;
1565}
1566.aero-paywall-bookmark-status {
1567  display: block;
1568  margin-top: 6px;
1569  font-size: 12px;
1570  color: #b91c1c;
1571}
1572
1573/* Follow toggle (follows.ts), mounted on category/tag archive pages */
1574.aero-paywall-follow-button {
1575  display: inline-flex;
1576  align-items: center;
1577  gap: 6px;
1578  padding: 8px 14px;
1579  border: 1px solid #d1d5db;
1580  border-radius: 999px;
1581  background: #fff;
1582  color: #374151;
1583  font-size: 13px;
1584  font-weight: 600;
1585  text-decoration: none;
1586  cursor: pointer;
1587  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
1588}
1589.aero-paywall-follow-button:hover {
1590  border-color: var(--aero-accent, ${v});
1591  color: var(--aero-accent, ${v});
1592}
1593.aero-paywall-follow-button.is-following {
1594  background: var(--aero-accent, ${v});
1595  border-color: var(--aero-accent, ${v});
1596  color: #fff;
1597}
1598.aero-paywall-follow-button:disabled {
1599  opacity: 0.6;
1600  cursor: default;
1601}
1602.aero-paywall-follow-status {
1603  display: block;
1604  margin-top: 6px;
1605  font-size: 12px;
1606  color: #b91c1c;
1607}
1608
1609/* Comment thread (comments.ts), mounted at the foot of an article */
1610.aero-paywall-comments {
1611  margin-top: 32px;
1612  padding-top: 24px;
1613  border-top: 1px solid #e5e7eb;
1614}
1615.aero-paywall-comments-title {
1616  margin: 0 0 16px;
1617  font-size: 18px;
1618  font-weight: 700;
1619}
1620.aero-paywall-comments-signin {
1621  margin: 0 0 20px;
1622  font-size: 14px;
1623  color: #4b5563;
1624}
1625.aero-paywall-comments-signin a {
1626  color: var(--aero-accent, ${v});
1627  font-weight: 600;
1628  text-decoration: none;
1629}
1630.aero-paywall-comments-empty {
1631  margin: 0 0 16px;
1632  font-size: 14px;
1633  color: #6b7280;
1634}
1635.aero-paywall-comments-error {
1636  margin: 8px 0;
1637  font-size: 13px;
1638  color: #b91c1c;
1639}
1640.aero-paywall-comments-list,
1641.aero-paywall-comment-replies {
1642  list-style: none;
1643  margin: 0;
1644  padding: 0;
1645}
1646.aero-paywall-comment {
1647  padding: 16px 0;
1648  border-bottom: 1px solid #f0f1f2;
1649}
1650.aero-paywall-comment-replies .aero-paywall-comment {
1651  padding-left: 20px;
1652  border-left: 2px solid #f0f1f2;
1653  border-bottom: none;
1654  margin-top: 12px;
1655}
1656.aero-paywall-comment-meta {
1657  display: flex;
1658  align-items: baseline;
1659  gap: 8px;
1660  margin-bottom: 4px;
1661}
1662.aero-paywall-comment-author {
1663  font-weight: 700;
1664  font-size: 13px;
1665}
1666.aero-paywall-comment-date {
1667  font-size: 12px;
1668  color: #9ca3af;
1669}
1670.aero-paywall-comment-body {
1671  margin: 0 0 8px;
1672  font-size: 14px;
1673  line-height: 1.55;
1674  color: #1f2937;
1675  white-space: pre-wrap;
1676}
1677.aero-paywall-comment-actions {
1678  display: flex;
1679  gap: 12px;
1680}
1681.aero-paywall-comment-reply-toggle,
1682.aero-paywall-comment-delete {
1683  border: none;
1684  background: none;
1685  padding: 0;
1686  font-size: 12px;
1687  font-weight: 600;
1688  color: #6b7280;
1689  cursor: pointer;
1690}
1691.aero-paywall-comment-reply-toggle:hover,
1692.aero-paywall-comment-delete:hover {
1693  color: var(--aero-accent, ${v});
1694}
1695.aero-paywall-comment-delete:hover {
1696  color: #b91c1c;
1697}
1698.aero-paywall-comment-form {
1699  margin: 10px 0 16px;
1700}
1701.aero-paywall-comment-form textarea {
1702  width: 100%;
1703  box-sizing: border-box;
1704  resize: vertical;
1705  padding: 10px 12px;
1706  border: 1px solid #d1d5db;
1707  border-radius: 8px;
1708  font: inherit;
1709  font-size: 14px;
1710}
1711.aero-paywall-comment-form-row {
1712  display: flex;
1713  justify-content: flex-end;
1714  margin-top: 8px;
1715}
1716.aero-paywall-comment-form button[type='submit'] {
1717  border: none;
1718  border-radius: 999px;
1719  padding: 8px 18px;
1720  background: var(--aero-accent, ${v});
1721  color: #fff;
1722  font-size: 13px;
1723  font-weight: 600;
1724  cursor: pointer;
1725}
1726.aero-paywall-comment-form button[type='submit']:disabled {
1727  opacity: 0.6;
1728  cursor: default;
1729}
1730.aero-paywall-comment-form-error {
1731  margin: 6px 0 0;
1732  font-size: 12px;
1733  color: #b91c1c;
1734}
1735.aero-paywall-comments-more {
1736  display: block;
1737  margin: 8px auto 0;
1738  border: 1px solid #d1d5db;
1739  border-radius: 999px;
1740  padding: 8px 20px;
1741  background: #fff;
1742  font-size: 13px;
1743  font-weight: 600;
1744  color: #374151;
1745  cursor: pointer;
1746}
1747.aero-paywall-comments-more:hover {
1748  border-color: var(--aero-accent, ${v});
1749  color: var(--aero-accent, ${v});
1750}
1751
1752/* My Profile \u2014 read-only block (email/name/phone/member since/plan/org)
1753   side by side with the editable Last name/Phone/Company form, so the
1754   whole profile and the form to change it are both visible at once.
1755   Collapses to a single column (read-only on top) under ~720px, same
1756   breakpoint convention as .aero-paywall-panel-layout above. */
1757.aero-paywall-profile-split {
1758  display: grid;
1759  grid-template-columns: 1fr 1fr;
1760  gap: 32px;
1761  align-items: start;
1762}
1763@media (max-width: 720px) {
1764  .aero-paywall-profile-split {
1765    grid-template-columns: 1fr;
1766  }
1767}
1768.aero-paywall-profile-readonly h3,
1769.aero-paywall-profile-editable h3 {
1770  margin: 0 0 12px;
1771  font-size: 16px;
1772  font-weight: 700;
1773}
1774.aero-paywall-profile-readonly-list {
1775  display: grid;
1776  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
1777  gap: 14px 24px;
1778  margin: 0 0 8px;
1779}
1780.aero-paywall-profile-readonly-list > div {
1781  display: flex;
1782  flex-direction: column;
1783  gap: 2px;
1784}
1785.aero-paywall-profile-readonly-list dt {
1786  font-size: 12px;
1787  font-weight: 600;
1788  color: #9ca3af;
1789  text-transform: uppercase;
1790  letter-spacing: 0.03em;
1791}
1792.aero-paywall-profile-readonly-list dd {
1793  margin: 0;
1794  font-size: 14px;
1795  color: #111827;
1796}
1797.aero-paywall-profile-readonly-note {
1798  margin: 0;
1799  font-size: 12px;
1800  color: #9ca3af;
1801}
1802.aero-paywall-verify-email-row {
1803  display: flex;
1804  align-items: center;
1805  flex-wrap: wrap;
1806  gap: 8px;
1807}
1808.aero-paywall-verify-email-btn {
1809  padding: 4px 10px;
1810  border: 1px solid var(--aero-accent, #1a73e8);
1811  border-radius: 6px;
1812  background: none;
1813  color: var(--aero-accent, #1a73e8);
1814  font-size: 12px;
1815  font-weight: 600;
1816  cursor: pointer;
1817}
1818.aero-paywall-verify-email-btn:hover {
1819  background: var(--aero-accent-soft, rgba(26, 115, 232, 0.08));
1820}
1821.aero-paywall-verify-email-btn:disabled {
1822  opacity: 0.6;
1823  cursor: not-allowed;
1824}
1825.aero-paywall-verify-email-status {
1826  flex-basis: 100%;
1827  font-size: 12px;
1828  color: #6b7280;
1829}
1830.aero-paywall-profile-editable {
1831  padding-left: 32px;
1832  border-left: 1px solid #e5e7eb;
1833}
1834@media (max-width: 720px) {
1835  .aero-paywall-profile-editable {
1836    padding-left: 0;
1837    padding-top: 32px;
1838    margin-top: 32px;
1839    border-left: none;
1840    border-top: 1px solid #e5e7eb;
1841  }
1842}
1843
1844/* Change Password / Personalization / Email Alerts tabs each set their
1845   own <h3> directly on the panel (no wrapping section div needed \u2014
1846   unlike Edit Profile, they're single-purpose tabs). */
1847.aero-paywall-account-panel > h3 {
1848  margin: 0 0 16px;
1849  font-size: 16px;
1850  font-weight: 700;
1851}
1852.aero-paywall-email-alerts-newsletters {
1853  margin-top: 28px;
1854  padding-top: 28px;
1855  border-top: 1px solid var(--color-border, #e5e7eb);
1856}
1857.aero-paywall-email-alerts-newsletters h4 {
1858  margin: 0 0 6px;
1859  font-size: 14px;
1860  font-weight: 700;
1861}
1862.aero-paywall-email-alerts-newsletters p {
1863  margin: 0 0 10px;
1864  font-size: 13px;
1865  color: #6b7280;
1866}
1867.aero-paywall-email-alerts-link {
1868  font-size: 13px;
1869  font-weight: 600;
1870  color: var(--aero-accent, ${v});
1871  text-decoration: none;
1872}
1873.aero-paywall-email-alerts-link:hover {
1874  text-decoration: underline;
1875}
1876
1877/* Flyout \u2014 Saved Articles / Read History / My News (nav-menu.ts's
1878   bindSignedInPanel) plus the Go to My Account link, each a full-width
1879   flat card stacked on top of each other. The three drill-in ones open
1880   a dedicated full-scroll screen with a back button (data-aero-nav-
1881   detail below) rather than expanding in place. */
1882.aero-paywall-nav-card {
1883  display: flex;
1884  align-items: center;
1885  justify-content: space-between;
1886  width: 100%;
1887  border: 1px solid #e5e7eb;
1888  border-radius: 10px;
1889  margin-bottom: 10px;
1890  padding: 14px 16px;
1891  background: none;
1892  color: #111827;
1893  font: inherit;
1894  font-size: 14px;
1895  font-weight: 700;
1896  text-align: left;
1897  text-decoration: none;
1898  cursor: pointer;
1899}
1900.aero-paywall-nav-card:hover {
1901  background: #f9fafb;
1902}
1903.aero-paywall-nav-card-chevron {
1904  flex-shrink: 0;
1905  color: #9ca3af;
1906}
1907/* The plain "Go to My Account" link is one of these same cards but
1908   never drills in, so it has no chevron of its own \u2014 no extra rule
1909   needed, .aero-paywall-nav-card--link only exists as a marker class. */
1910
1911/* The drill-in detail screen \u2014 a back row (chevron + section title)
1912   above whichever list is currently showing. No max-height/internal
1913   scroll any more (reader-requested: "scroll all the way down to see
1914   more content") \u2014 this is its own full screen now, so it scrolls with
1915   the panel itself. */
1916.aero-paywall-nav-detail-back {
1917  display: flex;
1918  align-items: center;
1919  gap: 6px;
1920  margin-bottom: 16px;
1921  padding: 0;
1922  border: none;
1923  background: none;
1924  color: #111827;
1925  font: inherit;
1926  font-size: 15px;
1927  font-weight: 700;
1928  cursor: pointer;
1929}
1930.aero-paywall-nav-detail-back:hover {
1931  color: var(--aero-accent, ${v});
1932}
1933.aero-paywall-nav-detail-list {
1934  /* Intentionally no max-height/overflow here \u2014 see comment above. */
1935}
1936.aero-paywall-nav-summary-loading,
1937.aero-paywall-nav-summary-empty {
1938  font-size: 13px;
1939  color: #6b7280;
1940}
1941.aero-paywall-nav-summary-list {
1942  list-style: none;
1943  margin: 0;
1944  padding: 0;
1945}
1946.aero-paywall-nav-summary-list li {
1947  padding: 10px 0;
1948  border-bottom: 1px solid #f0f1f2;
1949  display: flex;
1950  flex-direction: column;
1951  gap: 2px;
1952}
1953.aero-paywall-nav-summary-list li:last-child {
1954  border-bottom: none;
1955}
1956.aero-paywall-nav-summary-list a {
1957  font-size: 13px;
1958  font-weight: 600;
1959  color: #111827;
1960  text-decoration: none;
1961}
1962.aero-paywall-nav-summary-list a:hover {
1963  color: var(--aero-accent, ${v});
1964}
1965.aero-paywall-nav-summary-list span {
1966  font-size: 11.5px;
1967  color: #9ca3af;
1968}
1969
1970/* My Comments tab: the reply-email toggle sits above the notifications/
1971   comments list, not inline with it. */
1972.aero-paywall-comments-email-toggle {
1973  margin-bottom: 24px;
1974  padding-bottom: 24px;
1975  border-bottom: 1px solid #e5e7eb;
1976}
1977
1978/* Notification preference toggle (notification-preferences.ts) */
1979.aero-paywall-notif-toggle {
1980  display: flex;
1981  align-items: center;
1982  gap: 12px;
1983  cursor: pointer;
1984}
1985.aero-paywall-notif-toggle-input {
1986  position: absolute;
1987  opacity: 0;
1988  width: 1px;
1989  height: 1px;
1990}
1991.aero-paywall-notif-toggle-track {
1992  flex: 0 0 auto;
1993  width: 40px;
1994  height: 24px;
1995  border-radius: 999px;
1996  background: #d1d5db;
1997  position: relative;
1998  transition: background-color 0.15s ease;
1999}
2000.aero-paywall-notif-toggle-thumb {
2001  position: absolute;
2002  top: 3px;
2003  left: 3px;
2004  width: 18px;
2005  height: 18px;
2006  border-radius: 50%;
2007  background: #fff;
2008  transition: transform 0.15s ease;
2009  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
2010}
2011.aero-paywall-notif-toggle-input:checked + .aero-paywall-notif-toggle-track {
2012  background: var(--aero-accent, ${v});
2013}
2014.aero-paywall-notif-toggle-input:checked + .aero-paywall-notif-toggle-track .aero-paywall-notif-toggle-thumb {
2015  transform: translateX(16px);
2016}
2017.aero-paywall-notif-toggle-input:focus-visible + .aero-paywall-notif-toggle-track {
2018  outline: 2px solid var(--aero-accent, ${v});
2019  outline-offset: 2px;
2020}
2021.aero-paywall-notif-toggle-label {
2022  font-size: 14px;
2023  color: #374151;
2024}
2025.aero-paywall-notif-status {
2026  margin: 10px 0 0;
2027  font-size: 12px;
2028  color: #6b7280;
2029}
2030
2031/* Interest picker (interest-picker.ts) \u2014 modal onboarding + Settings-tab section */
2032.aero-paywall-interest-modal-backdrop {
2033  position: fixed;
2034  inset: 0;
2035  background: rgba(17, 24, 39, 0.55);
2036  display: flex;
2037  align-items: center;
2038  justify-content: center;
2039  z-index: 100010;
2040  padding: 20px;
2041}
2042.aero-paywall-interest-modal {
2043  position: relative;
2044  background: #fff;
2045  border-radius: 16px;
2046  padding: 32px;
2047  max-width: 480px;
2048  width: 100%;
2049  max-height: 85vh;
2050  overflow-y: auto;
2051}
2052.aero-paywall-interest-modal h2 {
2053  margin: 0 0 16px;
2054  font-size: 20px;
2055  font-weight: 700;
2056}
2057.aero-paywall-interest-modal .aero-paywall-interest-modal-newsletters-heading {
2058  margin-top: 28px;
2059  padding-top: 20px;
2060  border-top: 1px solid #e5e7eb;
2061}
2062.aero-paywall-interest-modal-skip {
2063  position: absolute;
2064  top: 20px;
2065  right: 24px;
2066  border: none;
2067  background: none;
2068  font-size: 13px;
2069  font-weight: 600;
2070  color: #6b7280;
2071  cursor: pointer;
2072}
2073.aero-paywall-interest-modal-skip:hover {
2074  color: #374151;
2075}
2076.aero-paywall-interest-hint {
2077  margin: 0 0 16px;
2078  font-size: 14px;
2079  color: #4b5563;
2080}
2081.aero-paywall-interest-loading {
2082  font-size: 14px;
2083  color: #6b7280;
2084}
2085.aero-paywall-interest-grid {
2086  display: flex;
2087  flex-wrap: wrap;
2088  gap: 8px;
2089}
2090/* A chip may hold two independent labels (the topic itself, and \u2014 only
2091   for admin-curated alert-eligible categories \u2014 the instant-alerts
2092   sub-toggle) side by side, so the invisible-input-covers-its-label trick
2093   below is scoped to each label individually, not the whole chip \u2014 two
2094   inputs both trying to cover the *chip's* full box would overlap and
2095   fight each other for clicks. */
2096.aero-paywall-interest-chip {
2097  display: inline-flex;
2098  align-items: center;
2099  gap: 4px;
2100}
2101.aero-paywall-interest-topic-label,
2102.aero-paywall-interest-alert-label {
2103  position: relative;
2104  display: inline-flex;
2105}
2106.aero-paywall-interest-topic-label input,
2107.aero-paywall-interest-alert-label input {
2108  position: absolute;
2109  opacity: 0;
2110  width: 100%;
2111  height: 100%;
2112  margin: 0;
2113  cursor: pointer;
2114}
2115.aero-paywall-interest-topic-label span {
2116  display: inline-flex;
2117  align-items: center;
2118  padding: 7px 14px;
2119  border: 1px solid #d1d5db;
2120  border-radius: 999px;
2121  font-size: 13px;
2122  font-weight: 600;
2123  color: #374151;
2124  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
2125}
2126.aero-paywall-interest-topic-label input:checked + span {
2127  background: var(--aero-accent, ${v});
2128  border-color: var(--aero-accent, ${v});
2129  color: #fff;
2130}
2131.aero-paywall-interest-chip.is-disabled .aero-paywall-interest-topic-label span {
2132  opacity: 0.45;
2133}
2134.aero-paywall-interest-alert-label span {
2135  display: inline-flex;
2136  align-items: center;
2137  padding: 6px 10px;
2138  border: 1px solid #d1d5db;
2139  border-radius: 999px;
2140  font-size: 12px;
2141  font-weight: 600;
2142  color: #6b7280;
2143  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
2144}
2145.aero-paywall-interest-alert-label input:checked + span {
2146  background: #fef3c7;
2147  border-color: #f59e0b;
2148  color: #92400e;
2149}
2150.aero-paywall-interest-alert-label input:disabled + span {
2151  opacity: 0.35;
2152  cursor: not-allowed;
2153}
2154.aero-paywall-interest-count {
2155  margin: 12px 0 0;
2156  font-size: 12px;
2157  color: #9ca3af;
2158}
2159.aero-paywall-interest-save {
2160  margin-top: 16px;
2161  border: none;
2162  border-radius: 999px;
2163  padding: 10px 22px;
2164  background: var(--aero-accent, ${v});
2165  color: #fff;
2166  font-size: 14px;
2167  font-weight: 600;
2168  cursor: pointer;
2169}
2170.aero-paywall-interest-save:disabled {
2171  opacity: 0.6;
2172  cursor: default;
2173}
2174
2175/* Upgrade-to-corporate form reuses .aero-paywall-form's field styling but
2176   isn't itself a .aero-paywall-form (it lives inside an account panel, not
2177   a standalone card) \u2014 a lighter, unboxed variant. */
2178.aero-paywall-upgrade-form {
2179  display: flex;
2180  flex-direction: column;
2181  gap: 14px;
2182  max-width: 420px;
2183}
2184.aero-paywall-upgrade-form label {
2185  display: flex;
2186  flex-direction: column;
2187  gap: 6px;
2188  font-size: 13px;
2189  font-weight: 500;
2190  color: #374151;
2191}
2192.aero-paywall-upgrade-form input,
2193.aero-paywall-upgrade-form select {
2194  padding: 10px 12px;
2195  border: 1px solid #d1d5db;
2196  border-radius: 8px;
2197  font-size: 14px;
2198  font-family: inherit;
2199  transition: border-color 0.15s ease, box-shadow 0.15s ease;
2200}
2201.aero-paywall-upgrade-form input:focus,
2202.aero-paywall-upgrade-form select:focus {
2203  outline: none;
2204  border-color: var(--aero-accent, ${v});
2205  box-shadow: 0 0 0 3px var(--aero-accent-soft, rgba(26, 115, 232, 0.15));
2206}
2207.aero-paywall-upgrade-form button[type="submit"] {
2208  margin-top: 4px;
2209  padding: 11px 16px;
2210  border: none;
2211  border-radius: 8px;
2212  color: #fff;
2213  font-size: 14px;
2214  font-weight: 600;
2215  cursor: pointer;
2216  align-self: flex-start;
2217  transition: opacity 0.15s ease;
2218}
2219.aero-paywall-upgrade-form button[type="submit"]:hover {
2220  opacity: 0.92;
2221}
2222
2223/* Header nav button \u2014 a right-side flyout panel, the same design at
2224   every screen size (nav-menu.ts / AeroPaywall_Nav_Button's generic
2225   render; a theme's own custom adapter, e.g. BusinessDay's header.php,
2226   targets these same classes on its own trigger icon). */
2227.aero-paywall-nav {
2228  display: inline-flex;
2229  align-items: center;
2230  gap: 6px;
2231  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
2232}
2233/* The icon+name link straight to My Account (no longer the flyout's own
2234   trigger \u2014 see .aero-paywall-nav-trigger below for that). */
2235.aero-paywall-nav-account-link {
2236  display: inline-flex;
2237  align-items: center;
2238  gap: 6px;
2239  padding: 6px 10px;
2240  border-radius: 999px;
2241  color: inherit;
2242  text-decoration: none;
2243  transition: background-color 0.15s ease;
2244}
2245.aero-paywall-nav-account-link:hover {
2246  background: rgba(0, 0, 0, 0.06);
2247}
2248/* The hamburger \u2014 the only thing that still opens the flyout panel. */
2249.aero-paywall-nav-trigger {
2250  display: inline-flex;
2251  align-items: center;
2252  justify-content: center;
2253  width: 36px;
2254  height: 36px;
2255  padding: 0;
2256  border: none;
2257  border-radius: 999px;
2258  background: none;
2259  color: inherit;
2260  cursor: pointer;
2261  transition: background-color 0.15s ease;
2262}
2263.aero-paywall-nav-trigger:hover {
2264  background: rgba(0, 0, 0, 0.06);
2265}
2266
2267.aero-paywall-nav-backdrop {
2268  position: fixed;
2269  inset: 0;
2270  background: rgba(0, 0, 0, 0.4);
2271  opacity: 0;
2272  pointer-events: none;
2273  transition: opacity 0.25s ease;
2274  z-index: 100000;
2275}
2276.aero-paywall-nav-backdrop.aero-paywall-nav-backdrop--visible {
2277  opacity: 1;
2278  pointer-events: auto;
2279}
2280
2281.aero-paywall-nav-panel {
2282  position: fixed;
2283  top: 0;
2284  right: 0;
2285  bottom: 0;
2286  width: 380px;
2287  max-width: 100vw;
2288  display: flex;
2289  flex-direction: column;
2290  background: var(--color-bg-raised, #fff);
2291  color: var(--color-ink-1, #111827);
2292  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
2293  transform: translateX(100%);
2294  visibility: hidden;
2295  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
2296  z-index: 100001;
2297  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
2298  box-sizing: border-box;
2299  overflow-y: auto;
2300}
2301.aero-paywall-nav-panel * {
2302  box-sizing: border-box;
2303}
2304.aero-paywall-nav-panel.aero-paywall-nav-panel--open {
2305  transform: translateX(0);
2306  visibility: visible;
2307}
2308.aero-paywall-nav-panel-header {
2309  display: flex;
2310  align-items: center;
2311  justify-content: space-between;
2312  gap: 12px;
2313  padding: 18px 20px;
2314  border-bottom: 1px solid var(--color-border, #f0f0f0);
2315}
2316.aero-paywall-nav-panel-email {
2317  font-size: 13px;
2318  font-weight: 600;
2319  color: var(--color-ink-2, #374151);
2320  overflow: hidden;
2321  text-overflow: ellipsis;
2322  white-space: nowrap;
2323}
2324.aero-paywall-nav-close {
2325  display: inline-flex;
2326  align-items: center;
2327  justify-content: center;
2328  width: 30px;
2329  height: 30px;
2330  flex-shrink: 0;
2331  padding: 0;
2332  margin-left: auto;
2333  border: none;
2334  border-radius: 999px;
2335  background: none;
2336  color: var(--color-ink-2, #374151);
2337  cursor: pointer;
2338}
2339.aero-paywall-nav-close:hover {
2340  background: rgba(0, 0, 0, 0.06);
2341}
2342.aero-paywall-nav-panel-body {
2343  display: flex;
2344  flex-direction: column;
2345  align-items: stretch;
2346  gap: 10px;
2347  padding: 24px 20px;
2348}
2349.aero-paywall-nav-panel-headline {
2350  margin: 0;
2351  font-family: Georgia, "Times New Roman", Times, serif;
2352  font-size: 22px;
2353  font-weight: 700;
2354  color: var(--color-ink-1, #111827);
2355}
2356.aero-paywall-nav-panel-subcopy {
2357  margin: 0;
2358  font-size: 14px;
2359  color: var(--color-ink-3, #6b7280);
2360}
2361.aero-paywall-nav-panel-logout {
2362  align-self: flex-start;
2363  padding: 11px 4px 0;
2364  border: none;
2365  background: none;
2366  color: var(--color-ink-3, #6b7280);
2367  font: inherit;
2368  font-size: 14px;
2369  font-weight: 600;
2370  cursor: pointer;
2371  text-align: left;
2372}
2373.aero-paywall-nav-panel-logout:hover {
2374  color: var(--color-ink-1, #111827);
2375}
2376
2377/* Inline login/create-account/forgot-password (nav-menu.ts's
2378   bindInlineAuth()) \u2014 un-boxes the form to fit this panel, since
2379   .aero-paywall-form's own max-width/border/shadow assume a full page,
2380   not a 340px-ish panel. */
2381[data-aero-nav-auth-mount] {
2382  width: 100%;
2383}
2384[data-aero-nav-auth-mount] .aero-paywall-form {
2385  max-width: none;
2386  padding: 0;
2387  margin: 0;
2388  border: none;
2389  box-shadow: none;
2390}
2391[data-aero-nav-auth-mount] .aero-paywall-oauth-buttons {
2392  margin-bottom: 10px;
2393}
2394[data-aero-nav-auth-mount] .aero-paywall-prompt-divider,
2395.aero-paywall-account-signed-out .aero-paywall-prompt-divider {
2396  margin: 10px 0;
2397}
2398
2399.aero-paywall-nav-scroll-lock {
2400  overflow: hidden;
2401}
2402
2403/* Subscribe modal (subscribe-modal.ts) \u2014 a separate, wider overlay from
2404   the flyout panel; tiered plan cards need real width to sit side by
2405   side, which the 380px panel can't give them. Same open/close mechanics
2406   as the panel (a class toggle, never the hidden attribute, so the
2407   transition can actually animate) for consistency, not code sharing \u2014
2408   these are deliberately two independent, differently-shaped surfaces. */
2409.aero-paywall-modal-root {
2410  position: fixed;
2411  inset: 0;
2412  z-index: 100002;
2413  display: flex;
2414  align-items: center;
2415  justify-content: center;
2416  padding: 24px;
2417  visibility: hidden;
2418  pointer-events: none;
2419  box-sizing: border-box;
2420}
2421.aero-paywall-modal-root.aero-paywall-modal-root--open {
2422  visibility: visible;
2423  pointer-events: auto;
2424}
2425.aero-paywall-modal-backdrop {
2426  position: absolute;
2427  inset: 0;
2428  background: rgba(0, 0, 0, 0.5);
2429  opacity: 0;
2430  transition: opacity 0.25s ease;
2431}
2432.aero-paywall-modal-root--open .aero-paywall-modal-backdrop {
2433  opacity: 1;
2434}
2435.aero-paywall-modal {
2436  position: relative;
2437  width: 100%;
2438  max-width: 760px;
2439  max-height: 85vh;
2440  overflow-y: auto;
2441  padding: 32px;
2442  border-radius: 16px;
2443  background: var(--color-bg-raised, #fff);
2444  color: var(--color-ink-1, #111827);
2445  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
2446  transform: translateY(12px) scale(0.98);
2447  opacity: 0;
2448  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
2449  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
2450  box-sizing: border-box;
2451}
2452.aero-paywall-modal * {
2453  box-sizing: border-box;
2454}
2455.aero-paywall-modal-root--open .aero-paywall-modal {
2456  transform: translateY(0) scale(1);
2457  opacity: 1;
2458}
2459.aero-paywall-modal-close {
2460  position: absolute;
2461  top: 16px;
2462  right: 16px;
2463  display: inline-flex;
2464  align-items: center;
2465  justify-content: center;
2466  width: 32px;
2467  height: 32px;
2468  padding: 0;
2469  border: none;
2470  border-radius: 999px;
2471  background: none;
2472  color: var(--color-ink-2, #374151);
2473  cursor: pointer;
2474}
2475.aero-paywall-modal-close:hover {
2476  background: rgba(0, 0, 0, 0.06);
2477}
2478.aero-paywall-modal-loading {
2479  margin: 40px 0;
2480  text-align: center;
2481  color: #6b7280;
2482}
2483
2484@media (max-width: 640px) {
2485  .aero-paywall-modal-root {
2486    padding: 0;
2487  }
2488  .aero-paywall-modal {
2489    max-width: 100vw;
2490    max-height: 100vh;
2491    height: 100%;
2492    border-radius: 0;
2493  }
2494}
2495
2496/* Edition reader modal (edition-reader-modal.ts) \u2014 deliberately separate
2497   from .aero-paywall-modal above: a page-flip reader needs the full
2498   viewport (dark background, no padding/border-radius), not a centered
2499   card sized for a plan grid. */
2500.bday-edition-reader-modal {
2501  position: fixed;
2502  inset: 0;
2503  z-index: 100003;
2504  background: #1a1a1a;
2505  visibility: hidden;
2506  pointer-events: none;
2507  opacity: 0;
2508  transition: opacity 0.2s ease;
2509}
2510.bday-edition-reader-modal.bday-edition-reader-modal--open {
2511  visibility: visible;
2512  pointer-events: auto;
2513  opacity: 1;
2514}
2515.bday-edition-reader-modal__frame {
2516  width: 100%;
2517  height: 100%;
2518  border: none;
2519  display: block;
2520}
2521.bday-edition-reader-modal__close {
2522  position: absolute;
2523  top: 14px;
2524  right: 14px;
2525  z-index: 1;
2526  display: inline-flex;
2527  align-items: center;
2528  justify-content: center;
2529  width: 36px;
2530  height: 36px;
2531  padding: 0;
2532  border: none;
2533  border-radius: 999px;
2534  background: rgba(0, 0, 0, 0.5);
2535  color: #fff;
2536  font-size: 22px;
2537  line-height: 1;
2538  cursor: pointer;
2539}
2540.bday-edition-reader-modal__close:hover {
2541  background: rgba(0, 0, 0, 0.75);
2542}
2543
2544@media (max-width: 480px) {
2545  .aero-paywall-nav-panel {
2546    width: 100vw;
2547  }
2548}
2549
2550@media (max-width: 480px) {
2551  .aero-paywall-form {
2552    max-width: 100%;
2553    padding: 18px;
2554  }
2555  .aero-paywall-account-signed-out {
2556    max-width: 100%;
2557  }
2558  .aero-paywall-account-sidebar button {
2559    padding: 8px 10px;
2560    font-size: 13px;
2561  }
2562}
2563
2564/* Gated-article paywall (prompt-forms.ts, class-content-gate.php).
2565   Copy (headline/subcopy/CTA/offer badge) is admin-editable per stage
2566   (Paywall Copy tab); this only ever styles whatever text lands here.
2567
2568   Redesigned from the old fixed-white gradient-box overlay (reader-
2569   reported: it painted a literal white rectangle over the fade, which
2570   broke completely in dark/warm mode \u2014 a bright white box sitting mid-
2571   page on a black background). The fade is now a CSS mask on the preview
2572   text itself rather than a painted-on gradient: it reveals whatever's
2573   actually behind it, so there is no background color to keep in sync
2574   with the site's three themes ever again \u2014 it is correct by
2575   construction in light, warm, and dark mode alike. */
2576.aero-paywall-preview {
2577  position: relative;
2578  max-height: 320px;
2579  overflow: hidden;
2580  font: 17px/1.7 Georgia, "Times New Roman", Times, serif;
2581  color: var(--color-ink-1, #1a1a1a);
2582  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 96%);
2583  mask-image: linear-gradient(to bottom, #000 50%, transparent 96%);
2584}
2585.aero-paywall-locked {
2586  max-width: 460px;
2587  margin: 0 auto;
2588  padding: 28px 16px 36px;
2589  text-align: center;
2590  box-sizing: border-box;
2591  border-top: 1px solid var(--color-border, #e5e7eb);
2592}
2593/* funnel-ui.ts's applyRenderPlan() reuses this same element to hold the
2594   real article body once a reader is entitled (reveal: 'full') \u2014 the
2595   narrow, centered "subscribe" prompt-card treatment above is wrong for
2596   that case, so this class (added at the same moment) undoes it back to
2597   normal full-width, left-aligned body flow. */
2598.aero-paywall-locked.aero-paywall-revealed {
2599  max-width: none;
2600  margin: 0;
2601  padding: 0;
2602  text-align: left;
2603  border-top: none;
2604}
2605.aero-paywall-hard-wall {
2606  border-top: none;
2607  padding-top: 4px;
2608}
2609.aero-paywall-locked-placeholder {
2610  font-size: 15px;
2611  color: var(--color-ink-3, #6b7280);
2612}
2613.aero-paywall-prompt-card {
2614  display: flex;
2615  flex-direction: column;
2616  align-items: center;
2617  gap: 6px;
2618  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
2619}
2620/* A small accent-tinted badge above the copy \u2014 the one deliberate visual
2621   flourish, standing in for the "this is a paywall" cue the old solid
2622   white box used to carry structurally. Built from a single currentColor
2623   mask so it always matches whatever accent color the install is
2624   configured with, light/warm/dark alike. */
2625.aero-paywall-prompt-icon {
2626  width: 42px;
2627  height: 42px;
2628  margin-bottom: 8px;
2629  border-radius: 50%;
2630  background: var(--aero-accent-soft, rgba(26, 115, 232, 0.12));
2631  display: flex;
2632  align-items: center;
2633  justify-content: center;
2634  flex-shrink: 0;
2635}
2636.aero-paywall-prompt-icon::before {
2637  content: "";
2638  width: 18px;
2639  height: 18px;
2640  background-color: var(--aero-accent, ${v});
2641  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
2642  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E") center/contain no-repeat;
2643}
2644.aero-paywall-prompt-eyebrow {
2645  margin: 4px 0 0;
2646  font-size: 12px;
2647  font-weight: 700;
2648  letter-spacing: 0.06em;
2649  text-transform: uppercase;
2650  color: var(--aero-accent, ${v});
2651}
2652.aero-paywall-prompt-headline {
2653  margin: 0;
2654  font-family: var(--font-headline, Georgia, "Times New Roman", Times, serif);
2655  font-size: 27px;
2656  font-weight: 700;
2657  line-height: 1.25;
2658  color: var(--color-ink-1, #111827);
2659}
2660.aero-paywall-prompt-subcopy {
2661  margin: 0 0 4px;
2662  max-width: 380px;
2663  font-size: 15px;
2664  line-height: 1.5;
2665  color: var(--color-ink-2, #4b5563);
2666}
2667.aero-paywall-prompt-card-body {
2668  width: 100%;
2669  max-width: 400px;
2670  display: flex;
2671  flex-direction: column;
2672  align-items: stretch;
2673  gap: 10px;
2674  margin-top: 10px;
2675}
2676/* The wrapped form's own title would just repeat the card's headline
2677   above it \u2014 this file's the single place that decides which text wins. */
2678.aero-paywall-prompt-card-body .aero-paywall-form-title {
2679  display: none;
2680}
2681.aero-paywall-prompt-card-body .aero-paywall-form {
2682  margin: 0;
2683  max-width: none;
2684  padding: 0;
2685  background: none;
2686  border: none;
2687  box-shadow: none;
2688  /* .aero-paywall-locked's text-align: center (centers the headline/
2689     subcopy/CTA above) was also inherited into each field's label text \u2014
2690     labels read left-aligned above their input in every other form this
2691     SDK renders, so reset it here rather than centering "Email"/
2692     "Password" over the input like a caption. */
2693  text-align: left;
2694}
2695.aero-paywall-prompt-card-body .aero-paywall-auth-toggle-link {
2696  align-self: center;
2697  text-align: center;
2698}
2699.aero-paywall-prompt-cta {
2700  display: block;
2701  padding: 14px 22px;
2702  border-radius: 999px;
2703  background: var(--aero-accent, ${v});
2704  /* !important: this is an <a> tag, and a theme's own link-color rule
2705     (e.g. brand red on an anchor, matching this button's own accent
2706     background) can otherwise win on specificity and render near-
2707     invisible same-color text on the button \u2014 see the identical
2708     precedent on .aero-paywall-account-sidebar-logout above. */
2709  color: #fff !important;
2710  font-size: 15px;
2711  font-weight: 700;
2712  text-align: center;
2713  text-decoration: none;
2714  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 10px 24px -8px var(--aero-accent-soft, rgba(26, 115, 232, 0.4));
2715  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
2716}
2717.aero-paywall-prompt-cta:hover {
2718  opacity: 0.94;
2719  transform: translateY(-1px);
2720  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), 0 14px 28px -8px var(--aero-accent-soft, rgba(26, 115, 232, 0.5));
2721}
2722.aero-paywall-prompt-cta:active {
2723  transform: translateY(0);
2724}
2725.aero-paywall-prompt-divider {
2726  display: flex;
2727  align-items: center;
2728  gap: 12px;
2729  margin: 2px 0;
2730  color: var(--color-ink-3, #9ca3af);
2731  font-size: 12px;
2732  font-weight: 600;
2733  text-transform: uppercase;
2734  letter-spacing: 0.04em;
2735}
2736.aero-paywall-prompt-divider::before,
2737.aero-paywall-prompt-divider::after {
2738  content: "";
2739  flex: 1;
2740  height: 1px;
2741  background: var(--color-border, #e5e7eb);
2742}
2743
2744@media (max-width: 480px) {
2745  .aero-paywall-prompt-headline {
2746    font-size: 22px;
2747  }
2748  .aero-paywall-preview {
2749    max-height: 240px;
2750  }
2751  .aero-paywall-locked {
2752    padding: 22px 12px 28px;
2753  }
2754}
2755
2756/* Phase 12 \u2014 reader settings center (reader-settings.ts) */
2757.aero-reader-settings__section {
2758  margin-bottom: 24px;
2759}
2760.aero-reader-settings__follows {
2761  list-style: none;
2762  margin: 8px 0 0;
2763  padding: 0;
2764}
2765.aero-reader-settings__follows li {
2766  display: flex;
2767  align-items: center;
2768  justify-content: space-between;
2769  padding: 8px 0;
2770  border-bottom: 1px solid #e5e7eb;
2771  font-size: 13px;
2772}
2773.aero-reader-settings__toggle {
2774  display: flex;
2775  align-items: flex-start;
2776  gap: 8px;
2777  font-size: 13px;
2778  color: #374151;
2779  cursor: pointer;
2780}
2781.aero-reader-settings__toggle input {
2782  margin-top: 2px;
2783}
2784
2785/* Corporate Subscriptions lead-capture form \u2014 reuses .aero-paywall-form's field/button/error
2786   styling (see corporate-subscription.ts). The subscription-type picker borrows the same
2787   selectable-card language as .aero-paywall-plan-card (border, radius, accent highlight on
2788   selection) so it reads as one design system instead of a one-off pair of bare radios.
2789   Bug fix: .aero-paywall-form input has a blanket width:100% rule (correct for text/select
2790   fields) that a plain radio input here inherited too \u2014 with the row's flex-shrink:0 also
2791   set, the radio's box stretched to the full row width and the label text overflowed the
2792   card. Every radio/checkbox override below now explicitly sets width:auto instead. */
2793.aero-corporate-form__type {
2794  display: flex;
2795  flex-direction: column;
2796  gap: 10px;
2797  margin-bottom: 22px;
2798}
2799.aero-corporate-form__type-label {
2800  font-weight: 700;
2801  font-size: 13px;
2802  color: var(--color-ink-1, #111827);
2803  margin-bottom: 2px;
2804}
2805.aero-corporate-form__type label {
2806  position: relative;
2807  flex-direction: row !important;
2808  align-items: flex-start;
2809  gap: 10px;
2810  margin-bottom: 0;
2811  padding: 14px 16px;
2812  border: 1px solid var(--color-border, #d1d5db);
2813  border-radius: 10px;
2814  line-height: 1.5;
2815  cursor: pointer;
2816  transition: border-color 0.15s ease, background-color 0.15s ease;
2817}
2818.aero-corporate-form__type label:hover {
2819  border-color: var(--aero-accent, ${v});
2820}
2821.aero-corporate-form__type label:has(input:checked) {
2822  border-color: var(--aero-accent, ${v});
2823  background: color-mix(in srgb, var(--aero-accent, ${v}) 6%, #fff);
2824}
2825.aero-corporate-form__type input[type='radio'] {
2826  flex-shrink: 0;
2827  width: auto !important;
2828  margin: 3px 0 0;
2829  accent-color: var(--aero-accent, ${v});
2830}
2831.aero-corporate-form__type-price {
2832  display: block;
2833  font-size: 12px;
2834  font-weight: 400;
2835  color: var(--color-ink-3, #6b7280);
2836  margin-top: 2px;
2837}
2838.aero-corporate-form__badge {
2839  display: inline-block;
2840  background: var(--aero-accent, ${v});
2841  color: #fff;
2842  font-size: 10.5px;
2843  font-weight: 700;
2844  letter-spacing: 0.03em;
2845  text-transform: uppercase;
2846  padding: 2px 8px;
2847  border-radius: 999px;
2848  margin-left: 8px;
2849  vertical-align: 1px;
2850}
2851.aero-corporate-form__hint {
2852  font-size: 13px;
2853  color: var(--color-ink-3, #6b7280);
2854  margin: -8px 0 4px;
2855}
2856.aero-corporate-form__grid {
2857  display: grid;
2858  grid-template-columns: 1fr 1fr;
2859  gap: 14px 16px;
2860}
2861@media (max-width: 560px) {
2862  .aero-corporate-form__grid {
2863    grid-template-columns: 1fr;
2864  }
2865}
2866.aero-corporate-form__consent {
2867  flex-direction: row !important;
2868  align-items: flex-start !important;
2869  gap: 8px !important;
2870  font-size: 12px;
2871  font-weight: 400;
2872  color: var(--color-ink-3, #6b7280);
2873  margin-top: 4px;
2874}
2875.aero-corporate-form__consent input {
2876  width: auto !important;
2877  margin-top: 2px;
2878  accent-color: var(--aero-accent, ${v});
2879}
2880.aero-corporate-form__success {
2881  font-size: 15px;
2882  font-weight: 600;
2883  text-align: center;
2884  padding: 24px 0;
2885  font-family: Georgia, "Times New Roman", Times, serif;
2886}
2887`;function ha(e=v){if(typeof document>"u"||document.getElementById(Xr))return;let t=document.createElement("style");t.id=Xr,t.textContent=`:root{--aero-accent:${e};}
2888${Pi}`,document.head.appendChild(t)}function ot(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ba(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;
2888if(typeof a=="string")return a}return t}async function wa(e,t,a){let r=await fetch(`${e}${t}`,{headers:{Authorization:`Bearer ${a}`}}),o=await r.json().catch(()=>null);if(!r.ok||o?.data===void 0)throw new Error(ba(o,"Failed to load settings"));return o.data}async function Ai(e,t,a,r){let o=await fetch(`${e}${t}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(r)}),n=await o.json().catch(()=>null);if(!o.ok||n?.data===void 0)throw new Error(ba(n,"Request failed"));return n.data}async function Mi(e,t,a){let r=await fetch(`${e}${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}});if(!r.ok){let o=await r.json().catch(()=>null);throw new Error(ba(o,"Request failed"))}}async function nt(e,t,a="#1a73e8"){let r=M();if(!r){e.innerHTML='<p class="aero-paywall-account-current-note">Log in to manage your notification and follow settings.</p>';return}e.innerHTML='<p class="aero-paywall-account-current-note">Loading your settings\u2026</p>';try{let[o,n,i]=await Promise.all([wa(t,"/me/follows",r),wa(t,"/me/notification-preferences",r),wa(t,"/me/archive-window",r)]);$i(e,t,r,a,o,n,i)}catch(o){e.innerHTML=`<p class="aero-paywall-form-error">${ot(o instanceof Error?o.message:"Failed to load settings")}</p>`}}function $i(e,t,a,r,o,n,i){let s=typeof window<"u"&&!!window.aeroPaywallContext?.followEnabled;e.innerHTML=`
2889    ${s?`<section class="aero-reader-settings__section">
2890      <h2 class="aero-paywall-form-title">Followed topics</h2>
2891      ${o.length===0?'<p class="aero-paywall-account-current-note">You aren\u2019t following any categories or tags yet.</p>':`<ul class="aero-reader-settings__follows">
2892              ${o.map(p=>`
2893                <li data-follow-id="${p.id}" data-taxonomy="${ot(p.taxonomy)}" data-term-id="${ot(p.termId)}">
2894                  <span>${ot(p.termLabel)}</span>
2895                  <button type="button" class="aero-paywall-cancel-subscription-link" data-reader-settings-action="unfollow">Unfollow</button>
2896                </li>`).join("")}
2897            </ul>`}
2898    </section>`:""}
2899
2900    <section class="aero-reader-settings__section">
2901      <h2 class="aero-paywall-form-title">Notifications</h2>
2902      <label class="aero-reader-settings__toggle">
2903        <input type="checkbox" data-reader-settings-notify-toggle ${n.briefEnabled?"checked":""} />
2904        Email me a digest of new stories from my follows (up to four times a day)
2905      </label>
2906    </section>
2907
2908    ${i.archiveAccessUnlimited?`<section class="aero-reader-settings__section">
2909            <h2 class="aero-paywall-form-title">Archive access</h2>
2910            <p class="aero-paywall-account-current-note">Your plan includes unlimited e-paper and gallery archive access \u2014 every past edition, however old.</p>
2911          </section>`:i.archiveAccessDays!==null?`<section class="aero-reader-settings__section">
2912            <h2 class="aero-paywall-form-title">Archive access</h2>
2913            <p class="aero-paywall-account-current-note">Your plan includes ${i.archiveAccessDays} days of e-paper and gallery archive access, rolling from today.</p>
2914          </section>`:""}
2915
2916    <p class="aero-paywall-form-error" role="alert" hidden></p>
2917  `;let l=e.querySelector(".aero-paywall-form-error"),c=p=>{l&&(l.textContent=p instanceof Error?p.message:"Action failed",l.hidden=!1)};e.querySelectorAll('[data-reader-settings-action="unfollow"]').forEach(p=>{p.addEventListener("click",()=>{let f=p.closest("[data-follow-id]"),{taxonomy:m,termId:g}=f.dataset;Mi(t,`/me/follows/${m}/${g}`,a).then(()=>nt(e,t,r)).catch(c)})});let d=e.querySelector("[data-reader-settings-notify-toggle]");d?.addEventListener("change",()=>{Ai(t,"/me/notification-preferences",a,{briefEnabled:d.checked}).catch(p=>{d.checked=!d.checked,c(p)})})}var va="bday-edition-reader-modal",xa="bday-edition-reader-modal--open";function Ea(e){if(typeof document>"u")return;let t=Hi(),a=t.querySelector("[data-bd-edition-reader-frame]");a.src=e,t.classList.add(xa),document.body.classList.add("aero-paywall-nav-scroll-lock")}function Zr(){let e=document.getElementById(va);if(!e)return;e.classList.remove(xa),document.body.classList.remove("aero-paywall-nav-scroll-lock");let t=e.querySelector("[data-bd-edition-reader-frame]");t&&(t.src="about:blank")}function Hi(){let e=document.getElementById(va);if(e)return e;let t=document.createElement("div");return t.id=va,t.className="bday-edition-reader-modal",t.innerHTML=`
2918    <button type="button" class="bday-edition-reader-modal__close" data-bd-edition-reader-close aria-label="Close reader">&times;</button>
2919    <iframe class="bday-edition-reader-modal__frame" data-bd-edition-reader-frame title="Edition reader" allowfullscreen></iframe>
2920  `,document.body.appendChild(t),t.querySelector("[data-bd-edition-reader-close]")?.addEventListener("click",Zr),document.addEventListener("keydown",a=>
2920{a.key==="Escape"&&t.classList.contains(xa)&&Zr()}),t}function Qr(){typeof document>"u"||document.querySelectorAll("[data-bd-edition-open]").forEach(e=>{e.addEventListener("click",t=>{t.preventDefault(),Ea(e.href)})})}var Ri="Unable to open this edition.";function _i(e){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let t=e.message.message;if(typeof t=="string")return t}return Ri}function ka(e,t){typeof document>"u"||document.querySelectorAll("[data-bd-edition-download]").forEach(a=>{a.addEventListener("click",r=>{r.preventDefault(),Ni(a,e,t)})})}function eo(e,t){let a=new URL(e,window.location.href);return a.searchParams.set("tab",t),a.searchParams.set("return_to",window.location.href),a.toString()}function to(e,t,a,r){if(!e)return;e.textContent="";let o=document.createElement("span");o.className="bday-edition-status-message",o.textContent=t,e.appendChild(o);let n=document.createElement("a");n.href=a,n.textContent=r,n.className="bday-btn-link bday-edition-status-link",e.appendChild(n)}async function Ni(e,t,a){let r=e.dataset.bdEditionPublication,o=e.dataset.bdEditionDate;if(!r||!o)return;let n=document.querySelector("[data-bd-edition-status]"),i=c=>{n&&(n.textContent=c)},s=M();if(!s){a?to(n,"You need to be logged in to read this edition.",eo(a,"login"),"Log in"):i("Log in to read this edition.");return}let l=e.textContent;e.setAttribute("aria-busy","true"),e.textContent="Opening\u2026",i("");try{let c=await fetch(`${t}/me/editions/${encodeURIComponent(r)}/${encodeURIComponent(o)}/download-url`,{headers:{Authorization:`Bearer ${s}`}}),d=await c.json().catch(()=>null);if(!c.ok||!d?.data){let f=_i(d);c.status===403&&a?to(n,f,eo(a,"upgrade"),"Upgrade"):i(f);return}let p=`${window.location.origin}/?bday_reader=1&pdf=${encodeURIComponent(d.data.url)}`;Ea(p)}catch{i("Something went wrong \u2014 please try again.")}finally{e.removeAttribute("aria-busy"),e.textContent=l}}var Ii="aero-paywall-bookmark-mount";function Oi(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function Ta(e){let t=typeof document<"u"?document.querySelector(".post-thumbnail"):null;return{postId:e,title:typeof document<"u"?document.title:"",url:typeof window<"u"?window.location.href:"",imageUrl:t?.src||void 0}}function Sa(e,t,a){fetch(`${e}/me/reading-history`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)}).catch(()=>{})}function La(e,t,a){let r=typeof document<"u"?document.getElementById(Ii):null;if(!r)return;let o=!1,n=document.createElement("button");n.type="button",n.className="aero-paywall-bookmark-button",s();let i=document.createElement("span");i.className="aero-paywall-bookmark-status",i.setAttribute("role","status"),i.hidden=!0,n.addEventListener("click",()=>{l()});function s(){n.classList.toggle("is-saved",o),n.setAttribute("aria-pressed",String(o)),n.innerHTML=`<svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true"><path fill="${o?"currentColor":"none"}" stroke="currentColor" stroke-width="1.6" stroke-linejoin="round" d="M6 3.5h12a.5.5 0 0 1 .5.5v16.5l-6.5-4-6.5 4V4a.5.5 0 0 1 .5-.5z"/></svg><span>${o?"Saved":"Save"}</span>`}async function l(){n.disabled=!0,i.hidden=!0;try{if(o){if(!(await fetch(`${e}/me/bookmarks/${encodeURIComponent(a.postId)}`,{method:"DELETE",headers:{Authorization:`Bearer ${t}`}})).ok)throw new Error("Could not remove bookmark");o=!1}else{let c=await fetch(`${e}/me/bookmarks`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)}),d=await c.json().catch(()=>null);if(!c.ok||d?.success===!1)throw new Error(Oi(d,"Could not save bookmark"));o=!0}s()}catch(c){i.textContent=c instanceof Error?c.message:"Something went wrong",i.hidden=!1}finally{n.disabled=!1}}r.appendChild(n),r.appendChild(i)}function Di(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;
2920if(typeof a=="string")return a}return t}var qi=20;async function no(e,t,a){let r=new URLSearchParams({postId:t,limit:String(qi)});a&&r.set("cursor",a);let o=await fetch(`${e}/comments?${r.toString()}`);return o.ok?(await o.json().catch(()=>null))?.data??{comments:[],nextCursor:null}:{comments:[],nextCursor:null}}async function ao(e,t,a){let r=await fetch(`${e}/comments`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(a)}),o=await r.json().catch(()=>null);if(!r.ok||!o?.data)throw new Error(Di(o,"Could not post comment"));return o.data}async function zi(e,t,a){if(!(await fetch(`${e}/comments/${encodeURIComponent(a)}`,{method:"DELETE",headers:{Authorization:`Bearer ${t}`}})).ok)throw new Error("Could not remove comment")}function Ca(e){let t=document.createElement("div");return t.textContent=e,t.innerHTML}function Fi(e){return new Date(e).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Pa(e,t,a,r,o,n,i){let s=new Set,l=null,c=!1;e.classList.add("aero-paywall-comments"),e.innerHTML=`
2921    <h3 class="aero-paywall-comments-title">Comments</h3>
2922    <div class="aero-paywall-comments-form-slot"></div>
2923    <ul class="aero-paywall-comments-list" role="list"></ul>
2924    <p class="aero-paywall-comments-empty" hidden>No comments yet \u2014 be the first to share your thoughts.</p>
2925    <p class="aero-paywall-comments-error" role="alert" hidden></p>
2926    <button type="button" class="aero-paywall-comments-more" hidden>Load more comments</button>
2927  `;let d=e.querySelector(".aero-paywall-comments-form-slot"),p=e.querySelector(".aero-paywall-comments-list"),f=e.querySelector(".aero-paywall-comments-empty"),m=e.querySelector(".aero-paywall-comments-error"),g=e.querySelector(".aero-paywall-comments-more");if(r){let S=ro(d,n);oo(d,o,null,async y=>{let x=await S(),L=await ao(t,r,{postId:a,body:y,captchaToken:x});s.add(L.id),p.prepend(A(L)),f.hidden=!0})}else i&&(d.innerHTML=`<p class="aero-paywall-comments-signin">
2928      <a href="${Ca(i)}?tab=register">Sign in</a> to join the conversation.
2929    </p>`);g.addEventListener("click",()=>{k(l)}),k(null);async function k(S){g.disabled=!0;try{let y=await no(t,a,S);l=y.nextCursor,g.hidden=!l,y.comments.forEach(x=>p.appendChild(A(x))),c||(c=!0,f.hidden=y.comments.length>0)}catch{m.textContent="Could not load comments right now.",m.hidden=!1}finally{g.disabled=!1}}function A(S){let y=document.createElement("li");y.className="aero-paywall-comment",y.dataset.commentId=S.id,y.innerHTML=`
2930      <div class="aero-paywall-comment-meta">
2931        <span class="aero-paywall-comment-author">${Ca(S.author.displayName)}</span>
2932        <span class="aero-paywall-comment-date">${Fi(S.createdAt)}</span>
2933      </div>
2934      <p class="aero-paywall-comment-body">${Ca(S.body)}</p>
2935      <div class="aero-paywall-comment-actions">
2936        ${r?'<button type="button" class="aero-paywall-comment-reply-toggle">Reply</button>':""}
2937        ${s.has(S.id)?'<button type="button" class="aero-paywall-comment-delete">Delete</button>':""}
2938      </div>
2939      <div class="aero-paywall-comment-reply-slot"></div>
2940      <ul class="aero-paywall-comment-replies" role="list"></ul>
2941    `;let x=y.querySelector(".aero-paywall-comment-replies");S.replies.forEach(w=>x.appendChild(A(w)));let L=y.querySelector(".aero-paywall-comment-reply-toggle"),P=y.querySelector(".aero-paywall-comment-reply-slot");L&&r&&L.addEventListener("click",()=>{if(P.childElementCount>0){P.innerHTML="";return}let w=ro(P,n);oo(P,o,S.id,async T=>{let h=await w(),C=await ao(t,r,{postId:a,body:T,parentId:S.id,captchaToken:h});s.add(C.id),x.appendChild(A(C)),P.innerHTML=""},"Reply")});let u=y.querySelector(".aero-paywall-comment-delete");return u&&r&&u.addEventListener("click",()=>{(async()=>{u.disabled=!0;try{await zi(t,r,S.id),y.remove()}catch{u.disabled=!1}})()}),y}}function ro(e,t){if(!t)return()=>Promise.resolve(void 0);let a=document.createElement("div");a.className="aero-paywall-captcha-mount",e.appendChild(a);let r=xe(a,t);return async()=>(await r)()}function oo(e,t,a,r,o="Post comment"){let n=document.createElement("form");n.className="aero-paywall-comment-form",n.innerHTML=`
2942    <textarea name="body" rows="${a?2:3}" maxlength="2000" required placeholder="${a?"Write a reply\u2026":"Join the conversation\u2026"}"></textarea>
2943    <div class="aero-paywall-comment-form-row">
2944      <button type="submit"${t?` style="background:${t}"`:""}>${o}</button>
2945    </div>
2946    <p class="aero-paywall-comment-form-error" role="alert" hidden></p>
2947  `,e.prepend(n);let i=n.querySelector("textarea"),s=n.querySelector('button[type="submit"]'),l=n.querySelector(".aero-paywall-comment-form-error");n.addEventListener("submit",d=>{d.preventDefault(),c()});async function c(){let d=i.value.trim();if(d){s.disabled=!0,l.hidden=!0;try{await r(d),i.value=""}catch(p){l.textContent=p instanceof Error?p.message:"Could not post comment",l.hidden=!1}finally{s.disabled=!1}}}}var Bi="bday-newsletter-opt-in-form",Ki="bday-newsletter-opt-in-brief-toggle-mount",Wi="bday-newsletter-opt-in-signedin";function Aa(e){if(typeof document>"u")return;let t=document.getElementById(Bi);if(!t)return;let a=document.getElementById(Ki),r=M();if(!r)return;a&&_e(a,e,r);let o=t.querySelector(".bday-newsletter-opt-in__identity-fields"),n=document.getElementById(Wi),i=t.querySelector('input[name="email"]'),s=t.querySelector('input[name="first_name"]'),l=t.querySelector('input[name="last_name"]');fetch(`${e}/me`,{headers:{Authorization:`Bearer ${r}`}}).then(c=>c.ok?c.json():null).then(c=>{let d=c?.data;d&&(i&&(i.value=d.email,i.required=!1),s&&(s.value=d.firstName??"",s.required=!1),l&&(l.value=d.lastName??"",l.required=!1),o&&(o.hidden=!0),n&&(n.hidden=!1,n.querySelector("[data-aero-nav-email]").textContent=d.email))}).catch(()=>{})}var Ji=["Nigeria","Ghana","United Kingdom","United States","South Africa","Kenya","Other"];function Gi(e,t){if(typeof e?.message=="string")return e.message;if(e?.message&&typeof e.message=="object"&&"message"in e.message){let a=e.message.message;if(typeof a=="string")return a}return t}function it(e){return e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t])}function ji(e){return e&&e!=="NG"?"USD":"NGN"}var io="General corporate inquiry";function Ma(e,t,a="#E30613",r,o){e.innerHTML='<p class="aero-corporate-loading">Loading\u2026</p>',Promise.all([fetch(`${t}/corporate-inquiries/config`).then(n=>n.ok?n.json():null).then(n=>n?.data?.teamSizeRanges??["1-10","11-50","51-100","101-500","500+"]).catch(()=>["1-10","11-50","51-100","101-500","500+"]),fetch(`${t}/plans`).then(n=>n.ok?n.json():null).then(n=>(n?.data??[]).filter(i=>i.isB2b)).catch(()=>[])]).then(([n,i])=>{Ui(e,t,a,n,i,r,o)})}function Ui(e,t,a,r,o,n,i){let s=ji(n),l=typeof window<"u"?new URLSearchParams(window.location.search).get("aero_corp_plan"):null,c=o.length>0?`<div class="aero-corporate-form__type">
2948           <p class="aero-corporate-form__type-label">Select subscription type</p>
2949           ${o.map((S,y)=>{let x=s==="USD"?`$${S.priceUsd}`:`\u20A6 ${S.priceNgn}`,L=l?S.id===l:y===0;return`
2950                 <label>
2951                   <input type="radio" name="subscriptionType" value="${it(S.id)}" ${L?"checked":""} />
2952                   <span>${it(S.name)}<span class="aero-corporate-form__type-price">${it(x)} / ${S.durationDays} days</span></span>
2953                 </label>
2954               `}).join("")}
2955         </div>`:`<input type="hidden" name="subscriptionType" value="${it(io)}" />`;e.innerHTML=`
2956    <form class="aero-paywall-form aero-corporate-form" novalidate>
2957      ${c}
2958
2959      <p class="aero-paywall-form-title">Provide your information</p>
2960      <p class="aero-corporate-form__hint">Complete your details and we'll get back to you shortly.</p>
2961
2962      <div class="aero-corporate-form__grid">
2963        <label>First name<input type="text" name="firstName" required /></label>
2964        <label>Last name<input type="text" name="lastName" required /></label>
2965        <label>Business email<input type="email" name="businessEmail" required /></label>
2966        <label>Business phone (optional)<input type="tel" name="businessPhone" /></label>
2967        <label>Job title<input type="text" name="jobTitle" required /></label>
2968        <label>Company<input type="text" name="company" required /></label>
2969        <label>Country
2970          <select name="country" required>
2971            <option value="" disabled selected>Select country</option>
2972            ${Ji.map(S=>`<option value="${S}">${S}</option>`).join("")}
2973          </select>
2974        </label>
2975        <label>Team size
2976          <select name="teamSizeLabel" required>
2977            <option value="" disabled selected>Select team size</option>
2978            ${r.map(S=>`<option value="${S}">${S}</option>`).join("")}
2979          </select>
2980        </label>
2981      </div>
2982
2983      <label class="aero-corporate-form__consent">
2984        <input type="checkbox" name="marketingOptIn" />
2985        I would like to receive updates and information about Corporate Subscriptions, recommended content and special offers from BusinessDay. I can unsubscribe at any time.
2986      </label>
2987
2988      ${i?'<div class="aero-paywall-captcha-mount"></div>':""}
2989      <button type="submit" style="background:${a}
2989">Get Pricing</button>
2990      <p class="aero-paywall-form-error" role="alert" hidden></p>
2991      <p class="aero-corporate-form__success" role="status" hidden>Thanks \u2014 our team will be in touch shortly.</p>
2992    </form>
2993  `;let d=e.querySelector("form"),p=d.querySelector(".aero-paywall-form-error"),f=d.querySelector(".aero-corporate-form__success"),m=d.querySelector('button[type="submit"]'),g=d.querySelector(".aero-paywall-captcha-mount"),k=g?xe(g,i):null;d.addEventListener("submit",S=>{S.preventDefault(),A()});async function A(){p.hidden=!0;let S=k?(await k)():void 0;if(k&&!S){p.textContent="Please complete the captcha check before submitting.",p.hidden=!1;return}m.disabled=!0;let y=new FormData(d),x=String(y.get("subscriptionType")??""),P={subscriptionType:o.find(u=>u.id===x)?.name??(x||io),firstName:String(y.get("firstName")??""),lastName:String(y.get("lastName")??""),businessEmail:String(y.get("businessEmail")??""),businessPhone:String(y.get("businessPhone")??"")||void 0,jobTitle:String(y.get("jobTitle")??""),company:String(y.get("company")??""),country:String(y.get("country")??""),teamSizeLabel:String(y.get("teamSizeLabel")??""),marketingOptIn:y.get("marketingOptIn")==="on",captchaToken:S};try{let u=await fetch(`${t}/corporate-inquiries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(P)});if(!u.ok){let w=await u.json().catch(()=>null);throw new Error(Gi(w,"Something went wrong. Please try again."))}d.hidden=!0,f.hidden=!1}catch(u){p.textContent=u instanceof Error?u.message:"Something went wrong. Please try again.",p.hidden=!1,m.disabled=!1,k&&(await k).reset()}}}var Vi="Africa/Lagos";function Yi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone===Vi?"NGN":"USD"}catch{return"USD"}}var Xi="#1a73e8";function so(e,t=Xi){let a=document.createElement("div");return a.className="aero-paywall-welcome-popup-overlay",a.style.cssText="position:fixed;inset:0;background:rgba(0,0,0,0.5);display:flex;align-items:center;justify-content:center;z-index:2147483000;",a.innerHTML=`
2994    <div class="aero-paywall-welcome-popup" role="dialog" aria-modal="true" style="background:#fff;border-radius:12px;padding:24px;max-width:360px;text-align:center;font:14px/1.5 system-ui,sans-serif;">
2995      <h2 style="margin:0 0 8px;">Welcome aboard!</h2>
2996      <p style="margin:0 0 16px;">Your account is ready. Continue to see subscription options.</p>
2997      <button type="button" class="aero-paywall-welcome-popup-close" style="background:${t};color:#fff;border:none;border-radius:6px;padding:8px 16px;cursor:pointer;">Got it</button>
2998    </div>
2999  `,a}function Zi(e,t,a=document.body){let r=so(e,t);a.appendChild(r);let o=()=>{r.remove(),window.location.href=`${e}#subscribe`};r.querySelector(".aero-paywall-welcome-popup-close")?.addEventListener("click",o),r.addEventListener("click",n=>{n.target===r&&o()})}var Qi="aero-paywall-account-mount",es="aero-reader-settings-mount",ts="aero-paywall-follow-mount",as="aero-paywall-comments-mount",rs="aero-corporate-subscription-mount",os="0.1.0";async function co(e){ha(e.accentColor),e.apiBaseUrl&&!M()&&await Pt(e.apiBaseUrl),ya(e);let t=typeof document<"u"?document.getElementById(Qi):null;if(!t&&typeof window<"u"&&e.accountUrl){let d=new URLSearchParams(window.location.search).get("aero_invite_token");if(d){let f=new URL(e.accountUrl);f.searchParams.set("aero_invite_token",d),window.location.href=f.toString();return}let p=new URLSearchParams(window.location.search).get("aero_gift_plan");if(p){let f=new URL(e.accountUrl);f.searchParams.set("aero_gift_plan",p),window.location.href=f.toString();return}}t&&Ne(t,e.apiBaseUrl,e.accentColor,e.googleClientId,e.appleClientId,e.captcha,e.accountUrl,e.countryCode,e.jwksUrl,e.corporateSubscriptionUrl);let a=typeof document<"u"?document.getElementById(es):null;if(a&&nt(a,e.apiBaseUrl,e.accentColor),ka(e.apiBaseUrl,e.accountUrl),Qr(),e.postId!==null){let d=M();if(d){let p=Ta(String(e.postId));La(e.apiBaseUrl,d,p),Sa(e.apiBaseUrl,d,p),Pe(d,e.jwksUrl??"").then(f=>{f?.subscriptionStatus==="active"&&ma(e.apiBaseUrl,d,String(e.postId))})}}let r=e.followEnabled&&typeof document<"u"?document.getElementById(ts):null;if(r){let d=r.dataset.aeroFollowTaxonomy,p=r.dataset.aeroFollowTermId,f=r.dataset.aeroFollowTermLabel;if((d==="category"||d==="tag")&&p&&f){let m={taxonomy:d,termId:p,termLabel:f},g=M();g?oa(r,e.apiBaseUrl,g,m):e.accountUrl&&na(r,e.accountUrl)}}let o=typeof document<"u"?document.getElementById(as):null;if(o){let d=o.dataset.aeroCommentsPostId;d&&Pa(o,e.apiBaseUrl,d,M(),e.accentColor,e.captcha,e.accountUrl)}Aa(e.apiBaseUrl);let n=typeof document<"u"?document.getElementById(rs):null;n&&Ma(n,e.apiBaseUrl,e.accentColor,e.countryCode,e.captcha);let i=await Kt(e);
2999if(!i)return;let{plan:s,isSubscriber:l}=i;Wt(s.remaining,l,e.accentColor),l&&(e.adFreeEnabled??!0)&&jt();let c=!l&&s.mount!==null;Ut(e.privateModeEnforcement??"soft",c)}function lo(){typeof window>"u"||!window.aeroPaywallContext||co(window.aeroPaywallContext)}typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",lo):lo());return Po(ns);})();

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.