Anvil/assets/Profile-ClMiso4k.js
André Jaenisch d08036cfe4
Updates
2024-07-09 20:40:57 +02:00

1 line
15 KiB
JavaScript

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