phanpy-cz/assets/main-kbQH2PR3.js

30 lines
276 KiB
JavaScript
Raw Permalink Normal View History

import{A as j,y as X,h as L,s as A,a as ce,b as Ge,i as g,x as ct,u as Be,c as e,T as l,d as he,g as bt,p as $t,e as mn,k as q,f as Xe,C as Tn,L as Vs,j as be,D as Gs,l as Ws,n as Pn,o as Yt,q as wt,r as it,t as Ks,v as Le,w as gn,z as hi,_ as vt,B as Zi,E as vl,F as Ji,G as Xi,H as Zs,I as Js,J as st,K as Xs,M as Yn,N as ut,O as Qs,P as eo,Q as to,R as Vn,S as Mt,U as Ke,V as Qi,W as es,X as no,Y as Qt,Z as io,$ as so,a0 as fi,a1 as pi,a2 as oo,a3 as mi,a4 as co,a5 as Gn,a6 as je,a7 as ao,a8 as ro,a9 as lo,aa as uo}from"./useTitle-SRT6j-GL.js";import{u as Wn,s as de,a as Ue,o as gi,b as ho,I as S,M as ze,A as lt,N as Ct,c as ot,d as ge,e as Oe,f as Ye,g as rt,L as ue,l as St,h as ts,t as bi,i as Je,R as Vt,j as et,p as Gt,k as at,m as ns,n as Nn,E as is,q as Ve,r as pt,v as fo,S as bn,w as vi,T as ss,x as dt,y as Kn,z as qe,B as yt,C as po,D as mo,F as Et,G as Zn,H as os,J as go,K as bo,O as vo,P as cs,Q as en,U as yo,V as wo,W as as,X as ko,Y as Rt,Z as Jn,_ as _o,$ as rs,a0 as So,a1 as ls,a2 as Co,a3 as Io,a4 as To,a5 as yi,a6 as xo,a7 as Ot}from"./fuse-MwQ_F2cO.js";import"./tinyld-light-PxOyhYWY.js";var ds=Ao;function Ao(t,n,i){var s=null,o=null,a=function(){s&&(clearTimeout(s),o=null,s=null)},f=function(){var c=o;a(),c&&c()},d=function(){if(!n)return t.apply(this,arguments);var c=this,r=arguments,m=i&&!s;if(a(),o=function(){t.apply(c,r)},s=setTimeout(function(){if(s=null,!m){var h=o;return o=null,h()}},n),m)return o()};return d.cancel=a,d.flush=f,d}/*!
* 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,v){v=v||{bubbles:!1,cancelable:!1,detail:void 0};var b=n.createEvent("CustomEvent");return b.initCustomEvent(u,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",r,!1);var i=null,s=null,o=null,a=null,f=null,d=null,c=0;function r(u){if(d===u.target){var v=parseInt(p(d,"data-swipe-threshold","20"),10),b=p(d,"data-swipe-unit","px"),w=parseInt(p(d,"data-swipe-timeout","500"),10),k=Date.now()-f,y="",C=u.changedTouches||u.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&&k<w&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(a)>v&&k<w&&(a>0?y="swiped-up":y="swiped-down"),y!==""){var _={dir:y.replace(/swiped-/,""),touchType:(C[0]||{}).touchType||"direct",fingers:c,xStart:parseInt(i,10),xEnd:parseInt((C[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((C[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:_})),d.dispatchEvent(new CustomEvent(y,{bubbles:!0,cancelable:!0,detail:_}))}i=null,s=null,f=null}}function m(u){u.target.getAttribute("data-swipe-ignore")!=="true"&&(d=u.target,f=Date.now(),i=u.touches[0].clientX,s=u.touches[0].clientY,o=0,a=0,c=u.touches.length)}function h(u){if(!(!i||!s)){var v=u.touches[0].clientX,b=u.touches[0].clientY;o=i-v,a=s-b}}function p(u,v,b){for(;u&&u!==n.documentElement;){var w=u.getAttribute(v);if(w)return w;u=u.parentNode}return b}})(window,document);function Bt(t=()=>{},n=[]){const i=j(t);X(()=>{i.current=t},[n]),X(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Eo=1e3*3,wi=2e4,Ro=ct(function({isLoggedIn:n}){const[i,s]=L(!0),o=j();Bt(c=>{clearTimeout(o.current),c?s(!0):o.current=setTimeout(()=>{s(!1)},wi)});const a=async(c,r,m)=>{var h;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 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=u[0].id!==v:A.notificationsShowNew=!0}}};X(()=>{let c,r,m;if(n&&i){const{masto:h,streaming:p,instance:u}=ce();(async()=>{await a(h,u);let v=!1;p&&(r=setTimeout(()=>{(async()=>{try{v=!0,c=p.user.notification.subscribe();for await(const b of c){if(!c||!i)break;b.event==="notification"&&Ge(b.payload,u,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{v=!1}v||(m=setInterval(()=>{a(h,u,!0)},wi))})()},Eo))})()}return()=>{var h;(h=c==null?void 0:c.unsubscribe)==null||h.call(c),c=null,clearTimeout(r),clearInterval(m)}},[i,n]);const f=j(),d=()=>{f.current=Date.now(),fetch("./version.json").then(c=>c.json()).then(c=>{c&&(A.appVersion=c)}).catch(c=>{})};return Wn(d,i&&1e3*60*30),Bt(c=>{c&&(f.current?Date.now()-f.current>1e3*60*60&&d():d())}),Ue("shift+alt+k",()=>{const c=A.settings.cloakMode;A.settings.cloakMode=!c,de({text:c?g._({id:"oguMwa"}):g._({id:"IXZLPs"})})}),null});function Lo(){const t=Be(A);function n(i){if(t.composerState.minimized){A.composerState.minimized=!1,gi();return}i.shiftKey?ho()||(A.showCompose=!0):(gi(),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(S,{icon:"quill",size:"xl",alt:g._({id:"QOhkyl"})})})}const $o=ct(function(){const n=Be(A);function i(){A.showKeyboardShortcutsHelp=!1}return Ue("?, shift+?, shift+slash",s=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!docume
${vi(f)}`).join(`
`))||"",o=vi(t)+(s?`
${s}`:"");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(l,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(ss,{forceTranslate:!0,text:o})]})]})}function Sc({accountID:t,onClose:n}){const{masto:i}=ce(),[s,o]=L("default"),[a,f]=L([]),[d,c]=L([]),[r,m]=$t(u=>u+1,0);X(()=>{o("loading"),(async()=>{try{const u=await sn();f(u);const v=await i.v1.accounts.$select(t).lists.list();c(v),o("default")}catch{o("error")}})()},[r]);const[h,p]=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(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(l,{id:"sJ2yQc"})})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(u=>{const v=d.some(b=>b.id===u.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(u.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(u.id).accounts.create({accountIds:[t]}),m()}catch{o("error"),alert(v?g._({id:"7KnEYa"}):g._({id:"Tba8uO"}))}})()},children:[e(S,{icon:"check-circle",alt:"☑️"}),e("span",{children:u.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e(Le,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(l,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(l,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>p(!0),disabled:s!=="default",children:[e(S,{icon:"plus",size:"l"})," ",e("span",{children:e(l,{id:"Sb2gYF"})})]})]}),h&&e(ze,{onClick:u=>{u.target===u.currentTarget&&p(!1)},children:e(ci,{list:h==null?void 0:h.list,onClose:u=>{u.state==="success"&&m(),p(!1)}})})]})}function Cc({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=ce(),[a,f]=L("default"),d=j(null);return X(()=>{let c;return d.current&&!n&&(c=setTimeout(()=>{var r,m;(m=(r=d.current).focus)==null||m.call(r)},100)),()=>{clearTimeout(c)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(l,{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())&&(f("loading"),(async()=>{try{const h=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:m});f("default"),i(h),s()}catch(h){f("error"),alert((h==null?void 0:h.message)||g._({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:d,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(l,{id:"dEgA5A"})}),e("span",{children:[e(Le,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:e(l,{id:"SrwrEj"})})]})]})]})})]})}function Ic({onClose:t=()=>{}}){const{masto:n}=ce(),[i,s]=L("loading"),[o,a]=L(null);X(()=>{(async()=>{try{const h=await n.v1.accounts.verifyCredentials();a(h),s("default")}catch{s("error")}})()},[]);const{displayName:f,source:d}=o||{},{note:c,fields:r}=d||{},m=j(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(S,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(l,{id:"9OpVZg"})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Le,{abrupt:!0})}):e("form",{onSubmit:h=>{h.preventDefault();const p=new FormData(h.target),u=p.get("display_name"),v=p.get("note"),b=m.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];b.forEach(k=>{const
rgba(${x==null?void 0:x.join(",")}, 0.4) ${D}%,
rgba(${x==null?void 0:x.join(",")}, 0.4) ${M}%
`:`
transparent ${D}%,
transparent ${M}%
`}))==null?void 0:I.join(", "))||"transparent"},[b]);let k=j(null);return X(()=>()=>{var _,T;(T=(_=k.current)==null?void 0:_.hideToast)==null||T.call(_)},[]),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:_=>{(_.target.classList.contains("carousel-item")||_.target.classList.contains("media")||_.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((_,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===r?h:null,onClick:x=>{x.target.classList.contains("media")||v(!u)},children:[!!_.description&&e("button",{type:"button",class:"media-alt",hidden:!u,onClick:()=>{A.showMediaAlt={alt:_.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:_.description})]}),e(os,{media:_,showOriginal:!0,lang:s})]},_.id)})}),e("div",{class:"carousel-top-controls",hidden:!u,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(S,{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((_,T)=>e("button",{type:"button",disabled:T===r,class:`carousel-dot ${T===r?"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(S,{icon:"round",size:"s",alt:"⸱"})},_.id))}):e("span",{}),e("span",{children:[e(ot,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(S,{icon:"more",alt:g._({id:"2FYpfJ"})})}),children:[e(Oe,{href:((y=t[r])==null?void 0:y.remoteUrl)||((C=t[r])==null?void 0:C.url),class:"carousel-button",target:"_blank",title:g._({id:"5hXGws"}),children:[e(S,{icon:"popout"}),e("span",{children:e(l,{id:"aDr7Vc"})})]}),!1]})," ",e(ue,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${r+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(l,{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:r===0,onClick:_=>{_.preventDefault(),_.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(r-1)*(Et()?-1:1),behavior:"smooth"})},children:e(S,{icon:"arrow-left",alt:g._({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:r===t.length-1,onClick:_=>{_.preventDefault(),_.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(r+1)*(Et()?-1:1),behavior:"smooth"})},children:e(S,{icon:"arrow-right",alt:g._({id:"hXzOVo"})})})]})]})}const Pc=[,"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 Nc({account:t,post:n,onClose:i}){const{_:s}=Xe(),{masto:o}=ce(),[a,f]=L("default"),[d,c]=t.acct.split("@"),[r,m]=be(()=>{const{rules:y,domain:C}=Zi();return[y||[],C]}),[h,p]=L(null),[u,v]=L(!1),b=j(null),[w,k]=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:d}})}),e("button",{type:"button",class:"plain4 small",disabled:a==="loading",onClick:()=>i(),children:e(S,{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(l,{id:"2WtL62"})})]},h),e("form",{onSubmit:y=>{y.preventDefault();const C=new FormData(y.target),_=Object.fromEntries(C.entries());let{category:T,comment:I,forward:x}=_;I||(I=void 0),x==="on"&&(x=!0);const z=T==="violation"?Obj
<phanpy-shortcuts-settings>${y}</phanpy-shortcuts-settings>`,de(g._({id:"9ZYiLz"})),await s.v1.accounts.$select(u).note.create({comment:k}),c("default"),de(g._({id:"5w02SH"}))}}catch{c("error"),de(g._({id:"aVsTYo"}))}},title:g._({id:"gWd6Cu"}),children:[e(S,{icon:"cloud"}),e(S,{icon:"arrow-up"})]})," ",o.length>0&&e("small",{class:"insignificant ib",children:e(l,{id:"IPXOXm",values:{0:o.length}})})]}),!!o&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(l,{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(S,{icon:"cloud"})," ",e(l,{id:"C4T6O/"})]})})]})]})}Ji(A,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&Un()});function Zc(){var s,o,a,f,d,c,r,m;const t=Be(A),n=Xi(),i=Yt();return X(()=>{setTimeout(Zs,1e3)},[]),e(q,{children:[!!t.showCompose&&e(ze,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(Js,{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:((f=A.showCompose)==null?void 0:f.draftStatus)||((d=window.__COMPOSE__)==null?void 0:d.draftStatus)||null,onClose:h=>{const{newStatus:p,instance:u,type:v}=h||{};A.showCompose=!1,window.__COMPOSE__=null,p&&(A.reloadStatusPage++,de({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(u?`/${u}/s/${p.id}`:`/s/${p.id}`)}}))}})}),!!t.showSettings&&e(ze,{onClose:()=>{A.showSettings=!1},children:e(oc,{onClose:()=>{A.showSettings=!1}})}),!!t.showAccounts&&e(ze,{onClose:()=>{A.showAccounts=!1},children:e(Wo,{onClose:()=>{A.showAccounts=!1}})}),!!t.showAccount&&e(ze,{onClose:()=>{A.showAccount=!1},children:e(Ac,{account:((c=t.showAccount)==null?void 0:c.account)||t.showAccount,instance:(r=t.showAccount)==null?void 0:r.instance,onClose:({destination:h}={})=>{A.showAccount=!1}})}),!!t.showDrafts&&e(ze,{onClose:()=>{A.showDrafts=!1},children:e(Ec,{onClose:()=>A.showDrafts=!1})}),!!t.showMediaModal&&e(ze,{onClick:h=>{(h.target===h.currentTarget||h.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Ss,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(ze,{onClose:()=>{A.showShortcutsSettings=!1},children:e(Gc,{onClose:()=>A.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(ze,{onClose:()=>{A.showGenericAccounts=!1},children:e($c,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(ze,{onClose:h=>{A.showMediaAlt=!1},children:e(Mc,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(m=t.showMediaAlt)==null?void 0:m.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(ze,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(Lc,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!t.showReportModal&&e(ze,{onClose:()=>{A.showReportModal=!1},children:e(Nc,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Bn({accountID:t,onChange:n}){const{masto:i}=ce(),[s,o]=L("default"),[a,f]=L(null),[d,c]=L(null),r=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||r,onClick:()=>{o("loading"),f("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":""}
${me?"has-spoiler":""}
${re?"show-media":""}
`,children:e(os,{class:t,media:$,lang:P,to:`/${s}/s/${y}?media-only=${E+1}`,onClick:a?le=>a(le,E,$,i):void 0})},B)})}const Ni=ct(da);function ua(t){var T,I,x,z,D;const n=Be(A),{masto:i,instance:s,authenticated:o}=ce(),[a,f]=be(()=>{const M=he.local.getJSON("accounts")||[];return[M.find(se=>se.info.id===bt())||M[0],M.length>1]},[]),d=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(M=>M.type==="following"),c=yo(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),r=j(),[m,h]=L(void 0),p=wo([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),u=j();async function v(M){return(M||!u.current)&&(u.current=i.v1.mutes.list({limit:80})),await u.current.next()}const b=j();async function w(M){return(M||!b.current)&&(b.current=i.v1.blocks.list({limit:80})),await b.current.next()}const k=Je("@mastodon/lists"),[y,C]=L([]);X(()=>{k&&m==="open"&&sn().then(C)},[m==="open"]);const _=j();return e(q,{children:[e("button",{ref:r,type:"button",class:`button plain nav-menu-button ${f?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{_.current=Date.now(),h(M=>M?void 0:"open")},onContextMenu:M=>{M.preventDefault(),A.showAccounts=!0},...c(),children:[f&&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(S,{icon:"menu",size:f?"s":"l",alt:g._({id:"zucql+"})})]}),e(as,{menuClassName:"nav-menu",state:m,anchorRef:r,onClose:()=>{h(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-_.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:p,unmountOnClose:!0,children:[!!((z=n.appVersion)!=null&&z.commitHash)&&n.appVersion.commitHash!=="1b8ab47"&&e("div",{class:"top-menu",children:[e(ge,{onClick:()=>{confirm(g._({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(S,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(l,{id:"95IFnD"})})]}),e(Ye,{})]}),e("section",{children:[e(Oe,{to:"/",children:[e(S,{icon:"home",size:"l"})," ",e("span",{children:e(l,{id:"i0qMbr"})})]}),o?e(q,{children:[d&&e(Oe,{to:"/following",children:[e(S,{icon:"following",size:"l"})," ",e("span",{children:e(l,{id:"y6sq5j"})})]}),e(Oe,{to:"/catchup",children:[e(S,{icon:"history2",size:"l"}),e("span",{children:e(l,{id:"xrl8fj"})})]}),Je("@mastodon/mentions")&&e(Oe,{to:"/mentions",children:[e(S,{icon:"at",size:"l"})," ",e("span",{children:e(l,{id:"/bZzdR"})})]}),e(Oe,{to:"/notifications",children:[e(S,{icon:"notification",size:"l"})," ",e("span",{children:e(l,{id:"iDNBZe"})}),n.notificationsShowNew&&e("sup",{title:g._({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ye,{}),((D=a==null?void 0:a.info)==null?void 0:D.id)&&e(Oe,{to:`/${s}/a/${a.info.id}`,children:[e(S,{icon:"user",size:"l"})," ",e("span",{children:e(l,{id:"vERlcd"})})]}),(y==null?void 0:y.length)>0?e(bn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(q,{children:[e(S,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(l,{id:"h16FyT"})}),e(S,{icon:"chevron-right"})]}),children:[e(Oe,{to:"/l",children:e("span",{children:e(l,{id:"BHWx+g"})})}),(y==null?void 0:y.length)>0&&e(q,{children:[e(Ye,{}),y.map(M=>e(Oe,{to:`/l/${M.id}`,children:e("span",{children:M.title})},M.id))]})]}):k&&e(Oe,{to:"/l",children:[e(S,{icon:"list",size:"l"}),e("span",{children:e(l,{id:"h16FyT"})})]}),e(Oe,{to:"/b",children:[e(S,{icon:"bookmark",size:"l"})," ",e("span",{children:e(l,{id:"7Ff7ia"})})]}),e(bn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(q,{children:[e(S,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(l,{id:"24misb"})}),e(S,{icon:"chevron-right"})]}),children:[e(Oe,{to:"/f",children:[e(S,{icon:"heart",size:"l"})," ",e("span",{children:e(l,{id:"zZOZj7"})})]}),e(Oe,{to:"/fh",children:[e(S,{icon:"hashtag",size:"l"})," ",e("span",{children:e(l,{id:"Xi1/bw"})})
//# sourceMappingURL=main-kbQH2PR3.js.map