(self.webpackChunklite=self.webpackChunklite||[]).push([[5186],{76730:(e,n,i)=>{"use strict";i.d(n,{K:()=>d});var t=i(22122),l=i(67294),o=i(93310),a=i(87691),d=function(e){return l.createElement(a.F,{scale:"M"},l.createElement(o.r,(0,t.Z)({},e,{linkStyle:"OBVIOUS"})))}},28069:(e,n,i)=>{"use strict";i.d(n,{ly:()=>r,r$:()=>c});var t=i(34699),l=i(67294),o=i(77355),a=function(){return null},d=l.createContext({increment:a,decrement:a,loading:!1}),r=function(e){var n=e.children,i=e.placeholder,a=e.loadingOverride,r=l.useState(0),c=(0,t.Z)(r,2),u=c[0],m=c[1],s=a||u>0,k=l.useMemo((function(){return{increment:function(){return m((function(e){return e+1}))},decrement:function(){return m((function(e){return e-1}))},loading:s}}),[s]);return l.createElement(d.Provider,{value:k},s&&i,l.createElement(o.x,{display:s?"none":void 0},n))},c=function(e){var n=l.useContext(d),i=n.increment,t=n.decrement,o=n.loading,a=l.useRef(!0);return l.useEffect((function(){e?i():a.current||t(),a.current=!1}),[e]),o}},82405:(e,n,i)=>{"use strict";i.d(n,{F:()=>y});var t=i(34699),l=i(21919),o=i(67294),a=i(51615),d=i(77520),r=i(20297),c=i(25550),u=i(25267),m=i(39727),s=i(26350),k=i(50563),v=i(93310),f=i(77355),S=i(47230),p=i(18627),g=i(66411),N=i(92661),F=i(43487),w=i(50458),y=function(e){var n,i=e.buttonSize,w=e.buttonStyleFn,y=e.collection,C=e.post,b=e.simpleLink,_=e.susiEntry,I=void 0===_?"follow_card":_,T=e.preventParentClick,M=e.width,D=(0,F.v9)((function(e){return e.config.authDomain})),h=(0,c.r)().viewerId,x=(0,p.A)(),O=(0,g.pK)(),V=(0,a.TH)(),Z=(0,N.$B)(V.pathname),R=null==Z||null===(n=Z.route)||void 0===n?void 0:n.name,B=(0,m.g)(y),U=B.viewerEdge,W=B.loading,H=function(e,n){var i=(0,l.D)(r.e),a=(0,t.Z)(i,1)[0];return o.useCallback((function(){return a({variables:{id:e.id},optimisticResponse:{followCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!0}}},update:function(i){i.modify({id:"User:".concat(n),fields:{missionControl:(0,k.im)("followedCollections",!0),followingCollectionConnection:(0,k.Hc)(e.id)}})}})}),[e.id])}(y,h),P=function(e,n){var i=(0,l.D)(r.X),a=(0,t.Z)(i,1)[0];return o.useCallback((function(){return a({variables:{id:e.id},optimisticResponse:{unfollowCollection:{__typename:"Collection",id:e.id,name:e.name,viewerEdge:{__typename:"CollectionViewerEdge",id:"collectionId:".concat(e.id,"-viewerId:").concat(n),isFollowing:!1}}},update:function(e){e.modify({id:"User:".concat(n),fields:{missionControl:(0,k.im)("followedCollections",!1)}})}})}),[e.id])}(y,h),L=o.useCallback((function(e){T&&e.preventDefault(),x.event("collection.followed",{collectionId:y.id,followSource:O}),H()}),[y,T,O,x]),z=o.useCallback((function(e){T&&e.preventDefault(),x.event("collection.unfollowed",{collectionId:y.id,followSource:O}),P()}),[T,O,x]),A=!(null==U||!U.isFollowing),K=w?w(!!A):A?"OBVIOUS":"STRONG";return b?o.createElement(v.r,{onClick:A?z:L},o.createElement(f.x,{display:"flex",flexDirection:"row"},A?"Unfollow publication":"Follow publication")):o.createElement(u.I,null,(function(e){return e?o.createElement(S.zx,{size:i,onClick:A?z:L,buttonStyle:K,loading:W,width:M},A?"Following":"Follow"):o.createElement(s.R,{collection:y,buttonStyle:K,isButton:!0,buttonSize:i,operation:"register",actionUrl:E(D,y,C)||"",susiEntry:I,pageSource:(0,d.x)(R,"register"),buttonWidth:M},A?"Following":"Follow")}))},E=function(e,n,i){return n.slug&&(i&&i.id?(0,w.TA)(e,n.slug,i.id):(0,w.Ll)(e,n.slug))}},24857:(e,n,i)=>{"use strict";i.d(n,{Z:()=>o});var t=i(87329),l=i(9419),o={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"WhoToFollowModule_rankedModule"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BaseRankedModule"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"RankedModuleMetadata_metadata"}}]}},{kind:"Field",alias:{kind:"Name",value:"entities"},name:{kind:"Name",value:"items"},selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ModuleItemUser"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"EntityFollowList_user"}}]}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"ModuleItemCollection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"collection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"FragmentSpread",name:{kind:"Name",value:"EntityFollowList_collection"}}]}}]}}]}}]}}].concat((0,t.Z)([{kind:"FragmentDefinition",name:{kind:"Name",value:"RankedModuleMetadata_metadata"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"RankedModuleMetadata"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"type"}},{kind:"Field",name:{kind:"Name",value:"feedId"}},{kind:"Field",name:{kind:"Name",value:"sourceEncoding"}}]}}]),(0,t.Z)(l.S.definitions),(0,t.Z)(l.B.definitions))}},91055:(e,n,i)=>{"use strict";i.d(n,{Q:()=>S});var t=i(64718),l=i(67294),o=i(76730),a=i(28069),d=i(52262),r=i(77355),c=i(20113),u=i(66411),m=i(43487),s=i(50458),k=i(87329),v=i(24857),f={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"WhoToFollowModuleQuery"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"entitiesToFollowHomepage"},arguments:[{kind:"Argument",name:{kind:"Name",value:"options"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"3"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"WhoToFollowModule_rankedModule"}}]}}]}}].concat((0,k.Z)(v.Z.definitions))},S=function(){var e,n,i,k=(0,t.a)(f,{ssr:!1}),v=k.error,S=k.data,p=k.loading,g=(0,m.v9)((function(e){return e.config.authDomain}));if((0,a.r$)(p),v||!S)return null;var N=(null===(e=S.entitiesToFollowHomepage)||void 0===e||null===(n=e.entities)||void 0===n?void 0:n.map((function(e){return"ModuleItemUser"===e.__typename?e.user:"ModuleItemCollection"===e.__typename?e.collection:null})).filter((function(e){return Boolean(e)})))||[];if(!N)return null;var F=null===(i=S.entitiesToFollowHomepage)||void 0===i?void 0:i.metadata;return l.createElement(r.x,null,l.createElement(u.cW,{extendSource:!0,source:{feedId:null==F?void 0:F.feedId,rankedModuleType:(null==F?void 0:F.sourceEncoding)||void 0}},l.createElement(d.T,{entities:N,enableEntityPresentationTracking:!0,susiEntry:"follow_list",enableKilnModulePresentationTracking:!0},l.createElement(r.x,null,l.createElement(c.X6,{scale:"XS"},"Who to follow")))),l.createElement(r.x,{paddingTop:"24px"},l.createElement(o.K,{href:(0,s.wn)(g)},"See more suggestions")))}},39727:(e,n,i)=>{"use strict";i.d(n,{g:()=>a});var t=i(64718),l=i(87329),o={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CollectionViewerEdge"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"collectionId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"collection"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"collectionId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Collection"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"viewerEdge"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Collection_viewerEdge"}}]}}]}}]}}]}}].concat((0,l.Z)([{kind:"FragmentDefinition",name:{kind:"Name",value:"Collection_viewerEdge"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"CollectionViewerEdge"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"canEditOwnPosts"}},{kind:"Field",name:{kind:"Name",value:"canEditPosts"}},{kind:"Field",name:{kind:"Name",value:"isEditor"}},{kind:"Field",name:{kind:"Name",value:"isFollowing"}},{kind:"Field",name:{kind:"Name",value:"isMuting"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToLetters"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToMediumNewsletter"}},{kind:"Field",name:{kind:"Name",value:"isSubscribedToEmails"}},{kind:"Field",name:{kind:"Name",value:"isWriter"}}]}}]))},a=function(e){var n,i,l=(0,t.a)(o,{variables:{collectionId:null!==(n=null==e?void 0:e.id)&&void 0!==n?n:""},ssr:!1,skip:!(null!=e&&e.id)}),a=l.loading,d=l.error,r=l.data;return a?{loading:a}:d?{error:d}:{viewerEdge:null==r||null===(i=r.collection)||void 0===i?void 0:i.viewerEdge}}},25267:(e,n,i)=>{"use strict";i.d(n,{I:()=>l});var t=i(6443),l=function(e){var n=e.children,i=e.nonBlocking,l=(0,t.H)(),o=l.error,a=l.loading,d=l.value;return i&&(o||a)?n(null):a?null:n(d)}}}]); //# sourceMappingURL=https://stats.medium.build/lite/sourcemaps/5186.a11b2bb9.chunk.js.map