30 lines
281 KiB
JavaScript
30 lines
281 KiB
JavaScript
|
import{A as q,y as ee,h as L,s as A,a as oe,b as Ke,i as g,C as it,u as He,c as e,T as u,d as me,g as vt,p as $t,e as gn,f as B,j as Je,k as En,L as Js,l as _e,D as Qs,m as eo,o as Fn,q as Vt,r as _t,t as ot,v as to,w as Ne,x as bn,z as vi,_ as yt,B as es,E as Rl,F as ts,G as ns,H as no,I as io,J as nt,K as so,M as Zn,N as ht,O as oo,P as co,Q as ao,R as Xn,S as Mt,U as We,V as is,W as ss,X as ro,Y as en,Z as lo,$ as uo,a0 as Rn,a1 as Ln,a2 as ho,a3 as yi,a4 as fo,a5 as po,a6 as mo,a7 as Jn,a8 as je,a9 as go,aa as bo,ab as vo,ac as yo}from"./useTitle-B8ZF9tfB.js";import{u as Qn,s as ue,a as Be,o as wi,b as wo,I as C,M as Fe,A as lt,N as pt,c as ct,d as ye,e as Ue,f as Ve,g as rt,L as he,l as Ct,h as os,t as _i,i as Xe,R as Gt,j as et,p as Kt,k as at,m as cs,n as Bn,E as as,q as Ge,r as ut,v as _o,S as vn,w as ki,T as rs,x as dt,y as ei,z as qe,B as wt,C as ko,D as So,F as Et,G as ti,H as ls,J as Co,K as Bt,O as Io,P as To,Q as ds,U as xo,V as Ao,W as us,X as Eo,Y as Rt,Z as ni,_ as Ro,$ as hs,a0 as Lo,a1 as fs,a2 as $o,a3 as Mo,a4 as Do,a5 as Si,a6 as No,a7 as Ot}from"./fuse-RZOrQKm7.js";var ps=Po;function Po(t,n,i){var s=null,o=null,a=function(){s&&(clearTimeout(s),o=null,s=null)},p=function(){var c=o;a(),c&&c()},r=function(){if(!n)return t.apply(this,arguments);var c=this,l=arguments,m=i&&!s;if(a(),o=function(){t.apply(c,l)},s=setTimeout(function(){if(s=null,!m){var h=o;return o=null,h()}},n),m)return o()};return r.cancel=a,r.flush=p,r}/*!
|
||
|
* swiped-events.js - v@version@
|
||
|
* Pure JavaScript swipe events
|
||
|
* https://github.com/john-doherty/swiped-events
|
||
|
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
|
||
|
* @author John Doherty <www.johndoherty.info>
|
||
|
* @license MIT
|
||
|
*/(function(t,n){"use strict";typeof t.CustomEvent!="function"&&(t.CustomEvent=function(d,v){v=v||{bubbles:!1,cancelable:!1,detail:void 0};var b=n.createEvent("CustomEvent");return b.initCustomEvent(d,v.bubbles,v.cancelable,v.detail),b},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",m,!1),n.addEventListener("touchmove",h,!1),n.addEventListener("touchend",l,!1);var i=null,s=null,o=null,a=null,p=null,r=null,c=0;function l(d){if(r===d.target){var v=parseInt(f(r,"data-swipe-threshold","20"),10),b=f(r,"data-swipe-unit","px"),w=parseInt(f(r,"data-swipe-timeout","500"),10),_=Date.now()-p,y="",S=d.changedTouches||d.touches||[];if(b==="vh"&&(v=Math.round(v/100*n.documentElement.clientHeight)),b==="vw"&&(v=Math.round(v/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>v&&_<w&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(a)>v&&_<w&&(a>0?y="swiped-up":y="swiped-down"),y!==""){var k={dir:y.replace(/swiped-/,""),touchType:(S[0]||{}).touchType||"direct",fingers:c,xStart:parseInt(i,10),xEnd:parseInt((S[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((S[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:k})),r.dispatchEvent(new CustomEvent(y,{bubbles:!0,cancelable:!0,detail:k}))}i=null,s=null,p=null}}function m(d){d.target.getAttribute("data-swipe-ignore")!=="true"&&(r=d.target,p=Date.now(),i=d.touches[0].clientX,s=d.touches[0].clientY,o=0,a=0,c=d.touches.length)}function h(d){if(!(!i||!s)){var v=d.touches[0].clientX,b=d.touches[0].clientY;o=i-v,a=s-b}}function f(d,v,b){for(;d&&d!==n.documentElement;){var w=d.getAttribute(v);if(w)return w;d=d.parentNode}return b}})(window,document);function Ht(t=()=>{},n=[]){const i=q(t);ee(()=>{i.current=t},[n]),ee(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Oo=1e3*3,Ci=2e4,zo=it(function({isLoggedIn:n}){const[i,s]=L(!0),o=q();Ht(c=>{clearTimeout(o.current),c?s(!0):o.current=setTimeout(()=>{s(!1)},Ci)});const a=async(c,l,m)=>{var h;if(A.notificationsLast){const f=c.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:d}=await f.next();if(d!=null&&d.length)if(m)A.notificationsShowNew=!0;else{let v;try{const b=await c.v1.markers.fetch({timeline:"notifications"});v=(h=b==null?void 0:b.notifications)==null?void 0:h.lastReadId}catch{}v?A.notificationsShowNew=d[0].id!==v:A.notificationsShowNew=!0}}};ee(()=>{let c,l,m;if(n&&i){const{masto:h,streaming:f,instance:d}=oe();(async()=>{await a(h,d);let v=!1;f&&(l=setTimeout(()=>{(async()=>{try{v=!0,c=f.user.notification.subscribe();for await(const b of c){if(!c||!i)break;b.event==="notification"&&Ke(b.payload,d,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{v=!1}v||(m=setInterval(()=>{a(h,d,!0)},Ci))})()},Oo))})()}return()=>{var h;(h=c==null?void 0:c.unsubscribe)==null||h.call(c),c=null,clearTimeout(l),clearInterval(m)}},[i,n]);const p=q(),r=()=>{p.current=Date.now(),fetch("./version.json").then(c=>c.json()).then(c=>{c&&(A.appVersion=c)}).catch(c=>{})};return Qn(r,i&&1e3*60*30),Ht(c=>{c&&(p.current?Date.now()-p.current>1e3*60*60&&r():r())}),Be("shift+alt+k",()=>{const c=A.settings.cloakMode;A.settings.cloakMode=!c,ue({text:c?g._({id:"oguMwa"}):g._({id:"IXZLPs"})})}),null});function Uo(){const t=He(A);function n(i){if(t.composerState.minimized){A.composerState.minimized=!1,wi();return}i.shiftKey?wo()||(A.showCompose=!0):(wi(),A.showCompose=!0)}return Be("c, shift+c",n,{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:n,class:`${t.composerState.minimized?"min":""} ${t.composerState.publishing?"loading":""} ${t.composerState.publishingError?"error":""}`,children:e(C,{icon:"quill",size:"xl",alt:g._({id:"QOhkyl"})})})}const Fo=it(function(){const n=He(A);function i(){A.showKeyboardShortcutsHelp=!1}return Be("?, shift+?, shift+slash",s=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!doc
|
||
|
${ki(p)}`).join(`
|
||
|
|
||
|
`))||"",o=ki(t)+(s?`
|
||
|
|
||
|
${s}`:"");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(rs,{forceTranslate:!0,text:o})]})]})}function Lc({accountID:t,onClose:n}){const{masto:i}=oe(),[s,o]=L("default"),[a,p]=L([]),[r,c]=L([]),[l,m]=$t(d=>d+1,0);ee(()=>{o("loading"),(async()=>{try{const d=await sn();p(d);const v=await i.v1.accounts.$select(t).lists.list();c(v),o("default")}catch{o("error")}})()},[l]);const[h,f]=L(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"sJ2yQc"})})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(d=>{const v=r.some(b=>b.id===d.id);return e("li",{children:e("button",{type:"button",class:`light ${v?"checked":""}`,disabled:s==="loading",onClick:()=>{o("loading"),(async()=>{try{v?await i.v1.lists.$select(d.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(d.id).accounts.create({accountIds:[t]}),m()}catch{o("error"),alert(v?g._({id:"7KnEYa"}):g._({id:"Tba8uO"}))}})()},children:[e(C,{icon:"check-circle",alt:"☑️"}),e("span",{children:d.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e(Ne,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>f(!0),disabled:s!=="default",children:[e(C,{icon:"plus",size:"l"})," ",e("span",{children:e(u,{id:"Sb2gYF"})})]})]}),h&&e(Fe,{onClick:d=>{d.target===d.currentTarget&&f(!1)},children:e(ui,{list:h==null?void 0:h.list,onClose:d=>{d.state==="success"&&m(),f(!1)}})})]})}function $c({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=oe(),[a,p]=L("default"),r=q(null);return ee(()=>{let c;return r.current&&!n&&(c=setTimeout(()=>{var l,m;(m=(l=r.current).focus)==null||m.call(l)},100)),()=>{clearTimeout(c)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"DYqYm5",values:{0:(t==null?void 0:t.username)||(t==null?void 0:t.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:c=>{c.preventDefault();const m=new FormData(c.target).get("note");(m==null?void 0:m.trim())!==(n==null?void 0:n.trim())&&(p("loading"),(async()=>{try{const h=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:m});p("default"),i(h),s()}catch(h){p("error"),alert((h==null?void 0:h.message)||g._({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:r,name:"note",disabled:a==="loading",dir:"auto",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:a==="loading",onClick:()=>{s==null||s()},children:e(u,{id:"dEgA5A"})}),e("span",{children:[e(Ne,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:e(u,{id:"SrwrEj"})})]})]})]})})]})}function Mc({onClose:t=()=>{}}){const{masto:n}=oe(),[i,s]=L("loading"),[o,a]=L(null);ee(()=>{(async()=>{try{const h=await n.v1.accounts.verifyCredentials();a(h),s("default")}catch{s("error")}})()},[]);const{displayName:p,source:r}=o||{},{note:c,fields:l}=r||{},m=q(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"9OpVZg"})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Ne,{abrupt:!0})}):e("form",{onSubmit:h=>{h.preventDefault();const f=new FormData(h.target),d=f.get("display_name"),v=f.get("note"),b=m.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];b.forEach(_=>{co
|
||
|
rgba(${x==null?void 0:x.join(",")}, 0.4) ${P}%,
|
||
|
rgba(${x==null?void 0:x.join(",")}, 0.4) ${$}%
|
||
|
`:`
|
||
|
transparent ${P}%,
|
||
|
transparent ${$}%
|
||
|
`}))==null?void 0:I.join(", "))||"transparent"},[b]);let _=q(null);return ee(()=>()=>{var k,T;(T=(k=_.current)==null?void 0:k.hideToast)==null||T.call(k)},[]),e("div",{class:`media-modal-container media-modal-count-${t==null?void 0:t.length}`,children:[e("div",{ref:c,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:k=>{(k.target.classList.contains("carousel-item")||k.target.classList.contains("media")||k.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local",backgroundImage:`linear-gradient(
|
||
|
to ${Et()?"left":"right"}, ${w})`}:{},children:t==null?void 0:t.map((k,T)=>{const I=t.length===1?b[T]:null;return e("div",{class:"carousel-item",style:I?{"--accent-color":`rgb(${I==null?void 0:I.join(",")})`,"--accent-alpha-color":`rgba(${I==null?void 0:I.join(",")}, 0.4)`}:{},tabindex:"0",ref:T===l?h:null,onClick:x=>{x.target.classList.contains("media")||v(!d)},children:[!!k.description&&e("button",{type:"button",class:"media-alt",hidden:!d,onClick:()=>{A.showMediaAlt={alt:k.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:k.description})]}),e(ls,{media:k,showOriginal:!0,lang:s})]},k.id)})}),e("div",{class:"carousel-top-controls",hidden:!d,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((k,T)=>e("button",{type:"button",disabled:T===l,class:`carousel-dot ${T===l?"active":""}`,onClick:I=>{I.preventDefault(),I.stopPropagation();const x=c.current.clientWidth*T*(Et()?-1:1);c.current.scrollTo({left:x,behavior:"smooth"}),c.current.focus()},children:e(C,{icon:"round",size:"s",alt:"⸱"})},k.id))}):e("span",{}),e("span",{children:[e(ct,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(C,{icon:"more",alt:g._({id:"2FYpfJ"})})}),children:[e(Ue,{href:((y=t[l])==null?void 0:y.remoteUrl)||((S=t[l])==null?void 0:S.url),class:"carousel-button",target:"_blank",title:g._({id:"5hXGws"}),children:[e(C,{icon:"popout"}),e("span",{children:e(u,{id:"aDr7Vc"})})]}),!1]})," ",e(he,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${l+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(u,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!d,children:[e("button",{type:"button",class:"carousel-button",hidden:l===0,onClick:k=>{k.preventDefault(),k.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l-1)*(Et()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-left",alt:g._({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:l===t.length-1,onClick:k=>{k.preventDefault(),k.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l+1)*(Et()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-right",alt:g._({id:"hXzOVo"})})})]})]})}const qc=[,"spam","legal","violation","other"],Wt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{id:"fpotTF"},stampLabel:{id:"iuLUuH"}},other:{label:{id:"/IX/7x"},description:{id:"kxiG8g"},excludeStamp:!0}};function Yc({account:t,post:n,onClose:i}){const{_:s}=Je(),{masto:o}=oe(),[a,p]=L("default"),[r,c]=t.acct.split("@"),[l,m]=_e(()=>{const{rules:y,domain:S}=es();return[y||[],S]}),[h,f]=L(null),[d,v]=L(!1),b=q(null),[w,_]=L(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:n?g._({id:"muLhL3"}):g._({id:"ACul2G",values:{username:r}})}),e("button",{type:"button",class:"plain4 small",disabled:a==="loading",onClick:()=>i(),children:e(C,{icon:"x",size:"xl",alt:g._({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(qe,{status:n,size:"s",previewMode:!0}):e(at,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!h&&!Wt[h].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[s(Wt[h].stampLabel||s(Wt[h].label)),e("small",{children:e(u,{id:"2WtL62"})})]},h),e("form",{onSubmit:y=>{y.preventDefault();const S=new FormData(y.target),k=Object.fromEntries(S.entries());let{category:T,comment:I,forward:x}=k;I||(I=void 0),x==="on"&&(x=!0);const O=T==="violation"?Obj
|
||
|
|
||
|
|
||
|
<phanpy-shortcuts-settings>${y}</phanpy-shortcuts-settings>`,ue(g._({id:"9ZYiLz"})),await s.v1.accounts.$select(d).note.create({comment:_}),c("default"),ue(g._({id:"5w02SH"}))}}catch{c("error"),ue(g._({id:"aVsTYo"}))}},title:g._({id:"gWd6Cu"}),children:[e(C,{icon:"cloud"}),e(C,{icon:"arrow-up"})]})," ",o.length>0&&e("small",{class:"insignificant ib",children:e(u,{id:"IPXOXm",values:{0:o.length}})})]}),!!o&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(u,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(t.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(C,{icon:"cloud"})," ",e(u,{id:"C4T6O/"})]})})]})]})}ts(A,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&Yn()});function sa(){var s,o,a,p,r,c,l,m;const t=He(A),n=ns(),i=Vt();return ee(()=>{setTimeout(no,1e3)},[]),e(B,{children:[!!t.showCompose&&e(Fe,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(io,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((s=window.__COMPOSE__)==null?void 0:s.replyToStatus)||null,editStatus:((o=A.showCompose)==null?void 0:o.editStatus)||((a=window.__COMPOSE__)==null?void 0:a.editStatus)||null,draftStatus:((p=A.showCompose)==null?void 0:p.draftStatus)||((r=window.__COMPOSE__)==null?void 0:r.draftStatus)||null,onClose:h=>{const{newStatus:f,instance:d,type:v}=h||{};A.showCompose=!1,window.__COMPOSE__=null,f&&(A.reloadStatusPage++,ue({text:{post:g._({id:"aTyHBW"}),reply:g._({id:"lZdBKl"}),edit:g._({id:"a5BN7l"})}[v||"post"],delay:1e3,duration:1e4,onClick:b=>{b.hideToast(),A.prevLocation=i,n(d?`/${d}/s/${f.id}`:`/s/${f.id}`)}}))}})}),!!t.showSettings&&e(Fe,{onClose:()=>{A.showSettings=!1},children:e(fc,{onClose:()=>{A.showSettings=!1}})}),!!t.showAccounts&&e(Fe,{onClose:()=>{A.showAccounts=!1},children:e(nc,{onClose:()=>{A.showAccounts=!1}})}),!!t.showAccount&&e(Fe,{onClose:()=>{A.showAccount=!1},children:e(Pc,{account:((c=t.showAccount)==null?void 0:c.account)||t.showAccount,instance:(l=t.showAccount)==null?void 0:l.instance,onClose:({destination:h}={})=>{A.showAccount=!1}})}),!!t.showDrafts&&e(Fe,{onClose:()=>{A.showDrafts=!1},children:e(Oc,{onClose:()=>A.showDrafts=!1})}),!!t.showMediaModal&&e(Fe,{onClick:h=>{(h.target===h.currentTarget||h.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(xs,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(Fe,{onClose:()=>{A.showShortcutsSettings=!1},children:e(ta,{onClose:()=>A.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Fe,{onClose:()=>{A.showGenericAccounts=!1},children:e(Fc,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(Fe,{onClose:h=>{A.showMediaAlt=!1},children:e(Bc,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(m=t.showMediaAlt)==null?void 0:m.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(Fe,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(Uc,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!t.showReportModal&&e(Fe,{onClose:()=>{A.showReportModal=!1},children:e(Yc,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Vn({accountID:t,onChange:n}){const{masto:i}=oe(),[s,o]=L("default"),[a,p]=L(null),[r,c]=L(null),l=r!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||l,onClick:()=>{o("loading"),p("accept"),(async()=>{try{const m=await i.v1.followRequests.$select(t).authorize();if(!(m!=null&&m.followedBy))throw new Error("Follow
|
||
|
media-post
|
||
|
${W?"filtered":""}
|
||
|
${pe?"has-spoiler":""}
|
||
|
${le?"show-media":""}
|
||
|
`,children:e(ls,{class:t,media:fe,lang:N,to:`/${s}/s/${y}?media-only=${D+1}`,onClick:a?ae=>a(ae,D,fe,i):void 0})},E)})}const Fi=it(va);function ya(t){var T,I,x,O,P;const n=He(A),{masto:i,instance:s,authenticated:o}=oe(),[a,p]=_e(()=>{const $=me.local.getJSON("accounts")||[];return[$.find(X=>X.info.id===vt())||$[0],$.length>1]},[]),r=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find($=>$.type==="following"),c=xo(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),l=q(),[m,h]=L(void 0),f=Ao([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),d=q();async function v($){return($||!d.current)&&(d.current=i.v1.mutes.list({limit:80})),await d.current.next()}const b=q();async function w($){return($||!b.current)&&(b.current=i.v1.blocks.list({limit:80})),await b.current.next()}const _=Xe("@mastodon/lists"),[y,S]=L([]);ee(()=>{_&&m==="open"&&sn().then(S)},[m==="open"]);const k=q();return e(B,{children:[e("button",{ref:l,type:"button",class:`button plain nav-menu-button ${p?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{k.current=Date.now(),h($=>$?void 0:"open")},onContextMenu:$=>{$.preventDefault(),A.showAccounts=!0},...c(),children:[p&&e(lt,{url:((T=a==null?void 0:a.info)==null?void 0:T.avatar)||((I=a==null?void 0:a.info)==null?void 0:I.avatarStatic),size:"l",squircle:(x=a==null?void 0:a.info)==null?void 0:x.bot}),e(C,{icon:"menu",size:p?"s":"l",alt:g._({id:"zucql+"})})]}),e(us,{menuClassName:"nav-menu",state:m,anchorRef:l,onClose:()=>{h(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-k.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:f,unmountOnClose:!0,children:[!!((O=n.appVersion)!=null&&O.commitHash)&&n.appVersion.commitHash!=="e3df9ff"&&e("div",{class:"top-menu",children:[e(ye,{onClick:()=>{confirm(g._({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(C,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(u,{id:"95IFnD"})})]}),e(Ve,{})]}),e("section",{children:[e(Ue,{to:"/",children:[e(C,{icon:"home",size:"l"})," ",e("span",{children:e(u,{id:"i0qMbr"})})]}),o?e(B,{children:[r&&e(Ue,{to:"/following",children:[e(C,{icon:"following",size:"l"})," ",e("span",{children:e(u,{id:"following.title"})})]}),e(Ue,{to:"/catchup",children:[e(C,{icon:"history2",size:"l"}),e("span",{children:e(u,{id:"xrl8fj"})})]}),Xe("@mastodon/mentions")&&e(Ue,{to:"/mentions",children:[e(C,{icon:"at",size:"l"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(Ue,{to:"/notifications",children:[e(C,{icon:"notification",size:"l"})," ",e("span",{children:e(u,{id:"iDNBZe"})}),n.notificationsShowNew&&e("sup",{title:g._({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ve,{}),((P=a==null?void 0:a.info)==null?void 0:P.id)&&e(Ue,{to:`/${s}/a/${a.info.id}`,children:[e(C,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"vERlcd"})})]}),(y==null?void 0:y.length)>0?e(vn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(B,{children:[e(C,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"h16FyT"})}),e(C,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),(y==null?void 0:y.length)>0&&e(B,{children:[e(Ve,{}),y.map($=>e(Ue,{to:`/l/${$.id}`,children:e("span",{children:$.title})},$.id))]})]}):_&&e(Ue,{to:"/l",children:[e(C,{icon:"list",size:"l"}),e("span",{children:e(u,{id:"h16FyT"})})]}),e(Ue,{to:"/b",children:[e(C,{icon:"bookmark",size:"l"})," ",e("span",{children:e(u,{id:"7Ff7ia"})})]}),e(vn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(B,{children:[e(C,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"24misb"})}),e(C,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/f",children:[e(C,{icon:"heart",size:"l"})," ",e("span",{children:e(u,{id:"zZOZj7"})})]}),e(Ue,{to:"/fh",children:[e(C,{icon:"hashtag",size:"l"})," ",e("span",{children:e(u,{id:"X
|
||
|
//# sourceMappingURL=main-e75P80UH.js.map
|