티스토리 수익 글 보기
“use strict”;(self.webpackChunksubstack=self.webpackChunksubstack||[]).push([[“6426″],{22949:function(e,t,n){n.d(t,{A:()=>r});let r={content:”content-t9D9VH”,tooltipOpen:”tooltipOpen-iE0yGo”,tooltipClose:”tooltipClose-ATcY5K”}},82936:function(e,t,n){n.d(t,{Hv:()=>Y,_N:()=>g,b4:()=>m,bd:()=>k,d1:()=>y,hU:()=>x,uL:()=>v});var r=n(4006);if(/^(1889|2101|6578|887|8981)$/.test(n.j))var i=n(63122);if(/^(1889|2101|6578|887|8981)$/.test(n.j))var o=n(40972);var a=n(17402),c=n(46271),l=n(94729),u=n(12501),s=n(68349),d=n(88774),p=n(36372);let h={mutes:[],blocks:[],blocked:[]},f=(0,a.createContext)({result:h,refetch:async()=>null,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1});function m(e){let{user:t,children:n}=e,i=(0,u.st)({pathname:”/api/v1/blocks/ids”,deps:[t],auto:!!t}),o=(0,a.useMemo)(()=>{let{result:e,refetch:t}=i;if(e){let{blocked:n,mutes:r,blocks:i}=e,o=new Set(n),a=new Set(r),c=new Set(i);return{result:e,refetch:t,isBlockingUser:e=>o.has(e),isMutedByUser:e=>a.has(e),isBlockedByUser:e=>c.has(e)}}return{result:h,refetch:t,isBlockingUser:()=>!1,isMutedByUser:()=>!1,isBlockedByUser:()=>!1}},[i.result]);return(0,r.Y)(f.Provider,{value:o,children:n})}function y(){return(0,a.useContext)(f)}function g(e){let{isBlockingUser:t,isBlockedByUser:n}=(0,a.useContext)(f);return e?n(e)?”blocking”:t(e)?”blocked”:null:null}function Y(e){let{isBlockingUser:t,isBlockedByUser:n,isMutedByUser:r}=(0,a.useContext)(f);return e?r(e)?”muting”:n(e)?”blocking”:t(e)?”blocked”:null:null}function k(e,t){let{surface:n,noteId:a,onClick:u}=t,h=(0,c.Jd)(),f=!!(h&&e&&h.id!==e.id),m=y(),g=Y(null==e?void 0:e.id),k=(0,p.d)(),b=async()=>{if(e){try{await (0,l.x6)(“/api/v1/blocks/”.concat(e.id),{method:”POST”,json:{type:”mute”,surface:n,noteId:a}})}catch(e){k.popToast(()=>(0,r.Y)(p.y,{text:(0,s.uX)(e)}));return}m.refetch(),k.popToast(()=>(0,r.Y)(p.y,{text:””.concat(e.name||”User”,” muted”),Icon:i.A})),null==u||u(“mute”)}},v=async()=>{if(e){try{await (0,l.x6)(“/api/v1/blocks/”.concat(e.id),{method:”DELETE”,query:{surface:n,noteId:a}})}catch(e){k.popToast(()=>(0,r.Y)(p.y,{text:(0,s.uX)(e)}));return}m.refetch(),k.popToast(()=>(0,r.Y)(p.y,{text:””.concat(e.name||”User”,” unmuted”),Icon:i.A})),null==u||u(“unmute”)}},x=async()=>{if(e){try{await (0,l.x6)(“/api/v1/blocks/”.concat(e.id),{method:”POST”,json:{type:”block”,surface:n,noteId:a}})}catch(e){k.popToast(()=>(0,r.Y)(p.y,{text:(0,s.uX)(e)}));return}m.refetch(),k.popToast(()=>(0,r.Y)(p.y,{text:””.concat(e.name||”User”,” blocked”),Icon:o.A})),null==u||u(“block”)}},C=async()=>{if(e){try{await (0,l.x6)(“/api/v1/blocks/”.concat(e.id),{method:”DELETE”,query:{surface:n,noteId:a}})}catch(e){k.popToast(()=>(0,r.Y)(p.y,{text:(0,s.uX)(e)}));return}m.refetch(),k.popToast(()=>(0,r.Y)(p.y,{text:””.concat(e.name||”User”,” unblocked”),Icon:o.A})),null==u||u(“unblock”)}},U=[];return f&&(“blocking”!==g&&U.push((0,r.Y)(d.Dr,{leading:(0,r.Y)(i.A,{}),priority:”destructive”,onClick:”muting”===g?v:b,children:”muting”===g?”Unmute”:”Mute”})),U.push((0,r.Y)(d.Dr,{leading:(0,r.Y)(o.A,{}),priority:”destructive”,onClick:”blocking”===g?C:x,children:”blocking”===g?”Unblock”:”Block”}))),U}f.displayName=”UserBlockContext”;let b=(0,a.createContext)(!1);function v(e){let{muteFree:t=!0,children:n}=e;return(0,r.Y)(b.Provider,{value:t,children:n})}function x(){return(0,a.useContext)(b)}b.displayName=”MuteFreeZone”},56720:function(e,t,n){n.d(t,{Sr:()=>p,fN:()=>s,hW:()=>h,k6:()=>d,m_:()=>f});var r=n(4006),i=n(38146),o=n(17402),a=n(10238),c=n(49978),l=n(3011),u=n(22949);let s=500,d=8,p=320,h=8981==n.j?{size:16,color:”var(–color-utility-white)”}:null;function f(e){let{children:t,text:n,title:h,imageUrl:f,leading:m,trailing:y,side:g,disabled:Y,delayEnter:k=s}=e,[b,v]=(0,o.useState)(!1),x=(0,l.a)()?o.Fragment:l.B;return Y?(0,r.Y)(r.FK,{children:t}):(0,r.Y)(x,{children:(0,r.FD)(i.bL,{delayDuration:k,open:b,onOpenChange:v,children:[(0,r.Y)(i.l9,{asChild:!0,children:(0,r.Y)(“span”,{children:t})}),(0,r.Y)(i.ZL,{children:(0,r.Y)(i.UC,{side:g,sideOffset:d,collisionPadding:d,className:u.A.content,style:{maxWidth:p,zIndex:a.QW,”–offset”:””.concat(d,”px”)},children:(0,r.Y)(c.c,{text:n,title:h,imageUrl:f,leading:m,trailing:y})})})]})})}},49978:function(e,t,n){n.d(t,{c:()=>f});var r=n(4006),i=n(17402),o=n(23623),a=n(78649),c=n(72880),l=n(89490),u=n(10238),s=n(76977),d=n(63136),p=n(56720);let h={title:”title-V6r8cy”,imageContainer:”imageContainer-UzIosZ”,endcapContainer:”endcapContainer-E0pGpX”};function f(e){let{leading:t,trailing:n,text:l,title:u,imageUrl:s,children:p}=e,f=l&&!u&&!s;return(0,r.Y)(o.a,{children:(0,r.Y)(a.Q,{children:(0,r.Y)(k,{children:(0,r.FD)(m,{textOnly:!!f,children:[s&&(0,r.Y)(Y,{children:(0,r.Y)(c.o,{src:s,maxWidth:296,useRetinaSizing:!0,imageIsFixedWidth:!0})}),(0,r.FD)(g,{hasTitle:!!u,children:[t&&(0,r.Y)(y,{children:t}),(0,r.FD)(b,{children:[u&&(0,r.Y)(d.EY.B4,{weight:”medium”,color:”primary”,className:h.title,children:u}),(0,r.Y)(d.EY.B4,{color:”primary”,opacity:80,lineHeight:16,children:”string”==typeof l?l.split(“\n”).map((e,t)=>(0,r.FD)(i.Fragment,{children:[t>0&&(0,r.Y)(“br”,{}),e]},t)):l}),p]}),n&&(0,r.Y)(y,{children:n})]})]})})})})}function m(e){let{textOnly:t,children:n}=e;return(0,r.Y)(s.VP,{alignItems:”center”,paddingY:t?6:12,paddingX:t?8:12,gap:8,children:n})}function y(e){let{children:t}=e;return(0,r.Y)(s.fI,{alignItems:”center”,justifyContent:”center”,className:h.endcapContainer,flex:”auto”,gap:8,children:t})}function g(e){let{hasTitle:t,children:n}=e;return(0,r.Y)(s.fI,{alignItems:t?”start”:”center”,gap:8,children:n})}function Y(e){let{children:t}=e;return(0,r.Y)(s.VP,{border:”detail”,radius:”sm”,className:h.imageContainer,overflow:”hidden”,children:t})}function k(e){let{children:t}=e;return(0,r.Y)(l.az,{className:h.content,style:{maxWidth:p.Sr,zIndex:u.QW,”–offset”:””.concat(p.k6,”px”)},radius:”sm”,shadow:”md”,border:”detail”,bg:”primary”,children:t})}let b=(0,l.I4)({display:”flex”,direction:”column”,gap:2})},3011:function(e,t,n){n.d(t,{B:()=>u,a:()=>l});var r=n(4006),i=n(38146),o=n(17402),a=n(56720);let c=(0,o.createContext)(!1);function l(){return(0,o.useContext)(c)}function u(e){let{children:t}=e;return(0,r.Y)(i.Kq,{delayDuration:a.fN,skipDelayDuration:300,children:(0,r.Y)(c.Provider,{value:!0,children:t})})}},94874:function(e,t,n){n.d(t,{F:()=>y,z:()=>g});var r=n(69277),i=n(70408),o=n(4006),a=n(46271),c=n(94729),l=n(56804),u=n(12501),s=n(36372),d=n(70486),p=n(46453),h=n(29611),f=n(15567),m=n(28700);function y(e){let{source:t}=e,n=g({source:t}),u=(0,h.v)(),d=(0,s.d)(),y=(0,a.Jd)(),{onboardingModalRef:Y,requireLogin:k}=(0,p.eE)(),b=async e=>{var t;if(!y)return k?k():Y.current?Y.current.open():u(Error(“Onboarding modal not found”),”Could not start conversation.”),!1;let r=await n.handleStart(e);return r instanceof Error?(r instanceof c.fk&&(null==(t=r.body)?void 0:t.type)===”profile_not_set_up”?d.popToast(()=>(0,o.Y)(s.y,{text:”Please set up your profile before sending a message.”,cta:”Set up profile”,href:(0,m.W$)({utm_source:”substack”,utm_campaign:”chat_dm_button”,redirect:window.location}),localNavigation:!1})):u(r,”Could not start conversation.”),!1):((0,l.z)((0,f.tv)(r.thread.id)),!0)};return(0,i._)((0,r._)({},n),{handleStart:b})}function g(e){let{source:t}=e,n=(0,d.wA)(),o=(0,u.st)({pathname:”/api/v1/messages/dm/start”,method:”POST”}),a=async e=>{let r=await o.refetch({json:{user_ids:e,source:t}});return r instanceof Error||n({type:”conversation-load_more”,payload:{edge:”before”,cursor:null,page:r}}),r};return(0,i._)((0,r._)({},o),{handleStart:a})}},11510:function(e,t,n){n.d(t,{Iu:()=>a,fz:()=>c});var r=n(17402),i=n(17988);n(68349);var o=n(98949);function a(){let e=(0,i.useMediaQuery)({maxWidth:650}),[t,n]=(0,r.useState)(!1);return(0,r.useLayoutEffect)(()=>{n((0,o.Fr)())},[]),t||e}function c(){return(0,i.useMediaQuery)({minWidth:1280})}}}]);