Anvil/assets/Profile-BEei22Yb.js
André Jaenisch e545bd2756
Updates
2024-07-22 13:59:31 +02:00

1 line
14 KiB
JavaScript

import{S as Xe,i as Ze,s as et,c as $e,a as Ee,m as ye,b as L,j as Oe,t as T,d as Ce,e as tt,k as Pe,n as He}from"./index-7XOhh2kt.js";import{e as c,a as E,t as te,c as m,b as g,h as r,d as y,f as le,j as x,k as S,l as s,n as oe,H as lt,q as st,i as ne,r as Be,p as Re}from"./lifecycle-Dpe71s4v.js";import{e as Ae}from"./each-iA4Nym3y.js";import{$ as at}from"./runtime-BQCs4yl7.js";import{h as rt}from"./ZoomOut24-Cmc7Jjj8.js";import{A as nt}from"./Avatar-B31sakrc.js";import{B as ot}from"./BlockOrReport-gP_ovLJD.js";import{C as it}from"./Created-BukJ6R8Y.js";import{D as ft}from"./DisplayName-CEs0V3-x.js";import{H as pt}from"./History-B1FrvVvb.js";import{P as We}from"./Project-E8T-J5XL.js";function Ye(o,t,n){const e=o.slice();return e[5]=t[n],e}function qe(o,t,n){const e=o.slice();return e[5]=t[n],e}function ut(o){let t,n=o[2]("page.profile.projects.empty")+"",e,i,l,d=o[2]("page.profile.projects.add_or_import",{values:{addElementOpen:'<a class="anchor" href="#">',addElementClose:"</a>",importElementOpen:`<a class="anchor" href="/projects/import/" data-sb-kind=${o[1]}>`,importElementClose:"</a>"}})+"";return{c(){t=c("p"),e=te(n),i=E(),l=new lt(!1),this.h()},l(_){t=m(_,"P",{class:!0});var $=g(t);e=le($,n),i=y($),l=st($,!1),$.forEach(r),this.h()},h(){l.a=null,x(t,"class","px-4")},m(_,$){S(_,t,$),s(t,e),s(t,i),l.m(d,t)},p(_,$){$&4&&n!==(n=_[2]("page.profile.projects.empty")+"")&&oe(e,n),$&6&&d!==(d=_[2]("page.profile.projects.add_or_import",{values:{addElementOpen:'<a class="anchor" href="#">',addElementClose:"</a>",importElementOpen:`<a class="anchor" href="/projects/import/" data-sb-kind=${_[1]}>`,importElementClose:"</a>"}})+"")&&l.p(d)},i:He,o:He,d(_){_&&r(t)}}}function ct(o){var G;let t,n,e,i=o[2]("page.profile.repositories.heading")+"",l,d,_,$,w,V,B="The following is DEBUG information and will be removed in the near future.",O,A,I=Ae(o[0].user.followingsMap),b=[];for(let a=0;a<I.length;a+=1)b[a]=Ge(qe(o,I,a));const Y=a=>L(b[a],1,1,()=>{b[a]=null});let D=Ae(o[0].user.followingsMap),h=[];for(let a=0;a<D.length;a+=1)h[a]=Ke(Ye(o,D,a));const _e=a=>L(h[a],1,1,()=>{h[a]=null});let j=((G=o[0])==null?void 0:G.user)&&Qe(o);return{c(){t=c("ul");for(let a=0;a<b.length;a+=1)b[a].c();n=E(),e=c("h2"),l=te(i),d=E(),_=c("section");for(let a=0;a<h.length;a+=1)h[a].c();$=E(),w=c("div"),V=c("p"),V.textContent=B,O=E(),j&&j.c(),this.h()},l(a){t=m(a,"UL",{});var p=g(t);for(let J=0;J<b.length;J+=1)b[J].l(p);p.forEach(r),n=y(a),e=m(a,"H2",{class:!0});var C=g(e);l=le(C,i),C.forEach(r),d=y(a),_=m(a,"SECTION",{class:!0});var u=g(_);for(let J=0;J<h.length;J+=1)h[J].l(u);u.forEach(r),$=y(a),w=m(a,"DIV",{});var N=g(w);V=m(N,"P",{"data-svelte-h":!0}),ne(V)!=="svelte-qlo5bs"&&(V.textContent=B),O=y(N),j&&j.l(N),N.forEach(r),this.h()},h(){x(e,"class","h2 font-semibold leading-tight text-base px-4"),x(_,"class","flex flex-col gap-4")},m(a,p){S(a,t,p);for(let C=0;C<b.length;C+=1)b[C]&&b[C].m(t,null);S(a,n,p),S(a,e,p),s(e,l),S(a,d,p),S(a,_,p);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(_,null);S(a,$,p),S(a,w,p),s(w,V),s(w,O),j&&j.m(w,null),A=!0},p(a,p){var C;if(p&25){I=Ae(a[0].user.followingsMap);let u;for(u=0;u<I.length;u+=1){const N=qe(a,I,u);b[u]?(b[u].p(N,p),T(b[u],1)):(b[u]=Ge(N),b[u].c(),T(b[u],1),b[u].m(t,null))}for(Pe(),u=I.length;u<b.length;u+=1)Y(u);Oe()}if((!A||p&4)&&i!==(i=a[2]("page.profile.repositories.heading")+"")&&oe(l,i),p&9){D=Ae(a[0].user.followingsMap);let u;for(u=0;u<D.length;u+=1){const N=Ye(a,D,u);h[u]?(h[u].p(N,p),T(h[u],1)):(h[u]=Ke(N),h[u].c(),T(h[u],1),h[u].m(_,null))}for(Pe(),u=D.length;u<h.length;u+=1)_e(u);Oe()}(C=a[0])!=null&&C.user?j?j.p(a,p):(j=Qe(a),j.c(),j.m(w,null)):j&&(j.d(1),j=null)},i(a){if(!A){for(let p=0;p<I.length;p+=1)T(b[p]);for(let p=0;p<D.length;p+=1)T(h[p]);A=!0}},o(a){b=b.filter(Boolean);for(let p=0;p<b.length;p+=1)L(b[p]);h=h.filter(Boolean);for(let p=0;p<h.length;p+=1)L(h[p]);A=!1},d(a){a&&(r(t),r(n),r(e),r(d),r(_),r($),r(w)),Be(b,a),Be(h,a),j&&j.d()}}}function Fe(o){let t,n,e,i;return n=new We({props:{collaborators:o[4]([o[0].user.person],o[0].user.collaboratorsMap,o[5].id),i18n:o[3],project:o[5]}}),{c(){t=c("li"),$e(n.$$.fragment),e=E()},l(l){t=m(l,"LI",{});var d=g(t);Ee(n.$$.fragment,d),e=y(d),d.forEach(r)},m(l,d){S(l,t,d),ye(n,t,null),s(t,e),i=!0},p(l,d){const _={};d&1&&(_.collaborators=l[4]([l[0].user.person],l[0].user.collaboratorsMap,l[5].id)),d&1&&(_.project=l[5]),n.$set(_)},i(l){i||(T(n.$$.fragment,l),i=!0)},o(l){L(n.$$.fragment,l),i=!1},d(l){l&&r(t),Ce(n)}}}function Ge(o){let t,n,e=o[5].type==="Project"&&Fe(o);return{c(){e&&e.c(),t=Re()},l(i){e&&e.l(i),t=Re()},m(i,l){e&&e.m(i,l),S(i,t,l),n=!0},p(i,l){i[5].type==="Project"?e?(e.p(i,l),l&1&&T(e,1)):(e=Fe(i),e.c(),T(e,1),e.m(t.parentNode,t)):e&&(Pe(),L(e,1,1,()=>{e=null}),Oe())},i(i){n||(T(e),n=!0)},o(i){L(e),n=!1},d(i){i&&r(t),e&&e.d(i)}}}function ze(o){let t,n,e,i;return n=new We({props:{collaborators:[],i18n:o[3],project:o[5]}}),{c(){t=c("div"),$e(n.$$.fragment),e=E(),this.h()},l(l){t=m(l,"DIV",{class:!0});var d=g(t);Ee(n.$$.fragment,d),e=y(d),d.forEach(r),this.h()},h(){x(t,"class","border border-surface-100")},m(l,d){S(l,t,d),ye(n,t,null),s(t,e),i=!0},p(l,d){const _={};d&1&&(_.project=l[5]),n.$set(_)},i(l){i||(T(n.$$.fragment,l),i=!0)},o(l){L(n.$$.fragment,l),i=!1},d(l){l&&r(t),Ce(n)}}}function Ke(o){let t,n,e=o[5].type==="Repository"&&ze(o);return{c(){e&&e.c(),t=Re()},l(i){e&&e.l(i),t=Re()},m(i,l){e&&e.m(i,l),S(i,t,l),n=!0},p(i,l){i[5].type==="Repository"?e?(e.p(i,l),l&1&&T(e,1)):(e=ze(i),e.c(),T(e,1),e.m(t.parentNode,t)):e&&(Pe(),L(e,1,1,()=>{e=null}),Oe())},i(i){n||(T(e),n=!0)},o(i){L(e),n=!1},d(i){i&&r(t),e&&e.d(i)}}}function Qe(o){let t,n,e="Person",i,l,d=JSON.stringify(o[0].user.person,null,2)+"",_,$,w,V,B="Followings",O,A,I=JSON.stringify(o[0].user.followings,null,2)+"",b,Y,D,h,_e="Followings mapped",j,G,a="These are the contents of the items in the previous dump.",p,C,u=JSON.stringify(o[0].user.followingsMap,null,2)+"",N,J,R,K,he="Collaborators mapped",ve,ie,q="These are the contents of the items in the previous dump.",H,pe,Z=JSON.stringify(o[0].user.collaboratorsMap,null,2)+"",se,Q,U,ue,ae="Commits",ke,ce,Ie="These are the contents of the items in the previous dump.",we,ge,f=JSON.stringify(o[0].user.commits,null,2)+"",k,z,P,F,re="Commits mapped",W,ee,fe="These are the contents of the items in the previous dump.",me,X,be=JSON.stringify(o[0].user.commitsMap,null,2)+"",de;return{c(){t=c("details"),n=c("summary"),n.textContent=e,i=E(),l=c("pre"),_=te(d),$=E(),w=c("details"),V=c("summary"),V.textContent=B,O=E(),A=c("pre"),b=te(I),Y=E(),D=c("details"),h=c("summary"),h.textContent=_e,j=E(),G=c("p"),G.textContent=a,p=E(),C=c("pre"),N=te(u),J=E(),R=c("details"),K=c("summary"),K.textContent=he,ve=E(),ie=c("p"),ie.textContent=q,H=E(),pe=c("pre"),se=te(Z),Q=E(),U=c("details"),ue=c("summary"),ue.textContent=ae,ke=E(),ce=c("p"),ce.textContent=Ie,we=E(),ge=c("pre"),k=te(f),z=E(),P=c("details"),F=c("summary"),F.textContent=re,W=E(),ee=c("p"),ee.textContent=fe,me=E(),X=c("pre"),de=te(be)},l(v){t=m(v,"DETAILS",{});var M=g(t);n=m(M,"SUMMARY",{"data-svelte-h":!0}),ne(n)!=="svelte-124pn6b"&&(n.textContent=e),i=y(M),l=m(M,"PRE",{});var De=g(l);_=le(De,d),De.forEach(r),M.forEach(r),$=y(v),w=m(v,"DETAILS",{});var Te=g(w);V=m(Te,"SUMMARY",{"data-svelte-h":!0}),ne(V)!=="svelte-akj1jk"&&(V.textContent=B),O=y(Te),A=m(Te,"PRE",{});var Ve=g(A);b=le(Ve,I),Ve.forEach(r),Te.forEach(r),Y=y(v),D=m(v,"DETAILS",{});var je=g(D);h=m(je,"SUMMARY",{"data-svelte-h":!0}),ne(h)!=="svelte-nlexcn"&&(h.textContent=_e),j=y(je),G=m(je,"P",{"data-svelte-h":!0}),ne(G)!=="svelte-1js943j"&&(G.textContent=a),p=y(je),C=m(je,"PRE",{});var Je=g(C);N=le(Je,u),Je.forEach(r),je.forEach(r),J=y(v),R=m(v,"DETAILS",{});var Me=g(R);K=m(Me,"SUMMARY",{"data-svelte-h":!0}),ne(K)!=="svelte-xs39bg"&&(K.textContent=he),ve=y(Me),ie=m(Me,"P",{"data-svelte-h":!0}),ne(ie)!=="svelte-1js943j"&&(ie.textContent=q),H=y(Me),pe=m(Me,"PRE",{});var xe=g(pe);se=le(xe,Z),xe.forEach(r),Me.forEach(r),Q=y(v),U=m(v,"DETAILS",{});var Se=g(U);ue=m(Se,"SUMMARY",{"data-svelte-h":!0}),ne(ue)!=="svelte-1k4vbf2"&&(ue.textContent=ae),ke=y(Se),ce=m(Se,"P",{"data-svelte-h":!0}),ne(ce)!=="svelte-1js943j"&&(ce.textContent=Ie),we=y(Se),ge=m(Se,"PRE",{});var Ue=g(ge);k=le(Ue,f),Ue.forEach(r),Se.forEach(r),z=y(v),P=m(v,"DETAILS",{});var Ne=g(P);F=m(Ne,"SUMMARY",{"data-svelte-h":!0}),ne(F)!=="svelte-15ihrx3"&&(F.textContent=re),W=y(Ne),ee=m(Ne,"P",{"data-svelte-h":!0}),ne(ee)!=="svelte-1js943j"&&(ee.textContent=fe),me=y(Ne),X=m(Ne,"PRE",{});var Le=g(X);de=le(Le,be),Le.forEach(r),Ne.forEach(r)},m(v,M){S(v,t,M),s(t,n),s(t,i),s(t,l),s(l,_),S(v,$,M),S(v,w,M),s(w,V),s(w,O),s(w,A),s(A,b),S(v,Y,M),S(v,D,M),s(D,h),s(D,j),s(D,G),s(D,p),s(D,C),s(C,N),S(v,J,M),S(v,R,M),s(R,K),s(R,ve),s(R,ie),s(R,H),s(R,pe),s(pe,se),S(v,Q,M),S(v,U,M),s(U,ue),s(U,ke),s(U,ce),s(U,we),s(U,ge),s(ge,k),S(v,z,M),S(v,P,M),s(P,F),s(P,W),s(P,ee),s(P,me),s(P,X),s(X,de)},p(v,M){M&1&&d!==(d=JSON.stringify(v[0].user.person,null,2)+"")&&oe(_,d),M&1&&I!==(I=JSON.stringify(v[0].user.followings,null,2)+"")&&oe(b,I),M&1&&u!==(u=JSON.stringify(v[0].user.followingsMap,null,2)+"")&&oe(N,u),M&1&&Z!==(Z=JSON.stringify(v[0].user.collaboratorsMap,null,2)+"")&&oe(se,Z),M&1&&f!==(f=JSON.stringify(v[0].user.commits,null,2)+"")&&oe(k,f),M&1&&be!==(be=JSON.stringify(v[0].user.commitsMap,null,2)+"")&&oe(de,be)},d(v){v&&(r(t),r($),r(w),r(Y),r(D),r(J),r(R),r(Q),r(U),r(z),r(P))}}}function mt(o){var ce,Ie,we,ge;let t,n,e,i,l,d,_,$,w,V,B,O,A,I,b,Y,D=o[0].user.username+"",h,_e,j=o[0].user.instance+"",G,a,p,C,u,N,J,R,K,he=o[2]("page.profile.projects.heading")+"",ve,ie,q,H,pe,Z,se,Q,U;e=new nt({props:{avatar:o[0].user.avatar,displayName:o[0].user.display_name}}),_=new it({props:{created_at:o[0].user.created_at,locale:o[0].locale}}),w=new ot({}),I=new ft({props:{displayName:o[0].user.display_name,i18n:o[3],pronoun:o[0].user.pronoun}}),C=new rt({props:{fill:"currentColor"}});const ue=[ct,ut],ae=[];function ke(f,k){var z,P;return(P=(z=f[0])==null?void 0:z.user)!=null&&P.followingsMap?0:1}return q=ke(o),H=ae[q]=ue[q](o),Q=new pt({props:{commitsMap:((Ie=(ce=o[0])==null?void 0:ce.user)==null?void 0:Ie.commitsMap)||[],data:o[0],followingsMap:((ge=(we=o[0])==null?void 0:we.user)==null?void 0:ge.followingsMap)||[]}}),{c(){t=c("section"),n=c("div"),$e(e.$$.fragment),i=E(),l=c("div"),d=c("div"),$e(_.$$.fragment),$=E(),$e(w.$$.fragment),V=E(),B=c("div"),O=c("div"),A=c("div"),$e(I.$$.fragment),b=E(),Y=c("span"),h=te(D),_e=te("@"),G=te(j),a=E(),p=c("button"),$e(C.$$.fragment),u=E(),N=c("section"),J=c("div"),R=c("div"),K=c("h2"),ve=te(he),ie=E(),H.c(),pe=E(),Z=c("div"),se=c("div"),$e(Q.$$.fragment),this.h()},l(f){t=m(f,"SECTION",{class:!0});var k=g(t);n=m(k,"DIV",{});var z=g(n);Ee(e.$$.fragment,z),z.forEach(r),i=y(k),l=m(k,"DIV",{class:!0});var P=g(l);d=m(P,"DIV",{class:!0});var F=g(d);Ee(_.$$.fragment,F),$=y(F),Ee(w.$$.fragment,F),F.forEach(r),V=y(P),B=m(P,"DIV",{class:!0});var re=g(B);O=m(re,"DIV",{class:!0});var W=g(O);A=m(W,"DIV",{class:!0});var ee=g(A);Ee(I.$$.fragment,ee),ee.forEach(r),b=y(W),Y=m(W,"SPAN",{class:!0});var fe=g(Y);h=le(fe,D),_e=le(fe,"@"),G=le(fe,j),fe.forEach(r),W.forEach(r),a=y(re),p=m(re,"BUTTON",{type:!0,class:!0});var me=g(p);Ee(C.$$.fragment,me),me.forEach(r),re.forEach(r),P.forEach(r),k.forEach(r),u=y(f),N=m(f,"SECTION",{class:!0});var X=g(N);J=m(X,"DIV",{class:!0});var be=g(J);R=m(be,"DIV",{class:!0});var de=g(R);K=m(de,"H2",{class:!0});var v=g(K);ve=le(v,he),v.forEach(r),ie=y(de),H.l(de),de.forEach(r),be.forEach(r),pe=y(X),Z=m(X,"DIV",{class:!0});var M=g(Z);se=m(M,"DIV",{class:!0});var De=g(se);Ee(Q.$$.fragment,De),De.forEach(r),M.forEach(r),X.forEach(r),this.h()},h(){x(d,"class","self-end"),x(A,"class","flex items-end"),x(Y,"class","leading-tight"),x(O,"class","flex flex-col flex-1 gap-2"),x(p,"type","button"),x(p,"class","btn-icon border rounded-none self-start"),x(B,"class","flex mt-2"),x(l,"class","flex flex-1 flex-col ps-8"),x(t,"class","w-full mx-auto flex px-8 pt-8"),x(K,"class","h2 font-semibold leading-tight text-base px-4"),x(R,"class","space-y-6"),x(J,"class","flex flex-1 flex-col px-4"),x(se,"class","space-y-6"),x(Z,"class","flex flex-1 flex-col px-4"),x(N,"class","w-full h-full mx-auto flex flex-wrap mt-8 px-8")},m(f,k){S(f,t,k),s(t,n),ye(e,n,null),s(t,i),s(t,l),s(l,d),ye(_,d,null),s(d,$),ye(w,d,null),s(l,V),s(l,B),s(B,O),s(O,A),ye(I,A,null),s(O,b),s(O,Y),s(Y,h),s(Y,_e),s(Y,G),s(B,a),s(B,p),ye(C,p,null),S(f,u,k),S(f,N,k),s(N,J),s(J,R),s(R,K),s(K,ve),s(R,ie),ae[q].m(R,null),s(N,pe),s(N,Z),s(Z,se),ye(Q,se,null),U=!0},p(f,[k]){var ee,fe,me,X;const z={};k&1&&(z.avatar=f[0].user.avatar),k&1&&(z.displayName=f[0].user.display_name),e.$set(z);const P={};k&1&&(P.created_at=f[0].user.created_at),k&1&&(P.locale=f[0].locale),_.$set(P);const F={};k&1&&(F.displayName=f[0].user.display_name),k&1&&(F.pronoun=f[0].user.pronoun),I.$set(F),(!U||k&1)&&D!==(D=f[0].user.username+"")&&oe(h,D),(!U||k&1)&&j!==(j=f[0].user.instance+"")&&oe(G,j),(!U||k&4)&&he!==(he=f[2]("page.profile.projects.heading")+"")&&oe(ve,he);let re=q;q=ke(f),q===re?ae[q].p(f,k):(Pe(),L(ae[re],1,1,()=>{ae[re]=null}),Oe(),H=ae[q],H?H.p(f,k):(H=ae[q]=ue[q](f),H.c()),T(H,1),H.m(R,null));const W={};k&1&&(W.commitsMap=((fe=(ee=f[0])==null?void 0:ee.user)==null?void 0:fe.commitsMap)||[]),k&1&&(W.data=f[0]),k&1&&(W.followingsMap=((X=(me=f[0])==null?void 0:me.user)==null?void 0:X.followingsMap)||[]),Q.$set(W)},i(f){U||(T(e.$$.fragment,f),T(_.$$.fragment,f),T(w.$$.fragment,f),T(I.$$.fragment,f),T(C.$$.fragment,f),T(H),T(Q.$$.fragment,f),U=!0)},o(f){L(e.$$.fragment,f),L(_.$$.fragment,f),L(w.$$.fragment,f),L(I.$$.fragment,f),L(C.$$.fragment,f),L(H),L(Q.$$.fragment,f),U=!1},d(f){f&&(r(t),r(u),r(N)),Ce(e),Ce(_),Ce(w),Ce(I),Ce(C),ae[q].d(),Ce(Q)}}}function dt(o,t,n){let e;tt(o,at,$=>n(2,e=$));const i={buttons:{fork:"page.profile.projects.actions.fork",star:"page.profile.projects.actions.star",watch:"page.profile.projects.actions.watch"},heading:"page.profile.heading"};let{data:l={locale:"",user:{avatar:"",created_at:null,created_with:"",display_name:"",instance:"",pronoun:"",username:""}}}=t,{sb:d=""}=t;const _=function($,w,V){return w.filter(O=>O.context===V).map(O=>O.items).map(O=>$.find(A=>O.find(I=>A.id===I.object))).flat(1)};return o.$$set=$=>{"data"in $&&n(0,l=$.data),"sb"in $&&n(1,d=$.sb)},[l,d,e,i,_]}class _t extends Xe{constructor(t){super(),Ze(this,t,dt,mt,et,{data:0,sb:1})}}_t.__docgen={version:3,name:"Profile.svelte",data:[{keywords:[{name:"type",description:"{*}"}],visibility:"public",description:"Required context for populating the template.",name:"data",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"*",type:"any"}},{keywords:[],visibility:"public",description:"Allow for linking stories in Storybook.",name:"sb",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"string",type:"string"},defaultValue:""}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};export{_t as P};