phanpy-cz/assets/main-hNUnS08_.js

35 lines
291 KiB
JavaScript
Raw Normal View History

2024-12-08 16:19:23 +00:00
import{A as Y,y as ie,h as R,s as A,a as ae,b as We,i as b,C as st,u as qe,c as e,T as d,d as ve,g as wt,p as Mt,e as vn,f as O,j as Qe,k as Mn,L as ao,l as Ce,D as ro,m as lo,o as Yn,q as Gt,r as _t,t as ct,v as uo,w as Oe,x as wn,z as Si,_ as gt,B as as,E as id,F as rs,G as ls,H as ho,I as fo,J as it,K as po,M as ti,N as pt,O as mo,P as go,Q as bo,R as ni,S as xt,U as Xe,V as ds,W as us,X as yo,Y as tn,Z as vo,$ as wo,a0 as Dn,a1 as Nn,a2 as ko,a3 as Ci,a4 as _o,a5 as So,a6 as Co,a7 as ii,a8 as je,a9 as Io,aa as To,ab as xo,ac as Ao}from"./useTitle-6CgMxXiB.js";import{u as si,s as he,a as Ue,o as Ii,b as Eo,I as C,M as Fe,A as dt,N as ht,c as at,d as Se,e as Be,f as Ge,g as lt,L as fe,l as It,h as hs,t as Ti,i as Ze,R as Kt,p as od,j as tt,k as Dt,m as rt,n as fs,q as jn,E as ps,r as Ke,v as ft,w as Ro,S as xn,x as xi,T as ms,y as ut,z as oi,B as Ye,C as kt,D as Lo,F as $o,G as Rt,H as ci,J as gs,K as Mo,O as Ht,P as Do,Q as No,U as bs,V as Po,W as Oo,X as ys,Y as zo,Z as Lt,_ as ai,$ as Uo,a0 as vs,a1 as Bo,a2 as ws,a3 as Fo,a4 as Ho,a5 as qo,a6 as Ai,a7 as Yo,a8 as zt}from"./fuse-3cGZwVM1.js";var ks=jo;function jo(t,n,i){var s=null,o=null,a=function(){s&&(clearTimeout(s),o=null,s=null)},h=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 f=o;return o=null,f()}},n),m)return o()};return r.cancel=a,r.flush=h,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(u,y){y=y||{bubbles:!1,cancelable:!1,detail:void 0};var g=n.createEvent("CustomEvent");return g.initCustomEvent(u,y.bubbles,y.cancelable,y.detail),g},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",m,!1),n.addEventListener("touchmove",f,!1),n.addEventListener("touchend",l,!1);var i=null,s=null,o=null,a=null,h=null,r=null,c=0;function l(u){if(r===u.target){var y=parseInt(p(r,"data-swipe-threshold","20"),10),g=p(r,"data-swipe-unit","px"),w=parseInt(p(r,"data-swipe-timeout","500"),10),v=Date.now()-h,k="",x=u.changedTouches||u.touches||[];if(g==="vh"&&(y=Math.round(y/100*n.documentElement.clientHeight)),g==="vw"&&(y=Math.round(y/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>y&&v<w&&(o>0?k="swiped-left":k="swiped-right"):Math.abs(a)>y&&v<w&&(a>0?k="swiped-up":k="swiped-down"),k!==""){var S={dir:k.replace(/swiped-/,""),touchType:(x[0]||{}).touchType||"direct",fingers:c,xStart:parseInt(i,10),xEnd:parseInt((x[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((x[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:S})),r.dispatchEvent(new CustomEvent(k,{bubbles:!0,cancelable:!0,detail:S}))}i=null,s=null,h=null}}function m(u){u.target.getAttribute("data-swipe-ignore")!=="true"&&(r=u.target,h=Date.now(),i=u.touches[0].clientX,s=u.touches[0].clientY,o=0,a=0,c=u.touches.length)}function f(u){if(!(!i||!s)){var y=u.touches[0].clientX,g=u.touches[0].clientY;o=i-y,a=s-g}}function p(u,y,g){for(;u&&u!==n.documentElement;){var w=u.getAttribute(y);if(w)return w;u=u.parentNode}return g}})(window,document);function qt(t=()=>{},n=[]){const i=Y(t);ie(()=>{i.current=t},[n]),ie(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Vo=1e3*3,Ei=2e4,Go=st(function({isLoggedIn:n}){const[i,s]=R(!0),o=Y();qt(c=>{clearTimeout(o.current),c?s(!0):o.current=setTimeout(()=>{s(!1)},Ei)});const a=async(c,l,m)=>{var f;if(A.notificationsLast){const p=c.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:u}=await p.next();if(u!=null&&u.length)if(m)A.notificationsShowNew=!0;else{let y;try{const g=await c.v1.markers.fetch({timeline:"notifications"});y=(f=g==null?void 0:g.notifications)==null?void 0:f.lastReadId}catch{}y?A.notificationsShowNew=u[0].id!==y:A.notificationsShowNew=!0}}};ie(()=>{let c,l,m;if(n&&i){const{masto:f,streaming:p,instance:u}=ae();(async()=>{await a(f,u);let y=!1;p&&(l=setTimeout(()=>{(async()=>{try{y=!0,c=p.user.notification.subscribe();for await(const g of c){if(!c||!i)break;g.event==="notification"&&We(g.payload,u,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{y=!1}y||(m=setInterval(()=>{a(f,u,!0)},Ei))})()},Vo))})()}return()=>{var f;(f=c==null?void 0:c.unsubscribe)==null||f.call(c),c=null,clearTimeout(l),clearInterval(m)}},[i,n]);const h=Y(),r=()=>{h.current=Date.now(),fetch("./version.json").then(c=>c.json()).then(c=>{c&&(A.appVersion=c)}).catch(c=>{})};return si(r,i&&1e3*60*30),qt(c=>{c&&(h.current?Date.now()-h.current>1e3*60*60&&r():r())}),Ue("shift+alt+k",()=>{const c=A.settings.cloakMode;A.settings.cloakMode=!c,he({text:c?b._({id:"oguMwa"}):b._({id:"IXZLPs"})})}),null});function Ko(){const t=qe(A);function n(i){if(t.composerState.minimized){A.composerState.minimized=!1,Ii();return}i.shiftKey?Eo()||(A.showCompose=!0):(Ii(),A.showCompose=!0)}return Ue("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:b._({id:"QOhkyl"})})})}const Wo=st(function(){const n=qe(A);function i(){A.showKeyboardShortcutsHelp=!1}return Ue("?, shift+?, shift+slash",s=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!doc
${xi(h)}`).join(`
`))||"",o=xi(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:b._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(d,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(ms,{forceTranslate:!0,text:o})]})]})}function Bc({accountID:t,onClose:n}){const{masto:i}=ae(),[s,o]=R("default"),[a,h]=R([]),[r,c]=R([]),[l,m]=Mt(u=>u+1,0);ie(()=>{o("loading"),(async()=>{try{const u=await cn();h(u);const y=await i.v1.accounts.$select(t).lists.list();c(y),o("default")}catch{o("error")}})()},[l]);const[f,p]=R(!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:b._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(d,{id:"sJ2yQc"})})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(u=>{const y=r.some(g=>g.id===u.id);return e("li",{children:e("button",{type:"button",class:`light ${y?"checked":""}`,disabled:s==="loading",onClick:()=>{o("loading"),(async()=>{try{y?await i.v1.lists.$select(u.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(u.id).accounts.create({accountIds:[t]}),m()}catch{o("error"),alert(y?b._({id:"7KnEYa"}):b._({id:"Tba8uO"}))}})()},children:[e(C,{icon:"check-circle",alt:"☑️"}),e("span",{children:u.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e(Oe,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(d,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(d,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>p(!0),disabled:s!=="default",children:[e(C,{icon:"plus",size:"l"})," ",e("span",{children:e(d,{id:"Sb2gYF"})})]})]}),f&&e(Fe,{onClick:u=>{u.target===u.currentTarget&&p(!1)},children:e(gi,{list:f==null?void 0:f.list,onClose:u=>{u.state==="success"&&m(),p(!1)}})})]})}function Fc({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=ae(),[a,h]=R("default"),r=Y(null);return ie(()=>{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:b._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(d,{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())&&(h("loading"),(async()=>{try{const f=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:m});h("default"),i(f),s()}catch(f){h("error"),alert((f==null?void 0:f.message)||b._({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(d,{id:"dEgA5A"})}),e("span",{children:[e(Oe,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:e(d,{id:"SrwrEj"})})]})]})]})})]})}function Hc({onClose:t=()=>{}}){const{masto:n}=ae(),[i,s]=R("loading"),[o,a]=R(null);ie(()=>{(async()=>{try{const f=await n.v1.accounts.verifyCredentials();a(f),s("default")}catch{s("error")}})()},[]);const{displayName:h,source:r}=o||{},{note:c,fields:l}=r||{},m=Y(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:b._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(d,{id:"9OpVZg"})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Oe,{abrupt:!0})}):e("form",{onSubmit:f=>{f.preventDefault();const p=new FormData(f.target),u=p.get("display_name"),y=p.get("note"),g=m.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];g.forEach(v=>{co
rgb(${(V=M.light)==null?void 0:V.join(",")}) ${te}%,
rgb(${(z=M.light)==null?void 0:z.join(",")}) ${B}%
`,dark:`
rgb(${(H=M.dark)==null?void 0:H.join(",")}) ${te}%,
rgb(${(ne=M.dark)==null?void 0:ne.join(",")}) ${B}%
`}:{light:`
transparent ${te}%,
transparent ${B}%
`,dark:`
transparent ${te}%,
transparent ${B}%
`}}),$=T.map(M=>M.light).join(", "),D=T.map(M=>M.dark).join(", ");return{light:$,dark:D}},[w]);let k=Y(null);return ie(()=>()=>{var I,_;(_=(I=k.current)==null?void 0:I.hideToast)==null||_.call(I)},[]),gt(()=>{const I=w[l];let _,T;if(I){const $=ve.local.get("theme");if($){const D=`rgb(${I[$].join(",")})`;_=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),_&&(T=_.content,_.content=D)}else{const D=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",M=`rgb(${I[D].join(",")})`;_=document.querySelector(`meta[name="theme-color"][media*="${D}"]`),_&&(T=_.content,_.content=M)}}return()=>{_&&T&&(_.content=T)}},[l,w]),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:I=>{(I.target.classList.contains("carousel-item")||I.target.classList.contains("media")||I.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local","--accent-gradient-light":v==null?void 0:v.light,"--accent-gradient-dark":v==null?void 0:v.dark}:{},children:t==null?void 0:t.map((I,_)=>{var $,D;const T=t.length===1?w[_]:null;return e("div",{class:"carousel-item",style:T?{"--accent-color":`rgb(${T.default.join(",")})`,"--accent-light-color":`rgb(${($=T.light)==null?void 0:$.join(",")})`,"--accent-dark-color":`rgb(${(D=T.dark)==null?void 0:D.join(",")})`,"--accent-alpha-color":`rgba(${T.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:_===l?f:null,onClick:M=>{M.target.classList.contains("media")||y(!u)},children:[!!I.description&&e("button",{type:"button",class:"media-alt",hidden:!u,onClick:()=>{A.showMediaAlt={alt:I.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:I.description})]}),e(gs,{media:I,showOriginal:!0,lang:s})]},I.id)})}),e("div",{class:"carousel-top-controls",hidden:!u,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(C,{icon:"x",alt:b._({id:"yz7wBu"})})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((I,_)=>e("button",{type:"button",disabled:_===l,class:`carousel-dot ${_===l?"active":""}`,onClick:T=>{T.preventDefault(),T.stopPropagation();const $=c.current.clientWidth*_*(Rt()?-1:1);c.current.focus(),c.current.scrollTo({left:$,behavior:"smooth"})},children:e(C,{icon:"round",size:"s",alt:"⸱"})},I.id))}):e("span",{}),e("span",{children:[e(at,{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:b._({id:"2FYpfJ"})})}),children:[e(Be,{href:((x=t[l])==null?void 0:x.remoteUrl)||((S=t[l])==null?void 0:S.url),class:"carousel-button",target:"_blank",title:b._({id:"5hXGws"}),children:[e(C,{icon:"popout"}),e("span",{children:e(d,{id:"aDr7Vc"})})]}),!1]})," ",e(fe,{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(d,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!u,children:[e("button",{type:"button",class:"carousel-button",hidden:l===0,onClick:I=>{I.preventDefault(),I.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l-1)*(Rt()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-left",alt:b._({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:l===t.length-1,onClick:I=>{I.preventDefault(),I.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l+1)*(Rt()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-right",alt:b._({id:"hXzOVo"})})})]})]})}const fa=[,"spam","legal","violation","other"],Zt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{i
<phanpy-shortcuts-settings>${k}</phanpy-shortcuts-settings>`,he(b._({id:"9ZYiLz"})),await s.v1.accounts.$select(u).note.create({comment:v}),c("default"),he(b._({id:"5w02SH"}))}}catch{c("error"),he(b._({id:"aVsTYo"}))}},title:b._({id:"gWd6Cu"}),children:[e(C,{icon:"cloud"}),e(C,{icon:"arrow-up"})]})," ",o.length>0&&e("small",{class:"insignificant ib",children:e(d,{id:"IPXOXm",values:{0:o.length}})})]}),!!o&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(d,{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(d,{id:"C4T6O/"})]})})]})]})}rs(A,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&Kn()});function Aa(){var s,o,a,h,r,c,l,m;const t=qe(A),n=ls(),i=Gt();return ie(()=>{setTimeout(ho,1e3)},[]),e(O,{children:[!!t.showCompose&&e(Fe,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(fo,{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:((h=A.showCompose)==null?void 0:h.draftStatus)||((r=window.__COMPOSE__)==null?void 0:r.draftStatus)||null,onClose:f=>{const{newStatus:p,instance:u,type:y}=f||{};A.showCompose=!1,window.__COMPOSE__=null,p&&(A.reloadStatusPage++,he({text:{post:b._({id:"aTyHBW"}),reply:b._({id:"lZdBKl"}),edit:b._({id:"a5BN7l"})}[y||"post"],delay:1e3,duration:1e4,onClick:g=>{g.hideToast(),A.prevLocation=i,n(u?`/${u}/s/${p.id}`:`/s/${p.id}`)}}))}})}),!!t.showSettings&&e(Fe,{onClose:()=>{A.showSettings=!1},children:e(_c,{onClose:()=>{A.showSettings=!1}})}),!!t.showAccounts&&e(Fe,{onClose:()=>{A.showAccounts=!1},children:e(uc,{onClose:()=>{A.showAccounts=!1}})}),!!t.showAccount&&e(Fe,{onClose:()=>{A.showAccount=!1},children:e(jc,{account:((c=t.showAccount)==null?void 0:c.account)||t.showAccount,instance:(l=t.showAccount)==null?void 0:l.instance,onClose:({destination:f}={})=>{A.showAccount=!1}})}),!!t.showDrafts&&e(Fe,{onClose:()=>{A.showDrafts=!1},children:e(Vc,{onClose:()=>A.showDrafts=!1})}),!!t.showMediaModal&&e(Fe,{onClick:f=>{(f.target===f.currentTarget||f.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Ps,{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(Ia,{onClose:()=>A.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Fe,{onClose:()=>{A.showGenericAccounts=!1},children:e(Wc,{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:f=>{A.showMediaAlt=!1},children:e(Zc,{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(Kc,{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(pa,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Zn({accountID:t,onChange:n}){const{masto:i}=ae(),[s,o]=R("default"),[a,h]=R(null),[r,c]=R(null),l=r!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||l,onClick:()=>{o("loading"),h("accept"),(async()=>{try{const m=await i.v1.followRequests.$select(t).authorize();if(!(m!=null&&m.followedBy))throw new Error("Follow
media-post
${J?"filtered":""}
${ge?"has-spoiler":""}
${le?"show-media":""}
`,children:e(gs,{class:t,media:we,lang:V,to:`/${s}/s/${k}?media-only=${P+1}`,onClick:a?N=>a(N,P,we,i):void 0})},ee)})}const ji=st(Ha);function qa(t){var k,x,S,I,_;const n=qe(A),{masto:i,instance:s,authenticated:o}=ae(),[a,h]=Ce(()=>{const T=ve.local.getJSON("accounts")||[];return[T.find(D=>D.info.id===wt())||T[0],T.length>1]},[]),r=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(T=>T.type==="following"),c=Po(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),l=Y(),[m,f]=R(void 0),p=Oo([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),u=Y();async function y(T){return(T||!u.current)&&(u.current=i.v1.mutes.list({limit:80})),await u.current.next()}const g=Y();async function w(T){return(T||!g.current)&&(g.current=i.v1.blocks.list({limit:80})),await g.current.next()}const v=Y();return e(O,{children:[e("button",{ref:l,type:"button",class:`button plain nav-menu-button ${h?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{v.current=Date.now(),f(T=>T?void 0:"open")},onContextMenu:T=>{T.preventDefault(),A.showAccounts=!0},...c(),children:[h&&e(dt,{url:((k=a==null?void 0:a.info)==null?void 0:k.avatar)||((x=a==null?void 0:a.info)==null?void 0:x.avatarStatic),size:"l",squircle:(S=a==null?void 0:a.info)==null?void 0:S.bot}),e(C,{icon:"menu",size:h?"s":"l",alt:b._({id:"zucql+"})})]}),e(ys,{menuClassName:"nav-menu",state:m,anchorRef:l,onClose:()=>{f(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-v.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:p,unmountOnClose:!0,children:[!!((I=n.appVersion)!=null&&I.commitHash)&&n.appVersion.commitHash!=="7e1ffc5"&&e("div",{class:"top-menu",children:[e(Se,{onClick:()=>{confirm(b._({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(C,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(d,{id:"95IFnD"})})]}),e(Ge,{})]}),e("section",{children:[e(Be,{to:"/",children:[e(C,{icon:"home",size:"l"})," ",e("span",{children:e(d,{id:"i0qMbr"})})]}),o?e(O,{children:[r&&e(Be,{to:"/following",children:[e(C,{icon:"following",size:"l"})," ",e("span",{children:e(d,{id:"following.title"})})]}),e(Be,{to:"/catchup",children:[e(C,{icon:"history2",size:"l"}),e("span",{children:e(d,{id:"xrl8fj"})})]}),Ze("@mastodon/mentions")&&e(Be,{to:"/mentions",children:[e(C,{icon:"at",size:"l"})," ",e("span",{children:e(d,{id:"/bZzdR"})})]}),e(Be,{to:"/notifications",children:[e(C,{icon:"notification",size:"l"})," ",e("span",{children:e(d,{id:"iDNBZe"})}),n.notificationsShowNew&&e("sup",{title:b._({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ge,{}),((_=a==null?void 0:a.info)==null?void 0:_.id)&&e(Be,{to:`/${s}/a/${a.info.id}`,children:[e(C,{icon:"user",size:"l"})," ",e("span",{children:e(d,{id:"vERlcd"})})]}),e(Ya,{menuState:m}),e(Be,{to:"/b",children:[e(C,{icon:"bookmark",size:"l"})," ",e("span",{children:e(d,{id:"7Ff7ia"})})]}),e(xn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(O,{children:[e(C,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(d,{id:"24misb"})}),e(C,{icon:"chevron-right"})]}),children:[e(Be,{to:"/f",children:[e(C,{icon:"heart",size:"l"})," ",e("span",{children:e(d,{id:"zZOZj7"})})]}),e(Be,{to:"/fh",children:[e(C,{icon:"hashtag",size:"l"})," ",e("span",{children:e(d,{id:"Xi1/bw"})})]}),e(Ge,{}),Ze("@mastodon/filters")&&e(Be,{to:"/ft",children:[e(C,{icon:"filters",size:"l"})," ",e("span",{children:e(d,{id:"cSev+j"})})]}),e(Se,{onClick:()=>{A.showGenericAccounts={id:"mute",heading:b._({id:"sOKhEA"}),fetchAccounts:y,excludeRelationshipAttrs:["muting"]}},children:[e(C,{icon:"mute",size:"l"})," ",e("span",{children:e(d,{id:"n1sANU"})})]}),e(Se,{onClick:()=>{A.showGenericAccounts={id:"block",heading:b._({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(C,{icon:"block",size:"l"})," ",e("span",{children:e(d,{id:"r3RRWo"})})]})," "]}),e(Ge,{})
//# sourceMappingURL=main-hNUnS08_.js.map