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]="ee1a25be-5fd3-5f4b-a10b-734b0aba0ade")}catch(e){}}(); 3import{s as e,t}from"./jsx-runtime-D4ePz0Hl.js";import{t as n}from"./react-BXH-GOAS.js";import{l as r}from"./components-CDo3yjgw.js";import{t as i}from"./classnames-B9Sa-P4w.js";import{n as a}from"./dist-DaRpaGs2.js";import{n as o}from"./QueryClientProvider-Cdu2unP4.js";import{n as s}from"./MemberProfileLink-DowoQ7x7.js";import{r as c,t as l}from"./useCommunityPosts-D77QtiKW.js";import{t as u}from"./useToast-CorSxc9g.js";var d=e(n());function f({title:e,titleId:t,...n},r){return d.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?d.createElement(`title`,{id:t},e):null,d.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99`}))}var p=d.forwardRef(f);function m({title:e,titleId:t,...n},r){return d.createElement(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?d.createElement(`title`,{id:t},e):null,d.createElement(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5`}))}var h=d.forwardRef(m),g=e(i(),1),_=e(t(),1),v=new Map([[`bold`,(0,_.jsx)(`path`,{d:`M224,44H32A12,12,0,0,0,20,56V192a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A12,12,0,0,0,224,44ZM193.15,68,128,127.72,62.85,68ZM44,188V83.28l75.89,69.57a12,12,0,0,0,16.22,0L212,83.28V188Z`})],[`duotone`,(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`path`,{d:`M224,56l-96,88L32,56Z`,opacity:`0.2`}),(0,_.jsx)(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`})]})],[`fill`,(0,_.jsx)(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48Zm-8,144H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`})],[`light`,(0,_.jsx)(`path`,{d:`M224,50H32a6,6,0,0,0-6,6V192a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A6,6,0,0,0,224,50ZM208.58,62,128,135.86,47.42,62ZM216,194H40a2,2,0,0,1-2-2V69.64l86,78.78a6,6,0,0,0,8.1,0L218,69.64V192A2,2,0,0,1,216,194Z`})],[`regular`,(0,_.jsx)(`path`,{d:`M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z`})],[`thin`,(0,_.jsx)(`path`,{d:`M224,52H32a4,4,0,0,0-4,4V192a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A4,4,0,0,0,224,52Zm-10.28,8L128,138.57,42.28,60ZM216,196H40a4,4,0,0,1-4-4V65.09L125.3,147a4,4,0,0,0,5.4,0L220,65.09V192A4,4,0,0,1,216,196Z`})]]);function y({className:e,size:t,weight:n=`regular`,"aria-hidden":r=!0}){return(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 256 256`,className:e,width:t,height:t,fill:`currentColor`,"aria-hidden":r,children:v.get(n)})}var b=new Map([[`bold`,(0,_.jsx)(`path`,{d:`M176,128a12,12,0,0,1-5.17,9.87l-52,36A12,12,0,0,1,100,164V92a12,12,0,0,1,18.83-9.87l52,36A12,12,0,0,1,176,128Zm60,0A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Z`})],[`duotone`,(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`path`,{d:`M128,32a96,96,0,1,0,96,96A96,96,0,0,0,128,32ZM108,168V88l64,40Z`,opacity:`0.2`}),(0,_.jsx)(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48.24-94.78-64-40A8,8,0,0,0,100,88v80a8,8,0,0,0,12.24,6.78l64-40a8,8,0,0,0,0-13.56ZM116,153.57V102.43L156.91,128Z`})]})],[`fill`,(0,_.jsx)(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm40.55,110.58-52,36A8,8,0,0,1,104,164V92a8,8,0,0,1,12.55-6.58l52,36a8,8,0,0,1,0,13.16Z`})],[`light`,(0,_.jsx)(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm47.18-95.09-64-40A6,6,0,0,0,102,88v80a6,6,0,0,0,9.18,5.09l64-40a6,6,0,0,0,0-10.18ZM114,157.17V98.83L160.68,128Z`})],[`regular`,(0,_.jsx)(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm48.24-94.78-64-40A8,8,0,0,0,100,88v80a8,8,0,0,0,12.24,6.78l64-40a8,8,0,0,0,0-13.56ZM116,153.57V102.43L156.91,128Z`})],[`thin`,(0,_.jsx)(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm46.12-95.39-64-40A4,4,0,0,0,104,88v80a4,4,0,0,0,2.06,3.5,4.06,4.06,0,0,0,1.94.5,4,4,0,0,0,2.12-.61l64-40a4,4,0,0,0,0-6.78ZM112,160.78V95.22L164.45,128Z`})]]);function x({className:e,size:t,weight:n=`regular`,"aria-hidden":r=!0}){return(0,_.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 256 256`,className:e,width:t,height:t,fill:`currentColor`,"aria-hidden":r,children:b.get(n)})}var S=e=>e===`newsletters`?y:e===`podcasts`?x:h,C=({slug:e,emoji:t,className:n})=>
3t?(0,_.jsx)(`svg`,{viewBox:`0 0 100 100`,className:n,"aria-hidden":`true`,children:(0,_.jsx)(`text`,{x:`50`,y:`.9em`,fontSize:`90`,textAnchor:`middle`,children:t})}):(0,_.jsx)(S(e),{className:n,"aria-hidden":`true`}),w=e=>{let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(Number.isNaN(t))return``;if(t<60)return`now`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`},T=({post:e,className:t})=>{let n=e.title?.trim()??``,r=e.created_at_label??w(e.created_at),i=e.author.name??``;return(0,_.jsxs)(`div`,{className:(0,g.default)(`rounded-2xl border border-black/10 p-4`,t),children:[(0,_.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0 text-[15px] leading-5 tracking-[-0.15px] text-black/50`,children:[e.author.avatar_url?(0,_.jsx)(`img`,{src:e.author.avatar_url,alt:i,className:`size-8 shrink-0 rounded-full object-cover`}):(0,_.jsx)(`div`,{className:`size-8 shrink-0 rounded-full bg-gray-200`}),(0,_.jsx)(`span`,{className:`font-semibold text-black truncate`,children:i}),r&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`span`,{children:`â¢`}),(0,_.jsx)(`span`,{className:`whitespace-nowrap`,children:r})]}),e.space?.name&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(`span`,{children:`â¢`}),(0,_.jsx)(C,{slug:e.space.slug,emoji:e.space.emoji,className:`size-4 shrink-0`}),(0,_.jsx)(`span`,{className:`truncate`,children:e.space.name})]})]}),n&&(0,_.jsx)(`p`,{className:`mt-3 text-xl font-semibold leading-6 tracking-[-0.4px] text-black line-clamp-3`,children:n})]})},E=`/community/member_posts`,D={all:[`community-member-posts`],feed:e=>[...D.all,e]},O=(e,t)=>t?[t,...e]:e,k=async(e,t)=>{let n=new URLSearchParams({id:e});t&&n.set(`cursor`,t);let r=await fetch(`${E}?${n}`);if(!r.ok)throw Error(`Failed to fetch community member posts`);let i=await r.json();return{items:O(i.posts,i.pinned_post),meta:i.meta}},A=({memberId:e,initialPosts:t,initialPinnedPost:n,initialMeta:r})=>{let{items:i,...a}=s({queryKey:D.feed(e),fetchPage:t=>k(e,t),initialItems:t&&O(t,n),initialMeta:r});return{posts:i,...a}},j=(0,d.createContext)(null),M=(e,{queryKey:t,onSubmissionComplete:n})=>{let i=r({key:e}),s=o(),c=(0,d.useRef)(i.state),l=i.state!==`idle`;return(0,d.useEffect)(()=>{let r=c.current!==`idle`;if(c.current=i.state,r&&i.state===`idle`&&i.data){if(s.invalidateQueries({queryKey:t}),i.data.toast){let{status:t,title:n,message:r}=i.data.toast,o=n?`${n}\n${r}`:r;t===u.ERROR?a.error(o,{id:e}):a.success(o,{id:e})}n?.()}},[i.state,i.data,s,e,t,n]),{fetcher:i,isProcessing:l}},N=`/pin_community_post_to_profile`,P=`pin-community-post-to-profile`,F=[...l.all],I=()=>{let e=o(),{applyOptimisticPatch:t,clearOptimisticPatch:n}=c(),r=(0,d.useRef)(`idle`),i=(0,d.useRef)(null),{fetcher:a}=M(P,{queryKey:F,onSubmissionComplete:(0,d.useCallback)(()=>{let t=i.current;t&&e.invalidateQueries({queryKey:D.all}).finally(()=>{i.current===t&&(n(t),i.current=null)})},[e,n])});return(0,d.useEffect)(()=>{let e=r.current;if(r.current=a.state,e===`idle`&&a.state!==`idle`&&a.formData){let e=a.formData.get(`post_id`),n=a.formData.get(`action_type`);typeof e==`string`&&(i.current=e,t(e,{is_profile_pinned:n===`pin`}))}},[a.state,a.formData,t]),(0,d.useEffect)(()=>{if(a.state!==`idle`||!a.data||!i.current||a.data.toast?.status!==u.ERROR)return;let e=i.current;i.current=null,n(e)},[a.state,a.data,n]),{fetcher:a}};export{j as a,T as c,p as d,M as i,C as l,N as n,D as o,I as r,A as s,P as t,h as u}; 4//# sourceMappingURL=useProfilePinFetcher-BqKg8ZLH.js.map 5//# debugId=ee1a25be-5fd3-5f4b-a10b-734b0aba0ade
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.