"use strict";(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([["1264"],{96855:function(e,t,n){n.d(t,{Z:()=>r});let r={container:"container-WYWNQ7",enabled:"enabled-FrokEl",checked:"checked-qUvq71",unchecked:"unchecked-YpAQwg",disabled:"disabled-w7hZI3",nub:"nub-XpaYD_",theme_accent:"theme_accent-eoXELK",themeAccent:"theme_accent-eoXELK",theme_success:"theme_success-my5UzI",themeSuccess:"theme_success-my5UzI",theme_error:"theme_error-Uoe9a5",themeError:"theme_error-Uoe9a5",theme_select:"theme_select-TR6faD",themeSelect:"theme_select-TR6faD",theme_highlight:"theme_highlight-sw2S4n",themeHighlight:"theme_highlight-sw2S4n",input:"input-b61VGF"}},87815:function(e,t,n){n.d(t,{Z:()=>r});let r={group:"group-JuxKi2",segment:"segment-XiSgAE",outlined:"outlined-kJWSK2"}},36781:function(e,t,n){n.d(t,{Z:()=>c});var r=n(16584),i=n(30396),a=n(2236),o=n(4038),l=n(81821);let c=e=>{let{pub:t,post:n,style:c,source:s,size:d,hoverOverlay:u=!0}=e,{img:m,imgDownload:h,shareData:g,useNativeShare:p}=(0,o.Q)((0,a.lx)({pub:t,post:n,style:c})),v=(0,i.I4)(async()=>{await (0,a.mT)({post_id:n.id,type:"post_asset",aspect_ratio:c.aspectRatio,source:s,shareData:p?g:void 0,eventName:"WRITER_MEDIA_ASSETS_IMAGE_DOWNLOADED"})},[n.id,c.aspectRatio,s,p,g]);return(0,r.tZ)(a.kA,{onClick:v,href:p?void 0:h,children:(0,r.BX)(a.A4,{size:d,children:[!(0,l.tq)()&&m&&u&&(0,r.tZ)(a.rA,{onClick:v}),(0,r.tZ)(a.M$,{img:m})]})})}},2236:function(e,t,n){n.d(t,{A4:()=>y,M$:()=>b,kA:()=>w,lx:()=>C,mT:()=>S,rA:()=>k});var r=n(7409),i=n(99282),a=n(16584),o=n(98661),l=n(94184),c=n.n(l),s=n(71212),d=n(95441),u=n(68833),m=n(15771),h=n(19081),g=n(98248),p=n(63474),v=n(60308),f=n(63651),_=n(97522);let b=(0,o.forwardRef)((e,t)=>{let{img:n}=e,[r,i]=(0,o.useState)(!1);return n?(0,a.BX)(a.HY,{children:[!r&&(0,a.tZ)(Z,{}),(0,a.tZ)("img",{src:n,className:c()(_.Z.image,r&&_.Z.loaded),ref:t,onLoad:()=>i(!0),style:{display:r?"block":"none"}})]}):(0,a.tZ)(Z,{})});function Z(){return(0,a.tZ)(h.sg,{alignItems:"center",justifyContent:"center",bg:"secondary",className:c()(_.Z.image,_.Z.loading),children:(0,a.tZ)(g.$j,{})})}function w(e){let{children:t,onClick:n,href:r}=e,{iString:i}=(0,d.M1)();return(0,a.tZ)(p.A0,{onClick:n,href:r,"aria-label":i("Download image"),download:!0,className:c()(_.Z.link),target:"_blank",rel:"noreferrer",children:t})}function k(e){let{onClick:t}=e,{iString:n}=(0,d.M1)();return(0,a.tZ)(h.sg,{className:_.Z.overlay,animate:!0,position:"absolute",inset:0,alignItems:"center",justifyContent:"end",padding:12,children:(0,a.tZ)(m.zx,{className:_.Z.downloadButton,priority:"primary-mono",size:"sm",leading:(0,a.tZ)(s.Z,{size:20}),onClick:t,children:n("Download")})})}function y(e){let{children:t,size:n=300}=e;return(0,a.tZ)(h.sg,{className:_.Z.imageContainer,flex:"auto",position:"relative",cursor:"grab",style:{"--image-max-size":"".concat(n,"px")},children:t})}async function S(e){let{post_id:t,type:n,aspect_ratio:a,selection_id:o,source:l,auto_selected:c,shareData:s,eventName:d,additionalTrackingData:m={}}=e;if((0,u.j)(u.FP[d],(0,i._)((0,r._)({post_id:t,type:n},a&&{aspect_ratio:a},o&&{selection_id:o},l&&{source:l},c&&{auto_selected:c},m),{interaction:"click"})),s)try{await navigator.share(s)}catch(e){}}function C(e){let{pub:t,post:n,selectionId:r,style:i}=e;return r?{shareTitle:"Share this post",shareText:n.title,shareUrl:(0,f.uRy)(t,n),imageDownloadUrl:(0,v.BPe)(t,n,r,i),imageUrl:(0,v.BPe)(t,n,r,i),imageUrlSameOrigin:(0,v.MWO)(t,n,r,i)}:{shareTitle:"Share this post",shareText:n.title,shareUrl:(0,f.uRy)(t,n),imageDownloadUrl:(0,v.ChS)(t,n,i),imageUrl:(0,v.ChS)(t,n,i),imageUrlSameOrigin:(0,v.FEI)(t,n,i)}}},16354:function(e,t,n){n.d(t,{zw:()=>Y,iL:()=>J,Qe:()=>K,k2:()=>ee});var r=n(7409),i=n(16584),a=n(30396),o=n(58865),l=n(94184),c=n.n(l),s=n(99282),d=n(64515);let u=e=>(0,i.BX)(d.l,(0,s._)((0,r._)({},e),{name:"DownloadIconNoBorder",svgParams:{height:32,width:32},children:[(0,i.tZ)("path",{d:"M23.5 18.5V21.8333C23.5 22.2754 23.3244 22.6993 23.0118 23.0118C22.6993 23.3244 22.2754 23.5 21.8333 23.5H10.1667C9.72464 23.5 9.30072 23.3244 8.98816 23.0118C8.67559 22.6993 8.5 22.2754 8.5 21.8333V18.5",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"rgba(255,255,255,0)"}),(0,i.tZ)("path",{d:"M11.8333 14.3335L16 18.5002L20.1667 14.3335",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"rgba(255,255,255,0)"}),(0,i.tZ)("path",{d:"M16 18.5V8.5",stroke:e.stroke||"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"rgba(255,255,255,0)"})]}));var m=n(95441),h=n(98248),g=n(81821);let p={root:"root-gpHBEU",fullSize:"fullSize-W6Pwju",link:"link-HgTAJz",linkHovered:"linkHovered-rnE2Gn",image:"image-ZSouY2",download:"download-aYXb5J",imageLoading:"imageLoading-BULJ5E"},v=e=>{let{img:t,imgDownload:n,shareData:r,useNativeShare:o,onClick:l}=e,{iString:s}=(0,m.M1)(),d=(0,a.sO)(null),v=(0,a.sO)(null),[f,_]=(0,a.eJ)(!1),[b,Z]=(0,a.eJ)({right:0,bottom:0});(0,a.d4)(()=>{var e,t;let n=null===(e=d.current)||void 0===e?void 0:e.getBoundingClientRect(),r=null===(t=v.current)||void 0===t?void 0:t.getBoundingClientRect();n&&r&&Z({right:r.right-n.right,bottom:r.bottom-n.bottom})},[d,v,t]);let w=(0,a.I4)(async e=>{if(null==l||l(),o&&r)try{await navigator.share(r)}catch(e){}else{var t;let n=null===(t=d.current)||void 0===t?void 0:t.getBoundingClientRect();if(n){let t=e.clientX,r=e.clientY;(tn.right||rn.bottom)&&e.preventDefault()}}},[l,o,r]);return(0,i.tZ)("a",{onClick:w,href:o?void 0:n,download:!0,className:c()(p.link,f&&p.linkHovered,p.fullSize),target:"_blank",children:(0,i.BX)("div",{ref:v,className:c()(p.root,p.fullSize),children:[!(0,g.tq)()&&t&&(0,i.tZ)("div",{className:p.download,style:b,children:(0,i.tZ)(u,{stroke:"#404040",fill:"white"})}),!t&&(0,i.tZ)("div",{className:c()(p.image,p.imageLoading),children:(0,i.tZ)(h.$j,{"aria-label":s("Loading")})}),t&&(0,i.tZ)("img",{ref:d,src:t,alt:s("Download Image"),className:c()(p.fullSize,p.image),onMouseEnter:()=>{_(!0)},onMouseLeave:()=>{_(!1)}})]})})};var f=n(64719),_=n(4038),b=n(68833),Z=n(35500),w=n(60308);function k(){let e=(0,o._)([""," has reached $10,000 in annual revenue"]);return k=function(){return e},e}function y(){let e=(0,o._)([""," has reached $1,000 in annual revenue"]);return y=function(){return e},e}function S(){let e=(0,o._)([""," has reached 100 subscribers"]);return S=function(){return e},e}function C(){let e=(0,o._)([""," has reached 1,000 subscribers"]);return C=function(){return e},e}n(67844);let I=e=>{let t,{pub:n,style:r,milestone:a}=e,{iString:o,iTemplate:l}=(0,m.M1)(),c=(0,f.Cq)();switch(a){case Z.dD.ARR10K:t=l(k(),n.name);break;case Z.dD.ARR1K:t=l(y(),n.name);break;case Z.bq.List100:t=l(S(),n.name);break;case Z.bq.List1K:t=l(C(),n.name)}let{img:s,imgDownload:d,shareData:u,useNativeShare:h}=(0,_.Q)({shareTitle:o("Share this milestone"),shareText:t,shareUrl:(0,w.SVA)(n),imageDownloadUrl:(0,w.iNT)(n,a,r,"".concat(a).concat(r.aspectRatio?" - ".concat(r.aspectRatio):"")),imageUrl:(0,w.iNT)(n,a,r,void 0),imageUrlSameOrigin:(0,w.RwZ)(n,a,r,{useRootDomain:null==c?void 0:c.isSubstack})});return(0,i.tZ)(v,{img:s,imgDownload:d,shareData:u,useNativeShare:h,onClick:()=>{(0,b.j)(b.FP.MILESTONE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{milestone:a,aspectRatio:r.aspectRatio,source:"image"})}})};var E=n(36781),T=n(33804);n(76511);let D=e=>{let{pub:t,style:n}=e,{iString:r}=(0,m.M1)(),a=(0,f.Cq)(),{img:o,imgDownload:l,shareData:c,useNativeShare:s}=(0,_.Q)({shareTitle:r("Share this publication"),shareText:t.hero_text,shareUrl:(0,w.SVA)(t),imageDownloadUrl:(0,w.p5u)(t,null,n,{fileToDownload:"Message".concat(n.aspectRatio?" - ".concat(n.aspectRatio):"")}),imageUrl:(0,w.p5u)(t,null,n),imageUrlSameOrigin:(0,w.eq9)(t,n,{useRootDomain:null==a?void 0:a.isSubstack})});return(0,i.tZ)(v,{img:o,imgDownload:l,shareData:c,useNativeShare:s,onClick:()=>{(0,b.j)(b.FP.PUBLICATION_MEDIA_ASSETS_IMAGE_DOWNLOADED,{aspectRatio:n.aspectRatio,source:"image"})}})};var x=n(25380),M=n(67791),N=n(46299),A=n(15771),P=n(66782);let O=["stories","square"],R=e=>{let{isSelected:t,value:n,onClick:r,coverImageUrl:a,themeVariables:o}=e,l=o.web_bg_color||o.cover_bg_color,s=o.print_on_web_bg_color||o.cover_print_primary||"#1a1a1a";return"accent"===n?(l=o.background_pop_color||o.background_pop,s=o.print_on_pop):"image"===n?(s="#ffffff",l="rgba(0,0,0,0.5)"):"black&white"===n&&(s="#404040",l="#ffffff"),(0,i.BX)(A.kG,{width:28,height:28,style:{backgroundColor:l},flex:"auto",radius:"sm",overflow:"hidden",alignItems:"center",justifyContent:"center",sizing:"border-box",className:c()(P.Z.customizeAssetButton,P.Z.themeButton,t&&P.Z.selected,"image"===n&&P.Z.image),onClick:e=>{e.preventDefault(),r()},tabIndex:0,children:["image"===n&&(0,i.tZ)("div",{className:P.Z.imageBg,style:{backgroundImage:"url(".concat(a,")")}}),(0,i.tZ)("div",{className:c()(P.Z.inner,"image"===n&&P.Z.image),children:t&&(0,i.tZ)(x.Z,{stroke:s,size:16,strokeWidth:2.5})})]})},L=e=>{let{isSelected:t,value:n,onClick:r}=e,a=function(e){let{iString:t}=(0,m.M1)(),n=(0,g.tq)({checkFirst4:!0}),r={square:t("Square"),stories:t("Vertical")};return(n?{square:"1:1",stories:"9:16"}:r)[e]}(n);return(0,i.tZ)(A.zx,{size:"sm",priority:t?"primary-mono":"secondary",onClick:r,leading:"square"===n?(0,i.tZ)(M.Z,{size:20}):(0,i.tZ)(N.Z,{size:20}),children:a})},B=e=>{let{isSelected:t,label:n,onClick:r}=e;return(0,i.tZ)(A.zx,{size:"sm",priority:t?"primary-mono":"secondary",onClick:r,children:n})};n(30279);let U=e=>{let{pub:t,user:n,note:r,style:a}=e,{iString:o}=(0,m.M1)(),l=(0,f.Cq)(),{img:c,imgDownload:s,shareData:d,useNativeShare:u}=(0,_.Q)({shareTitle:o("Share this message"),shareText:(null==r?void 0:r.note)||"",shareUrl:(0,w.SVA)(t),imageDownloadUrl:(0,w.gGz)(t,n,a,{fileToDownload:"Message".concat(a.aspectRatio?" - ".concat(a.aspectRatio):"")}),imageUrl:(0,w.gGz)(t,n,a),imageUrlSameOrigin:(0,w.MBd)(t,n,a,{useRootDomain:null==l?void 0:l.isSubstack})});return(0,i.tZ)(v,{img:c,imgDownload:s,shareData:d,useNativeShare:u,onClick:()=>{(0,b.j)(b.FP.SUBSCRIPTION_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:n.id,aspectRatio:a.aspectRatio,source:"image"})}})},z=e=>{let{pub:t,user:n,note:r,style:a}=e,{iString:o}=(0,m.M1)(),l=(0,f.Cq)(),{img:c,imgDownload:s,shareData:d,useNativeShare:u}=(0,_.Q)({shareTitle:o("Share this message"),shareText:(null==r?void 0:r.note)||"",shareUrl:(0,w.SVA)(t),imageDownloadUrl:(0,w.uQO)(t,n,a,{fileToDownload:"Message".concat(a.aspectRatio?" - ".concat(a.aspectRatio):"")}),imageUrl:(0,w.uQO)(t,n,a),imageUrlSameOrigin:(0,w.BtY)(t,n,a,{useRootDomain:null==l?void 0:l.isSubstack})});return(0,i.tZ)(v,{img:c,imgDownload:s,shareData:d,useNativeShare:u,onClick:()=>{(0,b.j)(b.FP.PLEDGE_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:n.id,aspectRatio:a.aspectRatio,source:"image"})}})};var q=n(98914),j=n(19081),X=n(6490),V=n(63474),W=n(96302),H=n(58175);let F={imageContainer:"imageContainer-bBRPE5"},G=(e,t)=>{var n;let{postCoverImageUrl:r,pubCoverImageUrl:i,pub:a,themeVariables:o}=t,l=[],c=[],s=!1,d=o||a.theme,u=null!==(n=(null==d?void 0:d.web_bg_color)||(null==d?void 0:d.cover_bg_color))&&void 0!==n?n:"";switch(e){case"post_asset":r&&l.push("image"),((null==d?void 0:d.background_pop_color)||(null==d?void 0:d.background_pop))&&l.push("accent"),l.push("primary"),"#ffffff"!==u.toLowerCase()&&l.push("black&white"),s=!0;break;case"pub_shareable_image":i&&l.push("image"),l.push("primary"),c.push({type:"logo",label:"Logo"}),a.has_posts&&c.push({type:"posts",label:"Top posts"}),a.hero_text&&c.push({type:"description",label:"Description"});break;case"paid_subscription":case"pledged_subscription":((null==d?void 0:d.background_pop_color)||(null==d?void 0:d.background_pop))&&l.push("accent"),l.push("primary")}return{assetThemes:l,assetTypes:c,includePreviewTextToggle:s}};function J(e){var t;let n,o,l,c,s,d,{pub:u,item:h,isOpen:g,setOpen:p,themeVariables:v,width:f}=e,{iString:_}=(0,m.M1)(),{type:k,target_user:y,target_user_id:S,target_pledge_note:C,target_subscription_note:x,post:M}=h,N=u.logo_url||u.cover_photo_url||u.author_photo_url||(null===(t=u.author)||void 0===t?void 0:t.photo_url),{assetThemes:P,assetTypes:R,includePreviewTextToggle:L}=G(k,{postCoverImageUrl:null==M?void 0:M.cover_image,pubCoverImageUrl:N,pub:u,themeVariables:v}),B=v||u.theme,[V,W]=(0,a.eJ)("stories"),[H,J]=(0,a.eJ)(P.find(e=>"image"===e)&&N?"image":P.find(e=>"accent"===e)&&((null==B?void 0:B.background_pop_color)||(null==B?void 0:B.background_pop))?"accent":"primary"),[et,en]=(0,a.eJ)("logo");(0,a.d4)(()=>{g&&(0,b.j)(b.FP.SHARE_CENTER_CUSTOMIZE_ASSETS_MODAL_OPENED)},[g]);let[er,ei]=(0,a.eJ)(!0),ea=()=>{switch(H){case"image":return(0,r._)({aspectRatio:V,bgImage:!0},R.length&&{type:et},L&&er&&{hidePreviewText:!0});case"accent":return(0,r._)({aspectRatio:V,bgColor:(null==B?void 0:B.background_pop_color)||(null==B?void 0:B.background_pop),textColor:null==B?void 0:B.print_on_pop},R.length&&{type:et},L&&er&&{hidePreviewText:!0});case"primary":return(0,r._)({aspectRatio:V,bgColor:(null==B?void 0:B.web_bg_color)||(null==B?void 0:B.cover_bg_color),textColor:(null==B?void 0:B.print_on_web_bg_color)||(null==B?void 0:B.cover_print_primary)},R.length&&{type:et},L&&er&&{hidePreviewText:!0});default:return(0,r._)({aspectRatio:V,bgColor:"#ffffff",textColor:"#404040"},R.length&&{type:et},L&&er&&{hidePreviewText:!0})}},eo=(0,q.K1)(),el=()=>{p(!1)};switch(k){case"arr_10k_milestone":l=Z.dD.ARR10K,o=(0,i.tZ)(I,{pub:u,milestone:l,style:{aspectRatio:V}}),c=(0,w.iNT)(u,l,{aspectRatio:V},"".concat(l," - ").concat("stories"===V?"vertical":V));break;case"arr_1k_milestone":l=Z.dD.ARR1K,o=(0,i.tZ)(I,{pub:u,milestone:l,style:{aspectRatio:V}}),c=(0,w.iNT)(u,l,{aspectRatio:V},"".concat(l," - ").concat("stories"===V?"vertical":V));break;case"list_100_milestone":l=Z.bq.List100,o=(0,i.tZ)(I,{pub:u,milestone:l,style:{aspectRatio:V}}),c=(0,w.iNT)(u,l,{aspectRatio:V},"".concat(l," - ").concat("stories"===V?"vertical":V));break;case"list_1k_milestone":l=Z.bq.List1K,o=(0,i.tZ)(I,{pub:u,milestone:l,style:{aspectRatio:V}}),c=(0,w.iNT)(u,l,{aspectRatio:V},"".concat(l," - ").concat("stories"===V?"vertical":V));break;case"paid_subscription":o=(0,i.tZ)(U,{pub:u,note:x,user:y||{id:S||0},style:ea()}),c=(0,w.gGz)(u,y||{id:S||0},ea(),{fileToDownload:"Message - ".concat("stories"===V?"vertical":V)}),d=()=>{(0,b.j)(b.FP.SUBSCRIPTION_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:(null==y?void 0:y.id)||S,aspectRatio:V,source:"download-button"})};break;case"pledged_subscription":o=(0,i.tZ)(z,{pub:u,note:C,user:y||{id:S||0},style:ea()}),c=(0,w.uQO)(u,y||{id:S||0},ea(),{fileToDownload:"Message - ".concat("stories"===V?"vertical":V)}),d=()=>{(0,b.j)(b.FP.PLEDGE_NOTE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{note_from_user_id:(null==y?void 0:y.id)||S,aspectRatio:V,source:"download-button"})};break;case"pub_shareable_image":n=_("Create shareable image"),o=(0,i.tZ)(D,{pub:u,style:ea()}),s="".concat(u.name," - ").concat("stories"===V?"vertical":V),c=(0,w.p5u)(u,null,ea(),{fileToDownload:s}),d=()=>{(0,b.j)(b.FP.PUBLICATION_MEDIA_ASSETS_IMAGE_DOWNLOADED,{aspectRatio:V,source:"download-button"})};break;case"post_asset":{let e=ea(),{text:t,translatedText:r}="image"===H?{text:"Image".concat(er?" - no preview":""),translatedText:_(er?"Image - no preview":"Image")}:"accent"===H?{text:"Accent Color".concat(er?" - no preview":""),translatedText:_(er?"Accent Color - no preview":"Accent Color")}:"primary"===H?{text:"Background Color".concat(er?" - no preview":""),translatedText:_(er?"Background Color - no preview":"Background Color")}:{text:"Black and White".concat(er?" - no preview":""),translatedText:_(er?"Black and White - no preview":"Black and White")};n=_("Create shareable image"),o=M&&(0,i.tZ)(E.Z,{pub:u,post:M,style:e,translatedText:r,size:420,hoverOverlay:!1}),s="".concat(r," - ").concat("stories"===V?"vertical":V),c=M&&(0,w.ChS)(u,M,e,s),d=()=>{(0,b.j)(b.FP.WRITER_MEDIA_ASSETS_IMAGE_DOWNLOADED,{post_id:null==M?void 0:M.id,type:t,aspectRatio:e.aspectRatio,share_center:!0,inline:!1,source:"download-button"})}}}["arr_10k_milestone","arr_1k_milestone","list_100_milestone","list_1k_milestone"].includes(k)?(n=_("Share milestone"),s="".concat(l," - ").concat("stories"===V?"vertical":V),d=()=>{(0,b.j)(b.FP.MILESTONE_MEDIA_ASSETS_IMAGE_DOWNLOADED,{milestone:l,aspectRatio:V,source:"download-button"})}):["paid_subscription","pledged_subscription"].includes(k)&&(n=_("Share message"),s="Message - ".concat("stories"===V?"vertical":V));let ec=async()=>{null==d||d();let e=document.createElement("a");e.href=c,e.download=s,e.target="_blank",e.rel="noopener noreferrer",e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)},es=P.length>1,ed=R.length>1,eu=O.length>1;return(0,i.tZ)(X.u_,{isOpen:g,onClose:el,width:f||640,overflow:"hidden",renderOverReactLaagPortal:!0,fullscreenMobile:!0,children:(0,i.BX)(T.w,{children:[(0,i.tZ)(X.xB,{onClose:el,title:n,showClose:!0,showDivider:!0}),(0,i.tZ)(X.fe,{children:(0,i.BX)(j.tu,{gap:20,children:[(0,i.tZ)(j.hs,{className:F.imageContainer,alignItems:"center",justifyContent:"center",children:o}),(0,i.BX)(ee,{children:[es&&(0,i.tZ)(K,{assetThemes:P,assetTheme:H,setAssetTheme:J,theme:B,pubCoverImageUrl:N}),ed&&(0,i.tZ)(Q,{assetTypes:R,assetType:et,setAssetType:en}),eu&&(0,i.tZ)(Y,{aspectRatio:V,setAspectRatio:W}),L&&(0,i.tZ)($,{hidePreviewText:er,setHidePreviewText:ei})]})]})}),!eo&&(0,i.tZ)(X.mz,{showDivider:!0,direction:"column",primaryButton:(0,i.tZ)(A.zx,{priority:"primary",onClick:ec,children:_("Download image")})})]})})}function K(e){let{assetThemes:t,assetTheme:n,setAssetTheme:r,theme:a,pubCoverImageUrl:o}=e;return(0,i.BX)(j.tu,{gap:8,children:[(0,i.tZ)(H.xv.B4,{weight:"medium",translated:!0,children:"Background"}),(0,i.tZ)(j.gq,{gap:8,children:t.map(e=>(0,i.tZ)(R,{value:e,isSelected:e===n,onClick:()=>r(e),themeVariables:a,coverImageUrl:o}))})]})}function Q(e){let{assetTypes:t,assetType:n,setAssetType:r}=e;return(0,i.BX)(j.tu,{gap:8,children:[(0,i.tZ)(H.xv.B4,{weight:"medium",translated:!0,children:"Type"}),(0,i.tZ)(j.gq,{gap:8,children:t.map(e=>{let{type:t,label:a}=e;return(0,i.tZ)(B,{label:a,isSelected:t===n,onClick:()=>r(t)})})})]})}function Y(e){let{aspectRatio:t,setAspectRatio:n}=e;return(0,i.BX)(j.tu,{gap:8,children:[(0,i.tZ)(H.xv.B4,{weight:"medium",translated:!0,children:"Aspect Ratio"}),(0,i.tZ)(j.gq,{gap:8,children:O.map(e=>(0,i.tZ)(L,{value:e,isSelected:e===t,onClick:()=>n(e)}))})]})}function $(e){let{hidePreviewText:t,setHidePreviewText:n}=e;return(0,i.BX)(j.tu,{gap:8,children:[(0,i.tZ)(H.xv.B4,{weight:"medium",translated:!0,children:"Preview Text"}),(0,i.tZ)(j.hs,{flex:"grow",alignItems:"center",children:(0,i.tZ)(W.rs,{checked:!t,onChange:e=>{n(!e),(0,b.j)(b.FP.SHARE_CENTER_CUSTOMIZE_ASSETS_PREVIEW_TEXT_TOGGLED,{includePreviewText:e})}})})]})}let ee=(0,V.zo)({display:"flex",gap:20,overflowX:"auto",flex:"auto",justifyContent:"space-between"})},28161:function(e,t,n){n.d(t,{Z:()=>l});var r=n(7409),i=n(99282),a=n(16584),o=n(64515);let l=e=>(0,a.BX)(o.l,(0,i._)((0,r._)({},e),{name:"SubstackLogoIcon",svgParams:{height:18,width:16,fill:"#ff6719",stroke:"none"},children:[(0,a.tZ)("path",{d:"M16 4H0V6H16V4Z"}),(0,a.tZ)("path",{d:"M0 8V18L7.9993 13.534L16 18V8H0Z"}),(0,a.tZ)("path",{d:"M16 0H0V2H16V0Z"})]}))},64719:function(e,t,n){n.d(t,{Cq:()=>l,UN:()=>c,_j:()=>o});var r=n(16584),i=n(6400),a=n(30396);let o=(0,i.createContext)({isSubstack:!1,customDomain:null});function l(){return(0,a.qp)(o)}function c(e){let{value:t,children:n}=e,i=(0,a.Ye)(()=>t,Object.values(t));return(0,r.tZ)(o.Provider,{value:i,children:n})}o.displayName="DomainInfoContext"},30372:function(e,t,n){n.d(t,{PS:()=>p,Pi:()=>g,UO:()=>f,aG:()=>v});var r=n(7409),i=n(99282),a=n(16584),o=n(6400),l=n(98661),c=n(30396),s=n(68833),d=n(21159),u=n(98914);let m={1:30,2:20,3:10},h=(0,o.createContext)({startInterval:()=>void 0,stopInterval:()=>void 0,trackInterval:()=>void 0,getCurrentUuid:()=>""});function g(e){let{children:t}=e,n=(0,c.sO)(null),r=(0,c.sO)(null),i=(0,c.sO)({top:0,bottom:0}),o=(0,c.sO)(null),l=(0,c.I4)(()=>{if(o.current){let{uuid:e,postId:t,containerElementRef:n,elementIsStatic:a,phase:l,count:c}=o.current;if(l&&l>3){g();return}if(c&&c>=m[l]){v();return}o.current.count=c+1;let u=(null==n?void 0:n.current)?(0,d.X)(n.current,null!=a&&a):i.current,h=u.top.toFixed(2),p=u.bottom.toFixed(2);(0,s.j)(s.FP.POST_PINGBACK_SEEN,{tracker_uuid:e,post_id:t,top_scroll_percentage:h,bottom_scroll_percentage:p,phase:l,count:c+1}),r.current!==h&&(r.current=h,t&&f(t,"read",u.top/100))}},[]),g=(0,c.I4)(()=>{n.current&&(clearInterval(n.current),n.current=null)},[]),p=()=>{var e,t;return 10**(null!==(t=null===(e=o.current)||void 0===e?void 0:e.phase)&&void 0!==t?t:1)*1e3},v=()=>{g(),o.current&&(o.current.phase+=1,o.current.count=0),n.current=setInterval(l,p())},_=(0,c.I4)(e=>{var t;let{postId:r,containerElementRef:i,elementIsStatic:a,phase:c=1,count:s=0}=e;"undefined"!=typeof window&&r&&i&&((null===(t=o.current)||void 0===t?void 0:t.postId)!==r&&(o.current={uuid:(0,u.EH)(),postId:r,containerElementRef:i,elementIsStatic:a,phase:c,count:s}),g(),n.current=setInterval(l,p()))},[l,g]),b=(0,c.I4)(()=>{var e;return(null===(e=o.current)||void 0===e?void 0:e.uuid)||""},[]);return(0,c.d4)(()=>{let e=()=>{var e,t,n,r,i,a,c;document.hidden?(l(),g()):(null===(e=o.current)||void 0===e?void 0:e.postId)&&(null===(t=o.current)||void 0===t?void 0:t.containerElementRef)&&_({postId:null===(n=o.current)||void 0===n?void 0:n.postId,containerElementRef:null===(r=o.current)||void 0===r?void 0:r.containerElementRef,elementIsStatic:null===(i=o.current)||void 0===i?void 0:i.elementIsStatic,phase:null===(a=o.current)||void 0===a?void 0:a.phase,count:null===(c=o.current)||void 0===c?void 0:c.count})};return document.addEventListener("visibilitychange",e),()=>{l(),o.current=null,g(),document.removeEventListener("visibilitychange",e)}},[_,g]),(0,c.d4)(()=>{let e=e=>{var t,n,r,a,l;let c=null===(n=o.current)||void 0===n?void 0:null===(t=n.containerElementRef)||void 0===t?void 0:t.current,s=null===(r=o.current)||void 0===r?void 0:r.elementIsStatic;c&&e.target===c&&(null===(l=o.current)||void 0===l?void 0:null===(a=l.containerElementRef)||void 0===a?void 0:a.current)&&(i.current=(0,d.X)(c,null!=s&&s))};return window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("scroll",e,!0)}},[_,g]),(0,a.tZ)(h.Provider,{value:{startInterval:_,stopInterval:g,trackInterval:l,getCurrentUuid:b},children:t})}function p(){return(0,c.qp)(h)}function v(e){let t=(0,l.forwardRef)((t,n)=>{let o=p();return(0,a.tZ)(e,(0,i._)((0,r._)({},o,t),{ref:n}))});return t.displayName="withPostPingbackTrackerContext(".concat(e.displayName||e.name||"Anonymous",")"),t}function f(e,t,n){var r;"undefined"!=typeof window&&(null===(r=window._preloads)||void 0===r?void 0:r.user)&&!window._preloads.user.is_magic&&fetch("/api/v1/posts/".concat(e,"/progress?type=").concat(t,"&progress=").concat(n),{method:"POST"}).catch(e=>{console.error("Failed to mark video progress:",e)})}h.displayName="PostPingbackTrackerContext"},25642:function(e,t,n){n.d(t,{Kk:()=>x,P$:()=>G,ju:()=>J});var r=n(7409),i=n(99282),a=n(16584),o=n(6400),l=n(30396),c=n(94184),s=n.n(c),d=n(39693),u=n.n(d),m=n(62686),h=n(40160),g=n(1548),p=n(31852),v=n(98170),f=n(26049),_=n(80878),b=n(71068),Z=n(19081),w=n(58175),k=n(2009),y=n(30343),S=n(64757),C=n(60836),I=n(59101);let E="quote_preferences",T={name:"DarkMuted",alignment:S.a_.Left},D=(0,o.createContext)({preferredTheme:T,setPreferredTheme:()=>{}});function x(e){var t,n,o;let{attachment:c,readOnly:s,onClick:d,onSavePostClick:u,onThemeChange:m,isPermalink:h,isComposing:g,isRestack:p}=e,{preferredTheme:v,setPreferredTheme:f}=G(),{postSelection:_,post:b,publication:w,postSelectionTheme:k}=c,[S,C]=(0,l.eJ)(null!=k?k:g?v:T),E=_.text.length<100,D=null!==(t=b.coverImagePalette)&&void 0!==t?t:null,x=e=>{let{name:t,alignment:n}=e,r={name:null!=t?t:S.name,alignment:null!=n?n:S.alignment};f(r),C(r),null==m||m(r)},A=F(S.name,{size:{width:520},palette:D,coverImage:null!==(n=b.cover_image)&&void 0!==n?n:void 0}),P=Object.keys(y.r.image).includes(S.name),U=Object.keys(y.r.basic).includes(S.name),z="blurredImage"===S.name,q="tintedImageVibrant"===S.name||"tintedImageMuted"===S.name,j=U?"1.0":.6;return(0,a.BX)(Z.tu,{gap:4,paddingTop:p?4:void 0,children:[(0,a.tZ)(M,{readOnly:s,onClick:d,publication:w,post:b,postSelection:_,className:U?"":I.Z.themed,isRestack:p,children:(0,a.tZ)(N,{text:_.text,isShort:E,isImage:P,isBasic:U,publication:w,post:b,onSavePostClick:u,palette:D,alignment:S.alignment,isPermalink:h,isComposing:g,isRestack:p,children:P?q?(0,a.tZ)(L,{style:A||void 0,palette:D,themeName:S.name}):(0,a.tZ)(R,{style:A||void 0,className:z?I.Z.blurred:void 0}):(0,a.tZ)(O,{style:(0,i._)((0,r._)({},A),{"--backdrop-opacity":"".concat(j)})})})}),g&&(0,a.tZ)(B,{palette:D,onColorSelect:e=>x({name:e}),onAlignmentSelect:e=>x({alignment:e}),selectedColorKey:S.name,coverImage:null!==(o=b.cover_image)&&void 0!==o?o:void 0,alignment:S.alignment})]})}function M(e){let{readOnly:t,onClick:n,publication:r,post:i,postSelection:o,children:l,className:c,isRestack:d}=e,u=t?void 0:(0,C.uR)(r,i,{feedViewer:!1,urlParams:{selection:o.id}});return(0,a.tZ)(Z.tu,{className:s()(I.Z.container,c),as:t?"div":"a",position:"relative",onClick:e=>{n&&n(),k.L&&!t&&(0,_.Q)(e,(0,C.uR)(r,i,{noBase:!0,feedViewer:!0,urlParams:{selection:o.id}}))},href:u,draggable:!1,showFocus:!0,animate:!0,radius:d?"sm":"md",overflow:"hidden",children:l})}function N(e){let{text:t,isShort:n,isImage:r,isBasic:i,palette:o,publication:l,post:c,onSavePostClick:d,alignment:u,children:m,isPermalink:h,isComposing:g,isRestack:p}=e;return(0,a.BX)(Z.tu,{padding:20,zIndex:1,className:s()(I.Z.header,h&&I.Z.permalink,p&&I.Z.restack),justifyContent:"space-between",gap:24,children:[m,(0,a.tZ)(A,{text:t,isShort:n,isImage:r,isVibrant:!i,alignment:u}),(0,a.tZ)(P,{publication:l,post:c,onSavePostClick:d,isVibrant:!i,palette:o,isComposing:g})]})}function A(e){let{text:t,isShort:n,isImage:r,isVibrant:i,alignment:o=S.a_.Left}=e;return(0,a.BX)(Z.tu,{gap:12,justifyContent:"center"===o?"center":"start",alignItems:"center"===o?"center":"start",flex:"grow",children:[(0,a.tZ)(p.Z,{color:i?"var(--color-utility-white)":"var(--color-fg-tertiary)"}),(0,a.tZ)(w.xv,{font:"serif",color:i?"vibrance-primary":"primary",className:s()(I.Z.text,n&&I.Z.short,r&&I.Z.imageText),align:o,children:t})]})}function P(e){var t;let{publication:n,post:r,palette:i,onSavePostClick:o,isVibrant:l,isComposing:c}=e,s=0===(t=r).publishedBylines.length?null:(0,a.tZ)(g.M,{array:t.publishedBylines,limit:3,formatter:e=>e.name}),d=null!=s?s:n.name;return(0,a.BX)(Z.gq,{gap:8,alignItems:"center",minWidth:0,height:20,children:[(0,a.tZ)(w.xv.B4,{weight:"regular",color:l?"vibrance-secondary":"secondary",ellipsis:!0,nowrap:!0,flex:"grow",decoration:"hover-underline",children:d}),!c&&(0,a.tZ)(v.s_,{post:r,palette:i&&l?i:null,onSavePostClick:o,className:I.Z.saveButton})]})}function O(e){let{style:t,className:n,children:r}=e;return(0,a.tZ)(b.xu,{style:t,className:s()(I.Z.backdrop,n),children:r})}function R(e){let{style:t,className:n}=e;return(0,a.tZ)(O,{className:I.Z.faded,children:(0,a.tZ)(b.xu,{style:t,className:s()(I.Z.imageBackdrop,n)})})}function L(e){let{style:t,className:n,palette:r,themeName:i}=e,o=(0,v.UO)(r||null,"tintedImageVibrant"===i?"DarkVibrant":"DarkMuted");return(0,a.BX)(O,{className:I.Z.faded,children:[(0,a.tZ)(b.xu,{style:t,className:s()(I.Z.imageBackdrop,I.Z.tinted,n)}),(0,a.tZ)(b.xu,{style:o,className:I.Z.tint})]})}function B(e){let{palette:t,selectedColorKey:n,coverImage:r,alignment:i,onColorSelect:o,onAlignmentSelect:l}=e;return(0,a.BX)(Z.gq,{justifyContent:"space-between",alignItems:"center",bg:"primary",cursor:"default",onClick:e=>e.stopPropagation(),gap:20,paddingTop:8,paddingBottom:16,height:28,children:[(0,a.tZ)(U,{palette:t,onColorSelect:o,selectedColorKey:n,coverImage:r}),(0,a.tZ)(z,{alignment:i,onAlignmentSelect:l})]})}function U(e){let{palette:t,onColorSelect:n,selectedColorKey:r,coverImage:i}=e,o=e=>t=>{t.preventDefault(),t.stopPropagation(),n(e)},l=(0,y.v)({coverImage:i,palette:null!=t?t:void 0}),c=u()(l.map(e=>{let n=F(e,{size:{width:26,height:28},palette:t,coverImage:i});return n?{key:e,style:n}:null}));return(0,a.tZ)(q,{children:c.map(e=>{let{key:n,style:i}=e;return(0,a.tZ)(j,{swatchKey:n,style:i,isSelected:r===n,onClick:o(n),palette:t})})})}function z(e){let{alignment:t,onAlignmentSelect:n}=e,r=S.Hp;return(0,a.tZ)(q,{children:r.map(e=>(0,a.tZ)(W,{alignment:e,onClick:()=>n(e),isSelected:t===e}))})}function q(e){let{children:t}=e;return(0,a.tZ)(Z.gq,{gap:8,className:I.Z.swatchesContainer,children:t})}function j(e){let{swatchKey:t,style:n,palette:r,isSelected:i,onClick:o}=e;return t in y.r.image?(0,a.tZ)(X,{swatchKey:t,style:n,onClick:o,isSelected:i,palette:r}):(0,a.tZ)(V,{swatchKey:t,style:n,onClick:o,isSelected:i})}function X(e){let{swatchKey:t,style:n,onClick:r,isSelected:i,palette:o}=e,l="blurredImage"===t,c="tintedImageVibrant"===t||"tintedImageMuted"===t,d=(0,v.UO)(o||null,"tintedImageVibrant"===t?"DarkVibrant":"DarkMuted");return(0,a.BX)(H,{isSelected:i,children:[(0,a.tZ)(b.xu,{onClick:r,width:28,height:28,title:t,flex:"auto",className:s()(I.Z.swatch,i&&I.Z.selected,l&&I.Z.blurred,c&&I.Z.tinted),style:n},t),c&&(0,a.tZ)(b.xu,{style:d,className:I.Z.tint})]})}function V(e){var t;let{swatchKey:n,style:r,onClick:i,isSelected:o}=e;return(0,a.tZ)(H,{isSelected:o,children:(0,a.tZ)(b.xu,{onClick:i,width:28,height:28,title:(t=n,"Theme ".concat(t)),style:r},n)})}function W(e){var t;let{alignment:n,onClick:r,isSelected:i}=e,o=i?"var(--color-fg-primary)":"var(--color-fg-secondary)";return(0,a.tZ)(H,{isSelected:i,className:I.Z.alignmentSwatchContainer,children:(0,a.tZ)(Z.hs,{onClick:r,title:(t=n,"Align ".concat(t)),children:n===S.a_.Left?(0,a.tZ)(m.Z,{color:o,size:16}):(0,a.tZ)(h.Z,{color:o,size:16})},n)})}function H(e){let{isSelected:t,children:n,className:r}=e;return(0,a.tZ)(Z.hs,{width:28,height:28,radius:"sm",outline:"detail",flex:"auto",cursor:"pointer",overflow:"hidden",sizing:"border-box",position:"relative",alignItems:"center",justifyContent:"center",animate:!0,className:s()(I.Z.swatchContainer,t&&I.Z.selected,r),tabIndex:0,children:n})}function F(e,t){let{size:n,palette:r,coverImage:i}=t;if(e in y.r.basic)return{background:y.r.basic[e]};if(e in y.r.custom)return{background:"linear-gradient(180deg, ".concat(y.r.custom[e],", ").concat(y.r.custom[e],"), var(--color-dark-bg-primary)")};if(e in y.r.image){if(!i)return;return{backgroundImage:(0,f._)(i,n),backgroundSize:"cover",backgroundPosition:"center"}}return(0,v.UO)(r||null,e)}function G(){let e=(0,l.qp)(D);if(!e)throw Error("useQuotePreferences must be used within QuotePreferencesProvider");return e}function J(e){let{children:t}=e,[n,i]=(0,l.eJ)(function(){if("undefined"==typeof localStorage)return T;try{let e=localStorage.getItem(E);if(!e)return T;return(0,r._)({},T,JSON.parse(e))}catch(e){return console.error("Error reading quote preferredTheme:",e),T}}()),o=(0,l.I4)(e=>{i(t=>{let n=(0,r._)({},t,e);try{localStorage.setItem(E,JSON.stringify(n))}catch(e){console.error("Storage error:",e)}return n})},[]);return(0,a.tZ)(D.Provider,{value:{preferredTheme:n,setPreferredTheme:o},children:t})}},6910:function(e,t,n){n.d(t,{m:()=>l});var r=n(7409),i=n(99282),a=n(98848),o=n(16584);function l(e){var{size:t=20,stroke:n="var(--color-light-secondary)"}=e,l=(0,a._)(e,["size","stroke"]);return(0,o.tZ)("svg",(0,i._)((0,r._)({},l),{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:n,xmlns:"http://www.w3.org/2000/svg",children:(0,o.tZ)("path",{id:"Vector",d:"M3 22C3 17.7044 6.69722 14.2222 11.258 14.2222C11.5081 14.2222 11.7556 14.2326 12 14.2531M21.0039 16.3098L18.6469 18.6668M18.6469 18.6668L16.2899 21.0239M18.6469 18.6668L21.0178 21.0377M18.6469 18.6668L16.276 16.2959M16.4118 6.44444C16.4118 8.89904 14.4102 10.8889 11.9412 10.8889C9.47214 10.8889 7.47059 8.89904 7.47059 6.44444C7.47059 3.98985 9.47214 2 11.9412 2C14.4102 2 16.4118 3.98985 16.4118 6.44444Z","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}))}},4038:function(e,t,n){n.d(t,{Q:()=>l});var r=n(30396),i=n(52384),a=n(98914),o=n(81821);function l(e){let[t,n]=(0,r.eJ)(""),[l,c]=(0,r.eJ)(""),[s,d]=(0,r.eJ)({}),[u,m]=(0,r.eJ)(!1);(0,r.d4)(()=>{(0,o.tq)()&&navigator.share&&navigator.canShare(s)&&m(!0)},[s]),(0,r.d4)(()=>{(async function(){n("");let t=e.imageUrl;if((0,a.pt)(e.imageUrl,()=>{n(t),c(e.imageDownloadUrl)}),(0,o.tq)()){var r,i;let n=await fetch(e.imageUrlSameOrigin||t),a=["instagram","instagram-stories"].includes(null!==(r=e.shareApp)&&void 0!==r?r:"");d({title:a?void 0:e.shareTitle,text:a?void 0:null!==(i=e.shareText)&&void 0!==i?i:void 0,files:[new File([await n.blob()],"image.png",{type:"image/png"})],url:a?void 0:e.shareUrl})}})()},[e.imageDownloadUrl,e.imageUrl,e.shareApp,e.shareText,e.shareTitle,e.shareUrl]);let{refetch:h}=(0,i.Q)({method:"post",pathname:"/api/v1/press_kit/notification",body:{title:e.shareText,imageUrl:e.imageUrl,shareApp:e.shareApp},deps:[e.shareText,e.imageUrl,e.shareApp]});return{img:t,imgDownload:l,sendPushNotification:(0,r.I4)(async()=>{let e=await h();return!(e instanceof Error)&&e.success},[h]),shareData:s,useNativeShare:u}}},21159:function(e,t,n){n.d(t,{X:()=>i,m:()=>r});let r=(e,t)=>{if(!e)return 0;let{scrollHeight:n,clientHeight:r}=e;return Math.min(t/100*(n-r),Math.max(0,n-r))},i=(e,t)=>{var n,r,i,a;let{scrollTop:o,scrollHeight:l,clientHeight:c}=t?{scrollTop:document.documentElement.scrollTop||document.body.scrollTop,scrollHeight:null!==(n=null==e?void 0:e.scrollHeight)&&void 0!==n?n:0,clientHeight:window.innerHeight}:{scrollTop:null!==(r=null==e?void 0:e.scrollTop)&&void 0!==r?r:0,scrollHeight:null!==(i=null==e?void 0:e.scrollHeight)&&void 0!==i?i:0,clientHeight:null!==(a=null==e?void 0:e.clientHeight)&&void 0!==a?a:0};return l&&c?l===c?{top:0,bottom:100}:{top:Math.min(100,o/(l-c)*100),bottom:Math.min(100,(o+c)/l*100)}:{top:0,bottom:0}}},57640:function(e,t,n){n.d(t,{Y:()=>m});var r=n(7409),i=n(99282),a=n(98848),o=n(16584),l=n(94184),c=n.n(l),s=n(71068),d=n(19081),u=n(96855);let m=e=>{var{checked:t,disabled:n,theme:l="accent",id:m}=e,h=(0,a._)(e,["checked","disabled","theme","id"]);return(0,o.BX)(d.hs,{height:20,width:20,position:"relative",radius:"full",sizing:"border-box",className:c()(u.Z.container,t?u.Z.checked:u.Z.unchecked,n?u.Z.disabled:u.Z.enabled,u.Z["theme_".concat(l)]),justifyContent:"center",alignItems:"center",children:[(0,o.tZ)("input",(0,i._)((0,r._)({},h),{id:m,checked:t,disabled:n,type:"radio",className:c()(u.Z.input,n?u.Z.disabled:u.Z.enabled)})),(0,o.tZ)(s.xu,{as:"span",radius:"full","aria-hidden":"true",className:c()(u.Z.nub,t?u.Z.checked:u.Z.unchecked,n?u.Z.disabled:u.Z.enabled,u.Z["theme_".concat(l)])})]})}},96302:function(e,t,n){n.d(t,{ZP:()=>f,rs:()=>g});var r=n(7409),i=n(99282),a=n(98848),o=n(16584),l=n(59278),c=n(94184),s=n.n(c);n(98661);var d=n(95441),u=n(71068);n(58175);var m=n(28657);let h=e=>{var{children:t,size:n}=e,c=(0,a._)(e,["children","size"]);let{iString:s}=(0,d.M1)();return(0,o.tZ)(l.r,(0,i._)((0,r._)({"aria-label":s("Toggle setting")},c),{onClick:e=>{e.stopPropagation()},children:t}))},g=e=>{var{checked:t,disabled:n,size:l="md",theme:c="accent",leading:d,trailing:u}=e,g=(0,a._)(e,["checked","disabled","size","theme","leading","trailing"]);return(0,o.BX)(v,{children:[d&&d,(0,o.tZ)(h,(0,i._)((0,r._)({checked:t,disabled:n,className:s()(m.Z.track,n?m.Z.disabled:m.Z.enabled,t?m.Z.checked:m.Z.unchecked,m.Z[l],m.Z["theme_".concat(c)])},g),{children:(0,o.tZ)(p,{className:s()(m.Z.nub,n?m.Z.disabled:m.Z.enabled,t?m.Z.checked:m.Z.unchecked,m.Z[l])})})),u&&u]})},p=e=>{let{className:t}=e;return(0,o.tZ)(u.xu,{"aria-hidden":"true",className:t})},v=(0,u.zo)({display:"flex",justifyContent:"center",alignItems:"center",gap:8}),f=g},54584:function(e,t,n){n.d(t,{o:()=>i,y:()=>a});var r=n(98661);let i=(0,r.createContext)("unknown");function a(){return(0,r.useContext)(i)}},78308:function(e,t,n){n.d(t,{A:()=>r});function r(e){return"direct-message"===e?"people":"all"}},97842:function(e,t,n){n.d(t,{I0:()=>c,RN:()=>d,UX:()=>o,WG:()=>u,ge:()=>l,ky:()=>s});var r=n(6400),i=n(30396),a=n(63018);let o={user:null,inbox:{threadList:[],threads:new Map,filter:"all",resources:{all:{isLoading:!0,hasMore:!1},people:{isLoading:!0,hasMore:!1}}},users:new Map,profiles:new Map,communityPosts:new Map,communityComments:new Map,chats:new Map,comments:new Map,replies:new Map,conversations:new Map,publications:new Map,notes:new Map,editingPost:null},l=(0,r.createContext)(()=>Promise.resolve());function c(){return(0,i.qp)(l)}let s=(0,r.createContext)(o);function d(){return(0,i.qp)(s)}function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return(0,a._I)("/api/v1/messages/unread-count",e,t)}},86190:function(e,t,n){n.d(t,{U:()=>i});var r=n(48980);let i=e=>async t=>{let n="before";t({type:"conversation-request_initial",payload:{conversationId:e}});try{let i=await (0,r.rd)("/api/v1/messages/dm/".concat(e));t({type:"conversation-load_more",payload:{edge:n,cursor:null,page:i}})}catch(r){t({type:"conversation-request_error",payload:{conversationId:e,edge:n,cursor:null,error:r}})}}},46603:function(e,t,n){n.d(t,{_:()=>a});var r=n(10928),i=n.n(r);function a(e,t){var n;let r;let a=e.conversations.get(t.messageThreadId),o=t.recentMessageId?e.communityComments.get(t.recentMessageId):null,l=i()(null!==(n=null==a?void 0:a.replyIds)&&void 0!==n?n:[]),c=l?e.communityComments.get(l):null;return o?c?o.comment.created_at>c.comment.created_at?o:c:o:c}},75822:function(e,t,n){n.d(t,{KS:()=>d,qS:()=>s});var r=n(16584),i=n(6400),a=n(30396),o=n(60807);let l=(0,i.createContext)({registerVideo:()=>void 0,unregisterVideo:()=>void 0,updatePaywallState:()=>void 0}),c=()=>(0,a.qp)(l),s=e=>{let{children:t}=e,[n,i]=(0,a.eJ)(0),c=(0,a.sO)([]),s=(0,a.sO)(new Map),d=(0,o.Fl)().autoPlayVideo;(0,a.d4)(()=>{let e=new IntersectionObserver(e=>{e.forEach(e=>{let t=e.target;if(!e.isIntersecting){t.pause();return}!s.current.get(t)&&d&&t.play()})},{threshold:1});return c.current.forEach(t=>{var n;(null===(n=t.current)||void 0===n?void 0:n.player)&&e.observe(t.current.player)}),()=>{c.current.forEach(t=>{var n;(null===(n=t.current)||void 0===n?void 0:n.player)&&e.unobserve(t.current.player)})}},[n]);let u=(0,a.I4)(e=>{e&&!c.current.includes(e)&&(c.current.push(e),i(e=>e+1))},[]),m=(0,a.I4)(e=>{c.current=c.current.filter(t=>t!==e),i(e=>e+1)},[]),h=(0,a.I4)(e=>{var t;let{videoPlayerRef:n,showPaywall:r}=e;(null===(t=n.current)||void 0===t?void 0:t.player)&&s.current.set(n.current.player,r)},[]);return(0,r.tZ)(l.Provider,{value:{registerVideo:u,unregisterVideo:m,updatePaywallState:h},children:t})},d=e=>{let{disable:t,showPaywall:n,videoPlayerRef:r}=e,{registerVideo:i,unregisterVideo:o,updatePaywallState:l}=c();(0,a.d4)(()=>{if(r.current&&!t)return i(r),()=>{o(r)}},[t,i,o,r]),(0,a.d4)(()=>{l({showPaywall:n,videoPlayerRef:r})},[n,l,r])}},16889:function(e,t,n){n.d(t,{n:()=>r});function r(e){let t=0,n=()=>{let{visibilityState:n="visible"}=document,r=Date.now();"hidden"!==n&&r-t>2e3&&(e(),t=r)};return window.addEventListener("online",n),document.addEventListener("visibilitychange",n),window.addEventListener("focus",n),()=>{window.removeEventListener("online",n),document.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}},17440:function(e,t,n){n.d(t,{F5:()=>l,FN:()=>c,Rg:()=>a,i4:()=>o,zg:()=>i});var r=n(7409);function i(e,t,n){let r=new Map(e);for(let e of t)r.set(n(e),e);return r}function a(e,t,n){let r=new Map(e);return r.set(t,n),r}function o(e,t){let n=new Map(e);return n.delete(t),n}function l(e,t,n){let i=e.get(t);if(null!=i){let a=new Map(e);return a.set(t,(0,r._)({},i,n)),a}return e}function c(e,t,n){let r=e.get(t);if(null!=r){let i=new Map(e);return i.set(t,n(r)),i}return e}}}]);