(self.webpackChunklite=self.webpackChunklite||[]).push([[6371],{66443:(e,t,n)=>{"use strict";n.d(t,{Z:()=>l});var r=n(67294);function o(){return(o=Object.assign||function(e){for(var t=1;t{"use strict";n.d(t,{Z:()=>a});var r=n(67294);function o(){return(o=Object.assign||function(e){for(var t=1;t{"use strict";n.d(t,{I:()=>f});var r,o=n(59713),i=n.n(o),a=n(67294),l=n(7530),c=n(64504);!function(e){e.S="S",e.L="L"}(r||(r={}));var s=n(28309),u=n(80637),d=n(67122),f=function(e){var t=e.children,n=e.scale,o=void 0===n?r.L:n,f=e.alpha,m=void 0===f?.05:f,p=e.verticalMargins,v=void 0===p?{normal:"24px",small:"24px"}:p,E=(0,s.Iq)();return a.createElement("div",{className:E((function(e){return i()({background:(0,d.Uy)(m),borderRadius:"4px",margin:"".concat(v.normal," -16px"),position:"relative"},u.sm(e),{margin:"".concat(v.small," -12px 0")})}))},a.createElement(l.xu,{display:"flex",justifyContent:"space-between",maxWidth:"740px",padding:"16px",sm:{padding:"12px"}},a.createElement(c.F,{scale:o,color:"DARKER"},t)))}},66371:(e,t,n)=>{"use strict";n.d(t,{Cs:()=>q,Dj:()=>j});var r=n(28655),o=n.n(r),i=n(71439),a=n(67294),l=n(28859),c=n(63038),s=n.n(c),u=n(46829),d=n(94093),f=n(7530),m=n(62630),p=n(27572),v=n(28309),E=n(72955);function h(){var e=o()(["\n mutation unfollowUser($targetUserId: ID!) {\n unfollowUser(targetUserId: $targetUserId) {\n id\n isFollowing\n }\n }\n"]);return h=function(){return e},e}function g(){var e=o()(["\n mutation followUser($targetUserId: ID!) {\n followUser(targetUserId: $targetUserId) {\n id\n isFollowing\n }\n }\n"]);return g=function(){return e},e}function x(){var e=o()(["\n fragment DigestReferredPostBodyCreatorPromo_user on User {\n id\n name\n isFollowing\n }\n"]);return x=function(){return e},e}var I=(0,i.Ps)(x()),w=(0,i.Ps)(g()),b=(0,i.Ps)(h()),y=function(e){var t=e.creator,n=e.postId,r=a.useRef(null),o=(0,v.Iq)(),i=(0,u.useMutation)(w,{variables:{targetUserId:t.id}}),l=s()(i,1)[0],c=(0,u.useMutation)(b,{variables:{targetUserId:t.id}}),h=s()(c,1)[0],g=(0,m.Av)(),x="post_body_cta",I=a.useCallback((function(){return g.event("user.followed",{targetUserId:t.id,followSource:x}),l()}),[t.id,x,l]),y=a.useCallback((function(){return g.event("user.unfollowed",{targetUserId:t.id,followSource:x}),h()}),[t.id,x,h]),_=(0,p.pK)(),R=!1,L=function(){!R&&N()&&(g.event("post.digestReferredFollowCreatorPromoViewed",{postId:n,targetUserId:t.id,source:_}),R=!0)},N=function(){var e;if(!r.current)return!1;var t=null===(e=r.current)||void 0===e?void 0:e.getBoundingClientRect(),n=t.top+t.height/2;return n>=0&&n<=window.innerHeight};a.useEffect((function(){return L(),window&&E.V6.on("scroll",L),function(){E.V6.off("scroll",L)}}),[]);var T=t.isFollowing;return a.createElement("div",{ref:r},a.createElement(d.I,{alpha:.02,verticalMargins:{normal:"42px",small:"28px"}},T?a.createElement(a.Fragment,null,"You’re now following ",t.name,"."," ",a.createElement(f.rU,{onClick:y,inline:!0,linkStyle:"OBVIOUS"},"Unfollow")):a.createElement(a.Fragment,null,"You've read a few stories by this writer."," ",a.createElement("span",{className:o({fontWeight:"bold"})},a.createElement(f.rU,{onClick:I,linkStyle:"OBVIOUS"},"Follow ",t.name))," ","to see more of their stories across Medium.")))},_=n(4743),R=n(47875),L=n(50493),N=n(88065),T=n(47713),S=n(57131),C=n(85828),A=n(50077),k=n(49925),B=n(85740),P=n(55077),D=n(98281),O=n(41832),U=n(22091),M=n(6688),F=n(27390);function H(){var e=o()(["\n fragment PostBodyInserts_post on Post {\n collection {\n ...auroraHooks_publisher\n }\n creator {\n ...auroraHooks_publisher\n ...DigestReferredPostBodyCreatorPromo_user\n ...UserMentionTooltip_user\n }\n isPublished\n isShortform\n # please note that postMeteringOptions is defined in PostHandler, which uses PostBodyInserts\n content(postMeteringOptions: $postMeteringOptions) {\n bodyModel {\n paragraphs {\n name\n text\n type\n }\n }\n }\n ...CardByline_post\n ...PostByline_post\n ...PostFooterSocialPopover_post\n ...ShareButtons_post\n ...BookmarkButton_post\n ...CreatorActionOverflowPopover_post\n }\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n"]);return H=function(){return e},e}var G=function(){return null};function Z(e){var t=e.post,n=(0,M.I)(),r=(0,k.GT)(t.collection||t.creator),o={marginTop:"32px"},i={post:t,source:{name:"post_actions_header"}};return a.createElement(l.TA,{className:n(o),name:"byline",type:"byline",offset:{left:-600}},a.createElement(f.xu,{display:"flex",justifyContent:"space-between",xs:{marginTop:o.marginTop},sm:{flexDirection:"column-reverse",marginTop:o.marginTop}},r&&t.creator?a.createElement(A.u_,{avatar:a.createElement(D.ZP,{user:t.creator,scale:"XXS",link:!0,withHalo:!0}),publisher:t.creator,href:t.mediumUrl||void 0,isOneLine:!0,publishedAt:t.firstPublishedAt,showStar:!!t.isLocked,timeToRead:!t.isShortform&&t.readingTime?"".concat((0,F.Vd)(t.readingTime)," min read"):void 0,post:t}):a.createElement(R.Z,{scale:"M",post:t,showBio:!1,hideCollection:!0}),a.createElement(f.xu,{display:"flex",alignItems:"flex-end",print:{display:"none"},xs:{marginLeft:"0px",marginBottom:"30px"},sm:{marginLeft:"0px",marginBottom:"30px"},md:{marginLeft:"30px"},lg:{marginLeft:"30px"},xl:{marginLeft:"30px"}},a.createElement(f.xu,{display:"flex",alignItems:"center"},t.isPublished&&(!r||!t.isShortform)&&a.createElement(a.Fragment,null,r?a.createElement(f.xu,{paddingRight:"8px"},a.createElement(C.$,i)):a.createElement(P.n,i),a.createElement(f.xu,{marginRight:"8px"},a.createElement(p.cW,{source:{name:"post_actions_header"}},a.createElement(T.o,{post:t,susiEntry:"bookmark_preview"}))),t&&a.createElement(f.xu,{flexGrow:"1"},a.createElement(f.Bn,null,(function(e){var n=e.show;return a.createElement(S.Z,{creator:null==t?void 0:t.creator,post:t,collection:null==t?void 0:t.collection,showLoadingIndicator:n})}))))))))}function V(e,t){return"".concat(t,"_").concat(e[t]?e[t].length:0)}function z(e,t,n,r,o){e[t]||(e[t]=[]),e[t].push({order:n,component:r,insertType:o})}function K(e,t,n){return function(r){var o="number"==typeof n.titleIndex,i=n.subtitleIndex||n.titleIndex||0,l=t[i]&&t[i].name;if(l&&0===i&&!o){var c=a.createElement(Z,{post:e,key:"insert_postBylineGroupComponent_".concat(V(r,"first"))});z(r,"first","before",a.createElement(U.Pm,{size:"inset",key:"insert_MaxWidth_PostBylineGroupComponent_".concat(V(r,"first"))},c),"BYLINE")}else l&&z(r,l,"after",a.createElement(Z,{post:e,key:"insert_PostBylineGroupComponent_".concat(V(r,l))}),"BYLINE");return r}}function W(e,t,n){return(0,L.tE)(e)?function(r){var o="number"==typeof n.titleIndex,i=Math.max(n.bannerImageIndex||n.subtitleIndex||n.titleIndex||0,n.subtitleIndex||n.titleIndex||0),l=t[i]&&t[i].name;if(l&&0===i&&!o){var c=a.createElement(L.ZP,{post:e,mode:"INLINE",key:"insert_TOC_".concat(V(r,"first"))});z(r,"first","before",a.createElement(U.Pm,{size:"inset",key:"insert_MaxWidth_TableOfContents_".concat(V(r,"first"))},c),"TABLE_OF_CONTENTS")}else l&&z(r,l,"after",a.createElement(L.ZP,{post:e,mode:"INLINE",key:"insert_TableOfContents_".concat(V(r,l))}),"TABLE_OF_CONTENTS");return r}:function(e){return e}}function $(e,t,n){var r=(0,_.ZV)(t),o=r.index,i=r.ordering;return"number"==typeof o&&n?function(n){var r=t[o]&&t[o].name,l=a.createElement(y,{creator:e.creator,postId:e.id,key:"insert_DigestReferredPostBodyCreatorPromo_".concat(V(n,r))}),c=a.createElement(B.bZ,{name:"enable_digest_referred_follow_cta",placeholder:G,key:"insert_WithClientFlag_DigestReferredPostBodyCreatorPromo_".concat(V(n,r))},(function(e){return e?l:null}));return z(n,r,i,c,"DIGEST_REFERRED_CREATOR_PROMO"),n}:function(e){return e}}function j(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e&&e.content&&e.content.bodyModel&&e.content.bodyModel.paragraphs||void 0;if(n){var r=(0,_.LI)(n);return[K(e,n,r),W(e,n,r),$(e,n,t)].reduce((function(e,t){return t(e)}),{})}}var q=(0,i.Ps)(H(),k.C5,I,A.yu,R.H,C.u,P.$,N.z,S.G,O.O)},50493:(e,t,n)=>{"use strict";n.d(t,{tA:()=>w,ZP:()=>_,tE:()=>b});var r=n(28655),o=n.n(r),i=n(71439),a=n(67294),l=n(4743),c=n(51684),s=n(82318),u=n(98024),d=n(28309),f={INLINE:{padding:"8px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},SIDEBAR:{padding:"8px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"".concat(c.ZR,"px"),":hover":{width:"200px"}}};function m(e){var t=(0,d.Iq)();return a.createElement("li",{className:t({overflow:"hidden"})},a.createElement(u.F,{scale:"M",color:"DARKER"},a.createElement(s.Z,{href:"#".concat(e.destination),onClick:function(t){t.preventDefault(),function(e){var t=document.getElementById(e);if(t){var n=t.offsetTop-56;window.scrollTo({left:0,top:n,behavior:"smooth"}),window.history.pushState({},"","#".concat(e))}}(e.destination)},disableSourceParam:!0,noFollow:!0,inline:!0},a.createElement("div",{className:t(f[e.mode]),title:e.text},e.text))))}var p=n(7654),v=n(42933),E=n(86021),h=n(14391),g=n(67122),x=n(25885);function I(){var e=o()(["\n fragment TableOfContents_post on Post {\n id\n collection {\n id\n }\n content(postMeteringOptions: $postMeteringOptions) {\n bodyModel {\n paragraphs {\n id\n name\n type\n text\n }\n }\n }\n }\n"]);return I=function(){return e},e}var w=(0,i.Ps)(I()),b=function(e){return!!(e.collection&&e.collection.id&&["3ec9f38ac0bd","3f6ecf56618","8d6b8a439e32"].includes(e.collection.id))||["8135e6744d59","21f0e9818b3a"].includes(e.id)},y={INLINE:{display:{xs:"block",sm:"block",md:"block",lg:"block",xl:"none"},marginTop:"35px"},SIDEBAR:{display:{xs:"none",sm:"none",md:"none",lg:"none",xl:"block"},margin:"50px 0",fontSize:"16px",":hover":{width:"200px"}}};const _=function(e){var t=e.post,n=e.mode,r=e.heightRef,o=(0,d.Iq)(),i=(0,d.Fg)().backgroundColor,c=function(e){var t=(e||{content:{bodyModel:{paragraphs:null}}}).content.bodyModel.paragraphs;if(!t)throw new Error("Expected post to have paragraphs.");var n=(0,l.LI)(t),r=t.filter((function(e){return function(e){switch(e){case h.NJ.H1:case h.NJ.H2:case h.NJ.H3:return!0}return!1}(e.type)}));return null!==n.titleIndex&&r.splice(0,1),r.length>1?r:[]}(t);if(!b(t)||null==c||!c.length)return null;var s,u,f=a.createElement(v.Z,{overflow:"hidden",marginTop:"16px"},a.createElement("ol",{className:o({marginTop:"5px"})},c.map((function(e){return a.createElement(m,{key:"toc_".concat(e.name),text:e.text||"",destination:e.name||"",mode:n})})))),I=(0,x.n2)(i),w=function(e){return"rgba(".concat(I[0],", ").concat(I[1],", ").concat(I[2],", ").concat(e,")")};switch(n){case"INLINE":var _=a.createElement(E.Lh,{scale:"M",color:"LIGHTER"},a.createElement("div",{className:o({marginRight:"7px"})},"Jump To Section"));return a.createElement("div",{className:o(y[n])},a.createElement(v.Z,{borderBottom:"BASE_LIGHTER",paddingBottom:"10px"},a.createElement(p.$,{titleComponent:_,width:"auto",arrowFill:(0,g.Uy)(.54)},f)));case"SIDEBAR":return a.createElement("div",{className:o(y[n])},a.createElement(E.Lh,{scale:"S",color:"LIGHTER"},a.createElement("div",{className:o({whiteSpace:"nowrap"})},"Table of Contents")),a.createElement(v.Z,{position:"relative"},a.createElement("div",{className:o((function(){return{background:"linear-gradient(".concat(w(1),",\n ").concat(w(.5),",\n ").concat(w(0),")"),width:"100%",height:"".concat(35,"px")}}))}),a.createElement("div",{className:o({overflowY:"scroll",scrollbarWidth:"none","-ms-overflow-style":"none","::-webkit-scrollbar":{display:"none"},height:(s=null!=r&&r.current?r.current.offsetHeight:0,u=Math.max("undefined"!=typeof window?window.innerHeight-s-106-100:150,150),"".concat(u,"px")),paddingBottom:"".concat(35,"px"),position:"relative",top:"-".concat(35,"px")})},f),a.createElement("div",{className:o((function(){return{background:"linear-gradient(".concat(w(0),",\n ").concat(w(.5),",\n ").concat(w(1),")"),position:"relative",width:"100%",height:"".concat(35,"px"),top:"-".concat(35,"px")}}))})));default:return null}}},47713:(e,t,n)=>{"use strict";n.d(t,{o:()=>R});var r=n(63038),o=n.n(r),i=n(67294),a=n(12291),l=n(86753),c=n(9482),s=n(3021),u=n(24087),d=n(62181),f=n(7530),m=n(33914),p=n(62630),v=n(27572),E=n(28309),h=n(14391),g=n(71254),x=n(66443),I=n(17298),w=n(27952),b=function(e,t){return e&&{READING_LIST_QUEUE:"READING_LIST_ARCHIVE",READING_LIST_ARCHIVE:"READING_LIST_NONE"}[t]},y=function(e){return{fill:e.baseColor.fill.lighter}},_=function(e){var t=e.currentReadingListType,n=(0,E.Iq)();return{READING_LIST_QUEUE:i.createElement(x.Z,{className:n(y)}),READING_LIST_ARCHIVE:i.createElement(I.Z,{className:n(y)})}[t]},R=function(e){var t=e.post,n=e.withTooltip,r=void 0===n||n,x=e.susiEntry,I=t.id,R=t.readingList,L=(0,E.Iq)(),N=(0,a.v9)((function(e){return e.config.authDomain})),T=(0,p.Av)(),S=(0,v.pK)(),C=i.useContext(c.Q),A=C.isFirstLoadAndInReadingList,k=C.setIsFirstLoadAndInReadingList,B=i.useState(r),P=o()(B,2),D=P[0],O=P[1],U=i.useCallback((function(e,t){if(R){if(T.event({READING_LIST_QUEUE:"post.addedArchive",READING_LIST_ARCHIVE:"post.removedBookmark"}[R],{postId:I,source:S}),t(b(e,R))(),b(e,R)===h.sx.READING_LIST_NONE)return void k(!1);r&&O(!1)}}),[I,R,A,k,r,S]),M=i.useCallback((function(){r&&O(!0)}),[r]);return i.createElement(u.Z,null,(function(e){return e?R&&i.createElement("div",null,!A||R!==h.sx.READING_LIST_QUEUE&&R!==h.sx.READING_LIST_ARCHIVE?i.createElement(l.Z,{post:t,susiEntry:x}):i.createElement(s.sN,{post:t},(function(t){return i.createElement(m._,{isVisible:D,targetDistance:10,tooltipText:(n=R,{READING_LIST_QUEUE:"Archive Story",READING_LIST_ARCHIVE:"Remove story from reading list"}[n]),onMouseLeave:M},i.createElement(f.rU,{onClick:function(){return U(e,t)}},i.createElement(_,{currentReadingListType:R})));var n}))):i.createElement("div",{className:L(y)},i.createElement(d.R9,{post:t,operation:"register",actionUrl:(0,w.XE)(N,I),susiEntry:x},i.createElement(g.Z,null)))}))}},9482:(e,t,n)=>{"use strict";n.d(t,{Q:()=>o});var r={isFirstLoadAndInReadingList:!0,setIsFirstLoadAndInReadingList:function(){return null}},o=n(67294).createContext(r)},7654:(e,t,n)=>{"use strict";n.d(t,{$:()=>f});var r=n(63038),o=n.n(r),i=n(67294),a=n(7530),l=n(64504),c=n(28309),s=n(73004),u=n(51064),d=300,f=function(e){var t=e.children,n=e.title,r=e.titleComponent,f=e.width,m=e.arrowFill,p=(0,c.Iq)(),v=(0,u.O)(!1),E=o()(v,4),h=E[0],g=E[3],x=function(e){var t=i.useRef(null),n=i.useState("0px"),r=o()(n,2),a=r[0],l=r[1],c=i.useState(!1),s=o()(c,2),u=s[0],f=s[1];return i.useEffect((function(){var n=t.current;n&&(e?(l("".concat(n.getBoundingClientRect().height,"px")),f(!0),setTimeout((function(){l("auto"),f(!1)}),d)):"auto"===a&&(l("".concat(n.getBoundingClientRect().height,"px")),f(!0),setTimeout((function(){return l("0px")}),50),setTimeout((function(){return f(!1)}),d)))}),[e]),{height:a,isAnimating:u,ref:t}}(h),I=x.ref,w=x.height,b=x.isAnimating;return i.createElement(i.Fragment,null,i.createElement("button",{className:p({width:f||"100%",height:"100%",border:"none",textAlign:"left",outline:"none",cursor:"pointer",padding:"0px"}),onClick:g,disabled:b},i.createElement(a.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between"},r||i.createElement(l.X6,{scale:"XS"},n||""),i.createElement(s.Z,{className:p((function(e){return{transition:"".concat(d,"ms transform"),transform:h?"rotate(180deg)":"rotate(0)",fill:m||e.baseColor.fill.normal}}))}))),i.createElement("div",{className:p({transition:"".concat(d,"ms height"),height:w,overflow:!h||b?"hidden":"visible",opacity:h?1:0})},i.createElement("div",{ref:I,className:p({opacity:h?1:0,transition:"".concat(d,"ms opacity"),display:"flex",justifyContent:"space-between",flexDirection:"column",flexFlow:"wrap"})},t)))}},51684:(e,t,n)=>{"use strict";n.d(t,{ZR:()=>m,HX:()=>v,b2:()=>E,hE:()=>h});var r=n(59713),o=n.n(r),i=n(67294),a=n(28859),l=n(43689),c=n(7530),s=n(28309),u=n(27108),d=n(89349),f=n(21146),m=131,p=function(e){return{pointerEvents:e?"auto":"none"}},v=function(e){var t=e.children,n=e.disableTransition,r=e.isFixed,u=e.scrollableRef,f=e.sidebarRef,v=e.testId,E=e.topOffset,h=e.visible,g=e.fixedWidth,x=(0,s.Iq)(),I=function(e){var t,n,r,c=e.isFixed,s=void 0===c||c,u=e.disableTransition,f=void 0!==u&&u,p=e.scrollableRef,v=e.topOffset,E=e.visible,h=e.fixedWidth,g=(r=null===(t=i.useContext(a.u6).watchedBounds.get("header"))||void 0===t||null===(n=t.ref)||void 0===n?void 0:n.current)?r.offsetTop+r.offsetHeight+64:l.Je+54+40;return function(e){var t,n=(0,d.uc)(e,m,e.grid.xStep*e.grid.marginSteps.lg,p&&"current"in p?p.current:null),r=void 0===v?g:v;return t={opacity:E?1:0,pointerEvents:"none",position:s?"fixed":"absolute",willChange:"opacity, transform",width:h?"".concat(h,"px"):"100%",transform:"translateY(".concat(r,"px)"),top:0},o()(t,(0,d.nk)("no-preference"),{transition:f?"opacity 0s":"opacity 200ms"}),o()(t,n,{display:"none"}),t}}({isFixed:r,scrollableRef:u,topOffset:E,visible:h,disableTransition:n,fixedWidth:g});return i.createElement("div",{className:x(I),"data-test-id":v},i.createElement(c.Pm,{size:"outset"},i.createElement(c.xu,{display:"flex",flexDirection:"column",width:"".concat(m,"px"),ref:f},i.createElement("div",{className:x(p(h))},t))))},E=function(e,t,n,r){var o=e.current;if(!o)return!1;var i=r.threshold||10,a=Array.from(t.values()).filter((function(e){var t,r=e.ref,o=e.opts;return n.includes(null!==(t=o.type)&&void 0!==t?t:"")&&!!r.current})).map((function(e){var t=e.ref,n=e.opts,r=n&&n.offset,o=(0,f.L6)(t.current);return(0,f.Dd)(o,r)})),l=(0,f.L6)(o);return!a.some((function(e){return(0,f.kK)(e,l,i)}))},h=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=n?"scroll_throttled":"scroll";return function(){var n=(0,u.jC)(null!=t?t:void 0);return n.on(r,e),n.on("scroll_end",e),n.on("resize_throttled",e),function(){n.off(r,e),n.off("scroll_end",e),n.off("resize_throttled",e)}}}},55077:(e,t,n)=>{"use strict";n.d(t,{$:()=>d,n:()=>f});var r=n(28655),o=n.n(r),i=n(71439),a=n(67294),l=n(51607),c=n(7530),s=n(27572);function u(){var e=o()(["\n fragment ShareButtons_post on Post {\n id\n isLimitedState\n visibility\n ...ShareButton_post\n }\n ","\n"]);return u=function(){return e},e}var d=(0,i.Ps)(u(),l.M);function f(e){var t=e.post,n=e.source,r="UNLISTED"===t.visibility;return a.createElement(s.cW,{source:n},a.createElement(c.xu,{flexGrow:"0",paddingRight:"6px"},!r&&a.createElement(l.T,{socialPlatform:"TWITTER",buttonStyle:t.isLimitedState?"LINK_DISABLED":"LINK",post:t})),a.createElement(c.xu,{flexGrow:"0",paddingRight:"6px"},!r&&a.createElement(l.T,{socialPlatform:"LINKEDIN",buttonStyle:t.isLimitedState?"LINK_DISABLED":"LINK",post:t})),a.createElement(c.xu,{flexGrow:"0",paddingRight:"6px"},!r&&a.createElement(l.T,{socialPlatform:"FACEBOOK",buttonStyle:t.isLimitedState?"LINK_DISABLED":"LINK",post:t})))}}}]); //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/6371.4672dd1f.chunk.js.map