import{A as F,y as W,M as at,u as ce,d as R,s as E,a as ie,b as Qe,p as mt,c as Ge,q as tt,g as ft,e,k as P,T as h,f as mi,h as It,i as Yt,j as xn,l as ke,L as Lo,C as Vn,D as Mo,n as xe,o as $o,r as En,t as gi,v as No,w as vi,x as Jt,z as Be,B as Po,E as de,F as Rn,G as Ln,_ as yt,H as As,I as Qd,J as Ts,K as xs,N as Do,O as Oo,P as ot,Q as zo,R as yi,S as Bo,U as gt,V as Fo,W as Uo,X as bi,Y as $t,Z as et,$ as Es,a0 as Rs,a1 as Ko,a2 as Ls,a3 as Ho,a4 as qo,a5 as on,a6 as jo,a9 as Yo,aa as Gn,ab as Wn,ac as Vo,ad as Fi,ae as Go,af as Wo,ag as Zo,ah as wi,ai as We,ak as Xo,al as Jo,am as Qo,an as ec}from"./useTitle-Ck4QBWzz.js";import{u as ki,w as He,s as re,o as Ui,a as tc,V as Ms,b as $s,I as _,C as Si,c as Ns,M as qe,d as je,S as dn,e as ge,f as On,R as bt,n as it,g as Ke,A as ut,N as pt,h as ct,i as dt,L as pe,l as Lt,j as nc,k as Ps,p as su,m as zn,q as Je,r as Bn,t as lt,v as Ki,T as Ds,x as nt,y as Ci,z as oi,B as Os,E as zs,D as Ze,F as ht,G as Ye,H as Ct,J as ic,K as sc,O as Ot,P as _i,Q as Bs,U as oc,W as Gt,X as cc,Y as ac,Z as Fn,_ as rc,$ as Bt,a0 as lc,a1 as dc,a2 as Fs,a3 as uc,a4 as Ii,a5 as hc,a6 as pc,a7 as fc,a8 as mc,a9 as gc,aa as Us,ab as vc,ac as yc,ad as Hi,ae as bc,af as wc,ag as Ht}from"./ScheduledAtField-CQDO0gVJ.js";var Ks=kc;function kc(n,i,o){var s=null,c=null,a=function(){s&&(clearTimeout(s),c=null,s=null)},p=function(){var d=c;a(),d&&d()},l=function(){if(!i)return n.apply(this,arguments);var d=this,r=arguments,u=o&&!s;if(a(),c=function(){n.apply(d,r)},s=setTimeout(function(){if(s=null,!u){var m=c;return c=null,m()}},i),u)return c()};return l.cancel=a,l.flush=p,l}/*! * 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 * @license MIT */(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(v,y){y=y||{bubbles:!1,cancelable:!1,detail:void 0};var S=i.createEvent("CustomEvent");return S.initCustomEvent(v,y.bubbles,y.cancelable,y.detail),S},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",u,!1),i.addEventListener("touchmove",m,!1),i.addEventListener("touchend",r,!1);var o=null,s=null,c=null,a=null,p=null,l=null,d=0;function r(v){if(l===v.target){var y=parseInt(f(l,"data-swipe-threshold","20"),10),S=f(l,"data-swipe-unit","px"),g=parseInt(f(l,"data-swipe-timeout","500"),10),w=Date.now()-p,b="",I=v.changedTouches||v.touches||[];if(S==="vh"&&(y=Math.round(y/100*i.documentElement.clientHeight)),S==="vw"&&(y=Math.round(y/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(a)?Math.abs(c)>y&&w0?b="swiped-left":b="swiped-right"):Math.abs(a)>y&&w0?b="swiped-up":b="swiped-down"),b!==""){var k={dir:b.replace(/swiped-/,""),touchType:(I[0]||{}).touchType||"direct",fingers:d,xStart:parseInt(o,10),xEnd:parseInt((I[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((I[0]||{}).clientY||-1,10)};l.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:k})),l.dispatchEvent(new CustomEvent(b,{bubbles:!0,cancelable:!0,detail:k}))}o=null,s=null,p=null}}function u(v){v.target.getAttribute("data-swipe-ignore")!=="true"&&(l=v.target,p=Date.now(),o=v.touches[0].clientX,s=v.touches[0].clientY,c=0,a=0,d=v.touches.length)}function m(v){if(!(!o||!s)){var y=v.touches[0].clientX,S=v.touches[0].clientY;c=o-y,a=s-S}}function f(v,y,S){for(;v&&v!==i.documentElement;){var g=v.getAttribute(y);if(g)return g;v=v.parentNode}return S}})(window,document);function Wt(n=()=>{},i=[]){const o=F(n);W(()=>{o.current=n},[i]),W(()=>{const s=()=>{const c=document.hidden||document.visibilityState==="hidden";o.current(!c)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Sc=1e3*3,qi=2e4,Cc=at(function({isLoggedIn:i}){const{_:o}=ce(),[s,c]=R(!0),a=F();Wt(r=>{clearTimeout(a.current),r?c(!0):a.current=setTimeout(()=>{c(!1)},qi)});const p=async(r,u,m)=>{if(E.notificationsLast){const f=r.v1.notifications.list({limit:1,sinceId:E.notificationsLast.id}).values(),{value:v}=await f.next();if(v?.length)if(m)E.notificationsShowNew=!0;else{let y;try{y=(await r.v1.markers.fetch({timeline:"notifications"}))?.notifications?.lastReadId}catch{}y?E.notificationsShowNew=v[0].id!==y:E.notificationsShowNew=!0}}};W(()=>{let r,u,m;if(i&&s){const{masto:f,streaming:v,instance:y}=ie();(async()=>{await p(f,y);let S=!1;v&&(u=setTimeout(()=>{(async()=>{try{S=!0,r=v.user.notification.subscribe();for await(const g of r){if(!r||!s)break;g.event==="notification"&&Qe(g.payload,y,{skipThreading:!0}),E.notificationsShowNew=!0}}catch{S=!1}S||(m=setInterval(()=>{p(f,y,!0)},qi))})()},Sc))})()}return()=>{r?.unsubscribe?.(),r=null,clearTimeout(u),clearInterval(m)}},[s,i]);const l=F(),d=()=>{l.current=Date.now(),fetch("./version.json").then(r=>r.json()).then(r=>{r&&(E.appVersion=r)}).catch(r=>{})};return ki(d,s&&1e3*60*30),Wt(r=>{r&&(l.current?Date.now()-l.current>1e3*60*60&&d():d())}),He("shift+alt+k",r=>{if(!r.shiftKey||!r.altKey)return;const u=E.settings.cloakMode;E.settings.cloakMode=!u,re({text:o(u?{id:"oguMwa"}:{id:"IXZLPs"})})},{useKey:!0,ignoreEventWhen:r=>r.metaKey||r.ctrlKey}),null}),_c=mt(async(n,i)=>{const o=n.v1.accounts.$select(i).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}).values(),{value:s}=await o.next();return s||[]},{maxAge:6e4});function Ic(){const{_:n}=ce(),i=Ge(E),{masto:o}=ie(),[s,c]=R(!1),[a,p]=R([]),[l,d]=R(!1),r=F(null),u=F(null),m=i.settings.shortcutsViewMode==="multi-column";function f(g){if(g.key&&g.key.toLowerCase()!=="c")return;if(i.composerState.minimized){E.composerState.minimized=!1,Ui();return}const w=document.querySelectorAll("data.compose-data"),b=!m&&w.length===1?JSON.parse(w[0].value):void 0;g.shiftKey?tc(b)||(E.showCompose=b||!0):(Ui(),E.showCompose=b||!0)}He("c, shift+c",f,{useKey:!0,ignoreEventWhen:g=>!!document.querySelector("#modal-container > *")||g.metaKey||g.ctrlKey||g.altKey});const v=Ms(()=>{c(!0)},{threshold:600}),y=tt(async()=>{try{d(!0);const g=ft();if(!g)return;const w=await _c(o,g);p(w)}catch{}finally{d(!1)}},[o]),S=tt(g=>{$s({replyToStatus:g}),c(!1)},[]);return W(()=>{s&&y()},[y,s]),e(P,{children:[e("button",{ref:r,type:"button",id:"compose-button",onClick:f,onContextMenu:g=>{g.preventDefault(),c(!0)},...v(),class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(_,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})}),e(Si,{ref:u,state:s?"open":void 0,anchorRef:r,onClose:()=>c(!1),direction:"top",gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:Ns(),containerProps:{style:{zIndex:19},onClick:()=>{u.current?.closeMenu?.()}},submenuOpenDelay:600,children:[e(qe,{to:"/sp",children:[e(_,{icon:"schedule"})," ",e("span",{children:e(h,{id:"+GkIdc"})})]}),e(je,{}),e(dn,{align:"end",direction:"top",shift:-8,disabled:l||a.length===0,label:e(P,{children:[e(_,{icon:"comment"})," ",e("span",{className:"menu-grow",children:e(h,{id:"LwOr4P"})}),l?"…":e(_,{icon:"chevron-right"})]}),children:a.length>0&&a.map(g=>{const w=new Date(g.createdAt),b=Date.now()-w.getTime()<864e5;return e(ge,{onClick:()=>S(g),children:e("small",{children:[e("div",{class:"menu-post-text",children:On(g)}),e("span",{className:"more-insignificant",children:[b&&e(P,{children:[e(bt,{datetime:w,format:"micro"})," ","‒"," "]}),e("time",{className:"created",dateTime:w.toISOString(),title:w.toLocaleString(),children:it(g.createdAt)})]})]})},g.id)})})]})]})}const Ac=at(function(){const{_:i}=ce(),o=Ge(E);function s(){E.showKeyboardShortcutsHelp=!1}return He("?",()=>{E.showKeyboardShortcutsHelp=!0},{useKey:!0,ignoreEventWhen:c=>/\/catchup/i.test(location.hash)||c.metaKey||c.ctrlKey||c.altKey}),!!o.showKeyboardShortcutsHelp&&e(Ke,{onClose:s,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"77Emn0"})})}),e("main",{children:e("table",{children:e("tbody",{children:[{action:i({id:"ulXSNi"}),keys:e("kbd",{children:"?"})},{action:i({id:"Gy9P9T"}),keys:e("kbd",{children:"j"})},{action:i({id:"6XYpYY"}),keys:e("kbd",{children:"k"})},{action:i({id:"DYowFe"}),keys:e(h,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(h,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e(h,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(h,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(h,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(h,{id:"nhpsIN",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"YrR3Co"}),keys:e("kbd",{children:"]"})},{action:i({id:"noxAFR"}),keys:e("kbd",{children:"["})},{action:i({id:"AIa/f7"}),keys:e("kbd",{children:"c"})},{action:i({id:"snPx8X"}),className:"insignificant",keys:e(h,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(h,{id:"py67WT",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{}),3:e("kbd",{})}})},{action:i({id:"A1taO8"}),keys:e("kbd",{children:"/"})},{action:i({id:"ImOQa9"}),keys:e("kbd",{children:"r"})},{action:i({id:"KFs8c6"}),className:"insignificant",keys:e(h,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(h,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(h,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(h,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:c,className:a,keys:p})=>e("tr",{children:[e("th",{class:a,children:c}),e("td",{children:p})]},c))})})})]})})}),ci=new Set,st=new WeakMap,Ft=new WeakMap,_t=new WeakMap,cn=new WeakMap,Zn=new WeakMap,ai=new WeakMap,zt=new WeakMap,Zt=new WeakMap,Vt=new WeakSet;let Mt,Ai=0,Ti=0;const kt="__aa_tgt",an="__aa_del",Mn="__aa_new",Hs=n=>{const i=Lc(n);i&&i.forEach(o=>Mc(o))},Tc=n=>{n.forEach(i=>{i.target===Mt&&Ec(),st.has(i.target)&&Kt(i.target)})};function xc(n){const i=cn.get(n);i?.disconnect();let o=st.get(n),s=0;const c=5;o||(o=Xt(n),st.set(n,o));const{offsetWidth:a,offsetHeight:p}=Mt,d=[o.top-c,a-(o.left+c+o.width),p-(o.top+c+o.height),o.left-c].map(u=>`${-1*Math.floor(u)}px`).join(" "),r=new IntersectionObserver(()=>{++s>1&&Kt(n)},{root:Mt,threshold:1,rootMargin:d});r.observe(n),cn.set(n,r)}function Kt(n){clearTimeout(Zt.get(n));const i=Un(n),o=rn(i)?500:i.duration;Zt.set(n,setTimeout(async()=>{const s=_t.get(n);try{await s?.finished,st.set(n,Xt(n)),xc(n)}catch{}},o))}function Ec(){clearTimeout(Zt.get(Mt)),Zt.set(Mt,setTimeout(()=>{ci.forEach(n=>ri(n,i=>qs(()=>Kt(i))))},100))}function Rc(n){setTimeout(()=>{ai.set(n,setInterval(()=>qs(Kt.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function qs(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let wt;const js=typeof window<"u"&&"ResizeObserver"in window;js&&(Mt=document.documentElement,new MutationObserver(Hs),wt=new ResizeObserver(Tc),window.addEventListener("scroll",()=>{Ti=window.scrollY,Ai=window.scrollX}),wt.observe(Mt));function Lc(n){return n.reduce((s,c)=>[...s,...Array.from(c.addedNodes),...Array.from(c.removedNodes)],[]).every(s=>s.nodeName==="#comment")?!1:n.reduce((s,c)=>{if(s===!1)return!1;if(c.target instanceof Element){if(Xn(c.target),!s.has(c.target)){s.add(c.target);for(let a=0;ao(n,zt.has(n)));for(let o=0;oc(s,zt.has(s)))}}function Ei(n){return Array.isArray(n)?n:[n]}function rn(n){return typeof n=="function"}function Nc(n){const i=st.get(n),o=Xt(n);if(!xi(n))return st.set(n,o);let s;if(!i)return;const c=Un(n);if(typeof c!="function"){const a=i.left-o.left,p=i.top-o.top,[l,d,r,u]=Ys(n,i,o),m={transform:`translate(${a}px, ${p}px)`},f={transform:"translate(0, 0)"};l!==d&&(m.width=`${l}px`,f.width=`${d}px`),r!==u&&(m.height=`${r}px`,f.height=`${u}px`),s=n.animate([m,f],{duration:c.duration,easing:c.easing})}else{const[a]=Ei(c(n,"remain",i,o));s=new Animation(a),s.play()}_t.set(n,s),st.set(n,o),s.addEventListener("finish",()=>Kt(n),{once:!0})}function ji(n){Mn in n&&delete n[Mn];const i=Xt(n);st.set(n,i);const o=Un(n);if(!xi(n))return;let s;if(typeof o!="function")s=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:o.duration*1.5,easing:"ease-in"});else{const[c]=Ei(o(n,"add",i));s=new Animation(c),s.play()}_t.set(n,s),s.addEventListener("finish",()=>Kt(n),{once:!0})}function Yi(n,i){var o;n.remove(),st.delete(n),Ft.delete(n),_t.delete(n),(o=cn.get(n))===null||o===void 0||o.disconnect(),setTimeout(()=>{if(an in n&&delete n[an],Object.defineProperty(n,Mn,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const s in i)n.style[s]=""},0)}function Pc(n){var i;if(!Ft.has(n)||!st.has(n))return;const[o,s]=Ft.get(n);Object.defineProperty(n,an,{value:!0,configurable:!0});const c=window.scrollX,a=window.scrollY;if(s&&s.parentNode&&s.parentNode instanceof Element?s.parentNode.insertBefore(n,s):o&&o.parentNode?o.parentNode.appendChild(n):(i=Vs(n))===null||i===void 0||i.appendChild(n),!xi(n))return Yi(n);const[p,l,d,r]=Oc(n),u=Un(n),m=st.get(n);(c!==Ai||a!==Ti)&&Dc(n,c,a,u);let f,v={position:"absolute",top:`${p}px`,left:`${l}px`,width:`${d}px`,height:`${r}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!rn(u))Object.assign(n.style,v),f=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:u.duration,easing:"ease-out"});else{const[y,S]=Ei(u(n,"remove",m));S?.styleReset!==!1&&(v=S?.styleReset||v,Object.assign(n.style,v)),f=new Animation(y),f.play()}_t.set(n,f),f.addEventListener("finish",()=>Yi(n,v),{once:!0})}function Dc(n,i,o,s){const c=Ai-i,a=Ti-o,p=document.documentElement.style.scrollBehavior;if(getComputedStyle(Mt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+c,window.scrollY+a),!n.parentElement)return;const d=n.parentElement;let r=d.clientHeight,u=d.clientWidth;const m=performance.now();function f(){requestAnimationFrame(()=>{if(!rn(s)){const v=r-d.clientHeight,y=u-d.clientWidth;m+s.duration>performance.now()?(window.scrollTo({left:window.scrollX-y,top:window.scrollY-v}),r=d.clientHeight,u=d.clientWidth,f()):document.documentElement.style.scrollBehavior=p}})}f()}function Oc(n){const i=st.get(n),[o,,s]=Ys(n,i,Xt(n));let c=n.parentElement;for(;c&&(getComputedStyle(c).position==="static"||c instanceof HTMLBodyElement);)c=c.parentElement;c||(c=document.body);const a=getComputedStyle(c),p=st.get(c)||Xt(c),l=Math.round(i.top-p.top)-vt(a.borderTopWidth),d=Math.round(i.left-p.left)-vt(a.borderLeftWidth);return[l,d,o,s]}function Gs(n,i={}){if(js&&wt&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!rn(i)&&!i.disrespectUserMotionPreference)){Vt.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),ri(n,Kt,Rc,p=>wt?.observe(p)),rn(i)?zt.set(n,i):zt.set(n,{duration:250,easing:"ease-in-out",...i});const a=new MutationObserver(Hs);a.observe(n,{childList:!0}),Zn.set(n,a),ci.add(n)}return Object.freeze({parent:n,enable:()=>{Vt.add(n)},disable:()=>{Vt.delete(n)},isEnabled:()=>Vt.has(n),destroy:()=>{Vt.delete(n),ci.delete(n),zt.delete(n);const s=Zn.get(n);s?.disconnect(),Zn.delete(n),ri(n,c=>{wt?.unobserve(c);const a=_t.get(c);try{a?.cancel()}catch{}_t.delete(c);const p=cn.get(c);p?.disconnect(),cn.delete(c);const l=ai.get(c);l&&clearInterval(l),ai.delete(c);const d=Zt.get(c);d&&clearTimeout(d),Zt.delete(c),st.delete(c),Ft.delete(c)})}})}function Kn(n){const i=F(null),[o,s]=R(),c=a=>{o&&(a?o.enable():o.disable())};return W(()=>{i.current instanceof HTMLElement&&s(Gs(i.current,n||{}))},[]),W(()=>()=>{var a;(a=o?.destroy)===null||a===void 0||a.call(o)},[o]),[i,c]}function zc(n){return("0"+n.toString(16)).slice(-2)}function Bc(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,zc).join("")}function Fc(n){const o=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",o)}function Uc(n){let i="";const o=new Uint8Array(n),s=o.byteLength;for(var c=0;c1,[p,l]=It(r=>r+1,0),[d]=Kn();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(h,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:d,children:s.map((r,u)=>{const m=r.info.id===c,f=u===0;return e("li",{children:[e("div",{children:[a&&e("span",{class:`current ${m?"is-current":""}`,children:e(_,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(ut,{url:r.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(m)try{const v=await o.v1.accounts.$select(r.info.id).fetch();r.info=v,Yt(s),l()}catch{}}}),e(pt,{account:a?{...r.info,acct:/@/.test(r.info.acct)?r.info.acct:`${r.info.acct}@${r.instanceURL}`}:r.info,showAcct:!0,onClick:()=>{m?E.showAccount=`${r.info.username}@${r.instanceURL}`:(xn(r.info.id),location.reload())}})]}),e("div",{class:"actions",children:[f&&a&&e(P,{children:[e("span",{class:"tag",children:e(h,{id:"ovBPCi"})})," "]}),e(ct,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(_,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[a&&e(P,{children:[e(ge,{disabled:m,onClick:()=>{xn(r.info.id),location.reload()},children:[e(_,{icon:"transfer"})," ",e(h,{id:"3t/Nrv"})]}),!Qc&&!m&&e(qe,{href:`./?account=${r.info.id}`,target:"_blank",children:[e(_,{icon:"external"}),e("span",{children:e(h,{id:"PZgZtY"})})]}),e(je,{})]}),e(ge,{onClick:()=>{E.showAccount=`${r.info.username}@${r.instanceURL}`},children:[e(_,{icon:"user"}),e("span",{children:e(h,{id:"40z2Fm"})})]}),e(je,{}),a&&e(P,{children:[e(ge,{disabled:f,onClick:()=>{s.splice(u,1),s.unshift(r),Yt(s),l()},children:[e(_,{icon:"check-circle"}),e("span",{children:e(h,{id:"PPcets"})})]}),e(ge,{disabled:u<=1,onClick:()=>{s.splice(u,1),s.splice(u-1,0,r),Yt(s),l()},children:[e(_,{icon:"arrow-up"}),e("span",{children:e(h,{id:"QyioBP"})})]}),e(ge,{disabled:u===0||u===s.length-1,onClick:()=>{s.splice(u,1),s.splice(u+1,0,r),Yt(s),l()},children:[e(_,{icon:"arrow-down"}),e("span",{children:e(h,{id:"3Ib6FN"})})]}),e(je,{})]}),e(dt,{subMenu:!0,confirmLabel:e(P,{children:[e(_,{icon:"exit"}),e("span",{children:e(h,{id:"k08LxG",values:{0:r.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!m,menuItemClassName:"danger",onClick:async()=>{await Jc({instanceURL:r.instanceURL,client_id:r.clientId,client_secret:r.clientSecret,token:r.accessToken}),s.splice(u,1),Yt(s),location.href=location.pathname||"/"},children:[e(_,{icon:"exit"}),e("span",{children:e(h,{id:"CXk1bI"})})]}),!!r?.createdAt&&e("div",{class:"footer",children:[e(_,{icon:"account-add"}),e("span",{children:e(h,{id:"+9E7iR",values:{0:it(r.createdAt)},components:{0:e(bt,{datetime:r.createdAt})}})})]})]})]})]},r.info.id)})}),e("p",{children:e(pe,{to:"/login",class:"button plain2",onClick:n,children:[e(_,{icon:"plus"})," ",e("span",{children:e(h,{id:"Is7/PB"})})]})}),a&&e("p",{children:e("small",{children:e(h,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const Li="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e",ta={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function Mi(){const{i18n:n}=ce(),i=ke(()=>Lo.map(o=>{const s=ta[o]||o.replace(/-[a-z]+$/i,""),c=Lt({code:s,locale:o,fallback:Vn.find(p=>p.code===o)?.nativeName}),a=Lt({code:s,locale:n.locale,fallback:Vn.find(p=>p.code===o)?.name});return{code:o,regionlessCode:s,_common:a,native:c}}).sort((o,s)=>{const c=o._common.localeCompare(s._common,n.locale);return c!==0?c:o.codes.code?1:0}),[]);return e("label",{class:"lang-selector",children:["🌐"," ",e("select",{class:"small",value:n.locale||Mo,onChange:o=>{xe.local.set("lang",o.target.value),$o(o.target.value)},children:[i.map(({code:o,regionlessCode:s,native:c})=>{const a=Lt({code:s,locale:n.locale,fallback:Vn.find(l=>l.code===o)?.name});return e("option",{value:o,"data-regionless-code":s,children:!!a&&a!==c?`${c} - ${a}`:c},o)}),void 0]})]})}function Vi(n){const{masto:i}=ie();return i.v1.push.subscription.create(n)}function na(){const{masto:n}=ie();return n.v1.push.subscription.fetch()}function ia(n){const{masto:i}=ie();return i.v1.push.subscription.update(n)}function sa(){const{masto:n}=ie();return n.v1.push.subscription.remove()}function qn(){return"serviceWorker"in navigator&&"PushManager"in window}function oa(){return navigator.serviceWorker.getRegistration()}async function $i(){const n=await oa(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function Zs(n){const i="=".repeat((4-n.length%4)%4),o=`${n}${i}`.replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(o),c=new Uint8Array(s.length);for(let a=0;a({code:n,name:i})),ha="TransLang API";function pa({onClose:n}){const{_:i}=ce(),o=Ge(E),s=xe.local.get("theme")||"auto",c=F(),a=o.settings.contentTranslationTargetLanguage||null,p=Ps(),l=Lt(p),d=xe.local.get("textSize")||Zi,[r,u]=R(gi()),{masto:m,authenticated:f,instance:v}=ie(),[y,S]=R(xe.local.get("experiments-tabBarV2")??!1);return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${d}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:c,onInput:g=>{g.preventDefault();const b=new FormData(c.current).get("theme"),I=document.documentElement;if(b==="auto"){I.classList.remove("is-light","is-dark");const k=document.querySelector('meta[data-theme-setting="manual"]');k&&(k.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(C=>{C.name="theme-color"})}else{I.classList.toggle("is-light",b==="light"),I.classList.toggle("is-dark",b==="dark");const k=document.querySelector('meta[data-theme-setting="manual"]');k&&(k.name="theme-color",k.content=b==="light"?k.dataset.themeLightColor:k.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(C=>{C.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",b==="auto"?"dark light":b),b==="auto"?xe.local.del("theme"):xe.local.set("theme",b)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:s==="light"}),e("span",{children:e(h,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:s==="dark"}),e("span",{children:e(h,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:s!=="light"&&s!=="dark"}),e("span",{children:e(h,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:Pt[0]},children:e(h,{id:"J6ypuD"})})," ",e("input",{type:"range",min:Pt[0],max:Pt[Pt.length-1],step:"1",value:d,list:"sizes",onChange:g=>{const w=parseInt(g.target.value,10);document.documentElement.style.setProperty("--text-size",`${w}px`),w===Zi?xe.local.del("textSize"):xe.local.set("textSize",g.target.value)}})," ",e("span",{style:{fontSize:Pt[Pt.length-1]},children:e(h,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:Pt.map(g=>e("option",{value:g}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(h,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener",children:e(h,{id:"FFmj1D"})})})]}),e(Mi,{})]})]})}),f&&e(P,{children:[e("h3",{children:e(h,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(h,{id:"NAjVvt"})," ",e(_,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:r["posting:default:visibility"]||"public",onChange:g=>{const{value:w}=g.target;(async()=>{try{await m.v1.accounts.updateCredentials({source:{privacy:w}}),u({...r,"posting:default:visibility":w}),No({...r,"posting:default:visibility":w})}catch{alert(i({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(h,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(h,{id:"pPYeIN"})}),e("option",{value:"private",children:e(h,{id:"x5LEuB"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(_,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(h,{id:"xlsg7n",values:{instance:v},components:{0:e("a",{href:`https://${v}/`,target:"_blank",rel:"noopener"})}})})]})]}),e("h3",{children:e(h,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:o.settings.autoRefresh,onChange:g=>{E.settings.autoRefresh=g.target.checked}})," ",e(h,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:o.settings.boostsCarousel,onChange:g=>{E.settings.boostsCarousel=g.target.checked}})," ",e(h,{id:"TSbnoW"})]})}),!!la&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.contentTranslation,onChange:g=>{const{checked:w}=g.target;E.settings.contentTranslation=w,w||(E.settings.contentTranslationTargetLanguage=null)}})," ",e(h,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${o.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(h,{id:"zXCa9e"})," ",e("select",{value:a||"",disabled:!o.settings.contentTranslation,style:{width:"10em"},onChange:g=>{E.settings.contentTranslationTargetLanguage=g.target.value||null},children:[e("option",{value:"",children:e(h,{id:"jNCSyx",values:{systemTargetLanguageText:l}})}),e("option",{disabled:!0,children:"──────────"}),Ji.map(g=>{const w=Lt({code:g.code,fallback:g.name}),b=Lt({code:g.code,locale:g.code}),I=b&&w!==b;return e("option",{value:g.code,children:I?`${b} - ${w}`:w})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(h,{id:"cc0NrU",values:{0:o.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Ji.map(g=>{const w=Lt({code:g.code,fallback:g.name}),b=Lt({code:g.code,locale:g.code}),I=b&&w!==b;return e("label",{children:[e("input",{type:"checkbox",checked:o.settings.contentTranslationHideLanguages.includes(g.code),onChange:k=>{const{checked:A}=k.target;A?E.settings.contentTranslationHideLanguages.push(g.code):E.settings.contentTranslationHideLanguages=o.settings.contentTranslationHideLanguages.filter(C=>C!==g.code)}})," ",I?e("span",{children:[b," ",e("span",{class:"insignificant ib",children:["- ",w]})]}):w]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"7I3sDQ",values:{TRANSLATION_API_NAME:ha},components:{0:e("a",{href:"https://github.com/cheeaun/translang-api",target:"_blank",rel:"noopener"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.contentTranslationAutoInline,disabled:!o.settings.contentTranslation,onChange:g=>{E.settings.contentTranslationAutoInline=g.target.checked}})," ",e(h,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!ua&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.composerGIFPicker,onChange:g=>{E.settings.composerGIFPicker=g.target.checked}})," ",e(h,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener"})}})})})]}),!!da&&f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.mediaAltGenerator,onChange:g=>{E.settings.mediaAltGenerator=g.target.checked}})," ",e(h,{id:"9q5uor"})," ",e(_,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener"})}})})})]}),f&&vi()?.mastodon>=2&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.groupedNotificationsAlpha,onChange:g=>{E.settings.groupedNotificationsAlpha=g.target.checked}})," ",e(h,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"X17jCM"})})})]}),f&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.shortcutSettingsCloudImportExport,onChange:g=>{E.settings.shortcutSettingsCloudImportExport=g.target.checked}})," ",e(h,{id:"570qTm"})," ",e(_,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:o.settings.cloakMode,onChange:g=>{E.settings.cloakMode=g.target.checked}})," ",e(h,{id:"lxYe+I",components:{0:e("span",{class:"insignificant"}),1:e("samp",{}),2:e("samp",{})}})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"T/hglb"})})})]}),f&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{E.showDrafts=!0,E.showSettings=!1},children:e(h,{id:"krk5ws"})})})]})}),f&&e(fa,{onClose:n}),e("h3",{children:e(h,{id:"uyJsf6"})}),e("section",{children:[e("div",{style:{display:"flex",flexWrap:"wrap",gap:8,lineHeight:1.25,alignItems:"center",marginTop:8},children:[e("img",{src:Li,alt:"",width:"64",height:"64",style:{aspectRatio:"1/1",verticalAlign:"middle",background:"#b7cdf9",borderRadius:12}}),e("div",{children:[e("b",{children:"Phanpy"})," ",e("a",{href:"https://hachyderm.io/@phanpy",rel:"noopener",onClick:g=>{g.preventDefault(),E.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(h,{id:"AZ2EoP",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank",rel:"noopener"}),1:e("a",{href:"https://mastodon.social/@cheeaun",rel:"noopener",onClick:g=>{g.preventDefault(),E.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener",children:e(h,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener",children:e(h,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener",children:"Patreon"})," ","·"," ",e("a",{href:"https://github.com/cheeaun/phanpy/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener",children:e(h,{id:"3ePd3I"})})," ","·"," ",e("a",{href:ra,target:"_blank",rel:"noopener",children:e(h,{id:"LcET2C"})})]}),e("p",{children:[Xi&&e(P,{children:[e(h,{id:"pFnMHn",values:{0:Xi.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(h,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/03ce4c6",target:"_blank",rel:"noopener",children:e(bt,{datetime:new Date("2025-09-17T13:51:06.398Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2025-09-17T13:51:06.398Z".slice(0,10).replace(/-/g,".")}.03ce4c6`,onClick:g=>{g.target.select();try{navigator.clipboard.writeText(g.target.value),re(i({id:"PiPfua"}))}catch{re(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function fa({onClose:n}){const{_:i}=ce();if(!qn())return null;const{instance:o}=ie(),[s,c]=R("default"),a=F(),[p,l]=R(!1),[d,r]=R(!1),u=F();W(()=>{(async()=>{c("loading");try{const{subscription:f,backendSubscription:v}=await ca();if(v?.policy&&v.policy!=="none"){l(!0);const{alerts:y,policy:S}=v;u.current=S;const{elements:g}=a.current,w=g.namedItem("policy");w&&(w.value=S),Object.entries(y).forEach(([b,I])=>{const k=g.namedItem(b);k?.type==="checkbox"&&(k.checked=!!I)})}c("default")}catch(f){/outside.*authorized/i.test(f.message)?r(!0):alert(f?.message||f),c("error")}})()},[]);const m=s==="loading";return e("form",{ref:a,onChange:()=>{setTimeout(()=>{const f=Object.fromEntries(new FormData(a.current)),v=!!f["policy-allow"],y={data:{policy:f.policy,alerts:{mention:!!f.mention,favourite:!!f.favourite,reblog:!!f.reblog,follow:!!f.follow,follow_request:!!f.followRequest,poll:!!f.poll,update:!!f.update,status:!!f.status}}};let S=0;Object.keys(y.data.alerts).forEach(w=>{y.data.alerts[w]?S++:delete y.data.alerts[w]});const g=u.current!==y.data.policy;v&&S>0?g?Wi().then(()=>{Gi(y)}).catch(w=>{alert(i({id:"I6pdY3"}))}):Gi(y).catch(w=>{alert(i({id:"I6pdY3"}))}):Wi().catch(w=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(h,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:m||d,name:"policy-allow",checked:p,onChange:async f=>{const{checked:v}=f.target;if(v){const y=await Notification.requestPermission();y==="granted"?l(!0):(l(!1),y==="denied"&&alert(i({id:"6LUsk7"})))}else l(!1)}})," ",e(h,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(f=>e("option",{value:f.value,children:f.label}))},components:{0:e("select",{name:"policy",disabled:m||d||!p})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!p,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"sub-section",children:e("ul",{children:[{value:"mention",label:i({id:"/bZzdR"})},{value:"favourite",label:i({id:"zZOZj7"})},{value:"reblog",label:i({id:"puY2t0"})},{value:"follow",label:i({id:"aaJhcT"})},{value:"followRequest",label:i({id:"6Fs1Ba"})},{value:"poll",label:i({id:"wNExRS"})},{value:"update",label:i({id:"K/EtE6"})},{value:"status",label:i({id:"2yr1/p"})}].map(f=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:f.value})," ",f.label]})}))})})})}),d&&e("div",{class:"sub-section",children:e("p",{children:e(h,{id:"8d0b8B",components:{0:e(pe,{to:`/login?instance=${o}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(h,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const li=()=>{let n=setTimeout(()=>{const i=document.getElementById("columns");if(i){const o=i.querySelector(".deck-container.focus");if(o)o.focus();else{const s=Array.from(i.querySelectorAll(".deck-container")).find(c=>c.getBoundingClientRect().left>=0);s?s.focus():i.querySelector(".deck-container")?.focus?.()}}else{const o=document.querySelectorAll("#modal-container > *");if(o?.length){const p=o[o.length-1],l=p.querySelector('[tabindex="-1"]')||p;if(l){l.focus();return}}if(document.querySelector(".deck-backdrop"))return;const c=document.querySelectorAll(".deck-container"),a=c[c.length-1];a&&a.tabIndex===-1&&a.focus()}},100);return()=>clearTimeout(n)};function Xs(n){if(!n)return;const i=Jt(),o=F(i.pathname);W(()=>{o.current&&i.pathname!==o.current&&n?.()},[i.pathname,n])}function ma({acct:n,instance:i}){let[o,s]=n.split("@");s||(s=i);const c=zn.toASCII(n);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:c,children:[e("b",{class:"handle-username",children:o}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:s})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(h,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(h,{id:"rZgCpJ"})]})]})]})}const ga=["image/jpeg","image/png","image/gif","image/webp"],Qi=ga.join(",");function va({name:n,value:i,disabled:o,index:s}){const[c,a]=R(!!i);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][name]`,defaultValue:n,disabled:o,maxLength:255,required:c,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${s}][value]`,defaultValue:i,disabled:o,maxLength:255,onChange:p=>a(!!p.currentTarget.value),dir:"auto"})})]})}function ya({onClose:n=()=>{}}){const{_:i}=ce(),{masto:o}=ie(),[s,c]=R("loading"),[a,p]=R(null),[l,d]=R(null),[r,u]=R(null);W(()=>{(async()=>{try{const k=await o.v1.accounts.verifyCredentials();p(k),c("default")}catch{c("error")}})()},[]);const{displayName:m,source:f,avatar:v,header:y}=a||{},{note:S,fields:g}=f||{},w=F(null),b=[...v?[{type:"image",url:v}]:[],...r?[{type:"image",url:r}]:[]],I=[...y?[{type:"image",url:y}]:[],...l?[{type:"image",url:l}]:[]];return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"9OpVZg"})})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("form",{onSubmit:k=>{k.preventDefault();const A=new FormData(k.target),C=A.get("header"),T=A.get("avatar"),M=A.get("display_name"),L=A.get("note"),U=w.current.querySelectorAll('input[name^="fields_attributes"]'),H=[];U.forEach(j=>{const X=j.name,[Q,V,G]=X.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],q=j.value?j.value.trim():"";V&&G&&q&&(H[V]||(H[V]={}),H[V][G]=q)}),H.forEach(j=>{j.name&&!j.value&&(j.value="")}),(async()=>{try{const j=await o.v1.accounts.updateCredentials({header:C,avatar:T,displayName:M,note:L,fieldsAttributes:H});n?.({state:"success",account:j})}catch(j){alert(j?.message||i({id:"FwMMx0"}))}})()},children:[e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(h,{id:"C5zXYJ"})," ",e("input",{type:"file",name:"header",accept:Qi,onChange:k=>{const A=k.target.files[0];if(A){const C=URL.createObjectURL(A);d(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[y?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:I,mediaIndex:0}},children:e("img",{src:y,alt:""})}):e("div",{class:"edit-media"}),l&&e(P,{children:[e(_,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:I,mediaIndex:1}},children:e("img",{src:l,alt:""})})]})]})]}),e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(h,{id:"4XF0BB"})," ",e("input",{type:"file",name:"avatar",accept:Qi,onChange:k=>{const A=k.target.files[0];if(A){const C=URL.createObjectURL(A);u(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[v?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:b,mediaIndex:0}},children:e("img",{src:v,alt:""})}):e("div",{class:"edit-media"}),r&&e(P,{children:[e(_,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:b,mediaIndex:1}},children:e("img",{src:r,alt:""})})]})]})]}),e("p",{children:e("label",{children:[e(h,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:m,maxLength:30,disabled:s==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(h,{id:"E+oKCO"}),e("textarea",{defaultValue:S,name:"note",maxLength:500,rows:"5",disabled:s==="loading",dir:"auto"})]})}),e("p",{children:e(h,{id:"T4I119"})}),e("table",{ref:w,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(h,{id:"87a/t/"})}),e("th",{children:e(h,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,g.length)}).map((k,A)=>{const{name:C="",value:T=""}=g[A]||{};return e(va,{name:C,value:T,index:A,disabled:s==="loading"},A)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:s==="loading",onClick:()=>{n?.()},children:e(h,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:s==="loading",children:e(h,{id:"tfDRzk"})})]})]})})]})}const ba=80;function wa({accountID:n,info:i,open:o=!1,onlyOpenIfHasEndorsements:s=!1}){const{masto:c}=ie(),a=F(),[p,l]=R("default"),[d,r]=R([]),[u,m]=R({});return W(()=>{Je("@mastodon/endorsements")&&o&&(async()=>{l("loading");try{const v=await c.v1.accounts.$select(n).endorsements.list({limit:ba});if(!v.length){l("default");return}r(v),l("default"),setTimeout(()=>{a.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300);const y=await Bn(v,u);y&&m(y)}catch{l("error")}})()},[o,n]),(s?o&&d.length>0:o)?e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"endorsements-container",ref:a,children:[e("h3",{children:e(h,{id:"UIfdY1",values:{0:i.username}})}),p==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):d.length>0?e("ul",{class:`endorsements ${d.length>10?"expanded":""}`,children:d.map(v=>e("li",{children:e(lt,{account:v,showStats:!0,avatarSize:"xxl",relationship:u[v.id]},v.id)}))}):e("p",{class:"ui-state insignificant",children:e(h,{id:"AgkUZa"})})]})})}):null}const Js=1e3*60,ka=24*60*60*1e3,di=mt(async()=>{const{masto:n}=ie(),i=await n.v1.lists.list();return i.sort((o,s)=>o.title.localeCompare(s.title)),i.length&&setTimeout(()=>{xe.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{maxAge:Js});async function un(){try{const{lists:n,updatedAt:i}=xe.account.get("lists")||{};return n?.length?(Date.now()-i>ka&&di(),n):await di()}catch{return[]}}const Sa=mt(n=>{const{masto:i}=ie();return i.v1.lists.$select(n).fetch()},{maxAge:Js});async function Qs(n){const{lists:i}=xe.account.get("lists")||{};if(i?.length){const o=i.find(s=>s.id===n);if(o)return o}try{return Sa(n)}catch{return null}}async function Ca(n){return(await Qs(n))?.title||""}function _a(n){const{lists:i}=xe.account.get("lists")||{};i?.length&&(i.push(n),i.sort((o,s)=>o.title.localeCompare(s.title)),xe.account.set("lists",{lists:i,updatedAt:Date.now()}))}function Ia(n){const{lists:i}=xe.account.get("lists")||{};if(i?.length){const o=i.findIndex(s=>s.id===n.id);o!==-1&&(i[o]=n,i.sort((s,c)=>s.title.localeCompare(c.title)),xe.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Aa(n){const{lists:i}=xe.account.get("lists")||{};if(i?.length){const o=i.findIndex(s=>s.id===n);o!==-1&&(i.splice(o,1),xe.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Ut({insignificant:n}){const{_:i}=ce();return e(_,{icon:"filter",size:"xs",class:`list-exclusive-badge ${n?"insignificant":""}`,title:i({id:"FNptcJ"})})}function Ni({list:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),[c,a]=R("default"),p=!!n,l=F(),d=F(),r=F();W(()=>{p&&(l.current.value=n.title,d.current.value=n.repliesPolicy,r.current&&(r.current.checked=n.exclusive))},[p]);const u=Je("@mastodon/list-exclusive")||Je("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(_,{icon:"x",alt:o({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:o(p?{id:"tuhghE"}:{id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:m=>{m.preventDefault();const f=new FormData(m.target),v=f.get("title"),y=f.get("replies_policy"),S=f.get("exclusive")==="on";a("loading"),(async()=>{try{let g;p?g=await s.v1.lists.$select(n.id).update({title:v,replies_policy:y,exclusive:S}):g=await s.v1.lists.create({title:v,replies_policy:y,exclusive:S}),a("default"),i?.({state:"success",list:g}),setTimeout(()=>{p?Ia(g):_a(g)},1)}catch{a("error"),alert(o(p?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(h,{id:"6YtxFj"})," ",e("input",{ref:l,type:"text",id:"list-title",name:"title",required:!0,disabled:c==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:d,name:"replies_policy",required:!0,disabled:c==="loading",children:[e("option",{value:"list",children:e(h,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(h,{id:"Mr53YX"})}),e("option",{value:"none",children:e(h,{id:"PM7llw"})})]})}),u&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:r,type:"checkbox",name:"exclusive",disabled:c==="loading"})," ",e(Ut,{insignificant:!0})," ",e(h,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:c==="loading",children:o(p?{id:"tfDRzk"}:{id:"hYgDIe"})}),p&&e(dt,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"+kQ/cY"}),onClick:()=>{a("loading"),(async()=>{try{await s.v1.lists.$select(n.id).remove(),a("default"),i?.({state:"deleted"}),setTimeout(()=>{Aa(n.id)},1)}catch{a("error"),alert(o({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}function Ta({accountID:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),[c,a]=R("default"),[p,l]=R([]),[d,r]=R([]),[u,m]=It(y=>y+1,0);W(()=>{a("loading"),(async()=>{try{const y=await un();l(y);const S=await s.v1.accounts.$select(n).lists.list();r(S),a("default")}catch{a("error")}})()},[u]);const[f,v]=R(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(_,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"sJ2yQc"})})}),e("main",{children:[p.length>0?e("ul",{class:"list-add-remove",children:p.map(y=>{const S=d.some(g=>g.id===y.id);return e("li",{children:e("button",{type:"button",class:`light ${S?"checked":""}`,disabled:c==="loading",onClick:()=>{a("loading"),(async()=>{try{S?await s.v1.lists.$select(y.id).accounts.remove({accountIds:[n]}):await s.v1.lists.$select(y.id).accounts.create({accountIds:[n]}),m()}catch{a("error"),alert(o(S?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(_,{icon:"check-circle",alt:"☑️"}),e("span",{children:y.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>v(!0),disabled:c!=="default",children:[e(_,{icon:"plus",size:"l"})," ",e("span",{children:e(h,{id:"Sb2gYF"})})]})]}),f&&e(Ke,{onClick:y=>{y.target===y.currentTarget&&v(!1)},children:e(Ni,{list:f?.list,onClose:y=>{y.state==="success"&&m(),v(!1)}})})]})}function xa({account:n,note:i,onRelationshipChange:o=()=>{},onClose:s=()=>{}}){const{_:c}=ce(),{masto:a}=ie(),[p,l]=R("default"),d=F(null);return W(()=>{let r;return d.current&&!i&&(r=setTimeout(()=>{d.current.focus?.()},100)),()=>{clearTimeout(r)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(_,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"DYqYm5",values:{0:n?.username||n?.acct},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:r=>{r.preventDefault();const m=new FormData(r.target).get("note");m?.trim()!==i?.trim()&&(l("loading"),(async()=>{try{const f=await a.v1.accounts.$select(n?.id).note.create({comment:m});l("default"),o(f),s()}catch(f){l("error"),alert(f?.message||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:d,name:"note",disabled:p==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:p==="loading",onClick:()=>{s?.()},children:e(h,{id:"dEgA5A"})}),e("span",{children:[e(Be,{abrupt:!0,hidden:p!=="loading"}),e("button",{disabled:p==="loading",type:"submit",children:e(h,{id:"SrwrEj"})})]})]})]})})]})}function Ea({note:n,fields:i,onClose:o}){const{_:s}=ce(),c=i?.map(({name:p,value:l})=>`${p} ${Ki(l)}`).join(` `)||"",a=Ki(n)+(c?` ${c}`:"");return e("div",{class:"sheet",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(_,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:a}),e(Ds,{forceTranslate:!0,text:a})]})]})}const Ra=[60*5,60*30,60*60,60*60*6,60*60*24,60*60*24*3,60*60*24*7,60*60*24*30,0],qt={0:{id:"9ZP9cc"},300:nt(5,"minute"),1800:nt(30,"minute"),3600:nt(1,"hour"),21600:nt(6,"hour"),86400:nt(1,"day"),259200:nt(3,"day"),604800:nt(1,"week"),2592e3:nt(30,"day")};function La({info:n,instance:i,standalone:o,authenticated:s,onRelationshipChange:c=()=>{},setShowEditProfile:a=()=>{},showEndorsements:p=!1,renderEndorsements:l=!1,setRenderEndorsements:d=()=>{}}){if(!n)return null;const{_:r,_:u}=ce(),{masto:m,instance:f,authenticated:v}=ie(),y=i===f,[S,g]=R("default"),[w,b]=R(null),{id:I,acct:k,url:A,username:C,locked:T,lastStatusAt:M,note:L,fields:U,moved:H}=n,j=F(I),{following:X,showingReblogs:Q,notifying:V,followedBy:G,blocking:q,blockedBy:he,muting:$,mutingNotifications:ne,requested:Y,domainBlocking:ee,endorsed:ue,note:ae}=w||{},[J,Ie]=R(null),[ye,be]=R(!1),Pe=k.includes("@")?k:`${k}@${i}`,Ce=Je("@mastodon/endorsements");W(()=>{if(n){const K=ft();let we;(async()=>{if(y&&s)we=I;else if(!y&&v){const Ne=n.acct.includes("@");try{const O=await m.v2.search.list({q:Ne?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});O.accounts.length&&(we=O.accounts[0].id,Ie(O.accounts[0]))}catch{}}if(!we)return;if(K===we){be(!0);return}j.current=we,g("loading");const Re=m.v1.accounts.relationships.fetch({id:[we]});try{const Ne=await Re;if(g("default"),Ne.length){const O=Ne[0];b(O),c({relationship:O,currentID:we})}}catch{g("error")}})()}},[n,s]),W(()=>{n&&ye&&Po(n)},[n,ye]);const Ae=S==="loading",[Te,De]=R(!1),[Oe,Fe]=R(!1),[se,Ee]=R(!1),[$e,_e]=R([]);return e(P,{children:[e("div",{class:"actions",children:[e("span",{children:[G?e("span",{class:"tag",children:e(h,{id:"p3UO/y"})}):M?e("small",{class:"insignificant",children:e(h,{id:"F3cM1G",values:{0:it(M,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),$&&e("span",{class:"tag danger",children:e(h,{id:"+IJm1Z"})}),q&&e("span",{class:"tag danger",children:e(h,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!ae&&e("button",{type:"button",class:"private-note-tag",title:u({id:"zxFxcH"}),onClick:()=>{Ee(!0)},dir:"auto",children:e("span",{children:ae})}),e(ct,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:Ae,children:e(_,{icon:"more",size:"l",alt:u({id:"2FYpfJ"})})}),onMenuChange:K=>{X&&K.open&&(async()=>{try{const we=await m.v1.accounts.$select(j.current).lists.list();_e(we)}catch{}})()},children:[v&&!ye?e(P,{children:[e(ge,{onClick:()=>{$s({draftStatus:{status:`@${J?.acct||k} `}})},children:[e(_,{icon:"at"}),e("span",{children:e(h,{id:"3LkfZu",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ge,{onClick:()=>{De(!0)},children:[e(_,{icon:"translate"}),e("span",{children:e(h,{id:"R8mSiS"})})]}),Je("@mastodon/profile-private-note")&&e(ge,{onClick:()=>{Ee(!0)},children:[e(_,{icon:"pencil"}),e("span",{children:u(ae?{id:"U+Gokq"}:{id:"VcQzRi"})})]}),X&&!!w&&e(P,{children:[e(ge,{onClick:()=>{g("loading"),(async()=>{try{const K=await m.v1.accounts.$select(j.current).follow({notify:!V});K&&b(K),g("default"),re(K.notifying?u({id:"jL3N0G",values:{username:C}}):u({id:"0h4/9h",values:{username:C}}))}catch(K){alert(K),g("error")}})()},children:[e(_,{icon:"notification"}),e("span",{children:u(V?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(ge,{onClick:()=>{g("loading"),(async()=>{try{const K=await m.v1.accounts.$select(j.current).follow({reblogs:!Q});K&&b(K),g("default"),re(K.showingReblogs?u({id:"0X2KC8",values:{username:C}}):u({id:"cXWjH0",values:{username:C}}))}catch(K){alert(K),g("error")}})()},children:[e(_,{icon:"rocket"}),e("span",{children:u(Q?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),Ce&&X&&e(ge,{onClick:()=>{g("loading"),(async()=>{try{if(ue){const K=await m.v1.accounts.$select(J?.id||I).unpin();b(K),g("default"),re(u({id:"pWFLFk",values:{username:C}}))}else{const K=await m.v1.accounts.$select(J?.id||I).pin();b(K),g("default"),re(u({id:"xhiXaF",values:{username:C}}))}}catch{g("error"),ue?re(u({id:"xHq5L2",values:{username:C}})):re(u({id:"Owr/5+",values:{username:C}}))}})()},children:[e(_,{icon:"endorsement"}),u(ue?{id:"S9JvjK"}:{id:"UlJ3QN"})]}),p&&Ce&&!l&&e(ge,{onClick:()=>d(!0),children:[e(_,{icon:"endorsement"}),e("span",{children:e(h,{id:"Qopbnd"})})]}),X&&e(ge,{onClick:()=>{Fe(!0)},children:[e(_,{icon:"list"}),$e.length?e(P,{children:[e("small",{class:"menu-grow",children:[e(h,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:$e.map(K=>K.title).join(", ")})]}),e("small",{class:"more-insignificant",children:$e.length})]}):e("span",{children:e(h,{id:"sJ2yQc"})})]}),e(je,{})]}):Ce&&!l&&e(P,{children:[e(ge,{onClick:()=>d(!0),children:[e(_,{icon:"endorsement"}),"Show featured profiles"]}),e(je,{})]}),e(ge,{onClick:()=>{const K=`@${J?.acct||Pe}`;try{navigator.clipboard.writeText(K),re(u({id:"zJoEwS"}))}catch{re(u({id:"BC0lSD"}))}},children:[e(_,{icon:"copy"}),e("small",{children:[e(h,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",J?.acct||Pe]})]})]}),e(ge,{href:A,target:"_blank",children:[e(_,{icon:"external"}),e("small",{class:"menu-double-lines",children:Ma(A)})]}),e("div",{class:"menu-horizontal",children:[e(ge,{onClick:()=>{try{navigator.clipboard.writeText(A),re(u({id:"edWbV6"}))}catch{re(u({id:"W1ewR0"}))}},children:[e(_,{icon:"link"}),e("span",{children:e(h,{id:"he3ygx"})})]}),navigator?.share&&navigator?.canShare?.({url:A})&&e(ge,{onClick:()=>{try{navigator.share({url:A})}catch{alert(u({id:"TtG3Uh"}))}},children:[e(_,{icon:"share"}),e("span",{children:e(h,{id:"LFKLqp"})})]})]}),!!w&&e(P,{children:[e(je,{}),$?e(ge,{onClick:()=>{g("loading"),(async()=>{try{const K=await m.v1.accounts.$select(J?.id||I).unmute();b(K),g("default"),re(u({id:"B4Xkly",values:{username:C}})),E.reloadGenericAccounts.id="mute",E.reloadGenericAccounts.counter++}catch{g("error")}})()},children:[e(_,{icon:"unmute"}),e("span",{children:e(h,{id:"Q/HUhC",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(dn,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(P,{children:[e(_,{icon:"mute"}),e("span",{class:"menu-grow",children:e(h,{id:"xhPEH3",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(_,{icon:"time"}),e(_,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:Ra.map(K=>e(ge,{onClick:()=>{g("loading"),(async()=>{try{const we=await m.v1.accounts.$select(J?.id||I).mute({duration:K});b(we),g("default"),re(u({id:"/plB9m",values:{0:typeof qt[K]=="function"?qt[K]():r(qt[K]),username:C}})),E.reloadGenericAccounts.id="mute",E.reloadGenericAccounts.counter++}catch{g("error"),re(u({id:"vWGBjT",values:{username:C}}))}})()},children:typeof qt[K]=="function"?qt[K]():r(qt[K])}))})}),G&&e(dt,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(P,{children:[e(_,{icon:"user-x"}),e("span",{children:e(h,{id:"unyq2W",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{g("loading"),(async()=>{try{const K=await m.v1.accounts.$select(J?.id||I).removeFromFollowers();b(K),g("default"),re(u({id:"AgkcM/",values:{username:C}})),E.reloadGenericAccounts.id="followers",E.reloadGenericAccounts.counter++}catch{g("error")}})()},children:[e(_,{icon:"user-x"}),e("span",{children:e(h,{id:"VCZ0OT"})})]}),e(dt,{subMenu:!0,confirm:!q,confirmLabel:e(P,{children:[e(_,{icon:"block"}),e("span",{children:e(h,{id:"aforS9",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{g("loading"),(async()=>{try{if(q){const K=await m.v1.accounts.$select(J?.id||I).unblock();b(K),g("default"),re(u({id:"sI9N29",values:{username:C}}))}else{const K=await m.v1.accounts.$select(J?.id||I).block();b(K),g("default"),re(u({id:"uYcYzu",values:{username:C}}))}E.reloadGenericAccounts.id="block",E.reloadGenericAccounts.counter++}catch{g("error"),q?re(u({id:"0tG4wG",values:{username:C}})):re(u({id:"pA+qEx",values:{username:C}}))}})()},children:q?e(P,{children:[e(_,{icon:"unblock"}),e("span",{children:e(h,{id:"/3LJfX",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(P,{children:[e(_,{icon:"block"}),e("span",{children:e(h,{id:"JRswkR",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ge,{className:"danger",onClick:()=>{E.showReportModal={account:J||n}},children:[e(_,{icon:"flag"}),e("span",{children:e(h,{id:"qTJgpR",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),v&&ye&&o&&Je("@mastodon/profile-edit")&&e(P,{children:[e(je,{}),e(ge,{onClick:()=>{a(!0)},children:[e(_,{icon:"pencil"}),e("span",{children:e(h,{id:"9OpVZg"})})]})]}),!1]}),!w&&S==="loading"&&e(Be,{abrupt:!0}),!!w&&!H&&e(dt,{confirm:X||Y,confirmLabel:e("span",{children:u(Y?{id:"e7qQIH"}:{id:"eYsAQr",values:{0:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:Ae,onClick:()=>{g("loading"),(async()=>{try{let K;X||Y?K=await m.v1.accounts.$select(j.current).unfollow():K=await m.v1.accounts.$select(j.current).follow(),K&&(b(K),p&&Ce&&!l&&K.following&&d("onlyOpenIfHasEndorsements")),g("default")}catch(K){alert(K),g("error")}})()},children:e("button",{type:"button",class:`${X||Y?"light swap":""}`,"data-swap-state":X||Y?"danger":"",disabled:Ae,children:X?e(P,{children:[e("span",{children:e(h,{id:"y6sq5j"})}),e("span",{children:e(h,{id:"HKrBPX"})})]}):Y?e(P,{children:[e("span",{children:e(h,{id:"Yx0Ud8"})}),e("span",{children:e(h,{id:"yTVtKs"})})]}):T?e(P,{children:[e(_,{icon:"lock"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]}):u({id:"MKEPCY"})})})]})]}),!!Te&&e(Ke,{onClose:()=>{De(!1)},children:e(Ea,{note:L,fields:U,onClose:()=>De(!1)})}),!!Oe&&e(Ke,{onClose:()=>{Fe(!1)},children:e(Ta,{accountID:j.current,onClose:()=>Fe(!1)})}),!!se&&e(Ke,{onClose:()=>{Ee(!1)},children:e(xa,{account:n,note:ae,onRelationshipChange:K=>{b(K)},onClose:()=>Ee(!1)})})]})}function Ma(n){if(!n)return;const i=URL.parse(n);if(!i)return;const{host:o,pathname:s}=i,c=s.replace(/\/$/,"").replace(/^\//,"");return e(P,{children:[e("span",{class:"more-insignificant",children:[zn.toUnicode(o),"/"]}),e("wbr",{}),e("span",{children:c})]})}const es=80,eo=1e3*60*10;function $a(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const Na=mt($a,{maxAge:eo});async function Pa(n,i){const o=i.v1.accounts.$select(n).statuses.list({limit:20}).values().next(),{value:s}=await o,c={total:s.length,originals:0,replies:0,boosts:0};return s.forEach(a=>{a.reblog?c.boosts++:a.inReplyToId&&a.inReplyToAccountId!==a.account.id?c.replies++:c.originals++}),s.length&&(c.daysSinceLastPost=Math.ceil((Date.now()-Date.parse(s[s.length-1].createdAt))/864e5)),c}const Da=mt(Pa,{maxAge:eo});function to({account:n,fetchAccount:i=()=>{},standalone:o,instance:s,authenticated:c,showEndorsements:a=!1}){const{i18n:p,_:l}=ce(),{masto:d,authenticated:r}=ie({instance:s}),{masto:u,instance:m}=ie(),[f,v]=R("default"),y=typeof n=="string",[S,g]=R(y?null:n),w=ke(()=>s===m,[s,m]);W(()=>{if(!y){g(n);return}v("loading"),(async()=>{try{const D=await i();E.accounts[`${D.id}@${s}`]=D,g(D),v("default")}catch{g(null),v("error")}})()},[y,n,i]);const{acct:b,avatar:I,avatarStatic:k,bot:A,createdAt:C,displayName:T,emojis:M,fields:L,followersCount:U,followingCount:H,group:j,id:X,lastStatusAt:Q,locked:V,note:G,statusesCount:q,url:he,username:$,memorial:ne,moved:Y,roles:ee,hideCollections:ue}=S||{};let ae=!1,{header:J,headerStatic:Ie}=S||{};(!J||/missing\.png$/.test(J))&&I&&!/missing\.png$/.test(I)&&(J=I,ae=!0,k&&!/missing\.png$/.test(k)&&(Ie=k));const ye=ke(()=>X===ft(),[X]);W(()=>{const D=!!(S?.id&&S?.username&&S?.acct&&S?.avatar&&S?.avatarStatic&&S?.displayName&&S?.url);if(ye&&s&&D){const le=mi();let ve=!1;le.forEach(me=>{me.info.id===S.id&&me.instanceURL===s&&(me.info=S,ve=!0)}),ve&&Yt(le)}},[ye,S,s]);const be=Ci(he),[Pe,Ce]=R([]),Ae=F(),Te=F([]);async function De(D){(D||!Ae.current)&&(Ae.current=d.v1.accounts.$select(X).followers.list({limit:es}).values());const le=await Ae.current.next();if(ye||!w)return le;const{value:ve}=le;let me=[];if(D){let z=[];try{z=await d.v1.accounts.familiarFollowers.fetch({id:[X]})}catch{}Te.current=z?.[0]?.accounts||[],me=[...Te.current,...ve.filter(fe=>!Te.current.some(Me=>Me.id===fe.id))]}else ve?.length&&(me=ve.filter(z=>!Te.current.some(fe=>fe.id===z.id)));return{...le,value:me}}const Oe=F();async function Fe(D){return(D||!Oe.current)&&(Oe.current=d.v1.accounts.$select(X).following.list({limit:es}).values()),await Oe.current.next()}const se=o?"div":pe,Ee=s?`/${s}/a/${X}`:`/a/${X}`,[$e,_e]=R([]),[K,we]=R(),[Re,Ne]=R("default"),O=!!K?.total,Se=async D=>{try{const le=await Na(D,u);_e(le[0].accounts.slice(0,Oa))}catch{}},Ue=async()=>{if(X){Ne("loading");try{const D=await Da(X,d);we(D),Ne("default")}catch{Ne("error")}}},ze=tt(({relationship:D,currentID:le})=>{D.following||(Se(le),!o&&q>0&&Ue())},[o,X,q]),N=tt(D=>{D.id===X&&(g(D),E.accounts[`${D.id}@${s}`]=D)},[X,s]),oe=y&&n&&/^https?:\/\//.test(n),[x,B]=R(!1),[Z,te]=R(!1);return e(P,{children:[e("div",{tabIndex:"-1",class:`account-container ${f==="loading"?"skeleton":""}`,style:{"--header-color-1":Pe[0],"--header-color-2":Pe[1],"--header-color-3":Pe[2],"--header-color-4":Pe[3]},children:[f==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"44hICK"})}),y?e("p",{children:oe?e("a",{href:n,target:"_blank",rel:"noopener",children:n}):e("code",{class:"insignificant",children:n})}):e("p",{children:e("a",{href:he,target:"_blank",rel:"noopener",children:[e(h,{id:"Aadw0+"})," ",e(_,{icon:"external"})]})})]}),f==="loading"?e(P,{children:[e("header",{children:e(lt,{avatarSize:"xxxl",skeleton:!0})}),e("main",{children:[e("div",{class:"note",children:[e("p",{children:"███████ ████ ████"}),e("p",{children:"████ ████████ ██████ █████████ ████ ██"})]}),e("div",{class:"account-metadata-box",children:[e("div",{class:"profile-metadata",children:[e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"███"}),e("p",{children:"██████"})]}),e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"████"}),e("p",{children:"███████████"})]})]}),e("div",{class:"stats",children:[e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(_,{icon:"more",size:"l",alt:l({id:"2FYpfJ"})})})})]})]})]}):S&&e(P,{children:[!!Y&&e("div",{class:"account-moved",children:[e("p",{children:e(h,{id:"C6cVP/",values:{displayName:T},components:{0:e("b",{})}})}),e(lt,{account:Y,instance:s,onClick:D=>{D.stopPropagation(),E.showAccount=Y}})]}),!!J&&!/missing\.png$/.test(J)&&e("img",{src:J,alt:"",class:`header-banner ${ae?"header-is-avatar":""}`,onError:D=>{D.target.crossOrigin?D.target.src!==Ie?D.target.src=Ie:(D.target.removeAttribute("crossorigin"),D.target.src=J):D.target.src!==Ie?D.target.src=Ie:D.target.remove()},crossOrigin:"anonymous",onLoad:D=>{D.target.classList.add("loaded");try{const le=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),ve=le.getContext("2d",{willReadFrequently:!0});le.width=D.target.width,le.height=D.target.height,ve.imageSmoothingEnabled=!1,ve.drawImage(D.target,0,0);const me=10,fe=[ve.getImageData(0,0,me,me).data,ve.getImageData(D.target.width-me,0,me,me).data,ve.getImageData(0,D.target.height-me,me,me).data,ve.getImageData(D.target.width-me,D.target.height-me,me,me).data].map(Me=>{let Le=0,Ve=0,Xe=0,Tt=0;for(let Et=0;Et{const[Le,Ve,Xe,Tt]=za(Me);return`rgba(${Le}, ${Ve}, ${Xe}, ${Tt})`});Ce(fe)}catch{}}}),e("header",{children:o?e(ct,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(lt,{account:S,instance:s,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(ma,{acct:b,instance:s})}),e(ge,{onClick:()=>{const D=b.includes("@")?`@${b}`:`@${b}@${s}`;try{navigator.clipboard.writeText(D),re(l({id:"zJoEwS"}))}catch{re(l({id:"BC0lSD"}))}},children:[e(_,{icon:"link"}),e("span",{children:e(h,{id:"27x6gl"})})]}),e(ge,{href:he,target:"_blank",children:[e(_,{icon:"external"}),e("span",{children:e(h,{id:"Bz5hLl"})})]}),e(je,{}),e(ge,{onClick:()=>{E.showMediaModal={mediaAttachments:[{type:"image",url:k}]}},children:[e(_,{icon:"user"}),e("span",{children:e(h,{id:"7WYl2I"})})]}),!!Ie&&!ae&&e(ge,{onClick:()=>{E.showMediaModal={mediaAttachments:[{type:"image",url:Ie}]}},children:[e(_,{icon:"media"}),e("span",{children:e(h,{id:"ZNme5R"})})]}),r&&ye&&Je("@mastodon/profile-edit")&&e(P,{children:[e(je,{}),e(ge,{onClick:()=>{B(!0)},children:[e(_,{icon:"pencil"}),e("span",{children:e(h,{id:"9OpVZg"})})]})]})]}):e(lt,{account:S,instance:s,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!ne&&e("span",{class:"tag",children:e(h,{id:"prdIOK"})}),!!A&&e("span",{class:"tag",children:[e(_,{icon:"bot"})," ",e(h,{id:"9Vdq+j"})]}),!!j&&e("span",{class:"tag",children:[e(_,{icon:"group"})," ",e(h,{id:"L8fEEm"})]}),e("div",{class:"note",dir:"auto",onClick:Os({instance:m}),dangerouslySetInnerHTML:{__html:oi(G,{emojis:M})}}),e("div",{class:"account-metadata-box",children:[L?.length>0&&e("div",{class:"profile-metadata",children:L.map(({name:D,value:le,verifiedAt:ve},me)=>e("div",{class:`profile-field ${ve?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(zs,{text:D,emojis:M})," ",!!ve&&e(_,{icon:"check-circle",size:"s",alt:l({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:oi(le,{emojis:M})}})]},D+me))}),e("div",{class:"stats",children:[e(se,{tabIndex:0,to:Ee,onClick:()=>{setTimeout(()=>{E.showGenericAccounts={id:"followers",heading:l({id:"x5LEuB"}),fetchAccounts:De,instance:s,excludeRelationshipAttrs:ye?["followedBy"]:[],blankCopy:ue?l({id:"BRV/wh"}):void 0}},0)},children:[!!$e.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:$e.map(D=>e(ut,{url:D.avatarStatic,size:"s",alt:`${D.displayName} @${D.acct}`,squircle:D?.bot}))})}),e(h,{id:"TbttfX",values:{0:Ze(U),1:Ze(U),followersCount:U},components:{0:e("span",{title:U}),1:e("span",{title:U})}})]}),e(se,{class:"insignificant",tabIndex:0,to:Ee,onClick:()=>{setTimeout(()=>{E.showGenericAccounts={heading:l({id:"following.stats"}),fetchAccounts:Fe,instance:s,excludeRelationshipAttrs:ye?["following"]:[],blankCopy:ue?l({id:"BRV/wh"}):void 0}},0)},children:[e(h,{id:"SGcIK+",values:{0:Ze(H),followingCount:H},components:{0:e("span",{title:H})}}),e("br",{})]}),e(se,{class:"insignificant",to:Ee,children:e(h,{id:"C4x3+X",values:{0:Ze(q),1:Ze(q),statusesCount:q},components:{0:e("span",{title:q}),1:e("span",{title:q})}})}),!!C&&e("div",{class:"insignificant",children:e(h,{id:"PCcEFZ",values:{0:it(C,{hideTime:!0})},components:{0:e("time",{datetime:C})}})})]})]}),!!K&&e(se,{to:Ee,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:O?e("div",{class:"posting-stats",title:l({id:"wiuWLe",values:{0:(K.originals/K.total).toLocaleString(p.locale||void 0,{style:"percent"}),1:(K.replies/K.total).toLocaleString(p.locale||void 0,{style:"percent"}),2:(K.boosts/K.total).toLocaleString(p.locale||void 0,{style:"percent"})}}),children:[e("div",{children:K.daysSinceLastPost<365?de._({id:"oZUtTk",values:{0:K.total,1:K.daysSinceLastPost,2:K.daysSinceLastPost,3:K.daysSinceLastPost,4:K.total,5:K.total,6:K.daysSinceLastPost}}):de._({id:"JvA7Mo",values:{0:K.total,1:K.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${K.originals/K.total*100}%`,"--replies-percentage":`${(K.originals+K.replies)/K.total*100}%`}}),e("div",{class:"posting-stats-legends",children:[e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-originals"})," ",e(h,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(h,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(h,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(h,{id:"vl3XTJ"})})})})}),!Y&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!K,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:Re==="loading",onClick:()=>{Ue()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${Re==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(h,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(La,{info:S,instance:s,standalone:o,authenticated:c,onRelationshipChange:ze,onProfileUpdate:N,setShowEditProfile:B,showEndorsements:a,renderEndorsements:Z,setRenderEndorsements:te})}),e(wa,{accountID:X,info:S,open:Z,onlyOpenIfHasEndorsements:Z==="onlyOpenIfHasEndorsements"})]})]}),!!x&&e(Ke,{onClose:()=>{B(!1)},children:e(ya,{onClose:({state:D,account:le}={})=>{B(!1),D==="success"&&le&&N(le)}})})]})}const Oa=3;function za([n,i,o]){const s=.2126*n+.7152*i+.0722*o;let c;return s>=220?c=1:s<=50?c=.1:c=s/255,c=Math.min(1,c),[n,i,o,c]}function Ba({account:n,instance:i,onClose:o}){const{_:s}=ce(),{masto:c,instance:a,authenticated:p}=ie({instance:i}),l=typeof n=="string";return W(()=>{l||(E.accounts[`${n.id}@${a}`]=n)},[n]),Xs(o),e("div",{class:"sheet",children:[!!o&&e("button",{type:"button",class:"sheet-close outer",onClick:o,children:e(_,{icon:"x",alt:s({id:"yz7wBu"})})}),e(to,{instance:a,authenticated:p,account:n,fetchAccount:async()=>{if(l)try{return await c.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const r=await c.v2.search.list({q:n,type:"accounts",limit:p?1:11,resolve:p});if(r.accounts.length){const u=r.accounts.find(m=>m.url===n||n.startsWith(m.url));if(u)return u}if(/^https?:\/\/[^/]+\/@[^/]+$/.test(n)){const u=URL.parse(n);if(u){const{hostname:m,pathname:f}=u,v=f.replace(/^\//,"").replace(/\/$/,"")+"@"+m,y=await c.v2.search.list({q:v,type:"accounts",limit:1,resolve:p});if(y.accounts.length)return y.accounts[0]}}}else return n}})]})}function Fa({onClose:n}){const{_:i}=ce(),{masto:o}=ie(),[s,c]=R("default"),[a,p]=R([]),[l,d]=It(u=>u+1,0);W(()=>{c("loading"),(async()=>{try{const u=await ht.drafts.keys();if(u.length){const m=Rn(),f=u.filter(v=>v.startsWith(m));if(f.length){const v=await ht.drafts.getMany(f);v.sort((y,S)=>Date.parse(S.updatedAt)-Date.parse(y.updatedAt)),p(v)}else p([])}else p([]);c("default")}catch{c("error")}})()},[l]);const r=a?.length>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(h,{id:"krk5ws"})," ",e(Be,{abrupt:!0,hidden:s!=="loading"})]}),r&&e("div",{class:"insignificant",children:e(h,{id:"Ap/10+"})})]}),e("main",{children:r?e(P,{children:[e("ul",{class:"drafts-list",children:a.map(u=>{const{updatedAt:m,key:f,draftStatus:v,replyTo:y}=u,S=new Date(m);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(_,{icon:y?"reply":"quill",size:"s"})," ",e("time",{children:[!!y&&e(P,{children:[e("span",{class:"bidi-isolate",children:["@",y.account.acct]}),e("br",{})]}),it(S)]})]}),e(dt,{confirmLabel:e("span",{children:e(h,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:s==="loading",onClick:()=>{(async()=>{try{await ht.drafts.del(f),d()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:s==="loading",children:e(h,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:s==="loading",class:"draft-item",onClick:async()=>{let g;if(y){c("loading");try{g=await o.v1.statuses.$select(y.id).fetch()}catch{alert(i({id:"tMwimH"})),c("default");return}c("default")}window.__COMPOSE__={draftStatus:v,replyToStatus:g},E.showCompose=!0,E.showDrafts=!1},children:e(Ua,{draft:u})})]},m)})}),a.length>1&&e("p",{children:e(dt,{confirmLabel:e("span",{children:e(h,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:s==="loading",onClick:()=>{(async()=>{c("loading");try{await ht.drafts.delMany(a.map(u=>u.key)),c("default"),d()}catch{alert(i({id:"0J4sZq"})),c("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:s==="loading",children:e(h,{id:"hOg+Mt"})})})})]}):e("p",{children:e(h,{id:"8iQ+jk"})})})]})}function Ua({draft:n}){const{_:i}=ce(),{draftStatus:o,replyTo:s}=n,{status:c,spoilerText:a,poll:p,mediaAttachments:l}=o,d=p?.options?.length>0,r=l?.length>0,u=d||r,m=ke(()=>{if(!r)return;const f=l.find(S=>/image/.test(S.type));if(!f)return;const{file:v}=f;return URL.createObjectURL(v)},[r,l]);return e(P,{children:e("div",{class:"mini-draft",children:[u&&e("div",{class:`mini-draft-aside ${m?"has-image":""}`,style:m?{"--bg-image":`url(${m})`}:{},children:[d&&e(_,{icon:"poll",alt:i({id:"4WUbF1"})}),r&&e("span",{children:[e(_,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:l?.length})]})]}),e("div",{class:"mini-draft-main",children:[!!a&&e("div",{class:"mini-draft-spoiler",children:a}),!!c&&e("div",{class:"mini-draft-status",children:c})]})]})})}function Ka({html:n,url:i,width:o,height:s,onClose:c=()=>{}}){const{_:a}=ce();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>c(),children:e(_,{icon:"x",alt:a({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener",class:"button plain",children:[e("span",{children:e(h,{id:"4/RpOy"})})," ",e(_,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":o+"px","--height":s+"px","--aspect-ratio":`${o}/${s}`}})]})}function Ha({instance:n,excludeRelationshipAttrs:i=[],postID:o,onClose:s=()=>{},blankCopy:c}){const{_:a}=ce(),{masto:p,instance:l}=ie(),d=n?n===l:!0,r=Ge(E),[u,m]=R("default"),[f,v]=R(!1);if(Xs(s),!r.showGenericAccounts)return null;const{id:y,heading:S,fetchAccounts:g,accounts:w,showReactions:b}=r.showGenericAccounts,[I,k]=R(w?.length?w:[]),[A,C]=R({}),T=async H=>{if(!H?.length||!d)return;const j=await Bn(H,A);j&&C({...A,...j})},M=H=>{g&&(H&&!I?.length&&k([]),m("loading"),(async()=>{try{const{done:j,value:X}=await g(H);if(Array.isArray(X)){if(H){const Q=[];for(let V=0;Vhe.id===G.id&&V!==$);q?q._types.push(...G._types):Q.push({_types:[],...G})}k(Q)}else k(Q=>{const V=Q;for(const G of X){const q=V.find(he=>he.id===G.id);q?q._types.push(...G._types):V.push(G)}return V});v(!j),T(X)}else v(!1);m("default")}catch{m("error")}})())},L=F(!0);W(()=>{I?.length>0?g?(M(!0),L.current=!1):T(I):(M(!0),L.current=!1)},[g]),W(()=>{L.current||r.reloadGenericAccounts?.id===y&&M(!0)},[r.reloadGenericAccounts.counter]);const U=E.statuses[o];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(_,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:S||a({id:"bPwFdf"})})}),e("main",{children:[U&&e(pe,{to:`/${n||l}/s/${U.id}`,class:"post-preview",children:e(Ye,{status:U,size:"s",readOnly:!0})}),I.length>0?e(P,{children:[e("ul",{class:"accounts-list",children:I.map(H=>{const j=A[H.id],X=`${H.id}-${H._types?.length||""}`;return e("li",{children:[b&&H._types?.length>0&&e("div",{class:"reactions-block",children:H._types.map(Q=>e(_,{icon:{reblog:"rocket",favourite:"heart"}[Q],class:`${Q}-icon`}))}),e("div",{class:"account-relationships",children:e(lt,{account:H,showStats:!0,relationship:j,excludeRelationshipAttrs:i})})]},X)})}),u==="default"?f?e(Ct,{onChange:H=>{H&&M()},children:e("button",{type:"button",class:"plain block",onClick:()=>M(),children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):u==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]}):u==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):u==="error"?e("p",{class:"ui-state",children:e(h,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:c||a({id:"10OlfF"})})]})]})}const qa=140;function ja({alt:n,lang:i,onClose:o}){const{_:s}=ce(),c=Ge(E),[a,p]=R(!1),l=Ps(!0),d=c.settings.contentTranslationHideLanguages||[],r=!!i&&i!==l&&!Ln([i],[l])&&!d.find(u=>i===u||Ln([i],[u]));return W(()=>{const u=n?.length>0&&n?.length<=qa;r&&u&&p(!0)},[r,n]),e("div",{class:"sheet",tabindex:"-1",children:[!!o&&e("button",{type:"button",class:"sheet-close outer",onClick:o,children:e(_,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(h,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(ct,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(_,{icon:"more",alt:s({id:"2FYpfJ"}),size:"xl"})}),children:[e(ge,{disabled:a,onClick:()=>{p(!0)},children:[e(_,{icon:"translate"}),e("span",{children:e(h,{id:"pi8x/S"})})]}),ic&&e(ge,{onClick:()=>{sc(n,i)},children:[e(_,{icon:"speak"}),e("span",{children:e(h,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(r||a)&&e(Ds,{forceTranslate:a,sourceLanguage:i,text:n})]})]})}const{min:ou,max:cu}=Math;const no={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])no[`[object ${n}]`]=n.toLowerCase();function Ya(n){return no[Object.prototype.toString.call(n)]||"object"}const Qt=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):Ya(n[0])=="object"&&i?i.split("").filter(o=>n[0][o]!==void 0).map(o=>n[0][o]):n[0].slice(0);const{PI:jn,min:au,max:ru}=Math;const lu=jn*2,du=jn/3,Va=jn/180,Ga=180/jn;function Nn(n,i){let o=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(i[0])||(i=i.map(p=>[p]));let s=i[0].length,c=i[0].map((p,l)=>i.map(d=>d[l])),a=n.map(p=>c.map(l=>Array.isArray(p)?p.reduce((d,r,u)=>d+r*(l[u]||0),0):l.reduce((d,r)=>d+r*p,0)));return o===1&&(a=a[0]),s===1?a.map(p=>p[0]):a}const io={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}};const Jn=n=>{const i=Math.sign(n);return n=Math.abs(n),(n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055)*i},Wa=(n,i,o)=>{const{MtxAdaptMa:s,MtxAdaptMaI:c,MtxXYZ2RGB:a,RefWhiteRGB:p,Xn:l,Yn:d,Zn:r}=io,u=l*s.m00+d*s.m10+r*s.m20,m=l*s.m01+d*s.m11+r*s.m21,f=l*s.m02+d*s.m12+r*s.m22,v=p.X*s.m00+p.Y*s.m10+p.Z*s.m20,y=p.X*s.m01+p.Y*s.m11+p.Z*s.m21,S=p.X*s.m02+p.Y*s.m12+p.Z*s.m22,g=(n*s.m00+i*s.m10+o*s.m20)*(v/u),w=(n*s.m01+i*s.m11+o*s.m21)*(y/m),b=(n*s.m02+i*s.m12+o*s.m22)*(S/f),I=g*c.m00+w*c.m10+b*c.m20,k=g*c.m01+w*c.m11+b*c.m21,A=g*c.m02+w*c.m12+b*c.m22,C=Jn(I*a.m00+k*a.m10+A*a.m20),T=Jn(I*a.m01+k*a.m11+A*a.m21),M=Jn(I*a.m02+k*a.m12+A*a.m22);return[C*255,T*255,M*255]},Pi=(...n)=>{n=Qt(n,"lab");const[i,o,s,...c]=n,[a,p,l]=Za([i,o,s]),[d,r,u]=Wa(a,p,l);return[d,r,u,...c.length>0&&c[0]<1?[c[0]]:[]]};function Za(n){var i=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],o=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],s=Nn(o,n);return Nn(i,s.map(c=>c**3))}function Qn(n){const i=Math.sign(n);return n=Math.abs(n),(n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4))*i}const Xa=(n,i,o)=>{n=Qn(n/255),i=Qn(i/255),o=Qn(o/255);const{MtxRGB2XYZ:s,MtxAdaptMa:c,MtxAdaptMaI:a,Xn:p,Yn:l,Zn:d,As:r,Bs:u,Cs:m}=io;let f=n*s.m00+i*s.m10+o*s.m20,v=n*s.m01+i*s.m11+o*s.m21,y=n*s.m02+i*s.m12+o*s.m22;const S=p*c.m00+l*c.m10+d*c.m20,g=p*c.m01+l*c.m11+d*c.m21,w=p*c.m02+l*c.m12+d*c.m22;let b=f*c.m00+v*c.m10+y*c.m20,I=f*c.m01+v*c.m11+y*c.m21,k=f*c.m02+v*c.m12+y*c.m22;return b*=S/r,I*=g/u,k*=w/m,f=b*a.m00+I*a.m10+k*a.m20,v=b*a.m01+I*a.m11+k*a.m21,y=b*a.m02+I*a.m12+k*a.m22,[f,v,y]},Di=(...n)=>{const[i,o,s,...c]=Qt(n,"rgb"),a=Xa(i,o,s);return[...Ja(a),...c.length>0&&c[0]<1?[c[0]]:[]]};function Ja(n){const i=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],o=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],s=Nn(i,n);return Nn(o,s.map(c=>Math.cbrt(c)))}const{sin:Qa,cos:er}=Math,tr=(...n)=>{let[i,o,s]=Qt(n,"lch");return isNaN(s)&&(s=0),s=s*Va,[i,er(s)*o,Qa(s)*o]},ei=(...n)=>{n=Qt(n,"lch");const[i,o,s,...c]=n,[a,p,l]=tr(i,o,s),[d,r,u]=Pi(a,p,l);return[d,r,u,...c.length>0&&c[0]<1?[c[0]]:[]]},{sqrt:nr,atan2:ir,round:sr}=Math,or=(...n)=>{const[i,o,s]=Qt(n,"lab"),c=nr(o*o+s*s);let a=(ir(s,o)*Ga+360)%360;return sr(c*1e4)===0&&(a=Number.NaN),[i,c,a]},cr=(...n)=>{const[i,o,s,...c]=Qt(n,"rgb"),[a,p,l]=Di(i,o,s),[d,r,u]=or(a,p,l);return[d,r,u,...c.length>0&&c[0]<1?[c[0]]:[]]},ar={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:uu}=ar;function so({mediaAttachments:n,statusID:i,instance:o,lang:s,index:c=0,onClose:a=()=>{}}){const{_:p}=ce(),[l,d]=R("default"),r=F(null),[u,m]=R(c),f=F(null);yt(()=>{f.current?.scrollIntoView()},[]);const v=F(i);W(()=>{const k=c*r.current.clientWidth,A=v.current!==i;A&&(v.current=i),r.current.focus(),r.current.scrollTo({left:k*(Ot()?-1:1),behavior:A?"auto":"smooth"})},[c,i]);const[y,S]=R(!0);W(()=>{let k=A=>{a(A,u,n,r)};return r.current&&r.current.addEventListener("swiped-down",k),()=>{r.current&&r.current.removeEventListener("swiped-down",k)}},[u,n]),He("esc",k=>{a(k,u,n,r)},{ignoreEventWhen:k=>!!document.querySelector("#modal-container > *")||k.metaKey||k.ctrlKey||k.altKey||k.shiftKey,useKey:!0},[a,u,n]),W(()=>{let k=()=>{const{clientWidth:A,scrollLeft:C}=r.current,T=Math.round(Math.abs(C)/A);m(T)};return r.current&&r.current.addEventListener("scroll",k,{passive:!0}),()=>{r.current&&r.current.removeEventListener("scroll",k)}},[]),W(()=>{let k=setTimeout(()=>{r.current?.focus?.()},100);return()=>clearTimeout(k)},[]);const g=ke(()=>n?.map(k=>{const{blurhash:A}=k;if(A){const C=_i(A);return cr(C)}return null}),[n]),w=ke(()=>g?.map(k=>k?{light:ei([.95,.01,k[2]]),dark:ei([.35,.01,k[2]]),default:ei([.6,k[1],k[2]])}:null)),b=ke(()=>{const A=100/w.length,C=w.map((L,U)=>{const H=U*A+5,j=(U+1)*A-5;return L?.light&&L?.dark?{light:` rgb(${L.light?.join(",")}) ${H}%, rgb(${L.light?.join(",")}) ${j}% `,dark:` rgb(${L.dark?.join(",")}) ${H}%, rgb(${L.dark?.join(",")}) ${j}% `}:{light:` transparent ${H}%, transparent ${j}% `,dark:` transparent ${H}%, transparent ${j}% `}}),T=C.map(L=>L.light).join(", "),M=C.map(L=>L.dark).join(", ");return{light:T,dark:M}},[w]);let I=F(null);return W(()=>()=>{I.current?.hideToast?.()},[]),yt(()=>{const k=w[u];let A,C;if(k){const T=xe.local.get("theme");if(T){const M=`rgb(${k[T].join(",")})`;A=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),A&&(C=A.content,A.content=M)}else{const M=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",L=`rgb(${k[M].join(",")})`;A=document.querySelector(`meta[name="theme-color"][media*="${M}"]`),A&&(C=A.content,A.content=L)}}return()=>{A&&C&&(A.content=C)}},[u,w]),e("div",{class:`media-modal-container media-modal-count-${n?.length}`,children:[e("div",{ref:r,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(k,u,n,r)},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":b?.light,"--accent-gradient-dark":b?.dark}:{},children:n?.map((k,A)=>{const C=n.length===1?w[A]:null;return e("div",{class:"carousel-item",style:C?{"--accent-color":`rgb(${C.default.join(",")})`,"--accent-light-color":`rgb(${C.light?.join(",")})`,"--accent-dark-color":`rgb(${C.dark?.join(",")})`,"--accent-alpha-color":`rgba(${C.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:A===u?f:null,onClick:T=>{T.target.classList.contains("media")||S(!y)},children:[!!k.description&&e("button",{type:"button",class:"media-alt",hidden:!y,onClick:()=>{E.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(Bs,{media:k,showOriginal:!0,lang:s})]},k.id)})}),e("div",{class:"carousel-top-controls",hidden:!y,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:k=>a(k,u,n,r),children:e(_,{icon:"x",alt:p({id:"yz7wBu"})})})}),n?.length>1?e("span",{class:"carousel-dots",children:n?.map((k,A)=>e("button",{type:"button",disabled:A===u,class:`carousel-dot ${A===u?"active":""}`,onClick:C=>{C.preventDefault(),C.stopPropagation();const T=r.current.clientWidth*A*(Ot()?-1:1);r.current.focus(),r.current.scrollTo({left:T,behavior:"smooth"})},children:e(_,{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(_,{icon:"more",alt:p({id:"2FYpfJ"})})}),children:[e(qe,{href:n[u]?.remoteUrl||n[u]?.url,class:"carousel-button",target:"_blank",title:p({id:"5hXGws"}),children:[e(_,{icon:"popout"}),e("span",{children:e(h,{id:"aDr7Vc"})})]}),!1]})," ",!!i&&e(pe,{to:`${o?`/${o}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${u+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(h,{id:"ISg5SQ"})," "]}),"»"]})]})]}),n?.length>1&&e("div",{class:"carousel-controls",hidden:!y,children:[e("button",{type:"button",class:"carousel-button",hidden:u===0,onClick:k=>{k.preventDefault(),k.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u-1)*(Ot()?-1:1),behavior:"smooth"})},children:e(_,{icon:"arrow-left",alt:p({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:u===n.length-1,onClick:k=>{k.preventDefault(),k.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u+1)*(Ot()?-1:1),behavior:"smooth"})},children:e(_,{icon:"arrow-right",alt:p({id:"hXzOVo"})})})]})]})}function rr({url:n,linkText:i,onClose:o}){const{_:s}=ce();if(!n)return null;let c=n;try{const l=URL.parse(n),d=l.protocol,r=l.hostname,u=n.slice(l.origin.length);c=e(P,{children:[d,"//",e("strong",{children:r}),u]})}catch{}const a=()=>{try{navigator.clipboard.writeText(n),re(s({id:"edWbV6"}))}catch{re(s({id:"W1ewR0"}))}},p=()=>{if(navigator.share&&navigator.canShare({url:n}))try{navigator.share({url:n})}catch{}};return e("div",{class:"sheet sheet-modal",id:"open-link-sheet",tabindex:"-1",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(_,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(h,{id:"Gj4mrz"})})}),e("main",{children:[!!i&&e(P,{children:[e("p",{class:"link-text",children:[e(_,{icon:"cursor-hand",size:"xl"})," ",i]}),e("div",{class:"arrow",children:e(_,{icon:"arrow-down"})})]}),e("p",{class:"full-url",children:c})]}),e("footer",{children:[e("button",{type:"button",class:"light",onClick:o,children:e(h,{id:"dEgA5A"})}),e("span",{class:"spacer"}),e("button",{type:"button",class:"plain6",onClick:a,children:e(_,{icon:"copy",alt:s({id:"he3ygx"})})}),navigator.canShare&&navigator.canShare({url:n})&&e("button",{type:"button",class:"plain6",onClick:p,children:e(_,{icon:"share",alt:s({id:"LFKLqp"})})}),e("a",{class:"button",href:n,target:"_blank",rel:"noopener noreferrer",onClick:o,children:e(h,{id:"1TNIig"})})]})]})}const lr=["spam","legal","violation","other"],en={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 dr(n,i){if(!n.translations||!i)return null;const o=Object.keys(n.translations);if(!o?.length)return null;let s=Ln([i],o,null);if(!s){const c=o.map(a=>a.split(/(?=[A-Z])/).map((l,d)=>d===0?l:l.toLowerCase()).join("-"));s=Ln([i],c,null)}if(s&&s.includes("-")){const[c,a]=s.split("-");s=c+a.charAt(0).toUpperCase()+a.slice(1)}return s}function ur(n,i){return n?.length?i?n.map(o=>{const s=dr(o,i);return{...o,_translatedText:o.translations?.[s]?.text||null}}):n:[]}function hr({account:n,post:i,onClose:o}){const{_:s,_:c,i18n:a}=ce(),{masto:p}=ie(),[l,d]=R("default"),[r,u]=n.acct.split("@"),[m,f]=ke(()=>{const{rules:k,domain:A}=As();return[ur(k||[],a.locale),A]},[a.locale]),[v,y]=R(null),[S,g]=R(!1),w=F(null),[b,I]=R(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:c(i?{id:"muLhL3"}:{id:"ACul2G",values:{username:r}})}),e("button",{type:"button",class:"plain4 small",disabled:l==="loading",onClick:()=>o(),children:e(_,{icon:"x",size:"xl",alt:c({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(Ye,{status:i,size:"s",previewMode:!0}):e(lt,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!v&&!en[v].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[s(en[v].stampLabel||s(en[v].label)),e("small",{children:e(h,{id:"2WtL62"})})]},v),e("form",{onSubmit:k=>{k.preventDefault();const A=new FormData(k.target),C=Object.fromEntries(A.entries());let{category:T,comment:M,forward:L}=C;M||(M=void 0),L==="on"&&(L=!0);const U=T==="violation"?Object.entries(C).filter(([j])=>j.startsWith("rule_ids")).map(([j,X])=>X):void 0,H={category:T,comment:M,forward:L,ruleIds:U};d("loading"),(async()=>{try{await p.v1.reports.create({accountId:n.id,statusIds:i?.id?[i.id]:void 0,category:T,comment:M,ruleIds:U,forward:L}),d("success"),re(c(i?{id:"y3ou+8"}:{id:"R9kjEL"})),o()}catch(j){d("error"),re(j?.message||c(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:c(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:lr.map(k=>k==="violation"&&!m?.length?null:e(P,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:k,required:!0,disabled:l==="loading",onChange:A=>{y(A.target.value),g(A.target.value==="violation")}}),e("span",{children:[s(en[k].label),"  ",e("small",{class:"ib insignificant",children:s(en[k].description)})]})]}),k==="violation"&&!!m?.length&&e("div",{class:"shazam-container no-animation",hidden:!S,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:w,children:m.map((A,C)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${C}]`,value:A.id,required:S&&!b,disabled:l==="loading",onChange:T=>{const{checked:M}=T.target;M?I(!0):w.current.querySelectorAll("input:checked").length||I(!1)}}),e("span",{children:A._translatedText||A.text})]},A.id))})})})]},k))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(h,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:l==="loading",required:!i})]}),!!u&&u!==f&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:l==="loading"})," ",e("span",{children:e(h,{id:"cyjS8M",values:{domain:u},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:l==="loading",children:e(h,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:l==="loading",onClick:async()=>{try{await p.v1.accounts.$select(n.id).mute(),re(c({id:"/BGBeF",values:{username:r}}))}catch{re(c({id:"v02K7/",values:{username:r}}))}},children:e(h,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:l==="loading",onClick:async()=>{try{await p.v1.accounts.$select(n.id).block(),re(c({id:"kjUejn",values:{username:r}}))}catch{re(c({id:"pMcdDp",values:{username:r}}))}},children:e(h,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Be,{hidden:l!=="loading"})]})]})]})]})}var kn={exports:{}},hu=kn.exports,ts;function pr(){return ts||(ts=1,function(n){var i=function(){var o=String.fromCharCode,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function p(d,r){if(!a[d]){a[d]={};for(var u=0;u>>8,u[m*2+1]=v%256}return u},decompressFromUint8Array:function(d){if(d==null)return l.decompress(d);for(var r=new Array(d.length/2),u=0,m=r.length;u>1}else{for(f=1,m=0;m>1}b--,b==0&&(b=Math.pow(2,k),k++),delete y[w]}else for(f=v[w],m=0;m>1;b--,b==0&&(b=Math.pow(2,k),k++),v[g]=I++,w=String(S)}if(w!==""){if(Object.prototype.hasOwnProperty.call(y,w)){if(w.charCodeAt(0)<256){for(m=0;m>1}else{for(f=1,m=0;m>1}b--,b==0&&(b=Math.pow(2,k),k++),delete y[w]}else for(f=v[w],m=0;m>1;b--,b==0&&(b=Math.pow(2,k),k++)}for(f=2,m=0;m>1;for(;;)if(C=C<<1,T==r-1){A.push(u(C));break}else T++;return A.join("")},decompress:function(d){return d==null?"":d==""?null:l._decompress(d.length,32768,function(r){return d.charCodeAt(r)})},_decompress:function(d,r,u){var m=[],f,v=4,y=4,S=3,g="",w=[],b,I,k,A,C,T,M,L={val:u(0),position:r,index:1};for(b=0;b<3;b+=1)m[b]=b;for(k=0,C=Math.pow(2,2),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;switch(f=k){case 0:for(k=0,C=Math.pow(2,8),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;M=o(k);break;case 1:for(k=0,C=Math.pow(2,16),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;M=o(k);break;case 2:return""}for(m[3]=M,I=M,w.push(M);;){if(L.index>d)return"";for(k=0,C=Math.pow(2,S),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;switch(M=k){case 0:for(k=0,C=Math.pow(2,8),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;m[y++]=o(k),M=y-1,v--;break;case 1:for(k=0,C=Math.pow(2,16),T=1;T!=C;)A=L.val&L.position,L.position>>=1,L.position==0&&(L.position=r,L.val=u(L.index++)),k|=(A>0?1:0)*T,T<<=1;m[y++]=o(k),M=y-1,v--;break;case 2:return w.join("")}if(v==0&&(v=Math.pow(2,S),S++),m[M])g=m[M];else if(M===y)g=I+I.charAt(0);else return null;w.push(g),m[y++]=I+g.charAt(0),v--,I=g,v==0&&(v=Math.pow(2,S),S++)}}};return l}();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})}(kn)),kn.exports}var ns=pr();const fr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e",mr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e",gr="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e",vr=200,yr=10;async function Pn(){const{masto:n}=ie(),i=n.v1.followedTags.list({limit:vr}).values(),o=[];let s=0;do{const{value:c,done:a}=await i.next();if(a||c?.length===0)break;o.push(...c),s++}while(sc.name.localeCompare(a.name)),o.length&&setTimeout(()=>{xe.account.set("followedTags",{tags:o,updatedAt:Date.now()})},1),o}const br=24*60*60*1e3;async function wr(){try{const{tags:n,updatedAt:i}=xe.account.get("followedTags")||{};return n?.length?(Date.now()-i>br&&Pn(),n):await Pn()}catch{return[]}}const is=document.createElement("div"),kr=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];is.innerHTML=n;const i=is.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(o=>o.innerText.trim().replace(/^[^#]*#+/,"")):[]};function Sn({children:n}){if(typeof n=="string")return n;const[i,o]=R("");return W(()=>{Promise.resolve(n).then(o)},[n]),i}const St=9,Sr=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],oo={following:{id:"7ZJHdw"},notifications:{id:"iDNBZe"},list:{id:"h16FyT"},public:{id:"tXgQpk"},search:{id:"A1taO8"},"account-statuses":{id:"AeXO77"},bookmarks:{id:"7Ff7ia"},favourites:{id:"zZOZj7"},hashtag:{id:"GP8RLS"},trending:{id:"4/iCqx"},mentions:{id:"/bZzdR"}},Cn={list:[{text:{id:"DUMt1y"},name:"id",notRequired:!0}],public:[{text:{id:"OgyJSr"},name:"local",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],trending:[{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],search:[{text:{id:"dmloPh"},name:"query",type:"text",placeholder:{id:"UHDQDE"},notRequired:!0}],"account-statuses":[{text:"@",name:"id",type:"text",placeholder:"cheeaun@mastodon.social"}],hashtag:[{text:"#",name:"hashtag",type:"text",placeholder:{id:"a6oTWs"},pattern:"[^#]+"},{text:{id:"eK4SL/"},name:"media",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}]},Cr=mt(async({id:n})=>{const i=await ie().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),Dn={following:{id:"home",title:(n,i)=>i===0?de._({id:"i0qMbr"}):de._({id:"following.title"}),path:"/",icon:"home"},mentions:{id:"mentions",title:{id:"/bZzdR"},path:"/mentions",icon:"at"},notifications:{id:"notifications",title:{id:"iDNBZe"},path:"/notifications",icon:"notification"},list:{id:({id:n})=>n?"list":"lists",title:({id:n})=>n?Ca(n):de._({id:"h16FyT"}),path:({id:n})=>n?`/l/${n}`:"/l",icon:"list",excludeViewMode:({id:n})=>n?[]:["multi-column"]},public:{id:"public",title:({local:n})=>n?de._({id:"d5zxa4"}):de._({id:"4ERYY7"}),subtitle:({instance:n})=>n||ie().instance,path:({local:n,instance:i})=>`/${i}/p${n?"/l":""}`,icon:({local:n})=>n?"building":"earth"},trending:{id:"trending",title:{id:"4/iCqx"},subtitle:({instance:n})=>n||ie().instance,path:({instance:n})=>`/${n}/trending`,icon:"chart"},search:{id:"search",title:({query:n})=>n?`“${n}”`:de._({id:"A1taO8"}),path:({query:n})=>n?`/search?q=${encodeURIComponent(n)}&type=statuses`:"/search",icon:"search",excludeViewMode:({query:n})=>n?[]:["multi-column"]},"account-statuses":{id:"account-statuses",title:Cr,path:({id:n})=>`/a/${n}`,icon:"user"},bookmarks:{id:"bookmarks",title:{id:"7Ff7ia"},path:"/b",icon:"bookmark"},favourites:{id:"favourites",title:{id:"zZOZj7"},path:"/f",icon:"heart"},hashtag:{id:"hashtag",title:({hashtag:n})=>n,subtitle:({instance:n})=>n||ie().instance,path:({hashtag:n,instance:i,media:o})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${o?"?media=1":""}`,icon:"hashtag"}};function _r({onClose:n}){const{_:i}=ce(),o=Ge(E),{shortcuts:s}=o,[c,a]=R(!1),[p,l]=R(!1),[d]=Kn();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(_,{icon:"x",alt:de._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(_,{icon:"shortcut"})," ",e(h,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(h,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(h,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:de._({id:"qwdOim"}),imgURL:fr},{value:"tab-menu-bar",label:de._({id:"UxBoCm"}),imgURL:gr},{value:"multi-column",label:de._({id:"uvDfdW"}),imgURL:mr}].map(({value:r,label:u,imgURL:m})=>{const f=o.settings.shortcutsViewMode===r||r==="float-button"&&!o.settings.shortcutsViewMode;return e("label",{class:f?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:r,checked:f,onChange:v=>{E.settings.shortcutsViewMode=v.target.value}})," ",e("img",{src:m,alt:"",width:"80",height:"58"})," ",e("span",{children:u})]},r)})}),s.length>0?e(P,{children:[e("ol",{class:"shortcuts-list",ref:d,children:s.filter(Boolean).map((r,u)=>{const m=Object.values(r).join("-"),{type:f}=r;if(!Dn[f])return null;let{icon:v,title:y,subtitle:S,excludeViewMode:g}=Dn[f];typeof y=="function"?y=y(r,u):y=i(y),typeof S=="function"?S=S(r,u):S=i(S),typeof v=="function"&&(v=v(r,u)),typeof g=="function"&&(g=g(r,u));const w=g?.includes(o.settings.shortcutsViewMode);return e("li",{children:[e(_,{icon:v}),e("span",{class:"shortcut-text",children:[e(Sn,{children:y}),S&&e(P,{children:[" ",e("small",{class:"ib insignificant",children:S})]}),w&&e("span",{class:"tag",children:e(h,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:u===0,onClick:()=>{const b=Array.from(E.shortcuts);if(u>0){const I=E.shortcuts[u-1];b[u-1]=r,b[u]=I,E.shortcuts=b}},children:e(_,{icon:"arrow-up",alt:de._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:u===s.length-1,onClick:()=>{const b=Array.from(E.shortcuts);if(u{a({shortcut:r,shortcutIndex:u})},children:e(_,{icon:"pencil",alt:de._({id:"ePK91l"})})})]})]},m)})}),s.length===1&&o.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(_,{icon:"info"})," ",e("small",{children:e(h,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:o.settings.shortcutsViewMode==="multi-column"?de._({id:"3xIN+E"}):de._({id:"vLxvHT"})}),e("p",{children:e(h,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:r=>{r.preventDefault(),E.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:s.length>=St&&(o.settings.shortcutsViewMode==="multi-column"?de._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:St}}):de._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:St}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>l(!0),children:e(h,{id:"bgVLbt"})}),e("button",{type:"button",disabled:s.length>=St,onClick:()=>a(!0),children:[e(_,{icon:"plus"})," ",e("span",{children:o.settings.shortcutsViewMode==="multi-column"?de._({id:"Vh3ADI"}):de._({id:"9tmn6W"})})]})]})]}),c&&e(Ke,{onClick:r=>{r.target===r.currentTarget&&a(!1)},children:e(Ir,{shortcut:c.shortcut,shortcutIndex:c.shortcutIndex,onSubmit:({result:r,mode:u})=>{u==="edit"?E.shortcuts[c.shortcutIndex]=r:E.shortcuts.push(r)},onClose:()=>a(!1)})}),p&&e(Ke,{onClick:r=>{r.target===r.currentTarget&&l(!1)},children:e(Ar,{shortcuts:s,onClose:()=>l(!1)})})]})}const ss={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function Ir({onSubmit:n,disabled:i,shortcut:o,shortcutIndex:s,onClose:c}){const{_:a}=ce(),p=!!o,[l,d]=R(o?.type||null),[r,u]=R("default"),[m,f]=R([]),[v,y]=R([]);W(()=>{(async()=>{if(l==="list")try{u("loading");const g=await un();f(g),u("default")}catch{u("error")}})(),(async()=>{if(l==="hashtag")try{const g=await Pn();y(g)}catch{}})()},[l]);const S=F();return W(()=>{if(p&&l&&Cn[l]){const g=S.current;Cn[l].forEach(({name:w,type:b})=>{const I=g.querySelector(`[name="${w}"]`);I&&o[w]&&(b==="checkbox"?I.checked=o[w]==="on":I.value=o[w])})}},[p,l]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!c&&e("button",{type:"button",class:"sheet-close",onClick:c,children:e(_,{icon:"x",alt:de._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:p?de._({id:"pe1jog"}):de._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:S,onSubmit:g=>{g.preventDefault();const w=new FormData(g.target),b={};w.forEach((I,k)=>{b[k]=I?.trim(),k==="instance"&&(b[k]=b[k].replace(/^https?:\/\//,"").replace(/\/+$/,""),b[k]=b[k].replace(/^@?[^@]+@/,""))}),b.type&&(n({result:b,mode:p?"edit":"add"}),g.target.reset(),d(null),c?.())},children:[e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:g=>{d(g.target.value)},defaultValue:p?o.type:void 0,name:"type",dir:"auto",children:[e("option",{}),Sr.map(g=>e("option",{value:g,children:a(oo[g])}))]})]})}),Cn[l]?.map?.(({text:g,name:w,type:b,placeholder:I,pattern:k,notRequired:A})=>l==="list"?e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"2BBAbc"})}),e("select",{name:"id",required:!A,disabled:i||r==="loading",defaultValue:p?o.id:void 0,dir:"auto",children:[e("option",{value:""}),m.map(C=>e("option",{value:C.id,children:C.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:a(g)})," ",e("input",{type:b,switch:b==="checkbox"||void 0,name:w,placeholder:a(I),required:b==="text"&&!A,disabled:i,list:l==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:k,dir:"auto"}),l==="hashtag"&&v.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:v.map(C=>e("option",{value:C.name}))})]})})),!!ss[l]&&e("p",{class:"form-note insignificant",children:[e(_,{icon:"info"}),a(ss[l])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||r==="loading",children:p?de._({id:"tfDRzk"}):de._({id:"m16xKo"})}),p&&e("button",{type:"button",class:"light danger",onClick:()=>{E.shortcuts.splice(s,1),c?.()},children:e(h,{id:"t/YqKh"})})]})]})})]})}function Ar({shortcuts:n,onClose:i}){const{_:o}=ce(),{masto:s}=ie(),c=ke(()=>!n||!n.filter(Boolean).length?"":ns.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[a,p]=R(""),[l,d]=R("default"),r=ke(()=>{if(!a)return d("default"),null;try{const f=JSON.parse(ns.decompressFromEncodedURIComponent(a));if(!Array.isArray(f))throw new Error("Not an array");return d("default"),f}catch{try{const v=JSON.parse(a);if(!Array.isArray(v))throw new Error("Not an array");return d("default"),v}catch{return d("error"),null}}},[a]),u=E.shortcuts.length>0,m=F();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(_,{icon:"x",alt:de._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(_,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:m,type:"text",name:"import",placeholder:de._({id:"tBmklN"}),class:"block",onInput:f=>{p(f.target.value)},dir:"auto"}),E.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:l==="cloud-downloading",onClick:async()=>{d("cloud-downloading");const f=ft();re(de._({id:"HLqLGx"}));try{const y=(await s.v1.accounts.relationships.fetch({id:[f]}))[0];if(y){const{note:S=""}=y;if(/(.*)<\/phanpy-shortcuts-settings>/.test(S)){const g=S.match(/(.*)<\/phanpy-shortcuts-settings>/)[1],{v:w,dt:b,data:I}=JSON.parse(g);m.current.value=I,m.current.dispatchEvent(new Event("input"))}}d("default")}catch{d("error"),re(de._({id:"gCDfX+"}))}},title:de._({id:"B6cG3J"}),children:[e(_,{icon:"cloud"}),e(_,{icon:"arrow-down"})]})]}),!!r&&Array.isArray(r)&&e(P,{children:[e("p",{children:[e("b",{children:r.length})," shortcut",r.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",a.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:r.map(f=>e("li",{children:[e("span",{style:{opacity:n.some(v=>Object.keys(v).every(y=>v[y]===f[y]))?1:0},children:"*"}),e("span",{children:[o(oo[f.type]),f.type==="list"&&" ⚠️"," ",Cn[f.type]?.map?.(({text:v,name:y,type:S})=>f[y]?e(P,{children:[e("span",{class:"tag collapsed insignificant",children:[v,":"," ",S==="checkbox"?f[y]==="on"?"✅":"❌":f[y]]})," "]}):null)]})]}))}),e("p",{children:[e("small",{children:e(h,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(h,{id:"N4z4P/"})]})]})]}),l==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(h,{id:"ZhsPEb"})]})}),e("p",{children:[u&&e(P,{children:[e(dt,{confirmLabel:de._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(h,{id:"nl8sCE"})}),onClick:()=>{const f=r.filter(S=>!E.shortcuts.some(g=>Object.keys(g).every(w=>g[w]===S[w])));if(!f.length){re(de._({id:"o6L30P"}));return}let v=[...E.shortcuts,...f];const y=v.length>St;y&&(v=v.slice(0,St)),E.shortcuts=v,re(y?de._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:St}}):de._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!r,children:e(h,{id:"c89gCv"})})})," "]}),e(dt,{confirmLabel:u?de._({id:"6ZjzWP"}):de._({id:"DWumLi"}),menuItemClassName:u?"danger":void 0,onClick:()=>{E.shortcuts=r,re(de._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!r,children:u?de._({id:"uIp8WL"}):de._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(_,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:c,readOnly:!0,onClick:f=>{if(f.target.value){f.target.select();try{navigator.clipboard.writeText(f.target.value),re(de._({id:"cWtH+v"}))}catch{re(de._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.clipboard.writeText(c),re(de._({id:"+Kq2vY"}))}catch{re(de._({id:"tFvxZF"}))}},children:[e(_,{icon:"clipboard"})," ",e("span",{children:e(h,{id:"he3ygx"})})]})," ",navigator?.share&&navigator?.canShare?.({text:c})&&e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.share({text:c})}catch{alert(de._({id:"TtG3Uh"}))}},children:[e(_,{icon:"share"})," ",e("span",{children:e(h,{id:"Z8lGw6"})})]})," ",E.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:l==="cloud-uploading",onClick:async()=>{d("cloud-uploading");const f=ft();try{const y=(await s.v1.accounts.relationships.fetch({id:[f]}))[0];if(y){const{note:S=""}=y;let g="";const w=JSON.stringify({v:"1",dt:Date.now(),data:c});/(.*)<\/phanpy-shortcuts-settings>/.test(S)?g=S.replace(/(.*)<\/phanpy-shortcuts-settings>/,`${w}`):g=`${S} ${w}`,re(de._({id:"9ZYiLz"})),await s.v1.accounts.$select(f).note.create({comment:g}),d("default"),re(de._({id:"5w02SH"}))}}catch{d("error"),re(de._({id:"aVsTYo"}))}},title:de._({id:"gWd6Cu"}),children:[e(_,{icon:"cloud"}),e(_,{icon:"arrow-up"})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(h,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(h,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),E.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(_,{icon:"cloud"})," ",e(h,{id:"C4T6O/"})]})})]})]})}Ts(E,n=>{for(const[i,o,s,c]of n)/^show/i.test(o)&&!s&&li()});function Tr(){const{_:n}=ce(),i=Ge(E),o=xs(),s=Jt();return W(()=>{setTimeout(Do,1e3)},[]),e(P,{children:[!!i.showCompose&&e(Ke,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(Oo,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:window.__COMPOSE__?.replyToStatus||null,editStatus:E.showCompose?.editStatus||window.__COMPOSE__?.editStatus||null,draftStatus:E.showCompose?.draftStatus||window.__COMPOSE__?.draftStatus||null,onClose:c=>{const{newStatus:a,instance:p,type:l,scheduledAt:d}=c||{};E.showCompose=!1,window.__COMPOSE__=null,a&&(E.reloadStatusPage++,d&&E.reloadScheduledPosts++,re({text:{post:n(d?{id:"IrX0sj"}:{id:"aTyHBW"}),reply:n(d?{id:"+38pse"}:{id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[l||"post"],delay:1e3,duration:1e4,onClick:r=>{r.hideToast(),E.prevLocation=s,o(d?"/sp":p?`/${p}/s/${a.id}`:`/s/${a.id}`)}}))}})}),!!i.showSettings&&e(Ke,{onClose:()=>{E.showSettings=!1},children:e(pa,{onClose:()=>{E.showSettings=!1}})}),!!i.showAccounts&&e(Ke,{onClose:()=>{E.showAccounts=!1},children:e(ea,{onClose:()=>{E.showAccounts=!1}})}),!!i.showAccount&&e(Ke,{onClose:()=>{E.showAccount=!1},children:e(Ba,{account:i.showAccount?.account||i.showAccount,instance:i.showAccount?.instance,onClose:({destination:c}={})=>{E.showAccount=!1}})}),!!i.showOpenLink&&e(Ke,{onClose:()=>{E.showOpenLink=!1},children:e(rr,{url:i.showOpenLink.url,linkText:i.showOpenLink.linkText,onClose:()=>{E.showOpenLink=!1}})}),!!i.showDrafts&&e(Ke,{onClose:()=>{E.showDrafts=!1},children:e(Fa,{onClose:()=>E.showDrafts=!1})}),!!i.showMediaModal&&e(Ke,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&(E.showMediaModal=!1)},children:e(so,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.mediaIndex,statusID:i.showMediaModal.statusID,onClose:()=>{E.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(Ke,{onClose:()=>{E.showShortcutsSettings=!1},children:e(_r,{onClose:()=>E.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(Ke,{onClose:()=>{E.showGenericAccounts=!1},children:e(Ha,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>E.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(Ke,{onClose:c=>{E.showMediaAlt=!1},children:e(ja,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:i.showMediaAlt?.lang,onClose:()=>{E.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(Ke,{class:"solid",onClose:()=>{E.showEmbedModal=!1},children:e(Ka,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{E.showEmbedModal=!1}})}),!!i.showReportModal&&e(Ke,{onClose:()=>{E.showReportModal=!1},children:e(hr,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{E.showReportModal=!1}})})]})}function ui({accountID:n,onChange:i}){const{_:o}=ce(),{masto:s}=ie(),[c,a]=R("default"),[p,l]=R(null),[d,r]=R(null),u=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||u,onClick:()=>{a("loading"),l("accept"),(async()=>{try{const m=await s.v1.followRequests.$select(n).authorize();if(!m?.followedBy)throw new Error("Follow request not accepted");r(m),i()}catch{}a("default")})()},children:e(h,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:c==="loading"||u,class:"light danger",onClick:()=>{a("loading"),l("reject"),(async()=>{try{const m=await s.v1.followRequests.$select(n).reject();if(m?.followedBy)throw new Error("Follow request not rejected");r(m),i()}catch{a("default")}})()},children:e(h,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:u&&p?p==="accept"?e(_,{icon:"check-circle",alt:o({id:"bzMKg7"}),class:"follow-accepted"}):e(_,{icon:"x-circle",alt:o({id:"ekCRTP"}),class:"follow-rejected"}):e(Be,{hidden:c!=="loading"})})]})}const os={mention:"comment",status:"notification",reblog:"rocket",follow:"follow",follow_request:"follow-add",favourite:"heart",poll:"poll",update:"pencil","admin.signup":"account-edit","admin.report":"account-warning",severed_relationships:"heart-break",moderation_warning:"alert",emoji_reaction:"emoji2","pleroma:emoji_reaction":"emoji2",annual_report:"celebrate"};function cs({account:n,emoji:i,emoji_url:o}){let s,c;typeof o=="string"?s=o:(s=o?.url,c=o?.staticUrl);const a=s?e(oc,{url:s,staticUrl:c,alt:i}):i;return e(h,{id:"i5uN6K",values:{account:n,emojiObject:a}})}const ti={status:({account:n})=>e(h,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:o,postType:s,components:{Subject:c}})=>e(h,{id:"jkt9P5",values:{0:Ze(n),1:Ze(n),count:n,postsCount:o,postType:s,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),follow:({account:n,count:i,components:{Subject:o}})=>e(h,{id:"+71G9C",values:{0:Ze(i),count:i,account:n},components:{0:e(o,{clickable:i>1}),1:e("span",{title:i})}}),follow_request:({account:n})=>e(h,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:o,postType:s,components:{Subject:c}})=>e(h,{id:"RqX1mR",values:{0:Ze(i),1:Ze(i),count:i,postsCount:o,postType:s,account:n},components:{0:e(c,{clickable:i>1}),1:e("span",{title:i}),2:e(c,{clickable:i>1}),3:e("span",{title:i})}}),poll:()=>de._({id:"kIlJaS"}),"poll-self":()=>de._({id:"kpjzdN"}),"poll-voted":()=>de._({id:"moT7M8"}),update:()=>de._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:o,postType:s,components:{Subject:c}})=>e(h,{id:"NunZZQ",values:{0:Ze(n),1:Ze(n),count:n,postsCount:o,postType:s,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),"admin.sign_up":({account:n})=>e(h,{id:"fJCCpx",values:{account:n}}),"admin.report":({account:n,targetAccount:i})=>e(h,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(h,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(h,{id:"YqffEv"})}),emoji_reaction:cs,"pleroma:emoji_reaction":cs,annual_report:({year:n})=>e(h,{id:"INLTzH",values:{year:n}})},xr={account_suspension:({from:n,targetName:i})=>e(h,{id:"uRkcgw",values:{from:n,targetName:i},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:n,targetName:i,followersCount:o,followingCount:s})=>e(h,{id:"Q3yArs",values:{from:n,targetName:i,followersCount:o,followingCount:s},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:n,followersCount:i,followingCount:o})=>e(h,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:o},components:{0:e("i",{})}})},Er={none:{id:"ipnHrn"},disable:{id:"jw0eSZ"},mark_statuses_as_sensitive:{id:"v9jO+F"},delete_statuses:{id:"raUMBQ"},sensitive:{id:"w2OpMr"},silence:{id:"mlycBx"},suspend:{id:"Fz4lZ1"}},ni=30;function Rr({notification:n,instance:i,isStatic:o,disableContextMenu:s}){const{_:c}=ce(),{masto:a}=ie(),{id:p,status:l,account:d,report:r,event:u,moderation_warning:m,annualReport:f,_ids:v,_accounts:y,_statuses:S,_groupKeys:g,sampleAccounts:w,notificationsCount:b,groupKey:I,_notificationsCount:k,_sampleAccountsCount:A}=n;let{type:C}=n;if(C==="mention"&&!l)return null;const T=l?.reblog||l,M=T?.id,L=ft(),U=L===d?.id,H=l?.poll?.voted,j=!!l?.inReplyToAccountId&&l?.inReplyToAccountId!==L&&l?.account?.id===L;let X=0,Q=0;if(C==="favourite+reblog"){if(y)for(const ee of y)ee._types?.includes("favourite")&&X++,ee._types?.includes("reblog")&&Q++;!Q&&X&&(C="favourite"),!X&&Q&&(C="reblog")}let V;C==="poll"?V=ti[U?"poll-self":H?"poll-voted":"poll"]:ti[C]?V=ti[C]:V=de._({id:"ODqZt1",values:{type:C}});const G=({clickable:ee,...ue})=>ee?e("b",{tabIndex:"0",onClick:Y,...ue}):e("b",{...ue}),q=b>0&&b>w?.length,he=q?"remote":"local";if(typeof V=="function"){const ee=(C==="favourite"||C==="reblog")&&b?q?b:w?.length:y?.length||w?.length||(d?1:0),ue=S?.length||(l?1:0);if(C==="admin.report"){const ae=r?.targetAccount;ae&&(V=V({account:e(pt,{account:d,showAvatar:!0}),targetAccount:e(pt,{account:ae,showAvatar:!0})}))}else if(C==="severed_relationships"){const ae=u?.targetName;ae&&(V=V({name:ae}))}else if((C==="emoji_reaction"||C==="pleroma:emoji_reaction")&&n.emoji){const ae=n.emoji_url||l?.emojis?.find?.(J=>J?.shortcode===n.emoji.replace(/^:/,"").replace(/:$/,""));V=V({account:e(pt,{account:d,showAvatar:!0}),emoji:n.emoji,emojiURL:ae})}else C==="annual_report"?V=V({...n.annualReport}):V=V({account:d?e(pt,{account:d,showAvatar:!0}):w?.[0]&&e(pt,{account:w[0],showAvatar:!0}),count:ee,postsCount:ue,postType:j?"reply":"post",components:{Subject:G}})}const $=n.createdAt&&new Date(n.createdAt).toLocaleString(),ne={"favourite+reblog":de._({id:"+XOeb+"}),favourite:de._({id:"LQFF6J"}),reblog:de._({id:"phQpSa"}),follow:de._({id:"Ih01jh"})}[C]||de._({id:"bPwFdf"}),Y=()=>{E.showGenericAccounts={heading:ne,accounts:y,showReactions:C==="favourite+reblog",excludeRelationshipAttrs:C==="follow"?["followedBy"]:[],postID:ot(M,i)}};if(l?.filtered){const ee=l?.account?.id===L,ue=Gt(l.filtered,"notifications");if(!U&&!ee&&ue?.action==="hide")return null}return e("div",{class:`notification notification-${C}`,"data-notification-id":v||p,"data-group-key":g?.join(" ")||I,tabIndex:"0",children:[e("div",{class:`notification-type notification-${C}`,title:$,children:C==="favourite+reblog"?e(P,{children:[e(_,{icon:"rocket",size:"xl",alt:C,class:"reblog-icon"}),e(_,{icon:"heart",size:"xl",alt:C,class:"favourite-icon"})]}):e(_,{icon:os[C]||"notification",size:"xl",alt:C})}),e("div",{class:"notification-content",children:[C!=="mention"&&e(P,{children:[e("p",{children:V}),C==="follow_request"&&e(ui,{accountID:d.id}),C==="severed_relationships"&&e("div",{children:[xr[u.type]({from:i,...u}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener",children:e(h,{id:"YL6Y8P",components:{0:e(_,{icon:"external",size:"s"})}})}),"."]}),C==="moderation_warning"&&!!m&&e("div",{children:[c(Er[m.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${m.id}`,target:"_blank",rel:"noopener",children:e(h,{id:"YL6Y8P",components:{0:e(_,{icon:"external",size:"s"})}})})]}),C==="annual_report"&&e("div",{children:e(pe,{to:`/annual_report/${f?.year}`,children:e(h,{id:"5PGPvG"})})})]}),y?.length>1&&e("p",{class:"avatars-stack",children:[y.slice(0,ni).map(ee=>e(P,{children:[e("a",{href:ee.url,rel:"noopener",class:"account-avatar-stack",onClick:ue=>{ue.preventDefault(),E.showAccount=ee},children:[e(ut,{url:ee.avatarStatic,size:y.length<=10?"xxl":y.length<20?"xl":"l",alt:`${ee.displayName} @${ee.acct}`,squircle:ee?.bot},ee.id),C==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:ee._types.map(ue=>e(_,{icon:os[ue],size:"s",class:`${ue}-icon`}))})]},ee.id)," "]},ee.id)),(C==="favourite+reblog"||C==="favourite"||C==="reblog")&&he==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":g?.join(" "),onClick:()=>{E.showGenericAccounts={heading:ne,accounts:y,fetchAccounts:async()=>{const ee=await Promise.allSettled(g.map(async ae=>{const J=a.v2.notifications.$select(ae).accounts.list().values();return[ae,(await J.next()).value]})),ue=[];for(const ae of ee){const[J,Ie]=ae.value,ye=/^favourite/.test(J)?"favourite":/^reblog/.test(J)?"reblog":null;if(ye)for(const be of Ie){const Pe=ue.find(Ce=>Ce.id===be.id);Pe?Pe._types.push(ye):(be._types=[ye],ue.push(be))}}return{done:!0,value:ue}},showReactions:C==="favourite+reblog",postID:ot(M,i)}},children:["+",(C==="favourite"||C==="reblog")&&b-y.length,e(_,{icon:"chevron-down"})]}):e("button",{type:"button",class:"small plain",onClick:Y,children:[y.length>ni&&`+${y.length-ni}`,e(_,{icon:"chevron-down"})]})]}),!y?.length&&w?.length>1&&e("p",{class:"avatars-stack",children:[w.map(ee=>e(P,{children:[e("a",{href:ee.url,rel:"noopener",class:"account-avatar-stack",onClick:ue=>{ue.preventDefault(),E.showAccount=ee},children:e(ut,{url:ee.avatarStatic,size:"xxl",alt:`${ee.displayName} @${ee.acct}`,squircle:ee?.bot},ee.id)},ee.id)," "]},ee.id)),b>w.length&&e(pe,{to:i?`/${i}/s/${l.id}`:`/s/${l.id}`,class:"button small plain centered",children:["+",b-w.length,e(_,{icon:"chevron-right"})]})]}),S?.length>1&&e("ul",{class:"notification-group-statuses",children:S.map(ee=>e("li",{children:e(as,{class:`status-link status-type-${C}`,to:i?`/${i}/s/${ee.id}`:`/s/${ee.id}`,children:e(Ye,{status:ee,size:"s",previewMode:!0,allowContextMenu:!0,allowFilters:!0})})},ee.id))}),l&&(!S?.length||S?.length<=1)&&e(as,{class:`status-link status-type-${C}`,to:i?`/${i}/s/${M}`:`/s/${M}`,onContextMenu:s?void 0:ee=>{const ue=ee.target.querySelector(".status");if(ue){if(ee.metaKey)return;ee.preventDefault(),ue.dispatchEvent(new MouseEvent("contextmenu",{clientX:ee.clientX,clientY:ee.clientY}))}},children:o?e(Ye,{status:T,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0}):e(Ye,{statusID:M,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0})})]})]})}function as(n){const i=cc();return e(pe,{...n,"data-read-more":de._({id:"8fZueG"}),ref:i})}const ln=at(Rr,(n,i)=>n.notification?.id===i.notification?.id);"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:o,accessToken:s}=n?.data||{};i==="notification"&&(E.routeNotification={id:o,accessToken:s})});const Lr=at(function(){const{_:i}=ce();if(!("serviceWorker"in navigator))return null;const o=Ge(E),{routeNotification:s}=o,{id:c,accessToken:a}=s||{},[p,l]=R(!1);yt(()=>{if(!c||!a)return;const{instance:r}=ie(),{masto:u,instance:m}=ie({accessToken:a}),f=r===m,v=a?zo(a):yi();(async()=>{const y=await u.v1.notifications.$select(c).fetch();if(y&&v){const S=v.instanceURL,{type:g,status:w,account:b}=y,I=!!document.querySelector("#modal-container > *"),k=g==="follow"&&!!b?.id,A=!!b?.id,C=!!w?.id;k&&f?E.showAccount={account:b,instance:S}:I||!f||A&&C?l({id:c,account:v,notification:y,sameInstance:f}):C?location.hash=`/${r}/s/${w.id}`:k?location.hash=`/${r}/a/${b.id}`:location.hash="/notifications"}})()},[c,a]),yt(()=>{navigator?.clearAppBadge&&navigator.clearAppBadge()},[]),Wt(r=>{r&&navigator?.clearAppBadge&&navigator.clearAppBadge()});const d=()=>{l(!1),E.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(p){const{id:r,account:u,notification:m,sameInstance:f}=p;return e(Ke,{onClick:v=>{v.target===v.currentTarget&&d()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:d,children:e(_,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"5+87Pq"})})}),e("main",{children:[!f&&e("p",{children:e(h,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:v=>{const{target:y}=v;(v.target.tagName==="BUTTON"||v.target.tagName==="A")&&d()},children:e(ln,{instance:u.instanceURL,notification:m,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(pe,{to:"/notifications",class:"button light",onClick:d,children:[e("span",{children:e(h,{id:"/WA/tl"})})," ",e(_,{icon:"arrow-right"})]})})]})]})})}return null}),Yn=({limit:n}={})=>{const i=xe.account.get("searchHistory")||[];return n?i.slice(0,n):i},Mr=10,_n=(n,i=null)=>{if(!n?.trim?.())return;const o=Yn(),s=o.findIndex(a=>a.query===n&&a.queryType===i);s!==-1&&o.splice(s,1),o.unshift({query:n.trim(),queryType:i,timestamp:Date.now()});const c=o.slice(0,Mr);xe.account.set("searchHistory",c)},$r=(n,i=null)=>{const s=Yn().filter(c=>!(c.query===n&&c.queryType===i));xe.account.set("searchHistory",s)},Nr=()=>{xe.account.set("searchHistory",[])},Dt=(n,i,o)=>{let s,c,a;return i==="statuses"?(s=e(h,{id:"o1mMWT",values:{query:n},components:{0:e("q",{})}}),c=`/search?q=${encodeURIComponent(n)}&type=statuses`,a="document"):i==="accounts"?(s=e(h,{id:"cDoNQr",values:{query:n},components:{0:e("q",{})}}),c=`/search?q=${encodeURIComponent(n)}&type=accounts`,a="group"):i==="hashtags"?(s=e(h,{id:"YAZw8D",values:{0:n.replace(/^#/,"")},components:{0:e("mark",{})}}),c=`/${o}/t/${n.replace(/^#/,"")}`,a="hashtag"):(s=e(h,{id:"48oDit",values:{query:n},components:{0:e("small",{class:"insignificant"})}}),c=`/search?q=${encodeURIComponent(n)}`,a="search"),{label:s,to:c,icon:a}},co=Bo((n,i)=>{const{_:o}=ce(),{instance:s}=ie(),[c,a]=gt(),[p,l]=R(!1),[d,r]=R(c.get("q")||""),u=c.get("type"),m=F(null),f=F(null);Fo(i,()=>({setValue:S=>{r(S)},focus:()=>{f.current.focus()},select:()=>{f.current.select()},blur:()=>{f.current.blur()}}));const v=ke(()=>Yn({limit:5}),[n?.hidden]),y=ke(()=>{if(!d)return[];const g=v.filter(b=>b.query===d?!1:b.query.toLowerCase().includes(d.toLowerCase())).slice(0,2).map(b=>({...Dt(b.query,b.queryType,s),queryType:b.queryType,isRecentSearch:!0,historyItem:b}));return[{...Dt(d,null,s),top:!u&&!/\s/.test(d),hidden:!!u},...g,{...Dt(d,"statuses",s),hidden:/^https?:/.test(d),top:/\s/.test(d),queryType:"statuses"},{...Dt(d,"hashtags",s),hidden:/^@/.test(d)||/^https?:/.test(d)||/\s/.test(d),top:/^#/.test(d),type:"link",queryType:"hashtags"},{label:e(h,{id:"gEoOUj",values:{query:d},components:{0:e("mark",{})}}),to:`/${d}`,hidden:!/^https?:/.test(d),top:/^https?:/.test(d),type:"link",icon:"arrow-right"},{...Dt(d,"accounts",s),queryType:"accounts"}].sort((b,I)=>{if(u){if(b.queryType===u)return-1;if(I.queryType===u)return 1}return b.top&&!I.top?-1:!b.top&&I.top?1:0}).filter(({hidden:b})=>!b)},[d,u,s]);return e("form",{ref:m,class:"search-popover-container",onSubmit:S=>{if(S.preventDefault(),/\/search/.test(location.hash))if(d){const w={q:d};u&&(w.type=u),a(w)}else a({});else d?location.hash=`/search?q=${encodeURIComponent(d)}${u?`&type=${u}`:""}`:location.hash="/search";_n(d,u),n?.onSubmit?.(S)},children:[e("input",{ref:f,value:d,name:"q",type:"search",placeholder:o({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:S=>{S.target.value||a({})},onInput:S=>{r(S.target.value),l(!0)},onFocus:()=>{l(!0);const S=m.current?.querySelector(".search-popover-item");S&&S.classList.add("focus")},onBlur:()=>{setTimeout(()=>{l(!1)},100),m.current?.querySelector(".search-popover-item.focus")?.classList.remove("focus")},onKeyDown:S=>{const{key:g}=S;switch(g){case"Escape":l(!1);break;case"Down":case"ArrowDown":if(S.preventDefault(),p){const w=m.current.querySelector(".search-popover-item.focus");if(w){let b=w.nextElementSibling;for(;b&&b.hidden;)b=b.nextElementSibling;b&&(b.classList.add("focus"),Array.from(b.parentElement.children).filter(k=>k!==b).forEach(k=>{k.classList.remove("focus")}))}else{const b=m.current.querySelector(".search-popover-item");b&&b.classList.add("focus")}}break;case"Up":case"ArrowUp":if(S.preventDefault(),p){const w=document.querySelector(".search-popover-item.focus");if(w){let b=w.previousElementSibling;for(;b&&b.hidden;)b=b.previousElementSibling;b&&(b.classList.add("focus"),Array.from(b.parentElement.children).filter(k=>k!==b).forEach(k=>{k.classList.remove("focus")}))}else{const b=document.querySelectorAll(".search-popover-item"),I=b[b.length-1];I&&I.classList.add("focus")}}break;case"Enter":if(p){const w=document.querySelector(".search-popover-item.focus");w&&(S.preventDefault(),w.click()),l(!1),n?.onSubmit?.(S)}break}}}),e("div",{class:"search-popover",hidden:!p,children:[!d&&v.length>0&&e("div",{class:"search-popover-recent-searches",children:[e("div",{class:"search-popover-header",children:[e(_,{icon:"history",size:"s"}),e(h,{id:"4R1B1H"})]}),v.map((S,g)=>{const{label:w,to:b,icon:I}=Dt(S.query,S.queryType,s);return e(pe,{to:b,class:`search-popover-item ${g===0?"focus":""}`,onClick:k=>{_n(S.query,S.queryType),n?.onSubmit?.(k)},children:[e(_,{icon:I,class:"more-insignificant"}),e("span",{children:w})]},`${S.query}-${S.queryType}-${S.timestamp}`)}),e(pe,{to:"/search",class:"search-popover-item search-history-see-all",children:[e(_,{icon:"more2",class:"more-insignificant"}),e("span",{children:e(h,{id:"gukqfD"})})]})]}),y.map(({label:S,to:g,icon:w,queryType:b,isRecentSearch:I,historyItem:k},A)=>e(pe,{to:g,class:`search-popover-item ${I?"search-popover-item-recent":""} ${A===0?"focus":""}`,onClick:C=>{I||_n(d,b),n?.onSubmit?.(C)},children:[e(_,{icon:w,class:"more-insignificant"}),e("span",{children:S})]},I?`recent-${k.query}-${k.queryType}-${k.timestamp}`:`suggestion-${b||"general"}-${A}`))]})]})}),Pr=at(function({onClose:i=()=>{}}){const[o,s]=R(!1),c=F(null);He(["Slash","/"],l=>{s(!0),setTimeout(()=>{c.current?.focus?.(),c.current?.select?.()},0)},{useKey:!0,preventDefault:!0,ignoreEventWhen:l=>{const d=/\/search/.test(location.hash),r=!!document.querySelector("#modal-container > *");return d||r||l.metaKey||l.ctrlKey||l.altKey||l.shiftKey}});const a=()=>{s(!1),i()};He("esc",l=>{c.current?.blur?.(),a()},{enabled:o,enableOnFormTags:!0,preventDefault:!0,useKey:!0,ignoreEventWhen:l=>l.metaKey||l.ctrlKey||l.altKey||l.shiftKey});const p=!o;return e("div",{id:"search-command-container",hidden:p,onClick:l=>{l.target===l.currentTarget&&a()},children:e(co,{ref:c,hidden:p,onSubmit:()=>{a()}})})});function Dr(){const{_:n,_:i}=ce(),{instance:o}=ie(),s=Ge(E),{shortcuts:c,settings:a}=s;if(!c.length)return null;const p=a.shortcutsViewMode==="multi-column"||!a.shortcutsViewMode&&a.shortcutsColumnsMode,l=F(),d=F(),r=F(!1),u=c.map((y,S)=>{const{type:g,...w}=y;if(!Dn[g])return null;let{id:b,path:I,title:k,subtitle:A,icon:C}=Dn[g];return typeof b=="function"&&(b=b(w,S)),typeof I=="function"&&(I=I({...w,instance:w.instance||o},S)),typeof k=="function"?k=k(w,S):k?.id&&(k=i(k)),typeof A=="function"?A=A(w,S):A?.id&&(A=i(A)),typeof C=="function"&&(C=C(w,S)),b==="lists"&&(r.current=!0),{id:b,path:I,title:k,subtitle:A,icon:C}}).filter(Boolean);W(()=>{if(s.settings.shortcutsViewMode==="tab-menu-bar"&&d.current){const y=setTimeout(()=>{const S=d.current?.querySelector(".is-active");S&&S.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},100);return()=>clearTimeout(y)}},[]);const m=xs();He(["1","2","3","4","5","6","7","8","9"],y=>{const S=parseInt(y.key,10)-1;if(Sy.metaKey||y.ctrlKey||y.altKey||y.shiftKey});const[f,v]=R([]);return p?null:e("div",{id:"shortcuts",children:s.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{ref:d,class:"tab-bar",onContextMenu:y=>{y.preventDefault(),E.showShortcutsSettings=!0},children:e("ul",{children:u.map(({id:y,path:S,title:g,subtitle:w,icon:b},I)=>e("li",{children:e(pe,{class:w?"has-subtitle":"",to:S,onClick:k=>{if(k.target.classList.contains("is-active")){k.preventDefault();const A=document.getElementById(`${y}-page`);if(A){A.scrollTop=0;const C=A.querySelector(".updates-button");C&&C.click()}}},children:[e(_,{icon:b,size:"xl"}),e("span",{children:[e(Sn,{children:g}),w&&e(P,{children:[e("br",{}),e("small",{children:w})]})]})]})},`${I}-${y}-${g}-${w}-${S}`))})}):e(ct,{instanceRef:l,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:y=>{y.open&&r.current&&un().then(v)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:y=>{y.preventDefault(),E.showShortcutsSettings=!0},onTransitionStart:y=>{try{const{target:S}=y;getComputedStyle(S).pointerEvents==="none"&&l.current?.closeMenu?.()}catch{}},children:e(_,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:u.map(({id:y,path:S,title:g,subtitle:w,icon:b},I)=>y==="lists"?e(dn,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(P,{children:[e(_,{icon:b,size:"l"}),e("span",{class:"menu-grow",children:e(Sn,{children:g})}),e(_,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),e(je,{}),f?.map(k=>e(qe,{to:`/l/${k.id}`,children:e("span",{children:[k.title,k.exclusive&&e(P,{children:[" ",e(Ut,{})]})]})},k.id))]}):e(qe,{to:S,class:"glass-menu-item",children:[e(_,{icon:b,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(Sn,{children:g})}),w&&e(P,{children:[" ",e("small",{class:"more-insignificant",children:w})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:I+1})]},`${I}-${y}-${g}-${w}-${S}`))})})}const Or=at(Dr);function zr(n){let i=[],o=[],s=0;for(let c=0;c10&&(o.length>n.length/4||s>=3)){const c=o.map(a=>a.id);if(o.length>n.length*3/4)i=[...i,{id:c,items:o,type:"boosts"}];else{const a=Math.floor(i.length/2);i=[...i.slice(0,a),{id:c,items:o,type:"boosts"},...i.slice(a)]}return i}else return n}function rs(n,i){const o=xe.account.get("boostedStatusIDs")||{},s=n.filter(a=>{if(!a.reblog)return!0;const p=`${i}-${a.reblog.id}`,l=o[p];return l&&l!==a.id?!1:(o[p]=a.id,!0)}),c=Object.keys(o);return c.length>50&&c.slice(0,c.length-50).forEach(a=>{delete o[a]}),xe.account.set("boostedStatusIDs",o),s}function Br(n,i){const o=[];let s=0;n.forEach(l=>{for(let r=0;ru.id===l.id))return;if(o[r].find(u=>u.id===l.inReplyToId)||o[r].find(u=>u.inReplyToId===l.id)){o[r].push(l);return}}const d=n.find(r=>r.id===l.inReplyToId);d&&(o[s++]=[l,d])});for(let l=0;lo[d].includes(u))&&(o[l]=[...o[l],...o[d]],o[l]=o[l].filter((u,m,f)=>f.findIndex(v=>v.id===u.id)===m),o.splice(d,1),d--);o.forEach(l=>{l.sort((d,r)=>!d.inReplyToId&&!r.inReplyToId?Date.parse(d.createdAt)-Date.parse(r.createdAt):d.inReplyToId===r.id?1:r.inReplyToId===d.id||!d.inReplyToId?-1:r.inReplyToId?Date.parse(d.createdAt)-Date.parse(r.createdAt):1)}),o.forEach(l=>{const d=l[0].account.id;l.forEach(r=>{r.account.id!==d&&(r._differentAuthor=!0)})}),o.length;const c=[],a=[],p=[];return n.forEach(l=>{if(l.reblog){c.push(l);return}for(let d=0;dr.id===l.id)){if(a.includes(d))return;const r=o[d];r.sort((m,f)=>Date.parse(m.createdAt)-Date.parse(f.createdAt));const u=r[0].account.id;c.push({id:r.map(m=>m.id),items:r,type:r.every(m=>m.account.id===u)?"thread":"conversation"}),a.push(d);return}if(l.inReplyToId&&l.inReplyToAccountId!==l.account.id){const d=ot(l.id,i);E.statusReply[d]||p.push({sKey:d,inReplyToId:l.inReplyToId})}c.push(l)}),p?.length&&queueMicrotask(()=>{const{masto:l}=ie({instance:i});async function d(){for(let r=0;rsetTimeout(v,1e3))}catch{}}}if(Je("@mastodon/fetch-multiple-statuses")){const r=p.map(({inReplyToId:u})=>u);(async()=>{try{const u=await l.v1.statuses.list({id:r});if(u?.length)for(const m of u){Qe(m,i,{skipThreading:!0});const f=p.find(({inReplyToId:v})=>v===m.id)?.sKey;f&&(E.statusReply[f]={id:m.id,instance:i})}else d()}catch{d()}})()}else d()}),c}const Fr=mt((n,i)=>i.v1.statuses.$select(n).fetch());async function ao(n,i){const o=await wr();if(!o.length)return;const{statusFollowedTags:s}=E,c=[];if(n.forEach(a=>{if(a.reblog)return;const{id:p,content:l,tags:d=[]}=a,r=ot(p,i);if(s[r]?.length)return;const u=kr(l);if(!u.length&&!d.length)return;const m=o.reduce((f,v)=>((u.some(y=>y.toLowerCase()===v.name.toLowerCase())||d.some(y=>y.name.toLowerCase()===v.name.toLowerCase()))&&f.push(v.name),f),[]);m.length&&c.push({item:a,sKey:r,followedTags:m})}),c.length){const a=c.map(l=>l.item.account),p=await Bn(a);if(!p)return;c.forEach(l=>{const{item:d,sKey:r,followedTags:u}=l,m=p[d.account.id];m&&!m.following&&(s[r]=u)})}}function Ur(){E.statusFollowedTags={}}function Kr({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:o=1,scrollThresholdStart:s=10,scrollThresholdEnd:c=10,direction:a="vertical",distanceFromStartPx:p,distanceFromEndPx:l}={}){const[d,r]=R(null),[u,m]=R(!1),[f,v]=R(!1),[y,S]=R(!1),[g,w]=R(!1),b=a==="vertical";return yt(()=>{const I=n.current;if(!I)return{};let k=b?I.scrollTop:I.scrollLeft;function A(){const{scrollTop:C,scrollLeft:T,scrollHeight:M,scrollWidth:L,clientHeight:U,clientWidth:H}=I,j=b?C:T,X=b?M:L,Q=b?U:H,V=Math.abs(j-k),G=p||Math.min(Q*i,X,j),q=l||Math.min(Q*o,X,X-j-Q);V>=(k=X),S(j<=G),w(j+Q>=X-q)}return I.addEventListener("scroll",A,{passive:!0}),()=>I.removeEventListener("scroll",A)},[i,o,s,c]),{scrollDirection:d,reachStart:u,reachEnd:f,nearReachStart:y,nearReachEnd:g,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function Hr({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:o=1,scrollThresholdStart:s=10,scrollThresholdEnd:c=10,direction:a="vertical",distanceFromStartPx:p,distanceFromEndPx:l,init:d}={},r,u){if(!r)return;const m=a==="vertical",f=F(null),v=F(null),y=ac(()=>{let S=!1,g=!1,w=!1,b=!1;const I=n.current,{scrollTop:k,scrollLeft:A,scrollHeight:C,scrollWidth:T,clientHeight:M,clientWidth:L}=I,U=m?k:A,H=m?C:T,j=m?M:L,X=Math.abs(U-f.current),Q=p||Math.min(j*i,H,U),V=l||Math.min(j*o,H,H-U-j);X>=(f.current=H,w=U<=Q,b=U+j>=H-V,r({scrollDirection:v.current,reachStart:S,reachEnd:g,nearReachStart:w,nearReachEnd:b})},500);return yt(()=>{const S=n.current;return S?(f.current=S[m?"scrollTop":"scrollLeft"],S.addEventListener("scroll",y,{passive:!0}),()=>S.removeEventListener("scroll",y)):{}},[i,o,s,c,...u]),W(()=>{d&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[d]),{resetScrollDirection:()=>{v.current=null}}}function qr({class:n,statusID:i,status:o,instance:s,parent:c,onMediaClick:a}){const{_:p}=ce();let l=ot(i,s);const d=Ge(E);if(o||(o=d.statuses[l]||d.statuses[i],l=ot(o?.id,s)),!o)return null;const{account:{acct:r,avatar:u,avatarStatic:m,id:f,url:v,displayName:y,username:S,emojis:g,bot:w,group:b},id:I,repliesCount:k,reblogged:A,reblogsCount:C,favourited:T,favouritesCount:M,bookmarked:L,poll:U,muted:H,sensitive:j,spoilerText:X,visibility:Q,language:V,editedAt:G,filtered:q,card:he,createdAt:$,inReplyToId:ne,inReplyToAccountId:Y,content:ee,mentions:ue,mediaAttachments:ae,reblog:J,uri:Ie,url:ye,emojis:be,_deleted:Pe,_pinned:Ce}=o;if(!ae?.length)return null;const Ae=we=>{we.shiftKey},Te=ke(()=>ft(),[]),De=ke(()=>Te&&Te===f,[f,Te]),Oe=Uo(Fn),Fe=!De&&Gt(q,Oe);if(Fe?.action==="hide")return null;const se=j,_e=(gi()["reading:expand:media"]?.toLowerCase()||"default")==="show_all",K=c||"div";return ae.map((we,Re)=>{const Ne=`${l}-${we.id}`,O=Fe?.titlesStr;return e(K,{"data-state-post-id":l,onMouseEnter:Ae,"data-spoiler-text":X||(j?p({id:"FKojeB"}):void 0),"data-filtered-text":Fe?p(O?{id:"7FGvtQ",values:{filterTitleStr:O}}:{id:"03Qqf9"}):void 0,class:` media-post ${Fe?"filtered":""} ${se?"has-spoiler":""} ${_e?"show-media":""} `,children:e(Bs,{class:n,media:we,lang:V,to:`/${s}/s/${I}?media-only=${Re+1}`,onClick:a?Se=>a(Se,Re,we,o):void 0})},Ne)})}const ls=at(qr);function jr(n){const{_:i}=ce(),o=Ge(E),{masto:s,instance:c,authenticated:a}=ie(),[p,l]=ke(()=>{const I=mi();return[I.find(A=>A.info.id===ft())||I[0],I.length>1]},[]),d=(o.settings.shortcutsViewMode==="multi-column"||!o.settings.shortcutsViewMode&&o.settings.shortcutsColumnsMode)&&!o.shortcuts.find(I=>I.type==="following"),r=Ms(()=>{E.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),u=F(),[m,f]=R(void 0),v=Ns([0,0,o.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),y=F();async function S(I){return(I||!y.current)&&(y.current=s.v1.mutes.list({limit:80}).values()),await y.current.next()}const g=F();async function w(I){return(I||!g.current)&&(g.current=s.v1.blocks.list({limit:80}).values()),await g.current.next()}const b=F();return e(P,{children:[e("button",{ref:u,type:"button",class:`button plain nav-menu-button ${l?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{b.current=Date.now(),f(I=>I?void 0:"open")},onContextMenu:I=>{I.preventDefault(),E.showAccounts=!0},...r(),children:[l&&e(ut,{url:p?.info?.avatar||p?.info?.avatarStatic,size:"l",squircle:p?.info?.bot}),e(_,{icon:"menu",size:l?"s":"l",alt:i({id:"zucql+"})})]}),e(Si,{menuClassName:"nav-menu",state:m,anchorRef:u,onClose:()=>{f(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-b.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:v,unmountOnClose:!0,children:[!!o.appVersion?.commitHash&&o.appVersion.commitHash!=="03ce4c6"&&e("div",{class:"top-menu",children:[e(ge,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(_,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(h,{id:"95IFnD"})})]}),e(je,{})]}),e("section",{children:[e(qe,{to:"/",children:[e(_,{icon:"home",size:"l"})," ",e("span",{children:e(h,{id:"i0qMbr"})})]}),a?e(P,{children:[d&&e(qe,{to:"/following",children:[e(_,{icon:"following",size:"l"})," ",e("span",{children:e(h,{id:"following.title"})})]}),e(qe,{to:"/catchup",children:[e(_,{icon:"history2",size:"l"}),e("span",{children:e(h,{id:"xrl8fj"})})]}),Je("@mastodon/mentions")&&e(qe,{to:"/mentions",children:[e(_,{icon:"at",size:"l"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(qe,{to:"/notifications",children:[e(_,{icon:"notification",size:"l"})," ",e("span",{children:e(h,{id:"iDNBZe"})}),o.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(je,{}),p?.info?.id&&e(qe,{to:`/${c}/a/${p.info.id}`,children:[e(_,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"vERlcd"})})]}),e(Yr,{menuState:m}),e(qe,{to:"/b",children:[e(_,{icon:"bookmark",size:"l"})," ",e("span",{children:e(h,{id:"7Ff7ia"})})]}),e(dn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(P,{children:[e(_,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"24misb"})}),e(_,{icon:"chevron-right"})]}),children:[e(qe,{to:"/f",children:[e(_,{icon:"heart",size:"l"})," ",e("span",{children:e(h,{id:"zZOZj7"})})]}),e(qe,{to:"/fh",children:[e(_,{icon:"hashtag",size:"l"})," ",e("span",{children:e(h,{id:"Xi1/bw"})})]}),e(qe,{to:"/sp",children:[e(_,{icon:"schedule",size:"l"})," ",e("span",{children:e(h,{id:"+GkIdc"})})]}),e(je,{}),Je("@mastodon/filters")&&e(qe,{to:"/ft",children:[e(_,{icon:"filters",size:"l"})," ",e("span",{children:e(h,{id:"cSev+j"})})]}),e(ge,{onClick:()=>{E.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:S,excludeRelationshipAttrs:["muting"]}},children:[e(_,{icon:"mute",size:"l"})," ",e("span",{children:e(h,{id:"n1sANU"})})]}),e(ge,{onClick:()=>{E.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(_,{icon:"block",size:"l"})," ",e("span",{children:e(h,{id:"r3RRWo"})})]})," "]}),e(je,{}),e(ge,{onClick:()=>{E.showAccounts=!0},children:[e(_,{icon:"group",size:"l"})," ",e("span",{children:e(h,{id:"7e0O8Z"})})]})]}):e(P,{children:[e(je,{}),e(qe,{to:"/login",children:[e(_,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(je,{}),e(qe,{to:"/search",children:[e(_,{icon:"search",size:"l"})," ",e("span",{children:e(h,{id:"A1taO8"})})]}),e(qe,{to:`/${c}/trending`,children:[e(_,{icon:"chart",size:"l"})," ",e("span",{children:e(h,{id:"4/iCqx"})})]}),e(qe,{to:`/${c}/p/l`,children:[e(_,{icon:"building",size:"l"})," ",e("span",{children:e(h,{id:"d5zxa4"})})]}),e(qe,{to:`/${c}/p`,children:[e(_,{icon:"earth",size:"l"})," ",e("span",{children:e(h,{id:"4ERYY7"})})]}),a?e(P,{children:[e(je,{className:"divider-grow"}),e(ge,{onClick:()=>{E.showKeyboardShortcutsHelp=!0},children:[e(_,{icon:"keyboard",size:"l"})," ",e("span",{children:e(h,{id:"77Emn0"})})]}),e(ge,{onClick:()=>{E.showShortcutsSettings=!0},children:[e(_,{icon:"shortcut",size:"l"})," ",e("span",{children:e(h,{id:"8Kudkr"})})]}),e(ge,{onClick:()=>{E.showSettings=!0},children:[e(_,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]}):e(P,{children:[e(je,{}),e(ge,{onClick:()=>{E.showSettings=!0},children:[e(_,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]})]})]})]})}function Yr({menuState:n}){const i=Je("@mastodon/lists"),[o,s]=R([]);return W(()=>{i&&n==="open"&&un().then(s)},[n,i]),o.length>0?e(dn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(P,{children:[e(_,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"h16FyT"})}),e(_,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),o?.length>0&&e(P,{children:[e(je,{}),o.map(c=>e(qe,{to:`/l/${c.id}`,children:e("span",{children:[c.title,c.exclusive&&e(P,{children:[" ",e(Ut,{})]})]})},c.id))]})]}):i&&e(qe,{to:"/l",children:[e(_,{icon:"list",size:"l"}),e("span",{children:e(h,{id:"h16FyT"})})]})}const Nt=at(jr),mn={block:"start",inline:"center",behavior:"smooth"};function At({title:n,titleComponent:i,id:o,instance:s,emptyText:c,errorText:a,useItemID:p,boostsCarousel:l,fetchItems:d=()=>{},checkForUpdates:r=()=>{},checkForUpdatesInterval:u=15e3,headerStart:m,headerEnd:f,timelineStart:v,refresh:y,view:S,filterContext:g,showFollowedTags:w,showReplyParent:b,clearWhenRefresh:I}){const{_:k}=ce(),A=Ge(E),[C,T]=R([]),[M,L]=R("start"),[U,H]=R(!1),[j,X]=R(!1),[Q,V]=R(!0),G=F();__BENCHMARK.start(`timeline-${o}-load`);const q=ke(()=>bi(),[]),he=S!=="media",$=F(0),ne=rc(se=>{X(!1),L("loading"),(async()=>{try{const Ee=$.current=Date.now();let{done:$e,value:_e}=await d(se);if(Ee!==$.current)return;if(Array.isArray(_e)){const[K,we]=_e.reduce((Re,Ne)=>(Ne._pinned?Re[0].push(Ne):Re[1].push(Ne),Re),[[],[]]);_e=we,he&&(l&&(_e=zr(_e)),_e=Br(_e,s)),K.length&&(_e=K.concat(_e)),T(se?_e:Re=>[...Re,..._e]),_e.length||($e=!0),H(!$e)}else H(!1);L("default"),__BENCHMARK.end(`timeline-${o}-load`)}catch{L("error"),se&&!C.length&&a&&re(a)}finally{ne.cancel()}})()},1e3,{leading:!0}),Y=".timeline-item, .timeline-item-alt",ee=He("j, shift+j",(se,Ee)=>{if(se.shiftKey!==Ee.shift)return;const $e=document.activeElement.closest(Y),_e=$e?.getBoundingClientRect(),K=Array.from(G.current.querySelectorAll(Y)).filter(we=>!!we.offsetHeight);if($e&&_e.top0){const we=K.indexOf($e);let Re=K[we+1];Ee.shift&&(Re=K.find((Ne,O)=>O>we&&!Ne.classList.contains("timeline-item-alt"))),Re&&(Re.focus(),Re.scrollIntoView(mn))}else{const we=K.find(Re=>{const Ne=Re.getBoundingClientRect();return Ne.top>=44&&Ne.left>=0});we&&(we.focus(),we.scrollIntoView(mn))}},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey}),ue=He("k, shift+k",(se,Ee)=>{if(se.shiftKey!==Ee.shift)return;const $e=document.activeElement.closest(Y),_e=$e?.getBoundingClientRect(),K=Array.from(G.current.querySelectorAll(Y)).filter(we=>!!we.offsetHeight);if($e&&_e.top0){const we=K.indexOf($e);let Re=K[we-1];Ee.shift&&(Re=K.findLast((Ne,O)=>O{const Ne=Re.getBoundingClientRect();return Ne.top>=44&&Ne.left>=0});we&&(we.focus(),we.scrollIntoView(mn))}},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey}),ae=He(["enter","o"],()=>{const se=document.activeElement;se?.matches(Y)&&se.click()},{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey||se.shiftKey}),J=C.length>0&&M!=="loading"&&j,Ie=tt(()=>{J&&ne(!0),G.current?.scrollTo({top:0,behavior:"smooth"})},[ne,J]),ye=He(".",Ie,{useKey:!0,ignoreEventWhen:se=>se.metaKey||se.ctrlKey||se.altKey||se.shiftKey}),be=F(),[Pe,Ce]=R(!1),{resetScrollDirection:Ae}=Hr({scrollableRef:G,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:se,nearReachStart:Ee,reachStart:$e})=>{if(be.current){const _e=se==="end"&&!Ee;be.current.hidden=_e}Ce(Ee),$e&&ne(!0)},[]);W(()=>{G.current?.scrollTo({top:0}),ne(!0)},[]);const Te=F(!0);W(()=>{if(Te.current){Te.current=!1;return}I&&C?.length&&(ne.cancel?.(),T([])),ne(!0)},[I,y]);const De=F(S);W(()=>{De.current!==S&&(De.current=S,T([]))},[S]);const Oe=tt(async({disableIdleCheck:se=!1}={})=>{const Ee=G.current?getComputedStyle(G.current).pointerEvents==="none":!1;A.settings.autoRefresh&&G.current.scrollTop<16&&(se||window.__IDLE__)&&!Zr()&&!Ee?ne(!0):await r()&&X(!0)},[o,ne,r,A.settings.autoRefresh]),Fe=F();return Wt(se=>{if(se){const Ee=Date.now()-Fe.current;(!Fe.current||Ee>1e3*3)&&Oe({disableIdleCheck:!0})}else Fe.current=Date.now();V(se)},[r,Oe,A.settings.autoRefresh]),ki(Oe,Q&&!j?u*(Pe?1:2):null),e(Fn.Provider,{value:g,children:e("div",{id:`${o}-page`,class:`deck-container ${q?"deck-container-media-first":""}`,ref:se=>{G.current=se,ee.current=se,ue.current=se,ae.current=se,ye.current=se},tabIndex:"-1",onClick:se=>{be.current&&se.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{be.current.hidden=!1,Ae()},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:be,onClick:se=>{se.target.closest("a, button")||G.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:se=>{se.target.closest("a, button")||ne(!0)},class:M==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),m??e(pe,{to:"/",class:"button plain home-button",children:e(_,{icon:"home",size:"l",alt:k({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!f&&f})]}),J&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:Ie,children:[e(_,{icon:"arrow-up"})," ",e(h,{id:"2yr1/p"})]})]}),!!v&&e("div",{class:`timeline-start ${M==="loading"?"loading":""}`,children:v}),C.length?e(P,{children:[e("ul",{class:`timeline ${S?`timeline-${S}`:""}`,children:[C.map(se=>e(Vr,{status:se,instance:s,useItemID:p,filterContext:g,view:S,showFollowedTags:w,showReplyParent:b,mediaFirst:q},se.id+se?._pinned+S)),U&&M==="loading"&&(S==="media"?null:e(P,{children:[e("li",{style:{height:"20vh"},children:e(Ye,{skeleton:!0,mediaFirst:q})}),e("li",{style:{height:"25vh"},children:e(Ye,{skeleton:!0,mediaFirst:q})})]}))]}),M==="default"&&(U?e(Ct,{root:G.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:se=>{se&&ne()},children:e("button",{type:"button",class:"plain block",onClick:()=>ne(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}))]}):M==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((se,Ee)=>S==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(Ye,{skeleton:!0,mediaFirst:q})},Ee))}):M!=="error"&&M!=="start"&&e("p",{class:"ui-state",children:c}),M==="error"&&e("p",{class:"ui-state",children:[a,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>ne(!C.length),children:e(h,{id:"KDw4GX"})})]})]})})})}const Vr=at(({status:n,instance:i,useItemID:o,filterContext:s,view:c,showFollowedTags:a,showReplyParent:p,mediaFirst:l})=>{const{_:d}=ce(),{id:r,reblog:u,items:m,type:f,_pinned:v}=n;v&&(o=!1);const y=u?.id||r,S=i?`/${i}/s/${y}`:`/s/${y}`;if(m){let w=Bt(m,s),b="";if(f==="boosts"?b=de._({id:"NuqppG",values:{0:w.length}}):f==="pinned"&&(b=d({id:"GlfmCu"})),f==="boosts"||f==="pinned"){const A=new Set;if(w.sort((C,T)=>{const M=Gt(C.filtered,s),L=Gt(T.filtered,s);return M&&M?.action!=="blur"&&A.add(C.id),L&&L?.action!=="blur"&&A.add(T.id),M&&!L?1:!M&&L?-1:0}),A.size>=2){const T=[],M=[];w.forEach(U=>{A.has(U.id)?M.push(U):T.push(U)});const L=[];for(let U=0;U{const{id:T,reblog:M,_pinned:L,_grouped:U}=C;if(U)return e("li",{class:"timeline-item-carousel-group",children:C.posts.map(X=>{const{id:Q,reblog:V,_pinned:G}=X,q=V?.id||Q,he=i?`/${i}/s/${q}`:`/s/${q}`;return G&&(o=!1),e(pe,{class:"status-carousel-link timeline-item-alt",to:he,children:o?e(Ye,{statusID:Q,instance:i,size:"s"}):e(Ye,{status:X,instance:i,size:"s"})})})},T);const H=M?.id||T,j=i?`/${i}/s/${H}`:`/s/${H}`;return L&&(o=!1),e("li",{children:e(pe,{class:"status-carousel-link timeline-item-alt",to:j,children:o?e(Ye,{statusID:T,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:l}):e(Ye,{status:C,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:l})})},T)})})},`timeline-${r}`)}const k=w.length>3;return w.map((A,C)=>{const{id:T,_differentAuthor:M}=A,L=i?`/${i}/s/${T}`:`/s/${T}`,U=C>0&&C0||k&&U&&(f==="thread"||f==="conversation"&&!M&&!w[C-1]._differentAuthor&&!w[C+1]._differentAuthor),X=C===0,Q=C===w.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${f} timeline-item-container-${X?"start":Q?"end":"middle"} ${M?"timeline-item-diff-author":""}`,children:e(pe,{class:"status-link timeline-item",to:L,children:j?e(Wr,{status:A,instance:i,filterContext:s}):o?e(Ye,{statusID:T,instance:i,enableCommentHint:Q,showFollowedTags:a}):e(Ye,{status:A,instance:i,enableCommentHint:Q,showFollowedTags:a})})},`timeline-${T}`)})}const g=`timeline-${r+v}`;return c==="media"?o?e(ls,{class:"timeline-item",parent:"li",statusID:r,instance:i},g):e(ls,{class:"timeline-item",parent:"li",status:n,instance:i},g):e("li",{children:e(pe,{class:"status-link timeline-item",to:S,children:o?e(Ye,{statusID:r,instance:i,enableCommentHint:!0,showFollowedTags:a,showReplyParent:p,mediaFirst:l}):e(Ye,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:a,showReplyParent:p,mediaFirst:l})})},g)},(n,i)=>{const o=(n.status?.id||"").toString(),s=(i.status?.id||"").toString();return o===s&&n.instance===i.instance&&n.view===i.view});function Gr({title:n,class:i,children:o}){const{_:s}=ce(),c=F(),a=F(),p=F(),[l,d]=R(!1);return W(()=>{setTimeout(()=>{d(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:a,type:"button",class:"small plain2",onClick:()=>{const r=Math.min(320,c.current?.offsetWidth)*(Ot()?1:-1);c.current?.scrollBy({left:r,behavior:"smooth"})},children:e(_,{icon:"chevron-left",alt:s({id:"DHhJ7s"})})})," ",e("button",{ref:p,type:"button",class:"small plain2",onClick:()=>{const r=Math.min(320,c.current?.offsetWidth)*(Ot()?-1:1);c.current?.scrollBy({left:r,behavior:"smooth"})},children:e(_,{icon:"chevron-right",alt:s({id:"hXzOVo"})})})]})]}),e("ul",{ref:c,children:[e(Ct,{class:"status-carousel-beacon",onChange:r=>{a.current&&(a.current.disabled=r)}}),o[0],l&&o.slice(1),e(Ct,{class:"status-carousel-beacon",onChange:r=>{p.current&&(p.current.disabled=r)}})]})]})}function Wr({status:n,instance:i,filterContext:o}){const{_:s}=ce(),c=Ge(E),{id:a,visibility:p,language:l}=n,d=On(n),r=ot(a,i),u=Gt(n.filtered,o);return e("article",{class:`status compact-thread ${p==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[e("div",{class:"status-thread-badge-container",children:e(lc,{index:c.statusThreadNumber[r]})}),e("div",{class:"content-compact",title:d,lang:l,dir:"auto",children:u&&u?.action!=="blur"?e("b",{class:"status-filtered-badge badge-meta horizontal",title:u?.titlesStr||"",children:u?.titlesStr?e(h,{id:"sr6maL",values:{0:u.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(h,{id:"03Qqf9"})})}):e(P,{children:[d,n.sensitive&&n.spoilerText&&e(P,{children:[" ",e("span",{class:"spoiler-badge",children:e(_,{icon:"eye-close",size:"s",alt:s({id:"gnKo7f"})})})]})]})})]})}function Zr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const jt=20,Oi=1983,ds=`${Oi}-01`,Xr=(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}})();async function Jr(n){const{masto:i}=ie({instance:n});return!!(await i.v2.search.list({q:"from:me",type:"statuses",limit:1}))?.statuses?.length}const Qr=mt(Jr);function el(){const{i18n:n,_:i}=ce(),o=Ge(E),{id:s,...c}=$t(),[a,p]=gt(),l=a.get("month"),d=!a.get("replies"),r=!!a.get("boosts"),u=a.get("tagged"),m=!!a.get("media"),{masto:f,instance:v,authenticated:y}=ie({instance:c.instance}),{masto:S,instance:g}=ie(),w=F(),b=[l,d,r,u,m],[I,k]=R(),A=F(0);W(()=>{A.current=0},b);const C=ke(()=>bi(),[]),T=ke(()=>v===g,[v,g]),[M,L]=R(!1);W(()=>{T&&I?.acct&&(async()=>{const ae=await Qr(v);L(ae)})()},[v,T,I?.acct]);async function U(ae){const J=/^\d{4}-[01]\d$/.test(l),Ie=l?.split?.("-")?.[0]>=Oi;if(J&&Ie){if(!I)return{value:[],done:!0};const[Ce,Ae]=l.split("-"),Te=parseInt(Ae,10)-1,De=new Date(Ce,Te,0),Oe=`${De.getFullYear()}-${(De.getMonth()+1).toString().padStart(2,"0")}-${De.getDate().toString().padStart(2,"0")}`,Fe=new Date(Ce,Te+1,1),se=`${Fe.getFullYear()}-${(Fe.getMonth()+1).toString().padStart(2,"0")}-${Fe.getDate().toString().padStart(2,"0")}`;let Ee;ae?(Ee=jt+1,A.current=0):(Ee=jt+A.current+1,A.current+=jt);const $e=await f.v2.search.list({q:`from:${I.acct} after:${Oe} before:${se}`,type:"statuses",limit:Ee,offset:A.current});if($e?.statuses?.length){const _e=$e.statuses.slice(0,jt);_e.forEach(we=>{Qe(we,v)});const K=$e.statuses.length<=jt;return{value:_e,done:K}}else return{value:[],done:!0}}let ye=[];if(ae){const{value:Ce}=await f.v1.accounts.$select(s).statuses.list({pinned:!0}).values().next();if(Ce?.length&&!u&&!m){const Ae=Ce.map(Te=>(Qe(Te,v),{...Te,_pinned:!0}));if(Ae.length>=3){const Te=Ae.map(De=>De.id);ye.push({id:Te,items:Ae,type:"pinned"})}else ye.push(...Ae)}}(ae||!w.current)&&(w.current=f.v1.accounts.$select(s).statuses.list({limit:jt,exclude_replies:d,exclude_reblogs:r,only_media:m||void 0,tagged:u}).values());const{value:be,done:Pe}=await w.current.next();if(be?.length){if(!Je("@mastodon/pinned-posts")&&ye.length){let Ce=[];ye[0]?.type==="pinned"?Ce=ye[0].id:Ce=ye.filter(Te=>Te._pinned).map(Te=>Te.id),Ce.every(Te=>be.some(De=>De.id===Te))&&(ye=[])}ye.push(...be),be.forEach(Ce=>{Qe(Ce,v)})}return{value:ye,done:Pe}}const[H,j]=R([]);let X=i({id:"/cKnpj"});if(I?.acct){const ae=(/@/.test(I.acct)?"":"@")+I.acct,J=I?.displayName?`${I.displayName} (${ae})`:`${ae}`;if(!d)X=i({id:"hS1Opy",values:{accountDisplay:J}});else if(r)X=i({id:"A/CX5F",values:{accountDisplay:J}});else if(u)X=i({id:"QQrO94",values:{accountDisplay:J,tagged:u}});else if(m)X=i({id:"NoG5wD",values:{accountDisplay:J}});else if(l){const Ie=new Date(l).toLocaleString(n.locale,{month:"long",year:"numeric"});X=i({id:"8GjLvB",values:{accountDisplay:J,monthYear:Ie}})}else X=J}et(X,"/:instance?/a/:id");const Q=tt(()=>il(s,f),[s,f]);W(()=>{(async()=>{try{const ae=await Q();k(ae)}catch{}if(!C)try{const ae=await f.v1.accounts.$select(s).featuredTags.list();j(ae)}catch{}})()},[s,C]);const{displayName:V,acct:G,emojis:q}=I||{},he=ke(()=>I?.id===ft(),[I?.id]),$=F(),ne=ke(()=>{const ae=!d||r||u||m||!!l,J=o.accounts[`${s}@${v}`];return e(P,{children:[e(to,{instance:v,account:J||s,fetchAccount:Q,authenticated:y,standalone:!0,showEndorsements:!0}),!C&&e("div",{class:"filter-bar",ref:$,style:{position:"relative"},children:[ae?e(pe,{to:`/${v}/a/${s}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(_,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(_,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(pe,{to:`/${v}/a/${s}${d?"?replies=1":""}`,onClick:()=>{d&&re(i({id:"PIWNSQ"}))},class:d?"":"is-active",children:e(h,{id:"5BFynH"})}),e(pe,{to:`/${v}/a/${s}${r?"":"?boosts=0"}`,onClick:()=>{r||re(i({id:"Qd13i0"}))},class:r?"is-active":"",children:e(h,{id:"usxQx0"})}),e(pe,{to:`/${v}/a/${s}${m?"":"?media=1"}`,onClick:()=>{m||re(i({id:"rKpfPY"}))},class:m?"is-active":"",children:e(h,{id:"xYilR2"})}),H.map(Ie=>e(pe,{to:`/${v}/a/${s}${u===Ie.name?"":`?tagged=${encodeURIComponent(Ie.name)}`}`,onClick:()=>{u!==Ie.name&&re(i({id:"L+HFfr",values:{0:Ie.name}}))},class:u===Ie.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),Ie.name]})},Ie.id)),M&&(Xr?e("label",{class:`filter-field ${l?"is-active":""}`,children:[e(_,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!I?.acct,value:l||"",min:ds,max:new Date().toISOString().slice(0,7),onInput:Ie=>{const{value:ye,validity:be}=Ie.currentTarget;if(!be.valid)return;p(ye?{month:ye}:{});const[Pe,Ce]=ye.split("-"),Ae=parseInt(Ce,10)-1,Te=new Date(Pe,Ae);re(i({id:"0WUFGD",values:{0:Te.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(tl,{class:`filter-field ${l?"is-active":""}`,disabled:!I?.acct,value:l||"",min:ds,max:new Date().toISOString().slice(0,7),onInput:Ie=>{const{value:ye,validity:be}=Ie;be.valid&&p(ye?{month:ye}:{})}}))]})]})},[s,v,y,H,Q,M,...b]);W(()=>{const ae=$.current?.querySelector(".is-active");ae&&$.current.scrollTo({behavior:"smooth",left:ae.offsetLeft-($.current.offsetWidth-ae.offsetWidth)/2})},[H,M,...b]);const Y=ke(()=>I?.url?URL.parse(I.url)?.hostname:null,[I]),ue=!!I&&!(v===Y);return e(P,{children:[e(At,{title:`${I?.acct?"@"+I.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(zs,{text:V,emojis:q})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",G]})})]}),id:"account-statuses",instance:v,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:U,useItemID:!0,view:m||C?"media":void 0,boostsCarousel:o.settings.boostsCarousel,timelineStart:ne,refresh:[d,r,u,m,l+I?.acct].toString(),headerEnd:e(ct,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ge,{disabled:!ue,onClick:()=>{(async()=>{try{const{masto:ae}=ie({instance:Y}),J=await ae.v1.accounts.lookup({acct:I.acct}),{id:Ie}=J;location.hash=`/${Y}/a/${Ie}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(_,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"/JFxxT",values:{0:Y?e(P,{children:[" ","(",e("b",{children:zn.toUnicode(Y)}),")"]}):null}})})]}),!T&&e(ge,{onClick:()=>{(async()=>{try{const ae=await S.v1.accounts.lookup({acct:I.acct+"@"+v}),{id:J}=ae;location.hash=`/${g}/a/${J}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(_,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"HkuyOu",values:{currentInstance:g},components:{0:e("b",{})}})})]})]})},s),G&&!he&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`@${G} `}})})]})}function tl(n){const{i18n:i}=ce(),{class:o,disabled:s,value:c,min:a,max:p,onInput:l=()=>{}}=n,[d,r]=c?.split("-")||[],u=F(),m=F(),f=(v,y)=>{const[S,g]=a?.split("-")||[],[w,b]=p?.split("-")||[];return!(yw||y===S&&vb)};return e("div",{class:o,children:[e(_,{icon:"month",size:"l"}),e("select",{ref:u,disabled:s,value:r||"",onInput:v=>{const{value:y}=v.currentTarget,S=m.current.value;if(!f(y,S))return{value:"",validity:{valid:!1}};l({value:y?`${S}-${y}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(h,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(v,y)=>e("option",{value:(y+1).toString().padStart(2,"0"),children:new Date(0,y).toLocaleString(i.locale,{month:"long"})},y))]})," ",e("input",{ref:m,type:"number",disabled:s,value:d||new Date().getFullYear(),min:a?.slice(0,4)||Oi,max:p?.slice(0,4)||new Date().getFullYear(),onInput:v=>{const{value:y,validity:S}=v.currentTarget,g=u.current.value;if(!S.valid||!f(g,y))return{value:"",validity:{valid:!1}};l({value:y?`${y}-${g}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function nl(n,i){return i.v1.accounts.$select(n).fetch()}const il=mt(nl,{maxAge:30*60*1e3});function sl(){const n=$t(),{year:i}=n;et(i?`Annual Report: ${i}`:"Annual Report");const{masto:o,instance:s}=ie(),[c,a]=R(null),[p,l]=R("default");W(()=>{i&&(async()=>{l("loading");const v=await o.v1.annualReports.$select(i).fetch();a(v),l("default")})()},[i]);const{accounts:d,annualReports:r,statuses:u}=c||{},m=r?.find(v=>v.year==i)?.data,f=new Date;return e("div",{id:"annual-report-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"report",children:[e("h1",{children:[i," #Wrapstodon"]}),p==="loading"&&e("p",{children:[e(Be,{abrupt:!0})," ",e(h,{id:"Pwqkdw"})]}),!!m&&e("dl",{children:Object.entries(m).map(([v,y])=>e(P,{children:[e("dt",{children:v}),e("dd",{class:`report-${v}`,children:Array.isArray(y)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(y[0]).map(([S,g])=>e("th",{class:S!=="month"&&typeof g=="number"?"number":"",children:S}))})}),e("tbody",{children:y.map(S=>e("tr",{children:Object.entries(S).map(([g,w])=>e("td",{class:g!=="month"&&typeof w=="number"?"number":"",children:w&&/(accountId)/i.test(g)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(v)?e(pt,{account:d?.find(b=>b.id===w),showAvatar:!0}):g==="month"?f.setMonth(w-1)&&f.toLocaleString(void 0,{month:"long"}):typeof w=="number"?w.toLocaleString():w}))}))})]}):typeof y=="object"?/^(topStatuses)$/i.test(v)?e("dl",{children:Object.entries(y).map(([S,g])=>e(P,{children:[e("dt",{children:S}),e("dd",{children:g&&e(pe,{to:`/${s}/s/${g}`,children:e(Ye,{status:u?.find(w=>w.id===g),size:"s",readOnly:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(y).map(([S,g])=>e("tr",{children:[e("th",{children:S}),e("td",{class:typeof g=="number"?"number":"",children:g})]}))})}):typeof y=="string"?y:JSON.stringify(y,null,2)})]}))})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(pe,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}const ol=20;function ro(){const{_:n}=ce();et(n({id:"7Ff7ia"}),"/b");const{masto:i,instance:o}=ie(),s=F();async function c(a){return(a||!s.current)&&(s.current=i.v1.bookmarks.list({limit:ol}).values()),await s.current.next()}return e(At,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:o,fetchItems:c})}const cl=""+new URL("catch-up-O5q5C75Z.png",import.meta.url).href,al="home",rt=[{label:{id:"Ov9hfp"},value:1},{label:{id:"tVE2wM"},value:2},{label:{id:"8+HOWa"},value:3},{label:{id:"1o+mEC"},value:4},{label:{id:"dZZ8oA"},value:5},{label:{id:"lpPucp"},value:6},{label:{id:"r9r5X6"},value:7},{label:{id:"I9uBFA"},value:8},{label:{id:"pBYFlb"},value:9},{label:{id:"wvL7OJ"},value:10},{label:{id:"7Vb+qD"},value:11},{label:{id:"VU1Pnd"},value:12},{label:{id:"vpc27K"},value:13}],rl={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},ll=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],dl=[null,"account"],ul=Es(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function hl(){const{i18n:n,_:i,_:o}=ce(),s=ul(n.locale);et("Catch-up","/catchup");const{masto:c,instance:a}=ie(),[p,l]=gt(),d=p.get("id"),[r,u]=R("start"),[m,f]=R(!1),v=ke(()=>ft(),[]),y=x=>x===v,S=Je("@pixelfed/home-include-reblogs");async function g({maxCreatedAt:x}){const B=[],Z=c.v1.timelines.home.list({limit:40}),te=Z.values();e:for(;;)try{S&&Z.params&&(typeof Z.params=="string"?Z.params+="&include_reblogs=true":Z.params.include_reblogs=!0);const D=await te.next(),{value:le}=D;if(le?.length){await ao(le,a);let ve=!1;for(let me=0;me=x){const Le=!y(z.reblog?.account?.id||z.account.id)&&Gt(z.reblog?.filtered||z.filtered,al);if(Le?.action==="hide")continue;z._filtered=Le;const Ve=ot(z.id,a);z._followedTags=E.statusFollowedTags[Ve]?[...E.statusFollowedTags[Ve]]:[],B.push(z),ve=!0}if(!ve)break e}}else break e;await new Promise(ve=>setTimeout(ve,1e3))}catch{break e}return B.forEach(D=>{if(D?.inReplyToId){const le=B.find(ve=>ve.id===D.inReplyToId);le&&!le.inReplyToId&&(le._thread=!0)}}),B}const[w,b]=R([]),I=F(),k=F(),A=ke(()=>Rn(),[]),C=tt(async({duration:x}={})=>{const B=Date.now(),Z=x?B-x:null;u("loading");const te=await g({maxCreatedAt:Z}),D=`${A}-${dc()}`;try{await ht.catchup.set(D,{id:D,posts:te,count:te.length,startAt:Z,endAt:B}),l({id:D})}catch{}},[]);W(()=>{d?(async()=>{const x=await ht.catchup.get(d);x&&(x.posts.sort((B,Z)=>B.createdAt>Z.createdAt?1:-1),b(x.posts),u("results"))})():r==="results"&&(b([]),u("start"))},[d]);const[T,M]=It(x=>x+1,0),[L,U]=R(null),[H,j]=R([]);W(()=>{(async()=>{try{const x=await ht.catchup.keys();if(x.length){const B=Rn(),Z=x.filter(te=>te.startsWith(`${B}-`));if(Z.length){let te=await ht.catchup.getMany(Z);te.sort((me,z)=>z.endAt-me.endAt);let D=te.slice(0,3),le=te.slice(3);const ve=D.map(me=>{const{id:z,count:fe,startAt:Me,endAt:Le}=me;return{id:z,count:fe,startAt:Me,endAt:Le}});j(ve),U(D[0].endAt),te=null,D=null,queueMicrotask(()=>{le.length&&ht.catchup.delMany(le.map(me=>me.id)).then(()=>{le=null}).catch(me=>{})});return}}}catch{}j([])})()},[T]),W(()=>{r==="start"&&M()},[r==="start"]);const[X,Q]=ke(()=>{let x=0,B=0,Z=0,te=0,D=0,le=0;const ve={};for(const z of w){z._filtered&&z._filtered?.action!=="blur"?(x++,z.__FILTER="filtered"):z.group?(B++,z.__FILTER="groups"):z.reblog?(Z++,z.__FILTER="boosts"):z._followedTags?.length?(D++,z.__FILTER="followedTags"):z.inReplyToId&&z.inReplyToAccountId!==z.account?.id?(te++,z.__FILTER="replies"):(le++,z.__FILTER="original");const fe=z.reblog||z;if(z.__FILTER!=="filtered"&&fe.card?.url&&fe.card?.image&&fe.card?.type==="link"){const{card:Me,favouritesCount:Le,reblogsCount:Ve}=fe;let{url:Xe}=Me;if(Xe=Xe.replace(/\/$/,""),!ve[Xe])ve[Xe]={postID:fe.id,card:Me,shared:1,sharers:[z.account],likes:Le,boosts:Ve};else{if(ve[Xe].sharers.find(Tt=>Tt.id===z.account.id))continue;ve[Xe].shared++,ve[Xe].sharers.push(z.account),ve[Xe].postID!==fe.id&&(ve[Xe].likes+=Le,ve[Xe].boosts+=Ve)}}}let me=[];for(const z in ve)me.push({url:z,...ve[z]});if(me.sort((z,fe)=>z.shared>fe.shared?-1:z.sharedfe.boosts?-1:z.boostsfe.likes?-1:z.likes10)e:for(let z=10;z{const x={},B=new Map;let Z=w.filter(D=>{const le=V==="all"||D.__FILTER===V;return le&&(x[D.account.id]=D.account,B.set(D.account.id,(B.get(D.account.id)||0)+1)),le});const te={};return Z.forEach(D=>{D.reblog&&(te[D.reblog.id]?(te[D.reblog.id].__BOOSTERS?te[D.reblog.id].__BOOSTERS.add(D.account):te[D.reblog.id].__BOOSTERS=new Set([D.account]),D.__HIDDEN=!0):te[D.reblog.id]=D)}),q&&B.has(q)&&(Z=Z.filter(D=>D.account.id===q||[...D.__BOOSTERS||[]].find(le=>le.id===q))),[Z,x,Object.fromEntries(B)]},[V,q,w]),Ce=ke(()=>{const x={};return ye.forEach(B=>{x[B.id]=B}),x},[ye]),Ae=ke(()=>Object.keys(Pe).sort((x,B)=>Pe[B]-Pe[x]),[Pe]),Te=ke(()=>{const x={};return Ae.forEach((B,Z)=>{x[B]=Z}),ye.filter(B=>!B.__HIDDEN).sort((B,Z)=>{if(J==="account"){const te=B.account.id,D=Z.account.id,le=x[te],ve=x[D],me=le-ve;if(me!==0)return me}if(Y!=="createdAt"&&(B=B.reblog||B,Z=Z.reblog||Z,Y!=="density"&&B[Y]===Z[Y]))return B.createdAt>Z.createdAt?1:-1;if(Y==="density"){const te=us(B),D=us(Z);return ue==="asc"?te>D?1:-1:D>te?1:-1}return ue==="asc"?B[Y]>Z[Y]?1:-1:Z[Y]>B[Y]?1:-1})},[ye,Y,ue,J,Ae]),De=F(null),Oe=F(null),Fe=F(!1);W(()=>{w.length>100||Fe.current||Oe.current&&(Gs(Oe.current,{duration:200}),Fe.current=!0)},[w,Oe]);const se=w.length>160?"3d":"2d",Ee=ke(()=>se!=="2d"?null:w.map(x=>{const B=Ce[x.id];return e("span",{class:`post-dot ${B?"post-dot-highlight":""}`},x.id)}),[Ce]),$e=ke(()=>se!=="3d"||!w?.length?null:bl(w,"createdAt",320).map((B,Z)=>e("div",{class:"posts-bin",children:B.map(te=>{const D=Ce[te.id];return e("span",{class:`post-dot ${D?"post-dot-highlight":""}`},te.id)})},Z)),[Ce]),_e=F(null),K=ke(()=>L?(Date.now()-L)/1e3/60/60:null,[L,$]);W(()=>{if(r!=="results")return;const x=q&&be[q]?be[q].username:"",B=ue==="asc"?0:1,Z={account:"authors"};let te=re({duration:5e3,text:o({id:"TLYeLT",values:{selectedFilterCategory:V,sortBy:Y,sortOrder:ue,groupBy:J}})});return()=>{te?.hideToast?.()}},[r,V,q,Y,ue,J,be]),W(()=>{if(q&&be[q]){const x=Oe.current.querySelector(`[data-author="${q}"]`),B=Oe.current?.getBoundingClientRect(),Z=x?.getBoundingClientRect();Z.leftB.right?x.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):Z.top<0&&x.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[q,be]);const[we,Re]=R(!1),Ne=".catchup-list > li > a",O=He("j",()=>{const x=document.activeElement.closest(Ne),B=x?.getBoundingClientRect(),Z=Array.from(_e.current.querySelectorAll(Ne));if(x&&B.top<_e.current.clientHeight&&B.bottom>0){const te=Z.indexOf(x),D=Z[te+1];D&&(D.focus(),D.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const te=Z.find(D=>D.getBoundingClientRect().top>=0);te&&(te.focus(),te.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:x=>x.metaKey||x.ctrlKey||x.altKey||x.shiftKey}),Se=He("k",()=>{const x=document.activeElement.closest(Ne),B=x?.getBoundingClientRect(),Z=Array.from(_e.current.querySelectorAll(Ne));if(x&&B.top<_e.current.clientHeight&&B.bottom>0){const te=Z.indexOf(x);let D=Z[te-1];D&&(D.focus(),D.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const te=Z.find(D=>{const le=D.getBoundingClientRect();return le.top>=44&&le.left>=0});te&&(te.focus(),te.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:x=>x.metaKey||x.ctrlKey||x.altKey||x.shiftKey}),Ue=He("h, l",(x,B)=>{const Z=B.keys[0];if(q){const te=Ae.indexOf(q);Z==="h"?te>0&&te=0&&(he(Ae[te+1]),_e.current?.focus())}else Z==="l"&&(he(Ae[0]),_e.current?.focus())},{useKey:!0,preventDefault:!0,ignoreEventWhen:x=>x.metaKey||x.ctrlKey||x.altKey||x.shiftKey,enableOnFormTags:["input"]}),ze=He("esc",()=>{he(null),_e.current?.focus()},{preventDefault:!0,ignoreEventWhen:x=>x.metaKey||x.ctrlKey||x.altKey||x.shiftKey,enableOnFormTags:["input"],useKey:!0}),N=He(".",()=>{_e.current?.scrollTo({top:0,behavior:"smooth"})},{useKey:!0,preventDefault:!0,ignoreEventWhen:x=>x.metaKey||x.ctrlKey||x.altKey||x.shiftKey,enableOnFormTags:["input"]}),oe=tt(x=>{const B=document.activeElement,Z=B?.tagName==="INPUT"&&B.type==="radio";if((x.key==="ArrowDown"||x.key==="ArrowUp"||x.key==="ArrowLeft"||x.key==="ArrowRight")&&Z){B.blur();return}},[]);return e("div",{ref:x=>{_e.current=x,O.current=x,Se.current=x,Ue.current=x,ze.current=x,N.current=x},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${r==="loading"?"loading":""}`,onClick:x=>{x.target.closest("a, button")||_e.current?.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),r==="results"&&e(pe,{to:"/catchup",class:"button plain",children:e(_,{icon:"history2",size:"l",alt:o({id:"xrl8fj"})})}),r==="start"&&e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l",alt:o({id:"i0qMbr"})})})]}),e("h1",{children:r!=="start"&&e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:r!=="start"&&r!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{Re(!0)},children:e(h,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:oe,children:[r==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(h,{id:"CxKPv6"})}),e("p",{children:e(h,{id:"YMU1CK"})}),e("img",{src:cl,width:"1200",height:"900",alt:o({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:x=>{x.target.closest("details").open=!1},children:e(h,{id:"2jI8hh"})})})]}),e("p",{children:e(h,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(h,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:I,type:"range",value:$,min:rt[0].value,max:rt[rt.length-1].value,step:"1",list:"catchup-ranges",onChange:x=>ne(+x.target.value)})," ",e("span",{style:{width:"8em"},children:[i(rt[$-1].label),e("br",{}),e("small",{class:"insignificant",children:$==rt[rt.length-1].value?o({id:"NMNiaO"}):it(new Date(Date.now()-$*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:rt.map(({label:x,value:B})=>e("option",{value:B,label:i(x)}))})," ",e("button",{type:"button",onClick:()=>{if($K?e("p",{class:"catchup-info",children:[e(_,{icon:"info"})," ",e(h,{id:"AGyV7s"})]}):$===rt[rt.length-1].value&&L?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:k})," ",e(h,{id:"dDJEHI",values:{0:s.format(new Date(L))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"EAjFM0"})})}),!!H?.length&&e("div",{class:"catchup-prev",children:[e("p",{children:e(h,{id:"Yfb9A8"})}),e("ul",{children:H.map(x=>e("li",{children:[e(pe,{to:`/catchup?id=${x.id}`,children:[e(_,{icon:"history2"})," ",e("span",{children:x.startAt?s.formatRange(new Date(x.startAt),new Date(x.endAt)):`… – ${s.format(new Date(x.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(h,{id:"S6XZwv",values:{0:x.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{if(confirm(o({id:"D9CmP2"}))){let Z=re(o({id:"xJUo4P",values:{0:x.id}}));await ht.catchup.del(x.id),Z?.hideToast?.(),re(o({id:"1dyGG/",values:{0:x.id}})),M()}},children:e(_,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},x.id))}),H.length>=3&&e("p",{children:e("small",{children:e(h,{id:"sXmrl4"})})})]})]}),r==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Be,{abrupt:!0}),e("p",{class:"insignificant",children:e(h,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(h,{id:"q9urQO"})})]}),r==="results"&&e(P,{children:[e("div",{class:"catchup-header",children:[w.length>0&&e("p",{children:e("b",{class:"ib",children:s.formatRange(new Date(w[0].createdAt),new Date(w[w.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:V==="all"&&!q&&Y==="createdAt"&&ue==="asc",type:"button",class:"plain4 small",onClick:()=>{G("all"),he(null),ee("createdAt"),Ie(null),ae("asc")},children:e(h,{id:"I9EnzM"})}),Q?.length>0&&e("button",{type:"button",class:"plain small",onClick:()=>f(!m),children:[e(h,{id:"EIZREX"})," ",e(_,{icon:"chevron-down",style:{transform:m?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!m,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:Q.map(x=>{const{card:B,shared:Z,sharers:te,likes:D,boosts:le}=x,{blurhash:ve,title:me,description:z,url:fe,image:Me,imageDescription:Le,language:Ve,width:Xe,height:Tt,publishedAt:xt}=B,Et=Ci(fe);let hn;if(ve){const pn=_i(ve),fn=Di(pn);hn=Pi([.6,fn[1],fn[2]])}return e("a",{href:fe,target:"_blank",rel:"noopener",class:"link-block",style:hn?{"--accent-color":`rgb(${hn.join(",")})`,"--accent-alpha-color":`rgba(${hn.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:Me,alt:Le,width:Xe,height:Tt,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Et})," ",!!xt&&e(P,{children:"· "}),!!xt&&e(P,{children:e(bt,{datetime:xt,format:"micro"})})]}),!!me&&e("h1",{class:"title",lang:Ve,dir:"auto",title:me,children:me})]}),!!z&&e("p",{class:"description",lang:Ve,dir:"auto",title:z,children:z}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(h,{id:"bfSr6z",values:{0:te.map(pn=>{const{avatarStatic:fn,displayName:Eo}=pn;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:Bi=>{Bi.preventDefault(),Bi.stopPropagation();const{id:Ro}=pn;he(Ro),G("all")},children:e(ut,{url:fn,size:"s",alt:Eo})})})}})})]})]})},fe)})})})}),w.length>=5&&(se==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:$e}):e("div",{class:"catchup-posts-viz-bar",children:Ee})),w.length>=2&&e("div",{class:"catchup-filters",children:[e("label",{class:"filter-cat",children:[e("input",{type:"radio",name:"filter-cat",checked:V.toLowerCase()==="all",onChange:()=>{G("all")}}),e(h,{id:"N40H+G"})," ",e("span",{class:"count",children:w.length})]}),Object.entries(rl).map(([x,B])=>!!X[x]&&e("label",{class:"filter-cat",title:(X[x]/w.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:V.toLowerCase()===x.toLowerCase(),onChange:()=>{G(x),x==="boosts"&&(ee("reblogsCount"),ae("desc"),Ie(null))}}),i(B)," ",e("span",{class:"count",children:X[x]})]},i(B)))]}),w.length>=2&&!!Pe&&e("div",{class:"catchup-filters authors-filters",ref:Oe,children:[Ae.map(x=>e("label",{class:"filter-author","data-author":x,children:[e("input",{type:"radio",name:"filter-author",checked:q===x,onChange:()=>{he(x)},onClick:()=>{q===x&&he(null)}}),e(ut,{url:be[x].avatarStatic||be[x].avatar,size:"xxl",alt:`${be[x].displayName} (@${be[x].acct})`})," ",e("span",{class:"count",children:Pe[x]}),e("span",{class:"username",children:be[x].username})]},`${x}-${Pe[x]}`)),Ae.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(h,{id:"HHtYi7",values:{0:Ae.length}})},"authors-count")]}),w.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(h,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:ll.map(x=>e("label",{class:"filter-sort",onClick:B=>{Y===x&&(B.preventDefault(),B.stopPropagation(),ae(ue==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:Y===x,onChange:()=>{ee(x);const B=/(replies|favourites|reblogs)/.test(x)?"desc":"asc";ae(B)}}),{createdAt:o({id:"mYGY3B"}),repliesCount:o({id:"N8UzTV"}),favouritesCount:o({id:"zZOZj7"}),reblogsCount:o({id:"puY2t0"}),density:o({id:"0tQ7AD"})}[x],Y===x&&(ue==="asc"?" ↑":" ↓")]},x))}),e("span",{class:"filter-label",children:e(h,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:dl.map(x=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:J===x,onChange:()=>{Ie(x)},disabled:x==="account"&&q}),{account:o({id:"dpqPBg"})}[x]||o({id:"EdQY6l"})]},x||"none"))}),q&&Ae.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{he(null)},style:{whiteSpace:"nowrap"},children:e(h,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${V||""} ${Y?`catchup-sort-${Y}`:""} ${q&&be[q]?"catchup-selected-author":""} ${J?`catchup-group-${J}`:""}`,children:Te.map((x,B)=>{const Z=x.reblog?.id||x.id;let te=!1;return J==="account"&&(De.current&&x.account.id!==De.current&&B>0&&(te=!0),De.current=x.account.id),e(P,{children:[te&&e("li",{class:"separator"}),e(fl,{to:`/${a}/s/${Z}`,post:x,root:_e.current})]},`${x.id}-${te}`)})}),e("footer",{children:ye.length>5&&e("p",{children:[o(V==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{_e.current.scrollTop=0},children:e(h,{id:"0MgdN+"})}),"."]})})]})]})]}),we&&e(Ke,{onClose:()=>Re(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>Re(!1),children:e(_,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(h,{id:"EIZREX"})}),e("dd",{children:e(h,{id:"YmGrIy"})}),e("dt",{children:e(h,{id:"coaNtr"})}),e("dd",{children:e(h,{id:"UUrqX1"})}),e("dt",{children:e(h,{id:"ScQBC/"})}),e("dd",{children:e(h,{id:"srocAr"})}),e("dt",{children:e(h,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(h,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const pl=at(function({post:n}){const{id:i,account:o,group:s,reblog:c,inReplyToId:a,inReplyToAccountId:p,_followedTags:l,_filtered:d,visibility:r,__BOOSTERS:u}=n,m=a&&p!==o.id,f=!!d&&d?.action!=="blur",v=y=>{y.shiftKey};return e("article",{class:`post-line ${s?"group":c?"reblog":l?.length?"followed-tags":""} ${m?"reply-to":""} ${f?"filtered":""} visibility-${r}`,onMouseEnter:v,children:[e("span",{class:"post-author",children:c?e("span",{class:"post-reblog-avatar",children:[e(ut,{url:o.avatarStatic||o.avatar,squircle:o.bot}),u?.size>0?[...u].map(y=>e(ut,{url:y.avatarStatic||y.avatar,squircle:y.bot})):""," ",e(_,{icon:"rocket"})," ",e(pt,{account:c.account,showAvatar:!0})]}):e(pt,{account:o,showAvatar:!0})}),e(vl,{post:c||n,filterInfo:d}),e("span",{class:"post-meta",children:[e(yl,{post:c||n})," ",e(bt,{datetime:new Date(c?.createdAt||n.createdAt),format:"micro"})]})]})},(n,i)=>n?.post?.id===i?.post?.id),fl=({root:n,to:i,...o})=>{const s=F(),[c,a]=R(!1);return W(()=>{const p=new IntersectionObserver(l=>{l[0].isIntersecting&&(queueMicrotask(()=>a(!0)),p.unobserve(s.current))},{root:n,rootMargin:`${Math.max(320,screen.height*.75)}px`});return s.current&&p.observe(s.current),()=>{s.current&&p.unobserve(s.current)}},[]),c?e("li",{children:e(pe,{to:i,children:e(pl,{...o})})}):e("li",{ref:s,style:{height:"4em"}})},ml=8,gl=8;function us(n){const{spoilerText:i,content:o,poll:s,mediaAttachments:c,card:a}=n,p=s?.options?.length?s.options.reduce((d,r)=>d+r.title,""):"";return(i.length+Fs(o)+p.length)/140+(c?.length?ml*c.length:a?.image?gl:0)}const Rt=48;function vl({post:n,filterInfo:i}){const{_:o}=ce(),{spoilerText:s,sensitive:c,content:a,emojis:p,poll:l,mediaAttachments:d,card:r,inReplyToId:u,inReplyToAccountId:m,account:f,_thread:v}=n,y=u&&m===f.id||!!v,g=!!gi()["reading:expand:spoilers"],w=g||!s&&!c&&i?.action!=="blur",b=a?On(n):"",I=!s||g;return e("div",{class:"post-peek",title:s?"":b,children:[e("span",{class:"post-peek-content",children:[y&&!I&&e(P,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i&&i?.action!=="blur"?e("span",{class:"post-peek-filtered",children:i?.titlesStr?o({id:"suKjh3",values:{0:i.titlesStr}}):o({id:"03Qqf9"})}):e(P,{children:[!!s&&e("span",{class:"post-peek-spoiler",children:[e(_,{icon:`${g?"eye-open":"eye-close"}`})," ",s]}),I&&e("div",{class:"post-peek-html",children:[y&&e(P,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(h,{id:"e66y2Z"})})," "]}),!!a&&e("div",{dangerouslySetInnerHTML:{__html:uc(a,p)}}),!!l?.options?.length&&l.options.map(k=>e("div",{children:[l.multiple?"▪️":"•"," ",k.title]})),!a&&d?.length===1&&d[0].description&&e(P,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:d[0].description})]})]})]})]}),(!i||i?.action==="blur")&&e("span",{class:"post-peek-post-content",children:[!!l&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(_,{icon:"poll",size:"s"}),e(h,{id:"4WUbF1"})]}),d?.length?d.map(k=>{const A=k.previewUrl||k.url,C=k.previewRemoteUrl||k.remoteUrl,T=k.meta?.original?k.meta.original.width:k.meta?.small?.width||k.meta?.original?.width,M=k.meta?.original?k.meta.original.height:k.meta?.small?.height||k.meta?.original?.height;return e("span",{class:"post-peek-media",children:{image:(A||C)&&w?e("img",{src:A,width:Rt,height:Rt,alt:k.description,loading:"lazy",onError:L=>{const{src:U}=L.target;U===A&&(L.target.src=C)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(T,M)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(A||C)&&w?e("img",{src:A,width:Rt,height:Rt,alt:k.description,loading:"lazy",onError:L=>{const{src:U}=L.target;U===A&&(L.target.src=C)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(A||C)&&w?e("img",{src:A,width:Rt,height:Rt,alt:k.description,loading:"lazy",onError:L=>{const{src:U}=L.target;U===A&&(L.target.src=C)}}):e("span",{class:"post-peek-faux-media",children:"📹"}),audio:e("span",{class:"post-peek-faux-media",children:"🎵"})}[k.type]||null},k.id)}):!!r&&r.image&&w&&e("span",{class:`post-peek-media post-peek-card card-${r.type||""}`,children:r.image?e("img",{src:r.image,width:Rt,height:Rt,alt:r.title||r.description||r.imageDescription,loading:"lazy",style:{"--anim-duration":r.width&&r.height&&`${Math.min(Math.max(Math.max(r.width,r.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function yl({post:n}){const{_:i}=ce(),{reblogsCount:o,repliesCount:s,favouritesCount:c}=n;return e("span",{class:"post-stats",children:[s>0&&e("span",{class:"post-stat-replies",children:[e(_,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Ze(s)]}),c>0&&e("span",{class:"post-stat-likes",children:[e(_,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Ze(c)]}),o>0&&e("span",{class:"post-stat-boosts",children:[e(_,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",Ze(o)]})]})}function bl(n,i,o){const s=n.map(d=>new Date(d[i])),c=s.reduce((d,r)=>rr>d?r:d,s[0]),p=Math.min(a.getTime(),Date.now())-c.getTime(),l=Array.from({length:o},()=>[]);return n.forEach(d=>{const r=Date.parse(d[i]);if(r>Date.now())l[l.length-1].push(d);else{const u=(r-c.getTime())/p,m=Math.floor(u*(o-1));l[m].push(d)}}),l}const wl=20;function lo(){const{_:n}=ce();et(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:o}=ie(),s=F();async function c(a){return(a||!s.current)&&(s.current=i.v1.favourites.list({limit:wl}).values()),await s.current.next()}return e(At,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:o,fetchItems:c})}const kl=["home","public","notifications","thread","account"],hs=["thread","account"],Sl={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},Cl=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],ii={0:{id:"qqeAJM"},1800:nt(30,"minute"),3600:nt(1,"hour"),21600:nt(6,"hour"),43200:nt(12,"hour"),86400:nt(24,"hour"),604800:nt(7,"day"),2592e3:nt(30,"day")};function _l(){const{_:n}=ce(),{masto:i}=ie();et(n({id:"cSev+j"}),"/ft");const[o,s]=R("default"),[c,a]=R(!1),[p,l]=It(u=>u+1,0),[d,r]=R([]);return W(()=>{s("loading"),(async()=>{try{const u=await i.v2.filters.list();u.sort((m,f)=>m.title.localeCompare(f.title)),u.forEach(m=>{m.keywords?.length&&m.keywords.sort((f,v)=>f.id-v.id)}),r(u),s("default")}catch{s("error")}})()},[p]),e("div",{id:"filters-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{a(!0)},children:e(_,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:d.length>0?e(P,{children:[e("ul",{class:"filters-list",children:d.map(u=>{const{id:m,title:f,expiresAt:v,keywords:y}=u;return e("li",{children:[e("div",{children:[e("h2",{children:f}),y?.length>0&&e("div",{children:y.map(S=>e(P,{children:[e("span",{class:"tag collapsed insignificant",children:S.wholeWord?`“${S.keyword}”`:S.keyword})," "]}))}),e("small",{class:"insignificant",children:e(uo,{expiresAt:v})})]}),e("button",{type:"button",class:"plain",onClick:()=>{a({filter:u})},children:e(_,{icon:"pencil",size:"l",alt:"Edit filter"})})]},m)})}),d.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"5vzJxv",values:{0:d.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):o==="error"?e("p",{class:"ui-state",children:e(h,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(h,{id:"cWIHTt"})})})]}),!!c&&e(Ke,{title:n({id:"vCSBPD"}),onClose:()=>{a(!1)},children:e(Tl,{filter:c?.filter,onClose:u=>{u.state==="success"&&l(),a(!1)}})})]})}let Il=1;const Al=()=>Il++;function Tl({filter:n,onClose:i}){const{_:o,_:s}=ce(),{masto:c}=ie(),[a,p]=R("default"),l=!!n,{context:d,expiresAt:r,id:u,keywords:m,title:f,filterAction:v}=n||{},y=!!r,S=y&&new Date(r),[g,w]=R(m||[]),b=F(),[I,k]=R([]),[A,C]=R([]),T=g.filter(M=>!I.includes(M.id)&&!A.includes(M._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(_,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:s(l?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:M=>{M.preventDefault();const L=new FormData(M.target),U=L.get("title"),H=L.getAll("keyword_attributes[][id]"),j=L.getAll("keyword_attributes[][keyword]"),X=[...b.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(he=>he.checked),Q=j.map((he,$)=>({id:H[$]||void 0,keyword:he,wholeWord:X[$]}));l&&I?.length&&I.forEach(he=>{Q.push({id:he,_destroy:!0})});const V=L.getAll("context");let G=L.get("expires_in");const q=L.get("filter_action");!U||!V?.length||(p("loading"),(async()=>{try{let he;l?(G===""||G===null?y?G=Math.floor((S-Date.now())/1e3):G=null:G==="0"||G===0?G=null:G=+G,he=await c.v2.filters.$select(u).update({title:U,context:V,expiresIn:G,keywordsAttributes:Q,filterAction:q})):(G=+G||null,he=await c.v2.filters.create({title:U,context:V,expiresIn:G,keywordsAttributes:Q,filterAction:q})),p("default"),i?.({state:"success",filter:he})}catch{p("error"),alert(s(l?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(h,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:f,disabled:a==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:b,children:[T.length?e("ul",{class:"filter-keywords",children:T.map(M=>{const{id:L,keyword:U,wholeWord:H,_id:j}=M;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:L}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:U,disabled:a==="loading",required:!0,dir:"auto"}),e("div",{class:"filter-keyword-actions",children:[e("label",{children:[e("input",{name:"keyword_attributes[][whole_word]",type:"checkbox",value:L,defaultChecked:H,disabled:a==="loading"})," ",e(h,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:a==="loading",onClick:()=>{L?(I.push(L),k([...I])):j&&(A.push(j),C([...A]))},children:e(_,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},`${L}-${j}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(h,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{w([...g,{_id:Al(),keyword:"",wholeWord:!0}]),setTimeout(()=>{const M=b.current.querySelectorAll('input[type="text"]');M[M.length-1]?.focus?.()},10)},children:e(h,{id:"qn5Dbn"})})," ",T?.length>1&&e("small",{class:"insignificant",children:e(h,{id:"1JZ175",values:{0:T.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(h,{id:"uqf7Yq"})})}),kl.map(M=>e("div",{children:[e("label",{class:hs.includes(M)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:M,defaultChecked:d?d.includes(M):!0,disabled:a==="loading"})," ",o(Sl[M]),hs.includes(M)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(h,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[l&&e(h,{id:"ucJk3m",components:{0:e("b",{}),1:e(uo,{expiresAt:r,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:s(l?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:a==="loading",defaultValue:l?void 0:0,children:[l&&e("option",{}),Cl.map(M=>e("option",{value:M,children:typeof ii[M]=="function"?ii[M]():o(ii[M])}))]})]}),e("p",{children:[e(h,{id:"blQMpa"}),e("br",{}),vi()?.mastodon>=5&&e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"blur",defaultChecked:v==="blur",disabled:a==="loading"})," ",e(h,{id:"ggxOw9"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:v!=="hide"&&v!=="blur"||!l,disabled:a==="loading"})," ",e(h,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:v==="hide",disabled:a==="loading"})," ",e(h,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:a==="loading",children:s(l?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(Be,{abrupt:!0,hidden:a!=="loading"})]}),l&&e(dt,{disabled:a==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"BPjyR2"}),onClick:()=>{p("loading"),(async()=>{try{await c.v2.filters.$select(u).remove(),p("default"),i?.({state:"success"})}catch{p("error"),alert(s({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:a==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}function uo({expiresAt:n,showNeverExpires:i}){const{_:o}=ce(),s=!!n,c=s&&new Date(n),a=s&&Date.parse(n)<=Date.now(),[p,l]=It(d=>d+1,0);return ki(l,a||3e4),a?o({id:"M1RnFv"}):s?e(h,{id:"urGtsw",components:{0:e(bt,{datetime:c})}}):i&&o({id:"O1Aswy"})}function xl(){const{_:n}=ce(),{masto:i,instance:o}=ie();et(n({id:"Xi1/bw"}),"/fh");const[s,c]=R("default"),[a,p]=R([]);return W(()=>{c("loading"),(async()=>{try{const l=await Pn();p(l),c("default")}catch{c("error")}})()},[]),e("div",{id:"followed-hashtags-page",class:"deck-container",tabIndex:"-1",children:e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:a.length>0?e(P,{children:[e("ul",{class:"link-list",children:a.map(l=>e("li",{children:e(pe,{to:o?`/${o}/t/${l.name}`:`/t/${l.name}`,children:[e(_,{icon:"hashtag",alt:"#"})," ",e("span",{children:l.name})]})}))}),a.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"2S/uvJ",values:{0:a.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(h,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(h,{id:"vKsGhk"})})})]})})}const El=20;function zi({title:n,path:i,id:o,...s}){const{_:c}=ce();et(n||c({id:"following.title"}),i||"/following");const{masto:a,streaming:p,instance:l}=ie(),d=Ge(E),r=F(),u=F(),m=F();__BENCHMARK.end("time-to-following");const f=Je("@pixelfed/home-include-reblogs");async function v(S){(S||!u.current)&&(__BENCHMARK.start("fetch-home-first"),r.current=a.v1.timelines.home.list({limit:El}),u.current=r.current.values()),f&&r.current?.params&&(typeof r.current.params=="string"?r.current.params+="&include_reblogs=true":r.current.params.include_reblogs=!0);const g=await u.current.next();let{value:w}=g;if(w?.length){let b=!1;S&&(w[0].id!==m.current&&(b=!0),m.current=w[0].id),w.forEach(I=>{Qe(I,l)}),w=rs(w,l),S&&b&&Ur(),ao(w,l),w.sort((I,k)=>Date.parse(k.createdAt)-Date.parse(I.createdAt))}return __BENCHMARK.end("fetch-home-first"),{...g,value:w}}async function y(){try{const S={limit:5,since_id:m.current};Je("@pixelfed/home-include-reblogs")&&(S.include_reblogs=!0);const g=await a.v1.timelines.home.list(S).values().next();let{value:w}=g;const b=w[0]?.id===m.current;return!!(w?.length&&!b&&(m.current=w[0].id,w=rs(w,l),w=Bt(w,"home"),w.some(I=>!I.reblog)))}catch{return!1}}return W(()=>{let S;return(async()=>{if(p){S=p.user.subscribe();for await(const g of S){if(!S)break;if(g.event==="status.update"){const w=g.payload;Qe(w,l)}else if(g.event==="delete"){const w=g.payload,b=Rs(w,l);b&&(b._deleted=!0)}}}})(),()=>{S?.unsubscribe?.(),S=null}},[p]),e(At,{title:n||c({id:"following.title"}),id:o||"following",emptyText:c({id:"nJEKbY"}),errorText:c({id:"7QSeK6"}),instance:l,fetchItems:v,checkForUpdates:y,useItemID:!0,boostsCarousel:d.settings.boostsCarousel,...s,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const Rl=20,Ll=4,ps=Ll+1;function ho({media:n,columnMode:i,...o}){const{_:s}=ce();let{hashtag:c,...a}=i?{}:$t();o.hashtag&&(c=o.hashtag);let p=c.trim().split(/[\s+]+/);p.sort(),c=p[0];const[l,d]=gt(),r=n||!!l.get("media"),u=r?"?media=1":"",{masto:m,instance:f,authenticated:v}=ie({instance:o?.instance||a.instance}),{masto:y,instance:S,authenticated:g}=ie(),w=p.map($=>`#${$}`).join(" "),b=s(f?r?{id:"kH0rA0",values:{hashtagTitle:w,instance:f}}:{id:"IK0zKi",values:{hashtagTitle:w,instance:f}}:r?{id:"hHSI3w",values:{hashtagTitle:w}}:{id:"+ZzjRY",values:{hashtagTitle:w}});et(b,"/:instance?/t/:hashtag");const I=F(),k=ke(()=>bi(),[]),A=F(void 0);async function C($){const ne=await m.v1.timelines.tag.$select(c).list({limit:Rl,any:p.slice(1),maxId:$?void 0:A.current,onlyMedia:r?!0:void 0}).values().next();let{value:Y}=ne;return Y?.length&&($&&(I.current=Y[0].id),Y.forEach(ee=>{Qe(ee,f,{skipThreading:r||k})}),A.current=Y[Y.length-1].id),{...ne,value:Y}}async function T(){try{const $=await m.v1.timelines.tag.$select(c).list({limit:1,any:p.slice(1),since_id:I.current,onlyMedia:r}).values().next();let{value:ne}=$;const Y=ne[0]?.id===I.current;return ne?.length&&!Y?(ne=Bt(ne,"public"),!0):!1}catch{return!1}}const[M,L]=R("default"),[U,H]=R();W(()=>{(async()=>{try{const $=await m.v1.tags.$select(c).fetch();H($)}catch{}})()},[c]);const j=p.length>=ps,[X,Q]=R("default"),[V,G]=R([]),[q,he]=R(!1);return W(()=>{v&&(async()=>{try{const $=await m.v1.featuredTags.list();G($),he($.some(ne=>ne.name.toLowerCase()===c.toLowerCase()))}catch{}})()},[]),e(P,{children:[e(At,{title:b,titleComponent:!!f&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:w}),e("div",{children:f})]}),id:"hashtag",instance:f,emptyText:s({id:"CNSLAW"}),errorText:s({id:"yjj6Ll"}),fetchItems:C,checkForUpdates:T,useItemID:!0,view:r||k?"media":void 0,refresh:r,filterContext:"public",headerEnd:e(ct,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[!!U&&p.length===1&&e(P,{children:[e(dt,{subMenu:!0,confirm:U.following,confirmLabel:s({id:"ctJi7k",values:{hashtag:c}}),disabled:M==="loading"||!v,onClick:()=>{L("loading"),U.following?m.v1.tags.$select(c).unfollow().then(()=>{H({...U,following:!1}),re(s({id:"doK/ij",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{L("default")}):m.v1.tags.$select(c).follow().then(()=>{H({...U,following:!0}),re(s({id:"R9+aEN",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{L("default")})},children:U.following?e(P,{children:[e(_,{icon:"check-circle"})," ",e("span",{children:e(h,{id:"HOSk7R"})})]}):e(P,{children:[e(_,{icon:"plus"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]})}),e(ge,{type:"checkbox",checked:q,disabled:X==="loading"||!v,onClick:()=>{if(Q("loading"),q){const $=V.find(ne=>ne.name.toLowerCase()===c.toLowerCase()).id;$?m.v1.featuredTags.$select($).remove().then(()=>{he(!1),re(s({id:"VH+Tf9"})),G(V.filter(ne=>ne.id!==$))}).catch(ne=>{}).finally(()=>{Q("default")}):re(s({id:"3OLv47"}))}else m.v1.featuredTags.create({name:c}).then($=>{he(!0),re(s({id:"9ra4hn"})),G(V.concat($))}).catch($=>{}).finally(()=>{Q("default")})},children:q?e(P,{children:[e(_,{icon:"check-circle"}),e("span",{children:e(h,{id:"9ra4hn"})})]}):e(P,{children:[e(_,{icon:"check-circle"}),e("span",{children:e(h,{id:"UlJ3QN"})})]})}),e(je,{})]}),!k&&e(P,{children:[e(Ii,{className:"plain",children:e(h,{id:"cSev+j"})}),e(ge,{type:"checkbox",checked:!!r,onClick:()=>{r?l.delete("media"):l.set("media","1"),d(l)},children:[e(_,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(h,{id:"eK4SL/"})})]}),e(je,{})]}),e(hc,{className:"menu-field",disabled:j,children:({ref:$})=>e("form",{onSubmit:ne=>{ne.preventDefault();const Y=ne.target[0].value?.trim?.();Y&&!p.some(ee=>ee.toLowerCase()===Y.toLowerCase())&&(p.push(Y),p.sort(),location.hash=f?`/${f}/t/${p.join("+")}${u}`:`/t/${p.join("+")}${u}`)},children:[e(_,{icon:"hashtag"}),e("input",{ref:$,type:"text",placeholder:j?de._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:ps}}):s({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:j,dir:"auto"})]})}),e(pc,{takeOverflow:!0,children:p.map(($,ne)=>e(ge,{disabled:p.length===1,onClick:Y=>{p.splice(ne,1),p.sort(),location.hash=f?`/${f}/t/${p.join("+")}${u}`:`/t/${p.join("+")}${u}`},children:[e(_,{icon:"x",alt:s({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),$]})]},$))}),e(je,{}),e(ge,{disabled:!g,onClick:()=>{if(E.shortcuts.length>=St){alert(de._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:St}}));return}const $={type:"hashtag",hashtag:p.join(" "),instance:f,media:r?"on":void 0};E.shortcuts.some(Y=>Y.type===$.type&&Y.hashtag.split(/[\s+]+/).sort().join(" ")===$.hashtag.split(/[\s+]+/).sort().join(" ")&&(Y.instance?Y.instance===$.instance:!0)&&(Y.media?!!Y.media==!!$.media:!0))?alert(s({id:"kfeQnS"})):(E.shortcuts.push($),re(s({id:"MIhb91"})))},children:[e(_,{icon:"shortcut"})," ",e("span",{children:e(h,{id:"i02Lq/"})})]}),e(ge,{onClick:()=>{let $=prompt(s({id:"2MQ2cd"}));if(!/\./.test($)){$&&alert(s({id:"7WddtO"}));return}$&&($=$.toLowerCase().trim(),location.hash=`/${$}/t/${p.join("+")}${u}`)},children:[e(_,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),S!==f&&e(ge,{onClick:()=>{location.hash=`/${S}/t/${p.join("+")}${u}`},children:[e(_,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:S},components:{0:e("b",{})}})})]})]})},f+w),!i&&!!p?.length&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`${p.length>1?` `:" "}${w}`}})})]})}const Ml=20;function po(n){const{_:i}=ce(),o=Ge(E),{masto:s,instance:c}=ie(),a=n?.id||$t()?.id,p=F(),l=F();async function d(b){(b||!l.current)&&(l.current=s.v1.timelines.list.$select(a).list({limit:Ml}).values());const I=await l.current.next();let{value:k}=I;return k?.length&&(b&&(p.current=k[0].id),k.forEach(A=>{Qe(A,c)})),{...I,value:k}}async function r(){try{const b=await s.v1.timelines.list.$select(a).list({limit:1,since_id:p.current});let{value:I}=b;const k=I[0]?.id===p.current;return I?.length&&!k?(I=Bt(I,"home"),!0):!1}catch{return!1}}const[u,m]=R([]),[f,v]=R({title:"List"});et(f.title,"/l/:id"),W(()=>{(async()=>{try{const b=await Qs(a);v(b)}catch{}})()},[a]);const[y,S]=R(!1),[g,w]=R(!1);return e(P,{children:[e(At,{title:f.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:c,fetchItems:d,checkForUpdates:r,useItemID:!0,boostsCarousel:o.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(ct,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(_,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(_,{icon:"chevron-down",size:"s"})]}),onMenuChange:b=>{b.open&&un().then(m)},children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),u?.length>0&&e(P,{children:[e(je,{}),u.map(b=>e(qe,{to:`/l/${b.id}`,children:e("span",{children:[b.title,b.exclusive&&e(P,{children:[" ",e(Ut,{})]})]})},b.id))]})]}),headerEnd:e(ct,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[f?.exclusive&&e(P,{children:[e(Ii,{className:"plain",children:[e(Ut,{})," ",e(h,{id:"FNptcJ"})]}),e(je,{})]}),e(ge,{onClick:()=>S({list:f}),children:[e(_,{icon:"pencil",size:"l"}),e("span",{children:e(h,{id:"ePK91l"})})]}),e(ge,{onClick:()=>w(!0),children:[e(_,{icon:"group",size:"l"}),e("span",{children:e(h,{id:"hB02vO"})})]})]})},a),y&&e(Ke,{onClick:b=>{b.target===b.currentTarget&&S(!1)},children:e(Ni,{list:y?.list,onClose:b=>{b.state==="success"&&b.list?v(b.list):b.state==="deleted"&&(location.hash="/l"),S(!1)}})}),g&&e(Ke,{onClick:b=>{b.target===b.currentTarget&&w(!1)},children:e(Nl,{listID:a,onClose:()=>w(!1)})})]})}const $l=40;function Nl({listID:n,onClose:i}){const{_:o}=ce(),{masto:s,instance:c}=ie(),[a,p]=R([]),[l,d]=R("default"),[r,u]=R(!1),m=F();async function f(v){u(!1),d("loading"),(async()=>{try{(v||!m.current)&&(m.current=s.v1.lists.$select(n).accounts.list({limit:$l}).values());const y=await m.current.next();let{done:S,value:g}=y;g?.length?(p(v?g:a.concat(g)),u(!S)):u(!1),d("default")}catch{d("error")}})()}return W(()=>{f(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(_,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[a.map(v=>e("li",{children:[e(lt,{account:v,instance:c}),e(Pl,{account:v,listID:n})]},v.id)),r&&l==="default"&&e(Ct,{as:"li",onChange:v=>v&&f(),children:e("button",{type:"button",class:"light block",onClick:f,children:e(h,{id:"uXRAkV"})})})]})})]})}function Pl({account:n,listID:i}){const{_:o}=ce(),{masto:s}=ie(),[c,a]=R("default"),[p,l]=R(!1);return e(dt,{confirm:!p,confirmLabel:e("span",{children:e(h,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{p?(a("loading"),(async()=>{try{await s.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),a("default"),l(!1)}catch{a("error")}})()):(a("loading"),(async()=>{try{await s.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),a("default"),l(!0)}catch{a("error")}})())},children:e("button",{type:"button",class:`light ${p?"":"danger"}`,disabled:c==="loading",children:o(p?{id:"m16xKo"}:{id:"MWIaew"})})})}const Dl={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Ol=["favourite","reblog","follow"],fo=n=>Ol.includes(n);function mo(n){return n.filter(i=>{const{type:o,id:s,createdAt:c}=i;if(!o)return!1;const a=Dl[o];return a?.length?a.every(p=>!!i[p]):!0})}function go(n){if(n?.notificationGroups){const{accounts:i=[],notificationGroups:o=[],statuses:s=[]}=n;return o.map(c=>{const{sampleAccountIds:a,statusId:p}=c,l=a?.map(r=>i.find(u=>u.id===r))||[],d=s?.find(r=>r.id===p)||null;return{...c,sampleAccounts:l,status:d}})}return n}function zl(n){const i=n.map(p=>{const{latestPageNotificationAt:l,mostRecentNotificationId:d,sampleAccounts:r,notificationsCount:u}=p;return{id:""+d,createdAt:l,account:r[0],...p}}),o={},s=[];for(let p=0;p0&&f?.length>0&&m>f?.length)&&(d==="favourite"||d==="reblog")&&(S="favourite+reblog");const w=`${r?.id}-${S}-${y}`,b=o[w];if(!fo(d))s.push(l);else if(b)f.forEach(I=>{const k=b.sampleAccounts.find(A=>A.id===I.id);k?(k._types.push(d),k._types.sort().reverse()):b.sampleAccounts.push({...I,_types:[d]})}),b.notificationsCount=Math.min(b.notificationsCount,m),b._notificationsCount.push(m),b._sampleAccountsCount.push(f?.length),b._accounts=b.sampleAccounts,b._groupKeys.push(v);else{const I=f.map(k=>({...k,_types:[d]}));o[w]={...l,sampleAccounts:I,type:S,_accounts:I,_groupKeys:v?[v]:[],_notificationsCount:[m],_sampleAccountsCount:[f?.length]},s.push(o[w])}}const c={},a=[];for(let p=0;pb.id===u.id);w?(w._types.push(m),w._types.sort().reverse(),g._ids+=`-${d}`):(u._types=[m],g._accounts.push(u),g._ids+=`-${d}`)}else{u&&(u._types=[m]);let w=i[S]={...l,type:y,_ids:d,_accounts:u?[u]:[]};o[p++]=w}}const s={},c=[];for(let a=0,p=0;a{Qe(A,c)})),{...I,value:k?.map(A=>A.status)}}const f=F(),v=F();async function y(b){(b||!f.current)&&(f.current=s.v1.conversations.list({limit:fs}).values());const I=await f.current.next();let{value:k}=I;return k=k?.filter(A=>A.lastStatus),k?.length&&(b&&(v.current=k[0].lastStatus.id),k.forEach(({lastStatus:A})=>{Qe(A,c)})),{...I,value:k?.map(A=>A.lastStatus)}}function S(...b){return d==="private"?y(...b):m(...b)}async function g(){if(d==="private")try{const b=await s.v1.conversations.list({limit:1,since_id:v.current}).values().next();let{value:I}=b;const k=I[0]?.id===v.current;return I?.length&&!k?(v.current=I[0].lastStatus.id,!0):!1}catch{return!1}else try{const b=await s.v1.notifications.list({limit:1,types:["mention"],since_id:u.current}).values().next();let{value:I}=b;return I?.length?(u.current=I[0].id,!0):!1}catch{return!1}}const w=ke(()=>e("div",{class:"filter-bar centered",children:[e(pe,{to:"/mentions",class:d?"":"is-active",onClick:b=>{n&&(b.preventDefault(),l(null))},children:e(h,{id:"N40H+G"})}),e(pe,{to:"/mentions?type=private",class:d==="private"?"is-active":"",onClick:b=>{n&&(b.preventDefault(),l("private"))},children:e(h,{id:"zwBp5t"})})]}),[d]);return e(At,{title:o({id:"/bZzdR"}),id:"mentions",emptyText:o({id:"03jFGT"}),errorText:o({id:"pqR9KF"}),instance:c,fetchItems:S,checkForUpdates:g,useItemID:!0,timelineStart:w,refresh:d,filterContext:"notifications"})}const Ul=80,Kl=20,Hl=new URLSearchParams,gn={block:"center",inline:"center",behavior:"smooth"},yo=Es(()=>vi()?.mastodon>=2,{maxAge:1e3*60*5});function bo(n={}){const{masto:i}=ie();return E.settings.groupedNotificationsAlpha&&yo()?i.v2.notifications.list({limit:Kl,...n}):i.v1.notifications.list({limit:Ul,...n})}function wo(n={}){return bo(n).values()}function ko(n){return E.settings.groupedNotificationsAlpha&&yo()?zl(n):Bl(n)}const ql=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],jl={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function Yl({columnMode:n}){const{_:i,_:o}=ce();et(o({id:"iDNBZe"}),"/notifications");const{masto:s,instance:c}=ie(),a=Ge(E),[p,l]=R("default"),[d]=n?[Hl]:gt(),r=d.get("id"),u=d.get("access_token"),[m,f]=R(!1),[v,y]=R(!1),S=F(),{nearReachEnd:g,scrollDirection:w,reachStart:b,nearReachStart:I}=Kr({scrollableRef:S}),k=w==="end"&&!I,[A,C]=R([]),[T,M]=R([]),L=F(),U=F();async function H(O){if((O||!U.current)&&(L.current=bo({excludeTypes:["follow_request"]}),U.current=L.current.values()),/max_id=($|&)/i.test(U.current?.nextParams))return{done:!0};const Se=await U.current.next(),Ue=go(Se.value);if(Ue?.length){Ue.forEach(N=>{Qe(N.status,c,{skipThreading:!0})});const ze=ko(Ue);O?(E.notificationsLast=ze[0],E.notifications=ze,s.v1.markers.create({notifications:{lastReadId:ze[0].id}}).catch(()=>{})):E.notifications.push(...ze)}return E.notificationsShowNew=!1,E.notificationsLastFetchTime=Date.now(),Se}async function j(){try{return await s.v1.followRequests.list({limit:80})}catch{return[]}}const X=()=>{l("loading"),(async()=>{try{const O=await j();C(O),l("default")}catch{l("error")}})()};async function Q(){try{return await s.v1.announcements.list()}catch{return[]}}const V=Je("@mastodon/filtered-notifications"),[G,q]=R(!1),[he,$]=R({});function ne(){return s.v2.notifications.policy.fetch().catch(()=>{})}function Y(){ne().then(O=>{$(O)}).catch(()=>{})}const[ee,ue]=R(null);function ae(){return s.v1.notifications.requests.list()}const J=O=>{ye(!1),l("loading"),(async()=>{try{const Se=H(O);O&&(Q().then(ze=>{ze.sort((N,oe)=>Date.parse(oe.updatedAt||oe.createdAt)-Date.parse(N.updatedAt||N.createdAt)),M(ze)}).catch(()=>{}),j().then(ze=>{C(ze)}).catch(()=>{}),V&&Y());const{done:Ue}=await Se;f(!Ue),l("default")}catch{l("error")}})()};W(()=>{J(!0)},[]),W(()=>{b&&J(!0)},[b]);const[Ie,ye]=R(!1),be=tt(({disableIdleCheck:O=!1}={})=>{p!=="loading"&&a.settings.autoRefresh&&S.current?.scrollTop<16&&(O||window.__IDLE__)&&!Vl()&&J(!0)},[a.notificationsShowNew,a.settings.autoRefresh,p]),Pe=F();Wt(O=>{if(O){const Se=Date.now()-Pe.current;!Pe.current||Se>1e3*3?be({disableIdleCheck:!0}):Pe.current=Date.now()}});const Ce=F(!0);W(()=>{let O=Ko(E,"notificationsShowNew",Se=>{if(Ce.current){Ce.current=!1;return}p!=="loading"&&(Se&&be(),ye(Se))});return()=>O?.()},[]);const Ae=new Date,Te=new Date(Ae-24*60*60*1e3);let De=new Date;const Oe=!a.notifications.some(O=>new Date(O.createdAt).toDateString()===Ae.toDateString()),Fe=F();W(()=>{r&&(E.routeNotification={id:r,accessToken:atob(u)})},[r,u]);const[se,Ee]=R(null);W(async()=>{const O=new Date;if(O.getMonth()!==11||!Je("@mastodon/annual-report"))return;let Se=xe.account.get("annualReportNotification");if(Se){Ee(Se);return}const Ue=wo({types:["annual_report"]});try{Se=(await Ue.next())?.value?.notificationGroups?.[0],Se?.annualReport?.year==O.getFullYear()&&(Ee(Se),xe.account.set("annualReportNotification",Se))}catch{}},[]);const $e=".notification",_e=He("j",()=>{const O=document.activeElement.closest($e),Se=O?.getBoundingClientRect(),Ue=Array.from(S.current.querySelectorAll($e));if(O&&Se.top0){const ze=Ue.indexOf(O);let N=Ue[ze+1];N&&(N.focus(),N.scrollIntoView(gn))}else{const ze=Ue.find(N=>{const oe=N.getBoundingClientRect();return oe.top>=44&&oe.left>=0});ze&&(ze.focus(),ze.scrollIntoView(gn))}},{useKey:!0,ignoreEventWhen:O=>O.metaKey||O.ctrlKey||O.altKey||O.shiftKey}),K=He("k",()=>{const O=document.activeElement.closest($e),Se=O?.getBoundingClientRect(),Ue=Array.from(S.current.querySelectorAll($e));if(O&&Se.top0){const ze=Ue.indexOf(O);let N=Ue[ze-1];N&&(N.focus(),N.scrollIntoView(gn))}else{const ze=Ue.find(N=>{const oe=N.getBoundingClientRect();return oe.top>=44&&oe.left>=0});ze&&(ze.focus(),ze.scrollIntoView(gn))}},{useKey:!0,ignoreEventWhen:O=>O.metaKey||O.ctrlKey||O.altKey||O.shiftKey}),we=He(["enter","o"],()=>{const Se=document.activeElement.closest($e)?.querySelector(".status-link");Se&&Se.click()},{useKey:!0,ignoreEventWhen:O=>O.metaKey||O.ctrlKey||O.altKey||O.shiftKey}),Re=new Date,Ne=ke(()=>it(Re,{forceOpts:{weekday:"long"}}),[Re]);return e("div",{id:"notifications-page",class:"deck-container",ref:O=>{S.current=O,_e.current=O,K.current=O,we.current=O},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${v?"only-mentions":""}`,children:[e("header",{hidden:k,onClick:O=>{O.target.closest("a, button")||S.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:O=>{O.target.closest("a, button")||J(!0)},class:p==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l",alt:o({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"iDNBZe"})}),e("div",{class:"header-side",children:V&&e("button",{type:"button",class:"button plain4",onClick:()=>{q(!0)},children:e(_,{icon:"settings",size:"l",alt:o({id:"a/+arl"})})})})]}),Ie&&p!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{J(!0),S.current?.scrollTo({top:0,behavior:"smooth"})},children:[e(_,{icon:"arrow-up"})," ",e(h,{id:"Jy9RU/"})]})]}),T.length>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("details",{class:"announcements",children:[e("summary",{children:[e("span",{children:[e(_,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(h,{id:"0whvLM",values:{0:T.length}})," ",e("small",{class:"insignificant",children:c})]}),T.length>1&&e("span",{class:"announcements-nav-buttons",children:T.map((O,Se)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{Fe.current?.children[Se].scrollIntoView({behavior:"smooth",block:"nearest"})},children:Se+1}))})]}),e("ul",{class:`announcements-list-${T.length>1?"multiple":"single"}`,ref:Fe,children:T.map(O=>e("li",{children:e(Gl,{announcement:O})}))})]})})}),A.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(h,{id:"6Fs1Ba"})}),A.length>5?e("details",{children:[e("summary",{children:e(h,{id:"7dHKu4",values:{0:A.length}})}),e("ul",{children:A.map(O=>e("li",{children:[e(lt,{account:O}),e(ui,{accountID:O.id,onChange:()=>{}})]},O.id))})]}):e("ul",{children:A.map(O=>e("li",{children:[e(lt,{account:O}),e(ui,{accountID:O.id,onChange:()=>{}})]},O.id))})]}),V&&he?.summary?.pendingRequestsCount>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"filtered-notifications",children:e("details",{onToggle:async O=>{const{open:Se}=O.target;if(Se){const Ue=await ae();ue(Ue)}},children:[e("summary",{children:e(h,{id:"N3Bq0f",values:{0:he.summary.pendingRequestsCount}})}),ee?ee?.length>0&&e("ul",{children:ee.map(O=>e("li",{children:[e("div",{class:"request-notifcations",children:[!O.lastStatus?.id&&e(lt,{useAvatarStatic:!0,showStats:!0,account:O.account}),O.lastStatus?.id&&e("div",{class:"last-post",children:e(pe,{class:"status-link",to:`/${c}/s/${O.lastStatus.id}`,children:e(Ye,{status:O.lastStatus,size:"s",readOnly:!0})})}),e(Zl,{request:O})]}),e(Xl,{request:O,onChange:()=>{J(!0)}})]},O.id))}):e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]})})})}),se&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(ln,{notification:se})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:v,onChange:O=>{y(O.target.checked)}})," ",e(h,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(h,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:Ne})]}),Oe&&e("p",{class:"ui-state insignificant",children:p==="default"?o({id:"KS7iJH"}):e(P,{children:"…"})}),a.notifications.length?e(Fn.Provider,{value:"notifications",children:a.notifications.filter(O=>O.type!=="follow_request").map(O=>{if(v&&O.type!=="mention")return null;const Se=new Date(O.createdAt),Ue=Se.toDateString()!==De.toDateString();Ue&&(De=Se);const ze=Se.toDateString()===Te.toDateString()?o({id:"y/0uwd"}):it(De,{hideTime:!0}),N=it(De,{forceOpts:{weekday:"long"}});return e(P,{children:[Ue&&e("h2",{class:"timeline-header",children:[e("span",{children:ze})," ",e("small",{class:"insignificant bidi-isolate",children:N})]}),e(ln,{instance:c,notification:O},O._ids||O.id)]},O._ids||O.id)})}):e(P,{children:[p==="loading"&&e(P,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((O,Se)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(_,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),p==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>J(!0),children:e(h,{id:"KDw4GX"})})]})]}),m&&e(Ct,{onChange:O=>{O&&J()},children:e("button",{type:"button",class:"plain block",disabled:p==="loading",onClick:()=>J(),style:{marginBlockEnd:"6em"},children:p==="loading"?e(Be,{abrupt:!0}):e(h,{id:"uXRAkV"})})})]}),V&&G&&e(Ke,{onClick:O=>{O.target===O.currentTarget&&q(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>q(!1),children:e(_,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:O=>{O.preventDefault();const{forNotFollowing:Se,forNotFollowers:Ue,forNewAccounts:ze,forPrivateMentions:N,forLimitedAccounts:oe}=O.target,x={...he,forNotFollowing:Se.value,forNotFollowers:Ue.value,forNewAccounts:ze.value,forPrivateMentions:N.value,forLimitedAccounts:oe.value};$(x),q(!1),(async()=>{try{await s.v2.notifications.policy.update(x),re(o({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(h,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:ql.map(O=>{const Se=he[O];return e("div",{children:e("label",{children:[i(jl[O]),e("select",{name:O,defaultValue:Se,class:"small",children:[e("option",{value:"accept",children:e(h,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(h,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(h,{id:"gbbkE7"})})]})]})},O)})}),e("p",{children:e("button",{type:"submit",children:e(h,{id:"tfDRzk"})})})]})})]})})]})}function Vl(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function Gl({announcement:n}){const{instance:i}=ie(),{contact:o}=As(),s=o?.account,{id:c,content:a,startsAt:p,endsAt:l,published:d,allDay:r,publishedAt:u,updatedAt:m,read:f,mentions:v,statuses:y,tags:S,emojis:g,reactions:w}=n,b=new Date(u),I=it(b),k=new Date(m),A=it(k);return e("div",{class:"announcement-block",children:[e(lt,{account:s}),e("div",{class:"announcement-content",onClick:Os({mentions:v,instance:i}),dangerouslySetInnerHTML:{__html:oi(a,{emojis:g})}}),e("p",{class:"insignificant",children:[e("time",{datetime:b.toISOString(),children:it(b)}),m&&A!==I&&e(P,{children:[" ","•"," ",e("span",{class:"ib",children:e(h,{id:"TbFrLc",values:{0:it(k)},components:{0:e("time",{datetime:k.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:w.map(C=>{const{name:T,count:M,me:L,staticUrl:U,url:H}=C;return e("button",{type:"button",class:`plain4 small ${L?"reacted":""}`,children:[H||U?e("img",{src:H||U,alt:T,width:"16",height:"16"}):e("span",{children:T})," ",e("span",{class:"count",children:Ze(M)})]})})})]})}function Wl(n){const{masto:i}=ie();return i.v1.notifications.list({accountID:n})}function Zl({request:n}){const{instance:i}=ie(),[o,s]=R("loading"),{account:c,lastStatus:a}=n,[p,l]=R(!1),[d,r]=R([]);function u(){l(!1)}return W(()=>{n?.account?.id&&p&&(s("loading"),(async()=>{const m=await Wl(n.account.id);r(m||[]),s("default")})())},[p,n?.account?.id]),e(P,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{l(!0)},children:[e(_,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(h,{id:"H0wUNM",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(_,{icon:"chevron-down"})]}),p&&e(Ke,{onClick:m=>{m.target===m.currentTarget&&u()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:u,children:e(_,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(h,{id:"MXOmPt",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):d.map(m=>e("div",{class:"notification-peek",onClick:f=>{const{target:v}=f;(f.target.tagName==="BUTTON"||f.target.tagName==="A")&&u()},children:e(ln,{instance:i,notification:m,isStatic:!0})}))})]})})]})}function Xl({request:n,onChange:i}){const{_:o}=ce(),{masto:s}=ie(),[c,a]=R("default"),[p,l]=R(null),d=p!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||d,onClick:()=>{a("loading"),(async()=>{try{await s.v1.notifications.requests.$select(n.id).accept(),l("accept"),a("default"),i({request:n,state:"accept"}),re(o({id:"ZtBMwU",values:{0:n.account.username}}))}catch{a("error"),re(o({id:"S92JKG"}))}})()},children:e(h,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:c==="loading"||d,class:"light danger",onClick:()=>{a("loading"),(async()=>{try{await s.v1.notifications.requests.$select(n.id).dismiss(),l("dismiss"),a("default"),i({request:n,state:"dismiss"}),re(o({id:"ibBDry",values:{0:n.account.username}}))}catch{a("error"),re(o({id:"S5aemF"}))}})()},children:e(h,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:c==="loading"?e(Be,{abrupt:!0}):p==="accept"?e(_,{icon:"check-circle",alt:o({id:"bzMKg7"}),class:"notification-accepted"}):p==="dismiss"&&e(_,{icon:"x-circle",alt:o({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const So=at(Yl),Jl=20;function hi({local:n,columnMode:i,...o}){const{_:s}=ce(),c=Ge(E),a=!!n,p=i?{}:$t(),{masto:l,instance:d}=ie({instance:o?.instance||p.instance}),{masto:r,instance:u}=ie(),m=s(a?{id:"u96B/B",values:{instance:d}}:{id:"PgVqvd",values:{instance:d}});et(m,a?"/:instance?/p/l":"/:instance?/p");const f=F(),v=F();async function y(g){if(g||!v.current){const I={limit:Jl,local:a||void 0};!a&&Je("@pixelfed/global-feed")&&(I.remote=!0),v.current=l.v1.timelines.public.list(I).values()}const w=await v.current.next();let{value:b}=w;return b?.length&&(g&&(f.current=b[0].id),b.forEach(I=>{Qe(I,d)})),{...w,value:b}}async function S(){try{const g=await l.v1.timelines.public.list({limit:1,local:a,since_id:f.current}).values().next();let{value:w}=g;const b=w[0]?.id===f.current;return w?.length&&!b?(w=Bt(w,"public"),!0):!1}catch{return!1}}return e(At,{title:m,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:s(a?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:d})]}),id:"public",instance:d,emptyText:s({id:"BiZJ6G"}),errorText:s({id:"scd9lw"}),fetchItems:y,checkForUpdates:S,useItemID:!0,headerStart:e(P,{}),boostsCarousel:c.settings.boostsCarousel,filterContext:"public",headerEnd:e(ct,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(ge,{href:a?`/#/${d}/p`:`/#/${d}/p/l`,children:a?e(P,{children:[e(_,{icon:"transfer"})," ",e("span",{children:e(h,{id:"dXMiUw"})})]}):e(P,{children:[e(_,{icon:"transfer"})," ",e("span",{children:e(h,{id:"t2B/we"})})]})}),e(je,{}),e(ge,{onClick:()=>{let g=prompt(s({id:"2MQ2cd"}));if(!/\./.test(g)){g&&alert(s({id:"7WddtO"}));return}g&&(g=g.toLowerCase().trim(),location.hash=a?`/${g}/p/l`:`/${g}/p`)},children:[e(_,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),u!==d&&e(ge,{onClick:()=>{location.hash=a?`/${u}/p/l`:`/${u}/p`},children:[e(_,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:u},components:{0:e("b",{})}})})]})]})},d+a)}function Ql({onItemClick:n}){const{_:i}=ce(),{instance:o}=ie(),[,s]=It(d=>d+1,0),c=Yn(),a=()=>{Nr(),re({text:i({id:"hgPsUe"}),delay:1e3}),s()},p=(d,r)=>{$r(d,r),s()},[l]=Kn();return c.length===0?null:e("div",{class:"recent-searches",children:[e("div",{class:"recent-searches-header",children:[e(_,{icon:"history"})," ",e("span",{children:e(h,{id:"4R1B1H"})}),e("span",{class:"spacer"}),e("button",{type:"button",class:"plain4 small",onClick:a,disabled:c.length<=0,children:e("span",{children:e(h,{id:"yYxB17"})})})]}),e("ul",{class:"link-list recent-searches-list",ref:l,children:c.map(d=>{const{label:r,to:u,icon:m}=Dt(d.query,d.queryType,o);return e("li",{class:"recent-searches-item",children:[e(pe,{to:u,class:"recent-searches-link",onClick:f=>{_n(d.query,d.queryType),n?.(f)},children:[e(_,{icon:m,class:"more-insignificant"}),e("span",{class:"recent-searches-label",children:r})]}),e("button",{type:"button",class:"plain4 small",onClick:()=>p(d.query,d.queryType),children:e(_,{icon:"trash",alt:i({id:"xCJdfg"})})})]},`${d.query}-${d.queryType}-${d.timestamp}`)})})]})}const vn=5,si=40,ed=new URLSearchParams,yn={block:"nearest",inline:"center",behavior:"smooth"};function Co({columnMode:n,...i}){const{_:o}=ce(),s=n?{}:$t(),{masto:c,instance:a,authenticated:p}=ie({instance:s.instance}),[l,d]=R("default"),[r]=n?[ed]:gt(),u=F(),m=i?.query||r.get("q"),f=n?"statuses":i?.type||r.get("type");let v=o({id:"A1taO8"});if(m)switch(f){case"statuses":v=o({id:"6YeoAt",values:{q:m}});break;case"accounts":v=o({id:"fpgumQ",values:{q:m}});break;case"hashtags":v=o({id:"AuiMZZ",values:{q:m}});break;default:v=o({id:"wr3GZI",values:{q:m}})}et(v,"/search");const[y,S]=R(!1),g=F(0);W(()=>{g.current=0},[m,f]);const w=F();yt(()=>{w.current?.scrollTo?.(0,0)},[m,f]);const[b,I]=R([]),[k,A]=R([]),[C,T]=R([]);W(()=>{I([]),A([]),T([])},[m]);const M={statuses:b,accounts:k,hashtags:C},L={statuses:I,accounts:A,hashtags:T},[U,H]=R({}),j=async $=>{if(!$?.length)return;const ne=await Bn($,U);ne&&H({...U,...ne})};function X($){$&&(g.current=0),!(!$&&!p)&&(d("loading"),$&&!f&&(I(b.slice(0,vn)),A(k.slice(0,vn)),T(C.slice(0,vn))),(async()=>{const ne={q:m,resolve:p,limit:vn};f&&(ne.limit=si,ne.type=f,p&&(ne.offset=g.current));try{const Y=await c.v2.search.list(ne);if(f)if($){L[f](Y[f]);const ee=Y[f]?.length;g.current=si,S(!!ee)}else if(Y[f]?.[0]?.id===M[f]?.[0]?.id)S(!1);else{L[f](ue=>[...ue,...Y[f]]);const ee=Y[f]?.length;g.current=g.current+si,S(!!ee)}else I(Y.statuses||[]),A(Y.accounts||[]),T(Y.hashtags||[]),g.current=0,S(!1);j(Y.accounts),d("default")}catch{d("error")}})())}const Q=F();Wt($=>{const ne=w.current?.scrollTop===0;if($&&ne){const Y=Date.now()-Q.current;!Q.current||Y>1e3*3?X(!0):Q.current=Date.now()}}),W(()=>{let $;return u.current?.setValue?.(m||""),m?X(!0):$=setTimeout(()=>{u.current?.focus?.()},150),()=>clearTimeout($)},[m,f,a]),He(["Slash","/"],$=>{u.current?.focus?.(),u.current?.select?.()},{useKey:!0,preventDefault:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey});const V=".timeline > li > a, .hashtag-list > li > a",G=He("j",()=>{const $=document.activeElement.closest(V),ne=$?.getBoundingClientRect(),Y=Array.from(w.current.querySelectorAll(V));if($&&ne.top0){const ee=Y.indexOf($);let ue=Y[ee+1];ue&&(ue.focus(),ue.scrollIntoView(yn))}else{const ee=Y.find(ue=>{const ae=ue.getBoundingClientRect();return ae.top>=44&&ae.left>=0});ee&&(ee.focus(),ee.scrollIntoView(yn))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),q=He("k",()=>{const $=document.activeElement.closest(V),ne=$?.getBoundingClientRect(),Y=Array.from(w.current.querySelectorAll(V));if($&&ne.top0){const ee=Y.indexOf($);let ue=Y[ee-1];ue&&(ue.focus(),ue.scrollIntoView(yn))}else{const ee=Y.find(ue=>{const ae=ue.getBoundingClientRect();return ae.top>=44&&ae.left>=0});ee&&(ee.focus(),ee.scrollIntoView(yn))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),[he]=Kn();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:$=>{w.current=$,G.current=$,q.current=$},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:l==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(Nt,{})}),e(co,{ref:u}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{X(!0)},disabled:l==="loading",children:e(_,{icon:"search",size:"l",alt:o({id:"A1taO8"})})})})]})}),e("main",{children:[!!m&&!n&&e("div",{ref:he,class:`filter-bar ${l==="loading"?"loading":""}`,children:[!!f&&e(pe,{to:`/search${m?`?q=${encodeURIComponent(m)}`:""}`,children:[e(_,{icon:"chevron-left"})," ",e(h,{id:"N40H+G"})]}),[{label:o({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(m)}&type=accounts`},{label:o({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(m)}&type=hashtags`},{label:o({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(m)}&type=statuses`}].sort(($,ne)=>$.type===f?-1:ne.type===f?1:0).map($=>e(pe,{to:$.to,children:$.label},$.type))]}),m?e(P,{children:[(!f||f==="accounts")&&e(P,{children:[f!=="accounts"&&e("h2",{class:"timeline-header",children:[e(h,{id:"bPwFdf"})," ",e(pe,{to:`/search?q=${encodeURIComponent(m)}&type=accounts`,children:e(_,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),k.length>0?e(P,{children:[e("ul",{class:"timeline flat accounts-list",children:k.map($=>e("li",{children:e(lt,{account:$,instance:a,showStats:!0,relationship:U[$.id]})},$.id))}),f!=="accounts"&&e("div",{class:"ui-state",children:e(pe,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=accounts`,children:[e(h,{id:"BMmtZ8"})," ",e(_,{icon:"arrow-right"})]})})]}):!f&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"YYB61U"})}))]}),(!f||f==="hashtags")&&e(P,{children:[f!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(h,{id:"VwUsHI"})," ",e(pe,{to:`/search?q=${encodeURIComponent(m)}&type=hashtags`,children:e(_,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),C.length>0?e(P,{children:[e("ul",{class:"link-list hashtag-list",children:C.map($=>{const{name:ne,history:Y}=$,ee=Y?.reduce?.((ue,ae)=>ue+ +ae.uses,0);return e("li",{children:e(pe,{to:a?`/${a}/t/${ne}`:`/t/${ne}`,children:[e(_,{icon:"hashtag",alt:"#"}),e("span",{children:ne}),!!ee&&e("span",{class:"count",children:Ze(ee)})]})},`${ne}-${ee}`)})}),f!=="hashtags"&&e("div",{class:"ui-state",children:e(pe,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=hashtags`,children:[e(h,{id:"Nc/W5J"})," ",e(_,{icon:"arrow-right"})]})})]}):!f&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"4MFM3P"})}))]}),(!f||f==="statuses")&&e(P,{children:[f!=="statuses"&&e("h2",{class:"timeline-header",children:[e(h,{id:"+owNNn"})," ",e(pe,{to:`/search?q=${encodeURIComponent(m)}&type=statuses`,children:e(_,{icon:"arrow-right",size:"l",alt:o({id:"V1fa9u"})})})]}),b.length>0?e(P,{children:[e("ul",{class:"timeline",children:b.map($=>e("li",{children:e(pe,{class:"status-link",to:a?`/${a}/s/${$.id}`:`/s/${$.id}`,children:e(Ye,{status:$})})},$.id))}),f!=="statuses"&&e("div",{class:"ui-state",children:e(pe,{class:"plain button",to:`/search?q=${encodeURIComponent(m)}&type=statuses`,children:[e(h,{id:"LYCgej"})," ",e(_,{icon:"arrow-right"})]})})]}):!f&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"Hzi9AA"})}))]}),!!f&&(l==="default"?y?e(Ct,{onChange:$=>{$&&X()},children:e("button",{type:"button",class:"plain block",onClick:()=>X(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):l==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}))]}):l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e(P,{children:[e("p",{class:"ui-state insignificant",children:e(h,{id:"fGn1Hk"})}),e(Ql,{})]})]})]})})}const td=20,_o=10*60*1e3,nd=mt(n=>n.v1.trends.links.list().values().next(),{maxAge:_o}),id=mt(n=>n.v1.trends.tags.list().values().next(),{maxAge:_o});function sd(n){return Je("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}).values():n.v1.trends.statuses.list({limit:td}).values()}function od(n,i){return n.v1.timelines.link.list(i).values()}function Io({columnMode:n,...i}){const{_:o}=ce(),s=Ge(E),c=n?{}:$t(),{masto:a,instance:p}=ie({instance:i?.instance||c.instance}),{masto:l,instance:d}=ie(),r=o({id:"cI3UEs",values:{instance:p}});et(r,"/:instance?/trending");const u=F(),m=p===d,[f,v]=R([]),[y,S]=R([]),g=F();async function w(Q){if(Q||!g.current){if(g.current=sd(a),Je("@mastodon/trending-hashtags"))try{const{value:q}=await id(a);q?.length&&v(q)}catch{}if(Je("@mastodon/trending-links"))try{const{value:q}=await nd(a,p),he=q?.filter?.($=>$.type==="link");he?.length&&S(he)}catch{}}const V=await g.current.next();let{value:G}=V;return G?.length&&(Q&&(u.current=G[0].id),G.forEach(q=>{Qe(q,p)})),{...V,value:G}}const[b,I]=R(!1),k=F(),[A,C]=R(null),T=!!A,M=F(),L=m&&Je("@mastodon/trending-link-posts");W(()=>{A&&M.current&&M.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[A]);const U=F();async function H(Q){(Q||!k.current)&&(I(!0),k.current=od(a,{url:A})),U.current=A;const V=await k.current.next();let{value:G}=V;return G?.length&&(G=Bt(G,"public"),G.forEach(q=>{Qe(q,p)})),U.current===A&&I(!1),{...V,value:G}}async function j(){try{const Q=await a.v1.trends.statuses.list({limit:1}).values().next();let{value:V}=Q;return V=Bt(V,"public"),V?.length&&V[0].id!==u.current?(u.current=V[0].id,!0):!1}catch{return!1}}const X=ke(()=>e(P,{children:[!!f.length&&e("div",{class:"filter-bar expandable",children:[e(_,{icon:"chart",class:"insignificant",size:"l"}),f.map((Q,V)=>{const{name:G,history:q}=Q,he=q.reduce(($,ne)=>$+ +ne.uses,0);return e(pe,{to:`/${p}/t/${G}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),G]}),e("span",{class:"filter-count",children:Ze(he)})]},G)})]}),!!y.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(h,{id:"9veeTb"})})}),y.map(Q=>{const{authors:V,authorName:G,authorUrl:q,blurhash:he,description:$,height:ne,image:Y,imageDescription:ee,language:ue,providerName:ae,providerUrl:J,publishedAt:Ie,title:ye,url:be,width:Pe}=Q,Ce=V?.[0]?.account?.id?V[0].account:null,Ae=ye.length<30,Te=!!(G||Ce),De=Ci(be);let Oe;if(he){const Fe=_i(he),se=Di(Fe);Oe=Pi([.6,se[1],se[2]])}return e("div",{children:[e("a",{ref:A===be?M:null,href:be,target:"_blank",rel:"noopener",class:`link-block ${T?A===be?"active":"inactive":""}`,style:Oe?{"--accent-color":`rgb(${Oe.join(",")})`,"--accent-alpha-color":`rgba(${Oe.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:Y,alt:ee,width:Pe,height:ne,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:De})," ",!!Ie&&e(P,{children:"· "}),!!Ie&&e(P,{children:e(bt,{datetime:Ie,format:"micro"})})]}),!!ye&&e("h1",{class:"title",lang:ue,dir:"auto",title:ye,children:ye})]}),!!$&&e("p",{class:`description ${Te&&!Ae?"":"more-lines"}`,lang:ue,dir:"auto",title:$,children:$}),Te&&e(P,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(h,{id:"aavdrC",values:{0:Ce?e(pt,{account:Ce,showAvatar:!0}):q?e("a",{href:q,target:"_blank",rel:"noopener",children:G}):G}})})})]})]})]})}),L&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{C(be)},disabled:be===A,children:[e(_,{icon:"comment2"})," ",e("span",{children:e(h,{id:"/bZzdR"})})," ",e(_,{icon:"chevron-down"})]})]},be)})]}),L&&!!y.length&&e("div",{class:`timeline-header-block ${T?"blended":""}`,children:T?e(P,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:b?e(Be,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{C(null)},children:e(_,{icon:"x",alt:o({id:"9Q/4xJ"})})})}),e("p",{children:e(h,{id:"BATCqf",values:{0:A.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(h,{id:"Vosm4k"})})})]}),[f,y,A,b]);return e(At,{title:r,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(h,{id:"4/iCqx"})}),e("div",{children:p})]}),id:"trending",instance:p,emptyText:o({id:"6HA9+s"}),errorText:o({id:"scd9lw"}),fetchItems:T?H:w,checkForUpdates:T?void 0:j,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(P,{}),boostsCarousel:s.settings.boostsCarousel,filterContext:"public",timelineStart:X,refresh:A,clearWhenRefresh:!0,view:T?"link-mentions":void 0,headerEnd:e(ct,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(ge,{onClick:()=>{let Q=prompt(o({id:"2MQ2cd"}));if(!/\./.test(Q)){Q&&alert(o({id:"7WddtO"}));return}Q&&(Q=Q.toLowerCase().trim(),location.hash=`/${Q}/trending`)},children:[e(_,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),d!==p&&e(ge,{onClick:()=>{location.hash=`/${d}/trending`},children:[e(_,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:d},components:{0:e("b",{})}})})]})]})},p)}const ms={block:"nearest",inline:"nearest",behavior:"smooth"};function cd(){const{_:n}=ce();et(n({id:"i0qMbr"}),"/");const i=Ge(E),{shortcuts:o}=i,s=o.map(c=>{if(!c)return null;const{type:a,...p}=c,l={following:zi,notifications:So,list:po,public:hi,bookmarks:ro,favourites:lo,hashtag:ho,mentions:vo,trending:Io,search:Co}[a];return!l||a==="search"&&!p.query||a==="list"&&!p.id?null:e(l,{...p,columnMode:!0},a+JSON.stringify(p))});return He(["1","2","3","4","5","6","7","8","9"],c=>{try{const a=parseInt(c.key,10)-1,p=document.querySelectorAll("#columns > *")[a];p&&(p.focus(),p.scrollIntoView(ms))}catch{}},{useKey:!0,ignoreEventWhen:c=>c.metaKey||c.ctrlKey||c.altKey||c.shiftKey}),He(["[","]"],(c,a)=>{const p=a.keys[0],l=document.activeElement.closest("#columns > *"),d=Ot(),r=d?"]":"[",u=d?"[":"]";let m;p===r?m=l?l.previousElementSibling:document.querySelectorAll("#columns > *")[0]:p===u&&(m=l?l.nextElementSibling:document.querySelectorAll("#columns > *")[1]),m&&(m.focus(),m.scrollIntoView(ms))},{useKey:!0,ignoreEventWhen:c=>c.metaKey||c.ctrlKey||c.altKey||c.shiftKey}),e("div",{id:"columns",onContextMenu:c=>{c.target.closest(".deck > header")&&!c.target.closest("a")&&!c.target.closest("button")&&(c.preventDefault(),E.showShortcutsSettings=!0)},onFocus:()=>{const c=document.activeElement.closest("#columns > *");c&&document.querySelectorAll("#columns > *").forEach(a=>{a.classList.toggle("focus",a===c)})},children:s})}function ad(){const{_:n}=ce(),i=Ge(E);return __BENCHMARK.end("time-to-home"),W(()=>{(async()=>{const o=await ht.drafts.keys();if(o.length){const s=Rn();o.filter(a=>a.startsWith(s)).length&&(E.showDrafts=!0)}})()},[]),e(P,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&i.shortcuts?.length?e(cd,{}):e(zi,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(rd,{})})})}function rd(){const{_:n}=ce(),i=Ge(E),o=F(),[s,c]=R(void 0);return e(P,{children:[e(pe,{ref:o,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${s||""}`,onClick:a=>{a.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(a.preventDefault(),c(p=>p?void 0:"open"))},children:e(_,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(dd,{state:s,anchorRef:o,onClose:()=>c(void 0)})]})}const ld=5;function dd({anchorRef:n,state:i,onClose:o}){const{masto:s,instance:c}=ie(),a=Ge(E),[p,l]=R("default"),d=wo();async function r(){const g=await d.next(),w=go(g.value);if(w?.length){w.forEach(I=>{Qe(I.status,c,{skipThreading:!0})});const b=ko(w);E.notificationsLast=b[0],E.notifications=b,s.v1.markers.create({notifications:{lastReadId:b[0].id}}).catch(()=>{})}return E.notificationsShowNew=!1,E.notificationsLastFetchTime=Date.now(),g}const[u,m]=R(!1);function f(){return s.v1.followRequests.list({limit:1})}function v({skipFollowRequests:g=!1}={}){l("loading"),(async()=>{try{if(await r(),!g){const w=await f();m(!!w?.length)}l("default")}catch{l("error")}})()}const y=F(),S=52;return W(()=>{i==="open"&&(a.notificationsShowNew?y.current?.scrollTop<=S&&v({skipFollowRequests:!0}):v())},[i,a.notificationsShowNew]),e(Si,{ref:y,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:o,portal:{target:document.body},containerProps:{onClick:()=>{y.current?.closeMenu?.()}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(h,{id:"iDNBZe"})})}),e(Fn.Provider,{value:"notifications",children:e("main",{children:a.notifications.length?e(P,{children:a.notifications.slice(0,ld).map(g=>e(ln,{instance:c,notification:g,disableContextMenu:!0},g._ids||g.id))}):p==="loading"?e("div",{class:"ui-state",children:e(Be,{abrupt:!0})}):p==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:v,children:e(h,{id:"KDw4GX"})})})]})})}),e("footer",{children:[e(pe,{to:"/mentions",class:"button plain",children:[e(_,{icon:"at"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(pe,{to:"/notifications",class:"button plain2",children:[u?e(h,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(h,{id:"gukqfD"})})," ",e(_,{icon:"arrow-right"})]})]})]})}const ud=at(ad),hd=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function Ao(n){const i=URL.parse(n);if(!i)return{};const{hostname:o,pathname:s}=i;for(const c of hd){const[,a]=s.match(c)||[];if(a)return{instance:o,id:a}}return{}}function pd(n){const{instance:i,id:o}=Ao(n);return i&&o?`/${i}/s/${o}`:null}function fd(){const i=Jt().pathname.replace(/^\//,""),o=Ao(i),s=o?.instance?`/${o.instance}/s/${o.id}`:null,[c,a]=R("loading");return yt(()=>{a("loading"),(async()=>{try{const{instance:p,id:l}=o;if(l){const{masto:d}=ie({instance:p});if(await d.v1.statuses.$select(l).fetch()){window.location.hash=s+"?view=full";return}}}catch{}{const{masto:p,instance:l}=ie(),d=await p.v2.search.list({q:i,limit:1,resolve:!0});if(d.statuses.length){const r=d.statuses[0];window.location.hash=`/${l}/s/${r.id}?view=full`}else if(d.accounts.length){const r=d.accounts[0];window.location.hash=`/${l}/a/${r.id}`}else s?window.location.hash=s+"?view=full":a("error")}})()},[s]),e("div",{class:"ui-state",tabIndex:"-1",children:[c==="loading"?e(P,{children:[e(Be,{abrupt:!0}),e("h2",{children:e(h,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}):e(P,{children:[e("h2",{children:e(h,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}),e("hr",{}),e("p",{children:e(pe,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}function md(){const{_:n}=ce();et(n({id:"h16FyT"}),"/l");const[i,o]=R("default"),[s,c]=It(u=>u+1,0),[a,p]=R([]);W(()=>{o("loading"),(async()=>{try{const u=await di();p(u),o("default")}catch{o("error")}})()},[s]);const[l,d]=R(!1),r=a.some(u=>u.exclusive);return e("div",{id:"lists-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l"})})]}),e("h1",{children:e(h,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>d(!0),children:e(_,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:a.length>0?e(P,{children:[e("ul",{class:"link-list",children:a.map(u=>e("li",{children:e(pe,{to:`/l/${u.id}`,children:[e(_,{icon:"list"})," ",e("span",{children:[u.title,u.exclusive&&e(P,{children:[" ",e(Ut,{insignificant:!0})]})]})]})}))}),a.length>1&&e("footer",{class:"ui-state",children:[r&&e("p",{children:e("small",{class:"insignificant",children:[e(Ut,{})," ",e(h,{id:"FNptcJ"})]})}),e("p",{children:e("small",{class:"insignificant",children:e(h,{id:"8prZNK",values:{0:a.length}})})})]})]}):i==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):i==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"IvPikw"})})})]}),l&&e(Ke,{onClick:u=>{u.target===u.currentTarget&&d(!1)},children:e(Ni,{list:l?.list,onClose:u=>{u.state==="success"&&c(),d(!1)}})})]})}const gd=""+new URL("instances-Dd-nff5Z.json",import.meta.url).href,vd={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:yd}=vd;function bd(){const{_:n}=ce();et(n({id:"sQia9P"}),"/login");const i=F(),o=xe.local.get("instanceURL"),[s,c]=R("default"),[a]=gt(),p=a.get("instance"),l=a.get("submit"),[d,r]=R(p||o?.toLowerCase()||""),[u,m]=R([]),f=F();W(()=>{(async()=>{try{const k=await(await fetch(gd)).json();m(k),f.current=new fc(k)}catch{}})()},[]);const v=I=>{I&&(async()=>{try{const A=await(await fetch(`https://${I}/.well-known/host-meta`)).text(),L=new DOMParser().parseFromString(A,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),U=URL.parse(L),{host:H}=U;I!==H&&(I=H)}catch{}xe.local.set("instanceURL",I),c("loading");try{let k=Ls(I);(!k||!k.client_id||!k.client_secret)&&(k=await Gc({instanceURL:I}),Ho(I,k));const{client_id:A,client_secret:C}=k,T=await Kc({instanceURL:I}),M=qo(I);if(T)if(A&&C){const[L,U]=await Wc({instanceURL:I,client_id:A,forceLogin:M});xe.sessionCookie.set("codeVerifier",U),location.href=L}else alert(n({id:"ZP1FIA"}));else A&&C?location.href=await Zc({instanceURL:I,client_id:A,forceLogin:M}):alert(n({id:"ZP1FIA"}));c("default")}catch{c("error")}})()},y=d?d.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,S=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(y)&&!/[\s\/\\@]/.test(y),g=y?f.current?.search(y,{limit:10})?.map(I=>I.item):[],w=S?y:g?.length?g[0]:d?u.find(I=>I.includes(d)):null,b=I=>{I.preventDefault(),v(w)};return l&&W(()=>{v(p||w)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:b,children:[e("h1",{children:[e("img",{src:Li,alt:"",width:"80",height:"80"}),e("br",{}),e(h,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(h,{id:"kyAi7k"})}),e("input",{value:d,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:s==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"u3gOdY"}),onInput:I=>{r(I.target.value)},dir:"auto"}),g?.length>0?e("ul",{id:"instances-suggestions",children:g.map((I,k)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{v(I)},children:I})}))}):e("div",{id:"instances-eg",children:e(h,{id:"/OvbEC"})})]}),s==="error"&&e("p",{class:"error",children:e(h,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:s==="loading"||!d||!w,children:n(w?{id:"2xahsi",values:{selectedInstanceText:w}}:{id:"xGVfLh"})})," "]}),e(Be,{hidden:s!=="loading"}),e("hr",{}),!yd&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(h,{id:"LcOiWS"})})}),e("p",{children:e(pe,{to:"/",children:e(h,{id:"iWpEwy"})})}),e(Mi,{})]})})}const wd=40;function kd(){const{_:n}=ce(),i=Ge(E);et(n({id:"+GkIdc"}),"/sp");const{masto:o}=ie(),[s,c]=R([]),[a,p]=R("default"),[l,d]=It(m=>m+1,0),[r,u]=R(!1);return W(d,[i.reloadScheduledPosts]),W(()=>{p("loading"),(async()=>{try{const m=o.v1.scheduledStatuses.list({limit:wd}).values(),f=[];let v;do v=(await m.next()).value,v?.length&&f.push(...v);while(v?.length);c(f)}catch{p("error")}finally{p("default")}})()},[l]),e("div",{id:"scheduled-posts-page",class:"deck-container",tabIndex:"-1",children:e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Nt,{}),e(pe,{to:"/",class:"button plain",children:e(_,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"+GkIdc"})}),e("div",{class:"header-side",children:e(ct,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(_,{icon:"more",size:"l",alt:n({id:"2FYpfJ"})})}),children:e(ge,{onClick:()=>{d()},children:[e(_,{icon:"refresh",size:"l"}),e("span",{children:e(h,{id:"lCF0wC"})})]})})})]})}),e("main",{children:[s.length?e("ul",{class:"posts-list",children:s.map(m=>{const{id:f,params:v,scheduledAt:y,mediaAttachments:S}=m,{inReplyToId:g,language:w,poll:b,sensitive:I,spoilerText:k,text:A,visibility:C}=v,T={id:f,inReplyToId:g,language:w,mediaAttachments:S,poll:b?{...b,expiresAt:new Date(Date.now()+b.expiresIn*1e3),options:b.options.map(M=>({title:M,votesCount:0}))}:void 0,sensitive:I,spoilerText:k,text:A,visibility:C,content:`

${A}

`};return e("li",{children:e(Sd,{status:T,scheduledAt:y,onClick:()=>{u({post:T,scheduledAt:new Date(y)})}})},f)})}):e("p",{class:"ui-state",children:a==="loading"?e(Be,{}):n({id:"mZYb1f"})}),r&&e(Ke,{onClick:m=>{m.target===m.currentTarget&&u(!1)},children:e(Cd,{post:r.post,scheduledAt:r.scheduledAt,onClose:()=>u(!1)})})]})]})})}function Sd({status:n,scheduledAt:i,onClick:o}){const s=ke(()=>{const c=(Date.parse(i)-Date.now())/36e5;return c<24?"time":c<720?"day":"month"},[i]);return e("button",{type:"button",class:"textual block",onClick:o,children:[e("div",{class:`post-schedule-meta post-schedule-${s}`,children:[e(_,{icon:s,class:"insignificant"})," ",e("span",{children:e(h,{id:"aEp6lO",values:{0:it(i,{formatOpts:{weekday:"short",second:"numeric"}})},components:{0:e("b",{}),1:e(bt,{datetime:i}),2:e("small",{})}})})]}),e(Ye,{status:n,size:"s",previewMode:!0,readOnly:!0})]})}function Cd({post:n,scheduledAt:i,onClose:o}){const{masto:s}=ie(),{_:c}=ce(),[a,p]=R("default"),[l,d]=R(),r=l&&l.getTime()!==i.getTime(),u=mc(),m=i&&i<=Date.now(),{inReplyToId:f}=n,[v,y]=R(null);return e("div",{id:"scheduled-post-sheet",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(_,{icon:"x",size:"l",alt:c({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(h,{id:"orjBLU",components:{0:e("b",{}),1:e(bt,{datetime:i})}}),e("br",{}),e("small",{children:it(i,{formatOpts:{weekday:"short",second:"numeric"}})})]})}),e("main",{tabIndex:"-1",children:[!!v&&e("div",{class:"status-reply",children:e(Ye,{status:v,size:"s",previewMode:!0,readOnly:!0})}),e(Ye,{status:n,size:"s",previewMode:!0,readOnly:!0,onMediaClick:(S,g,w,b)=>{S.preventDefault(),E.showMediaModal={mediaAttachments:n.mediaAttachments,mediaIndex:g}}}),e("form",{onSubmit:S=>{S.preventDefault(),p("loading"),(async()=>{try{await s.v1.scheduledStatuses.$select(n.id).update({scheduledAt:l.toISOString()}),re(c({id:"40naR1"})),o(),p("default"),E.reloadScheduledPosts++}catch{p("error"),re(c({id:"ZM3jAs"}))}})()},children:e("footer",{children:[e("div",{class:"row",children:e("span",{children:[e(gc,{scheduledAt:i,setScheduledAt:S=>{d(S)}})," ",e("small",{class:"ib",children:u})]})}),e("div",{class:"row",children:[e("button",{disabled:!r||a==="loading"||m,children:e(h,{id:"QqW27M"})}),e("span",{class:"grow"}),e(dt,{align:"end",menuItemClassName:"danger",confirmLabel:c({id:"09u3Kk"}),onClick:()=>{p("loading"),(async()=>{try{await ie().masto.v1.scheduledStatuses.$select(n.id).remove(),re(c({id:"/zL/Mq"})),o(),p("default"),E.reloadScheduledPosts++}catch{p("error"),re(c({id:"aOh6Md"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:a==="loading"||m,children:e(h,{id:"Jb6/SB"})})})]})]})})]})]})}function _d(){const{_:n}=ce(),{prevEditedAt:i,nextEditedAt:o,editedAtIndex:s,editHistoryMode:c,editHistoryRef:a,exitEditHistory:p}=Us();return c?e("div",{class:"edit-history-controls",children:[e(_,{icon:"edit"}),e("b",{class:"edit-history-heading",children:n({id:"HSA2au"})}),e("span",{class:"spacer"}),e("span",{class:"edit-history-pagination",children:[e("button",{type:"button",class:"plain4",onClick:()=>{i()},disabled:!c||s+1>=a.current.length,children:e(_,{icon:"chevron-left",alt:n({id:"DHhJ7s"})})})," ",a.current.length-s," /"," ",a.current.length," ",e("button",{type:"button",class:"plain4",onClick:()=>{o()},disabled:!c||s<=0,children:e(_,{icon:"chevron-right",alt:n({id:"hXzOVo"})})})]}),e("button",{type:"button",class:"plain3",onClick:()=>{p()},children:e(_,{icon:"exit",alt:n({id:"ydzS9x"})})})]}):null}const Id={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:gs}=Id,bn=40,Ad=10,Td=5;let pi={},In={},An={};function Tn(n){delete In[n],delete An[n]}const tn={block:"nearest",inline:"center",behavior:"smooth"},vs=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",ys=/\/s\//i;function xd(n){const{id:i}=n,{masto:o,instance:s}=ie({instance:n.instance}),c=Ge(E),[a,p]=gt(),l=a.get("media"),d=a.get("media-only"),r=parseInt(l||d,10);let u=r>0;const m=a.get("mediaStatusID"),f=Rs(m,s);m&&!f&&(u=!1);const v=u&&!!d,y=ot(i,s),[S,g]=R(E.statuses[y]);W(()=>{E.statuses[y]&&g(E.statuses[y])},[y]);const w=ke(()=>{const{prevLocation:C}=E,T=(C?.pathname||"")+(C?.search||""),M=on("/:instance/s/:id",T)||on("/s/:id",T);return!T||M?"/":T},[]);W(()=>{!S&&u&&(async()=>{try{const C=await o.v1.statuses.$select(i).fetch();Qe(C,s),g(C)}catch{alert("Unable to load post."),location.hash=w}})()},[u]);const b=m?c.statuses[ot(m,s)]?.mediaAttachments:S?.mediaAttachments,I=()=>window.matchMedia("(min-width: calc(40em + 350px))").matches?"large":"small",k=tt(()=>{I()==="small"&&c.prevLocation?history.back():v?location.hash=w:(a.delete("media"),a.delete("mediaStatusID"),p(a))},[v,w,c.prevLocation]),A=tt((C,T,M,L)=>{if(I()==="large"&&!v){k();return}if(u&&document.startViewTransition){const U=M[T],{id:H,blurhash:j,url:X}=U,Q=vc(H||j||X),G=[...document.querySelectorAll(`.status .media [data-view-transition-name="${Q}"]`)].filter?.(he=>{const $=he.getBoundingClientRect();return $.top0&&$.left0}),q=G.length===1?G[0]:G.find(he=>!!he.closest(".status-deck"));q?document.startViewTransition(()=>{q.style.viewTransitionName=Q,L?.current&&L.current.querySelectorAll(".media img, .media video")?.forEach($=>{$.style.viewTransitionName=""}),k()}).ready.finally(()=>{q.style.viewTransitionName="",q.dataset.viewTransitioned=Q}):k()}else k()},[u,v]);return W(()=>{let C=setTimeout(()=>{const T=document.querySelector(".carousel");T&&T.focus()},100);return()=>clearTimeout(C)},[v]),W(()=>{const C=document.querySelectorAll(".deck-container");return C.forEach(T=>{T.setAttribute("inert","")}),()=>{C.forEach(T=>{T.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[u?b?.length?e(so,{mediaAttachments:b,statusID:m||i,instance:s,lang:S?.language,index:r-1,onClose:A}):e("div",{class:"media-modal-container loading",children:e(Be,{abrupt:!0})}):e(pe,{to:w}),!v&&e(yc,{statusID:i,children:e(Rd,{id:i,instance:n.instance,closeLink:w})})]})}function Ed(n){const{linkable:i,to:o,onClick:s,...c}=n;return i?e(pe,{class:"status-link",to:o,onClick:s,...c}):e("div",{class:"status-focus",tabIndex:0,...c})}function bs(n,i){return Date.parse(n.createdAt)-Date.parse(i.createdAt)}const ws=1e3*60*60*24*30;function Rd({id:n,closeLink:i="/",instance:o}){const{_:s}=ce(),[c,a]=gt(),p=c.get("media"),l=c.get("mediaStatusID"),d=parseInt(p,10)>0,r=F(!E.prevLocation&&(history.length===1||"navigation"in window&&navigation?.entries?.()?.length===1)),[u,m]=R(c.get("view")||r.current?"full":null),f=!!parseInt(c.get("translate")),{masto:v,instance:y}=ie({instance:o}),{masto:S,instance:g,authenticated:w}=ie(),b=y===g,I=Ge(E),[k,A]=R([]),[C,T]=R("default"),M=F(),L=ot(n,y),U=F(0),H=F();W(()=>{H.current?.focus()},[]),W(()=>{const N=Ks(()=>{if(!H.current)return;const{scrollTop:oe}=H.current;C!=="loading"&&(An[n]=oe)},50);return H.current?.addEventListener("scroll",N,{passive:!0}),N(),()=>{N.cancel(),H.current?.removeEventListener("scroll",N)}},[n,C!=="loading"]);const{editHistoryMode:j,initEditHistory:X,editedAtIndex:Q,editHistoryRef:V}=Us(),G=F(),q=F(),[he,$]=R(0),ne=F(null),Y=()=>{if(!ne.current)return;let{ancestors:N,descendants:oe,heroStatus:x}=ne.current;if(j&&oe?.length){const z=V.current[Q],fe=Date.parse(z.createdAt),Me=V.current[Q-1],Le=Me?Date.parse(Me.createdAt):null;oe=oe.filter(Ve=>{const Xe=Date.parse(Ve.editedAt||Ve.createdAt);return Xe>=fe&&(!Le||Xe<=Le)})}N.sort(bs),oe.sort(bs),U.current=oe?.length||0;const B=new Set;N.forEach(z=>{Qe(z,y,{skipThreading:!0}),z.inReplyToId&&!N.find(fe=>fe.id===z.inReplyToId)&&B.add(z.inReplyToId)});const Z=N.every(z=>z.account.id===x.account.id),te=[];oe.forEach(z=>{if(Qe(z,y,{}),z.inReplyToId&&!oe.find(fe=>fe.id===z.inReplyToId)&&z.inReplyToId!==x.id&&B.add(z.inReplyToId),z.inReplyToAccountId===z.account.id)te.push(z);else if(z.inReplyToId===x.id)te.push(z);else if(!z.inReplyToAccountId&&te.find(fe=>fe.id===z.inReplyToId&&fe.account.id===x.account.id)&&z.account.id===x.account.id)te.push(z);else{const fe=oe.find(Me=>Me.id===z.inReplyToId);fe&&(fe.__replies||(fe.__replies=[]),fe.__replies.push(z))}}),te.sort((z,fe)=>{const Me=x.account.id;return z.account.id===Me&&fe.account.id!==Me?-1:fe.account.id===Me&&z.account.id!==Me?1:0}),B.size;let D=1;function le(z,fe){const Me=fe+1;return Me>D&&(D=fe),z?.map(Le=>({id:Le.id,account:Le.account,repliesCount:Le.repliesCount,content:Le.content,weight:sn(Le),level:Me,replies:le(Le.__replies,Me)}))}const ve=te.map(z=>({id:z.id,account:z.account,accountID:z.account.id,descendant:!0,thread:z.account.id===x.account.id,weight:sn(z),level:1,replies:le(z.__replies,1),createdAt:z.createdAt}));return{allStatuses:[...N.map(z=>({id:z.id,ancestor:!0,isThread:Z,accountID:z.account.id,account:z.account,repliesCount:z.repliesCount,weight:sn(z),createdAt:z.createdAt})),{id:n,accountID:x.account.id,weight:sn(x),createdAt:x.createdAt},...ve],ancestorsIsThread:Z,mappedNestedDescendants:ve}},ee=({reloadHero:N}={})=>{T("loading");let oe;const x=In[n];if(x){const B=x.filter(Z=>E.statuses[L]);A(B)}else A([{id:n}]);return(async()=>{const B=()=>Hi(()=>v.v1.statuses.$select(n).fetch(),{retries:4}),Z=Hi(()=>v.v1.statuses.$select(n).context.fetch(),{retries:8}),te=!!I.statuses[L];let D=I.statuses[L];if(!(te&&!N))try{D=await B(),Qe(D,y),await new Promise(le=>{setTimeout(le,100)})}catch{T("error");return}try{const le=await Z,{ancestors:ve}=le;ne.current={...le,heroStatus:D};const{allStatuses:me,ancestorsIsThread:z,mappedNestedDescendants:fe}=Y(),Me=ve.length&&!z?[]:fe.filter(Xe=>Xe.thread),Le=(z?ve.length:0)+Me.length;Le>0&&Le<100&&$(Le+1),T("default"),G.current={offsetTop:M.current?.offsetTop,scrollTop:H.current?.scrollTop};const Ve=ve.length||0;Ve>=Ce&&Ae(Ve+1),A(me),In[n]=me,jo(D,y)}catch{T("error")}})(),q.current=Date.now(),()=>{clearTimeout(oe)}};W(ee,[n,v]),W(()=>{try{const{allStatuses:N}=Y();A(N)}catch{}},[j,Q]);const[ue,ae]=R(!1);W(()=>{let N=setInterval(()=>{const oe=Date.now();q.current&&oe-q.current>=6e4&&ae(!0)},6e4);return()=>{clearInterval(N)}},[]),yt(()=>{if(!k.length)return;const N=An[n];if(N)H.current.scrollTop=N;else if(G.current){const oe={offsetTop:M.current?.offsetTop,scrollTop:H.current?.scrollTop},x=oe.offsetTop-G.current.offsetTop+oe.scrollTop;H.current.scrollTop=x}else k.length===1&&(H.current.scrollTop=0);G.current=null},[k]),W(()=>{I.reloadStatusPage<=0||(async()=>{try{const{instanceURL:N}=yi(),oe=`https://${N}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(oe,{ignoreVary:!0}),ee({reloadHero:!0})}catch{}})()},[I.reloadStatusPage]),W(()=>()=>{An={},E.reloadStatusPage=0,In={},pi={},fi.clear()},[]);const J=I.statuses[L]||I.statuses[n],Ie=ke(()=>{if(!J)return"";const{account:N}=J,oe=document.createElement("div");return oe.innerHTML=N.displayName,oe.innerText.trim()},[J]),ye=ke(()=>{if(!J)return"";let N=On(J);return N.length>64&&(N=N.slice(0,64)+"…"),N},[J]);et(Ie&&ye?`${Ie}: "${ye}"`:s({id:"post.title"}),"/:instance?/s/:id");const be=ke(()=>{if(!J)return;const{url:N}=J;if(N)return URL.parse(N)?.hostname},[J]),Pe=ke(()=>{if(be)return be===y},[be,y]),[Ce,Ae]=R(bn),Te=ke(()=>k.length-Ce,[k.length,Ce]),De=k.some(N=>N.descendant),Oe=k.filter(N=>N.ancestor),[Fe,se]=R(!0),Ee=ke(()=>{if(!M.current||Fe)return null;const{top:N}=M.current.getBoundingClientRect();return N>0?"down":"up"},[Fe]);He("esc",()=>{location.hash=i},{enabled:!d,ignoreEventWhen:N=>!!document.querySelector("#modal-container > *")||N.metaKey||N.ctrlKey||N.altKey||N.shiftKey,useKey:!0}),He("backspace",()=>{location.hash=i},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),He("j",()=>{const N=document.activeElement.closest(".status-link, .status-focus"),oe=N?.getBoundingClientRect(),x=Array.from(H.current.querySelectorAll(vs));if(N&&oe.top0){const B=x.indexOf(N);let Z=x[B+1];Z&&(Z.focus(),Z.scrollIntoView(tn))}else{const B=x.find(Z=>{const te=Z.getBoundingClientRect();return te.top>=44&&te.left>=0});B&&(B.focus(),B.scrollIntoView(tn))}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),He("k",()=>{const N=document.activeElement.closest(".status-link, .status-focus"),oe=N?.getBoundingClientRect(),x=Array.from(H.current.querySelectorAll(vs));if(N&&oe.top0){const B=x.indexOf(N);let Z=x[B-1];Z&&(Z.focus(),Z.scrollIntoView(tn))}else{const B=x.find(Z=>{const te=Z.getBoundingClientRect();return te.top>=44&&te.left>=0});B&&(B.focus(),B.scrollIntoView(tn))}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey}),He("x",()=>{const N=document.activeElement.closest(".status-link, .status-focus");if(N){const oe=N.nextElementSibling;oe&&oe.tagName.toLowerCase()==="details"&&(oe.open=!oe.open)}},{useKey:!0,ignoreEventWhen:N=>N.metaKey||N.ctrlKey||N.altKey||N.shiftKey});const[$e,_e]=R(!1),K=F(d?"media+status":"status"),we=tt((N,oe,x,B)=>{N.preventDefault(),N.stopPropagation(),a({media:oe+1,mediaStatusID:B.id})},[n]),Re=tt((N,oe)=>{Tn(oe.id)},[]);W(()=>{let N;return l&&d&&(N=setTimeout(()=>{const oe=H.current?.querySelector(`.status-link[href*="/${l}"]`);oe&&oe.scrollIntoView(tn)},400)),()=>{clearTimeout(N)}},[l,d]);const Ne=tt((N,oe)=>{const{id:x,ancestor:B,isThread:Z,descendant:te,thread:D,replies:le,repliesCount:ve,weight:me,level:z}=N,fe=x===n;return e("li",{ref:fe?M:null,class:`${B?"ancestor":""} ${te?"descendant":""} ${D?"thread":""} ${fe?"hero":""}`,children:[fe?e(P,{children:[e(Ct,{threshold:.1,onChange:Le=>{queueMicrotask(()=>{requestAnimationFrame(()=>{se(Le)})})},class:"status-focus",tabIndex:0,children:e(Ye,{statusID:x,instance:y,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:f})}),C!=="loading"&&!w?e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"Vyeh4F"})}),e(pe,{to:gs?`/login?instance=${gs}&submit=1`:"/login",class:"button",children:e(h,{id:"sQia9P"})})]}):!b&&e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"j5roNG",values:{instance:y},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:C==="loading",onClick:()=>{T("loading"),(async()=>{try{const Le=await S.v2.search.list({q:J.url,type:"statuses",resolve:!0,limit:1});if(Le.statuses.length){const Ve=Le.statuses[0];location.hash=g?`/${g}/s/${Ve.id}`:`/s/${Ve.id}`}else throw new Error("No results")}catch(Le){T("default"),alert(s({id:"DnepCE",values:{e:Le}}))}})()},children:[e(_,{icon:"transfer"})," ",e(h,{id:"ejAVrO"})]})]})]}):e(Ed,{linkable:Z||B,to:y?`/${y}/s/${x}`:`/s/${x}`,onClick:()=>{Tn(x)},children:[oe===0&&B?e(Ct,{threshold:.5,onChange:Le=>{queueMicrotask(()=>{requestAnimationFrame(()=>{_e(Le)})})},children:e(Ye,{statusID:x,instance:y,withinContext:!0,size:D||B?"m":"s",enableTranslate:!0,onMediaClick:we,onStatusLinkClick:Re})}):e(Ye,{statusID:x,instance:y,withinContext:!0,size:D||B?"m":"s",enableTranslate:!0,onMediaClick:we,onStatusLinkClick:Re,showActionsBar:!!te}),B&&ve>1&&e("div",{class:"replies-link",children:[e(_,{icon:"comment2",alt:s({id:"N8UzTV"})})," ",e("span",{title:ve,children:Ze(ve)})]})," "]}),te&&le?.length>0&&e(To,{instance:y,replies:le,hasParentThread:D,level:z,accWeight:me,openAll:U.currentTn(x)}}),C==="loading"&&fe&&!!J?.repliesCount&&!De&&e("div",{class:"status-loading",children:e(Be,{abrupt:J.repliesCount>=3})}),C==="error"&&fe&&!!J?.repliesCount&&!De&&e("div",{class:"status-error",children:[e(h,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{E.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]},x)},[n,y,C,w,b,f,we,Re,De]),O=ke(()=>{if("navigation"in window&&navigation?.entries){const N=navigation.entries()[navigation.currentEntry.index-1];if(N?.url)return ys.test(N.url)}return ys.test(E.prevLocation?.pathname)},[L]),Se=ke(()=>{if(!Te)return[];const N=[];function oe(x){N.push(x.id),x.replies&&x.replies.forEach(oe)}return k.slice(Ce).forEach(oe),N.map(x=>ot(x,y))},[Te,k,Ce,y]);function Ue(N){if(N<12)return de._({id:"DqsEm+",values:{months:N}});{const oe=Math.floor(N/12);return de._({id:"24w+FD",values:{years:oe}})}}const ze=ke(()=>{const N=[],oe=k.slice(0,Ce);for(let x=0;x0){const Z=oe[x-1],{createdAt:te,descendant:D,thread:le,id:ve}=B;if(Z?.createdAt&&te){const me=Date.parse(te);if(isFinite(me)&&me>ws){const z=Date.parse(Z.createdAt);if(z&&isFinite(z)){const{ancestor:fe,id:Me}=Z,Ve=~~((me-z)/ws);Ve>0&&N.push(e("li",{style:{"--time-gap-range":Math.min(12,Ve)},class:`time-gap ${fe?"ancestor":""} ${D?"descendant":""} ${le?"thread":""}`,children:Ue(Ve)},`time-gap-${ve}-${Me}`))}}}}N.push(Ne(B,x))}return N},[k,Ce,Ne,j,Q]);return W(()=>{let N=setTimeout(()=>{if(!M.current)return;const oe=M.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");oe&&oe.click()},1e3);return()=>clearTimeout(N)},[n]),e(bc.Provider,{value:he,children:e("div",{tabIndex:"-1",ref:H,class:`status-deck deck contained ${k.length>1?"padded-bottom":""} ${K.current==="status"&&!r.current?"slide-in":""} ${u?`deck-view-${u}`:""} ${j?"edit-history-mode":""}`,style:j?{"--edit-history-percentage":`${Q/(V.current.length-1)}`}:void 0,onAnimationEnd:N=>{K.current==="status"&&(K.current=null)},children:[e("header",{class:`${C==="loading"?"loading":""}`,onDblClick:N=>{E.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[O&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(_,{icon:"chevron-left",size:"xl",alt:s({id:"iH8pgl"})})}),!Fe&&J&&C!=="loading"?e(P,{children:[e("span",{class:"hero-heading",children:[e(pt,{account:J.account,instance:y,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(bt,{datetime:J.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:N=>{N.preventDefault(),N.stopPropagation(),M.current.scrollIntoView({behavior:"smooth",block:"start"})},title:s({id:"NCy+Nw"}),children:e(_,{icon:Ee==="down"?"arrow-down":"arrow-up"})})]}):e(P,{children:[e(h,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:N=>{N.preventDefault(),N.stopPropagation(),H.current.scrollTo({top:0,behavior:"smooth"})},hidden:!Oe.length||$e,title:s({id:"R8CUl0",values:{0:Oe.length}}),children:[e(_,{icon:"arrow-up"}),Oe.filter((N,oe,x)=>x.findIndex(B=>B.accountID===N.accountID)===oe).slice(0,3).map(N=>e(ut,{url:N.account.avatarStatic||N.account.avatar,alt:N.account.displayName,squircle:N.account?.bot},N.account.id)),Oe.length>3&&e(P,{children:[" ",e("span",{class:"insignificant",children:Ze(Oe.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:u==="full"?"":"none"},onClick:()=>{m(null),c.delete("media"),c.delete("media-only"),c.delete("view"),a(c)},title:s({id:"+/xYEI"}),children:e(_,{icon:"layout4",size:"l"})}),ue&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{E.reloadStatusPage++,ae(!1)},children:e(_,{icon:"refresh",size:"l",alt:s({id:"lCF0wC"})})}),e(ct,{align:"end",portal:{target:H.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(_,{icon:"more",alt:s({id:"2FYpfJ"}),size:"xl"})}),children:[e(ge,{disabled:C==="loading",onClick:()=>{E.reloadStatusPage++},children:[e(_,{icon:"refresh"}),e("span",{children:e(h,{id:"lCF0wC"})})]}),e(ge,{className:"menu-switch-view",onClick:()=>{m(u==="full"?null:"full"),c.delete("media"),c.delete("media-only"),u==="full"?c.delete("view"):c.set("view","full"),a(c)},children:[e(_,{icon:{"":"layout5",full:"layout4"}[u||""]}),e("span",{children:s(u==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(ge,{onClick:()=>{Array.from(H.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(oe=>{oe.click()})},children:[e(_,{icon:"eye-open"})," ",e("span",{children:e(h,{id:"8r8KmB"})})]}),e(je,{}),e(Ii,{className:"plain",children:e(h,{id:"Rsjgm0"})}),e(ge,{disabled:!be||Pe,onClick:()=>{const N=pd(J.url);N?location.hash=N:alert(s({id:"9J6biQ"}))},children:[e(_,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:s(be?{id:"Kp9SAs",values:{0:zn.toUnicode(be)}}:{id:"lb07+k"})})]}),e(ge,{disabled:!b||C==="loading"||!J?.editedAt||!U.current,onClick:X,children:[e(_,{icon:"edit"}),e("span",{children:s({id:"OqaQnE"})})]})]}),e(pe,{class:"button plain deck-close",to:i,children:e(_,{icon:"x",size:"xl",alt:s({id:"yz7wBu"})})})]})]})}),e(_d,{}),k.length&&J?e("ul",{class:`timeline flat contextual grow ${C==="loading"?"loading":""}`,children:[ze,Te>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:C==="loading",onClick:()=>Ae(N=>N+bn),style:{marginBlockEnd:"6em"},"data-state-post-ids":Se.join(" "),children:[e("div",{class:"ib avatars-bunch",children:k.slice(Ce,Ce+5).map(N=>e(ut,{url:N.account.avatarStatic},N.id))})," ",e("div",{class:"ib",children:[e(h,{id:"uXRAkV"})," ",e("span",{class:"tag",children:Te>bn?`${bn}+`:Te})]})]})})]}):e(P,{children:[C==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(Ye,{skeleton:!0,size:"l"})})}),C==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{E.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]})]})})}function To({replies:n,instance:i,hasParentThread:o,level:s,accWeight:c,openAll:a,parentLink:p}){const{_:l}=ce(),[d,r]=gt(),u=T=>T.reduce((M,L)=>{const{repliesCount:U,replies:H}=L,j=H?.length||U;return M+j+u(H||[])},0),m=n.length+u(n),f=n.length===m,v=n.map(T=>T.account).filter((T,M,L)=>L.findIndex(U=>U.id===T.id)===M).slice(0,3),y=ke(()=>n?.reduce((T,M)=>T+M?.weight,c),[c,n?.length]);let S=!1;(a||y<=Td||!o&&m===1&&sn(n[0])<2)&&(S=!0);const g=pi[n[0].id],w=tt((T,M,L,U)=>{T.preventDefault(),T.stopPropagation(),r({media:M+1,mediaStatusID:U.id})},[]),b=F();yt(()=>{function T(M){M.target.dataset.scrollLeft=M.target.scrollLeft}return b.current?.addEventListener("scroll",T,{passive:!0}),()=>{b.current?.removeEventListener("scroll",T)}},[]);const[I,k]=R(g||S);W(()=>{let T;return!g&&!S&&(T=setTimeout(()=>k(!0),100)),()=>clearTimeout(T)},[g,S]);const A=S?"div":"details",C=A==="details";return e(A,{ref:b,class:"replies",open:C?g||S:void 0,onToggle:C?T=>{const{open:M}=T.target;pi[n[0].id]=M}:void 0,style:{"--comments-level":s},"data-comments-level":s,"data-comments-level-overflow":s>4,children:[!S&&e("summary",{class:"replies-summary",hidden:S,children:[e("span",{class:"avatars",children:v.map(T=>e(ut,{url:T.avatarStatic,title:`${T.displayName} @${T.username}`,squircle:T?.bot},T.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(h,{id:"DOQUen",values:{0:n.length,1:Ze(n.length)},components:{0:e("span",{title:n.length})}})}),!f&&m>1&&e(P,{children:[" ","·"," ",e("span",{children:e(h,{id:"qSQQSe",values:{0:Ze(m),totalComments:m},components:{0:e("span",{title:m})}})})]})]}),e(_,{icon:"chevron-down",class:"replies-summary-chevron"}),!!p&&e(pe,{class:"replies-parent-link",to:p.to,onClick:p.onClick,title:l({id:"ZlV82A"}),children:"»"})]}),I&&e("ul",{children:n.map(T=>e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(Ye,{statusID:T.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:w,showActionsBar:!0}),!T.replies?.length&&T.repliesCount>0&&e("div",{class:"replies-link",children:[e(_,{icon:"comment2",alt:l({id:"N8UzTV"})})," ",e("span",{title:T.repliesCount,children:Ze(T.repliesCount)})]})]}),T.replies?.length&&e(To,{instance:i,replies:T.replies,level:T.level,accWeight:S?y:T.weight,openAll:a,parentLink:{to:i?`/${i}/s/${T.id}`:`/s/${T.id}`,onClick:()=>{Tn(T.id)}}})]},T.id))})]})}const Ld=140,Md=35,$d=70,Nd=140,fi=new Map;function sn(n){const i=fi.get(n.id);if(i)return i;const{spoilerText:o,content:s,mediaAttachments:c,poll:a,card:p}=n,l=Fs(o+s),d=c?.length?Ld:0,r=(a?.options?.length||0)*Md,u=p&&(c?.length||a?.options?.length)?0:$d,f=(l+d+r+u)/Nd;return fi.set(n.id,f),f}const Pd=at(xd);function Dd(){const n=$t(),{id:i,instance:o}=n;return e(Pd,{id:i,instance:o})}const Od=""+new URL("boosts-carousel-BiOaNdMT.jpg",import.meta.url).href,zd=""+new URL("grouped-notifications-DFgwVVj3.jpg",import.meta.url).href,Bd=""+new URL("multi-column-ROck0NVt.jpg",import.meta.url).href,Fd=""+new URL("multi-hashtag-timeline-DH5INVHi.jpg",import.meta.url).href,Ud=""+new URL("nested-comments-thread-hv59kZLc.jpg",import.meta.url).href,Kd="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e",Hd={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:nn,PHANPY_WEBSITE:ks,PHANPY_PRIVACY_POLICY_URL:qd,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:Ss}=Hd,Cs=ks?ks.replace(/https?:\/\//g,"").replace(/\/$/,""):null,_s=`${"2025-09-17T13:51:06.398Z".slice(0,10).replace(/-/g,".")}.03ce4c6`;function xo(){const{_:n}=ce();return et(null,["/","/welcome"]),e("main",{id:"welcome",children:[e("div",{class:"hero-container",children:[e("div",{class:"hero-content",children:[e("h1",{children:[e("img",{src:Li,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:Kd,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(h,{id:"Ogtv0V"})}),e("p",{children:e(pe,{to:nn?`/login?instance=${nn}&submit=1`:"/login",class:"button",children:n(nn?{id:"sQia9P"}:{id:"ZLoGls"})})}),nn&&Ss&&e("p",{children:e("a",{href:Ss,class:"button plain5",children:e(h,{id:"e+RpCP"})})}),!nn&&e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(Cs||_s)&&e("p",{class:"app-site-version",children:e("small",{children:[Cs," ",_s]})}),e("p",{children:e(h,{id:"BskFI2",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank"}),1:e("a",{href:"https://mastodon.social/@cheeaun",target:"_blank",onClick:i=>{i.preventDefault(),E.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:qd,target:"_blank"})}})}),e("div",{children:e(Mi,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:Od,alt:n({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Tu+sCN"})}),e("p",{children:e(h,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:Ud,alt:n({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(h,{id:"cYE45+"})}),e("p",{children:e(h,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:zd,alt:n({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(h,{id:"4RRMre"})}),e("p",{children:e(h,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:Bd,alt:n({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(h,{id:"pEkad9"})}),e("p",{children:e(h,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:Fd,alt:n({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Wi1Ov0"})}),e("p",{children:e(h,{id:"tS2i+h"})})]})]})})]})}const jd=window.alert;window.__nativeAlert||(window.__nativeAlert=jd);window.alert=function(n){n instanceof Error&&n?.message&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=wc({text:n,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{i.hideToast()}});i.showToast()};window.__STATES__=E;window.__STATES_STATS__=()=>{const n=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],i={};n.forEach(c=>{i[c]=Object.keys(E[c]).length});const{statuses:o}=E,s=[];for(const c in o)document.querySelector(`[data-state-post-id~="${c}"], [data-state-post-ids~="${c}"]`)||s.push(c)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:n,unfurledLinks:i,notifications:o}=E;let s=0;const{instance:c}=ie();for(const a in n){if(!window.__IDLE__)break;try{const p=document.querySelector(`[data-state-post-id~="${a}"], [data-state-post-ids~="${a}"]`),l=o.some(d=>a===ot(d.status?.id,c));if(!p&&!l){delete E.statuses[a],delete E.statusQuotes[a];for(const d in i){const r=i[d];if(ot(r.id,r.instance)===a){delete E.unfurledLinks[d];break}}s++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const n in Ht)setTimeout(()=>{Array.isArray(Ht[n])?Ht[n][0]?.():typeof Ht[n]=="object"?Ht[n].module?.():Ht[n]?.()},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},s=Ks(i,3e3),c=()=>{window.__IDLE__=!1,s()};n.forEach(a=>{window.addEventListener(a,c,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",a=>{!a.relatedTarget&&!a.toElement&&i()},{passive:!0})})();const Yd=/iPad|iPhone|iPod/.test(navigator.userAgent);Yd&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=xe.local.get("theme");let o;if(i){if(o=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),o){const s=o.content,c=i==="light"?o.dataset.themeLightColorTemp:o.dataset.themeDarkColorTemp;o.content=c||"",setTimeout(()=>{o.content=s},10)}}else{const s=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(o=document.querySelector(`meta[name="theme-color"][media*="${s}"]`),o){const c=o.dataset.content,a=o.dataset.contentTemp;o.content=a||"",setTimeout(()=>{o.content=c},10)}}}});{const n=xe.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"dark light");const o=document.querySelector('meta[data-theme-setting="manual"]');o&&(o.name="theme-color",o.content=n==="light"?o.dataset.themeLightColor:o.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(c=>{c.name=""})}const i=xe.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}Ts(E,n=>{for(const[i,o,s,c]of n){if(o.join(".")==="settings.shortcutsViewMode"){const a=document.getElementById("app");a&&(a.dataset.shortcutsViewMode=E.shortcuts?.length?s:"")}o.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",s)}});const wn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};document.body.classList.toggle("exp-tab-bar-v2",xe.local.get("experiments-tabBarV2")??!1);function Vd(){const[n,i]=R(!1),[o,s]=R("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),ce(),W(()=>{const a=xe.local.get("instanceURL"),p=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(p){window.history.replaceState({},document.title,window.location.pathname||"/");const{client_id:l,client_secret:d,vapid_key:r}=Ls(a)||{},u=En(a)||r,m=xe.sessionCookie.get("codeVerifier");(async()=>{s("loading");const{access_token:f}=await Xc({instanceURL:a,client_id:l,client_secret:d,code:p,code_verifier:m||void 0});if(f){const v=Yo({instance:a,accessToken:f});await Promise.allSettled([Gn(v),Wn(v,a),Vo(v,a,f,u)]),Fi(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),s("default")}else s("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const l=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let d;if(l&&(d=Go(l),d&&(xn(d.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),d||(d=yi()),d){xn(d.info.id);const{client:r}=ie({account:d}),{instance:u}=r;Fi(),s("loading"),(async()=>{try{Wo()&&Zo(u)?(Gn(r),Wn(r,u)):await Promise.allSettled([Gn(r),Wn(r,u)])}catch{}finally{i(!0),s("default"),__BENCHMARK.end("app-init")}})()}else s("default"),__BENCHMARK.end("app-init")}xe.sessionCookie.del("clientID"),xe.sessionCookie.del("clientSecret"),xe.sessionCookie.del("codeVerifier")},[]);let c=Jt();return E.currentLocation=c.pathname,W(li,[c,n]),/\/https?:/.test(c.pathname)?e(fd,{}):o==="loading"?e(Be,{id:"loader-root"}):e(P,{children:[e(Wd,{isLoggedIn:n}),e(Zd,{isLoggedIn:n}),e(wi,{children:e(We,{path:"/:instance?/s/:id",element:e(Dd,{})})}),n&&e(Ic,{}),n&&e(Or,{}),e(Tr,{}),n&&e(Lr,{}),e(Cc,{isLoggedIn:n}),e(Pr,{onClose:li}),e(Ac,{})]})}function Gd({isLoggedIn:n}){return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(ud,{}):e(xo,{})}const Wd=at(({isLoggedIn:n})=>{const i=Jt(),o=ke(()=>{const{pathname:s}=i;return!/^\/(login|welcome|_sandbox)/i.test(s)},[i]);return e(wi,{location:o||i,children:[e(We,{path:"/",element:e(Gd,{isLoggedIn:n})}),e(We,{path:"/login",element:e(bd,{})}),e(We,{path:"/welcome",element:e(xo,{})}),void 0]})});function Is(){return E.prevLocation||null}function Zd({isLoggedIn:n}){const i=Jt(),o=F(Is());return ke(()=>on("/:instance/s/:id",i.pathname)||on("/s/:id",i.pathname),[i.pathname,on])?o.current||(o.current=Is()):o.current=null,e(wi,{location:o.current||i,children:[n&&e(P,{children:[e(We,{path:"/notifications",element:e(So,{})}),e(We,{path:"/mentions",element:e(vo,{})}),e(We,{path:"/following",element:e(zi,{})}),e(We,{path:"/b",element:e(ro,{})}),e(We,{path:"/f",element:e(lo,{})}),e(We,{path:"/l",children:[e(We,{index:!0,element:e(md,{})}),e(We,{path:":id",element:e(po,{})})]}),e(We,{path:"/fh",element:e(xl,{})}),e(We,{path:"/sp",element:e(kd,{})}),e(We,{path:"/ft",element:e(_l,{})}),e(We,{path:"/catchup",element:e(hl,{})}),e(We,{path:"/annual_report/:year",element:e(sl,{})})]}),e(We,{path:"/:instance?/t/:hashtag",element:e(ho,{})}),e(We,{path:"/:instance?/a/:id",element:e(el,{})}),e(We,{path:"/:instance?/p",children:[e(We,{index:!0,element:e(hi,{})}),e(We,{path:"l",element:e(hi,{local:!0})})]}),e(We,{path:"/:instance?/trending",element:e(Io,{})}),e(We,{path:"/:instance?/search",element:e(Co,{})})]})}Xo();Jo(e(Qo,{i18n:de,children:e(ec,{children:e(Vd,{})})}),document.getElementById("app"));setTimeout(()=>{try{Object.keys(localStorage).forEach(n=>{n.startsWith("iconify")&&localStorage.removeItem(n)}),Object.keys(sessionStorage).forEach(n=>{n.startsWith("iconify")&&sessionStorage.removeItem(n)}),localStorage.removeItem("settings:boostsCarousel")}catch{}},5e3);if("serviceWorker"in navigator&&typeof caches<"u"){const i=["icons"];let o=!1;const s=1e4,c=60*60*1e3;async function a(){if(window.__IDLE__)try{const p=await caches.keys();for(const l of p){if(i.includes(l))continue;const d=await caches.open(l),r=await d.keys();if(r.length>50){const u=r.slice(50);for(const m of u)await d.delete(m)}}o=!0}catch{}setTimeout(a,o?c:s)}setTimeout(a,s)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")}; //# sourceMappingURL=main-sFlLDyhh.js.map