1import{o as te,M as Re,a5 as Le,p as Te,j as e,J as ae,P as le,K as ce,T as K,bs as F,bt as G,c as s,I as se,v as C,_ as Ie,aA as Y,i as l,bk as D,U as de,z as ue,b9 as Me,C as ke,as as Ae,aR as Ee,V as _e,W as Be,by as Ne,w as H,u as De,d as he,G as ze,h as W,H as pe,a as Oe,N as Ue,b as He}from"./app-main.js";import{C as $,H as Fe}from"./app-chunk-BF5L2kK1.js";import{r as c,V as i,b as X,P as re,F as Ge,s as We}from"./app-chunk-CJpFCVSQ.js";import{N as qe}from"./app-chunk-Dhranl14.js";import{t as Ve,v as xe,w as Ke,x as Qe,E as ee,b as Ye,c as me,y as Xe,z as $e}from"./app-chunk-tFtycJnE.js";import{d as Ze,u as ye}from"./app-chunk-_K_x6SQJ.js";import{A as fe,g as Je,b as et}from"./app-chunk-CLi1s4Fv.js";import"./app-chunk-DoVsSYY_.js";import"./app-chunk-bo8vKkox.js";import"./app-chunk-DQvCtitM.js";import"./app-chunk-IYR6zERB.js";import"./app-chunk-B2-Evm7O.js";import"./app-chunk-BA5ZSR8G.js";import"./app-chunk-DqG6YvXa.js";import"./app-chunk-W_RnHzll.js";import"./app-chunk-BuhNRGhG.js";import"./app-chunk-1CWhczJG.js";import"./app-chunk-VnstY1uF.js";import"./app-chunk-DeCHhyfc.js";import{u as tt}from"./app-chunk-CAHdk6Mx.js";import{P as ne}from"./app-chunk-ghwzGXnf.js";import{S as Q}from"./app-chunk-CLNDi0iJ.js";import{u as st,l as rt,U as nt,C as ot}from"./app-chunk-2-6AFzcz.js";import{P as it}from"./app-chunk-DkHgYxfH.js";import"./app-chunk-Br0KKukW.js";import"./app-chunk-IicmEIly.js";import"./app-chunk-BgfvJUsu.js";import"./app-chunk-CgXd_QmP.js";import"./app-chunk-C2lbItnH.js";import"./app-chunk-Cn6_kZkj.js";import"./app-chunk-CsNttX_2.js";const at=1e3,lt=30;function ct(){const t=te("shopware"),n=Re(),a=Le({mutationFn:async({uploadId:r})=>{await t.request({method:"post",url:`/mce/community/profile/image/${r}`});for(let o=0;o<lt;o++){await new Promise(u=>setTimeout(u,at));const{data:d}=await t.request({method:"get",url:`/mce/community/profile/image/${r}`});if(d.state==="completed")return d.result?.url;if(d.state==="failed")throw new Error(d.error??"Image processing failed")}throw new Error("Image processing timed out")},onSuccess:r=>{r&&n.setQueryData(Ve(),o=>o&&{...o,imageUrl:r})}});return{...a,updateAvatar:a.mutateAsync}}const dt=t=>["media-collection-sets","community",t];function ut(t,n=20,a){const r=te("shopware");return tt({queryKey:dt(t),queryFn:async({pageParam:o,signal:d})=>(await r.request({url:`/mce/community/media-collection-sets/${t}`,method:"get",params:{page:o,pageSize:n},signal:d})).data,initialPageParam:1,getNextPageParam:(o,d)=>d.length*n<o.total?d.length+1:void 0,enabled:(a??!0)&&!!t})}const ht=()=>["projects"];function pt(){const t=te("shopware");return Te({queryKey:ht(),queryFn:async({signal:n})=>(await t.request({url:"/mce/projects",method:"get",signal:n})).data,gcTime:1e3*60*10})}function xt(t){const{width:n=30,height:a=30,strokeWidth:r=2,scale:o,...d}=t,u=o===!1?1:o??(ce.getDisplayMode().mode==="kiosk"?1.4:1);return e.jsx(ae,{width:Number(n)*u,height:Number(a)*u,fill:"none",viewBox:"0 0 30 30",...d,children:e.jsx(le,{stroke:t.stroke??t.style?.color,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:Number(r)*u,d:"M15 11.25v5m0 5h.012M13.268 4.865 2.988 22.623c-.571.985-.856 1.477-.814 1.882.037.352.221.672.508.881.329.239.898.239 2.036.239H25.28c1.139 0 1.707 0 2.036-.239a1.25 1.25 0 0 0 .508-.881c.043-.405-.243-.897-.813-1.882L16.731 4.865c-.57-.982-.853-1.473-1.224-1.637a1.25 1.25 0 0 0-1.016 0c-.37.164-.654.655-1.223 1.637"})})}function mt(t){const{width:n=20,height:a=20,strokeWidth:r=2,scale:o,...d}=t,u=o===!1?1:o??(ce.getDisplayMode().mode==="kiosk"?1.4:1);return e.jsx(ae,{width:Number(n)*u,height:Number(a)*u,fill:"none",viewBox:"0 0 20 20",...d,children:e.jsx(le,{stroke:t.stroke??t.style?.color,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:Number(r)*u,d:"M15 8.333V3c0-.467 0-.7-.09-.878a.83.83 0 0 0-.365-.364c-.178-.091-.412-.091-.878-.091H6.333c-.466 0-.7 0-.878.09a.83.83 0 0 0-.364.365C5 2.3 5 2.533 5 3v5.333m10 0H5m10 0V8.5c0 1.4 0 2.1-.273 2.635a2.5 2.5 0 0 1-1.092 1.092C13.1 12.5 12.4 12.5 11 12.5H9c-1.4 0-2.1 0-2.635-.273a2.5 2.5 0 0 1-1.093-1.092C5 10.6 5 9.9 5 8.5v-.167m7.083 4.167v3.75a2.083 2.083 0 1 1-4.166 0V12.5"})})}const ge=({itemWidth:t,separatorWidth:n,aspectRatio:a,horizontalPadding:r="xl",FooterComponent:o,style:d,tileStyle:u})=>{const[p,y]=c.useState(0),x=h=>{const{width:f}=h.nativeEvent.layout;y(f)},w=c.useMemo(()=>
1{if(p===0)return 4;const f=p-(r==="xl"?48:0),g=t+n,m=Math.floor((f+n)/g)+1;return Math.max(1,m)},[p,t,n,r]),v=c.useMemo(()=>Array.from({length:w},(h,f)=>e.jsx(i,{style:{width:t},children:e.jsx(K,{contextId:"skeleton",aspectRatio:a,style:d,tileStyle:u,NonImageTileComponent:e.jsx(F,{width:"100%",height:"100%",children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})}),bypassSlotProps:!0,FooterComponent:o})},`skeleton-${f}`)),[w,t,a,d,u,o]);return e.jsx(i,{onLayout:x,style:s.style("flex-row",r==="xl"&&"px-xl",{gap:n}),children:v})};function yt(t){return t?Y(t).fromNow():""}function ft(t){return t.replies>0&&Y(t.createdAt).isAfter(Y().subtract(1,"day"))?"new":"default"}function gt(t){const n=t.threadPreview?.type==="MEDIA_COLLECTION"?l._({id:"c7lyYG"}):t.threadPreview?.type==="PRODUCT"?l._({id:"ssXMdx"}):"";return t.threadType==="POST"?t.parent?l._({id:"B+Z7b1"}):l._({id:"8Nc0Ty"}):t.parent?l._({id:"NZnMjH"}):t.threadType==="QA"?n?l._({id:"zPXno6",values:{contentLabel:n}}):l._({id:"3T/6by"}):t.threadType==="DISCUSSION"?n?l._({id:"ha0kTl",values:{contentLabel:n}}):l._({id:"8Nc0Ty"}):n?l._({id:"tzzccf",values:{contentLabel:n}}):l._({id:"UluPbN"})}function jt(t,n){return n?l._({id:"ACGZLw"}):t.content??""}function wt(t,n){return n?l._({id:"fjYptd",values:{replyCount:t}}):l._({id:"SQYkn1",values:{replyCount:t}})}function Pt(t,n,a){const r=wt(t,n);return a==="REJECTED"?l._({id:"9wGpw6"}):a==="APPROVED_PRIVATE"?l._({id:"7C6tqK",values:{label:r}}):r}function Z({replyCount:t,hasNewReply:n,replyState:a}){const r=Pt(t,n,a);return n?e.jsxs(i,{style:s`gap-xs flex-row items-center`,children:[e.jsx(i,{style:s`bg-brand-solid h-[12px] w-[12px] rounded-full`}),e.jsx(C.Body,{numberOfLines:1,size:"md",style:s`text-brand-secondary text-center`,children:r})]}):e.jsx(C.Body,{numberOfLines:1,size:"md",style:s`text-secondary`,children:r})}const bt=3,oe="https://s3.eu-central-1.amazonaws.com/assets.misspompadour.de/";function ie({item:t,width:n,onPress:a,onPressAvatar:r,hasNewReply:o,replyCount:d}){const[u,p]=c.useState(1);if(!t)return null;const y=ft(t),x=y==="deleted",w=o??(t.replies>0||y==="new"),v=Math.max(1,bt-u),h=t?.threadPreview?.type==="MEDIA_COLLECTION"?t.threadPreview?.owner:void 0,f=h?.firstName??void 0,g=h?.imageUrl?.replace("https://www.misspompadour.de/",oe)??void 0,m=t.threadPreview?.previewUrl?.replace("https://www.misspompadour.de/",oe)??void 0;return e.jsxs(X,{accessibilityRole:"button",onPress:t&&a?()=>a(t):void 0,disabled:!a,style:s.style("border-tertiary p-xl gap-lg flex-row items-start rounded-lg border-1 bg-white",n!=null&&{width:n},Ie),children:[t?.threadPreview?.type==="MEDIA_COLLECTION"?m?e.jsx(se,{source:{uri:m},style:s`h-[40px] w-[40px] rounded-sm`,accessibilityIgnoresInvertColors:!1,contentFit:"cover"}):e.jsx(fe,{imageUrl:g,firstName:f,onPress:h?.id?()=>r?.(h.id,f):void 0}):m?e.jsx(se,{source:{uri:m},style:s`h-[40px] w-[40px] rounded-sm`,accessibilityIgnoresInvertColors:!1,contentFit:"cover"}):e.jsx(i,{style:s`bg-disabled h-[40px] w-[40px] rounded-sm`}),e.jsxs(i,{style:s`gap-lg min-w-0 flex-1`,children:[e.jsxs(i,{style:s`gap-xs h-[64px]`,children:[e.jsx(C.Body,{bold:!0,size:"lg",style:s`text-primary`,numberOfLines:2,onTextLayout:S=>p(S.nativeEvent.lines.length),children:gt(t)}),e.jsx(C.Body,{size:"lg",style:s.style("text-primary flex-1",x&&"text-quarternary"),numberOfLines:v,children:jt(t,x)})]}),e.jsxs(i,{style:s`gap-md min-w-0 flex-row items-center`,children:[e.jsx(i,{style:s.style("pr-md",(t.replies>0||!!t.messageCount)&&"border-disabled border-r-1"),children:e.jsx(C.Body,{size:"md",style:s`text-secondary`,children:t.createdAt?yt(t.createdAt):""})}),e.jsx(i,{style:s`min-w-0 flex-1`,children:t.threadType==="COMMENTS"?t.replies>0?e.jsx(Z,{replyCount:t.replies,hasNewReply:!0}):t.messageCount?e.jsx(Z,{replyCount:t.messageCount,hasNewReply:!1}):null:e.jsx(Z,{replyCount:w?t.replies:t?.children?.length??0,hasNewReply:w,replyState:t?.state})})]})]})]})}const Ct=t=>{const{variant:n,onPressDiscussion:a}=t,r=c.useCallback(d=>{a?.(d)},[a]);return{getItemProps:c.useCallback(d=>({item:d,onPress:r,width:n==="carousel"?300:void 0}),[r,n])}},vt=[0,1,2];function St(t){const{contextId:n,onPressDiscussion:a,onPressComment:r}=t,{data:o,isLoading:d}=xe({page:1,pageSize:8}),u=c.useMemo(()=>o?.data??[],[o?.data]),p=c.useCallback(x=>{x.threadType==="COMMENTS"&&r?r(x):a?.(x)},[a,r]),{getItemProps:y}=Ct({variant:"carousel",onPressDiscussion:p});if(d)return e.jsx(i,{style:s`px-xl pb-xs flex-row gap-[16px]`,children:vt.map(x=>e.jsx(D,{style:s`h-[128px] w-[300px] rounded-lg`},x))});if(u.length===1){const x=u[0],w=y(x);return e.jsx(i,{style:s`px-xl pb-xs`,children:e.jsx(ie,{...w,width:void 0})})}return e.jsx($,{data:u??[],TileComponent:ie,getItemProps:y,getKey:x=>x.id,horizontalPadding:"xl",separatorWidth:16,maxToRenderPerBatch:4,windowSize:4,initialNumToRender:4,removeClippedSubviews:!0,contentContainerStyle:s`pb-xs`})}const Rt=t=>{const{variant:n,width:a,separatorWidth:r,aspectRatio:o}=t,d=c.useCallback(()=>
1{switch(n){case"product-carousel":return e.jsxs(i,{style:s`pt-xl gap-md`,children:[e.jsx(i,{style:s`h-[48px] overflow-hidden rounded-md`,children:e.jsx(F,{children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})})}),e.jsx(i,{style:s`h-[20px] w-[80%] overflow-hidden rounded-md`,children:e.jsx(F,{children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})})}),e.jsx(i,{style:s`h-[20px]`}),e.jsx(i,{style:s`h-[20px] w-[40%] overflow-hidden rounded-md`,children:e.jsx(F,{children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})})})]});case"mood-board":return e.jsxs(i,{style:s`pt-md gap-xs`,children:[e.jsx(i,{style:s`h-[20px] w-[80%] overflow-hidden rounded-md`,children:e.jsx(F,{children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})})}),e.jsx(i,{style:s`h-[16px] w-[50%] overflow-hidden rounded-md`,children:e.jsx(F,{children:e.jsx(G,{x:"0",y:"0",width:"100%",height:"100%"})})})]});default:return null}},[n]),p=de({variants:{variant:{"product-carousel":{aspectRatio:1,itemWidth:150,separatorWidth:16},"mood-board":{aspectRatio:1,itemWidth:150,separatorWidth:16}}}})({variant:n});return{FooterComponent:d,...p,itemWidth:a??p.itemWidth,separatorWidth:r??p.separatorWidth,aspectRatio:o??p.aspectRatio}};function Lt(t){const{contextId:n,userId:a,isOwner:r=!0,onPressMediaCollectionSet:o,onCreateBoard:d}=t,u=Ke({pageSize:20}),p=ut(a??"",20,!r&&!!a),{data:y,isLoading:x}=r?u:p,w=c.useMemo(()=>{let f=y?.pages.map(g=>g.data).flat()||[];return f.some(g=>g.default===!0)&&(f=f.map(g=>g.default?{...g,title:l._({id:"RchQJq"})}:g).sort((g,m)=>g.default?-1:m.default?1:new Date(m.updatedAt).getTime()-new Date(g.updatedAt).getTime())),f},[y]),{getItemProps:v}=Qe({contextId:n,variant:"carousel",onPressMediaCollectionSet:o,isLoading:x}),h=Rt({variant:"mood-board"});return e.jsxs(e.Fragment,{children:[x?e.jsx(ge,{...h,horizontalPadding:"xl",tileStyle:s`rounded-md`}):e.jsx($,{data:w||[],TileComponent:K,getItemProps:v,getKey:f=>f.id,horizontalPadding:"xl",listEmptyComponent:r?e.jsx(ee,{cta:!0,title:l._({id:"f+azRc"}),subtitle:l._({id:"Z/7zF1"}),buttonTitle:l._({id:"vtQnqR"}),onPress:d}):e.jsx(ee,{cta:!0,title:l._({id:"1aKh7q"}),subtitle:l._({id:"wGnFK+"}),style:s`w-full`}),maxToRenderPerBatch:6,windowSize:6,initialNumToRender:6,removeClippedSubviews:!0}),r&&w&&w.length>0&&!x?e.jsx(i,{style:s`px-xl`,children:e.jsx(ue,{variant:"primary",title:l._({id:"vtQnqR"}),size:"lg",onPress:d})}):null]})}const Tt=t=>{switch(t){case"COMPLETED":return l._({id:"t790Fz"});case"IN_PROGRESS":return l._({id:"byPPNL"})}},It=t=>{const{variant:n,contextId:a,onPressProject:r,aspectRatio:o=1,imageSize:d,isLoading:u}=t,p=c.useMemo(()=>e.jsx(i,{style:s`bg-primary-hover flex-1 items-center justify-center`,children:e.jsx(Me,{width:40,height:40,stroke:ke.gray[200]})}),[]),y=c.useCallback(({item:m})=>{const S=Tt(m.state),A=m.state==="COMPLETED"?"success":"gray";switch(n){case"carousel":case"grid":return e.jsx(i,{style:s`p-md`,children:e.jsx(Ae,{variant:A,size:"sm",type:"pill",title:S,translucent:!0,icon:m.state==="COMPLETED"?e.jsx(Ee,{width:12,height:12}):void 0})});default:return null}},[n]),x=c.useCallback(({item:m})=>{switch(n){case"carousel":case"grid":return e.jsx(i,{style:s`pt-lg flex-row justify-between`,children:e.jsx(C.Body,{bold:!0,size:"lg",style:s`text-primary`,children:m.name})});default:return null}},[n]),w=de({variants:{variant:{carousel:{aspectRatio:1,width:150},grid:{aspectRatio:1}}}}),v=c.useCallback(m=>{r?.(m.id)},[r]),h=c.useCallback((m,S)=>m.url??void 0,[]),f=c.useCallback((m,S)=>Je(m,S),[]);return{getItemProps:c.useCallback(m=>({contextId:a,item:m,getUrl:h,getUri:f,onPress:v,EmptyTileComponent:p,TopLeftComponent:y,FooterComponent:x,imageSize:d,aspectRatio:o,isLoading:u,...w({variant:n})}),[a,h,f,v,p,y,x,d,o,u,w,n])}};function Mt(t){const{contextId:n,onPressProjectDetail:a,onNewProjectCreate:r}=t,{data:o}=pt(),{getItemProps:d}=It({contextId:n,variant:"carousel",onPressProject:a}),u=c.useCallback(()=>{r?.()},[r]);return e.jsxs(i,{style:s`gap-3xl`,children:[e.jsx($,{data:o??[],TileComponent:K,getItemProps:d,getKey:(p,y)=>p.id,horizontalPadding:"xl",listEmptyComponent:e.jsx(ee,{cta:!0,title:l._({id:"le4S3y"}),subtitle:l._({id:"dXBG5P"}),buttonTitle:l._({id:"e09XL8"}),icon:e.jsx(mt,{width:40,height:40}),onPress:u,accessibilityHint:l._({id:"AydKA7"})}),separatorWidth:16,maxToRenderPerBatch:6,windowSize:6,initialNumToRender:6,removeClippedSubviews:!0}),(o?.length??0)>0?e.jsx(i,{style:s`px-xl`,children:e.jsx(ue,{variant:"primary",title:l._({id:"1rArLP"}),size:"lg",onPress:u})}):void 0]})}const kt=c.forwardRef(function(n,a){const{userId:r,currentUserId:o,enableReactions:d,onOpenPictures:u,onPressMediaCollection:p,onCreateMediaCollection:y,onPressMediaCollectionSet:x,onPressDiscussions:w,onPressUserDiscu
1ssion:v,onPressComment:h,onPressUserDiscussions:f,onPressTitle:g,onPressProject:m,onNewProjectCreate:S,onPressProjectDetail:A,onBoardCreated:j,onPressAvatar:M,onPressReactionOverride:E,style:b}=n,L=c.useRef(null),R=r??o,P=!r||r===o,T=Ze(20,!1,R,P),I=ye(R??"",20,!1,!P),_=P?T.data:I.data,z=P?T.isLoading:I.isLoading,q=P?T.refetch:I.refetch,{data:N,isLoading:O}=xe({page:1,pageSize:8},P),B=N?.data??[],k=P&&(O||B.length>0),V=c.useMemo(()=>_?.pages.flatMap(U=>U.data).filter(U=>U.items.length>0)??[],[_]);c.useImperativeHandle(a,()=>({refresh:()=>{q()}}),[q]);const je=c.useCallback((U,ve,Se)=>{p?.(U,ve,Se,{url:"",aspectRatio:1},P?"EDIT":"VIEW")},[P,p]),{renderButton:we,context:Pe}=Ye({numberOfReactions:3,onPressReactionOverride:E}),{getItemProps:be}=me({variant:"carousel",contextId:"community-profile-pictures",onPressMediaCollection:je,onPressDiscussions:w,showAvatar:!1,showReactions:!0,enableReactions:d,isLoading:z,enableState:P,onPressAvatar:M,onPressReactionOverride:E,renderReaction:we}),Ce=c.useCallback(()=>L.current?.handleBoardCreate(),[]);return e.jsxs(i,{style:[s.style(P?"pb-4xl":"pb-7xl","gap-3xl"),b],children:[k?e.jsxs(i,{style:s`gap-3xl`,children:[e.jsx(Q,{title:l._({id:"1ykpzB"}),onPress:f,showChevron:!1}),e.jsx(i,{style:s`mx-[-16px]`,children:e.jsx(St,{contextId:"community-profile-comments",userId:R,onPressDiscussion:v,onPressComment:h})})]}):null,e.jsxs(i,{style:s`gap-3xl`,children:[e.jsx(Q,{title:l._({id:"ySj6fH"}),onPress:V?.length>0?u:void 0,showChevron:!(V?.length>0)}),e.jsx(i,{style:s`mx-[-16px]`,children:z?e.jsx(ge,{itemWidth:270,separatorWidth:16,aspectRatio:1.43,horizontalPadding:"xl"}):e.jsx($,{data:V??[],TileComponent:K,getItemProps:be,getKey:U=>U.id,horizontalPadding:"xl",separatorWidth:16,maxToRenderPerBatch:4,windowSize:4,initialNumToRender:4,removeClippedSubviews:!0,listEmptyComponent:P?e.jsx(ne,{title:l._({id:"c4Y7zr"}),subtitle:l._({id:"OA3Qr9"}),buttonTitle:l._({id:"6CILno"}),onPress:y}):e.jsx(ne,{title:l._({id:"Tqgtd6"}),onPress:y})})}),e.jsx(Pe,{})]}),re.OS!=="web"?e.jsxs(i,{style:s`gap-3xl`,children:[e.jsx(Q,{title:l._({id:"8TveY+"}),onPress:g,showChevron:!1}),e.jsx(i,{style:s.style("-mx-xl gap-3xl"),children:e.jsx(Lt,{contextId:"community-profile-mood-boards",userId:R,isOwner:P,onPressMediaCollectionSet:x,onCreateBoard:P?Ce:void 0})}),P?e.jsx(qe,{ref:L,onBoardCreated:j}):null]}):null,P&&re.OS!=="web"?e.jsxs(i,{style:s`gap-3xl`,children:[e.jsx(Q,{title:l._({id:"634EmK"}),onPress:m,showChevron:!1}),e.jsx(i,{style:s`mx-[-16px]`,children:e.jsx(Mt,{contextId:"community-profile-projects",onNewProjectCreate:S,onPressProjectDetail:A})})]}):null]})});function At(t){const{TextComponent:n=C.Body,style:a,numberOfLines:r=1,children:o,...d}=t,[u,p]=c.useState(!1);return o?e.jsx(X,{accessibilityRole:"button",onPress:()=>p(!u),style:({pressed:y})=>y&&{opacity:.7},children:e.jsx(n,{style:a,ellipsizeMode:"tail",numberOfLines:u?void 0:r,...d,children:o})}):null}function Et(t){const{numPictures:n,numBoards:a,numProjects:r,isLoading:o,showStats:d}=t;return!o&&d?e.jsxs(i,{style:s`py-md w-full flex-row`,children:[e.jsxs(i,{style:s`border-tertiary flex-1 items-center border-r-1`,children:[e.jsx(C.Body,{bold:!0,size:"lg",style:s`text-center`,children:n}),e.jsx(C.Body,{size:"md",style:s`text-secondary text-center`,children:e.jsx(H,{id:"5aF1gy",values:{numPictures:n}})})]}),e.jsxs(i,{style:s`border-tertiary flex-1 items-center border-r-1`,children:[e.jsx(C.Body,{bold:!0,size:"lg",style:s`text-center`,children:a}),e.jsx(C.Body,{size:"md",style:s`text-secondary text-center`,children:e.jsx(H,{id:"wQdZ+d",values:{numBoards:a}})})]}),e.jsxs(i,{style:s`flex-1 items-center`,children:[e.jsx(C.Body,{bold:!0,size:"lg",style:s`text-center`,children:r}),e.jsx(C.Body,{size:"md",style:s`text-secondary text-center`,children:e.jsx(H,{id:"8x9ASg",values:{numProjects:r}})})]})]}):!o&&!d?null:e.jsxs(i,{style:s`py-md w-full flex-row`,children:[e.jsxs(i,{style:s`border-tertiary gap-xxs flex-1 items-center border-r-1`,children:[e.jsx(D,{style:s`h-[20px] w-[28px] rounded`}),e.jsx(D,{style:s`h-[14px] w-[40px] rounded`})]}),e.jsxs(i,{style:s`border-tertiary gap-xxs flex-1 items-center border-r-1`,children:[e.jsx(D,{style:s`h-[20px] w-[28px] rounded`}),e.jsx(D,{style:s`h-[14px] w-[40px] rounded`})]}),e.jsxs(i,{style:s`gap-xxs flex-1 items-center`,children:[e.jsx(D,{style:s`h-[20px] w-[28px] rounded`}),e.jsx(D,{style:s`h-[14px] w-[48px] rounded`})]})]})}const _t=c.forwardRef(function(n,a){const{userId:r,firstName:o,enableDescription:d=!0,isOwner:u=!1,enableAvatarEdit:p=!0,onEditBio:y,onAvatarPress:x,onAvatarUploadError:w,style:v}=n,{data:h,isLoading:f,refetch:g}=Xe({userId:r}),m=st(),{updateAvatar:S}=ct(),A=c.useRef(null),[j,M]=c.useState(!1),[E,b]=c.useState(!1),[L,R]=c.useState(),P=_e(0);c.useEffect(()=>{L&&h?.imageUrl&&R(void 0)},[h?.imageUrl]),c.useImperativeHandle(a,()=>({refresh:g}),[g]);const T=c.useCallback(async()=>
1{if(x){x();return}if(!j)try{const B=await rt({mediaTypes:["images"]});if(!B.canceled&&B.assets?.length>0){const k=B.assets[0];if(!k.width||!k.height){w?.(new Error("Image has no dimensions"));return}A.current?.open(k.uri,k.width,k.height,l._({id:"dTa2T/"}))}}catch(B){w?.(B)}},[x,j,w]),I=c.useCallback(async B=>{R(B.uri),M(!0),P.value=0;try{const{uploadId:k}=await m.mutateAsync({filename:`profile-${Date.now()}.jpg`,filePath:B.uri,contentType:"image/jpeg",onProgress:V=>{P.value=Be(V,{duration:300})}});b(!0),await S({uploadId:k})}catch(k){R(void 0),w?.(k)}finally{M(!1),b(!1)}},[m,S,w,P]),_=c.useCallback(()=>{},[]),z=h?.redactionReason==="MODERATION",q=d&&!!h?.description&&h.description.length>0,N=u&&p,O=48;return e.jsxs(i,{style:[s.style("px-xl gap-xl border-tertiary border-b-1",u?"pb-md pt-3xl":"py-3xl"),v],children:[e.jsxs(i,{style:s`gap-md items-center`,children:[e.jsx(i,{style:[s`items-center justify-center`,{height:O,width:O}],children:f?e.jsx(Ne,{style:{height:O,width:O}}):e.jsxs(i,{children:[e.jsx(fe,{firstName:o??h?.firstName??"",size:O,imageUrl:L??et(h?.imageUrl??"","xs")??h?.imageUrl,isAmbassador:h?.role==="AMBASSADOR",faded:N&&!L,onPress:N&&!j?T:void 0}),N&&j&&e.jsx(i,{style:s`bg-secondary-subtle/70 absolute inset-0 items-center justify-center rounded-full`,pointerEvents:"none",children:e.jsx(nt,{progressValue:P,indeterminate:E,size:24})}),N&&!j&&e.jsx(i,{style:s`bg-primary absolute -top-1 -right-1 h-5 w-5 items-center justify-center rounded-full`,pointerEvents:"none",children:e.jsx(xt,{width:12,height:12,strokeWidth:3,style:s`text-warning-primary`})}),N&&!j&&!(z&&!h?.imageUrl)&&e.jsx(i,{style:s`bg-primary absolute -top-1 -right-1 h-5 w-5 items-center justify-center rounded-full`,pointerEvents:"none",children:e.jsx($e,{width:12,height:12,style:s`text-brand-primary`})})]})}),e.jsx(C.Body,{bold:!0,size:"xl",numberOfLines:1,children:o??h?.firstName??""}),e.jsxs(i,{style:s`gap-md items-center`,children:[f?e.jsx(D,{style:s`h-[22px] w-[200px] rounded`}):q&&z?e.jsx(C.Body,{size:"md",style:s`text-warning text-center leading-[22px]`,children:e.jsx(H,{id:"nHxXPu"})}):q&&h?.description?e.jsx(At,{TextComponent:C.Body,numberOfLines:2,style:s`text-center leading-[22px]`,children:h?.description}):h?.createdAt?e.jsx(C.Body,{size:"md",style:s`text-secondary text-center leading-[22px]`,children:e.jsx(H,{id:"52wGL8",values:{0:Y(h.createdAt).year()}})}):null,u&&y&&h?.description?.length?e.jsx(X,{accessibilityRole:"button",accessibilityLabel:l._({id:"vt9lfn"}),accessibilityHint:l._({id:"U2+h+k"}),onPress:y,children:e.jsx(C.Body,{size:"md",style:s`text-secondary underline`,children:e.jsx(H,{id:"Ui6fCz"})})}):u&&y&&!h?.description?.length?e.jsx(X,{accessibilityRole:"button",accessibilityLabel:l._({id:"t/iC7g"}),accessibilityHint:l._({id:"iquuUY"}),onPress:y,children:e.jsx(C.Body,{size:"md",style:s`text-secondary underline`,children:e.jsx(H,{id:"t/iC7g"})})}):null]})]}),e.jsx(Et,{numPictures:h?.uploads??0,numBoards:h?.mediaCollectionSets??0,numProjects:h?.projects??0,isLoading:!r&&f,showStats:!r}),N&&e.jsx(ot,{ref:A,circular:!0,onConfirm:I,onCancel:_,onError:w})]})});function Bt(t){const{userId:n,enableReactions:a,initialScrollIndex:r,onPressMediaCollection:o,onPressReactionOverride:d}=t,{isAuthenticated:u}=De(),p=30,{data:y,isLoading:x,isFetchingNextPage:w,hasNextPage:v,refetch:h,fetchNextPage:f}=ye(n,p,!1,!0),g=c.useMemo(()=>y?.pages.flatMap(b=>b.data).filter(b=>b.items.length>0)??[],[y]),m=c.useCallback((b,L,R)=>{const P=g.findIndex(T=>T.id===b);if(P>=0){const T=new URL(window.location.href);T.searchParams.set("scrollIndex",String(P)),history.replaceState(null,"",T.search)}o?.(b,L,R,{url:"",aspectRatio:1},"VIEW")},[g,o]),S=c.useCallback((b,L,R)=>{history.pushState({mediaCollectionId:b},"",`?media-collection-id=${b}?discussions`),pe.canGoBackInHistory=!0,b&&he({name:"open-discussion",params:{filters:{mediaCollectionId:b}},title:L,suppressCreate:R})},[]),{getItemProps:A}=me({variant:"grid",gridLayout:"grid",contextId:"community-profile-pictures-grid",onPressMediaCollection:m,showAvatar:!0,showReactions:!0,showBookmark:!1,enableReactions:a,enableBookmark:!1,enableAuth:u,isLoading:x,enableState:!1,onPressReactionOverride:d,onPressDiscussions:S}),j=c.useRef(null),M=c.useRef(!1);c.useEffect(()=>{if(M.current||r===void 0||r<=0||g.length===0)return;M.current=!0;const b=(L=0)=>{const R=j.current;if(!R)return;const T=R.querySelectorAll('[data-testid="media-collection-tile"]')[r];if(!T){L<15&&requestAnimationFrame(()=>b(L+1));return}let I=T.parentElement;for(;I;){const _=getComputedStyle(I).overflowY;if(_==="auto"||_==="scroll")break;I=I.parentElement}if(I){const _=I.getBoundingClientRect(),z=T.getBoundingClientRect();I.scrollTop+=z.top-_.top-_.height/3}};requestAnimationFrame(()=>b())},[r,g]);const E=r!==void 0?Math.max(r+4,6):6;return e.jsx(i,{ref:j,style:s`flex-1`,children:e.jsx(ze,{data:g,layout:"grid",columns:2,initialNumToRender:E,Item
1Component:K,getItemProps:A,getKey:b=>b.id,gridSpacing:W.SMALL,verticalSeparatorHeight:W.LARGE,onRefresh:h,isLoading:x,isLoadingMore:w,hasMore:v,onLoadMore:f,contentContainerStyle:s`pt-lg pb-3xl -mx-xl`})})}function xs(t){const{userId:n,showReactions:a,enableReactions:r,onDismiss:o,onMediaCollectionPress:d,style:u}=t,[p,y]=c.useState(()=>new URLSearchParams(window.location.search).get("makeovers")==="true"),[x]=c.useState(()=>{const j=new URLSearchParams(window.location.search).get("scrollIndex");return j?parseInt(j,10):void 0}),w=()=>{o?.()},{addNotification:v}=Oe(),h=()=>{window.location.href="/account/login"},f=c.useCallback(()=>{a&&!r&&v({id:"login-web-reactions",type:He.OVERLAY,title:l._({id:"8p3YP0"}),message:l._({id:"7p3bYs"}),scheme:Ue.DEFAULT,actions:[{title:l._({id:"6G0FJF"}),primary:!0,onPress:()=>h()},{title:l._({id:"aP3N/0"}),primary:!1}]})},[a,r,v]),g=c.useCallback((j,M,E,b,L)=>{d?.(j,M,E,b)},[d]),m=c.useCallback(()=>{const j=new URL(window.location.href);j.searchParams.set("makeovers","true"),history.replaceState(null,"",j.search),y(!0)},[]),S=c.useCallback((j,M,E)=>{history.pushState({mediaCollectionId:j},"",`?media-collection-id=${j}?discussions`),pe.canGoBackInHistory=!0,j&&he({name:"open-discussion",params:{filters:{mediaCollectionId:j}},title:M,suppressCreate:E})},[]),A=c.useCallback(()=>{if(p){const j=new URL(window.location.href);j.searchParams.delete("makeovers"),j.searchParams.delete("scrollIndex"),history.replaceState(null,"",j.search),y(!1)}else o()},[p,o]);return e.jsxs(it,{onDismiss:o,onBackdropPress:w,style:s`bg-primary`,children:[e.jsx(Fe,{variant:"secondary",enableBackNavigation:!0,onNavigateBack:A,title:p?l._({id:"ySj6fH"}):void 0}),p?e.jsx(Bt,{userId:n,enableReactions:r,initialScrollIndex:x,onPressMediaCollection:g,onPressReactionOverride:a&&!r?f:void 0}):e.jsxs(Ge,{style:s.style("bg-primary w-full flex-1",u),contentContainerStyle:J.scrollC
1ontent,children:[e.jsx(_t,{userId:n,enableAvatarEdit:!1,enableDescription:!0,style:J.headerContainer}),e.jsx(i,{style:J.contentContainer,children:e.jsx(kt,{userId:n,enableReactions:r,onPressMediaCollection:g,onPressReactionOverride:a&&!r?f:void 0,onOpenPictures:m,onPressDiscussions:S})})]})]})}const J=We.create({scrollContent:{gap:W.LARGE},headerContainer:{paddingHorizontal:W.SMALL,paddingTop:W.LARGE,alignItems:"center",borderBottomWidth:0},contentContainer:{paddingHorizontal:W.SMALL}});export{xs as default};
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.