1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b065dfd1-dc72-5790-a080-a49351472eaa")}catch(e){}}(); 3import{s as e,t}from"./jsx-runtime-D4ePz0Hl.js";import{t as n}from"./react-BXH-GOAS.js";import{D as r,I as i,M as a,f as o}from"./components-CDo3yjgw.js";import{i as s}from"./SignupAction-4PkHGLMJ.js";var c=e(n(),1);function l(e,t){try{return new URL(e).searchParams.get(t)||null}catch{return null}}function u(e){try{return new URL(e),!0}catch{return!1}}var d=({post:e,visitToken:t,skip:n=!1,containerRef:r})=>{(0,c.useEffect)(()=>{if(n)return;function i(n){try{let r=n.target;for(;r&&r.id!==`content-blocks`&&r.tagName!==`BODY`;){if(r.tagName===`A`){let n=r.href;if(!u(n))break;let i=l(n,`_bhlid`),a={url:n,post_id:e.id,publication_id:e.publication_id,visit_token:t,...i?{link_id:i}:{}};fetch(`/clicks`,{method:`post`,body:JSON.stringify(a),headers:{"content-type":`application/json`}}).then().catch();break}r=r.parentElement}}catch{}}let a=r?r.current:document;if(a)return a.addEventListener(`click`,i),()=>{a.removeEventListener(`click`,i)}},[e.id,e.publication_id,t,n,r])},f=e(t(),1),p=({site:e,post:t,hide_premium_post:n,paywall_shown:l,metered_usage_shown:u,force_premium:d,enforce_paywall_breaks:p,contains_subscriber_break:m,subscription:h,previewSubscription:g,commentsEnabled:_,isDraft:v,onlyRenderComments:y,paywall:b,community_comments:x=null,meta_information_fetched:S,children:C})=>{let[w]=r(),T=a(),E=w.get(`preview_modal`)===`true`;n??=t.hide_premium_post,l??=t.paywall_shown,d??=t.force_premium,p??=t.enforce_paywall_breaks,m??=t.contains_subscriber_break;let D=h||g,{cookies:O,isLoggedIn:k,admin:A}=i(),{isFetchingSubscription:j}=o(`root`),M=k||!!D&&E||v&&!!g,N=j||!!O.popup_closed||M,P=w.getAll(`tier_ids[]`).includes(`none`),F=!!O.email_capture_disabled||M||v&&!P,I=t.audience===`premium`,L=!!A,R=D?.tier===`premium`&&D?.status!==`paused`,z=!!(I&&!R&&!L&&!v),B=_&&!z,V=!!(e.publication.community_enabled&&e.publication.has_community)&&!S,H=B&&!V&&x!=null,U=B&&!V&&x==null,W=m&&!F,G=!!l,K=n,q=!!u,[J,Y]=(0,c.useState)(!1),X=!J&&t.enforce_gated_content===!0&&!W&&!F&&!j,Z=!J&&t.enable_popup_on_scroll===!0&&!W&&!F&&!j,Q=!v&&!X&&!y,$=`text_to_speech_config`in t&&!!t.text_to_speech_config?.audio_url&&!X&&!W&&!G&&!K,ee=(0,c.useMemo)(()=>{let e=new URLSearchParams(T.search);b&&`offer_id`in b&&b.offer_id&&e.set(`offer_id`,b.offer_id);let t=e.toString();return`/upgrade${t?`?`:``}${t}`},[b,T.search]);return(0,f.jsx)(s.Provider,{value:{postId:t.id,canShowCommentsNode:B,communityComments:x,showCommunityComments:H,showNativeComments:U,isGatedContentDisabled:F,onlyRenderComments:y,isPopupDisabled:N,hidePremiumComments:z,showRecommendedPostsNode:Q,isSubscriberGateEnabled:X,isEmailCapturePopupEnabled:Z,showSubscriberBreak:W,showPaywallBreak:G,showPaywallAndHidePostContent:K,showMeteredUsageBanner:q,isMeteredPaywallModalOpen:J,setIsMeteredPaywallModalOpen:Y,paywallUrl:ee,showTextToSpeechBlock:$,utmParams:{utmParamsEnabled:t.utm_params_enabled,utmCampaign:t.utm_campaign,utmMedium:t.utm_medium,utmSource:t.utm_source},forcePremium:d,enforcePaywallBreaks:p},children:C})};export{d as n,p as t}; 4//# sourceMappingURL=PostPageProvider-C1K5S7LT.js.map 5//# debugId=b065dfd1-dc72-5790-a080-a49351472eaa
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.