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]="e087aad3-8ccf-5e7d-8003-252392af2269")}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-DE5eomti.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=!!O.email_capture_disabled||M,F=t.audience===`premium`,I=!!A,L=D?.tier===`premium`&&D?.status!==`paused`,R=!!(F&&!L&&!I&&!v),z=_&&!R,B=!!(e.publication.community_enabled&&e.publication.has_community)&&!S,V=z&&!B&&x!=null,H=z&&!B&&x==null,U=m&&!P,W=!!l,G=n,K=!!u,[q,J]=(0,c.useState)(!1),Y=!q&&t.enforce_gated_content===!0&&!U&&!P&&!j,X=!q&&t.enable_popup_on_scroll===!0&&!U&&!P&&!j,Z=!v&&!Y&&!y,Q=`text_to_speech_config`in t&&!!t.text_to_speech_config?.audio_url&&!Y&&!U&&!W&&!G,$=(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:z,communityComments:x,showCommunityComments:V,showNativeComments:H,isGatedContentDisabled:P,onlyRenderComments:y,isPopupDisabled:N,hidePremiumComments:R,showRecommendedPostsNode:Z,isSubscriberGateEnabled:Y,isEmailCapturePopupEnabled:X,showSubscriberBreak:U,showPaywallBreak:W,showPaywallAndHidePostContent:G,showMeteredUsageBanner:K,isMeteredPaywallModalOpen:q,setIsMeteredPaywallModalOpen:J,paywallUrl:$,showTextToSpeechBlock:Q,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-DSlUyacU.js.map 5//# debugId=e087aad3-8ccf-5e7d-8003-252392af2269
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.