35 lines
300 KiB
JavaScript
35 lines
300 KiB
JavaScript
import{A as Y,y as ie,M as lt,u as ue,h as E,s as A,a as ce,b as Qe,p as gt,c as Ve,q as st,g as yt,d as e,k as z,T as f,e as ve,f as Et,i as Cn,j as Ce,L as go,C as Nn,D as bo,m as vo,n as Gn,o as Zt,r as he,t as yo,v as Ue,w as _n,x as Ti,_ as wt,z as hs,B as yd,E as fs,F as ps,G as wo,H as ko,I as at,J as So,K as si,N as Co,O as bt,P as _o,Q as Io,R as oi,S as Lt,U as tt,V as ms,W as gs,X as To,Y as nn,Z as xo,$ as Ao,a0 as On,a1 as zn,a2 as Ro,a3 as xi,a4 as Eo,a5 as Lo,a6 as Mo,a7 as ci,a8 as Ge,a9 as $o,aa as Do,ab as Po,ac as No}from"./useTitle-C_BZYcuR.js";import{u as ai,a as Fe,s as pe,o as Ai,b as Oo,J as bs,c as vs,I as T,C as ri,d as ys,M as qe,e as Ke,S as an,f as ye,g as Ln,R as It,n as ot,h as He,A as ft,N as mt,i as rt,j as ut,L as ge,l as At,k as ws,m as et,t as Ri,p as kd,q as it,r as rn,v as ht,w as Kn,x as ks,E as Ss,y as Je,z as Ei,T as Cs,B as pt,D as li,F as je,G as _t,H as zo,K as Uo,O as Pt,P as di,Q as _s,U as Bo,V as jt,W as Fo,X as Ho,Y as Is,Z as qo,_ as Nt,$ as jo,a0 as Ts,a1 as xs,a2 as Yo,a3 as As,a4 as Vo,a5 as Go,a6 as Ko,a7 as Zo,a8 as Wo,a9 as Li,aa as Xo,ab as Bt}from"./ScheduledAtField-ely_oZde.js";var Rs=Jo;function Jo(n,i,s){var o=null,c=null,r=function(){o&&(clearTimeout(o),c=null,o=null)},h=function(){var l=c;r(),l&&l()},d=function(){if(!i)return n.apply(this,arguments);var l=this,a=arguments,p=s&&!o;if(r(),c=function(){n.apply(l,a)},o=setTimeout(function(){if(o=null,!p){var b=c;return c=null,b()}},i),p)return c()};return d.cancel=r,d.flush=h,d}/*!
|
||
* swiped-events.js - v@version@
|
||
* Pure JavaScript swipe events
|
||
* https://github.com/john-doherty/swiped-events
|
||
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
|
||
* @author John Doherty <www.johndoherty.info>
|
||
* @license MIT
|
||
*/(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(g,u){u=u||{bubbles:!1,cancelable:!1,detail:void 0};var v=i.createEvent("CustomEvent");return v.initCustomEvent(g,u.bubbles,u.cancelable,u.detail),v},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",p,!1),i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",a,!1);var s=null,o=null,c=null,r=null,h=null,d=null,l=0;function a(g){if(d===g.target){var u=parseInt(m(d,"data-swipe-threshold","20"),10),v=m(d,"data-swipe-unit","px"),y=parseInt(m(d,"data-swipe-timeout","500"),10),w=Date.now()-h,S="",_=g.changedTouches||g.touches||[];if(v==="vh"&&(u=Math.round(u/100*i.documentElement.clientHeight)),v==="vw"&&(u=Math.round(u/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(r)?Math.abs(c)>u&&w<y&&(c>0?S="swiped-left":S="swiped-right"):Math.abs(r)>u&&w<y&&(r>0?S="swiped-up":S="swiped-down"),S!==""){var k={dir:S.replace(/swiped-/,""),touchType:(_[0]||{}).touchType||"direct",fingers:l,xStart:parseInt(s,10),xEnd:parseInt((_[0]||{}).clientX||-1,10),yStart:parseInt(o,10),yEnd:parseInt((_[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:k})),d.dispatchEvent(new CustomEvent(S,{bubbles:!0,cancelable:!0,detail:k}))}s=null,o=null,h=null}}function p(g){g.target.getAttribute("data-swipe-ignore")!=="true"&&(d=g.target,h=Date.now(),s=g.touches[0].clientX,o=g.touches[0].clientY,c=0,r=0,l=g.touches.length)}function b(g){if(!(!s||!o)){var u=g.touches[0].clientX,v=g.touches[0].clientY;c=s-u,r=o-v}}function m(g,u,v){for(;g&&g!==i.documentElement;){var y=g.getAttribute(u);if(y)return y;g=g.parentNode}return v}})(window,document);function Yt(n=()=>{},i=[]){const s=Y(n);ie(()=>{s.current=n},[i]),ie(()=>{const o=()=>{const c=document.hidden||document.visibilityState==="hidden";s.current(!c)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}const Qo=1e3*3,Mi=2e4,ec=lt(function({isLoggedIn:i}){const{_:s}=ue(),[o,c]=E(!0),r=Y();Yt(a=>{clearTimeout(r.current),a?c(!0):r.current=setTimeout(()=>{c(!1)},Mi)});const h=async(a,p,b)=>{var m;if(A.notificationsLast){const g=a.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:u}=await g.next();if(u!=null&&u.length)if(b)A.notificationsShowNew=!0;else{let v;try{const y=await a.v1.markers.fetch({timeline:"notifications"});v=(m=y==null?void 0:y.notifications)==null?void 0:m.lastReadId}catch{}v?A.notificationsShowNew=u[0].id!==v:A.notificationsShowNew=!0}}};ie(()=>{let a,p,b;if(i&&o){const{masto:m,streaming:g,instance:u}=ce();(async()=>{await h(m,u);let v=!1;g&&(p=setTimeout(()=>{(async()=>{try{v=!0,a=g.user.notification.subscribe();for await(const y of a){if(!a||!o)break;y.event==="notification"&&Qe(y.payload,u,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{v=!1}v||(b=setInterval(()=>{h(m,u,!0)},Mi))})()},Qo))})()}return()=>{var m;(m=a==null?void 0:a.unsubscribe)==null||m.call(a),a=null,clearTimeout(p),clearInterval(b)}},[o,i]);const d=Y(),l=()=>{d.current=Date.now(),fetch("./version.json").then(a=>a.json()).then(a=>{a&&(A.appVersion=a)}).catch(a=>{})};return ai(l,o&&1e3*60*30),Yt(a=>{a&&(d.current?Date.now()-d.current>1e3*60*60&&l():l())}),Fe("shift+alt+k",()=>{const a=A.settings.cloakMode;A.settings.cloakMode=!a,pe({text:s(a?{id:"oguMwa"}:{id:"IXZLPs"})})}),null}),tc=gt(async(n,i)=>{const s=n.v1.accounts.$select(i).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}),{value:o}=await s.next();return o||[]},{maxAge:6e4});function nc(){const{_:n}=ue(),i=Ve(A),{masto:s}=ce(),[o,c]=E(!1),[r,h]=E([]),[d,l]=E(!1),a=Y(null),p=Y(null);function b(v){if(i.composerState.minimized){A.composerState.minimized=!1,Ai();return}v.shiftKey?Oo()||(A.showCompose=!0):(Ai(),A.showCompose=!0)}Fe("c, shift+c",b,{ignoreEventWhen:v=>!!document.querySelector("#modal-container > *")});const m=bs(()=>{c(!0)},{threshold:600}),g=st(async()=>{try{l(!0);const v=yt();if(!v)return;const y=await tc(s,v);h(y)}catch{}finally{l(!1)}},[s]),u=st(v=>{vs({replyToStatus:v}),c(!1)},[]);return ie(()=>{o&&g()},[g,o]),e(z,{children:[e("button",{ref:a,type:"button",id:"compose-button",onClick:b,onContextMenu:v=>{v.preventDefault(),c(!0)},...m(),class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(T,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})}),e(ri,{ref:p,state:o?"open":void 0,anchorRef:a,onClose:()=>c(!1),direction:"top",gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:ys(),containerProps:{style:{zIndex:19},onClick:()=>{var v,y;(y=(v=p.current)==null?void 0:v.closeMenu)==null||y.call(v)}},submenuOpenDelay:600,children:[e(qe,{to:"/sp",children:[e(T,{icon:"schedule"})," ",e("span",{children:e(f,{id:"+GkIdc"})})]}),e(Ke,{}),e(an,{align:"end",direction:"top",shift:-8,disabled:d||r.length===0,label:e(z,{children:[e(T,{icon:"comment"})," ",e("span",{className:"menu-grow",children:e(f,{id:"LwOr4P"})}),d?"…":e(T,{icon:"chevron-right"})]}),children:r.length>0&&r.map(v=>{const y=new Date(v.createdAt),w=new Date().getTime()-y.getTime()<864e5;return e(ye,{onClick:()=>u(v),children:e("small",{children:[e("div",{class:"menu-post-text",children:Ln(v)}),e("span",{className:"more-insignificant",children:[w&&e(z,{children:[e(It,{datetime:y,format:"micro"})," ","‒"," "]}),e("time",{className:"created",dateTime:y.toISOString(),title:y.toLocaleString(),children:ot(v.createdAt)})]})]})},v.id)})})]})]})}const ic=lt(function(){const{_:i}=ue(),s=Ve(A);function o(){A.showKeyboardShortcutsHelp=!1}return Fe("?, shift+?, shift+slash",c=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:c=>/\/catchup/i.test(location.hash)}),!!s.showKeyboardShortcutsHelp&&e(He,{onClose:o,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{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(f,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(f,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e(f,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(f,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(f,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(f,{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(f,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(f,{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(f,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(f,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(f,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(f,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:c,className:r,keys:h})=>e("tr",{children:[e("th",{class:r,children:c}),e("td",{children:h})]},c))})})})]})})}),Es=new Set,ct=new WeakMap,Vt=new WeakMap,Ot=new WeakMap,Zn=new WeakMap,sc=new WeakMap,Gt=new WeakMap,In=new WeakMap,en=new WeakSet;let Rt,ui=0,hi=0;const St="__aa_tgt",sn="__aa_del",Tn="__aa_new",oc=n=>{const i=uc(n);i&&i.forEach(s=>hc(s))},cc=n=>{n.forEach(i=>{i.target===Rt&&rc(),ct.has(i.target)&&zt(i.target)})};function ac(n){const i=Zn.get(n);i==null||i.disconnect();let s=ct.get(n),o=0;const c=5;s||(s=Kt(n),ct.set(n,s));const{offsetWidth:r,offsetHeight:h}=Rt,l=[s.top-c,r-(s.left+c+s.width),h-(s.top+c+s.height),s.left-c].map(p=>`${-1*Math.floor(p)}px`).join(" "),a=new IntersectionObserver(()=>{++o>1&&zt(n)},{root:Rt,threshold:1,rootMargin:l});a.observe(n),Zn.set(n,a)}function zt(n){clearTimeout(In.get(n));const i=Mn(n),s=on(i)?500:i.duration;In.set(n,setTimeout(async()=>{const o=Ot.get(n);try{await(o==null?void 0:o.finished),ct.set(n,Kt(n)),ac(n)}catch{}},s))}function rc(){clearTimeout(In.get(Rt)),In.set(Rt,setTimeout(()=>{Es.forEach(n=>Ds(n,i=>Ls(()=>zt(i))))},100))}function lc(n){setTimeout(()=>{sc.set(n,setInterval(()=>Ls(zt.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function Ls(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Wn,qt;const dc=typeof window<"u"&&"ResizeObserver"in window;dc&&(Rt=document.documentElement,Wn=new MutationObserver(oc),qt=new ResizeObserver(cc),window.addEventListener("scroll",()=>{hi=window.scrollY,ui=window.scrollX}),qt.observe(Rt));function uc(n){return n.reduce((o,c)=>[...o,...Array.from(c.addedNodes),...Array.from(c.removedNodes)],[]).every(o=>o.nodeName==="#comment")?!1:n.reduce((o,c)=>{if(o===!1)return!1;if(c.target instanceof Element){if(Un(c.target),!o.has(c.target)){o.add(c.target);for(let r=0;r<c.target.children.length;r++){const h=c.target.children.item(r);if(h){if(sn in h)return!1;Un(c.target,h),o.add(h)}}}if(c.removedNodes.length)for(let r=0;r<c.removedNodes.length;r++){const h=c.removedNodes[r];if(sn in h)return!1;h instanceof Element&&(o.add(h),Un(c.target,h),Vt.set(h,[c.previousSibling,c.nextSibling]))}}return o},new Set)}function Un(n,i){!i&&!(St in n)?Object.defineProperty(n,St,{value:n}):i&&!(St in i)&&Object.defineProperty(i,St,{value:n})}function hc(n){var i;const s=n.isConnected,o=ct.has(n);s&&Vt.has(n)&&Vt.delete(n),Ot.has(n)&&((i=Ot.get(n))===null||i===void 0||i.cancel()),Tn in n?$i(n):o&&s?pc(n):o&&!s?mc(n):$i(n)}function vt(n){return Number(n.replace(/[^0-9.\-]/g,""))}function fc(n){let i=n.parentElement;for(;i;){if(i.scrollLeft||i.scrollTop)return{x:i.scrollLeft,y:i.scrollTop};i=i.parentElement}return{x:0,y:0}}function Kt(n){const i=n.getBoundingClientRect(),{x:s,y:o}=fc(n);return{top:i.top+o,left:i.left+s,width:i.width,height:i.height}}function Ms(n,i,s){let o=i.width,c=i.height,r=s.width,h=s.height;const d=getComputedStyle(n);if(d.getPropertyValue("box-sizing")==="content-box"){const a=vt(d.paddingTop)+vt(d.paddingBottom)+vt(d.borderTopWidth)+vt(d.borderBottomWidth),p=vt(d.paddingLeft)+vt(d.paddingRight)+vt(d.borderRightWidth)+vt(d.borderLeftWidth);o-=p,r-=p,c-=a,h-=a}return[o,r,c,h].map(Math.round)}function Mn(n){return St in n&&Gt.has(n[St])?Gt.get(n[St]):{duration:250,easing:"ease-in-out"}}function $s(n){if(St in n)return n[St]}function fi(n){const i=$s(n);return i?en.has(i):!1}function Ds(n,...i){i.forEach(s=>s(n,Gt.has(n)));for(let s=0;s<n.children.length;s++){const o=n.children.item(s);o&&i.forEach(c=>c(o,Gt.has(o)))}}function pi(n){return Array.isArray(n)?n:[n]}function on(n){return typeof n=="function"}function pc(n){const i=ct.get(n),s=Kt(n);if(!fi(n))return ct.set(n,s);let o;if(!i)return;const c=Mn(n);if(typeof c!="function"){const r=i.left-s.left,h=i.top-s.top,[d,l,a,p]=Ms(n,i,s),b={transform:`translate(${r}px, ${h}px)`},m={transform:"translate(0, 0)"};d!==l&&(b.width=`${d}px`,m.width=`${l}px`),a!==p&&(b.height=`${a}px`,m.height=`${p}px`),o=n.animate([b,m],{duration:c.duration,easing:c.easing})}else{const[r]=pi(c(n,"remain",i,s));o=new Animation(r),o.play()}Ot.set(n,o),ct.set(n,s),o.addEventListener("finish",zt.bind(null,n))}function $i(n){Tn in n&&delete n[Tn];const i=Kt(n);ct.set(n,i);const s=Mn(n);if(!fi(n))return;let o;if(typeof s!="function")o=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:s.duration*1.5,easing:"ease-in"});else{const[c]=pi(s(n,"add",i));o=new Animation(c),o.play()}Ot.set(n,o),o.addEventListener("finish",zt.bind(null,n))}function Di(n,i){var s;n.remove(),ct.delete(n),Vt.delete(n),Ot.delete(n),(s=Zn.get(n))===null||s===void 0||s.disconnect(),setTimeout(()=>{if(sn in n&&delete n[sn],Object.defineProperty(n,Tn,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const o in i)n.style[o]=""},0)}function mc(n){var i;if(!Vt.has(n)||!ct.has(n))return;const[s,o]=Vt.get(n);Object.defineProperty(n,sn,{value:!0,configurable:!0});const c=window.scrollX,r=window.scrollY;if(o&&o.parentNode&&o.parentNode instanceof Element?o.parentNode.insertBefore(n,o):s&&s.parentNode?s.parentNode.appendChild(n):(i=$s(n))===null||i===void 0||i.appendChild(n),!fi(n))return Di(n);const[h,d,l,a]=bc(n),p=Mn(n),b=ct.get(n);(c!==ui||r!==hi)&&gc(n,c,r,p);let m,g={position:"absolute",top:`${h}px`,left:`${d}px`,width:`${l}px`,height:`${a}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!on(p))Object.assign(n.style,g),m=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:p.duration,easing:"ease-out"});else{const[u,v]=pi(p(n,"remove",b));(v==null?void 0:v.styleReset)!==!1&&(g=(v==null?void 0:v.styleReset)||g,Object.assign(n.style,g)),m=new Animation(u),m.play()}Ot.set(n,m),m.addEventListener("finish",Di.bind(null,n,g))}function gc(n,i,s,o){const c=ui-i,r=hi-s,h=document.documentElement.style.scrollBehavior;if(getComputedStyle(Rt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+c,window.scrollY+r),!n.parentElement)return;const l=n.parentElement;let a=l.clientHeight,p=l.clientWidth;const b=performance.now();function m(){requestAnimationFrame(()=>{if(!on(o)){const g=a-l.clientHeight,u=p-l.clientWidth;b+o.duration>performance.now()?(window.scrollTo({left:window.scrollX-u,top:window.scrollY-g}),a=l.clientHeight,p=l.clientWidth,m()):document.documentElement.style.scrollBehavior=h}})}m()}function bc(n){const i=ct.get(n),[s,,o]=Ms(n,i,Kt(n));let c=n.parentElement;for(;c&&(getComputedStyle(c).position==="static"||c instanceof HTMLBodyElement);)c=c.parentElement;c||(c=document.body);const r=getComputedStyle(c),h=ct.get(c)||Kt(c),d=Math.round(i.top-h.top)-vt(r.borderTopWidth),l=Math.round(i.left-h.left)-vt(r.borderLeftWidth);return[d,l,s,o]}function Ps(n,i={}){return Wn&&qt&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!on(i)&&!i.disrespectUserMotionPreference||(en.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),Ds(n,zt,lc,c=>qt==null?void 0:qt.observe(c)),on(i)?Gt.set(n,i):Gt.set(n,{duration:250,easing:"ease-in-out",...i}),Wn.observe(n,{childList:!0}),Es.add(n))),Object.freeze({parent:n,enable:()=>{en.add(n)},disable:()=>{en.delete(n)},isEnabled:()=>en.has(n)})}function mi(n){const i=Y(null),[s,o]=E(),c=r=>{s&&(r?s.enable():s.disable())};return ie(()=>{i.current instanceof HTMLElement&&o(Ps(i.current,n||{}))},[]),[i,c]}const vc=window.matchMedia("(display-mode: standalone)").matches;function yc({onClose:n}){const{_:i}=ue(),{masto:s}=ce(),o=ve.local.getJSON("accounts"),c=yt(),r=o.length>1,[h,d]=Et(a=>a+1,0),[l]=mi();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(f,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:l,children:o.map((a,p)=>{const b=a.info.id===c,m=p===0;return e("li",{children:[e("div",{children:[r&&e("span",{class:`current ${b?"is-current":""}`,children:e(T,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(ft,{url:a.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(b)try{const g=await s.v1.accounts.$select(a.info.id).fetch();a.info=g,ve.local.setJSON("accounts",o),d()}catch{}}}),e(mt,{account:r?{...a.info,acct:/@/.test(a.info.acct)?a.info.acct:`${a.info.acct}@${a.instanceURL}`}:a.info,showAcct:!0,onClick:()=>{b?A.showAccount=`${a.info.username}@${a.instanceURL}`:(Cn(a.info.id),location.reload())}})]}),e("div",{class:"actions",children:[m&&r&&e(z,{children:[e("span",{class:"tag",children:e(f,{id:"ovBPCi"})})," "]}),e(rt,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[r&&e(z,{children:[e(ye,{disabled:b,onClick:()=>{Cn(a.info.id),location.reload()},children:[e(T,{icon:"transfer"})," ",e(f,{id:"3t/Nrv"})]}),!vc&&!b&&e(qe,{href:`./?account=${a.info.id}`,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(f,{id:"PZgZtY"})})]}),e(Ke,{})]}),e(ye,{onClick:()=>{A.showAccount=`${a.info.username}@${a.instanceURL}`},children:[e(T,{icon:"user"}),e("span",{children:e(f,{id:"40z2Fm"})})]}),e(Ke,{}),r&&e(ye,{disabled:m,onClick:()=>{o.splice(p,1),o.unshift(a),ve.local.setJSON("accounts",o),d()},children:[e(T,{icon:"check-circle"}),e("span",{children:e(f,{id:"PPcets"})})]}),e(ut,{subMenu:!0,confirmLabel:e(z,{children:[e(T,{icon:"exit"}),e("span",{children:e(f,{id:"k08LxG",values:{0:a.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!b,menuItemClassName:"danger",onClick:()=>{o.splice(p,1),ve.local.setJSON("accounts",o),location.href=location.pathname||"/"},children:[e(T,{icon:"exit"}),e("span",{children:e(f,{id:"CXk1bI"})})]})]})]})]},a.info.id)})}),e("p",{children:e(ge,{to:"/login",class:"button plain2",onClick:n,children:[e(T,{icon:"plus"})," ",e("span",{children:e(f,{id:"Is7/PB"})})]})}),r&&e("p",{children:e("small",{children:e(f,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const gi="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",wc={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function bi(){const{i18n:n}=ue(),i=Ce(()=>go.map(s=>{var h,d;const o=wc[s]||s.replace(/-[a-z]+$/i,""),c=At({code:o,locale:s,fallback:(h=Nn.find(l=>l.code===s))==null?void 0:h.nativeName}),r=At({code:o,locale:n.locale,fallback:(d=Nn.find(l=>l.code===s))==null?void 0:d.name});return{code:s,regionlessCode:o,_common:r,native:c}}).sort((s,o)=>{const c=s._common.localeCompare(o._common,n.locale);return c!==0?c:s.code<o.code?-1:s.code>o.code?1:0}),[]);return e("label",{class:"lang-selector",children:["🌐"," ",e("select",{class:"small",value:n.locale||bo,onChange:s=>{ve.local.set("lang",s.target.value),vo(s.target.value)},children:[i.map(({code:s,regionlessCode:o,native:c})=>{var d;const r=At({code:o,locale:n.locale,fallback:(d=Nn.find(l=>l.code===s))==null?void 0:d.name});return e("option",{value:s,"data-regionless-code":o,children:!!r&&r!==c?`${c} - ${r}`:c},s)}),void 0]})]})}function Pi(n){const{masto:i}=ce();return i.v1.push.subscription.create(n)}function kc(){const{masto:n}=ce();return n.v1.push.subscription.fetch()}function Sc(n){const{masto:i}=ce();return i.v1.push.subscription.update(n)}function Cc(){const{masto:n}=ce();return n.v1.push.subscription.remove()}function $n(){return"serviceWorker"in navigator&&"PushManager"in window}function _c(){return navigator.serviceWorker.getRegistration()}async function vi(){const n=await _c(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function Ns(n){const i="=".repeat((4-n.length%4)%4),s=`${n}${i}`.replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(s),c=new Uint8Array(o.length);for(let r=0;r<o.length;++r)c[r]=o.charCodeAt(r);return c}async function Ic(){if(!$n())return;const{subscription:n}=await vi();let i=null;try{i=await kc()}catch(s){if(!/(not found|unknown)/i.test(s.message))throw s}if(i&&n){const s=i.endpoint===n.endpoint,o=Gn(),c=i.serverKey===o;if(!s)throw new Error("Backend subscription endpoint changed");if(!c)throw new Error("Backend subscription key and vapid key changed")}if(n&&!i){const s=Gn();if(s){const{applicationServerKey:o}=n.options,c=Ns(s).toString(),r=new Uint8Array(o).toString();if(!(c===r))throw await n.unsubscribe(),new Error("Subscription key and vapid key changed")}}return{subscription:n,backendSubscription:i}}async function Ni({data:n,policy:i}){if(!$n())return;let{registration:s,subscription:o}=await vi(),c=null;if(o)try{c=await Sc({data:n,policy:i})}catch{c=await Pi({subscription:o,data:n,policy:i})}else{const r=Gn();if(!r)throw new Error("No server key found");o=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ns(r)}),c=await Pi({subscription:o,data:n,policy:i})}return{subscription:o,backendSubscription:c}}async function Oi(){if(!$n())return;const{subscription:n}=await vi();n&&(await Cc(),await n.unsubscribe())}const Tc={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},zi=16,Dt=[14,15,16,17,18,19,20],{PHANPY_WEBSITE:Ui,PHANPY_PRIVACY_POLICY_URL:xc,PHANPY_IMG_ALT_API_URL:Ac,PHANPY_GIPHY_API_KEY:Rc}=Tc;function Ec({onClose:n}){const{_:i}=ue(),s=Ve(A),o=ve.local.get("theme")||"auto",c=Y(),r=s.settings.contentTranslationTargetLanguage||null,h=ws(),d=At(h),l=ve.local.get("textSize")||zi,[a,p]=E(ve.account.get("preferences")||{}),{masto:b,authenticated:m,instance:g}=ce();return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${l}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(f,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:c,onInput:u=>{u.preventDefault();const y=new FormData(c.current).get("theme"),w=document.documentElement;if(y==="auto"){w.classList.remove("is-light","is-dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(k=>{k.name="theme-color"})}else{w.classList.toggle("is-light",y==="light"),w.classList.toggle("is-dark",y==="dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name="theme-color",S.content=y==="light"?S.dataset.themeLightColor:S.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(k=>{k.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",y==="auto"?"dark light":y),y==="auto"?ve.local.del("theme"):ve.local.set("theme",y)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:o==="light"}),e("span",{children:e(f,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:o==="dark"}),e("span",{children:e(f,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:o!=="light"&&o!=="dark"}),e("span",{children:e(f,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(f,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:Dt[0]},children:e(f,{id:"J6ypuD"})})," ",e("input",{type:"range",min:Dt[0],max:Dt[Dt.length-1],step:"1",value:l,list:"sizes",onChange:u=>{const v=parseInt(u.target.value,10);document.documentElement.style.setProperty("--text-size",`${v}px`),v===zi?ve.local.del("textSize"):ve.local.set("textSize",u.target.value)}})," ",e("span",{style:{fontSize:Dt[Dt.length-1]},children:e(f,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:Dt.map(u=>e("option",{value:u}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(f,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener",children:e(f,{id:"FFmj1D"})})})]}),e(bi,{})]})]})}),m&&e(z,{children:[e("h3",{children:e(f,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(f,{id:"NAjVvt"})," ",e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:a["posting:default:visibility"]||"public",onChange:u=>{const{value:v}=u.target;(async()=>{try{await b.v1.accounts.updateCredentials({source:{privacy:v}}),p({...a,"posting:default:visibility":v}),ve.account.set("preferences",{...a,"posting:default:visibility":v})}catch{alert(i({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(f,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(f,{id:"WDcQq9"})}),e("option",{value:"private",children:e(f,{id:"o34OrG"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(f,{id:"xlsg7n",values:{instance:g},components:{0:e("a",{href:`https://${g}/`,target:"_blank",rel:"noopener"})}})})]})]}),e("h3",{children:e(f,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.autoRefresh,onChange:u=>{A.settings.autoRefresh=u.target.checked}})," ",e(f,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.boostsCarousel,onChange:u=>{A.settings.boostsCarousel=u.target.checked}})," ",e(f,{id:"TSbnoW"})]})}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslation,onChange:u=>{const{checked:v}=u.target;A.settings.contentTranslation=v,v||(A.settings.contentTranslationTargetLanguage=null)}})," ",e(f,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${s.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(f,{id:"zXCa9e"})," ",e("select",{value:r||"",disabled:!s.settings.contentTranslation,style:{width:"10em"},onChange:u=>{A.settings.contentTranslationTargetLanguage=u.target.value||null},children:[e("option",{value:"",children:e(f,{id:"jNCSyx",values:{systemTargetLanguageText:d}})}),e("option",{disabled:!0,children:"──────────"}),Ri.map(u=>{const v=At({code:u.code,fallback:u.name}),y=At({code:u.code,locale:u.code}),w=v!==y;return e("option",{value:u.code,children:w?`${y} - ${v}`:v})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(f,{id:"cc0NrU",values:{0:s.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Ri.map(u=>{const v=At({code:u.code,fallback:u.name}),y=At({code:u.code,locale:u.code}),w=v!==y;return e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationHideLanguages.includes(u.code),onChange:S=>{const{checked:_}=S.target;_?A.settings.contentTranslationHideLanguages.push(u.code):A.settings.contentTranslationHideLanguages=s.settings.contentTranslationHideLanguages.filter(k=>k!==u.code)}})," ",w?e("span",{children:[y," ",e("span",{class:"insignificant",children:["- ",v]})]}):v]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(f,{id:"xpF+wU",components:{0:e("a",{href:"https://github.com/cheeaun/lingva-api",target:"_blank",rel:"noopener"}),1:e("a",{href:"https://github.com/thedaviddelta/lingva-translate",target:"_blank",rel:"noopener"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationAutoInline,disabled:!s.settings.contentTranslation,onChange:u=>{A.settings.contentTranslationAutoInline=u.target.checked}})," ",e(f,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(f,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!Rc&&m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.composerGIFPicker,onChange:u=>{A.settings.composerGIFPicker=u.target.checked}})," ",e(f,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener"})}})})})]}),!!Ac&&m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.mediaAltGenerator,onChange:u=>{A.settings.mediaAltGenerator=u.target.checked}})," ",e(f,{id:"9q5uor"})," ",e(T,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener"})}})})})]}),m&&et("@mastodon/grouped-notifications")&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.groupedNotificationsAlpha,onChange:u=>{A.settings.groupedNotificationsAlpha=u.target.checked}})," ",e(f,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"X17jCM"})})})]}),m&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.shortcutSettingsCloudImportExport,onChange:u=>{A.settings.shortcutSettingsCloudImportExport=u.target.checked}})," ",e(f,{id:"570qTm"})," ",e(T,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(f,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.cloakMode,onChange:u=>{A.settings.cloakMode=u.target.checked}})," ",e(f,{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(f,{id:"T/hglb"})})})]}),m&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{A.showDrafts=!0,A.showSettings=!1},children:e(f,{id:"krk5ws"})})})]})}),m&&e(Lc,{onClose:n}),e("h3",{children:e(f,{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:gi,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:u=>{u.preventDefault(),A.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(f,{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:u=>{u.preventDefault(),A.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener",children:e(f,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener",children:e(f,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener",children:"Patreon"})," ","·"," ",e("a",{href:xc,target:"_blank",rel:"noopener",children:e(f,{id:"LcET2C"})})]}),e("p",{children:[Ui&&e(z,{children:[e(f,{id:"pFnMHn",values:{0:Ui.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(f,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/85d964f",target:"_blank",rel:"noopener",children:e(It,{datetime:new Date("2025-03-22T10:26:37.992Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2025-03-22T10:26:37.992Z".slice(0,10).replace(/-/g,".")}.85d964f`,onClick:u=>{u.target.select();try{navigator.clipboard.writeText(u.target.value),pe(i({id:"PiPfua"}))}catch{pe(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function Lc({onClose:n}){const{_:i}=ue();if(!$n())return null;const{instance:s}=ce(),[o,c]=E("default"),r=Y(),[h,d]=E(!1),[l,a]=E(!1),p=Y();ie(()=>{(async()=>{c("loading");try{const{subscription:m,backendSubscription:g}=await Ic();if(g!=null&&g.policy&&g.policy!=="none"){d(!0);const{alerts:u,policy:v}=g;p.current=v;const{elements:y}=r.current,w=y.namedItem("policy");w&&(w.value=v),Object.entries(u).forEach(([S,_])=>{const k=y.namedItem(S);(k==null?void 0:k.type)==="checkbox"&&(k.checked=!!_)})}c("default")}catch(m){/outside.*authorized/i.test(m.message)?a(!0):alert((m==null?void 0:m.message)||m),c("error")}})()},[]);const b=o==="loading";return e("form",{ref:r,onChange:()=>{setTimeout(()=>{const m=Object.fromEntries(new FormData(r.current)),g=!!m["policy-allow"],u={data:{policy:m.policy,alerts:{mention:!!m.mention,favourite:!!m.favourite,reblog:!!m.reblog,follow:!!m.follow,follow_request:!!m.followRequest,poll:!!m.poll,update:!!m.update,status:!!m.status}}};let v=0;Object.keys(u.data.alerts).forEach(w=>{u.data.alerts[w]?v++:delete u.data.alerts[w]});const y=p.current!==u.data.policy;g&&v>0?y?Oi().then(()=>{Ni(u)}).catch(w=>{alert(i({id:"I6pdY3"}))}):Ni(u).catch(w=>{alert(i({id:"I6pdY3"}))}):Oi().catch(w=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(f,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:b||l,name:"policy-allow",checked:h,onChange:async m=>{const{checked:g}=m.target;if(g){const u=await Notification.requestPermission();u==="granted"?d(!0):(d(!1),u==="denied"&&alert(i({id:"6LUsk7"})))}else d(!1)}})," ",e(f,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(m=>e("option",{value:m.value,children:m.label}))},components:{0:e("select",{name:"policy",disabled:b||l||!h})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!h,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(m=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:m.value})," ",m.label]})}))})})})}),l&&e("div",{class:"sub-section",children:e("p",{children:e(f,{id:"8d0b8B",components:{0:e(ge,{to:`/login?instance=${s}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(f,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const Xn=()=>{let n=setTimeout(()=>{var s,o;const i=document.getElementById("columns");if(i){const c=i.querySelector(".deck-container.focus");if(c)c.focus();else{const r=Array.from(i.querySelectorAll(".deck-container")).find(h=>h.getBoundingClientRect().left>=0);r?r.focus():(o=(s=i.querySelector(".deck-container"))==null?void 0:s.focus)==null||o.call(s)}}else{const c=document.querySelectorAll("#modal-container > *");if(c!=null&&c.length){const l=c[c.length-1],a=l.querySelector('[tabindex="-1"]')||l;if(a){a.focus();return}}if(document.querySelector(".deck-backdrop"))return;const h=document.querySelectorAll(".deck-container"),d=h[h.length-1];d&&d.tabIndex===-1&&d.focus()}},100);return()=>clearTimeout(n)};function Os(n){if(!n)return;const i=Zt(),s=Y(i.pathname);ie(()=>{s.current&&i.pathname!==s.current&&(n==null||n())},[i.pathname,n])}const zs=1e3*60,Mc=24*60*60*1e3,Jn=gt(async()=>{const{masto:n}=ce(),i=await n.v1.lists.list();return i.sort((s,o)=>s.title.localeCompare(o.title)),i.length&&setTimeout(()=>{ve.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{maxAge:zs});async function ln(){try{const{lists:n,updatedAt:i}=ve.account.get("lists")||{};return n!=null&&n.length?(Date.now()-i>Mc&&Jn(),n):await Jn()}catch{return[]}}const $c=gt(n=>{const{masto:i}=ce();return i.v1.lists.$select(n).fetch()},{maxAge:zs});async function Us(n){const{lists:i}=ve.account.get("lists")||{};if(i!=null&&i.length){const s=i.find(o=>o.id===n);if(s)return s}try{return $c(n)}catch{return null}}async function Dc(n){const i=await Us(n);return(i==null?void 0:i.title)||""}function Pc(n){const{lists:i}=ve.account.get("lists")||{};i!=null&&i.length&&(i.push(n),i.sort((s,o)=>s.title.localeCompare(o.title)),ve.account.set("lists",{lists:i,updatedAt:Date.now()}))}function Nc(n){const{lists:i}=ve.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n.id);s!==-1&&(i[s]=n,i.sort((o,c)=>o.title.localeCompare(c.title)),ve.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Oc(n){const{lists:i}=ve.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n);s!==-1&&(i.splice(s,1),ve.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function yi({list:n,onClose:i}){const{_:s}=ue(),{masto:o}=ce(),[c,r]=E("default"),h=!!n,d=Y(),l=Y(),a=Y();ie(()=>{h&&(d.current.value=n.title,l.current.value=n.repliesPolicy,a.current&&(a.current.checked=n.exclusive))},[h]);const p=et("@mastodon/list-exclusive")||et("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:s(h?{id:"tuhghE"}:{id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:b=>{b.preventDefault();const m=new FormData(b.target),g=m.get("title"),u=m.get("replies_policy"),v=m.get("exclusive")==="on";r("loading"),(async()=>{try{let y;h?y=await o.v1.lists.$select(n.id).update({title:g,replies_policy:u,exclusive:v}):y=await o.v1.lists.create({title:g,replies_policy:u,exclusive:v}),r("default"),i==null||i({state:"success",list:y}),setTimeout(()=>{h?Nc(y):Pc(y)},1)}catch{r("error"),alert(s(h?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(f,{id:"6YtxFj"})," ",e("input",{ref:d,type:"text",id:"list-title",name:"title",required:!0,disabled:c==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:l,name:"replies_policy",required:!0,disabled:c==="loading",children:[e("option",{value:"list",children:e(f,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(f,{id:"Mr53YX"})}),e("option",{value:"none",children:e(f,{id:"PM7llw"})})]})}),p&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:a,type:"checkbox",name:"exclusive",disabled:c==="loading"})," ",e(f,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:c==="loading",children:s(h?{id:"tfDRzk"}:{id:"hYgDIe"})}),h&&e(ut,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"+kQ/cY"}),onClick:()=>{r("loading"),(async()=>{try{await o.v1.lists.$select(n.id).remove(),r("default"),i==null||i({state:"deleted"}),setTimeout(()=>{Oc(n.id)},1)}catch{r("error"),alert(s({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading",children:e(f,{id:"Jb6/SB"})})})]})]})})]})}const zc=[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],Ft={0:{id:"9ZP9cc"},300:it(5,"minute"),1800:it(30,"minute"),3600:it(1,"hour"),21600:it(6,"hour"),86400:it(1,"day"),259200:it(3,"day"),604800:it(1,"week"),2592e3:it(30,"day")},Bi=80,Bs=1e3*60*10;function Uc(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const Bc=gt(Uc,{maxAge:Bs});async function Fc(n,i){const s=i.v1.accounts.$select(n).statuses.list({limit:20}).next(),{value:o}=await s,c={total:o.length,originals:0,replies:0,boosts:0};return o.forEach(r=>{r.reblog?c.boosts++:r.inReplyToId&&r.inReplyToAccountId!==r.account.id?c.replies++:c.originals++}),o.length&&(c.daysSinceLastPost=Math.ceil((Date.now()-new Date(o[o.length-1].createdAt))/864e5)),c}const Hc=gt(Fc,{maxAge:Bs});function Fs({account:n,fetchAccount:i=()=>{},standalone:s,instance:o,authenticated:c}){const{i18n:r,_:h}=ue(),{masto:d,authenticated:l}=ce({instance:o}),{masto:a,instance:p}=ce(),[b,m]=E("default"),g=typeof n=="string",[u,v]=E(g?null:n),y=Ce(()=>o===p,[o,p]);ie(()=>{if(!g){v(n);return}m("loading"),(async()=>{try{const D=await i();A.accounts[`${D.id}@${o}`]=D,v(D),m("default")}catch{v(null),m("error")}})()},[g,n,i]);const{acct:w,avatar:S,avatarStatic:_,bot:k,createdAt:x,displayName:C,emojis:I,fields:R,followersCount:L,followingCount:F,group:P,id:q,lastStatusAt:te,locked:ee,note:W,statusesCount:j,url:U,username:ae,memorial:$,moved:B,roles:G,hideCollections:le}=u||{};let H=!1,{header:se,headerStatic:be}=u||{};(!se||/missing\.png$/.test(se))&&S&&!/missing\.png$/.test(S)&&(se=S,H=!0,_&&!/missing\.png$/.test(_)&&(be=_));const we=Ce(()=>q===yt(),[q]);ie(()=>{const D=!!(u!=null&&u.id&&(u!=null&&u.username)&&(u!=null&&u.acct)&&(u!=null&&u.avatar)&&(u!=null&&u.avatarStatic)&&(u!=null&&u.displayName)&&(u!=null&&u.url));if(we&&o&&D){const Z=ve.local.getJSON("accounts");let V=!1;Z.forEach(K=>{K.info.id===u.id&&K.instanceURL===o&&(K.info=u,V=!0)}),V&&ve.local.setJSON("accounts",Z)}},[we,u,o]);const X=Ce(()=>{var V;if(!U)return null;const D=(V=URL.parse(U))==null?void 0:V.hostname;return D?rn.toUnicode(D):null},[U]),[de,Ee]=E([]),$e=Y(),Pe=Y([]);async function ze(D){var Oe;(D||!$e.current)&&($e.current=d.v1.accounts.$select(q).followers.list({limit:Bi}));const Z=await $e.current.next();if(we||!y)return Z;const{value:V}=Z;let K=[];if(D){let xe=[];try{xe=await d.v1.accounts.familiarFollowers.fetch({id:[q]})}catch{}Pe.current=((Oe=xe==null?void 0:xe[0])==null?void 0:Oe.accounts)||[],K=[...Pe.current,...V.filter(Ie=>!Pe.current.some(Be=>Be.id===Ie.id))]}else V!=null&&V.length&&(K=V.filter(xe=>!Pe.current.some(Ie=>Ie.id===xe.id)));return{...Z,value:K}}const Le=Y();async function Ae(D){return(D||!Le.current)&&(Le.current=d.v1.accounts.$select(q).following.list({limit:Bi})),await Le.current.next()}const J=s?"div":ge,_e=o?`/${o}/a/${q}`:`/a/${q}`,[De,ne]=E([]),[oe,Re]=E(),[O,Q]=E("default"),fe=!!(oe!=null&&oe.total),N=async D=>{try{const Z=await Bc(D,a);ne(Z[0].accounts.slice(0,qc))}catch{}},re=async()=>{if(q){Q("loading");try{const D=await Hc(q,d);Re(D),Q("default")}catch{Q("error")}}},Te=st(({relationship:D,currentID:Z})=>{D.following||(N(Z),!s&&j>0&&re())},[s,q,j]),Se=st(D=>{D.id===q&&(v(D),A.accounts[`${D.id}@${o}`]=D)},[q,o]),Ne=g&&n&&/^https?:\/\//.test(n),[Ye,M]=E(!1);return e(z,{children:[e("div",{tabIndex:"-1",class:`account-container ${b==="loading"?"skeleton":""}`,style:{"--header-color-1":de[0],"--header-color-2":de[1],"--header-color-3":de[2],"--header-color-4":de[3]},children:[b==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(f,{id:"44hICK"})}),g?e("p",{children:Ne?e("a",{href:n,target:"_blank",rel:"noopener",children:n}):e("code",{class:"insignificant",children:n})}):e("p",{children:e("a",{href:U,target:"_blank",rel:"noopener",children:[e(f,{id:"Aadw0+"})," ",e(T,{icon:"external"})]})})]}),b==="loading"?e(z,{children:[e("header",{children:e(ht,{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(f,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"██"})," ",e(f,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"██"})," ",e(f,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(T,{icon:"more",size:"l",alt:h({id:"2FYpfJ"})})})})]})]})]}):u&&e(z,{children:[!!B&&e("div",{class:"account-moved",children:[e("p",{children:e(f,{id:"C6cVP/",values:{displayName:C},components:{0:e("b",{})}})}),e(ht,{account:B,instance:o,onClick:D=>{D.stopPropagation(),A.showAccount=B}})]}),!!se&&!/missing\.png$/.test(se)&&e("img",{src:se,alt:"",class:`header-banner ${H?"header-is-avatar":""}`,onError:D=>{D.target.crossOrigin?D.target.src!==be?D.target.src=be:(D.target.removeAttribute("crossorigin"),D.target.src=se):D.target.src!==be?D.target.src=be:D.target.remove()},crossOrigin:"anonymous",onLoad:D=>{D.target.classList.add("loaded");try{const Z=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),V=Z.getContext("2d",{willReadFrequently:!0});Z.width=D.target.width,Z.height=D.target.height,V.imageSmoothingEnabled=!1,V.drawImage(D.target,0,0);const K=10,xe=[V.getImageData(0,0,K,K).data,V.getImageData(D.target.width-K,0,K,K).data,V.getImageData(0,D.target.height-K,K,K).data,V.getImageData(D.target.width-K,D.target.height-K,K,K).data].map(Ie=>{let Be=0,Ze=0,me=0,Me=0;for(let ke=0;ke<Ie.length;ke+=4)Be+=Ie[ke],Ze+=Ie[ke+1],me+=Ie[ke+2],Me+=Ie[ke+3];const We=Ie.length/4;return[Be/We,Ze/We,me/We,Me/We]}).map(Ie=>{const[Be,Ze,me,Me]=Yc(Ie);return`rgba(${Be}, ${Ze}, ${me}, ${Me})`});Ee(xe)}catch{}}}),e("header",{children:s?e(rt,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(ht,{account:u,instance:o,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(Qc,{acct:w,instance:o})}),e(ye,{onClick:()=>{const D=w.includes("@")?`@${w}`:`@${w}@${o}`;try{navigator.clipboard.writeText(D),pe(h({id:"zJoEwS"}))}catch{pe(h({id:"BC0lSD"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(f,{id:"27x6gl"})})]}),e(ye,{href:U,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(f,{id:"Bz5hLl"})})]}),e(Ke,{}),e(ye,{onClick:()=>{A.showMediaModal={mediaAttachments:[{type:"image",url:_}]}},children:[e(T,{icon:"user"}),e("span",{children:e(f,{id:"7WYl2I"})})]}),e(ye,{onClick:()=>{A.showMediaModal={mediaAttachments:[{type:"image",url:be}]}},children:[e(T,{icon:"media"}),e("span",{children:e(f,{id:"ZNme5R"})})]}),l&&we&&et("@mastodon/profile-edit")&&e(z,{children:[e(Ke,{}),e(ye,{onClick:()=>{M(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:e(f,{id:"9OpVZg"})})]})]})]}):e(ht,{account:u,instance:o,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!$&&e("span",{class:"tag",children:e(f,{id:"prdIOK"})}),!!k&&e("span",{class:"tag",children:[e(T,{icon:"bot"})," ",e(f,{id:"9Vdq+j"})]}),!!P&&e("span",{class:"tag",children:[e(T,{icon:"group"})," ",e(f,{id:"L8fEEm"})]}),G==null?void 0:G.map(D=>e("span",{class:"tag",children:[D.name,!!X&&e(z,{children:[" ",e("span",{class:"more-insignificant",children:X})]})]})),e("div",{class:"note",dir:"auto",onClick:ks({instance:p}),dangerouslySetInnerHTML:{__html:Kn(W,{emojis:I})}}),e("div",{class:"account-metadata-box",children:[(R==null?void 0:R.length)>0&&e("div",{class:"profile-metadata",children:R.map(({name:D,value:Z,verifiedAt:V},K)=>e("div",{class:`profile-field ${V?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(Ss,{text:D,emojis:I})," ",!!V&&e(T,{icon:"check-circle",size:"s",alt:h({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:Kn(Z,{emojis:I})}})]},D+K))}),e("div",{class:"stats",children:[e(J,{tabIndex:0,to:_e,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={id:"followers",heading:h({id:"x5LEuB"}),fetchAccounts:ze,instance:o,excludeRelationshipAttrs:we?["followedBy"]:[],blankCopy:le?h({id:"BRV/wh"}):void 0}},0)},children:[!!De.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:De.map(D=>e(ft,{url:D.avatarStatic,size:"s",alt:`${D.displayName} @${D.acct}`,squircle:D==null?void 0:D.bot}))})}),e("span",{title:L,children:Je(L)})," ",e(f,{id:"x5LEuB"})]}),e(J,{class:"insignificant",tabIndex:0,to:_e,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={heading:h({id:"following.stats"}),fetchAccounts:Ae,instance:o,excludeRelationshipAttrs:we?["following"]:[],blankCopy:le?h({id:"BRV/wh"}):void 0}},0)},children:[e("span",{title:F,children:Je(F)})," ",e(f,{id:"following.stats"}),e("br",{})]}),e(J,{class:"insignificant",to:_e,children:[e("span",{title:j,children:Je(j)})," ",e(f,{id:"+owNNn"})]}),!!x&&e("div",{class:"insignificant",children:e(f,{id:"PCcEFZ",values:{0:ot(x,{hideTime:!0})},components:{0:e("time",{datetime:x})}})})]})]}),!!oe&&e(J,{to:_e,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:fe?e("div",{class:"posting-stats",title:h({id:"wiuWLe",values:{0:(oe.originals/oe.total).toLocaleString(r.locale||void 0,{style:"percent"}),1:(oe.replies/oe.total).toLocaleString(r.locale||void 0,{style:"percent"}),2:(oe.boosts/oe.total).toLocaleString(r.locale||void 0,{style:"percent"})}}),children:[e("div",{children:oe.daysSinceLastPost<365?he._({id:"oZUtTk",values:{0:oe.total,1:oe.daysSinceLastPost,2:oe.daysSinceLastPost,3:oe.daysSinceLastPost,4:oe.total,5:oe.total,6:oe.daysSinceLastPost}}):he._({id:"JvA7Mo",values:{0:oe.total,1:oe.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${oe.originals/oe.total*100}%`,"--replies-percentage":`${(oe.originals+oe.replies)/oe.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(f,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(f,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(f,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(f,{id:"vl3XTJ"})})})})}),!B&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!oe,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:O==="loading",onClick:()=>{re()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${O==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(f,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(jc,{info:u,instance:o,standalone:s,authenticated:c,onRelationshipChange:Te,onProfileUpdate:Se,setShowEditProfile:M})})]})]}),!!Ye&&e(He,{onClose:()=>{M(!1)},children:e(Xc,{onClose:({state:D,account:Z}={})=>{M(!1),D==="success"&&Z&&Se(Z)}})})]})}const qc=3;function jc({info:n,instance:i,standalone:s,authenticated:o,onRelationshipChange:c=()=>{},onProfileUpdate:r=()=>{},setShowEditProfile:h=()=>{}}){var De;if(!n)return null;const{_:d,_:l}=ue(),{masto:a,instance:p,authenticated:b}=ce(),m=i===p,[g,u]=E("default"),[v,y]=E(null),{id:w,acct:S,url:_,username:k,locked:x,lastStatusAt:C,note:I,fields:R,moved:L}=n,F=Y(w),{following:P,showingReblogs:q,notifying:te,followedBy:ee,blocking:W,blockedBy:j,muting:U,mutingNotifications:ae,requested:$,domainBlocking:B,endorsed:G,note:le}=v||{},[H,se]=E(null),[be,we]=E(!1),X=S.includes("@")?S:`${S}@${i}`;ie(()=>{if(n){const ne=yt();let oe;(async()=>{if(m&&o)oe=w;else if(!m&&b){const O=n.acct.includes("@");try{const Q=await a.v2.search.fetch({q:O?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});Q.accounts.length&&(oe=Q.accounts[0].id,se(Q.accounts[0]))}catch{}}if(!oe)return;if(ne===oe){we(!0);return}F.current=oe,u("loading");const Re=a.v1.accounts.relationships.fetch({id:[oe]});try{const O=await Re;if(u("default"),O.length){const Q=O[0];y(Q),c({relationship:Q,currentID:oe})}}catch{u("error")}})()}},[n,o]),ie(()=>{n&&be&&yo(n)},[n,be]);const de=g==="loading",[Ee,$e]=E(!1),[Pe,ze]=E(!1),[Le,Ae]=E(!1),[J,_e]=E([]);return e(z,{children:[e("div",{class:"actions",children:[e("span",{children:[ee?e("span",{class:"tag",children:e(f,{id:"p3UO/y"})}):C?e("small",{class:"insignificant",children:e(f,{id:"F3cM1G",values:{0:ot(C,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),U&&e("span",{class:"tag danger",children:e(f,{id:"+IJm1Z"})}),W&&e("span",{class:"tag danger",children:e(f,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!le&&e("button",{type:"button",class:"private-note-tag",title:l({id:"zxFxcH"}),onClick:()=>{Ae(!0)},dir:"auto",children:e("span",{children:le})}),e(rt,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:de,children:e(T,{icon:"more",size:"l",alt:l({id:"2FYpfJ"})})}),onMenuChange:ne=>{P&&ne.open&&(async()=>{try{const oe=await a.v1.accounts.$select(F.current).lists.list();_e(oe)}catch{}})()},children:[b&&!be&&e(z,{children:[e(ye,{onClick:()=>{vs({draftStatus:{status:`@${(H==null?void 0:H.acct)||S} `}})},children:[e(T,{icon:"at"}),e("span",{children:e(f,{id:"3LkfZu",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ye,{onClick:()=>{$e(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(f,{id:"R8mSiS"})})]}),et("@mastodon/profile-private-note")&&e(ye,{onClick:()=>{Ae(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:l(le?{id:"U+Gokq"}:{id:"VcQzRi"})})]}),P&&!!v&&e(z,{children:[e(ye,{onClick:()=>{u("loading"),(async()=>{try{const ne=await a.v1.accounts.$select(F.current).follow({notify:!te});ne&&y(ne),u("default"),pe(ne.notifying?l({id:"jL3N0G",values:{username:k}}):l({id:"0h4/9h",values:{username:k}}))}catch(ne){alert(ne),u("error")}})()},children:[e(T,{icon:"notification"}),e("span",{children:l(te?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(ye,{onClick:()=>{u("loading"),(async()=>{try{const ne=await a.v1.accounts.$select(F.current).follow({reblogs:!q});ne&&y(ne),u("default"),pe(ne.showingReblogs?l({id:"0X2KC8",values:{username:k}}):l({id:"cXWjH0",values:{username:k}}))}catch(ne){alert(ne),u("error")}})()},children:[e(T,{icon:"rocket"}),e("span",{children:l(q?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),P&&e(ye,{onClick:()=>{ze(!0)},children:[e(T,{icon:"list"}),J.length?e(z,{children:[e("small",{class:"menu-grow",children:[e(f,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:J.map(ne=>ne.title).join(", ")})]}),e("small",{class:"more-insignificant",children:J.length})]}):e("span",{children:e(f,{id:"sJ2yQc"})})]}),e(Ke,{})]}),e(ye,{onClick:()=>{const ne=`@${(H==null?void 0:H.acct)||X}`;try{navigator.clipboard.writeText(ne),pe(l({id:"zJoEwS"}))}catch{pe(l({id:"BC0lSD"}))}},children:[e(T,{icon:"copy"}),e("small",{children:[e(f,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",(H==null?void 0:H.acct)||X]})]})]}),e(ye,{href:_,target:"_blank",children:[e(T,{icon:"external"}),e("small",{class:"menu-double-lines",children:Vc(_)})]}),e("div",{class:"menu-horizontal",children:[e(ye,{onClick:()=>{try{navigator.clipboard.writeText(_),pe(l({id:"edWbV6"}))}catch{pe(l({id:"W1ewR0"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(f,{id:"he3ygx"})})]}),(navigator==null?void 0:navigator.share)&&((De=navigator==null?void 0:navigator.canShare)==null?void 0:De.call(navigator,{url:_}))&&e(ye,{onClick:()=>{try{navigator.share({url:_})}catch{alert(l({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"}),e("span",{children:e(f,{id:"LFKLqp"})})]})]}),!!v&&e(z,{children:[e(Ke,{}),U?e(ye,{onClick:()=>{u("loading"),(async()=>{try{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).unmute();y(ne),u("default"),pe(l({id:"B4Xkly",values:{username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{u("error")}})()},children:[e(T,{icon:"unmute"}),e("span",{children:e(f,{id:"Q/HUhC",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(an,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(z,{children:[e(T,{icon:"mute"}),e("span",{class:"menu-grow",children:e(f,{id:"xhPEH3",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(T,{icon:"time"}),e(T,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:zc.map(ne=>e(ye,{onClick:()=>{u("loading"),(async()=>{try{const oe=await a.v1.accounts.$select((H==null?void 0:H.id)||w).mute({duration:ne});y(oe),u("default"),pe(l({id:"/plB9m",values:{0:typeof Ft[ne]=="function"?Ft[ne]():d(Ft[ne]),username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{u("error"),pe(l({id:"vWGBjT",values:{username:k}}))}})()},children:typeof Ft[ne]=="function"?Ft[ne]():d(Ft[ne])}))})}),ee&&e(ut,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(z,{children:[e(T,{icon:"user-x"}),e("span",{children:e(f,{id:"unyq2W",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{u("loading"),(async()=>{try{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).removeFromFollowers();y(ne),u("default"),pe(l({id:"AgkcM/",values:{username:k}})),A.reloadGenericAccounts.id="followers",A.reloadGenericAccounts.counter++}catch{u("error")}})()},children:[e(T,{icon:"user-x"}),e("span",{children:e(f,{id:"VCZ0OT"})})]}),e(ut,{subMenu:!0,confirm:!W,confirmLabel:e(z,{children:[e(T,{icon:"block"}),e("span",{children:e(f,{id:"aforS9",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{u("loading"),(async()=>{try{if(W){const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).unblock();y(ne),u("default"),pe(l({id:"sI9N29",values:{username:k}}))}else{const ne=await a.v1.accounts.$select((H==null?void 0:H.id)||w).block();y(ne),u("default"),pe(l({id:"uYcYzu",values:{username:k}}))}A.reloadGenericAccounts.id="block",A.reloadGenericAccounts.counter++}catch{u("error"),W?pe(l({id:"0tG4wG",values:{username:k}})):pe(l({id:"pA+qEx",values:{username:k}}))}})()},children:W?e(z,{children:[e(T,{icon:"unblock"}),e("span",{children:e(f,{id:"/3LJfX",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(z,{children:[e(T,{icon:"block"}),e("span",{children:e(f,{id:"JRswkR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ye,{className:"danger",onClick:()=>{A.showReportModal={account:H||n}},children:[e(T,{icon:"flag"}),e("span",{children:e(f,{id:"qTJgpR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),b&&be&&s&&et("@mastodon/profile-edit")&&e(z,{children:[e(Ke,{}),e(ye,{onClick:()=>{h(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:e(f,{id:"9OpVZg"})})]})]}),!1]}),!v&&g==="loading"&&e(Ue,{abrupt:!0}),!!v&&!L&&e(ut,{confirm:P||$,confirmLabel:e("span",{children:l($?{id:"e7qQIH"}:{id:"q4ucww",values:{1:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:de,onClick:()=>{u("loading"),(async()=>{try{let ne;P||$?ne=await a.v1.accounts.$select(F.current).unfollow():ne=await a.v1.accounts.$select(F.current).follow(),ne&&y(ne),u("default")}catch(ne){alert(ne),u("error")}})()},children:e("button",{type:"button",class:`${P||$?"light swap":""}`,"data-swap-state":P||$?"danger":"",disabled:de,children:P?e(z,{children:[e("span",{children:e(f,{id:"y6sq5j"})}),e("span",{children:e(f,{id:"HKrBPX"})})]}):$?e(z,{children:[e("span",{children:e(f,{id:"Yx0Ud8"})}),e("span",{children:e(f,{id:"yTVtKs"})})]}):x?e(z,{children:[e(T,{icon:"lock"})," ",e("span",{children:e(f,{id:"MKEPCY"})})]}):l({id:"MKEPCY"})})})]})]}),!!Ee&&e(He,{onClose:()=>{$e(!1)},children:e(Gc,{note:I,fields:R,onClose:()=>$e(!1)})}),!!Pe&&e(He,{onClose:()=>{ze(!1)},children:e(Kc,{accountID:F.current,onClose:()=>ze(!1)})}),!!Le&&e(He,{onClose:()=>{Ae(!1)},children:e(Zc,{account:n,note:le,onRelationshipChange:ne=>{y(ne)},onClose:()=>Ae(!1)})})]})}function Yc([n,i,s]){const o=.2126*n+.7152*i+.0722*s;let c;return o>=220?c=1:o<=50?c=.1:c=o/255,c=Math.min(1,c),[n,i,s,c]}function Vc(n){if(!n)return;const i=URL.parse(n);if(!i)return;const{host:s,pathname:o}=i,c=o.replace(/\/$/,"").replace(/^\//,"");return e(z,{children:[e("span",{class:"more-insignificant",children:[rn.toUnicode(s),"/"]}),e("wbr",{}),e("span",{children:c})]})}function Gc({note:n,fields:i,onClose:s}){const{_:o}=ue(),c=(i==null?void 0:i.map(({name:h,value:d})=>`${h}
|
||
${Ei(d)}`).join(`
|
||
|
||
`))||"",r=Ei(n)+(c?`
|
||
|
||
${c}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:r}),e(Cs,{forceTranslate:!0,text:r})]})]})}function Kc({accountID:n,onClose:i}){const{_:s}=ue(),{masto:o}=ce(),[c,r]=E("default"),[h,d]=E([]),[l,a]=E([]),[p,b]=Et(u=>u+1,0);ie(()=>{r("loading"),(async()=>{try{const u=await ln();d(u);const v=await o.v1.accounts.$select(n).lists.list();a(v),r("default")}catch{r("error")}})()},[p]);const[m,g]=E(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"sJ2yQc"})})}),e("main",{children:[h.length>0?e("ul",{class:"list-add-remove",children:h.map(u=>{const v=l.some(y=>y.id===u.id);return e("li",{children:e("button",{type:"button",class:`light ${v?"checked":""}`,disabled:c==="loading",onClick:()=>{r("loading"),(async()=>{try{v?await o.v1.lists.$select(u.id).accounts.remove({accountIds:[n]}):await o.v1.lists.$select(u.id).accounts.create({accountIds:[n]}),b()}catch{r("error"),alert(s(v?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(T,{icon:"check-circle",alt:"☑️"}),e("span",{children:u.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(f,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(f,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>g(!0),disabled:c!=="default",children:[e(T,{icon:"plus",size:"l"})," ",e("span",{children:e(f,{id:"Sb2gYF"})})]})]}),m&&e(He,{onClick:u=>{u.target===u.currentTarget&&g(!1)},children:e(yi,{list:m==null?void 0:m.list,onClose:u=>{u.state==="success"&&b(),g(!1)}})})]})}function Zc({account:n,note:i,onRelationshipChange:s=()=>{},onClose:o=()=>{}}){const{_:c}=ue(),{masto:r}=ce(),[h,d]=E("default"),l=Y(null);return ie(()=>{let a;return l.current&&!i&&(a=setTimeout(()=>{var p,b;(b=(p=l.current).focus)==null||b.call(p)},100)),()=>{clearTimeout(a)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(f,{id:"DYqYm5",values:{0:(n==null?void 0:n.username)||(n==null?void 0:n.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:a=>{a.preventDefault();const b=new FormData(a.target).get("note");(b==null?void 0:b.trim())!==(i==null?void 0:i.trim())&&(d("loading"),(async()=>{try{const m=await r.v1.accounts.$select(n==null?void 0:n.id).note.create({comment:b});d("default"),s(m),o()}catch(m){d("error"),alert((m==null?void 0:m.message)||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:l,name:"note",disabled:h==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:h==="loading",onClick:()=>{o==null||o()},children:e(f,{id:"dEgA5A"})}),e("span",{children:[e(Ue,{abrupt:!0,hidden:h!=="loading"}),e("button",{disabled:h==="loading",type:"submit",children:e(f,{id:"SrwrEj"})})]})]})]})})]})}const Wc=["image/jpeg","image/png","image/gif","image/webp"],Fi=Wc.join(",");function Xc({onClose:n=()=>{}}){const{_:i}=ue(),{masto:s}=ce(),[o,c]=E("loading"),[r,h]=E(null),[d,l]=E(null),[a,p]=E(null);ie(()=>{(async()=>{try{const k=await s.v1.accounts.verifyCredentials();h(k),c("default")}catch{c("error")}})()},[]);const{displayName:b,source:m,avatar:g,header:u}=r||{},{note:v,fields:y}=m||{},w=Y(null),S=[...g?[{type:"image",url:g}]:[],...a?[{type:"image",url:a}]:[]],_=[...u?[{type:"image",url:u}]:[],...d?[{type:"image",url:d}]:[]];return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(f,{id:"9OpVZg"})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("form",{onSubmit:k=>{k.preventDefault();const x=new FormData(k.target),C=x.get("header"),I=x.get("avatar"),R=x.get("display_name"),L=x.get("note"),F=w.current.querySelectorAll('input[name^="fields_attributes"]'),P=[];F.forEach(q=>{const te=q.name,[ee,W,j]=te.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],U=q.value?q.value.trim():"";W&&j&&U&&(P[W]||(P[W]={}),P[W][j]=U)}),P.forEach(q=>{q.name&&!q.value&&(q.value="")}),(async()=>{try{const q=await s.v1.accounts.updateCredentials({header:C,avatar:I,displayName:R,note:L,fieldsAttributes:P});n==null||n({state:"success",account:q})}catch(q){alert((q==null?void 0:q.message)||i({id:"FwMMx0"}))}})()},children:[e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(f,{id:"C5zXYJ"})," ",e("input",{type:"file",name:"header",accept:Fi,onChange:k=>{const x=k.target.files[0];if(x){const C=URL.createObjectURL(x);l(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[u?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{A.showMediaModal={mediaAttachments:_,index:0}},children:e("img",{src:u,alt:""})}):e("div",{class:"edit-media"}),d&&e(z,{children:[e(T,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{A.showMediaModal={mediaAttachments:_,index:1}},children:e("img",{src:d,alt:""})})]})]})]}),e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(f,{id:"4XF0BB"})," ",e("input",{type:"file",name:"avatar",accept:Fi,onChange:k=>{const x=k.target.files[0];if(x){const C=URL.createObjectURL(x);p(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[g?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{A.showMediaModal={mediaAttachments:S,index:0}},children:e("img",{src:g,alt:""})}):e("div",{class:"edit-media"}),a&&e(z,{children:[e(T,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{A.showMediaModal={mediaAttachments:S,index:1}},children:e("img",{src:a,alt:""})})]})]})]}),e("p",{children:e("label",{children:[e(f,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:b,maxLength:30,disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(f,{id:"E+oKCO"}),e("textarea",{defaultValue:v,name:"note",maxLength:500,rows:"5",disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e(f,{id:"T4I119"})}),e("table",{ref:w,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(f,{id:"87a/t/"})}),e("th",{children:e(f,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,y.length)}).map((k,x)=>{const{name:C="",value:I=""}=y[x]||{};return e(Jc,{name:C,value:I,index:x,disabled:o==="loading"},x)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:o==="loading",onClick:()=>{n==null||n()},children:e(f,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:o==="loading",children:e(f,{id:"tfDRzk"})})]})]})})]})}function Jc({name:n,value:i,disabled:s,index:o}){const[c,r]=E(!!i);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][name]`,defaultValue:n,disabled:s,maxLength:255,required:c,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][value]`,defaultValue:i,disabled:s,maxLength:255,onChange:h=>r(!!h.currentTarget.value),dir:"auto"})})]})}function Qc({acct:n,instance:i}){let[s,o]=n.split("@");o||(o=i);const c=rn.toASCII(n);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:c,children:[e("b",{class:"handle-username",children:s}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:o})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(f,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(f,{id:"rZgCpJ"})]})]})]})}function ea({account:n,instance:i,onClose:s}){const{_:o}=ue(),{masto:c,instance:r,authenticated:h}=ce({instance:i}),d=typeof n=="string";return ie(()=>{d||(A.accounts[`${n.id}@${r}`]=n)},[n]),Os(s),e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e(Fs,{instance:r,authenticated:h,account:n,fetchAccount:async()=>{if(d)try{return await c.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const a=await c.v2.search.fetch({q:n,type:"accounts",limit:1,resolve:h});if(a.accounts.length)return a.accounts[0];if(/https?:\/\/[^/]+\/@/.test(n)){const p=URL.parse(n);if(p){const{hostname:b,pathname:m}=p,g=m.replace(/^\//,"").replace(/\/$/,"")+"@"+b,u=await c.v2.search.fetch({q:g,type:"accounts",limit:1,resolve:h});if(u.accounts.length)return u.accounts[0]}}}else return n}})]})}function ta({onClose:n}){const{_:i}=ue(),{masto:s}=ce(),[o,c]=E("default"),[r,h]=E([]),[d,l]=Et(p=>p+1,0);ie(()=>{c("loading"),(async()=>{try{const p=await pt.drafts.keys();if(p.length){const b=_n(),m=p.filter(g=>g.startsWith(b));if(m.length){const g=await pt.drafts.getMany(m);g.sort((u,v)=>new Date(v.updatedAt).getTime()-new Date(u.updatedAt).getTime()),h(g)}else h([])}else h([]);c("default")}catch{c("error")}})()},[d]);const a=(r==null?void 0:r.length)>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(f,{id:"krk5ws"})," ",e(Ue,{abrupt:!0,hidden:o!=="loading"})]}),a&&e("div",{class:"insignificant",children:e(f,{id:"Ap/10+"})})]}),e("main",{children:a?e(z,{children:[e("ul",{class:"drafts-list",children:r.map(p=>{const{updatedAt:b,key:m,draftStatus:g,replyTo:u}=p,v=new Date(b);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(T,{icon:u?"reply":"quill",size:"s"})," ",e("time",{children:[!!u&&e(z,{children:[e("span",{class:"bidi-isolate",children:["@",u.account.acct]}),e("br",{})]}),ot(v)]})]}),e(ut,{confirmLabel:e("span",{children:e(f,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:o==="loading",onClick:()=>{(async()=>{try{await pt.drafts.del(m),l()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:o==="loading",children:e(f,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:o==="loading",class:"draft-item",onClick:async()=>{let y;if(u){c("loading");try{y=await s.v1.statuses.$select(u.id).fetch()}catch{alert(i({id:"tMwimH"})),c("default");return}c("default")}window.__COMPOSE__={draftStatus:g,replyToStatus:y},A.showCompose=!0,A.showDrafts=!1},children:e(na,{draft:p})})]},b)})}),r.length>1&&e("p",{children:e(ut,{confirmLabel:e("span",{children:e(f,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:o==="loading",onClick:()=>{(async()=>{c("loading");try{await pt.drafts.delMany(r.map(p=>p.key)),c("default"),l()}catch{alert(i({id:"0J4sZq"})),c("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:o==="loading",children:e(f,{id:"hOg+Mt"})})})})]}):e("p",{children:e(f,{id:"8iQ+jk"})})})]})}function na({draft:n}){var m;const{_:i}=ue(),{draftStatus:s,replyTo:o}=n,{status:c,spoilerText:r,poll:h,mediaAttachments:d}=s,l=((m=h==null?void 0:h.options)==null?void 0:m.length)>0,a=(d==null?void 0:d.length)>0,p=l||a,b=Ce(()=>{if(!a)return;const g=d.find(y=>/image/.test(y.type));if(!g)return;const{file:u}=g;return URL.createObjectURL(u)},[a,d]);return e(z,{children:e("div",{class:"mini-draft",children:[p&&e("div",{class:`mini-draft-aside ${b?"has-image":""}`,style:b?{"--bg-image":`url(${b})`}:{},children:[l&&e(T,{icon:"poll",alt:i({id:"4WUbF1"})}),a&&e("span",{children:[e(T,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:d==null?void 0:d.length})]})]}),e("div",{class:"mini-draft-main",children:[!!r&&e("div",{class:"mini-draft-spoiler",children:r}),!!c&&e("div",{class:"mini-draft-status",children:c})]})]})})}function ia({html:n,url:i,width:s,height:o,onClose:c=()=>{}}){const{_:r}=ue();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>c(),children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener",class:"button plain",children:[e("span",{children:e(f,{id:"4/RpOy"})})," ",e(T,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":s+"px","--height":o+"px","--aspect-ratio":`${s}/${o}`}})]})}function sa({instance:n,excludeRelationshipAttrs:i=[],postID:s,onClose:o=()=>{},blankCopy:c}){const{_:r}=ue(),{masto:h,instance:d}=ce(),l=n?n===d:!0,a=Ve(A),[p,b]=E("default"),[m,g]=E([]),[u,v]=E(!1);if(Os(o),!a.showGenericAccounts)return null;const{id:y,heading:w,fetchAccounts:S,accounts:_,showReactions:k}=a.showGenericAccounts,[x,C]=E({}),I=async P=>{if(!(P!=null&&P.length)||!l)return;const q=await li(P,x);q&&C({...x,...q})},R=P=>{S&&(P&&g([]),b("loading"),(async()=>{try{const{done:q,value:te}=await S(P);if(Array.isArray(te)){if(P){const ee=[];for(let W=0;W<te.length;W++){const j=te[W],U=ee.find((ae,$)=>ae.id===j.id&&W!==$);U?U._types.push(...j._types):ee.push({_types:[],...j})}g(ee)}else g(ee=>{const W=ee;for(const j of te){const U=W.find(ae=>ae.id===j.id);U?U._types.push(...j._types):W.push(j)}return W});v(!q),I(te)}else v(!1);b("default")}catch{b("error")}})())},L=Y(!0);ie(()=>{(_==null?void 0:_.length)>0?(g(_),I(_)):(R(!0),L.current=!1)},[_,S]),ie(()=>{var P;L.current||((P=a.reloadGenericAccounts)==null?void 0:P.id)===y&&R(!0)},[a.reloadGenericAccounts.counter]);const F=A.statuses[s];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:w||r({id:"bPwFdf"})})}),e("main",{children:[F&&e(ge,{to:`/${n||d}/s/${F.id}`,class:"post-preview",children:e(je,{status:F,size:"s",readOnly:!0})}),m.length>0?e(z,{children:[e("ul",{class:"accounts-list",children:m.map(P=>{var ee,W;const q=x[P.id],te=`${P.id}-${((ee=P._types)==null?void 0:ee.length)||""}`;return e("li",{children:[k&&((W=P._types)==null?void 0:W.length)>0&&e("div",{class:"reactions-block",children:P._types.map(j=>e(T,{icon:{reblog:"rocket",favourite:"heart"}[j],class:`${j}-icon`}))}),e("div",{class:"account-relationships",children:e(ht,{account:P,showStats:!0,relationship:q,excludeRelationshipAttrs:i})})]},te)})}),p==="default"?u?e(_t,{onChange:P=>{P&&R()},children:e("button",{type:"button",class:"plain block",onClick:()=>R(),children:e(f,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(f,{id:"2EYeAZ"})}):p==="loading"&&e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})})]}):p==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):p==="error"?e("p",{class:"ui-state",children:e(f,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:c||r({id:"10OlfF"})})]})]})}function oa({alt:n,lang:i,onClose:s}){const{_:o}=ue(),c=Ve(A),[r,h]=E(!1),d=ws(!0),l=c.settings.contentTranslationHideLanguages||[],a=!!i&&i!==d&&!Ti([i],[d])&&!l.find(p=>i===p||Ti([i],[p]));return e("div",{class:"sheet",tabindex:"-1",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(f,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(rt,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ye,{disabled:r,onClick:()=>{h(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(f,{id:"pi8x/S"})})]}),zo&&e(ye,{onClick:()=>{Uo(n,i)},children:[e(T,{icon:"speak"}),e("span",{children:e(f,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(a||r)&&e(Cs,{forceTranslate:r,sourceLanguage:i,text:n})]})]})}const{min:Sd,max:Cd}=Math;const Hs={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Hs[`[object ${n}]`]=n.toLowerCase();function ca(n){return Hs[Object.prototype.toString.call(n)]||"object"}const Wt=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):ca(n[0])=="object"&&i?i.split("").filter(s=>n[0][s]!==void 0).map(s=>n[0][s]):n[0].slice(0);const{PI:Dn,min:_d,max:Id}=Math;const Td=Dn*2,xd=Dn/3,aa=Dn/180,ra=180/Dn;function xn(n,i){let s=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(i[0])||(i=i.map(h=>[h]));let o=i[0].length,c=i[0].map((h,d)=>i.map(l=>l[d])),r=n.map(h=>c.map(d=>Array.isArray(h)?h.reduce((l,a,p)=>l+a*(d[p]||0),0):d.reduce((l,a)=>l+a*h,0)));return s===1&&(r=r[0]),o===1?r.map(h=>h[0]):r}const qs={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 Bn=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},la=(n,i,s)=>{const{MtxAdaptMa:o,MtxAdaptMaI:c,MtxXYZ2RGB:r,RefWhiteRGB:h,Xn:d,Yn:l,Zn:a}=qs,p=d*o.m00+l*o.m10+a*o.m20,b=d*o.m01+l*o.m11+a*o.m21,m=d*o.m02+l*o.m12+a*o.m22,g=h.X*o.m00+h.Y*o.m10+h.Z*o.m20,u=h.X*o.m01+h.Y*o.m11+h.Z*o.m21,v=h.X*o.m02+h.Y*o.m12+h.Z*o.m22,y=(n*o.m00+i*o.m10+s*o.m20)*(g/p),w=(n*o.m01+i*o.m11+s*o.m21)*(u/b),S=(n*o.m02+i*o.m12+s*o.m22)*(v/m),_=y*c.m00+w*c.m10+S*c.m20,k=y*c.m01+w*c.m11+S*c.m21,x=y*c.m02+w*c.m12+S*c.m22,C=Bn(_*r.m00+k*r.m10+x*r.m20),I=Bn(_*r.m01+k*r.m11+x*r.m21),R=Bn(_*r.m02+k*r.m12+x*r.m22);return[C*255,I*255,R*255]},wi=(...n)=>{n=Wt(n,"lab");const[i,s,o,...c]=n,[r,h,d]=da([i,s,o]),[l,a,p]=la(r,h,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]};function da(n){var i=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],s=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=xn(s,n);return xn(i,o.map(c=>c**3))}function Fn(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 ua=(n,i,s)=>{n=Fn(n/255),i=Fn(i/255),s=Fn(s/255);const{MtxRGB2XYZ:o,MtxAdaptMa:c,MtxAdaptMaI:r,Xn:h,Yn:d,Zn:l,As:a,Bs:p,Cs:b}=qs;let m=n*o.m00+i*o.m10+s*o.m20,g=n*o.m01+i*o.m11+s*o.m21,u=n*o.m02+i*o.m12+s*o.m22;const v=h*c.m00+d*c.m10+l*c.m20,y=h*c.m01+d*c.m11+l*c.m21,w=h*c.m02+d*c.m12+l*c.m22;let S=m*c.m00+g*c.m10+u*c.m20,_=m*c.m01+g*c.m11+u*c.m21,k=m*c.m02+g*c.m12+u*c.m22;return S*=v/a,_*=y/p,k*=w/b,m=S*r.m00+_*r.m10+k*r.m20,g=S*r.m01+_*r.m11+k*r.m21,u=S*r.m02+_*r.m12+k*r.m22,[m,g,u]},ki=(...n)=>{const[i,s,o,...c]=Wt(n,"rgb"),r=ua(i,s,o);return[...ha(r),...c.length>0&&c[0]<1?[c[0]]:[]]};function ha(n){const i=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],s=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=xn(i,n);return xn(s,o.map(c=>Math.cbrt(c)))}const{sin:fa,cos:pa}=Math,ma=(...n)=>{let[i,s,o]=Wt(n,"lch");return isNaN(o)&&(o=0),o=o*aa,[i,pa(o)*s,fa(o)*s]},Hn=(...n)=>{n=Wt(n,"lch");const[i,s,o,...c]=n,[r,h,d]=ma(i,s,o),[l,a,p]=wi(r,h,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]},{sqrt:ga,atan2:ba,round:va}=Math,ya=(...n)=>{const[i,s,o]=Wt(n,"lab"),c=ga(s*s+o*o);let r=(ba(o,s)*ra+360)%360;return va(c*1e4)===0&&(r=Number.NaN),[i,c,r]},wa=(...n)=>{const[i,s,o,...c]=Wt(n,"rgb"),[r,h,d]=ki(i,s,o),[l,a,p]=ya(r,h,d);return[l,a,p,...c.length>0&&c[0]<1?[c[0]]:[]]},ka={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:Ad}=ka;function js({mediaAttachments:n,statusID:i,instance:s,lang:o,index:c=0,onClose:r=()=>{}}){var k,x;const{_:h}=ue(),[d,l]=E("default"),a=Y(null),[p,b]=E(c),m=Y(null);wt(()=>{var C;(C=m.current)==null||C.scrollIntoView()},[]);const g=Y(i);ie(()=>{const C=c*a.current.clientWidth,I=g.current!==i;I&&(g.current=i),a.current.focus(),a.current.scrollTo({left:C*(Pt()?-1:1),behavior:I?"auto":"smooth"})},[c,i]);const[u,v]=E(!0);ie(()=>{let C=()=>{r()};return a.current&&a.current.addEventListener("swiped-down",C),()=>{a.current&&a.current.removeEventListener("swiped-down",C)}},[]),Fe("esc",r,{ignoreEventWhen:C=>!!document.querySelector("#modal-container > *")},[r]),ie(()=>{let C=()=>{const{clientWidth:I,scrollLeft:R}=a.current,L=Math.round(Math.abs(R)/I);b(L)};return a.current&&a.current.addEventListener("scroll",C,{passive:!0}),()=>{a.current&&a.current.removeEventListener("scroll",C)}},[]),ie(()=>{let C=setTimeout(()=>{var I,R;(R=(I=a.current)==null?void 0:I.focus)==null||R.call(I)},100);return()=>clearTimeout(C)},[]);const y=Ce(()=>n==null?void 0:n.map(C=>{const{blurhash:I}=C;if(I){const R=di(I);return wa(R)}return null}),[n]),w=Ce(()=>y==null?void 0:y.map(C=>C?{light:Hn([.95,.01,C[2]]),dark:Hn([.35,.01,C[2]]),default:Hn([.6,C[1],C[2]])}:null)),S=Ce(()=>{const I=100/w.length,R=w.map((P,q)=>{var W,j,U,ae;const te=q*I+5,ee=(q+1)*I-5;return P!=null&&P.light&&(P!=null&&P.dark)?{light:`
|
||
rgb(${(W=P.light)==null?void 0:W.join(",")}) ${te}%,
|
||
rgb(${(j=P.light)==null?void 0:j.join(",")}) ${ee}%
|
||
`,dark:`
|
||
rgb(${(U=P.dark)==null?void 0:U.join(",")}) ${te}%,
|
||
rgb(${(ae=P.dark)==null?void 0:ae.join(",")}) ${ee}%
|
||
`}:{light:`
|
||
transparent ${te}%,
|
||
transparent ${ee}%
|
||
`,dark:`
|
||
transparent ${te}%,
|
||
transparent ${ee}%
|
||
`}}),L=R.map(P=>P.light).join(", "),F=R.map(P=>P.dark).join(", ");return{light:L,dark:F}},[w]);let _=Y(null);return ie(()=>()=>{var C,I;(I=(C=_.current)==null?void 0:C.hideToast)==null||I.call(C)},[]),wt(()=>{const C=w[p];let I,R;if(C){const L=ve.local.get("theme");if(L){const F=`rgb(${C[L].join(",")})`;I=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),I&&(R=I.content,I.content=F)}else{const F=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",P=`rgb(${C[F].join(",")})`;I=document.querySelector(`meta[name="theme-color"][media*="${F}"]`),I&&(R=I.content,I.content=P)}}return()=>{I&&R&&(I.content=R)}},[p,w]),e("div",{class:`media-modal-container media-modal-count-${n==null?void 0:n.length}`,children:[e("div",{ref:a,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:C=>{(C.target.classList.contains("carousel-item")||C.target.classList.contains("media")||C.target.classList.contains("media-zoom"))&&r()},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":S==null?void 0:S.light,"--accent-gradient-dark":S==null?void 0:S.dark}:{},children:n==null?void 0:n.map((C,I)=>{var L,F;const R=n.length===1?w[I]:null;return e("div",{class:"carousel-item",style:R?{"--accent-color":`rgb(${R.default.join(",")})`,"--accent-light-color":`rgb(${(L=R.light)==null?void 0:L.join(",")})`,"--accent-dark-color":`rgb(${(F=R.dark)==null?void 0:F.join(",")})`,"--accent-alpha-color":`rgba(${R.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:I===p?m:null,onClick:P=>{P.target.classList.contains("media")||v(!u)},children:[!!C.description&&e("button",{type:"button",class:"media-alt",hidden:!u,onClick:()=>{A.showMediaAlt={alt:C.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:C.description})]}),e(_s,{media:C,showOriginal:!0,lang:o})]},C.id)})}),e("div",{class:"carousel-top-controls",hidden:!u,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>r(),children:e(T,{icon:"x",alt:h({id:"yz7wBu"})})})}),(n==null?void 0:n.length)>1?e("span",{class:"carousel-dots",children:n==null?void 0:n.map((C,I)=>e("button",{type:"button",disabled:I===p,class:`carousel-dot ${I===p?"active":""}`,onClick:R=>{R.preventDefault(),R.stopPropagation();const L=a.current.clientWidth*I*(Pt()?-1:1);a.current.focus(),a.current.scrollTo({left:L,behavior:"smooth"})},children:e(T,{icon:"round",size:"s",alt:"⸱"})},C.id))}):e("span",{}),e("span",{children:[e(rt,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(T,{icon:"more",alt:h({id:"2FYpfJ"})})}),children:[e(qe,{href:((k=n[p])==null?void 0:k.remoteUrl)||((x=n[p])==null?void 0:x.url),class:"carousel-button",target:"_blank",title:h({id:"5hXGws"}),children:[e(T,{icon:"popout"}),e("span",{children:e(f,{id:"aDr7Vc"})})]}),!1]})," ",!!i&&e(ge,{to:`${s?`/${s}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${p+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(f,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(n==null?void 0:n.length)>1&&e("div",{class:"carousel-controls",hidden:!u,children:[e("button",{type:"button",class:"carousel-button",hidden:p===0,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(p-1)*(Pt()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-left",alt:h({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:p===n.length-1,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(p+1)*(Pt()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-right",alt:h({id:"hXzOVo"})})})]})]})}const Sa=[,"spam","legal","violation","other"],Xt={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 Ca({account:n,post:i,onClose:s}){const{_:o,_:c}=ue(),{masto:r}=ce(),[h,d]=E("default"),[l,a]=n.acct.split("@"),[p,b]=Ce(()=>{const{rules:_,domain:k}=hs();return[_||[],k]}),[m,g]=E(null),[u,v]=E(!1),y=Y(null),[w,S]=E(!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:l}})}),e("button",{type:"button",class:"plain4 small",disabled:h==="loading",onClick:()=>s(),children:e(T,{icon:"x",size:"xl",alt:c({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(je,{status:i,size:"s",previewMode:!0}):e(ht,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!m&&!Xt[m].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[o(Xt[m].stampLabel||o(Xt[m].label)),e("small",{children:e(f,{id:"2WtL62"})})]},m),e("form",{onSubmit:_=>{_.preventDefault();const k=new FormData(_.target),x=Object.fromEntries(k.entries());let{category:C,comment:I,forward:R}=x;I||(I=void 0),R==="on"&&(R=!0);const L=C==="violation"?Object.entries(x).filter(([P])=>P.startsWith("rule_ids")).map(([P,q])=>q):void 0,F={category:C,comment:I,forward:R,ruleIds:L};d("loading"),(async()=>{try{await r.v1.reports.create({accountId:n.id,statusIds:i!=null&&i.id?[i.id]:void 0,category:C,comment:I,ruleIds:L,forward:R}),d("success"),pe(c(i?{id:"y3ou+8"}:{id:"R9kjEL"})),s()}catch(P){d("error"),pe((P==null?void 0:P.message)||c(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:c(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:Sa.map(_=>_==="violation"&&!(p!=null&&p.length)?null:e(z,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:_,required:!0,disabled:h==="loading",onChange:k=>{g(k.target.value),v(k.target.value==="violation")}}),e("span",{children:[o(Xt[_].label)," ",e("small",{class:"ib insignificant",children:o(Xt[_].description)})]})]}),_==="violation"&&!!(p!=null&&p.length)&&e("div",{class:"shazam-container no-animation",hidden:!u,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:y,children:p.map((k,x)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${x}]`,value:k.id,required:u&&!w,disabled:h==="loading",onChange:C=>{const{checked:I}=C.target;I?S(!0):y.current.querySelectorAll("input:checked").length||S(!1)}}),e("span",{children:k.text})]},k.id))})})})]},_))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(f,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:h==="loading",required:!i})]}),!!a&&a!==b&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:h==="loading"})," ",e("span",{children:e(f,{id:"cyjS8M",values:{domain:a},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:h==="loading",children:e(f,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:h==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).mute(),pe(c({id:"/BGBeF",values:{username:l}}))}catch{pe(c({id:"v02K7/",values:{username:l}}))}},children:e(f,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:h==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).block(),pe(c({id:"kjUejn",values:{username:l}}))}catch{pe(c({id:"pMcdDp",values:{username:l}}))}},children:e(f,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Ue,{hidden:h!=="loading"})]})]})]})]})}var bn={exports:{}},Rd=bn.exports,Hi;function _a(){return Hi||(Hi=1,function(n){var i=function(){var s=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function h(l,a){if(!r[l]){r[l]={};for(var p=0;p<l.length;p++)r[l][l.charAt(p)]=p}return r[l][a]}var d={compressToBase64:function(l){if(l==null)return"";var a=d._compress(l,6,function(p){return o.charAt(p)});switch(a.length%4){default:case 0:return a;case 1:return a+"===";case 2:return a+"==";case 3:return a+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:d._decompress(l.length,32,function(a){return h(o,l.charAt(a))})},compressToUTF16:function(l){return l==null?"":d._compress(l,15,function(a){return s(a+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:d._decompress(l.length,16384,function(a){return l.charCodeAt(a)-32})},compressToUint8Array:function(l){for(var a=d.compress(l),p=new Uint8Array(a.length*2),b=0,m=a.length;b<m;b++){var g=a.charCodeAt(b);p[b*2]=g>>>8,p[b*2+1]=g%256}return p},decompressFromUint8Array:function(l){if(l==null)return d.decompress(l);for(var a=new Array(l.length/2),p=0,b=a.length;p<b;p++)a[p]=l[p*2]*256+l[p*2+1];var m=[];return a.forEach(function(g){m.push(s(g))}),d.decompress(m.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":d._compress(l,6,function(a){return c.charAt(a)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),d._decompress(l.length,32,function(a){return h(c,l.charAt(a))}))},compress:function(l){return d._compress(l,16,function(a){return s(a)})},_compress:function(l,a,p){if(l==null)return"";var b,m,g={},u={},v="",y="",w="",S=2,_=3,k=2,x=[],C=0,I=0,R;for(R=0;R<l.length;R+=1)if(v=l.charAt(R),Object.prototype.hasOwnProperty.call(g,v)||(g[v]=_++,u[v]=!0),y=w+v,Object.prototype.hasOwnProperty.call(g,y))w=y;else{if(Object.prototype.hasOwnProperty.call(u,w)){if(w.charCodeAt(0)<256){for(b=0;b<k;b++)C=C<<1,I==a-1?(I=0,x.push(p(C)),C=0):I++;for(m=w.charCodeAt(0),b=0;b<8;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1}else{for(m=1,b=0;b<k;b++)C=C<<1|m,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=0;for(m=w.charCodeAt(0),b=0;b<16;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1}S--,S==0&&(S=Math.pow(2,k),k++),delete u[w]}else for(m=g[w],b=0;b<k;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1;S--,S==0&&(S=Math.pow(2,k),k++),g[y]=_++,w=String(v)}if(w!==""){if(Object.prototype.hasOwnProperty.call(u,w)){if(w.charCodeAt(0)<256){for(b=0;b<k;b++)C=C<<1,I==a-1?(I=0,x.push(p(C)),C=0):I++;for(m=w.charCodeAt(0),b=0;b<8;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1}else{for(m=1,b=0;b<k;b++)C=C<<1|m,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=0;for(m=w.charCodeAt(0),b=0;b<16;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1}S--,S==0&&(S=Math.pow(2,k),k++),delete u[w]}else for(m=g[w],b=0;b<k;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1;S--,S==0&&(S=Math.pow(2,k),k++)}for(m=2,b=0;b<k;b++)C=C<<1|m&1,I==a-1?(I=0,x.push(p(C)),C=0):I++,m=m>>1;for(;;)if(C=C<<1,I==a-1){x.push(p(C));break}else I++;return x.join("")},decompress:function(l){return l==null?"":l==""?null:d._decompress(l.length,32768,function(a){return l.charCodeAt(a)})},_decompress:function(l,a,p){var b=[],m,g=4,u=4,v=3,y="",w=[],S,_,k,x,C,I,R,L={val:p(0),position:a,index:1};for(S=0;S<3;S+=1)b[S]=S;for(k=0,C=Math.pow(2,2),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;switch(m=k){case 0:for(k=0,C=Math.pow(2,8),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;R=s(k);break;case 1:for(k=0,C=Math.pow(2,16),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;R=s(k);break;case 2:return""}for(b[3]=R,_=R,w.push(R);;){if(L.index>l)return"";for(k=0,C=Math.pow(2,v),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;switch(R=k){case 0:for(k=0,C=Math.pow(2,8),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;b[u++]=s(k),R=u-1,g--;break;case 1:for(k=0,C=Math.pow(2,16),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=p(L.index++)),k|=(x>0?1:0)*I,I<<=1;b[u++]=s(k),R=u-1,g--;break;case 2:return w.join("")}if(g==0&&(g=Math.pow(2,v),v++),b[R])y=b[R];else if(R===u)y=_+_.charAt(0);else return null;w.push(y),b[u++]=_+y.charAt(0),g--,_=y,g==0&&(g=Math.pow(2,v),v++)}}};return d}();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})}(bn)),bn.exports}var qi=_a();const Ia="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",Ta="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",xa="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",Aa=200,Ra=10;async function An(){const{masto:n}=ce(),i=n.v1.followedTags.list({limit:Aa}),s=[];let o=0;do{const{value:c,done:r}=await i.next();if(r||(c==null?void 0:c.length)===0)break;s.push(...c),o++}while(o<Ra);return s.sort((c,r)=>c.name.localeCompare(r.name)),s.length&&setTimeout(()=>{ve.account.set("followedTags",{tags:s,updatedAt:Date.now()})},1),s}const Ea=24*60*60*1e3;async function La(){try{const{tags:n,updatedAt:i}=ve.account.get("followedTags")||{};return n!=null&&n.length?(Date.now()-i>Ea&&An(),n):await An()}catch{return[]}}const ji=document.createElement("div"),Ma=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];ji.innerHTML=n;const i=ji.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(s=>s.innerText.trim().replace(/^[^#]*#+/,"")):[]};function vn({children:n}){if(typeof n=="string")return n;const[i,s]=E("");return ie(()=>{Promise.resolve(n).then(s)},[n]),i}const Ct=9,$a=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],Ys={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"}},yn={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}]},Da=gt(async({id:n})=>{const i=await ce().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),Rn={following:{id:"home",title:(n,i)=>i===0?he._({id:"i0qMbr"}):he._({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?Dc(n):he._({id:"h16FyT"}),path:({id:n})=>n?`/l/${n}`:"/l",icon:"list",excludeViewMode:({id:n})=>n?[]:["multi-column"]},public:{id:"public",title:({local:n})=>n?he._({id:"d5zxa4"}):he._({id:"4ERYY7"}),subtitle:({instance:n})=>n||ce().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||ce().instance,path:({instance:n})=>`/${n}/trending`,icon:"chart"},search:{id:"search",title:({query:n})=>n?`“${n}”`:he._({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:Da,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||ce().instance,path:({hashtag:n,instance:i,media:s})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${s?"?media=1":""}`,icon:"hashtag"}};function Pa({onClose:n}){const{_:i}=ue(),s=Ve(A),{shortcuts:o}=s,[c,r]=E(!1),[h,d]=E(!1),[l]=mi();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(T,{icon:"shortcut"})," ",e(f,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(f,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(f,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:he._({id:"qwdOim"}),imgURL:Ia},{value:"tab-menu-bar",label:he._({id:"UxBoCm"}),imgURL:xa},{value:"multi-column",label:he._({id:"uvDfdW"}),imgURL:Ta}].map(({value:a,label:p,imgURL:b})=>{const m=s.settings.shortcutsViewMode===a||a==="float-button"&&!s.settings.shortcutsViewMode;return e("label",{class:m?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:a,checked:m,onChange:g=>{A.settings.shortcutsViewMode=g.target.value}})," ",e("img",{src:b,alt:"",width:"80",height:"58"})," ",e("span",{children:p})]},a)})}),o.length>0?e(z,{children:[e("ol",{class:"shortcuts-list",ref:l,children:o.filter(Boolean).map((a,p)=>{const b=Object.values(a).join("-"),{type:m}=a;if(!Rn[m])return null;let{icon:g,title:u,subtitle:v,excludeViewMode:y}=Rn[m];typeof u=="function"?u=u(a,p):u=i(u),typeof v=="function"?v=v(a,p):v=i(v),typeof g=="function"&&(g=g(a,p)),typeof y=="function"&&(y=y(a,p));const w=y==null?void 0:y.includes(s.settings.shortcutsViewMode);return e("li",{children:[e(T,{icon:g}),e("span",{class:"shortcut-text",children:[e(vn,{children:u}),v&&e(z,{children:[" ",e("small",{class:"ib insignificant",children:v})]}),w&&e("span",{class:"tag",children:e(f,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:p===0,onClick:()=>{const S=Array.from(A.shortcuts);if(p>0){const _=A.shortcuts[p-1];S[p-1]=a,S[p]=_,A.shortcuts=S}},children:e(T,{icon:"arrow-up",alt:he._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:p===o.length-1,onClick:()=>{const S=Array.from(A.shortcuts);if(p<A.shortcuts.length-1){const _=A.shortcuts[p+1];S[p+1]=a,S[p]=_,A.shortcuts=S}},children:e(T,{icon:"arrow-down",alt:he._({id:"3Ib6FN"})})}),e("button",{type:"button",class:"plain small",onClick:()=>{r({shortcut:a,shortcutIndex:p})},children:e(T,{icon:"pencil",alt:he._({id:"ePK91l"})})})]})]},b)})}),o.length===1&&s.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(T,{icon:"info"})," ",e("small",{children:e(f,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"3xIN+E"}):he._({id:"vLxvHT"})}),e("p",{children:e(f,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:a=>{a.preventDefault(),A.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:o.length>=Ct&&(s.settings.shortcutsViewMode==="multi-column"?he._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:Ct}}):he._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:Ct}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>d(!0),children:e(f,{id:"bgVLbt"})}),e("button",{type:"button",disabled:o.length>=Ct,onClick:()=>r(!0),children:[e(T,{icon:"plus"})," ",e("span",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"Vh3ADI"}):he._({id:"9tmn6W"})})]})]})]}),c&&e(He,{onClick:a=>{a.target===a.currentTarget&&r(!1)},children:e(Na,{shortcut:c.shortcut,shortcutIndex:c.shortcutIndex,onSubmit:({result:a,mode:p})=>{p==="edit"?A.shortcuts[c.shortcutIndex]=a:A.shortcuts.push(a)},onClose:()=>r(!1)})}),h&&e(He,{onClick:a=>{a.target===a.currentTarget&&d(!1)},children:e(Oa,{shortcuts:o,onClose:()=>d(!1)})})]})}const Yi={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function Na({onSubmit:n,disabled:i,shortcut:s,shortcutIndex:o,onClose:c}){var y,w;const{_:r}=ue(),h=!!s,[d,l]=E((s==null?void 0:s.type)||null),[a,p]=E("default"),[b,m]=E([]),[g,u]=E([]);ie(()=>{(async()=>{if(d==="list")try{p("loading");const S=await ln();m(S),p("default")}catch{p("error")}})(),(async()=>{if(d==="hashtag")try{const S=await An();u(S)}catch{}})()},[d]);const v=Y();return ie(()=>{if(h&&d&&yn[d]){const S=v.current;yn[d].forEach(({name:_,type:k})=>{const x=S.querySelector(`[name="${_}"]`);x&&s[_]&&(k==="checkbox"?x.checked=s[_]==="on":x.value=s[_])})}},[h,d]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!c&&e("button",{type:"button",class:"sheet-close",onClick:c,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:h?he._({id:"pe1jog"}):he._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:v,onSubmit:S=>{S.preventDefault();const _=new FormData(S.target),k={};_.forEach((x,C)=>{k[C]=x==null?void 0:x.trim(),C==="instance"&&(k[C]=k[C].replace(/^https?:\/\//,"").replace(/\/+$/,""),k[C]=k[C].replace(/^@?[^@]+@/,""))}),k.type&&(n({result:k,mode:h?"edit":"add"}),S.target.reset(),l(null),c==null||c())},children:[e("p",{children:e("label",{children:[e("span",{children:e(f,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:S=>{l(S.target.value)},defaultValue:h?s.type:void 0,name:"type",dir:"auto",children:[e("option",{}),$a.map(S=>e("option",{value:S,children:r(Ys[S])}))]})]})}),(w=(y=yn[d])==null?void 0:y.map)==null?void 0:w.call(y,({text:S,name:_,type:k,placeholder:x,pattern:C,notRequired:I})=>d==="list"?e("p",{children:e("label",{children:[e("span",{children:e(f,{id:"2BBAbc"})}),e("select",{name:"id",required:!I,disabled:i||a==="loading",defaultValue:h?s.id:void 0,dir:"auto",children:[e("option",{value:""}),b.map(R=>e("option",{value:R.id,children:R.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:r(S)})," ",e("input",{type:k,switch:k==="checkbox"||void 0,name:_,placeholder:r(x),required:k==="text"&&!I,disabled:i,list:d==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:C,dir:"auto"}),d==="hashtag"&&g.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:g.map(R=>e("option",{value:R.name}))})]})})),!!Yi[d]&&e("p",{class:"form-note insignificant",children:[e(T,{icon:"info"}),r(Yi[d])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||a==="loading",children:h?he._({id:"tfDRzk"}):he._({id:"m16xKo"})}),h&&e("button",{type:"button",class:"light danger",onClick:()=>{A.shortcuts.splice(o,1),c==null||c()},children:e(f,{id:"t/YqKh"})})]})]})})]})}function Oa({shortcuts:n,onClose:i}){var m;const{_:s}=ue(),{masto:o}=ce(),c=Ce(()=>!n||!n.filter(Boolean).length?"":qi.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[r,h]=E(""),[d,l]=E("default"),a=Ce(()=>{if(!r)return l("default"),null;try{const g=JSON.parse(qi.decompressFromEncodedURIComponent(r));if(!Array.isArray(g))throw new Error("Not an array");return l("default"),g}catch{try{const u=JSON.parse(r);if(!Array.isArray(u))throw new Error("Not an array");return l("default"),u}catch{return l("error"),null}}},[r]),p=A.shortcuts.length>0,b=Y();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(f,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:b,type:"text",name:"import",placeholder:he._({id:"tBmklN"}),class:"block",onInput:g=>{h(g.target.value)},dir:"auto"}),A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:d==="cloud-downloading",onClick:async()=>{l("cloud-downloading");const g=yt();pe(he._({id:"HLqLGx"}));try{const v=(await o.v1.accounts.relationships.fetch({id:[g]}))[0];if(v){const{note:y=""}=v;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(y)){const w=y.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:S,dt:_,data:k}=JSON.parse(w);b.current.value=k,b.current.dispatchEvent(new Event("input"))}}l("default")}catch{l("error"),pe(he._({id:"gCDfX+"}))}},title:he._({id:"B6cG3J"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-down"})]})]}),!!a&&Array.isArray(a)&&e(z,{children:[e("p",{children:[e("b",{children:a.length})," shortcut",a.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",r.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:a.map(g=>{var u,v;return e("li",{children:[e("span",{style:{opacity:n.some(y=>Object.keys(y).every(w=>y[w]===g[w]))?1:0},children:"*"}),e("span",{children:[s(Ys[g.type]),g.type==="list"&&" ⚠️"," ",(v=(u=yn[g.type])==null?void 0:u.map)==null?void 0:v.call(u,({text:y,name:w,type:S})=>g[w]?e(z,{children:[e("span",{class:"tag collapsed insignificant",children:[y,":"," ",S==="checkbox"?g[w]==="on"?"✅":"❌":g[w]]})," "]}):null)]})]})})}),e("p",{children:[e("small",{children:e(f,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(f,{id:"N4z4P/"})]})]})]}),d==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(f,{id:"ZhsPEb"})]})}),e("p",{children:[p&&e(z,{children:[e(ut,{confirmLabel:he._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(f,{id:"nl8sCE"})}),onClick:()=>{const g=a.filter(y=>!A.shortcuts.some(w=>Object.keys(w).every(S=>w[S]===y[S])));if(!g.length){pe(he._({id:"o6L30P"}));return}let u=[...A.shortcuts,...g];const v=u.length>Ct;v&&(u=u.slice(0,Ct)),A.shortcuts=u,pe(v?he._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:Ct}}):he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:e(f,{id:"c89gCv"})})})," "]}),e(ut,{confirmLabel:p?he._({id:"6ZjzWP"}):he._({id:"DWumLi"}),menuItemClassName:p?"danger":void 0,onClick:()=>{A.shortcuts=a,pe(he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:p?he._({id:"uIp8WL"}):he._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(f,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:c,readOnly:!0,onClick:g=>{if(g.target.value){g.target.select();try{navigator.clipboard.writeText(g.target.value),pe(he._({id:"cWtH+v"}))}catch{pe(he._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.clipboard.writeText(c),pe(he._({id:"+Kq2vY"}))}catch{pe(he._({id:"tFvxZF"}))}},children:[e(T,{icon:"clipboard"})," ",e("span",{children:e(f,{id:"he3ygx"})})]})," ",(navigator==null?void 0:navigator.share)&&((m=navigator==null?void 0:navigator.canShare)==null?void 0:m.call(navigator,{text:c}))&&e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.share({text:c})}catch{alert(he._({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"})," ",e("span",{children:e(f,{id:"Z8lGw6"})})]})," ",A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:d==="cloud-uploading",onClick:async()=>{l("cloud-uploading");const g=yt();try{const v=(await o.v1.accounts.relationships.fetch({id:[g]}))[0];if(v){const{note:y=""}=v;let w="";const S=JSON.stringify({v:"1",dt:Date.now(),data:c});/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(y)?w=y.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${S}</phanpy-shortcuts-settings>`):w=`${y}
|
||
|
||
|
||
<phanpy-shortcuts-settings>${S}</phanpy-shortcuts-settings>`,pe(he._({id:"9ZYiLz"})),await o.v1.accounts.$select(g).note.create({comment:w}),l("default"),pe(he._({id:"5w02SH"}))}}catch{l("error"),pe(he._({id:"aVsTYo"}))}},title:he._({id:"gWd6Cu"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-up"})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(f,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(f,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(T,{icon:"cloud"})," ",e(f,{id:"C4T6O/"})]})})]})]})}fs(A,n=>{for(const[i,s,o,c]of n)/^show/i.test(s)&&!o&&Xn()});function za(){var c,r,h,d,l,a,p,b;const{_:n}=ue(),i=Ve(A),s=ps(),o=Zt();return ie(()=>{setTimeout(wo,1e3)},[]),e(z,{children:[!!i.showCompose&&e(He,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(ko,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:((c=window.__COMPOSE__)==null?void 0:c.replyToStatus)||null,editStatus:((r=A.showCompose)==null?void 0:r.editStatus)||((h=window.__COMPOSE__)==null?void 0:h.editStatus)||null,draftStatus:((d=A.showCompose)==null?void 0:d.draftStatus)||((l=window.__COMPOSE__)==null?void 0:l.draftStatus)||null,onClose:m=>{const{newStatus:g,instance:u,type:v,scheduledAt:y}=m||{};A.showCompose=!1,window.__COMPOSE__=null,g&&(A.reloadStatusPage++,y&&A.reloadScheduledPosts++,pe({text:{post:n(y?{id:"IrX0sj"}:{id:"aTyHBW"}),reply:n(y?{id:"+38pse"}:{id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[v||"post"],delay:1e3,duration:1e4,onClick:w=>{w.hideToast(),A.prevLocation=o,s(y?"/sp":u?`/${u}/s/${g.id}`:`/s/${g.id}`)}}))}})}),!!i.showSettings&&e(He,{onClose:()=>{A.showSettings=!1},children:e(Ec,{onClose:()=>{A.showSettings=!1}})}),!!i.showAccounts&&e(He,{onClose:()=>{A.showAccounts=!1},children:e(yc,{onClose:()=>{A.showAccounts=!1}})}),!!i.showAccount&&e(He,{onClose:()=>{A.showAccount=!1},children:e(ea,{account:((a=i.showAccount)==null?void 0:a.account)||i.showAccount,instance:(p=i.showAccount)==null?void 0:p.instance,onClose:({destination:m}={})=>{A.showAccount=!1}})}),!!i.showDrafts&&e(He,{onClose:()=>{A.showDrafts=!1},children:e(ta,{onClose:()=>A.showDrafts=!1})}),!!i.showMediaModal&&e(He,{onClick:m=>{(m.target===m.currentTarget||m.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(js,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.index,statusID:i.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(He,{onClose:()=>{A.showShortcutsSettings=!1},children:e(Pa,{onClose:()=>A.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(He,{onClose:()=>{A.showGenericAccounts=!1},children:e(sa,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(He,{onClose:m=>{A.showMediaAlt=!1},children:e(oa,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:(b=i.showMediaAlt)==null?void 0:b.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(He,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(ia,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!i.showReportModal&&e(He,{onClose:()=>{A.showReportModal=!1},children:e(Ca,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Qn({accountID:n,onChange:i}){const{_:s}=ue(),{masto:o}=ce(),[c,r]=E("default"),[h,d]=E(null),[l,a]=E(null),p=l!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||p,onClick:()=>{r("loading"),d("accept"),(async()=>{try{const b=await o.v1.followRequests.$select(n).authorize();if(!(b!=null&&b.followedBy))throw new Error("Follow request not accepted");a(b),i()}catch{}r("default")})()},children:e(f,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:c==="loading"||p,class:"light danger",onClick:()=>{r("loading"),d("reject"),(async()=>{try{const b=await o.v1.followRequests.$select(n).reject();if(b!=null&&b.followedBy)throw new Error("Follow request not rejected");a(b),i()}catch{r("default")}})()},children:e(f,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:p&&h?h==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"follow-accepted"}):e(T,{icon:"x-circle",alt:s({id:"ekCRTP"}),class:"follow-rejected"}):e(Ue,{hidden:c!=="loading"})})]})}const Vi={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 Gi({account:n,emoji:i,emoji_url:s}){let o,c;typeof s=="string"?o=s:(o=s==null?void 0:s.url,c=s==null?void 0:s.staticUrl);const r=o?e(Bo,{url:o,staticUrl:c,alt:i}):i;return e(f,{id:"i5uN6K",values:{account:n,emojiObject:r}})}const qn={status:({account:n})=>e(f,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(f,{id:"jkt9P5",values:{0:Je(n),1:Je(n),count:n,postsCount:s,postType:o,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:s}})=>e(f,{id:"+71G9C",values:{0:Je(i),count:i,account:n},components:{0:e(s,{clickable:i>1}),1:e("span",{title:i})}}),follow_request:({account:n})=>e(f,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:s,postType:o,components:{Subject:c}})=>e(f,{id:"RqX1mR",values:{0:Je(i),1:Je(i),count:i,postsCount:s,postType:o,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:()=>he._({id:"kIlJaS"}),"poll-self":()=>he._({id:"kpjzdN"}),"poll-voted":()=>he._({id:"moT7M8"}),update:()=>he._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(f,{id:"NunZZQ",values:{0:Je(n),1:Je(n),count:n,postsCount:s,postType:o,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(f,{id:"fJCCpx",values:{account:n}}),"admin.report":({account:n,targetAccount:i})=>e(f,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(f,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(f,{id:"YqffEv"})}),emoji_reaction:Gi,"pleroma:emoji_reaction":Gi,annual_report:({year:n})=>e(f,{id:"INLTzH",values:{year:n}})},Ua={account_suspension:({from:n,targetName:i})=>e(f,{id:"uRkcgw",values:{from:n,targetName:i},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:n,targetName:i,followersCount:s,followingCount:o})=>e(f,{id:"Q3yArs",values:{from:n,targetName:i,followersCount:s,followingCount:o},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:n,followersCount:i,followingCount:s})=>e(f,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:s},components:{0:e("i",{})}})},Ba={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"}},jn=30;function Fa({notification:n,instance:i,isStatic:s,disableContextMenu:o}){var B,G,le,H,se,be,we;const{_:c}=ue(),{masto:r}=ce(),{id:h,status:d,account:l,report:a,event:p,moderation_warning:b,annualReport:m,_ids:g,_accounts:u,_statuses:v,_groupKeys:y,sampleAccounts:w,notificationsCount:S,groupKey:_}=n;let{type:k}=n;if(k==="mention"&&!d)return null;const x=(d==null?void 0:d.reblog)||d,C=x==null?void 0:x.id,I=yt(),R=I===(l==null?void 0:l.id),L=(B=d==null?void 0:d.poll)==null?void 0:B.voted,F=!!(d!=null&&d.inReplyToAccountId)&&(d==null?void 0:d.inReplyToAccountId)!==I&&((G=d==null?void 0:d.account)==null?void 0:G.id)===I;let P=0,q=0;if(k==="favourite+reblog"){if(u)for(const X of u)(le=X._types)!=null&&le.includes("favourite")&&P++,(H=X._types)!=null&&H.includes("reblog")&&q++;!q&&P&&(k="favourite"),!P&&q&&(k="reblog")}let te;k==="poll"?te=qn[R?"poll-self":L?"poll-voted":"poll"]:qn[k]?te=qn[k]:te=he._({id:"ODqZt1",values:{type:k}});const ee=({clickable:X,...de})=>X?e("b",{tabIndex:"0",onClick:U,...de}):e("b",{...de});if(typeof te=="function"){const X=(u==null?void 0:u.length)||(w==null?void 0:w.length)||(l?1:0),de=(v==null?void 0:v.length)||(d?1:0);if(k==="admin.report"){const Ee=a==null?void 0:a.targetAccount;Ee&&(te=te({account:e(mt,{account:l,showAvatar:!0}),targetAccount:e(mt,{account:Ee,showAvatar:!0})}))}else if(k==="severed_relationships"){const Ee=p==null?void 0:p.targetName;Ee&&(te=te({name:Ee}))}else if((k==="emoji_reaction"||k==="pleroma:emoji_reaction")&&n.emoji){const Ee=n.emoji_url||((be=(se=d==null?void 0:d.emojis)==null?void 0:se.find)==null?void 0:be.call(se,$e=>($e==null?void 0:$e.shortcode)===n.emoji.replace(/^:/,"").replace(/:$/,"")));te=te({account:e(mt,{account:l,showAvatar:!0}),emoji:n.emoji,emojiURL:Ee})}else k==="annual_report"?te=te({...n.annualReport}):te=te({account:l?e(mt,{account:l,showAvatar:!0}):(w==null?void 0:w[0])&&e(mt,{account:w[0],showAvatar:!0}),count:X,postsCount:de,postType:F?"reply":"post",components:{Subject:ee}})}const W=n.createdAt&&new Date(n.createdAt).toLocaleString(),j={"favourite+reblog":he._({id:"+XOeb+"}),favourite:he._({id:"LQFF6J"}),reblog:he._({id:"phQpSa"}),follow:he._({id:"Ih01jh"})}[k]||he._({id:"bPwFdf"}),U=()=>{A.showGenericAccounts={heading:j,accounts:u,showReactions:k==="favourite+reblog",excludeRelationshipAttrs:k==="follow"?["followedBy"]:[],postID:at(C,i)}},$=S>0&&S>(w==null?void 0:w.length)?"remote":"local";if(d!=null&&d.filtered){const X=((we=d==null?void 0:d.account)==null?void 0:we.id)===I,de=jt(d.filtered,"notifications");if(!R&&!X&&(de==null?void 0:de.action)==="hide")return null}return e("div",{class:`notification notification-${k}`,"data-notification-id":g||h,"data-group-key":(y==null?void 0:y.join(" "))||_,tabIndex:"0",children:[e("div",{class:`notification-type notification-${k}`,title:W,children:k==="favourite+reblog"?e(z,{children:[e(T,{icon:"rocket",size:"xl",alt:k,class:"reblog-icon"}),e(T,{icon:"heart",size:"xl",alt:k,class:"favourite-icon"})]}):e(T,{icon:Vi[k]||"notification",size:"xl",alt:k})}),e("div",{class:"notification-content",children:[k!=="mention"&&e(z,{children:[e("p",{children:te}),k==="follow_request"&&e(Qn,{accountID:l.id}),k==="severed_relationships"&&e("div",{children:[Ua[p.type]({from:i,...p}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener",children:e(f,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})}),"."]}),k==="moderation_warning"&&!!b&&e("div",{children:[c(Ba[b.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${b.id}`,target:"_blank",rel:"noopener",children:e(f,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})})]}),k==="annual_report"&&e("div",{children:e(ge,{to:`/annual_report/${m==null?void 0:m.year}`,children:e(f,{id:"5PGPvG"})})})]}),(u==null?void 0:u.length)>1&&e("p",{class:"avatars-stack",children:[u.slice(0,jn).map(X=>e(z,{children:[e("a",{href:X.url,rel:"noopener",class:"account-avatar-stack",onClick:de=>{de.preventDefault(),A.showAccount=X},children:[e(ft,{url:X.avatarStatic,size:u.length<=10?"xxl":u.length<20?"xl":"l",alt:`${X.displayName} @${X.acct}`,squircle:X==null?void 0:X.bot},X.id),k==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:X._types.map(de=>e(T,{icon:Vi[de],size:"s",class:`${de}-icon`}))})]},X.id)," "]},X.id)),k==="favourite+reblog"&&$==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":y==null?void 0:y.join(" "),onClick:()=>{A.showGenericAccounts={heading:j,fetchAccounts:async()=>{const X=await Promise.allSettled(y.map(async Ee=>{const $e=r.v2.notifications.$select(Ee).accounts.list();return[Ee,(await $e.next()).value]})),de=[];for(const Ee of X){const[$e,Pe]=Ee.value,ze=/^favourite/.test($e)?"favourite":/^reblog/.test($e)?"reblog":null;if(ze)for(const Le of Pe){const Ae=de.find(J=>J.id===Le.id);Ae?Ae._types.push(ze):(Le._types=[ze],de.push(Le))}}return{done:!0,value:de}},showReactions:!0,postID:at(C,i)}},children:e(T,{icon:"chevron-down"})}):e("button",{type:"button",class:"small plain",onClick:U,children:[u.length>jn&&`+${u.length-jn}`,e(T,{icon:"chevron-down"})]})]}),!(u!=null&&u.length)&&(w==null?void 0:w.length)>1&&e("p",{class:"avatars-stack",children:[w.map(X=>e(z,{children:[e("a",{href:X.url,rel:"noopener",class:"account-avatar-stack",onClick:de=>{de.preventDefault(),A.showAccount=X},children:e(ft,{url:X.avatarStatic,size:"xxl",alt:`${X.displayName} @${X.acct}`,squircle:X==null?void 0:X.bot},X.id)},X.id)," "]},X.id)),S>w.length&&e(ge,{to:i?`/${i}/s/${d.id}`:`/s/${d.id}`,class:"button small plain centered",children:["+",S-w.length,e(T,{icon:"chevron-right"})]})]}),(v==null?void 0:v.length)>1&&e("ul",{class:"notification-group-statuses",children:v.map(X=>e("li",{children:e(Ki,{class:`status-link status-type-${k}`,to:i?`/${i}/s/${X.id}`:`/s/${X.id}`,children:e(je,{status:X,size:"s",previewMode:!0,allowContextMenu:!0})})},X.id))}),d&&(!(v!=null&&v.length)||(v==null?void 0:v.length)<=1)&&e(Ki,{class:`status-link status-type-${k}`,to:i?`/${i}/s/${C}`:`/s/${C}`,onContextMenu:o?void 0:X=>{const de=X.target.querySelector(".status");if(de){if(X.metaKey)return;X.preventDefault(),de.dispatchEvent(new MouseEvent("contextmenu",{clientX:X.clientX,clientY:X.clientY}))}},children:s?e(je,{status:x,size:"s",readOnly:!0,allowContextMenu:!0}):e(je,{statusID:C,size:"s",readOnly:!0,allowContextMenu:!0})})]})]})}function Ki(n){const i=Fo();return e(ge,{...n,"data-read-more":he._({id:"8fZueG"}),ref:i})}const cn=lt(Fa,(n,i)=>{var s,o;return((s=n.notification)==null?void 0:s.id)===((o=i.notification)==null?void 0:o.id)});"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:s,accessToken:o}=(n==null?void 0:n.data)||{};i==="notification"&&(A.routeNotification={id:s,accessToken:o})});const Ha=lt(function(){const{_:i}=ue();if(!("serviceWorker"in navigator))return null;const s=Ve(A),{routeNotification:o}=s,{id:c,accessToken:r}=o||{},[h,d]=E(!1);wt(()=>{if(!c||!r)return;const{instance:a}=ce(),{masto:p,instance:b}=ce({accessToken:r}),m=a===b,g=r?So(r):si();(async()=>{const u=await p.v1.notifications.$select(c).fetch();if(u&&g){const v=g.instanceURL,{type:y,status:w,account:S}=u,_=!!document.querySelector("#modal-container > *"),k=y==="follow"&&!!(S!=null&&S.id),x=!!(S!=null&&S.id),C=!!(w!=null&&w.id);k&&m?A.showAccount={account:S,instance:v}:_||!m||x&&C?d({id:c,account:g,notification:u,sameInstance:m}):C?location.hash=`/${a}/s/${w.id}`:k?location.hash=`/${a}/a/${S.id}`:location.hash="/notifications"}})()},[c,r]),wt(()=>{navigator!=null&&navigator.clearAppBadge&&navigator.clearAppBadge()},[]),Yt(a=>{a&&(navigator!=null&&navigator.clearAppBadge)&&navigator.clearAppBadge()});const l=()=>{d(!1),A.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(h){const{id:a,account:p,notification:b,sameInstance:m}=h;return e(He,{onClick:g=>{g.target===g.currentTarget&&l()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:l,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(f,{id:"5+87Pq"})})}),e("main",{children:[!m&&e("p",{children:e(f,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:g=>{const{target:u}=g;(g.target.tagName==="BUTTON"||g.target.tagName==="A")&&l()},children:e(cn,{instance:p.instanceURL,notification:b,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(ge,{to:"/notifications",class:"button light",onClick:l,children:[e("span",{children:e(f,{id:"/WA/tl"})})," ",e(T,{icon:"arrow-right"})]})})]})]})})}return null}),Vs=Co((n,i)=>{const{_:s}=ue(),{instance:o}=ce(),[c,r]=bt(),[h,d]=E(!1),[l,a]=E(c.get("q")||""),p=c.get("type"),b=Y(null),m=Y(null);return _o(i,()=>({setValue:g=>{a(g)},focus:()=>{m.current.focus()},select:()=>{m.current.select()},blur:()=>{m.current.blur()}})),e("form",{ref:b,class:"search-popover-container",onSubmit:g=>{var v;if(g.preventDefault(),/\/search/.test(location.hash))if(l){const y={q:l};p&&(y.type=p),r(y)}else r({});else l?location.hash=`/search?q=${encodeURIComponent(l)}${p?`&type=${p}`:""}`:location.hash="/search";(v=n==null?void 0:n.onSubmit)==null||v.call(n,g)},children:[e("input",{ref:m,value:l,name:"q",type:"search",placeholder:s({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:g=>{g.target.value||r({})},onInput:g=>{a(g.target.value),d(!0)},onFocus:()=>{var g,u;d(!0),(u=(g=b.current)==null?void 0:g.querySelector(".search-popover-item"))==null||u.classList.add("focus")},onBlur:()=>{var g,u;setTimeout(()=>{d(!1)},100),(u=(g=b.current)==null?void 0:g.querySelector(".search-popover-item.focus"))==null||u.classList.remove("focus")},onKeyDown:g=>{var v;const{key:u}=g;switch(u){case"Escape":d(!1);break;case"Down":case"ArrowDown":if(g.preventDefault(),h){const y=b.current.querySelector(".search-popover-item.focus");if(y){let w=y.nextElementSibling;for(;w&&w.hidden;)w=w.nextElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(_=>_!==w).forEach(_=>{_.classList.remove("focus")}))}else{const w=b.current.querySelector(".search-popover-item");w&&w.classList.add("focus")}}break;case"Up":case"ArrowUp":if(g.preventDefault(),h){const y=document.querySelector(".search-popover-item.focus");if(y){let w=y.previousElementSibling;for(;w&&w.hidden;)w=w.previousElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(_=>_!==w).forEach(_=>{_.classList.remove("focus")}))}else{const w=document.querySelector(".search-popover-item:last-child");w&&w.classList.add("focus")}}break;case"Enter":if(h){const y=document.querySelector(".search-popover-item.focus");y&&(g.preventDefault(),y.click()),d(!1),(v=n==null?void 0:n.onSubmit)==null||v.call(n,g)}break}}}),e("div",{class:"search-popover",hidden:!h||!l,children:!!l&&[{label:e(f,{id:"48oDit",values:{query:l},components:{0:e("small",{class:"insignificant"})}}),to:`/search?q=${encodeURIComponent(l)}`,top:!p&&!/\s/.test(l),hidden:!!p},{label:e(f,{id:"o1mMWT",values:{query:l},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(l)}&type=statuses`,hidden:/^https?:/.test(l),top:/\s/.test(l),icon:"document",queryType:"statuses"},{label:e(f,{id:"YAZw8D",values:{0:l.replace(/^#/,"")},components:{0:e("mark",{})}}),to:`/${o}/t/${l.replace(/^#/,"")}`,hidden:/^@/.test(l)||/^https?:/.test(l)||/\s/.test(l),top:/^#/.test(l),type:"link",icon:"hashtag",queryType:"hashtags"},{label:e(f,{id:"gEoOUj",values:{query:l},components:{0:e("mark",{})}}),to:`/${l}`,hidden:!/^https?:/.test(l),top:/^https?:/.test(l),type:"link"},{label:e(f,{id:"cDoNQr",values:{query:l},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(l)}&type=accounts`,icon:"group",queryType:"accounts"}].sort((g,u)=>{if(p){if(g.queryType===p)return-1;if(u.queryType===p)return 1}return g.top&&!u.top?-1:!g.top&&u.top?1:0}).filter(({hidden:g})=>!g).map(({label:g,to:u,icon:v,type:y},w)=>e(ge,{to:u,class:`search-popover-item ${w===0?"focus":""}`,onClick:S=>{var _;(_=n==null?void 0:n.onSubmit)==null||_.call(n,S)},children:[e(T,{icon:v||(y==="link"?"arrow-right":"search"),class:"more-insignificant"}),e("span",{children:g})," "]}))})]})}),qa=lt(function({onClose:i=()=>{}}){const[s,o]=E(!1),c=Y(null);Fe(["Slash","/"],h=>{o(!0),setTimeout(()=>{var d,l,a,p;(l=(d=c.current)==null?void 0:d.focus)==null||l.call(d),(p=(a=c.current)==null?void 0:a.select)==null||p.call(a)},0)},{preventDefault:!0,ignoreEventWhen:h=>{const d=/\/search/.test(location.hash),l=!!document.querySelector("#modal-container > *");return d||l}});const r=()=>{o(!1),i()};return Fe("esc",h=>{var d,l;(l=(d=c.current)==null?void 0:d.blur)==null||l.call(d),r()},{enabled:s,enableOnFormTags:!0,preventDefault:!0}),e("div",{id:"search-command-container",hidden:!s,onClick:h=>{h.target===h.currentTarget&&r()},children:e(Vs,{ref:c,onSubmit:()=>{r()}})})});function ja(){const{_:n,_:i}=ue(),{instance:s}=ce(),o=Ve(A),{shortcuts:c,settings:r}=o;if(!c.length)return null;const h=r.shortcutsViewMode==="multi-column"||!r.shortcutsViewMode&&r.shortcutsColumnsMode;if(h)return null;const d=Y(),l=Y(!1),a=c.map((g,u)=>{const{type:v,...y}=g;if(!Rn[v])return null;let{id:w,path:S,title:_,subtitle:k,icon:x}=Rn[v];return typeof w=="function"&&(w=w(y,u)),typeof S=="function"&&(S=S({...y,instance:y.instance||s},u)),typeof _=="function"?_=_(y,u):_=i(_),typeof k=="function"?k=k(y,u):k=i(k),typeof x=="function"&&(x=x(y,u)),w==="lists"&&(l.current=!0),{id:w,path:S,title:_,subtitle:k,icon:x}}).filter(Boolean),p=ps();Fe(["1","2","3","4","5","6","7","8","9"],(g,u)=>{var y,w;const v=parseInt(u.keys[0],10)-1;if(v<a.length){const{path:S}=a[v];S&&(p(S),(w=(y=d.current)==null?void 0:y.closeMenu)==null||w.call(y))}},{enabled:!h});const[b,m]=E([]);return e("div",{id:"shortcuts",children:o.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{class:"tab-bar",onContextMenu:g=>{g.preventDefault(),A.showShortcutsSettings=!0},children:e("ul",{children:a.map(({id:g,path:u,title:v,subtitle:y,icon:w},S)=>e("li",{children:e(ge,{class:y?"has-subtitle":"",to:u,onClick:_=>{if(_.target.classList.contains("is-active")){_.preventDefault();const k=document.getElementById(`${g}-page`);if(k){k.scrollTop=0;const x=k.querySelector(".updates-button");x&&x.click()}}},children:[e(T,{icon:w,size:"xl",alt:v}),e("span",{children:[e(vn,{children:v}),y&&e(z,{children:[e("br",{}),e("small",{children:y})]})]})]})},`${S}-${g}-${v}-${y}-${u}`))})}):e(rt,{instanceRef:d,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:g=>{g.open&&l.current&&ln().then(m)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:g=>{g.preventDefault(),A.showShortcutsSettings=!0},onTransitionStart:g=>{var u,v;try{const{target:y}=g;getComputedStyle(y).pointerEvents==="none"&&((v=(u=d.current)==null?void 0:u.closeMenu)==null||v.call(u))}catch{}},children:e(T,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:a.map(({id:g,path:u,title:v,subtitle:y,icon:w},S)=>g==="lists"?e(an,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(z,{children:[e(T,{icon:w,size:"l"}),e("span",{class:"menu-grow",children:e(vn,{children:v})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(f,{id:"BHWx+g"})})}),e(Ke,{}),b==null?void 0:b.map(_=>e(qe,{to:`/l/${_.id}`,children:e("span",{children:_.title})},_.id))]}):e(qe,{to:u,class:"glass-menu-item",children:[e(T,{icon:w,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(vn,{children:v})}),y&&e(z,{children:[" ",e("small",{class:"more-insignificant",children:y})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:S+1})]},`${S}-${g}-${v}-${y}-${u}`))})})}const Ya=lt(ja);function Va(n){var c;let i=[],s=[],o=0;for(let r=0;r<n.length;r++){const h=n[r];h.reblog&&!((c=h.account)!=null&&c.group)?(s.push(h),o++):(i.push(h),o<3&&(o=0))}if(n.length>10&&(s.length>n.length/4||o>=3)){const r=s.map(h=>h.id);if(s.length>n.length*3/4)i=[...i,{id:r,items:s,type:"boosts"}];else{const h=Math.floor(i.length/2);i=[...i.slice(0,h),{id:r,items:s,type:"boosts"},...i.slice(h)]}return i}else return n}function Zi(n,i){const s=ve.account.get("boostedStatusIDs")||{},o=n.filter(r=>{if(!r.reblog)return!0;const h=`${i}-${r.reblog.id}`,d=s[h];return d&&d!==r.id?!1:(s[h]=r.id,!0)}),c=Object.keys(s);return c.length>50&&c.slice(0,c.length-50).forEach(r=>{delete s[r]}),ve.account.set("boostedStatusIDs",s),o}function Ga(n,i){const s=[];let o=0;n.forEach(d=>{for(let a=0;a<s.length;a++){if(s[a].find(p=>p.id===d.id))return;if(s[a].find(p=>p.id===d.inReplyToId)||s[a].find(p=>p.inReplyToId===d.id)){s[a].push(d);return}}const l=n.find(a=>a.id===d.inReplyToId);l&&(s[o++]=[d,l])});for(let d=0;d<s.length;d++)for(let l=d+1;l<s.length;l++)s[d].find(p=>s[l].includes(p))&&(s[d]=[...s[d],...s[l]],s[d]=s[d].filter((p,b,m)=>m.findIndex(g=>g.id===p.id)===b),s.splice(l,1),l--);s.forEach(d=>{d.sort((l,a)=>!l.inReplyToId&&!a.inReplyToId?new Date(l.createdAt)-new Date(a.createdAt):l.inReplyToId===a.id?1:a.inReplyToId===l.id||!l.inReplyToId?-1:a.inReplyToId?new Date(l.createdAt)-new Date(a.createdAt):1)}),s.forEach(d=>{const l=d[0].account.id;d.forEach(a=>{a.account.id!==l&&(a._differentAuthor=!0)})}),s.length;const c=[],r=[],h=[];return n.forEach(d=>{if(d.reblog){c.push(d);return}for(let l=0;l<s.length;l++)if(s[l].find(a=>a.id===d.id)){if(r.includes(l))return;const a=s[l];a.sort((b,m)=>{const g=new Date(b.createdAt),u=new Date(m.createdAt);return g-u});const p=a[0].account.id;c.push({id:a.map(b=>b.id),items:a,type:a.every(b=>b.account.id===p)?"thread":"conversation"}),r.push(l);return}if(d.inReplyToId&&d.inReplyToAccountId!==d.account.id){const l=at(d.id,i);A.statusReply[l]||h.push({sKey:l,inReplyToId:d.inReplyToId})}c.push(d)}),h!=null&&h.length&&queueMicrotask(()=>{const{masto:d}=ce({instance:i});async function l(){for(let a=0;a<h.length;a++){const{sKey:p,inReplyToId:b}=h[a];try{const m=await Ka(b,d);Qe(m,i,{skipThreading:!0}),A.statusReply[p]={id:m.id,instance:i},await new Promise(g=>setTimeout(g,1e3))}catch{}}}if(et("@mastodon/fetch-multiple-statuses")){const a=h.map(({inReplyToId:p})=>p);(async()=>{var p;try{const b=await d.v1.statuses.list({id:a});if(b!=null&&b.length)for(const m of b){Qe(m,i,{skipThreading:!0});const g=(p=h.find(({inReplyToId:u})=>u===m.id))==null?void 0:p.sKey;g&&(A.statusReply[g]={id:m.id,instance:i})}else l()}catch{l()}})()}else l()}),c}const Ka=gt((n,i)=>i.v1.statuses.$select(n).fetch());async function Gs(n,i){const s=await La();if(!s.length)return;const{statusFollowedTags:o}=A,c=[];if(n.forEach(r=>{var m;if(r.reblog)return;const{id:h,content:d,tags:l=[]}=r,a=at(h,i);if((m=o[a])!=null&&m.length)return;const p=Ma(d);if(!p.length&&!l.length)return;const b=s.reduce((g,u)=>((p.some(v=>v.toLowerCase()===u.name.toLowerCase())||l.some(v=>v.name.toLowerCase()===u.name.toLowerCase()))&&g.push(u.name),g),[]);b.length&&c.push({item:r,sKey:a,followedTags:b})}),c.length){const r=c.map(d=>d.item.account),h=await li(r);if(!h)return;c.forEach(d=>{const{item:l,sKey:a,followedTags:p}=d,b=h[l.account.id];b&&!b.following&&(o[a]=p)})}}function Za(){A.statusFollowedTags={}}function Wa({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:h,distanceFromEndPx:d}={}){const[l,a]=E(null),[p,b]=E(!1),[m,g]=E(!1),[u,v]=E(!1),[y,w]=E(!1),S=r==="vertical";return wt(()=>{const _=n.current;if(!_)return{};let k=S?_.scrollTop:_.scrollLeft;function x(){const{scrollTop:C,scrollLeft:I,scrollHeight:R,scrollWidth:L,clientHeight:F,clientWidth:P}=_,q=S?C:I,te=S?R:L,ee=S?F:P,W=Math.abs(q-k),j=h||Math.min(ee*i,te,q),U=d||Math.min(ee*s,te,te-q-ee);W>=(k<q?c:o)&&(a(k<q?"end":"start"),k=q),b(q<=0),g(q+ee>=te),v(q<=j),w(q+ee>=te-U)}return _.addEventListener("scroll",x,{passive:!0}),()=>_.removeEventListener("scroll",x)},[i,s,o,c]),{scrollDirection:l,reachStart:p,reachEnd:m,nearReachStart:u,nearReachEnd:y,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function Xa({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:h,distanceFromEndPx:d,init:l}={},a,p){if(!a)return;const b=r==="vertical",m=Y(null),g=Y(null),u=Ho(()=>{let v=!1,y=!1,w=!1,S=!1;const _=n.current,{scrollTop:k,scrollLeft:x,scrollHeight:C,scrollWidth:I,clientHeight:R,clientWidth:L}=_,F=b?k:x,P=b?C:I,q=b?R:L,te=Math.abs(F-m.current),ee=h||Math.min(q*i,P,F),W=d||Math.min(q*s,P,P-F-q);te>=(m.current<F?c:o)&&(g.current=m.current<F?"end":"start",m.current=F),v=F<=0,y=F+q>=P,w=F<=ee,S=F+q>=P-W,a({scrollDirection:g.current,reachStart:v,reachEnd:y,nearReachStart:w,nearReachEnd:S})},500);wt(()=>{const v=n.current;return v?(m.current=v[b?"scrollTop":"scrollLeft"],v.addEventListener("scroll",u,{passive:!0}),()=>v.removeEventListener("scroll",u)):{}},[i,s,o,c,...p]),ie(()=>{l&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[l])}function Ja({class:n,statusID:i,status:s,instance:o,parent:c,onMediaClick:r}){const{_:h}=ue();let d=at(i,o);const l=Ve(A);if(s||(s=l.statuses[d]||l.statuses[i],d=at(s==null?void 0:s.id,o)),!s)return null;const{account:{acct:a,avatar:p,avatarStatic:b,id:m,url:g,displayName:u,username:v,emojis:y,bot:w,group:S},id:_,repliesCount:k,reblogged:x,reblogsCount:C,favourited:I,favouritesCount:R,bookmarked:L,poll:F,muted:P,sensitive:q,spoilerText:te,visibility:ee,language:W,editedAt:j,filtered:U,card:ae,createdAt:$,inReplyToId:B,inReplyToAccountId:G,content:le,mentions:H,mediaAttachments:se,reblog:be,uri:we,url:X,emojis:de,_deleted:Ee,_pinned:$e}=s;if(!(se!=null&&se.length))return null;const Pe=Re=>{Re.shiftKey},ze=Ce(()=>yt(),[]),Le=Ce(()=>ze&&ze===m,[m,ze]),Ae=Io(Is),J=!Le&&jt(U,Ae);if((J==null?void 0:J.action)==="hide")return null;const _e=q,ne=Ce(()=>{var O;return((O=(ve.account.get("preferences")||{})["reading:expand:media"])==null?void 0:O.toLowerCase())||"default"},[])==="show_all",oe=c||"div";return se.map((Re,O)=>{const Q=`${d}-${Re.id}`,fe=J==null?void 0:J.titlesStr;return e(oe,{"data-state-post-id":d,onMouseEnter:Pe,"data-spoiler-text":te||(q?h({id:"FKojeB"}):void 0),"data-filtered-text":J?h(fe?{id:"7FGvtQ",values:{filterTitleStr:fe}}:{id:"03Qqf9"}):void 0,class:`
|
||
media-post
|
||
${J?"filtered":""}
|
||
${_e?"has-spoiler":""}
|
||
${ne?"show-media":""}
|
||
`,children:e(_s,{class:n,media:Re,lang:W,to:`/${o}/s/${_}?media-only=${O+1}`,onClick:r?N=>r(N,O,Re,s):void 0})},Q)})}const Wi=lt(Ja);function Qa(n){var _,k,x,C,I;const{_:i}=ue(),s=Ve(A),{masto:o,instance:c,authenticated:r}=ce(),[h,d]=Ce(()=>{const R=ve.local.getJSON("accounts")||[];return[R.find(F=>F.info.id===yt())||R[0],R.length>1]},[]),l=(s.settings.shortcutsViewMode==="multi-column"||!s.settings.shortcutsViewMode&&s.settings.shortcutsColumnsMode)&&!s.shortcuts.find(R=>R.type==="following"),a=bs(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),p=Y(),[b,m]=E(void 0),g=ys([0,0,s.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),u=Y();async function v(R){return(R||!u.current)&&(u.current=o.v1.mutes.list({limit:80})),await u.current.next()}const y=Y();async function w(R){return(R||!y.current)&&(y.current=o.v1.blocks.list({limit:80})),await y.current.next()}const S=Y();return e(z,{children:[e("button",{ref:p,type:"button",class:`button plain nav-menu-button ${d?"with-avatar":""} ${b==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{S.current=Date.now(),m(R=>R?void 0:"open")},onContextMenu:R=>{R.preventDefault(),A.showAccounts=!0},...a(),children:[d&&e(ft,{url:((_=h==null?void 0:h.info)==null?void 0:_.avatar)||((k=h==null?void 0:h.info)==null?void 0:k.avatarStatic),size:"l",squircle:(x=h==null?void 0:h.info)==null?void 0:x.bot}),e(T,{icon:"menu",size:d?"s":"l",alt:i({id:"zucql+"})})]}),e(ri,{menuClassName:"nav-menu",state:b,anchorRef:p,onClose:()=>{m(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-S.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:g,unmountOnClose:!0,children:[!!((C=s.appVersion)!=null&&C.commitHash)&&s.appVersion.commitHash!=="85d964f"&&e("div",{class:"top-menu",children:[e(ye,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(T,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(f,{id:"95IFnD"})})]}),e(Ke,{})]}),e("section",{children:[e(qe,{to:"/",children:[e(T,{icon:"home",size:"l"})," ",e("span",{children:e(f,{id:"i0qMbr"})})]}),r?e(z,{children:[l&&e(qe,{to:"/following",children:[e(T,{icon:"following",size:"l"})," ",e("span",{children:e(f,{id:"following.title"})})]}),e(qe,{to:"/catchup",children:[e(T,{icon:"history2",size:"l"}),e("span",{children:e(f,{id:"xrl8fj"})})]}),et("@mastodon/mentions")&&e(qe,{to:"/mentions",children:[e(T,{icon:"at",size:"l"})," ",e("span",{children:e(f,{id:"/bZzdR"})})]}),e(qe,{to:"/notifications",children:[e(T,{icon:"notification",size:"l"})," ",e("span",{children:e(f,{id:"iDNBZe"})}),s.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ke,{}),((I=h==null?void 0:h.info)==null?void 0:I.id)&&e(qe,{to:`/${c}/a/${h.info.id}`,children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(f,{id:"vERlcd"})})]}),e(er,{menuState:b}),e(qe,{to:"/b",children:[e(T,{icon:"bookmark",size:"l"})," ",e("span",{children:e(f,{id:"7Ff7ia"})})]}),e(an,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(z,{children:[e(T,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(f,{id:"24misb"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/f",children:[e(T,{icon:"heart",size:"l"})," ",e("span",{children:e(f,{id:"zZOZj7"})})]}),e(qe,{to:"/fh",children:[e(T,{icon:"hashtag",size:"l"})," ",e("span",{children:e(f,{id:"Xi1/bw"})})]}),e(qe,{to:"/sp",children:[e(T,{icon:"schedule",size:"l"})," ",e("span",{children:e(f,{id:"+GkIdc"})})]}),e(Ke,{}),et("@mastodon/filters")&&e(qe,{to:"/ft",children:[e(T,{icon:"filters",size:"l"})," ",e("span",{children:e(f,{id:"cSev+j"})})]}),e(ye,{onClick:()=>{A.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:v,excludeRelationshipAttrs:["muting"]}},children:[e(T,{icon:"mute",size:"l"})," ",e("span",{children:e(f,{id:"n1sANU"})})]}),e(ye,{onClick:()=>{A.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(T,{icon:"block",size:"l"})," ",e("span",{children:e(f,{id:"r3RRWo"})})]})," "]}),e(Ke,{}),e(ye,{onClick:()=>{A.showAccounts=!0},children:[e(T,{icon:"group",size:"l"})," ",e("span",{children:e(f,{id:"7e0O8Z"})})]})]}):e(z,{children:[e(Ke,{}),e(qe,{to:"/login",children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(f,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ke,{}),e(qe,{to:"/search",children:[e(T,{icon:"search",size:"l"})," ",e("span",{children:e(f,{id:"A1taO8"})})]}),e(qe,{to:`/${c}/trending`,children:[e(T,{icon:"chart",size:"l"})," ",e("span",{children:e(f,{id:"4/iCqx"})})]}),e(qe,{to:`/${c}/p/l`,children:[e(T,{icon:"building",size:"l"})," ",e("span",{children:e(f,{id:"d5zxa4"})})]}),e(qe,{to:`/${c}/p`,children:[e(T,{icon:"earth",size:"l"})," ",e("span",{children:e(f,{id:"4ERYY7"})})]}),r?e(z,{children:[e(Ke,{className:"divider-grow"}),e(ye,{onClick:()=>{A.showKeyboardShortcutsHelp=!0},children:[e(T,{icon:"keyboard",size:"l"})," ",e("span",{children:e(f,{id:"77Emn0"})})]}),e(ye,{onClick:()=>{A.showShortcutsSettings=!0},children:[e(T,{icon:"shortcut",size:"l"})," ",e("span",{children:e(f,{id:"8Kudkr"})})]}),e(ye,{onClick:()=>{A.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(f,{id:"uVbUP8"})})]})]}):e(z,{children:[e(Ke,{}),e(ye,{onClick:()=>{A.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(f,{id:"uVbUP8"})})]})]})]})]})]})}function er({menuState:n}){const i=et("@mastodon/lists"),[s,o]=E([]);return ie(()=>{i&&n==="open"&&ln().then(o)},[n,i]),s.length>0?e(an,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(z,{children:[e(T,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(f,{id:"h16FyT"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(f,{id:"BHWx+g"})})}),(s==null?void 0:s.length)>0&&e(z,{children:[e(Ke,{}),s.map(c=>e(qe,{to:`/l/${c.id}`,children:e("span",{children:c.title})},c.id))]})]}):i&&e(qe,{to:"/l",children:[e(T,{icon:"list",size:"l"}),e("span",{children:e(f,{id:"h16FyT"})})]})}const Mt=lt(Qa),un={block:"start",inline:"center",behavior:"smooth"};function Tt({title:n,titleComponent:i,id:s,instance:o,emptyText:c,errorText:r,useItemID:h,boostsCarousel:d,fetchItems:l=()=>{},checkForUpdates:a=()=>{},checkForUpdatesInterval:p=15e3,headerStart:b,headerEnd:m,timelineStart:g,refresh:u,view:v,filterContext:y,showFollowedTags:w,showReplyParent:S,clearWhenRefresh:_}){const{_:k}=ue(),x=Ve(A),[C,I]=E([]),[R,L]=E("start"),[F,P]=E(!1),[q,te]=E(!1),[ee,W]=E(!0),j=Y();__BENCHMARK.start(`timeline-${s}-load`);const U=Ce(()=>oi(),[]),ae=v!=="media",$=Y(0),B=qo(J=>{te(!1),L("loading"),(async()=>{try{const _e=$.current=Date.now();let{done:De,value:ne}=await l(J);if(_e!==$.current)return;if(Array.isArray(ne)){const[oe,Re]=ne.reduce((O,Q)=>(Q._pinned?O[0].push(Q):O[1].push(Q),O),[[],[]]);ne=Re,ae&&(d&&(ne=Va(ne)),ne=Ga(ne,o)),oe.length&&(ne=oe.concat(ne)),I(J?ne:O=>[...O,...ne]),ne.length||(De=!0),P(!De)}else P(!1);L("default"),__BENCHMARK.end(`timeline-${s}-load`)}catch{L("error"),J&&!C.length&&r&&pe(r)}finally{B.cancel()}})()},1e3,{leading:!0}),G=".timeline-item, .timeline-item-alt",le=Fe("j, shift+j",(J,_e)=>{const De=document.activeElement.closest(G),ne=De==null?void 0:De.getBoundingClientRect(),oe=Array.from(j.current.querySelectorAll(G)).filter(Re=>!!Re.offsetHeight);if(De&&ne.top<j.current.clientHeight&&ne.bottom>0){const Re=oe.indexOf(De);let O=oe[Re+1];_e.shift&&(O=oe.find((Q,fe)=>fe>Re&&!Q.classList.contains("timeline-item-alt"))),O&&(O.focus(),O.scrollIntoView(un))}else{const Re=oe.find(O=>{const Q=O.getBoundingClientRect();return Q.top>=44&&Q.left>=0});Re&&(Re.focus(),Re.scrollIntoView(un))}}),H=Fe("k, shift+k",(J,_e)=>{const De=document.activeElement.closest(G),ne=De==null?void 0:De.getBoundingClientRect(),oe=Array.from(j.current.querySelectorAll(G)).filter(Re=>!!Re.offsetHeight);if(De&&ne.top<j.current.clientHeight&&ne.bottom>0){const Re=oe.indexOf(De);let O=oe[Re-1];_e.shift&&(O=oe.findLast((Q,fe)=>fe<Re&&!Q.classList.contains("timeline-item-alt"))),O&&(O.focus(),O.scrollIntoView(un))}else{const Re=oe.find(O=>{const Q=O.getBoundingClientRect();return Q.top>=44&&Q.left>=0});Re&&(Re.focus(),Re.scrollIntoView(un))}}),se=Fe(["enter","o"],()=>{const J=document.activeElement;J!=null&&J.matches(G)&&J.click()}),be=C.length>0&&R!=="loading"&&q,we=st(()=>{var J;be&&B(!0),(J=j.current)==null||J.scrollTo({top:0,behavior:"smooth"})},[B,be]),X=Fe(".",we),de=Y(),[Ee,$e]=E(!1);Xa({scrollableRef:j,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:J,nearReachStart:_e,reachStart:De})=>{if(de.current){const ne=J==="end"&&!_e;de.current.hidden=ne}$e(_e),De&&B(!0)},[]),ie(()=>{var J;(J=j.current)==null||J.scrollTo({top:0}),B(!0)},[]);const Pe=Y(!0);ie(()=>{var J;if(Pe.current){Pe.current=!1;return}_&&(C!=null&&C.length)&&((J=B.cancel)==null||J.call(B),I([])),B(!0)},[_,u]);const ze=Y(v);ie(()=>{ze.current!==v&&(ze.current=v,I([]))},[v]);const Le=st(async({disableIdleCheck:J=!1}={})=>{const _e=j.current?getComputedStyle(j.current).pointerEvents==="none":!1;x.settings.autoRefresh&&j.current.scrollTop<16&&(J||window.__IDLE__)&&!sr()&&!_e?B(!0):await a()&&te(!0)},[s,B,a,x.settings.autoRefresh]),Ae=Y();return Yt(J=>{if(J){const _e=Date.now()-Ae.current;(!Ae.current||_e>1e3*3)&&Le({disableIdleCheck:!0})}else Ae.current=Date.now();W(J)},[a,Le,x.settings.autoRefresh]),ai(Le,ee&&!q?p*(Ee?1:2):null),e(Is.Provider,{value:y,children:e("div",{id:`${s}-page`,class:`deck-container ${U?"deck-container-media-first":""}`,ref:J=>{j.current=J,le(J),H(J),se(J),X(J)},tabIndex:"-1",onClick:J=>{de.current&&J.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{de.current.hidden=!1},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:de,onClick:J=>{var _e;J.target.closest("a, button")||(_e=j.current)==null||_e.scrollTo({top:0,behavior:"smooth"})},onDblClick:J=>{J.target.closest("a, button")||B(!0)},class:R==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),b??e(ge,{to:"/",class:"button plain home-button",children:e(T,{icon:"home",size:"l",alt:k({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!m&&m})]}),be&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:we,children:[e(T,{icon:"arrow-up"})," ",e(f,{id:"2yr1/p"})]})]}),!!g&&e("div",{class:`timeline-start ${R==="loading"?"loading":""}`,children:g}),C.length?e(z,{children:[e("ul",{class:`timeline ${v?`timeline-${v}`:""}`,children:[C.map(J=>e(tr,{status:J,instance:o,useItemID:h,filterContext:y,view:v,showFollowedTags:w,showReplyParent:S,mediaFirst:U},J.id+(J==null?void 0:J._pinned)+v)),F&&R==="loading"&&(v==="media"?null:e(z,{children:[e("li",{style:{height:"20vh"},children:e(je,{skeleton:!0,mediaFirst:U})}),e("li",{style:{height:"25vh"},children:e(je,{skeleton:!0,mediaFirst:U})})]}))]}),R==="default"&&(F?e(_t,{root:j.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:J=>{J&&B()},children:e("button",{type:"button",class:"plain block",onClick:()=>B(),style:{marginBlockEnd:"6em"},children:e(f,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(f,{id:"2EYeAZ"})}))]}):R==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((J,_e)=>v==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(je,{skeleton:!0,mediaFirst:U})},_e))}):R!=="error"&&R!=="start"&&e("p",{class:"ui-state",children:c}),R==="error"&&e("p",{class:"ui-state",children:[r,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>B(!C.length),children:e(f,{id:"KDw4GX"})})]})]})})})}const tr=lt(({status:n,instance:i,useItemID:s,filterContext:o,view:c,showFollowedTags:r,showReplyParent:h,mediaFirst:d})=>{const{_:l}=ue(),{id:a,reblog:p,items:b,type:m,_pinned:g}=n;g&&(s=!1);const u=(p==null?void 0:p.id)||a,v=i?`/${i}/s/${u}`:`/s/${u}`;if(b){let w=Nt(b,o),S="";if(m==="boosts"?S=he._({id:"NuqppG",values:{0:w.length}}):m==="pinned"&&(S=l({id:"GlfmCu"})),m==="boosts"||m==="pinned"){const x=new Set;if(w.sort((C,I)=>{const R=jt(C.filtered,o),L=jt(I.filtered,o);return R&&x.add(C.id),L&&x.add(I.id),R&&!L?1:!R&&L?-1:0}),x.size>=2){const I=[],R=[];w.forEach(F=>{x.has(F.id)?R.push(F):I.push(F)});const L=[];for(let F=0;F<R.length;F+=5)L.push({_grouped:!0,posts:R.slice(F,F+5)});w=I.concat(L)}return e("li",{class:"timeline-item-carousel",children:e(nr,{title:S,class:`${m}-carousel`,children:w.map(C=>{const{id:I,reblog:R,_pinned:L,_grouped:F}=C;if(F)return e("li",{class:"timeline-item-carousel-group",children:C.posts.map(te=>{const{id:ee,reblog:W,_pinned:j}=te,U=(W==null?void 0:W.id)||ee,ae=i?`/${i}/s/${U}`:`/s/${U}`;return j&&(s=!1),e(ge,{class:"status-carousel-link timeline-item-alt",to:ae,children:s?e(je,{statusID:ee,instance:i,size:"s"}):e(je,{status:te,instance:i,size:"s"})})})},I);const P=(R==null?void 0:R.id)||I,q=i?`/${i}/s/${P}`:`/s/${P}`;return L&&(s=!1),e("li",{children:e(ge,{class:"status-carousel-link timeline-item-alt",to:q,children:s?e(je,{statusID:I,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d}):e(je,{status:C,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d})})},I)})})},`timeline-${a}`)}const k=w.length>3;return w.map((x,C)=>{const{id:I,_differentAuthor:R}=x,L=i?`/${i}/s/${I}`:`/s/${I}`,F=C>0&&C<w.length-1,P=x.sensitive&&!!x.spoilerText,q=!R&&P&&C>0||k&&F&&(m==="thread"||m==="conversation"&&!R&&!w[C-1]._differentAuthor&&!w[C+1]._differentAuthor),te=C===0,ee=C===w.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${m} timeline-item-container-${te?"start":ee?"end":"middle"} ${R?"timeline-item-diff-author":""}`,children:e(ge,{class:"status-link timeline-item",to:L,children:q?e(ir,{status:x,instance:i,filterContext:o}):s?e(je,{statusID:I,instance:i,enableCommentHint:ee,showFollowedTags:r}):e(je,{status:x,instance:i,enableCommentHint:ee,showFollowedTags:r})})},`timeline-${I}`)})}const y=`timeline-${a+g}`;return c==="media"?s?e(Wi,{class:"timeline-item",parent:"li",statusID:a,instance:i},y):e(Wi,{class:"timeline-item",parent:"li",status:n,instance:i},y):e("li",{children:e(ge,{class:"status-link timeline-item",to:v,children:s?e(je,{statusID:a,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:h,mediaFirst:d}):e(je,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:h,mediaFirst:d})})},y)},(n,i)=>{var c,r;const s=(((c=n.status)==null?void 0:c.id)||"").toString(),o=(((r=i.status)==null?void 0:r.id)||"").toString();return s===o&&n.instance===i.instance&&n.view===i.view});function nr({title:n,class:i,children:s}){const{_:o}=ue(),c=Y(),r=Y(),h=Y(),[d,l]=E(!1);return ie(()=>{setTimeout(()=>{l(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:r,type:"button",class:"small plain2",onClick:()=>{var p,b;const a=Math.min(320,(p=c.current)==null?void 0:p.offsetWidth)*(Pt()?1:-1);(b=c.current)==null||b.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-left",alt:o({id:"DHhJ7s"})})})," ",e("button",{ref:h,type:"button",class:"small plain2",onClick:()=>{var p,b;const a=Math.min(320,(p=c.current)==null?void 0:p.offsetWidth)*(Pt()?-1:1);(b=c.current)==null||b.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-right",alt:o({id:"hXzOVo"})})})]})]}),e("ul",{ref:c,children:[e(_t,{class:"status-carousel-beacon",onChange:a=>{r.current&&(r.current.disabled=a)}}),s[0],d&&s.slice(1),e(_t,{class:"status-carousel-beacon",onChange:a=>{h.current&&(h.current.disabled=a)}})]})]})}function ir({status:n,instance:i,filterContext:s}){const{_:o}=ue(),c=Ve(A),{id:r,visibility:h,language:d}=n,l=Ln(n),a=at(r,i),p=jt(n.filtered,s);return e("article",{class:`status compact-thread ${h==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[c.statusThreadNumber[a]?e("div",{class:"status-thread-badge",children:[e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})}),c.statusThreadNumber[a]?` ${c.statusThreadNumber[a]}/X`:""]}):e("div",{class:"status-thread-badge",children:e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})})}),e("div",{class:"content-compact",title:l,lang:d,dir:"auto",children:p?e("b",{class:"status-filtered-badge badge-meta horizontal",title:(p==null?void 0:p.titlesStr)||"",children:p!=null&&p.titlesStr?e(f,{id:"sr6maL",values:{0:p.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(f,{id:"03Qqf9"})})}):e(z,{children:[l,n.sensitive&&n.spoilerText&&e(z,{children:[" ",e("span",{class:"spoiler-badge",children:e(T,{icon:"eye-close",size:"s",alt:o({id:"gnKo7f"})})})]})]})})]})}function sr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const Ht=20,Si=1983,Xi=`${Si}-01`,or=(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}})();async function cr(n){var o;const{masto:i}=ce({instance:n}),s=await i.v2.search.fetch({q:"from:me",type:"statuses",limit:1});return!!((o=s==null?void 0:s.statuses)!=null&&o.length)}const ar=gt(cr);function rr(){const{i18n:n,_:i}=ue(),s=Ve(A),{id:o,...c}=Lt(),[r,h]=bt(),d=r.get("month"),l=!r.get("replies"),a=!!r.get("boosts"),p=r.get("tagged"),b=!!r.get("media"),{masto:m,instance:g,authenticated:u}=ce({instance:c.instance}),{masto:v,instance:y}=ce(),w=Y(),S=[d,l,a,p,b],[_,k]=E(),x=Y(0);ie(()=>{x.current=0},S);const C=Ce(()=>oi(),[]),I=Ce(()=>g===y,[g,y]),[R,L]=E(!1);ie(()=>{I&&_!=null&&_.acct&&(async()=>{const H=await ar(g);L(H)})()},[g,I,_==null?void 0:_.acct]);async function F(H){var Ee,$e,Pe,ze;const se=/^\d{4}-[01]\d$/.test(d),be=(($e=(Ee=d==null?void 0:d.split)==null?void 0:Ee.call(d,"-"))==null?void 0:$e[0])>=Si;if(se&&be){if(!_)return{value:[],done:!0};const[Le,Ae]=d.split("-"),J=parseInt(Ae,10)-1,_e=new Date(Le,J,0),De=`${_e.getFullYear()}-${(_e.getMonth()+1).toString().padStart(2,"0")}-${_e.getDate().toString().padStart(2,"0")}`,ne=new Date(Le,J+1,1),oe=`${ne.getFullYear()}-${(ne.getMonth()+1).toString().padStart(2,"0")}-${ne.getDate().toString().padStart(2,"0")}`;let Re;H?(Re=Ht+1,x.current=0):(Re=Ht+x.current+1,x.current+=Ht);const O=await m.v2.search.fetch({q:`from:${_.acct} after:${De} before:${oe}`,type:"statuses",limit:Re,offset:x.current});if((Pe=O==null?void 0:O.statuses)!=null&&Pe.length){const Q=O.statuses.slice(0,Ht);Q.forEach(N=>{Qe(N,g)});const fe=O.statuses.length<=Ht;return{value:Q,done:fe}}else return{value:[],done:!0}}let we=[];if(H){const{value:Le}=await m.v1.accounts.$select(o).statuses.list({pinned:!0}).next();if(Le!=null&&Le.length&&!p&&!b){const Ae=Le.map(J=>(Qe(J,g),{...J,_pinned:!0}));if(Ae.length>=3){const J=Ae.map(_e=>_e.id);we.push({id:J,items:Ae,type:"pinned"})}else we.push(...Ae)}}(H||!w.current)&&(w.current=m.v1.accounts.$select(o).statuses.list({limit:Ht,exclude_replies:l,exclude_reblogs:a,only_media:b||void 0,tagged:p}));const{value:X,done:de}=await w.current.next();if(X!=null&&X.length){if(we.length){let Le=[];((ze=we[0])==null?void 0:ze.type)==="pinned"?Le=we[0].id:Le=we.filter(J=>J._pinned).map(J=>J.id),Le.every(J=>X.some(_e=>_e.id===J))&&(we=[])}we.push(...X),X.forEach(Le=>{Qe(Le,g)})}return{value:we,done:de}}const[P,q]=E([]);let te=i({id:"/cKnpj"});if(_!=null&&_.acct){const H=(/@/.test(_.acct)?"":"@")+_.acct,se=_!=null&&_.displayName?`${_.displayName} (${H})`:`${H}`;if(!l)te=i({id:"hS1Opy",values:{accountDisplay:se}});else if(a)te=i({id:"A/CX5F",values:{accountDisplay:se}});else if(p)te=i({id:"QQrO94",values:{accountDisplay:se,tagged:p}});else if(b)te=i({id:"NoG5wD",values:{accountDisplay:se}});else if(d){const be=new Date(d).toLocaleString(n.locale,{month:"long",year:"numeric"});te=i({id:"8GjLvB",values:{accountDisplay:se,monthYear:be}})}else te=se}tt(te,"/:instance?/a/:id");const ee=st(()=>ur(o,m),[o,m]);ie(()=>{(async()=>{try{const H=await ee();k(H)}catch{}if(!C)try{const H=await m.v1.accounts.$select(o).featuredTags.list();q(H)}catch{}})()},[o,C]);const{displayName:W,acct:j,emojis:U}=_||{},ae=Y(),$=Ce(()=>{const H=!l||a||p||b||!!d,se=s.accounts[`${o}@${g}`];return e(z,{children:[e(Fs,{instance:g,account:se||o,fetchAccount:ee,authenticated:u,standalone:!0}),!C&&e("div",{class:"filter-bar",ref:ae,style:{position:"relative"},children:[H?e(ge,{to:`/${g}/a/${o}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(T,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(T,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(ge,{to:`/${g}/a/${o}${l?"?replies=1":""}`,onClick:()=>{l&&pe(i({id:"PIWNSQ"}))},class:l?"":"is-active",children:e(f,{id:"5BFynH"})}),e(ge,{to:`/${g}/a/${o}${a?"":"?boosts=0"}`,onClick:()=>{a||pe(i({id:"Qd13i0"}))},class:a?"is-active":"",children:e(f,{id:"usxQx0"})}),e(ge,{to:`/${g}/a/${o}${b?"":"?media=1"}`,onClick:()=>{b||pe(i({id:"rKpfPY"}))},class:b?"is-active":"",children:e(f,{id:"xYilR2"})}),P.map(be=>e(ge,{to:`/${g}/a/${o}${p===be.name?"":`?tagged=${encodeURIComponent(be.name)}`}`,onClick:()=>{p!==be.name&&pe(i({id:"L+HFfr",values:{0:be.name}}))},class:p===be.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),be.name]})},be.id)),R&&(or?e("label",{class:`filter-field ${d?"is-active":""}`,children:[e(T,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!(_!=null&&_.acct),value:d||"",min:Xi,max:new Date().toISOString().slice(0,7),onInput:be=>{const{value:we,validity:X}=be.currentTarget;if(!X.valid)return;h(we?{month:we}:{});const[de,Ee]=we.split("-"),$e=parseInt(Ee,10)-1,Pe=new Date(de,$e);pe(i({id:"yKR8NJ",values:{1:Pe.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(lr,{class:`filter-field ${d?"is-active":""}`,disabled:!(_!=null&&_.acct),value:d||"",min:Xi,max:new Date().toISOString().slice(0,7),onInput:be=>{const{value:we,validity:X}=be;X.valid&&h(we?{month:we}:{})}}))]})]})},[o,g,u,P,ee,R,...S]);ie(()=>{var se;const H=(se=ae.current)==null?void 0:se.querySelector(".is-active");H&&ae.current.scrollTo({behavior:"smooth",left:H.offsetLeft-(ae.current.offsetWidth-H.offsetWidth)/2})},[P,R,...S]);const B=Ce(()=>{var se;return _!=null&&_.url?(se=URL.parse(_.url))==null?void 0:se.hostname:null},[_]),le=!!_&&!(g===B);return e(Tt,{title:`${_!=null&&_.acct?"@"+_.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(Ss,{text:W,emojis:U})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",j]})})]}),id:"account-statuses",instance:g,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:F,useItemID:!0,view:b||C?"media":void 0,boostsCarousel:s.settings.boostsCarousel,timelineStart:$,refresh:[l,a,p,b,d+(_==null?void 0:_.acct)].toString(),headerEnd:e(rt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ye,{disabled:!le,onClick:()=>{(async()=>{try{const{masto:H}=ce({instance:B}),se=await H.v1.accounts.lookup({acct:_.acct}),{id:be}=se;location.hash=`/${B}/a/${be}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(f,{id:"/JFxxT",values:{0:B?e(z,{children:[" ","(",e("b",{children:rn.toUnicode(B)}),")"]}):null}})})]}),!I&&e(ye,{onClick:()=>{(async()=>{try{const H=await v.v1.accounts.lookup({acct:_.acct+"@"+g}),{id:se}=H;location.hash=`/${y}/a/${se}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(f,{id:"HkuyOu",values:{currentInstance:y},components:{0:e("b",{})}})})]})]})},o)}function lr(n){const{i18n:i}=ue(),{class:s,disabled:o,value:c,min:r,max:h,onInput:d=()=>{}}=n,[l,a]=(c==null?void 0:c.split("-"))||[],p=Y(),b=Y(),m=(g,u)=>{const[v,y]=(r==null?void 0:r.split("-"))||[],[w,S]=(h==null?void 0:h.split("-"))||[];return!(u<v||u>w||u===v&&g<y||u===w&&g>S)};return e("div",{class:s,children:[e(T,{icon:"month",size:"l"}),e("select",{ref:p,disabled:o,value:a||"",onInput:g=>{const{value:u}=g.currentTarget,v=b.current.value;if(!m(u,v))return{value:"",validity:{valid:!1}};d({value:u?`${v}-${u}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(f,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(g,u)=>e("option",{value:(u+1).toString().padStart(2,"0"),children:new Date(0,u).toLocaleString(i.locale,{month:"long"})},u))]})," ",e("input",{ref:b,type:"number",disabled:o,value:l||new Date().getFullYear(),min:(r==null?void 0:r.slice(0,4))||Si,max:(h==null?void 0:h.slice(0,4))||new Date().getFullYear(),onInput:g=>{const{value:u,validity:v}=g.currentTarget,y=p.current.value;if(!v.valid||!m(y,u))return{value:"",validity:{valid:!1}};d({value:u?`${u}-${y}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function dr(n,i){return i.v1.accounts.$select(n).fetch()}const ur=gt(dr,{maxAge:30*60*1e3});function hr(){var g;const n=Lt(),{year:i}=n;tt(i?`Annual Report: ${i}`:"Annual Report");const{masto:s,instance:o}=ce(),[c,r]=E(null),[h,d]=E("default");ie(()=>{i&&(async()=>{d("loading");const u=await s.v1.annualReports.$select(i).fetch();r(u),d("default")})()},[i]);const{accounts:l,annualReports:a,statuses:p}=c||{},b=(g=a==null?void 0:a.find(u=>u.year==i))==null?void 0:g.data,m=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"]}),h==="loading"&&e("p",{children:[e(Ue,{abrupt:!0})," ",e(f,{id:"Pwqkdw"})]}),!!b&&e("dl",{children:Object.entries(b).map(([u,v])=>e(z,{children:[e("dt",{children:u}),e("dd",{class:`report-${u}`,children:Array.isArray(v)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(v[0]).map(([y,w])=>e("th",{class:y!=="month"&&typeof w=="number"?"number":"",children:y}))})}),e("tbody",{children:v.map(y=>e("tr",{children:Object.entries(y).map(([w,S])=>e("td",{class:w!=="month"&&typeof S=="number"?"number":"",children:S&&/(accountId)/i.test(w)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(u)?e(mt,{account:l==null?void 0:l.find(_=>_.id===S),showAvatar:!0}):w==="month"?m.setMonth(S-1)&&m.toLocaleString(void 0,{month:"long"}):typeof S=="number"?S.toLocaleString():S}))}))})]}):typeof v=="object"?/^(topStatuses)$/i.test(u)?e("dl",{children:Object.entries(v).map(([y,w])=>e(z,{children:[e("dt",{children:y}),e("dd",{children:w&&e(ge,{to:`/${o}/s/${w}`,children:e(je,{status:p==null?void 0:p.find(S=>S.id===w),size:"s",readOnly:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(v).map(([y,w])=>e("tr",{children:[e("th",{children:y}),e("td",{class:typeof w=="number"?"number":"",children:w})]}))})}):typeof v=="string"?v:JSON.stringify(v,null,2)})]}))})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(ge,{to:"/",children:e(f,{id:"iWpEwy"})})})]})}const fr=20;function Ks(){const{_:n}=ue();tt(n({id:"7Ff7ia"}),"/bookmarks");const{masto:i,instance:s}=ce(),o=Y();async function c(r){return(r||!o.current)&&(o.current=i.v1.bookmarks.list({limit:fr})),await o.current.next()}return e(Tt,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:s,fetchItems:c})}const pr=""+new URL("catch-up-O5q5C75Z.png",import.meta.url).href,mr="home",dt=[{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}],gr={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},br=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],vr=[null,"account"],yr=ms(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function wr(){const{i18n:n,_:i,_:s}=ue(),o=yr(n.locale);tt("Catch-up","/catchup");const{masto:c,instance:r}=ce(),[h,d]=bt(),l=h.get("id"),[a,p]=E("start"),[b,m]=E(!1),g=Ce(()=>yt(),[]),u=M=>M===g,v=et("@pixelfed/home-include-reblogs");async function y({maxCreatedAt:M}){var K,Oe,xe;const D=M?new Date(M):null,Z=[],V=c.v1.timelines.home.list({limit:40});e:for(;;)try{v&&V.nextParams&&(typeof V.nextParams=="string"?V.nextParams+="&include_reblogs=true":V.nextParams.include_reblogs=!0);const Ie=await V.next(),{value:Be}=Ie;if(Be!=null&&Be.length){await Gs(Be,r);let Ze=!1;for(let me=0;me<Be.length;me++){const Me=Be[me],We=new Date(Me.createdAt);if(!D||We>=D){const Xe=!u(((Oe=(K=Me.reblog)==null?void 0:K.account)==null?void 0:Oe.id)||Me.account.id)&&jt(((xe=Me.reblog)==null?void 0:xe.filtered)||Me.filtered,mr);if((Xe==null?void 0:Xe.action)==="hide")continue;Me._filtered=Xe;const kt=at(Me.id,r);Me._followedTags=A.statusFollowedTags[kt]?[...A.statusFollowedTags[kt]]:[],Z.push(Me),Ze=!0}if(!Ze)break e}}else break e;await new Promise(Ze=>setTimeout(Ze,1e3))}catch{break e}return Z.forEach(Ie=>{if(Ie!=null&&Ie.inReplyToId){const Be=Z.find(Ze=>Ze.id===Ie.inReplyToId);Be&&!Be.inReplyToId&&(Be._thread=!0)}}),Z}const[w,S]=E([]),_=Y(),k=Y(),x=Ce(()=>_n(),[]),C=st(async({duration:M}={})=>{const D=Date.now(),Z=M?D-M:null;p("loading");const V=await y({maxCreatedAt:Z}),K=`${x}-${jo()}`;try{await pt.catchup.set(K,{id:K,posts:V,count:V.length,startAt:Z,endAt:D}),d({id:K})}catch{}},[]);ie(()=>{l?(async()=>{const M=await pt.catchup.get(l);M&&(M.posts.sort((D,Z)=>D.createdAt>Z.createdAt?1:-1),S(M.posts),p("results"))})():a==="results"&&(S([]),p("start"))},[l]);const[I,R]=Et(M=>M+1,0),[L,F]=E(null),[P,q]=E([]);ie(()=>{(async()=>{try{const M=await pt.catchup.keys();if(M.length){const D=_n(),Z=M.filter(V=>V.startsWith(`${D}-`));if(Z.length){let V=await pt.catchup.getMany(Z);V.sort((Ie,Be)=>Be.endAt-Ie.endAt);let K=V.slice(0,3),Oe=V.slice(3);const xe=K.map(Ie=>{const{id:Be,count:Ze,startAt:me,endAt:Me}=Ie;return{id:Be,count:Ze,startAt:me,endAt:Me}});q(xe),F(K[0].endAt),V=null,K=null,queueMicrotask(()=>{Oe.length&&pt.catchup.delMany(Oe.map(Ie=>Ie.id)).then(()=>{Oe=null}).catch(Ie=>{})});return}}}catch{}q([])})()},[I]),ie(()=>{a==="start"&&R()},[a==="start"]);const[te,ee]=Ce(()=>{var Be,Ze,me,Me,We;let M=0,D=0,Z=0,V=0,K=0,Oe=0;const xe={};for(const ke of w){ke._filtered?(M++,ke.__FILTER="filtered"):ke.group?(D++,ke.__FILTER="groups"):ke.reblog?(Z++,ke.__FILTER="boosts"):(Be=ke._followedTags)!=null&&Be.length?(K++,ke.__FILTER="followedTags"):ke.inReplyToId&&ke.inReplyToAccountId!==((Ze=ke.account)==null?void 0:Ze.id)?(V++,ke.__FILTER="replies"):(Oe++,ke.__FILTER="original");const Xe=ke.reblog||ke;if(ke.__FILTER!=="filtered"&&((me=Xe.card)!=null&&me.url)&&((Me=Xe.card)!=null&&Me.image)&&((We=Xe.card)==null?void 0:We.type)==="link"){const{card:kt,favouritesCount:dn,reblogsCount:$t}=Xe;let{url:nt}=kt;if(nt=nt.replace(/\/$/,""),!xe[nt])xe[nt]={postID:Xe.id,card:kt,shared:1,sharers:[ke.account],likes:dn,boosts:$t};else{if(xe[nt].sharers.find(Ut=>Ut.id===ke.account.id))continue;xe[nt].shared++,xe[nt].sharers.push(ke.account),xe[nt].postID!==Xe.id&&(xe[nt].likes+=dn,xe[nt].boosts+=$t)}}}let Ie=[];for(const ke in xe)Ie.push({url:ke,...xe[ke]});if(Ie.sort((ke,Xe)=>ke.shared>Xe.shared?-1:ke.shared<Xe.shared?1:ke.boosts>Xe.boosts?-1:ke.boosts<Xe.boosts?1:ke.likes>Xe.likes?-1:ke.likes<Xe.likes?1:0),Ie.length>10)e:for(let ke=10;ke<Ie.length;ke++){const{shared:Xe}=Ie[ke];if(Xe<=1){Ie=Ie.slice(0,ke);break e}}return[{filtered:M,groups:D,boosts:Z,replies:V,followedTags:K,original:Oe},Ie]},[w]),[W,j]=E("all"),[U,ae]=E(null),[$,B]=E(1),[G,le]=E("createdAt"),[H,se]=E("asc"),[be,we]=E(null),[X,de,Ee]=Ce(()=>{const M={},D=new Map;let Z=w.filter(K=>{const Oe=W==="all"||K.__FILTER===W;return Oe&&(M[K.account.id]=K.account,D.set(K.account.id,(D.get(K.account.id)||0)+1)),Oe});const V={};return Z.forEach(K=>{K.reblog&&(V[K.reblog.id]?(V[K.reblog.id].__BOOSTERS?V[K.reblog.id].__BOOSTERS.add(K.account):V[K.reblog.id].__BOOSTERS=new Set([K.account]),K.__HIDDEN=!0):V[K.reblog.id]=K)}),U&&D.has(U)&&(Z=Z.filter(K=>K.account.id===U||[...K.__BOOSTERS||[]].find(Oe=>Oe.id===U))),[Z,M,Object.fromEntries(D)]},[W,U,w]),$e=Ce(()=>{const M={};return X.forEach(D=>{M[D.id]=D}),M},[X]),Pe=Ce(()=>Object.keys(Ee).sort((M,D)=>Ee[D]-Ee[M]),[Ee]),ze=Ce(()=>{const M={};return Pe.forEach((D,Z)=>{M[D]=Z}),X.filter(D=>!D.__HIDDEN).sort((D,Z)=>{if(be==="account"){const V=D.account.id,K=Z.account.id,Oe=M[V],xe=M[K],Ie=Oe-xe;if(Ie!==0)return Ie}if(G!=="createdAt"&&(D=D.reblog||D,Z=Z.reblog||Z,G!=="density"&&D[G]===Z[G]))return D.createdAt>Z.createdAt?1:-1;if(G==="density"){const V=Ji(D),K=Ji(Z);return H==="asc"?V>K?1:-1:K>V?1:-1}return H==="asc"?D[G]>Z[G]?1:-1:Z[G]>D[G]?1:-1})},[X,G,H,be,Pe]),Le=Y(null),Ae=Y(null),J=Y(!1);ie(()=>{w.length>100||J.current||Ae.current&&(Ps(Ae.current,{duration:200}),J.current=!0)},[w,Ae]);const _e=w.length>160?"3d":"2d",De=Ce(()=>_e!=="2d"?null:w.map(M=>{const D=$e[M.id];return e("span",{class:`post-dot ${D?"post-dot-highlight":""}`},M.id)}),[$e]),ne=Ce(()=>_e!=="3d"||!(w!=null&&w.length)?null:xr(w,"createdAt",320).map((D,Z)=>e("div",{class:"posts-bin",children:D.map(V=>{const K=$e[V.id];return e("span",{class:`post-dot ${K?"post-dot-highlight":""}`},V.id)})},Z)),[$e]),oe=Y(null),Re=Ce(()=>L?(Date.now()-L)/1e3/60/60:null,[L,$]);ie(()=>{if(a!=="results")return;const M=U&&de[U]?de[U].username:"",D=H==="asc"?0:1,Z={account:"authors"};let V=pe({duration:5e3,text:s({id:"TLYeLT",values:{selectedFilterCategory:W,sortBy:G,sortOrder:H,groupBy:be}})});return()=>{var K;(K=V==null?void 0:V.hideToast)==null||K.call(V)}},[a,W,U,G,H,be,de]),ie(()=>{var M;if(U&&de[U]){const D=Ae.current.querySelector(`[data-author="${U}"]`),Z=(M=Ae.current)==null?void 0:M.getBoundingClientRect(),V=D==null?void 0:D.getBoundingClientRect();V.left<Z.left||V.right>Z.right?D.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):V.top<0&&D.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[U,de]);const[O,Q]=E(!1),fe=".catchup-list > li > a",N=Fe("j",()=>{const M=document.activeElement.closest(fe),D=M==null?void 0:M.getBoundingClientRect(),Z=Array.from(oe.current.querySelectorAll(fe));if(M&&D.top<oe.current.clientHeight&&D.bottom>0){const V=Z.indexOf(M),K=Z[V+1];K&&(K.focus(),K.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const V=Z.find(K=>K.getBoundingClientRect().top>=0);V&&(V.focus(),V.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),re=Fe("k",()=>{const M=document.activeElement.closest(fe),D=M==null?void 0:M.getBoundingClientRect(),Z=Array.from(oe.current.querySelectorAll(fe));if(M&&D.top<oe.current.clientHeight&&D.bottom>0){const V=Z.indexOf(M);let K=Z[V-1];K&&(K.focus(),K.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const V=Z.find(K=>{const Oe=K.getBoundingClientRect();return Oe.top>=44&&Oe.left>=0});V&&(V.focus(),V.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),Te=Fe("h, l",(M,D)=>{var V,K,Oe;const Z=D.keys[0];if(U){const xe=Pe.indexOf(U);Z==="h"?xe>0&&xe<Pe.length&&(ae(Pe[xe-1]),(V=oe.current)==null||V.focus()):Z==="l"&&xe<Pe.length-1&&xe>=0&&(ae(Pe[xe+1]),(K=oe.current)==null||K.focus())}else Z==="l"&&(ae(Pe[0]),(Oe=oe.current)==null||Oe.focus())},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Se=Fe("esc",()=>{var M;ae(null),(M=oe.current)==null||M.focus()},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Ne=Fe(".",()=>{var M;(M=oe.current)==null||M.scrollTo({top:0,behavior:"smooth"})},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Ye=st(M=>{const D=document.activeElement,Z=(D==null?void 0:D.tagName)==="INPUT"&&D.type==="radio";if((M.key==="ArrowDown"||M.key==="ArrowUp"||M.key==="ArrowLeft"||M.key==="ArrowRight")&&Z){D.blur();return}},[]);return e("div",{ref:M=>{oe.current=M,N(M),re(M),Te(M),Se(M)},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${a==="loading"?"loading":""}`,onClick:M=>{var D;M.target.closest("a, button")||(D=oe.current)==null||D.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),a==="results"&&e(ge,{to:"/catchup",class:"button plain",children:e(T,{icon:"history2",size:"l",alt:s({id:"xrl8fj"})})}),a==="start"&&e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:a!=="start"&&e(f,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:a!=="start"&&a!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{Q(!0)},children:e(f,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:Ye,children:[a==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(f,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(f,{id:"CxKPv6"})}),e("p",{children:e(f,{id:"YMU1CK"})}),e("img",{src:pr,width:"1200",height:"900",alt:s({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:M=>{M.target.closest("details").open=!1},children:e(f,{id:"2jI8hh"})})})]}),e("p",{children:e(f,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(f,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:_,type:"range",value:$,min:dt[0].value,max:dt[dt.length-1].value,step:"1",list:"catchup-ranges",onChange:M=>B(+M.target.value)})," ",e("span",{style:{width:"8em"},children:[i(dt[$-1].label),e("br",{}),e("small",{class:"insignificant",children:$==dt[dt.length-1].value?s({id:"NMNiaO"}):ot(new Date(Date.now()-$*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:dt.map(({label:M,value:D})=>e("option",{value:D,label:i(M)}))})," ",e("button",{type:"button",onClick:()=>{var M;if($<dt[dt.length-1].value){let D;$===dt[dt.length-1].value&&((M=k.current)!=null&&M.checked)?D=Date.now()-L:D=$*60*60*1e3,C({duration:D})}else C()},children:e(f,{id:"R0yu2l"})})]}),Re&&$>Re?e("p",{class:"catchup-info",children:[e(T,{icon:"info"})," ",e(f,{id:"AGyV7s"})]}):$===dt[dt.length-1].value&&L?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:k})," ",e(f,{id:"dDJEHI",values:{0:o.format(new Date(L))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(f,{id:"EAjFM0"})})}),!!(P!=null&&P.length)&&e("div",{class:"catchup-prev",children:[e("p",{children:e(f,{id:"Yfb9A8"})}),e("ul",{children:P.map(M=>e("li",{children:[e(ge,{to:`/catchup?id=${M.id}`,children:[e(T,{icon:"history2"})," ",e("span",{children:M.startAt?o.formatRange(new Date(M.startAt),new Date(M.endAt)):`… – ${o.format(new Date(M.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(f,{id:"S6XZwv",values:{0:M.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{var Z;if(confirm(s({id:"D9CmP2"}))){let V=pe(s({id:"xJUo4P",values:{0:M.id}}));await pt.catchup.del(M.id),(Z=V==null?void 0:V.hideToast)==null||Z.call(V),pe(s({id:"bRDKRy",values:{1:M.id}})),R()}},children:e(T,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},M.id))}),P.length>=3&&e("p",{children:e("small",{children:e(f,{id:"sXmrl4"})})})]})]}),a==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Ue,{abrupt:!0}),e("p",{class:"insignificant",children:e(f,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(f,{id:"q9urQO"})})]}),a==="results"&&e(z,{children:[e("div",{class:"catchup-header",children:[w.length>0&&e("p",{children:e("b",{class:"ib",children:o.formatRange(new Date(w[0].createdAt),new Date(w[w.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:W==="all"&&!U&&G==="createdAt"&&H==="asc",type:"button",class:"plain4 small",onClick:()=>{j("all"),ae(null),le("createdAt"),we(null),se("asc")},children:e(f,{id:"I9EnzM"})}),(ee==null?void 0:ee.length)>0&&e("button",{type:"button",class:"plain small",onClick:()=>m(!b),children:[e(f,{id:"EIZREX"})," ",e(T,{icon:"chevron-down",style:{transform:b?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!b,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:ee.map(M=>{const{card:D,shared:Z,sharers:V,likes:K,boosts:Oe}=M,{blurhash:xe,title:Ie,description:Be,url:Ze,image:me,imageDescription:Me,language:We,width:ke,height:Xe,publishedAt:kt}=D,dn=Ts(Ze);let $t;if(xe){const nt=di(xe),Ut=ki(nt);$t=wi([.6,Ut[1],Ut[2]])}return e("a",{href:Ze,target:"_blank",rel:"noopener",class:"link-block",style:$t?{"--accent-color":`rgb(${$t.join(",")})`,"--accent-alpha-color":`rgba(${$t.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:me,alt:Me,width:ke,height:Xe,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:dn})," ",!!kt&&e(z,{children:"· "}),!!kt&&e(z,{children:e(It,{datetime:kt,format:"micro"})})]}),!!Ie&&e("h1",{class:"title",lang:We,dir:"auto",title:Ie,children:Ie})]}),!!Be&&e("p",{class:"description",lang:We,dir:"auto",title:Be,children:Be}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(f,{id:"bfSr6z",values:{0:V.map(nt=>{const{avatarStatic:Ut,displayName:po}=nt;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:Ii=>{Ii.preventDefault(),Ii.stopPropagation();const{id:mo}=nt;ae(mo),j("all")},children:e(ft,{url:Ut,size:"s",alt:po})})})}})})]})]})},Ze)})})})}),w.length>=5&&(_e==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:ne}):e("div",{class:"catchup-posts-viz-bar",children:De})),w.length>=2&&e("div",{class:"catchup-filters",children:[e("label",{class:"filter-cat",children:[e("input",{type:"radio",name:"filter-cat",checked:W.toLowerCase()==="all",onChange:()=>{j("all")}}),e(f,{id:"N40H+G"})," ",e("span",{class:"count",children:w.length})]}),Object.entries(gr).map(([M,D])=>!!te[M]&&e("label",{class:"filter-cat",title:(te[M]/w.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:W.toLowerCase()===M.toLowerCase(),onChange:()=>{j(M),M==="boosts"&&(le("reblogsCount"),se("desc"),we(null))}}),i(D)," ",e("span",{class:"count",children:te[M]})]},i(D)))]}),w.length>=2&&!!Ee&&e("div",{class:"catchup-filters authors-filters",ref:Ae,children:[Pe.map(M=>e("label",{class:"filter-author","data-author":M,children:[e("input",{type:"radio",name:"filter-author",checked:U===M,onChange:()=>{ae(M)},onClick:()=>{U===M&&ae(null)}}),e(ft,{url:de[M].avatarStatic||de[M].avatar,size:"xxl",alt:`${de[M].displayName} (@${de[M].acct})`})," ",e("span",{class:"count",children:Ee[M]}),e("span",{class:"username",children:de[M].username})]},`${M}-${Ee[M]}`)),Pe.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(f,{id:"HHtYi7",values:{0:Pe.length}})},"authors-count")]}),w.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(f,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:br.map(M=>e("label",{class:"filter-sort",onClick:D=>{G===M&&(D.preventDefault(),D.stopPropagation(),se(H==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:G===M,onChange:()=>{le(M);const D=/(replies|favourites|reblogs)/.test(M)?"desc":"asc";se(D)}}),{createdAt:s({id:"mYGY3B"}),repliesCount:s({id:"N8UzTV"}),favouritesCount:s({id:"zZOZj7"}),reblogsCount:s({id:"puY2t0"}),density:s({id:"0tQ7AD"})}[M],G===M&&(H==="asc"?" ↑":" ↓")]},M))}),e("span",{class:"filter-label",children:e(f,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:vr.map(M=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:be===M,onChange:()=>{we(M)},disabled:M==="account"&&U}),{account:s({id:"dpqPBg"})}[M]||s({id:"EdQY6l"})]},M||"none"))}),U&&Pe.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{ae(null)},style:{whiteSpace:"nowrap"},children:e(f,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${W||""} ${G?`catchup-sort-${G}`:""} ${U&&de[U]?"catchup-selected-author":""} ${be?`catchup-group-${be}`:""}`,children:ze.map((M,D)=>{var K;const Z=((K=M.reblog)==null?void 0:K.id)||M.id;let V=!1;return be==="account"&&(Le.current&&M.account.id!==Le.current&&D>0&&(V=!0),Le.current=M.account.id),e(z,{children:[V&&e("li",{class:"separator"}),e(Sr,{to:`/${r}/s/${Z}`,post:M,root:oe.current})]},`${M.id}-${V}`)})}),e("footer",{children:X.length>5&&e("p",{children:[s(W==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{oe.current.scrollTop=0},children:e(f,{id:"0MgdN+"})}),"."]})})]})]})]}),O&&e(He,{onClose:()=>Q(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>Q(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(f,{id:"EIZREX"})}),e("dd",{children:e(f,{id:"YmGrIy"})}),e("dt",{children:e(f,{id:"coaNtr"})}),e("dd",{children:e(f,{id:"UUrqX1"})}),e("dt",{children:e(f,{id:"ScQBC/"})}),e("dd",{children:e(f,{id:"srocAr"})}),e("dt",{children:e(f,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(f,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(f,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(f,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(f,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(f,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(f,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const kr=lt(function({post:n}){const{id:i,account:s,group:o,reblog:c,inReplyToId:r,inReplyToAccountId:h,_followedTags:d,_filtered:l,visibility:a,__BOOSTERS:p}=n,b=r&&h!==s.id,m=!!l,g=u=>{u.shiftKey};return e("article",{class:`post-line ${o?"group":c?"reblog":d!=null&&d.length?"followed-tags":""} ${b?"reply-to":""} ${m?"filtered":""} visibility-${a}`,onMouseEnter:g,children:[e("span",{class:"post-author",children:c?e("span",{class:"post-reblog-avatar",children:[e(ft,{url:s.avatarStatic||s.avatar,squircle:s.bot}),(p==null?void 0:p.size)>0?[...p].map(u=>e(ft,{url:u.avatarStatic||u.avatar,squircle:u.bot})):""," ",e(T,{icon:"rocket"})," ",e(mt,{account:c.account,showAvatar:!0})]}):e(mt,{account:s,showAvatar:!0})}),e(Ir,{post:c||n,filterInfo:l}),e("span",{class:"post-meta",children:[e(Tr,{post:c||n})," ",e(It,{datetime:new Date((c==null?void 0:c.createdAt)||n.createdAt),format:"micro"})]})]})},(n,i)=>{var s,o;return((s=n==null?void 0:n.post)==null?void 0:s.id)===((o=i==null?void 0:i.post)==null?void 0:o.id)}),Sr=({root:n,to:i,...s})=>{const o=Y(),[c,r]=E(!1);return ie(()=>{const h=new IntersectionObserver(d=>{d[0].isIntersecting&&(queueMicrotask(()=>r(!0)),h.unobserve(o.current))},{root:n,rootMargin:`${Math.max(320,screen.height*.75)}px`});return o.current&&h.observe(o.current),()=>{o.current&&h.unobserve(o.current)}},[]),c?e("li",{children:e(ge,{to:i,children:e(kr,{...s})})}):e("li",{ref:o,style:{height:"4em"}})},Cr=8,_r=8;function Ji(n){var l;const{spoilerText:i,content:s,poll:o,mediaAttachments:c,card:r}=n,h=(l=o==null?void 0:o.options)!=null&&l.length?o.options.reduce((a,p)=>a+p.title,""):"";return(i.length+xs(s)+h.length)/140+(c!=null&&c.length?Cr*c.length:r!=null&&r.image?_r:0)}const xt=48;function Ir({post:n,filterInfo:i}){var _;const{_:s}=ue(),{spoilerText:o,sensitive:c,content:r,emojis:h,poll:d,mediaAttachments:l,card:a,inReplyToId:p,inReplyToAccountId:b,account:m,_thread:g}=n,u=p&&b===m.id||!!g,v=Ce(()=>!!(ve.account.get("preferences")||{})["reading:expand:spoilers"],[]),y=v||!o&&!c,w=r?Ln(n):"",S=!o||v;return e("div",{class:"post-peek",title:o?"":w,children:[e("span",{class:"post-peek-content",children:[u&&!S&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i?e("span",{class:"post-peek-filtered",children:i!=null&&i.titlesStr?s({id:"suKjh3",values:{0:i.titlesStr}}):s({id:"03Qqf9"})}):e(z,{children:[!!o&&e("span",{class:"post-peek-spoiler",children:[e(T,{icon:`${v?"eye-open":"eye-close"}`})," ",o]}),S&&e("div",{class:"post-peek-html",children:[u&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(f,{id:"e66y2Z"})})," "]}),!!r&&e("div",{dangerouslySetInnerHTML:{__html:Yo(r,h)}}),!!((_=d==null?void 0:d.options)!=null&&_.length)&&d.options.map(k=>e("div",{children:[d.multiple?"▪️":"•"," ",k.title]})),!r&&(l==null?void 0:l.length)===1&&l[0].description&&e(z,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:l[0].description})]})]})]})]}),!i&&e("span",{class:"post-peek-post-content",children:[!!d&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(T,{icon:"poll",size:"s"}),e(f,{id:"4WUbF1"})]}),l!=null&&l.length?l.map(k=>{var L,F,P,q,te,ee,W,j,U,ae;const x=k.previewUrl||k.url,C=k.previewRemoteUrl||k.remoteUrl,I=(L=k.meta)!=null&&L.original?k.meta.original.width:((P=(F=k.meta)==null?void 0:F.small)==null?void 0:P.width)||((te=(q=k.meta)==null?void 0:q.original)==null?void 0:te.width),R=(ee=k.meta)!=null&&ee.original?k.meta.original.height:((j=(W=k.meta)==null?void 0:W.small)==null?void 0:j.height)||((ae=(U=k.meta)==null?void 0:U.original)==null?void 0:ae.height);return e("span",{class:"post-peek-media",children:{image:(x||C)&&y?e("img",{src:x,width:xt,height:xt,alt:k.description,loading:"lazy",onError:$=>{const{src:B}=$.target;B===x&&($.target.src=C)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(I,R)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(x||C)&&y?e("img",{src:x,width:xt,height:xt,alt:k.description,loading:"lazy",onError:$=>{const{src:B}=$.target;B===x&&($.target.src=C)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(x||C)&&y?e("img",{src:x,width:xt,height:xt,alt:k.description,loading:"lazy",onError:$=>{const{src:B}=$.target;B===x&&($.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)}):!!a&&a.image&&y&&e("span",{class:`post-peek-media post-peek-card card-${a.type||""}`,children:a.image?e("img",{src:a.image,width:xt,height:xt,alt:a.title||a.description||a.imageDescription,loading:"lazy",style:{"--anim-duration":a.width&&a.height&&`${Math.min(Math.max(Math.max(a.width,a.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function Tr({post:n}){const{_:i}=ue(),{reblogsCount:s,repliesCount:o,favouritesCount:c}=n;return e("span",{class:"post-stats",children:[o>0&&e("span",{class:"post-stat-replies",children:[e(T,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Je(o)]}),c>0&&e("span",{class:"post-stat-likes",children:[e(T,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Je(c)]}),s>0&&e("span",{class:"post-stat-boosts",children:[e(T,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",Je(s)]})]})}function xr(n,i,s){const o=n.map(l=>new Date(l[i])),c=o.reduce((l,a)=>a<l?a:l,o[0]),r=o.reduce((l,a)=>a>l?a:l,o[0]),h=Math.min(r.getTime(),Date.now())-c.getTime(),d=Array.from({length:s},()=>[]);return n.forEach(l=>{const a=new Date(l[i]);if(a.getTime()>Date.now())d[d.length-1].push(l);else{const p=(a.getTime()-c.getTime())/h,b=Math.floor(p*(s-1));d[b].push(l)}}),d}const Ar=20;function Zs(){const{_:n}=ue();tt(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:s}=ce(),o=Y();async function c(r){return(r||!o.current)&&(o.current=i.v1.favourites.list({limit:Ar})),await o.current.next()}return e(Tt,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:s,fetchItems:c})}const Rr=["home","public","notifications","thread","account"],Qi=["notifications","thread","account"],Er={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},Lr=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],Yn={0:{id:"qqeAJM"},1800:it(30,"minute"),3600:it(1,"hour"),21600:it(6,"hour"),43200:it(12,"hour"),86400:it(24,"hour"),604800:it(7,"day"),2592e3:it(30,"day")};function Mr(){const{_:n}=ue(),{masto:i}=ce();tt(n({id:"cSev+j"}),"/ft");const[s,o]=E("default"),[c,r]=E(!1),[h,d]=Et(p=>p+1,0),[l,a]=E([]);return ie(()=>{o("loading"),(async()=>{try{const p=await i.v2.filters.list();p.sort((b,m)=>b.title.localeCompare(m.title)),p.forEach(b=>{var m;(m=b.keywords)!=null&&m.length&&b.keywords.sort((g,u)=>g.id-u.id)}),a(p),o("default")}catch{o("error")}})()},[h]),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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(f,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{r(!0)},children:e(T,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:l.length>0?e(z,{children:[e("ul",{class:"filters-list",children:l.map(p=>{const{id:b,title:m,expiresAt:g,keywords:u}=p;return e("li",{children:[e("div",{children:[e("h2",{children:m}),(u==null?void 0:u.length)>0&&e("div",{children:u.map(v=>e(z,{children:[e("span",{class:"tag collapsed insignificant",children:v.wholeWord?`“${v.keyword}”`:v.keyword})," "]}))}),e("small",{class:"insignificant",children:e(Ws,{expiresAt:g})})]}),e("button",{type:"button",class:"plain",onClick:()=>{r({filter:p})},children:e(T,{icon:"pencil",size:"l",alt:"Edit filter"})})]},b)})}),l.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(f,{id:"5vzJxv",values:{0:l.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(Ue,{})}):s==="error"?e("p",{class:"ui-state",children:e(f,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(f,{id:"cWIHTt"})})})]}),!!c&&e(He,{title:n({id:"vCSBPD"}),onClose:()=>{r(!1)},children:e(Pr,{filter:c==null?void 0:c.filter,onClose:p=>{p.state==="success"&&d(),r(!1)}})})]})}let $r=1;const Dr=()=>$r++;function Pr({filter:n,onClose:i}){const{_:s,_:o}=ue(),{masto:c}=ce(),[r,h]=E("default"),d=!!n,{context:l,expiresAt:a,id:p,keywords:b,title:m,filterAction:g}=n||{},u=!!a,v=u&&new Date(a),[y,w]=E(b||[]),S=Y(),[_,k]=E([]),[x,C]=E([]),I=y.filter(R=>!_.includes(R.id)&&!x.includes(R._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:o(d?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:R=>{R.preventDefault();const L=new FormData(R.target),F=L.get("title"),P=L.getAll("keyword_attributes[][id]"),q=L.getAll("keyword_attributes[][keyword]"),te=[...S.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(ae=>ae.checked),ee=q.map((ae,$)=>({id:P[$]||void 0,keyword:ae,wholeWord:te[$]}));d&&(_!=null&&_.length)&&_.forEach(ae=>{ee.push({id:ae,_destroy:!0})});const W=L.getAll("context");let j=L.get("expires_in");const U=L.get("filter_action");!F||!(W!=null&&W.length)||(h("loading"),(async()=>{try{let ae;d?(j===""||j===null?u?j=Math.floor((v-new Date)/1e3):j=null:j==="0"||j===0?j=null:j=+j,ae=await c.v2.filters.$select(p).update({title:F,context:W,expiresIn:j,keywordsAttributes:ee,filterAction:U})):(j=+j||null,ae=await c.v2.filters.create({title:F,context:W,expiresIn:j,keywordsAttributes:ee,filterAction:U})),h("default"),i==null||i({state:"success",filter:ae})}catch{h("error"),alert(o(d?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(f,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:m,disabled:r==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:S,children:[I.length?e("ul",{class:"filter-keywords",children:I.map(R=>{const{id:L,keyword:F,wholeWord:P,_id:q}=R;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:L}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:F,disabled:r==="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:P,disabled:r==="loading"})," ",e(f,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:r==="loading",onClick:()=>{L?(_.push(L),k([..._])):q&&(x.push(q),C([...x]))},children:e(T,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},`${L}-${q}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(f,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{w([...y,{_id:Dr(),keyword:"",wholeWord:!0}]),setTimeout(()=>{var L,F;const R=S.current.querySelectorAll('input[type="text"]');(F=(L=R[R.length-1])==null?void 0:L.focus)==null||F.call(L)},10)},children:e(f,{id:"qn5Dbn"})})," ",(I==null?void 0:I.length)>1&&e("small",{class:"insignificant",children:e(f,{id:"1JZ175",values:{0:I.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(f,{id:"uqf7Yq"})})}),Rr.map(R=>e("div",{children:[e("label",{class:Qi.includes(R)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:R,defaultChecked:l?l.includes(R):!0,disabled:r==="loading"})," ",s(Er[R]),Qi.includes(R)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(f,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[d&&e(f,{id:"ucJk3m",components:{0:e("b",{}),1:e(Ws,{expiresAt:a,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:o(d?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:r==="loading",defaultValue:d?void 0:0,children:[d&&e("option",{}),Lr.map(R=>e("option",{value:R,children:typeof Yn[R]=="function"?Yn[R]():s(Yn[R])}))]})]}),e("p",{children:[e(f,{id:"blQMpa"}),e("br",{}),e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:g==="warn"||!d,disabled:r==="loading"})," ",e(f,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:g==="hide",disabled:r==="loading"})," ",e(f,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:r==="loading",children:o(d?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(Ue,{abrupt:!0,hidden:r!=="loading"})]}),d&&e(ut,{disabled:r==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"BPjyR2"}),onClick:()=>{h("loading"),(async()=>{try{await c.v2.filters.$select(p).remove(),h("default"),i==null||i({state:"success"})}catch{h("error"),alert(o({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:r==="loading",children:e(f,{id:"Jb6/SB"})})})]})]})})]})}function Ws({expiresAt:n,showNeverExpires:i}){const{_:s}=ue(),o=!!n,c=o&&new Date(n),r=o&&c<=new Date,[h,d]=Et(l=>l+1,0);return ai(d,r||3e4),r?s({id:"M1RnFv"}):o?e(f,{id:"urGtsw",components:{0:e(It,{datetime:c})}}):i&&s({id:"O1Aswy"})}function Nr(){const{_:n}=ue(),{masto:i,instance:s}=ce();tt(n({id:"Xi1/bw"}),"/fh");const[o,c]=E("default"),[r,h]=E([]);return ie(()=>{c("loading"),(async()=>{try{const d=await An();h(d),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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(f,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:r.length>0?e(z,{children:[e("ul",{class:"link-list",children:r.map(d=>e("li",{children:e(ge,{to:s?`/${s}/t/${d.name}`:`/t/${d.name}`,children:[e(T,{icon:"hashtag",alt:"#"})," ",e("span",{children:d.name})]})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(f,{id:"2S/uvJ",values:{0:r.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):o==="error"?e("p",{class:"ui-state",children:e(f,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(f,{id:"vKsGhk"})})})]})})}const Or=20;function Ci({title:n,path:i,id:s,...o}){const{_:c}=ue();tt(n||c({id:"following.title"}),i||"/following");const{masto:r,streaming:h,instance:d}=ce(),l=Ve(A),a=Y(),p=Y();__BENCHMARK.end("time-to-following");const b=et("@pixelfed/home-include-reblogs");async function m(u){var w;(u||!a.current)&&(__BENCHMARK.start("fetch-home-first"),a.current=r.v1.timelines.home.list({limit:Or})),b&&((w=a.current)!=null&&w.nextParams)&&(typeof a.current.nextParams=="string"?a.current.nextParams+="&include_reblogs=true":a.current.nextParams.include_reblogs=!0);const v=await a.current.next();let{value:y}=v;if(y!=null&&y.length){let S=!1;u&&(y[0].id!==p.current&&(S=!0),p.current=y[0].id),y.forEach(_=>{Qe(_,d)}),y=Zi(y,d),u&&S&&Za(),Gs(y,d),y.sort((_,k)=>{const x=new Date(_.createdAt);return new Date(k.createdAt)-x})}return __BENCHMARK.end("fetch-home-first"),{...v,value:y}}async function g(){var u;try{const v={limit:5,since_id:p.current};et("@pixelfed/home-include-reblogs")&&(v.include_reblogs=!0);const y=await r.v1.timelines.home.list(v).next();let{value:w}=y;const S=((u=w[0])==null?void 0:u.id)===p.current;return!!(w!=null&&w.length&&!S&&(p.current=w[0].id,w=Zi(w,d),w=Nt(w,"home"),w.some(_=>!_.reblog)))}catch{return!1}}return ie(()=>{let u;return(async()=>{if(h){u=h.user.subscribe();for await(const v of u){if(!u)break;if(v.event==="status.update"){const y=v.payload;Qe(y,d)}else if(v.event==="delete"){const y=v.payload,w=gs(y,d);w&&(w._deleted=!0)}}}})(),()=>{var v;(v=u==null?void 0:u.unsubscribe)==null||v.call(u),u=null}},[h]),e(Tt,{title:n||c({id:"following.title"}),id:s||"following",emptyText:c({id:"nJEKbY"}),errorText:c({id:"7QSeK6"}),instance:d,fetchItems:m,checkForUpdates:g,useItemID:!0,boostsCarousel:l.settings.boostsCarousel,...o,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const zr=20,Ur=4,es=Ur+1;function Xs({media:n,columnMode:i,...s}){const{_:o}=ue();let{hashtag:c,...r}=i?{}:Lt();s.hashtag&&(c=s.hashtag);let h=c.trim().split(/[\s+]+/);h.sort(),c=h[0];const[d,l]=bt(),a=n||!!d.get("media"),p=a?"?media=1":"",{masto:b,instance:m,authenticated:g}=ce({instance:(s==null?void 0:s.instance)||r.instance}),{masto:u,instance:v,authenticated:y}=ce(),w=h.map($=>`#${$}`).join(" "),S=o(m?a?{id:"kH0rA0",values:{hashtagTitle:w,instance:m}}:{id:"IK0zKi",values:{hashtagTitle:w,instance:m}}:a?{id:"hHSI3w",values:{hashtagTitle:w}}:{id:"+ZzjRY",values:{hashtagTitle:w}});tt(S,"/:instance?/t/:hashtag");const _=Y(),k=Ce(()=>oi(),[]),x=Y(void 0);async function C($){const B=await b.v1.timelines.tag.$select(c).list({limit:zr,any:h.slice(1),maxId:$?void 0:x.current,onlyMedia:a?!0:void 0}).next();let{value:G}=B;return G!=null&&G.length&&($&&(_.current=G[0].id),G.forEach(le=>{Qe(le,m,{skipThreading:a||k})}),x.current=G[G.length-1].id),{...B,value:G}}async function I(){var $;try{const B=await b.v1.timelines.tag.$select(c).list({limit:1,any:h.slice(1),since_id:_.current,onlyMedia:a}).next();let{value:G}=B;const le=(($=G[0])==null?void 0:$.id)===_.current;return G!=null&&G.length&&!le?(G=Nt(G,"public"),!0):!1}catch{return!1}}const[R,L]=E("default"),[F,P]=E();ie(()=>{(async()=>{try{const $=await b.v1.tags.$select(c).fetch();P($)}catch{}})()},[c]);const q=h.length>=es,[te,ee]=E("default"),[W,j]=E([]),[U,ae]=E(!1);return ie(()=>{g&&(async()=>{try{const $=await b.v1.featuredTags.list();j($),ae($.some(B=>B.name.toLowerCase()===c.toLowerCase()))}catch{}})()},[]),e(Tt,{title:S,titleComponent:!!m&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:w}),e("div",{children:m})]}),id:"hashtag",instance:m,emptyText:o({id:"CNSLAW"}),errorText:o({id:"yjj6Ll"}),fetchItems:C,checkForUpdates:I,useItemID:!0,view:a||k?"media":void 0,refresh:a,filterContext:"public",headerEnd:e(rt,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[!!F&&h.length===1&&e(z,{children:[e(ut,{subMenu:!0,confirm:F.following,confirmLabel:o({id:"ctJi7k",values:{hashtag:c}}),disabled:R==="loading"||!g,onClick:()=>{L("loading"),F.following?b.v1.tags.$select(c).unfollow().then(()=>{P({...F,following:!1}),pe(o({id:"doK/ij",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{L("default")}):b.v1.tags.$select(c).follow().then(()=>{P({...F,following:!0}),pe(o({id:"R9+aEN",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{L("default")})},children:F.following?e(z,{children:[e(T,{icon:"check-circle"})," ",e("span",{children:e(f,{id:"HOSk7R"})})]}):e(z,{children:[e(T,{icon:"plus"})," ",e("span",{children:e(f,{id:"MKEPCY"})})]})}),e(ye,{type:"checkbox",checked:U,disabled:te==="loading"||!g,onClick:()=>{if(ee("loading"),U){const $=W.find(B=>B.name.toLowerCase()===c.toLowerCase()).id;$?b.v1.featuredTags.$select($).remove().then(()=>{ae(!1),pe(o({id:"VH+Tf9"})),j(W.filter(B=>B.id!==$))}).catch(B=>{}).finally(()=>{ee("default")}):pe(o({id:"3OLv47"}))}else b.v1.featuredTags.create({name:c}).then($=>{ae(!0),pe(o({id:"9ra4hn"})),j(W.concat($))}).catch($=>{}).finally(()=>{ee("default")})},children:U?e(z,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(f,{id:"9ra4hn"})})]}):e(z,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(f,{id:"UlJ3QN"})})]})}),e(Ke,{})]}),!k&&e(z,{children:[e(As,{className:"plain",children:e(f,{id:"cSev+j"})}),e(ye,{type:"checkbox",checked:!!a,onClick:()=>{a?d.delete("media"):d.set("media","1"),l(d)},children:[e(T,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(f,{id:"eK4SL/"})})]}),e(Ke,{})]}),e(Vo,{className:"menu-field",disabled:q,children:({ref:$})=>e("form",{onSubmit:B=>{var le,H;B.preventDefault();const G=(H=(le=B.target[0].value)==null?void 0:le.trim)==null?void 0:H.call(le);G&&!h.some(se=>se.toLowerCase()===G.toLowerCase())&&(h.push(G),h.sort(),location.hash=m?`/${m}/t/${h.join("+")}${p}`:`/t/${h.join("+")}${p}`)},children:[e(T,{icon:"hashtag"}),e("input",{ref:$,type:"text",placeholder:q?he._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:es}}):o({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:q,dir:"auto"})]})}),e(Go,{takeOverflow:!0,children:h.map(($,B)=>e(ye,{disabled:h.length===1,onClick:G=>{h.splice(B,1),h.sort(),location.hash=m?`/${m}/t/${h.join("+")}${p}`:`/t/${h.join("+")}${p}`},children:[e(T,{icon:"x",alt:o({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),$]})]},$))}),e(Ke,{}),e(ye,{disabled:!y,onClick:()=>{if(A.shortcuts.length>=Ct){alert(he._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:Ct}}));return}const $={type:"hashtag",hashtag:h.join(" "),instance:m,media:a?"on":void 0};A.shortcuts.some(G=>G.type===$.type&&G.hashtag.split(/[\s+]+/).sort().join(" ")===$.hashtag.split(/[\s+]+/).sort().join(" ")&&(G.instance?G.instance===$.instance:!0)&&(G.media?!!G.media==!!$.media:!0))?alert(o({id:"kfeQnS"})):(A.shortcuts.push($),pe(o({id:"MIhb91"})))},children:[e(T,{icon:"shortcut"})," ",e("span",{children:e(f,{id:"i02Lq/"})})]}),e(ye,{onClick:()=>{let $=prompt(o({id:"2MQ2cd"}));if(!/\./.test($)){$&&alert(o({id:"7WddtO"}));return}$&&($=$.toLowerCase().trim(),location.hash=`/${$}/t/${h.join("+")}${p}`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(f,{id:"Sq04Yc"})})]}),v!==m&&e(ye,{onClick:()=>{location.hash=`/${v}/t/${h.join("+")}${p}`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(f,{id:"iAzCp4",values:{currentInstance:v},components:{0:e("b",{})}})})]})]})},m+w)}const Br=20;function Js(n){var S;const{_:i}=ue(),s=Ve(A),{masto:o,instance:c}=ce(),r=(n==null?void 0:n.id)||((S=Lt())==null?void 0:S.id),h=Y(),d=Y();async function l(_){(_||!d.current)&&(d.current=o.v1.timelines.list.$select(r).list({limit:Br}));const k=await d.current.next();let{value:x}=k;return x!=null&&x.length&&(_&&(h.current=x[0].id),x.forEach(C=>{Qe(C,c)})),{...k,value:x}}async function a(){var _;try{const k=await o.v1.timelines.list.$select(r).list({limit:1,since_id:h.current});let{value:x}=k;const C=((_=x[0])==null?void 0:_.id)===h.current;return x!=null&&x.length&&!C?(x=Nt(x,"home"),!0):!1}catch{return!1}}const[p,b]=E([]);ie(()=>{ln().then(b)},[]);const[m,g]=E({title:"List"});tt(m.title,"/l/:id"),ie(()=>{(async()=>{try{const _=await Us(r);g(_)}catch{}})()},[r]);const[u,v]=E(!1),[y,w]=E(!1);return e(z,{children:[e(Tt,{title:m.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:c,fetchItems:l,checkForUpdates:a,useItemID:!0,boostsCarousel:s.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(rt,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(T,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(T,{icon:"chevron-down",size:"s"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(f,{id:"BHWx+g"})})}),(p==null?void 0:p.length)>0&&e(z,{children:[e(Ke,{}),p.map(_=>e(qe,{to:`/l/${_.id}`,children:e("span",{children:_.title})},_.id))]})]}),headerEnd:e(rt,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ye,{onClick:()=>v({list:m}),children:[e(T,{icon:"pencil",size:"l"}),e("span",{children:e(f,{id:"ePK91l"})})]}),e(ye,{onClick:()=>w(!0),children:[e(T,{icon:"group",size:"l"}),e("span",{children:e(f,{id:"hB02vO"})})]})]})},r),u&&e(He,{onClick:_=>{_.target===_.currentTarget&&v(!1)},children:e(yi,{list:u==null?void 0:u.list,onClose:_=>{_.state==="success"&&_.list?g(_.list):_.state==="deleted"&&(location.hash="/l"),v(!1)}})}),y&&e(He,{onClick:_=>{_.target===_.currentTarget&&w(!1)},children:e(Hr,{listID:r,onClose:()=>w(!1)})})]})}const Fr=40;function Hr({listID:n,onClose:i}){const{_:s}=ue(),{masto:o,instance:c}=ce(),[r,h]=E([]),[d,l]=E("default"),[a,p]=E(!1),b=Y();async function m(g){p(!1),l("loading"),(async()=>{try{(g||!b.current)&&(b.current=o.v1.lists.$select(n).accounts.list({limit:Fr}));const u=await b.current.next();let{done:v,value:y}=u;y!=null&&y.length?(h(g?y:r.concat(y)),p(!v)):p(!1),l("default")}catch{l("error")}})()}return ie(()=>{m(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[r.map(g=>e("li",{children:[e(ht,{account:g,instance:c}),e(qr,{account:g,listID:n})]},g.id)),a&&d==="default"&&e(_t,{as:"li",onChange:g=>g&&m(),children:e("button",{type:"button",class:"light block",onClick:m,children:e(f,{id:"uXRAkV"})})})]})})]})}function qr({account:n,listID:i}){const{_:s}=ue(),{masto:o}=ce(),[c,r]=E("default"),[h,d]=E(!1);return e(ut,{confirm:!h,confirmLabel:e("span",{children:e(f,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{h?(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),r("default"),d(!1)}catch{r("error")}})()):(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),r("default"),d(!0)}catch{r("error")}})())},children:e("button",{type:"button",class:`light ${h?"":"danger"}`,disabled:c==="loading",children:s(h?{id:"m16xKo"}:{id:"MWIaew"})})})}const jr={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Yr=["favourite","reblog","follow"],Qs=n=>Yr.includes(n);function eo(n){return n.filter(i=>{const{type:s,id:o,createdAt:c}=i;if(!s)return!1;const r=jr[s];return r!=null&&r.length?r.every(h=>!!i[h]):!0})}function to(n){if(n!=null&&n.notificationGroups){const{accounts:i=[],notificationGroups:s=[],statuses:o=[]}=n;return s.map(c=>{const{sampleAccountIds:r,statusId:h}=c,d=(r==null?void 0:r.map(a=>i.find(p=>p.id===a)))||[],l=(o==null?void 0:o.find(a=>a.id===h))||null;return{...c,sampleAccounts:d,status:l}})}return n}function Vr(n){const i=n.map(h=>{const{latestPageNotificationAt:d,mostRecentNotificationId:l,sampleAccounts:a,notificationsCount:p}=h;return{id:""+l,createdAt:d,account:a[0],...h}}),s={},o=[];for(let h=0;h<i.length;h++){const d=i[h],{type:l,status:a,createdAt:p,notificationsCount:b,sampleAccounts:m,groupKey:g}=d,u=p?new Date(p).toLocaleDateString():"";let v=l;b>0&&(m==null||m.length),(l==="favourite"||l==="reblog")&&(v="favourite+reblog");const y=`${a==null?void 0:a.id}-${v}-${u}`,w=s[y];if(!Qs(l))o.push(d);else if(w)m.forEach(S=>{const _=w.sampleAccounts.find(k=>k.id===S.id);_?(_._types.push(l),_._types.sort().reverse()):w.sampleAccounts.push({...S,_types:[l]})}),w.notificationsCount=Math.min(w.notificationsCount,b),w._notificationsCount.push(b),w._accounts=w.sampleAccounts,w._groupKeys.push(g);else{const S=m.map(_=>({..._,_types:[l]}));s[y]={...d,sampleAccounts:S,type:v,_accounts:S,_groupKeys:g?[g]:[],_notificationsCount:[b]},o.push(s[y])}}const c={},r=[];for(let h=0;h<o.length;h++){const d=o[h],{type:l,account:a,_accounts:p,sampleAccounts:b,createdAt:m,groupKey:g}=d,u=m?new Date(m).toLocaleDateString():"",v=(b==null?void 0:b.length)===1||(p==null?void 0:p.length)===1;if((l==="favourite"||l==="reblog"||l==="favourite+reblog")&&v){const y=`${a==null?void 0:a.id}-${l}-${u}`,w=c[y];if(w)w._statuses.push(d.status),w._ids+=`-${d.id}`,w._groupKeys.push(g);else{let S=c[y]={...d,type:l,_ids:d.id,_statuses:[d.status],_groupKeys:g?[g]:[]};r.push(S)}}else r.push(d)}return r}function Gr(n){n=eo(n);const i={},s=[];for(let r=0,h=0;r<n.length;r++){const d=n[r],{id:l,status:a,account:p,type:b,createdAt:m}=d,g=m?new Date(m).toLocaleDateString():"";let u=b;(b==="favourite"||b==="reblog")&&(u="favourite+reblog");const v=`${a==null?void 0:a.id}-${u}-${g}`,y=i[v];if(!Qs(b))s[h++]=d;else if(y!=null&&y.account){const w=y._accounts.find(S=>S.id===p.id);w?(w._types.push(b),w._types.sort().reverse(),y._ids+=`-${l}`):(p._types=[b],y._accounts.push(p),y._ids+=`-${l}`)}else{p&&(p._types=[b]);let w=i[v]={...d,type:u,_ids:l,_accounts:p?[p]:[]};s[h++]=w}}const o={},c=[];for(let r=0,h=0;r<s.length;r++){const d=s[r],{id:l,account:a,_accounts:p,type:b,createdAt:m}=d,g=m?new Date(m).toLocaleDateString():"";if(b==="favourite+reblog"&&a&&p.length===1){const u=`${a==null?void 0:a.id}-${b}-${g}`,v=o[u];if(v)v._statuses.push(d.status),v._ids+=`-${l}`;else{let y=o[u]={...d,type:b,_ids:l,_statuses:[d.status]};c[h++]=y}}else c[h++]=d}return c}const ts=20,Kr=new URLSearchParams;function no({columnMode:n,...i}){const{_:s}=ue(),{masto:o,instance:c}=ce(),[r]=n?[Kr]:bt(),[h,d]=E(null),l=(i==null?void 0:i.type)||r.get("type")||h;tt(s(l==="private"?{id:"2BApYc"}:{id:"/bZzdR"}),"/mentions");const a=Y(),p=Y();async function b(S){(S||!a.current)&&(a.current=o.v1.notifications.list({limit:ts,types:["mention"]}));const _=await a.current.next();let{value:k}=_;return k!=null&&k.length&&(k=eo(k),S&&(p.current=k[0].id),k.forEach(({status:x})=>{Qe(x,c)})),{..._,value:k==null?void 0:k.map(x=>x.status)}}const m=Y(),g=Y();async function u(S){(S||!m.current)&&(m.current=o.v1.conversations.list({limit:ts}));const _=await m.current.next();let{value:k}=_;return k=k==null?void 0:k.filter(x=>x.lastStatus),k!=null&&k.length&&(S&&(g.current=k[0].lastStatus.id),k.forEach(({lastStatus:x})=>{Qe(x,c)})),{..._,value:k==null?void 0:k.map(x=>x.lastStatus)}}function v(...S){return l==="private"?u(...S):b(...S)}async function y(){var S;if(l==="private")try{const _=await o.v1.conversations.list({limit:1,since_id:g.current}).next();let{value:k}=_;const x=((S=k[0])==null?void 0:S.id)===g.current;return k!=null&&k.length&&!x?(g.current=k[0].lastStatus.id,!0):!1}catch{return!1}else try{const _=await o.v1.notifications.list({limit:1,types:["mention"],since_id:p.current}).next();let{value:k}=_;return k!=null&&k.length?(p.current=k[0].id,!0):!1}catch{return!1}}const w=Ce(()=>e("div",{class:"filter-bar centered",children:[e(ge,{to:"/mentions",class:l?"":"is-active",onClick:S=>{n&&(S.preventDefault(),d(null))},children:e(f,{id:"N40H+G"})}),e(ge,{to:"/mentions?type=private",class:l==="private"?"is-active":"",onClick:S=>{n&&(S.preventDefault(),d("private"))},children:e(f,{id:"zwBp5t"})})]}),[l]);return e(Tt,{title:s({id:"/bZzdR"}),id:"mentions",emptyText:s({id:"03jFGT"}),errorText:s({id:"pqR9KF"}),instance:c,fetchItems:v,checkForUpdates:y,useItemID:!0,timelineStart:w,refresh:l})}const Zr=80,Wr=20,Xr=new URLSearchParams,hn={block:"center",inline:"center",behavior:"smooth"},io=ms(()=>et("@mastodon/grouped-notifications"),{maxAge:1e3*60*5});function ei(n={}){const{masto:i}=ce();return A.settings.groupedNotificationsAlpha&&io()?i.v2.notifications.list({limit:Wr,...n}):i.v1.notifications.list({limit:Zr,...n})}function so(n){return A.settings.groupedNotificationsAlpha&&io()?Vr(n):Gr(n)}const Jr=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],Qr={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function el({columnMode:n}){var fe;const{_:i,_:s}=ue();tt(s({id:"iDNBZe"}),"/notifications");const{masto:o,instance:c}=ce(),r=Ve(A),[h,d]=E("default"),[l]=n?[Xr]:bt(),a=l.get("id"),p=l.get("access_token"),[b,m]=E(!1),[g,u]=E(!1),v=Y(),{nearReachEnd:y,scrollDirection:w,reachStart:S,nearReachStart:_}=Wa({scrollableRef:v}),k=w==="end"&&!_,[x,C]=E([]),[I,R]=E([]),L=Y();async function F(N){var Se;if((N||!L.current)&&(L.current=ei({excludeTypes:["follow_request"]})),/max_id=($|&)/i.test((Se=L.current)==null?void 0:Se.nextParams))return{done:!0};const re=await L.current.next(),Te=to(re.value);if(Te!=null&&Te.length){Te.forEach(Ye=>{Qe(Ye.status,c,{skipThreading:!0})});const Ne=so(Te);N?(A.notificationsLast=Ne[0],A.notifications=Ne,o.v1.markers.create({notifications:{lastReadId:Ne[0].id}}).catch(()=>{})):A.notifications.push(...Ne)}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),re}async function P(){try{return await o.v1.followRequests.list({limit:80})}catch{return[]}}const q=()=>{d("loading"),(async()=>{try{const N=await P();C(N),d("default")}catch{d("error")}})()};async function te(){try{return await o.v1.announcements.list()}catch{return[]}}const ee=et("@mastodon/filtered-notifications"),[W,j]=E(!1),[U,ae]=E({});function $(){return o.v2.notifications.policy.fetch().catch(()=>{})}function B(){$().then(N=>{ae(N)}).catch(()=>{})}const[G,le]=E(null);function H(){return o.v1.notifications.requests.list()}const se=N=>{we(!1),d("loading"),(async()=>{try{const re=F(N);N&&(te().then(Se=>{Se.sort((Ne,Ye)=>{const M=new Date(Ne.updatedAt||Ne.createdAt);return new Date(Ye.updatedAt||Ye.createdAt)-M}),R(Se)}).catch(()=>{}),P().then(Se=>{C(Se)}).catch(()=>{}),ee&&B());const{done:Te}=await re;m(!Te),d("default")}catch{d("error")}})()};ie(()=>{se(!0)},[]),ie(()=>{S&&se(!0)},[S]);const[be,we]=E(!1),X=st(({disableIdleCheck:N=!1}={})=>{var re;h!=="loading"&&r.settings.autoRefresh&&((re=v.current)==null?void 0:re.scrollTop)<16&&(N||window.__IDLE__)&&!tl()&&se(!0)},[r.notificationsShowNew,r.settings.autoRefresh,h]),de=Y();Yt(N=>{if(N){const re=Date.now()-de.current;!de.current||re>1e3*3?X({disableIdleCheck:!0}):de.current=Date.now()}});const Ee=Y(!0);ie(()=>{let N=To(A,"notificationsShowNew",re=>{if(Ee.current){Ee.current=!1;return}h!=="loading"&&(re&&X(),we(re))});return()=>N==null?void 0:N()},[]);const $e=new Date,Pe=new Date($e-24*60*60*1e3);let ze=new Date;const Le=!r.notifications.some(N=>new Date(N.createdAt).toDateString()===$e.toDateString()),Ae=Y();ie(()=>{a&&(A.routeNotification={id:a,accessToken:atob(p)})},[a,p]);const[J,_e]=E(null);ie(async()=>{var Se,Ne,Ye;const N=new Date;if(N.getMonth()!==11||!et("@mastodon/annual-report"))return;let re=ve.account.get("annualReportNotification");if(re){_e(re);return}const Te=ei({types:["annual_report"]});try{const M=await Te.next();re=(Ne=(Se=M==null?void 0:M.value)==null?void 0:Se.notificationGroups)==null?void 0:Ne[0],((Ye=re==null?void 0:re.annualReport)==null?void 0:Ye.year)==N.getFullYear()&&(_e(re),ve.account.set("annualReportNotification",re))}catch{}},[]);const De=".notification",ne=Fe("j",()=>{const N=document.activeElement.closest(De),re=N==null?void 0:N.getBoundingClientRect(),Te=Array.from(v.current.querySelectorAll(De));if(N&&re.top<v.current.clientHeight&&re.bottom>0){const Se=Te.indexOf(N);let Ne=Te[Se+1];Ne&&(Ne.focus(),Ne.scrollIntoView(hn))}else{const Se=Te.find(Ne=>{const Ye=Ne.getBoundingClientRect();return Ye.top>=44&&Ye.left>=0});Se&&(Se.focus(),Se.scrollIntoView(hn))}}),oe=Fe("k",()=>{const N=document.activeElement.closest(De),re=N==null?void 0:N.getBoundingClientRect(),Te=Array.from(v.current.querySelectorAll(De));if(N&&re.top<v.current.clientHeight&&re.bottom>0){const Se=Te.indexOf(N);let Ne=Te[Se-1];Ne&&(Ne.focus(),Ne.scrollIntoView(hn))}else{const Se=Te.find(Ne=>{const Ye=Ne.getBoundingClientRect();return Ye.top>=44&&Ye.left>=0});Se&&(Se.focus(),Se.scrollIntoView(hn))}}),Re=Fe(["enter","o"],()=>{const N=document.activeElement.closest(De),re=N==null?void 0:N.querySelector(".status-link");re&&re.click()}),O=new Date,Q=Ce(()=>ot(O,{forceOpts:{weekday:"long"}}),[O]);return e("div",{id:"notifications-page",class:"deck-container",ref:N=>{v.current=N,ne(N),oe(N),Re(N)},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${g?"only-mentions":""}`,children:[e("header",{hidden:k,onClick:N=>{var re;N.target.closest("a, button")||(re=v.current)==null||re.scrollTo({top:0,behavior:"smooth"})},onDblClick:N=>{N.target.closest("a, button")||se(!0)},class:h==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:e(f,{id:"iDNBZe"})}),e("div",{class:"header-side",children:ee&&e("button",{type:"button",class:"button plain4",onClick:()=>{j(!0)},children:e(T,{icon:"settings",size:"l",alt:s({id:"a/+arl"})})})})]}),be&&h!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{var N;se(!0),(N=v.current)==null||N.scrollTo({top:0,behavior:"smooth"})},children:[e(T,{icon:"arrow-up"})," ",e(f,{id:"Jy9RU/"})]})]}),I.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(T,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(f,{id:"0whvLM",values:{0:I.length}})," ",e("small",{class:"insignificant",children:c})]}),I.length>1&&e("span",{class:"announcements-nav-buttons",children:I.map((N,re)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{var Te;(Te=Ae.current)==null||Te.children[re].scrollIntoView({behavior:"smooth",block:"nearest"})},children:re+1}))})]}),e("ul",{class:`announcements-list-${I.length>1?"multiple":"single"}`,ref:Ae,children:I.map(N=>e("li",{children:e(nl,{announcement:N})}))})]})})}),x.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(f,{id:"6Fs1Ba"})}),x.length>5?e("details",{children:[e("summary",{children:e(f,{id:"7dHKu4",values:{0:x.length}})}),e("ul",{children:x.map(N=>e("li",{children:[e(ht,{account:N}),e(Qn,{accountID:N.id,onChange:()=>{}})]},N.id))})]}):e("ul",{children:x.map(N=>e("li",{children:[e(ht,{account:N}),e(Qn,{accountID:N.id,onChange:()=>{}})]},N.id))})]}),ee&&((fe=U==null?void 0:U.summary)==null?void 0:fe.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 N=>{const{open:re}=N.target;if(re){const Te=await H();le(Te)}},children:[e("summary",{children:e(f,{id:"N3Bq0f",values:{0:U.summary.pendingRequestsCount}})}),G?(G==null?void 0:G.length)>0&&e("ul",{children:G.map(N=>{var re,Te;return e("li",{children:[e("div",{class:"request-notifcations",children:[!((re=N.lastStatus)!=null&&re.id)&&e(ht,{useAvatarStatic:!0,showStats:!0,account:N.account}),((Te=N.lastStatus)==null?void 0:Te.id)&&e("div",{class:"last-post",children:e(ge,{class:"status-link",to:`/${c}/s/${N.lastStatus.id}`,children:e(je,{status:N.lastStatus,size:"s",readOnly:!0})})}),e(sl,{request:N})]}),e(ol,{request:N,onChange:()=>{se(!0)}})]},N.id)})}):e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})})]})})})}),J&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(cn,{notification:J})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:g,onChange:N=>{u(N.target.checked)}})," ",e(f,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(f,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:Q})]}),Le&&e("p",{class:"ui-state insignificant",children:h==="default"?s({id:"KS7iJH"}):e(z,{children:"…"})}),r.notifications.length?e(z,{children:r.notifications.filter(N=>N.type!=="follow_request").map(N=>{if(g&&N.type!=="mention")return null;const re=new Date(N.createdAt),Te=re.toDateString()!==ze.toDateString();Te&&(ze=re);const Se=re.toDateString()===Pe.toDateString()?s({id:"y/0uwd"}):ot(ze,{hideTime:!0}),Ne=ot(ze,{forceOpts:{weekday:"long"}});return e(z,{children:[Te&&e("h2",{class:"timeline-header",children:[e("span",{children:Se})," ",e("small",{class:"insignificant bidi-isolate",children:Ne})]}),e(cn,{instance:c,notification:N},N._ids||N.id)]},N._ids||N.id)})}):e(z,{children:[h==="loading"&&e(z,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((N,re)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(T,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),h==="error"&&e("p",{class:"ui-state",children:[e(f,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>se(!0),children:e(f,{id:"KDw4GX"})})]})]}),b&&e(_t,{onChange:N=>{N&&se()},children:e("button",{type:"button",class:"plain block",disabled:h==="loading",onClick:()=>se(),style:{marginBlockEnd:"6em"},children:h==="loading"?e(Ue,{abrupt:!0}):e(f,{id:"uXRAkV"})})})]}),ee&&W&&e(He,{onClick:N=>{N.target===N.currentTarget&&j(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>j(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(f,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:N=>{N.preventDefault();const{forNotFollowing:re,forNotFollowers:Te,forNewAccounts:Se,forPrivateMentions:Ne,forLimitedAccounts:Ye}=N.target,M={...U,forNotFollowing:re.value,forNotFollowers:Te.value,forNewAccounts:Se.value,forPrivateMentions:Ne.value,forLimitedAccounts:Ye.value};ae(M),j(!1),(async()=>{try{await o.v2.notifications.policy.update(M),pe(s({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(f,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:Jr.map(N=>{const re=U[N];return e("div",{children:e("label",{children:[i(Qr[N]),e("select",{name:N,defaultValue:re,class:"small",children:[e("option",{value:"accept",children:e(f,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(f,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(f,{id:"gbbkE7"})})]})]})},N)})}),e("p",{children:e("button",{type:"submit",children:e(f,{id:"tfDRzk"})})})]})})]})})]})}function tl(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function nl({announcement:n}){const{instance:i}=ce(),{contact:s}=hs(),o=s==null?void 0:s.account,{id:c,content:r,startsAt:h,endsAt:d,published:l,allDay:a,publishedAt:p,updatedAt:b,read:m,mentions:g,statuses:u,tags:v,emojis:y,reactions:w}=n,S=new Date(p),_=ot(S),k=new Date(b),x=ot(k);return e("div",{class:"announcement-block",children:[e(ht,{account:o}),e("div",{class:"announcement-content",onClick:ks({mentions:g,instance:i}),dangerouslySetInnerHTML:{__html:Kn(r,{emojis:y})}}),e("p",{class:"insignificant",children:[e("time",{datetime:S.toISOString(),children:ot(S)}),b&&x!==_&&e(z,{children:[" ","•"," ",e("span",{class:"ib",children:e(f,{id:"TbFrLc",values:{0:ot(k)},components:{0:e("time",{datetime:k.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:w.map(C=>{const{name:I,count:R,me:L,staticUrl:F,url:P}=C;return e("button",{type:"button",class:`plain4 small ${L?"reacted":""}`,children:[P||F?e("img",{src:P||F,alt:I,width:"16",height:"16"}):e("span",{children:I})," ",e("span",{class:"count",children:Je(R)})]})})})]})}function il(n){const{masto:i}=ce();return i.v1.notifications.list({accountID:n})}function sl({request:n}){var b;const{instance:i}=ce(),[s,o]=E("loading"),{account:c,lastStatus:r}=n,[h,d]=E(!1),[l,a]=E([]);function p(){d(!1)}return ie(()=>{var m;(m=n==null?void 0:n.account)!=null&&m.id&&h&&(o("loading"),(async()=>{const g=await il(n.account.id);a(g||[]),o("default")})())},[h,(b=n==null?void 0:n.account)==null?void 0:b.id]),e(z,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{d(!0)},children:[e(T,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(f,{id:"H0wUNM",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(T,{icon:"chevron-down"})]}),h&&e(He,{onClick:m=>{m.target===m.currentTarget&&p()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:p,children:e(T,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(f,{id:"MXOmPt",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):l.map(m=>e("div",{class:"notification-peek",onClick:g=>{const{target:u}=g;(g.target.tagName==="BUTTON"||g.target.tagName==="A")&&p()},children:e(cn,{instance:i,notification:m,isStatic:!0})}))})]})})]})}function ol({request:n,onChange:i}){const{_:s}=ue(),{masto:o}=ce(),[c,r]=E("default"),[h,d]=E(null),l=h!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||l,onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).accept(),d("accept"),r("default"),i({request:n,state:"accept"}),pe(s({id:"ZtBMwU",values:{0:n.account.username}}))}catch{r("error"),pe(s({id:"S92JKG"}))}})()},children:e(f,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:c==="loading"||l,class:"light danger",onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).dismiss(),d("dismiss"),r("default"),i({request:n,state:"dismiss"}),pe(s({id:"pRqdUf",values:{1:n.account.username}}))}catch{r("error"),pe(s({id:"S5aemF"}))}})()},children:e(f,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:c==="loading"?e(Ue,{abrupt:!0}):h==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"notification-accepted"}):h==="dismiss"&&e(T,{icon:"x-circle",alt:s({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const oo=lt(el),cl=20;function ti({local:n,columnMode:i,...s}){const{_:o}=ue(),c=Ve(A),r=!!n,h=i?{}:Lt(),{masto:d,instance:l}=ce({instance:(s==null?void 0:s.instance)||h.instance}),{masto:a,instance:p}=ce(),b=o(r?{id:"u96B/B",values:{instance:l}}:{id:"PgVqvd",values:{instance:l}});tt(b,r?"/:instance?/p/l":"/:instance?/p");const m=Y(),g=Y();async function u(y){if(y||!g.current){const _={limit:cl,local:r||void 0};!r&&et("@pixelfed/global-feed")&&(_.remote=!0),g.current=d.v1.timelines.public.list(_)}const w=await g.current.next();let{value:S}=w;return S!=null&&S.length&&(y&&(m.current=S[0].id),S.forEach(_=>{Qe(_,l)})),{...w,value:S}}async function v(){var y;try{const w=await d.v1.timelines.public.list({limit:1,local:r,since_id:m.current}).next();let{value:S}=w;const _=((y=S[0])==null?void 0:y.id)===m.current;return S!=null&&S.length&&!_?(S=Nt(S,"public"),!0):!1}catch{return!1}}return e(Tt,{title:b,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:o(r?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:l})]}),id:"public",instance:l,emptyText:o({id:"BiZJ6G"}),errorText:o({id:"scd9lw"}),fetchItems:u,checkForUpdates:v,useItemID:!0,headerStart:e(z,{}),boostsCarousel:c.settings.boostsCarousel,filterContext:"public",headerEnd:e(rt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(ye,{href:r?`/#/${l}/p`:`/#/${l}/p/l`,children:r?e(z,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(f,{id:"dXMiUw"})})]}):e(z,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(f,{id:"t2B/we"})})]})}),e(Ke,{}),e(ye,{onClick:()=>{let y=prompt(o({id:"2MQ2cd"}));if(!/\./.test(y)){y&&alert(o({id:"7WddtO"}));return}y&&(y=y.toLowerCase().trim(),location.hash=r?`/${y}/p/l`:`/${y}/p`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(f,{id:"Sq04Yc"})})]}),p!==l&&e(ye,{onClick:()=>{location.hash=r?`/${p}/p/l`:`/${p}/p`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(f,{id:"iAzCp4",values:{currentInstance:p},components:{0:e("b",{})}})})]})]})},l+r)}const fn=5,Vn=40,al=new URLSearchParams,pn={block:"nearest",inline:"center",behavior:"smooth"};function co({columnMode:n,...i}){const{_:s}=ue(),o=n?{}:Lt(),{masto:c,instance:r,authenticated:h}=ce({instance:o.instance}),[d,l]=E("default"),[a]=n?[al]:bt(),p=Y(),b=(i==null?void 0:i.query)||a.get("q"),m=n?"statuses":(i==null?void 0:i.type)||a.get("type");let g=s({id:"A1taO8"});if(b)switch(m){case"statuses":g=s({id:"6YeoAt",values:{q:b}});break;case"accounts":g=s({id:"fpgumQ",values:{q:b}});break;case"hashtags":g=s({id:"AuiMZZ",values:{q:b}});break;default:g=s({id:"wr3GZI",values:{q:b}})}tt(g,"/search");const[u,v]=E(!1),y=Y(0);ie(()=>{y.current=0},[b,m]);const w=Y();wt(()=>{var $,B;(B=($=w.current)==null?void 0:$.scrollTo)==null||B.call($,0,0)},[b,m]);const[S,_]=E([]),[k,x]=E([]),[C,I]=E([]);ie(()=>{_([]),x([]),I([])},[b]);const R={statuses:S,accounts:k,hashtags:C},L={statuses:_,accounts:x,hashtags:I},[F,P]=E({}),q=async $=>{if(!($!=null&&$.length))return;const B=await li($,F);B&&P({...F,...B})};function te($){$&&(y.current=0),!(!$&&!h)&&(l("loading"),$&&!m&&(_(S.slice(0,fn)),x(k.slice(0,fn)),I(C.slice(0,fn))),(async()=>{var G,le,H,se,be,we;const B={q:b,resolve:h,limit:fn};m&&(B.limit=Vn,B.type=m,h&&(B.offset=y.current));try{const X=await c.v2.search.fetch(B);if(m)if($){L[m](X[m]);const de=(G=X[m])==null?void 0:G.length;y.current=Vn,v(!!de)}else if(((H=(le=X[m])==null?void 0:le[0])==null?void 0:H.id)===((be=(se=R[m])==null?void 0:se[0])==null?void 0:be.id))v(!1);else{L[m](Ee=>[...Ee,...X[m]]);const de=(we=X[m])==null?void 0:we.length;y.current=y.current+Vn,v(!!de)}else _(X.statuses||[]),x(X.accounts||[]),I(X.hashtags||[]),y.current=0,v(!1);q(X.accounts),l("default")}catch{l("error")}})())}const ee=Y();Yt($=>{var G;const B=((G=w.current)==null?void 0:G.scrollTop)===0;if($&&B){const le=Date.now()-ee.current;!ee.current||le>1e3*3?te(!0):ee.current=Date.now()}}),ie(()=>{var B,G;let $;return(G=(B=p.current)==null?void 0:B.setValue)==null||G.call(B,b||""),b?te(!0):$=setTimeout(()=>{var le,H;(H=(le=p.current)==null?void 0:le.focus)==null||H.call(le)},150),()=>clearTimeout($)},[b,m,r]),Fe(["/","Slash"],$=>{var B,G,le,H;(G=(B=p.current)==null?void 0:B.focus)==null||G.call(B),(H=(le=p.current)==null?void 0:le.select)==null||H.call(le)},{preventDefault:!0});const W=".timeline > li > a, .hashtag-list > li > a",j=Fe("j",()=>{const $=document.activeElement.closest(W),B=$==null?void 0:$.getBoundingClientRect(),G=Array.from(w.current.querySelectorAll(W));if($&&B.top<w.current.clientHeight&&B.bottom>0){const le=G.indexOf($);let H=G[le+1];H&&(H.focus(),H.scrollIntoView(pn))}else{const le=G.find(H=>{const se=H.getBoundingClientRect();return se.top>=44&&se.left>=0});le&&(le.focus(),le.scrollIntoView(pn))}}),U=Fe("k",()=>{const $=document.activeElement.closest(W),B=$==null?void 0:$.getBoundingClientRect(),G=Array.from(w.current.querySelectorAll(W));if($&&B.top<w.current.clientHeight&&B.bottom>0){const le=G.indexOf($);let H=G[le-1];H&&(H.focus(),H.scrollIntoView(pn))}else{const le=G.find(H=>{const se=H.getBoundingClientRect();return se.top>=44&&se.left>=0});le&&(le.focus(),le.scrollIntoView(pn))}}),[ae]=mi();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:$=>{w.current=$,j($),U($)},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:d==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(Mt,{})}),e(Vs,{ref:p}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{te(!0)},disabled:d==="loading",children:e(T,{icon:"search",size:"l",alt:s({id:"A1taO8"})})})})]})}),e("main",{children:[!!b&&!n&&e("div",{ref:ae,class:`filter-bar ${d==="loading"?"loading":""}`,children:[!!m&&e(ge,{to:`/search${b?`?q=${encodeURIComponent(b)}`:""}`,children:[e(T,{icon:"chevron-left"})," ",e(f,{id:"N40H+G"})]}),[{label:s({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(b)}&type=accounts`},{label:s({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(b)}&type=hashtags`},{label:s({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(b)}&type=statuses`}].sort(($,B)=>$.type===m?-1:B.type===m?1:0).map($=>e(ge,{to:$.to,children:$.label},$.type))]}),b?e(z,{children:[(!m||m==="accounts")&&e(z,{children:[m!=="accounts"&&e("h2",{class:"timeline-header",children:[e(f,{id:"bPwFdf"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=accounts`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),k.length>0?e(z,{children:[e("ul",{class:"timeline flat accounts-list",children:k.map($=>e("li",{children:e(ht,{account:$,instance:r,showStats:!0,relationship:F[$.id]})},$.id))}),m!=="accounts"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=accounts`,children:[e(f,{id:"BMmtZ8"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(f,{id:"YYB61U"})}))]}),(!m||m==="hashtags")&&e(z,{children:[m!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(f,{id:"VwUsHI"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=hashtags`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),C.length>0?e(z,{children:[e("ul",{class:"link-list hashtag-list",children:C.map($=>{var H;const{name:B,history:G}=$,le=(H=G==null?void 0:G.reduce)==null?void 0:H.call(G,(se,be)=>se+ +be.uses,0);return e("li",{children:e(ge,{to:r?`/${r}/t/${B}`:`/t/${B}`,children:[e(T,{icon:"hashtag",alt:"#"}),e("span",{children:B}),!!le&&e("span",{class:"count",children:Je(le)})]})},`${B}-${le}`)})}),m!=="hashtags"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=hashtags`,children:[e(f,{id:"Nc/W5J"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(f,{id:"4MFM3P"})}))]}),(!m||m==="statuses")&&e(z,{children:[m!=="statuses"&&e("h2",{class:"timeline-header",children:[e(f,{id:"+owNNn"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=statuses`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),S.length>0?e(z,{children:[e("ul",{class:"timeline",children:S.map($=>e("li",{children:e(ge,{class:"status-link",to:r?`/${r}/s/${$.id}`:`/s/${$.id}`,children:e(je,{status:$})})},$.id))}),m!=="statuses"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=statuses`,children:[e(f,{id:"LYCgej"})," ",e(T,{icon:"arrow-right"})]})})]}):!m&&(d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(f,{id:"Hzi9AA"})}))]}),!!m&&(d==="default"?u?e(_t,{onChange:$=>{$&&te()},children:e("button",{type:"button",class:"plain block",onClick:()=>te(),style:{marginBlockEnd:"6em"},children:e(f,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(f,{id:"2EYeAZ"})}):d==="loading"&&e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}))]}):d==="loading"?e("p",{class:"ui-state",children:e(Ue,{abrupt:!0})}):e("p",{class:"ui-state",children:e(f,{id:"fGn1Hk"})})]})]})})}const rl=20,ao=10*60*1e3,ll=gt(n=>n.v1.trends.links.list().next(),{maxAge:ao}),dl=gt(n=>n.v1.trends.tags.list().next(),{maxAge:ao});function ul(n){return et("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}):n.v1.trends.statuses.list({limit:rl})}function hl(n,i){return n.v1.timelines.link.list(i)}function ro({columnMode:n,...i}){const{_:s}=ue(),o=Ve(A),c=n?{}:Lt(),{masto:r,instance:h}=ce({instance:(i==null?void 0:i.instance)||c.instance}),{masto:d,instance:l}=ce(),a=s({id:"cI3UEs",values:{instance:h}});tt(a,"/:instance?/trending");const p=Y(),b=h===l,[m,g]=E([]),[u,v]=E([]),y=Y();async function w(ee){var U;if(ee||!y.current){if(y.current=ul(r),et("@mastodon/trending-hashtags"))try{const{value:ae}=await dl(r);ae!=null&&ae.length&&g(ae)}catch{}if(et("@mastodon/trending-links"))try{const{value:ae}=await ll(r,h),$=(U=ae==null?void 0:ae.filter)==null?void 0:U.call(ae,B=>B.type==="link");$!=null&&$.length&&v($)}catch{}}const W=await y.current.next();let{value:j}=W;return j!=null&&j.length&&(ee&&(p.current=j[0].id),j.forEach(ae=>{Qe(ae,h)})),{...W,value:j}}const[S,_]=E(!1),k=Y(),[x,C]=E(null),I=!!x,R=Y(),L=b&&et("@mastodon/trending-link-posts");ie(()=>{x&&R.current&&R.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[x]);const F=Y();async function P(ee){(ee||!k.current)&&(_(!0),k.current=hl(r,{url:x})),F.current=x;const W=await k.current.next();let{value:j}=W;return j!=null&&j.length&&(j=Nt(j,"public"),j.forEach(U=>{Qe(U,h)})),F.current===x&&_(!1),{...W,value:j}}async function q(){try{const ee=await r.v1.trends.statuses.list({limit:1}).next();let{value:W}=ee;return W=Nt(W,"public"),W!=null&&W.length&&W[0].id!==p.current?(p.current=W[0].id,!0):!1}catch{return!1}}const te=Ce(()=>e(z,{children:[!!m.length&&e("div",{class:"filter-bar expandable",children:[e(T,{icon:"chart",class:"insignificant",size:"l"}),m.map((ee,W)=>{const{name:j,history:U}=ee,ae=U.reduce(($,B)=>$+ +B.uses,0);return e(ge,{to:`/${h}/t/${j}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),j]}),e("span",{class:"filter-count",children:Je(ae)})]},j)})]}),!!u.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(f,{id:"9veeTb"})})}),u.map(ee=>{var J,_e;const{authors:W,authorName:j,authorUrl:U,blurhash:ae,description:$,height:B,image:G,imageDescription:le,language:H,providerName:se,providerUrl:be,publishedAt:we,title:X,url:de,width:Ee}=ee,$e=(_e=(J=W==null?void 0:W[0])==null?void 0:J.account)!=null&&_e.id?W[0].account:null,Pe=X.length<30,ze=!!(j||$e),Le=Ts(de);let Ae;if(ae){const De=di(ae),ne=ki(De);Ae=wi([.6,ne[1],ne[2]])}return e("div",{children:[e("a",{ref:x===de?R:null,href:de,target:"_blank",rel:"noopener",class:`link-block ${I?x===de?"active":"inactive":""}`,style:Ae?{"--accent-color":`rgb(${Ae.join(",")})`,"--accent-alpha-color":`rgba(${Ae.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:G,alt:le,width:Ee,height:B,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Le})," ",!!we&&e(z,{children:"· "}),!!we&&e(z,{children:e(It,{datetime:we,format:"micro"})})]}),!!X&&e("h1",{class:"title",lang:H,dir:"auto",title:X,children:X})]}),!!$&&e("p",{class:`description ${ze&&!Pe?"":"more-lines"}`,lang:H,dir:"auto",title:$,children:$}),ze&&e(z,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(f,{id:"aavdrC",values:{0:$e?e(mt,{account:$e,showAvatar:!0}):U?e("a",{href:U,target:"_blank",rel:"noopener",children:j}):j}})})})]})]})]})}),L&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{C(de)},disabled:de===x,children:[e(T,{icon:"comment2"})," ",e("span",{children:e(f,{id:"/bZzdR"})})," ",e(T,{icon:"chevron-down"})]})]},de)})]}),L&&!!u.length&&e("div",{class:`timeline-header-block ${I?"blended":""}`,children:I?e(z,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:S?e(Ue,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{C(null)},children:e(T,{icon:"x",alt:s({id:"9Q/4xJ"})})})}),e("p",{children:e(f,{id:"BATCqf",values:{0:x.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(f,{id:"Vosm4k"})})})]}),[m,u,x,S]);return e(Tt,{title:a,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(f,{id:"4/iCqx"})}),e("div",{children:h})]}),id:"trending",instance:h,emptyText:s({id:"6HA9+s"}),errorText:s({id:"scd9lw"}),fetchItems:I?P:w,checkForUpdates:I?void 0:q,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(z,{}),boostsCarousel:o.settings.boostsCarousel,filterContext:"public",timelineStart:te,refresh:x,clearWhenRefresh:!0,view:I?"link-mentions":void 0,headerEnd:e(rt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(ye,{onClick:()=>{let ee=prompt(s({id:"2MQ2cd"}));if(!/\./.test(ee)){ee&&alert(s({id:"7WddtO"}));return}ee&&(ee=ee.toLowerCase().trim(),location.hash=`/${ee}/trending`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(f,{id:"Sq04Yc"})})]}),l!==h&&e(ye,{onClick:()=>{location.hash=`/${l}/trending`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(f,{id:"iAzCp4",values:{currentInstance:l},components:{0:e("b",{})}})})]})]})},h)}const ns={block:"nearest",inline:"nearest",behavior:"smooth"};function fl(){const{_:n}=ue();tt(n({id:"i0qMbr"}),"/");const i=Ve(A),{shortcuts:s}=i,o=s.map(c=>{if(!c)return null;const{type:r,...h}=c,d={following:Ci,notifications:oo,list:Js,public:ti,bookmarks:Ks,favourites:Zs,hashtag:Xs,mentions:no,trending:ro,search:co}[r];return!d||r==="search"&&!h.query||r==="list"&&!h.id?null:e(d,{...h,columnMode:!0},r+JSON.stringify(h))});return Fe(["1","2","3","4","5","6","7","8","9"],(c,r)=>{try{const h=parseInt(r.keys[0],10)-1,d=document.querySelectorAll("#columns > *")[h];d&&(d.focus(),d.scrollIntoView(ns))}catch{}}),Fe(["[","]"],(c,r)=>{const h=r.keys[0],d=document.activeElement.closest("#columns > *"),l=Pt(),a=l?"]":"[",p=l?"[":"]";let b;h===a?b=d?d.previousElementSibling:document.querySelectorAll("#columns > *")[0]:h===p&&(b=d?d.nextElementSibling:document.querySelectorAll("#columns > *")[1]),b&&(b.focus(),b.scrollIntoView(ns))}),e("div",{id:"columns",onContextMenu:c=>{c.target.closest(".deck > header")&&!c.target.closest("a")&&!c.target.closest("button")&&(c.preventDefault(),A.showShortcutsSettings=!0)},onFocus:()=>{const c=document.activeElement.closest("#columns > *");c&&document.querySelectorAll("#columns > *").forEach(r=>{r.classList.toggle("focus",r===c)})},children:o})}function pl(){var s;const{_:n}=ue(),i=Ve(A);return __BENCHMARK.end("time-to-home"),ie(()=>{(async()=>{const o=await pt.drafts.keys();if(o.length){const c=_n();o.filter(h=>h.startsWith(c)).length&&(A.showDrafts=!0)}})()},[]),e(z,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&((s=i.shortcuts)!=null&&s.length)?e(fl,{}):e(Ci,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(ml,{})})})}function ml(){const{_:n}=ue(),i=Ve(A),s=Y(),[o,c]=E(void 0);return e(z,{children:[e(ge,{ref:s,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${o||""}`,onClick:r=>{r.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(r.preventDefault(),c(h=>h?void 0:"open"))},children:e(T,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(bl,{state:o,anchorRef:s,onClose:()=>c(void 0)})]})}const gl=5;function bl({anchorRef:n,state:i,onClose:s}){const{masto:o,instance:c}=ce(),r=Ve(A),[h,d]=E("default"),l=ei();async function a(){const v=await l.next(),y=to(v.value);if(y!=null&&y.length){y.forEach(S=>{Qe(S.status,c,{skipThreading:!0})});const w=so(y);A.notificationsLast=w[0],A.notifications=w,o.v1.markers.create({notifications:{lastReadId:w[0].id}}).catch(()=>{})}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),v}const[p,b]=E(!1);function m(){return o.v1.followRequests.list({limit:1})}function g(){d("loading"),(async()=>{try{await a();const v=await m();b(!!(v!=null&&v.length)),d("default")}catch{d("error")}})()}ie(()=>{i==="open"&&g()},[i]);const u=Y();return e(ri,{ref:u,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:s,portal:{target:document.body},containerProps:{onClick:()=>{var v,y;(y=(v=u.current)==null?void 0:v.closeMenu)==null||y.call(v)}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(f,{id:"iDNBZe"})})}),e("main",{children:r.notifications.length?e(z,{children:r.notifications.slice(0,gl).map(v=>e(cn,{instance:c,notification:v,disableContextMenu:!0},v._ids||v.id))}):h==="loading"?e("div",{class:"ui-state",children:e(Ue,{abrupt:!0})}):h==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(f,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:g,children:e(f,{id:"KDw4GX"})})})]})}),e("footer",{children:[e(ge,{to:"/mentions",class:"button plain",children:[e(T,{icon:"at"})," ",e("span",{children:e(f,{id:"/bZzdR"})})]}),e(ge,{to:"/notifications",class:"button plain2",children:[p?e(f,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(f,{id:"gukqfD"})})," ",e(T,{icon:"arrow-right"})]})]})]})}const vl=lt(pl),yl=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function lo(n){const i=URL.parse(n);if(!i)return{};const{hostname:s,pathname:o}=i;for(const c of yl){const[,r]=o.match(c)||[];if(r)return{instance:s,id:r}}return{}}function wl(n){const{instance:i,id:s}=lo(n);return i&&s?`/${i}/s/${s}`:null}function kl(){const i=Zt().pathname.replace(/^\//,""),s=lo(i),o=s!=null&&s.instance?`/${s.instance}/s/${s.id}`:null,[c,r]=E("loading");return wt(()=>{r("loading"),(async()=>{try{const{instance:h,id:d}=s;if(d){const{masto:l}=ce({instance:h});if(await l.v1.statuses.$select(d).fetch()){window.location.hash=o+"?view=full";return}}}catch{}{const{masto:h,instance:d}=ce(),l=await h.v2.search.fetch({q:i,limit:1,resolve:!0});if(l.statuses.length){const a=l.statuses[0];window.location.hash=`/${d}/s/${a.id}?view=full`}else if(l.accounts.length){const a=l.accounts[0];window.location.hash=`/${d}/a/${a.id}`}else o?window.location.hash=o+"?view=full":r("error")}})()},[o]),e("div",{class:"ui-state",tabIndex:"-1",children:[c==="loading"?e(z,{children:[e(Ue,{abrupt:!0}),e("h2",{children:e(f,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}):e(z,{children:[e("h2",{children:e(f,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}),e("hr",{}),e("p",{children:e(ge,{to:"/",children:e(f,{id:"iWpEwy"})})})]})}function Sl(){const{_:n}=ue();tt(n({id:"h16FyT"}),"/l");const[i,s]=E("default"),[o,c]=Et(a=>a+1,0),[r,h]=E([]);ie(()=>{s("loading"),(async()=>{try{const a=await Jn();h(a),s("default")}catch{s("error")}})()},[o]);const[d,l]=E(!1);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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l"})})]}),e("h1",{children:e(f,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>l(!0),children:e(T,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:r.length>0?e(z,{children:[e("ul",{class:"link-list",children:r.map(a=>e("li",{children:e(ge,{to:`/l/${a.id}`,children:e("span",{children:[e(T,{icon:"list"})," ",e("span",{children:a.title})]})})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(f,{id:"8prZNK",values:{0:r.length}})})})]}):i==="loading"?e("p",{class:"ui-state",children:e(Ue,{})}):i==="error"?e("p",{class:"ui-state",children:e(f,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(f,{id:"IvPikw"})})})]}),d&&e(He,{onClick:a=>{a.target===a.currentTarget&&l(!1)},children:e(yi,{list:d==null?void 0:d.list,onClose:a=>{a.state==="success"&&c(),l(!1)}})})]})}const Cl=""+new URL("instances-LA7224ZB.json",import.meta.url).href;function _l(n){return("0"+n.toString(16)).slice(-2)}function Il(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,_l).join("")}function Tl(n){const s=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",s)}function xl(n){let i="";const s=new Uint8Array(n),o=s.byteLength;for(var c=0;c<o;c++)i+=String.fromCharCode(s[c]);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function uo(n){const i=await Tl(n);return xl(i)}async function Al({instanceURL:n}){var i;if(!n)return!1;try{const s=await fetch(`https://${n}/.well-known/oauth-authorization-server`);return!s.ok||s.status!==200?!1:!!((i=(await s.json()).code_challenge_methods_supported)!=null&&i.includes("S256"))}catch{return!1}}window.__generateCodeChallenge=uo;const Rl={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{DEV:El,PHANPY_CLIENT_NAME:Ll,PHANPY_WEBSITE:En}=Rl,_i="read write follow push",Ml=En?En.toLowerCase().includes(location.hostname):!1,$l=location.origin+location.pathname,Pn=El||!Ml?$l:En;async function Dl({instanceURL:n}){const i=new URLSearchParams({client_name:Ll,redirect_uris:Pn,scopes:_i,website:En});return await(await fetch(`https://${n}/api/v1/apps`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json()}async function Pl({instanceURL:n,client_id:i}){const s=Il(),o=await uo(s),c=new URLSearchParams({client_id:i,code_challenge_method:"S256",code_challenge:o,redirect_uri:Pn,response_type:"code",scope:_i});return[`https://${n}/oauth/authorize?${c.toString()}`,s]}async function Nl({instanceURL:n,client_id:i}){const s=new URLSearchParams({client_id:i,scope:_i,redirect_uri:Pn,response_type:"code"});return`https://${n}/oauth/authorize?${s.toString()}`}async function Ol({instanceURL:n,client_id:i,client_secret:s,code:o,code_verifier:c}){const r=new URLSearchParams({client_id:i,redirect_uri:Pn,grant_type:"authorization_code",code:o});return s&&r.append("client_secret",s),c&&r.append("code_verifier",c),await(await fetch(`https://${n}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()})).json()}const zl={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Ul}=zl;function Bl(){var _,k;const{_:n}=ue();tt(n({id:"sQia9P"}),"/login");const i=Y(),s=ve.local.get("instanceURL"),[o,c]=E("default"),[r]=bt(),h=r.get("instance"),d=r.get("submit"),[l,a]=E(h||(s==null?void 0:s.toLowerCase())||""),[p,b]=E([]),m=Y();ie(()=>{(async()=>{try{const C=await(await fetch(Cl)).json();b(C),m.current=new Ko(C)}catch{}})()},[]);const g=x=>{x&&(async()=>{try{const I=await(await fetch(`https://${x}/.well-known/host-meta`)).text(),P=new DOMParser().parseFromString(I,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),q=URL.parse(P),{host:te}=q;x!==te&&(x=te)}catch{}ve.local.set("instanceURL",x),c("loading");try{const{client_id:C,client_secret:I,vapid_key:R}=await Dl({instanceURL:x});if(await Al({instanceURL:x}))if(C&&I){ve.sessionCookie.set("clientID",C),ve.sessionCookie.set("clientSecret",I),ve.sessionCookie.set("vapidKey",R);const[F,P]=await Pl({instanceURL:x,client_id:C});ve.sessionCookie.set("codeVerifier",P),location.href=F}else alert(n({id:"ZP1FIA"}));else C&&I?(ve.sessionCookie.set("clientID",C),ve.sessionCookie.set("clientSecret",I),ve.sessionCookie.set("vapidKey",R),location.href=await Nl({instanceURL:x,client_id:C})):alert(n({id:"ZP1FIA"}));c("default")}catch{c("error")}})()},u=l?l.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,v=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(u)&&!/[\s\/\\@]/.test(u),y=u?(k=(_=m.current)==null?void 0:_.search(u,{limit:10}))==null?void 0:k.map(x=>x.item):[],w=v?u:y!=null&&y.length?y[0]:l?p.find(x=>x.includes(l)):null,S=x=>{x.preventDefault(),g(w)};return d&&ie(()=>{g(h||w)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:S,children:[e("h1",{children:[e("img",{src:gi,alt:"",width:"80",height:"80"}),e("br",{}),e(f,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(f,{id:"kyAi7k"})}),e("input",{value:l,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:o==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"u3gOdY"}),onInput:x=>{a(x.target.value)},dir:"auto"}),(y==null?void 0:y.length)>0?e("ul",{id:"instances-suggestions",children:y.map((x,C)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{g(x)},children:x})}))}):e("div",{id:"instances-eg",children:e(f,{id:"/OvbEC"})})]}),o==="error"&&e("p",{class:"error",children:e(f,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:o==="loading"||!l||!w,children:n(w?{id:"2xahsi",values:{selectedInstanceText:w}}:{id:"xGVfLh"})})," "]}),e(Ue,{hidden:o!=="loading"}),e("hr",{}),!Ul&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(f,{id:"LcOiWS"})})}),e("p",{children:e(ge,{to:"/",children:e(f,{id:"iWpEwy"})})}),e(bi,{})]})})}const Fl=40;function Hl(){const{_:n}=ue(),i=Ve(A);tt(n({id:"+GkIdc"}),"/sp");const{masto:s}=ce(),[o,c]=E([]),[r,h]=E("default"),[d,l]=Et(b=>b+1,0),[a,p]=E(!1);return ie(l,[i.reloadScheduledPosts]),ie(()=>{h("loading"),(async()=>{try{const b=s.v1.scheduledStatuses.list({limit:Fl}),m=[];let g;do g=(await b.next()).value,g!=null&&g.length&&m.push(...g);while(g!=null&&g.length);c(m)}catch{h("error")}finally{h("default")}})()},[d]),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(Mt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(f,{id:"+GkIdc"})}),e("div",{class:"header-side",children:e(rt,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:n({id:"2FYpfJ"})})}),children:e(ye,{onClick:()=>{l()},children:[e(T,{icon:"refresh",size:"l"}),e("span",{children:e(f,{id:"lCF0wC"})})]})})})]})}),e("main",{children:[o.length?e("ul",{class:"posts-list",children:o.map(b=>{const{id:m,params:g,scheduledAt:u,mediaAttachments:v}=b,{inReplyToId:y,language:w,poll:S,sensitive:_,spoilerText:k,text:x,visibility:C}=g,I={id:m,inReplyToId:y,language:w,mediaAttachments:v,poll:S?{...S,expiresAt:new Date(Date.now()+S.expiresIn*1e3),options:S.options.map(R=>({title:R,votesCount:0}))}:void 0,sensitive:_,spoilerText:k,text:x,visibility:C,content:`<p>${x}</p>`};return e("li",{children:e(ql,{status:I,scheduledAt:u,onClick:()=>{p({post:I,scheduledAt:new Date(u)})}})},m)})}):e("p",{class:"ui-state",children:r==="loading"?e(Ue,{}):n({id:"mZYb1f"})}),a&&e(He,{onClick:b=>{b.target===b.currentTarget&&p(!1)},children:e(jl,{post:a.post,scheduledAt:a.scheduledAt,onClose:()=>p(!1)})})]})]})})}function ql({status:n,scheduledAt:i,onClick:s}){const o=Ce(()=>{const c=(new Date(i).getTime()-Date.now())/36e5;return c<24?"time":c<720?"day":"month"},[i]);return e("button",{type:"button",class:"textual block",onClick:s,children:[e("div",{class:`post-schedule-meta post-schedule-${o}`,children:[e(T,{icon:o,class:"insignificant"})," ",e("span",{children:e(f,{id:"aEp6lO",values:{0:ot(i,{formatOpts:{weekday:"short",second:"numeric"}})},components:{0:e("b",{}),1:e(It,{datetime:i}),2:e("small",{})}})})]}),e(je,{status:n,size:"s",previewMode:!0,readOnly:!0})]})}function jl({post:n,scheduledAt:i,onClose:s}){const{masto:o}=ce(),{_:c}=ue(),[r,h]=E("default"),[d,l]=E(),a=d&&d.getTime()!==i.getTime(),p=Zo(),b=i&&i<=Date.now(),{inReplyToId:m}=n,[g,u]=E(null);return e("div",{id:"scheduled-post-sheet",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",size:"l",alt:c({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(f,{id:"orjBLU",components:{0:e("b",{}),1:e(It,{datetime:i})}}),e("br",{}),e("small",{children:ot(i,{formatOpts:{weekday:"short",second:"numeric"}})})]})}),e("main",{tabIndex:"-1",children:[!!g&&e("div",{class:"status-reply",children:e(je,{status:g,size:"s",previewMode:!0,readOnly:!0})}),e(je,{status:n,size:"s",previewMode:!0,readOnly:!0,onMediaClick:(v,y,w,S)=>{v.preventDefault(),A.showMediaModal={mediaAttachments:n.mediaAttachments,mediaIndex:y}}}),e("form",{onSubmit:v=>{v.preventDefault(),h("loading"),(async()=>{try{await o.v1.scheduledStatuses.$select(n.id).update({scheduledAt:d.toISOString()}),pe(c({id:"40naR1"})),s(),h("default"),A.reloadScheduledPosts++}catch{h("error"),pe(c({id:"ZM3jAs"}))}})()},children:e("footer",{children:[e("div",{class:"row",children:e("span",{children:[e(Wo,{scheduledAt:i,setScheduledAt:v=>{l(v)}})," ",e("small",{class:"ib",children:p})]})}),e("div",{class:"row",children:[e("button",{disabled:!a||r==="loading"||b,children:e(f,{id:"QqW27M"})}),e("span",{class:"grow"}),e(ut,{align:"end",menuItemClassName:"danger",confirmLabel:c({id:"09u3Kk"}),onClick:()=>{h("loading"),(async()=>{try{await ce().masto.v1.scheduledStatuses.$select(n.id).remove(),pe(c({id:"/zL/Mq"})),s(),h("default"),A.reloadScheduledPosts++}catch{h("error"),pe(c({id:"aOh6Md"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:r==="loading"||b,children:e(f,{id:"Jb6/SB"})})})]})]})})]})]})}const Yl={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:is}=Yl,mn=40,Vl=10,Gl=5;let ni={},wn={},kn={};function Sn(n){delete wn[n],delete kn[n]}const Jt={block:"nearest",inline:"center",behavior:"smooth"},ss=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",os=/\/s\//i;function Kl(n){var x;const{_:i}=ue(),{id:s}=n,{masto:o,instance:c}=ce({instance:n.instance}),r=Ve(A),[h,d]=bt(),l=h.get("media"),a=h.get("media-only"),p=parseInt(l||a,10);let b=p>0;const m=h.get("mediaStatusID"),g=gs(m,c);m&&!g&&(b=!1);const u=b&&!!a,v=at(s,c),[y,w]=E(A.statuses[v]);ie(()=>{A.statuses[v]&&w(A.statuses[v])},[v]);const S=Ce(()=>{const{prevLocation:C}=A,I=((C==null?void 0:C.pathname)||"")+((C==null?void 0:C.search)||""),R=nn("/:instance/s/:id",I)||nn("/s/:id",I);return!I||R?"/":I},[]);ie(()=>{!y&&b&&(async()=>{try{const C=await o.v1.statuses.$select(s).fetch();Qe(C,c),w(C)}catch{alert("Unable to load post."),location.hash=S}})()},[b]);const _=m?(x=r.statuses[at(m,c)])==null?void 0:x.mediaAttachments:y==null?void 0:y.mediaAttachments,k=st(()=>{!window.matchMedia("(min-width: calc(40em + 350px))").matches&&r.prevLocation?history.back():u?location.hash=S:(h.delete("media"),h.delete("mediaStatusID"),d(h))},[u,S,r.prevLocation]);return ie(()=>{let C=setTimeout(()=>{const I=document.querySelector(".carousel");I&&I.focus()},100);return()=>clearTimeout(C)},[u]),ie(()=>{const C=document.querySelectorAll(".deck-container");return C.forEach(I=>{I.setAttribute("inert","")}),()=>{C.forEach(I=>{I.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[b?_!=null&&_.length?e(js,{mediaAttachments:_,statusID:m||s,instance:c,lang:y==null?void 0:y.language,index:p-1,onClose:k}):e("div",{class:"media-modal-container loading",children:e(Ue,{abrupt:!0})}):e(ge,{to:S}),!u&&e(Wl,{id:s,instance:n.instance,closeLink:S})]})}function Zl(n){const{linkable:i,to:s,onClick:o,...c}=n;return i?e(ge,{class:"status-link",to:s,onClick:o,...c}):e("div",{class:"status-focus",tabIndex:0,...c})}function cs(n,i){return new Date(i.created_at)-new Date(n.created_at)}function Wl({id:n,closeLink:i="/",instance:s}){var oe,Re;const{_:o}=ue(),[c,r]=bt(),h=c.get("media"),d=c.get("mediaStatusID"),l=parseInt(h,10)>0,a=Y(!A.prevLocation&&(history.length===1||"navigation"in window&&((Re=(oe=navigation==null?void 0:navigation.entries)==null?void 0:oe.call(navigation))==null?void 0:Re.length)===1)),[p,b]=E(c.get("view")||a.current?"full":null),m=!!parseInt(c.get("translate")),{masto:g,instance:u}=ce({instance:s}),{masto:v,instance:y,authenticated:w}=ce(),S=u===y,_=Ve(A),[k,x]=E([]),[C,I]=E("default"),R=Y(),L=at(n,u),F=Y(0),P=Y();ie(()=>{var O;(O=P.current)==null||O.focus()},[]),ie(()=>{var Q;const O=Rs(()=>{if(!P.current)return;const{scrollTop:fe}=P.current;C!=="loading"&&(kn[n]=fe)},50);return(Q=P.current)==null||Q.addEventListener("scroll",O,{passive:!0}),O(),()=>{var fe;O.cancel(),(fe=P.current)==null||fe.removeEventListener("scroll",O)}},[n,C!=="loading"]);const q=Y(),te=Y(),ee=({reloadHero:O}={})=>{I("loading");let Q;const fe=wn[n];if(fe){const N=fe.filter(re=>A.statuses[L]);x(N)}else x([{id:n}]);return(async()=>{var Ne,Ye;const N=()=>Li(()=>g.v1.statuses.$select(n).fetch(),{retries:4}),re=Li(()=>g.v1.statuses.$select(n).context.fetch(),{retries:8}),Te=!!_.statuses[L];let Se=_.statuses[L];if(!(Te&&!O))try{Se=await N(),Qe(Se,u),await new Promise(M=>{setTimeout(M,100)})}catch{I("error");return}try{let M=function(me,Me){const We=Me+1;return We>Ie&&(Ie=Me),me==null?void 0:me.map(ke=>({id:ke.id,account:ke.account,repliesCount:ke.repliesCount,content:ke.content,weight:tn(ke),level:We,replies:M(ke.__replies,We)}))};const D=await re,{ancestors:Z,descendants:V}=D;Z.sort(cs),V.sort(cs),F.current=(V==null?void 0:V.length)||0;const K=new Set;Z.forEach(me=>{Qe(me,u,{skipThreading:!0}),me.inReplyToId&&!Z.find(Me=>Me.id===me.inReplyToId)&&K.add(me.inReplyToId)});const Oe=Z.every(me=>me.account.id===Se.account.id),xe=[];V.forEach(me=>{if(Qe(me,u,{skipThreading:!0}),me.inReplyToId&&!V.find(Me=>Me.id===me.inReplyToId)&&me.inReplyToId!==Se.id&&K.add(me.inReplyToId),me.inReplyToAccountId===me.account.id)xe.push(me);else if(me.inReplyToId===Se.id)xe.push(me);else if(!me.inReplyToAccountId&&xe.find(Me=>Me.id===me.inReplyToId&&Me.account.id===Se.account.id)&&me.account.id===Se.account.id)xe.push(me);else{const Me=V.find(We=>We.id===me.inReplyToId);Me&&(Me.__replies||(Me.__replies=[]),Me.__replies.push(me))}}),xe.sort((me,Me)=>{const We=Se.account.id;return me.account.id===We&&Me.account.id!==We?-1:Me.account.id===We&&me.account.id!==We?1:0}),K.size;let Ie=1;const Be=[...Z.map(me=>({id:me.id,ancestor:!0,isThread:Oe,accountID:me.account.id,account:me.account,repliesCount:me.repliesCount,weight:tn(me)})),{id:n,accountID:Se.account.id,weight:tn(Se)},...xe.map(me=>({id:me.id,account:me.account,accountID:me.account.id,descendant:!0,thread:me.account.id===Se.account.id,weight:tn(me),level:1,replies:M(me.__replies,1)}))];I("default"),q.current={offsetTop:(Ne=R.current)==null?void 0:Ne.offsetTop,scrollTop:(Ye=P.current)==null?void 0:Ye.scrollTop};const Ze=Z.length||0;Ze>=le&&H(Ze+1),x(Be),wn[n]=Be,xo(Se,u)}catch{I("error")}})(),te.current=Date.now(),()=>{clearTimeout(Q)}};ie(ee,[n,g]);const[W,j]=E(!1);ie(()=>{let O=setInterval(()=>{const Q=Date.now();te.current&&Q-te.current>=6e4&&j(!0)},6e4);return()=>{clearInterval(O)}},[]),wt(()=>{var Q,fe;if(!k.length)return;const O=kn[n];if(O)P.current.scrollTop=O;else if(q.current){const N={offsetTop:(Q=R.current)==null?void 0:Q.offsetTop,scrollTop:(fe=P.current)==null?void 0:fe.scrollTop},re=N.offsetTop-q.current.offsetTop+N.scrollTop;P.current.scrollTop=re}else k.length===1&&(P.current.scrollTop=0);q.current=null},[k]),ie(()=>{_.reloadStatusPage<=0||(async()=>{try{const{instanceURL:O}=si(),Q=`https://${O}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(Q,{ignoreVary:!0}),ee({reloadHero:!0})}catch{}})()},[_.reloadStatusPage]),ie(()=>()=>{kn={},A.reloadStatusPage=0,wn={},ni={},ii.clear()},[]);const U=_.statuses[L]||_.statuses[n],ae=Ce(()=>{if(!U)return"";const{account:O}=U,Q=document.createElement("div");return Q.innerHTML=O.displayName,Q.innerText.trim()},[U]),$=Ce(()=>{if(!U)return"";let O=Ln(U);return O.length>64&&(O=O.slice(0,64)+"…"),O},[U]);tt(ae&&$?`${ae}: "${$}"`:o({id:"post.title"}),"/:instance?/s/:id");const B=Ce(()=>{var Q;if(!U)return;const{url:O}=U;if(O)return(Q=URL.parse(O))==null?void 0:Q.hostname},[U]),G=Ce(()=>{if(B)return B===u},[B,u]),[le,H]=E(mn),se=Ce(()=>k.length-le,[k.length,le]),be=k.some(O=>O.descendant),we=k.filter(O=>O.ancestor),[X,de]=E(!0),Ee=Ce(()=>{if(!R.current||X)return null;const{top:O}=R.current.getBoundingClientRect();return O>0?"down":"up"},[X]);Fe("esc",()=>{location.hash=i},{enabled:!l,ignoreEventWhen:O=>!!document.querySelector("#modal-container > *")}),Fe("backspace",()=>{location.hash=i}),Fe("j",()=>{const O=document.activeElement.closest(".status-link, .status-focus"),Q=O==null?void 0:O.getBoundingClientRect(),fe=Array.from(P.current.querySelectorAll(ss));if(O&&Q.top<P.current.clientHeight&&Q.bottom>0){const N=fe.indexOf(O);let re=fe[N+1];re&&(re.focus(),re.scrollIntoView(Jt))}else{const N=fe.find(re=>{const Te=re.getBoundingClientRect();return Te.top>=44&&Te.left>=0});N&&(N.focus(),N.scrollIntoView(Jt))}}),Fe("k",()=>{const O=document.activeElement.closest(".status-link, .status-focus"),Q=O==null?void 0:O.getBoundingClientRect(),fe=Array.from(P.current.querySelectorAll(ss));if(O&&Q.top<P.current.clientHeight&&Q.bottom>0){const N=fe.indexOf(O);let re=fe[N-1];re&&(re.focus(),re.scrollIntoView(Jt))}else{const N=fe.find(re=>{const Te=re.getBoundingClientRect();return Te.top>=44&&Te.left>=0});N&&(N.focus(),N.scrollIntoView(Jt))}}),Fe("x",()=>{const O=document.activeElement.closest(".status-link, .status-focus");if(O){const Q=O.nextElementSibling;Q&&Q.tagName.toLowerCase()==="details"&&(Q.open=!Q.open)}});const[$e,Pe]=E(!1),ze=Y(l?"media+status":"status"),Le=st((O,Q,fe,N)=>{O.preventDefault(),O.stopPropagation(),r({media:Q+1,mediaStatusID:N.id})},[n]),Ae=st((O,Q)=>{Sn(Q.id)},[]);ie(()=>{let O;return d&&l&&(O=setTimeout(()=>{var fe;const Q=(fe=P.current)==null?void 0:fe.querySelector(`.status-link[href*="/${d}"]`);Q&&Q.scrollIntoView(Jt)},400)),()=>{clearTimeout(O)}},[d,l]);const J=st((O,Q)=>{const{id:fe,ancestor:N,isThread:re,descendant:Te,thread:Se,replies:Ne,repliesCount:Ye,weight:M,level:D}=O,Z=fe===n;return e("li",{ref:Z?R:null,class:`${N?"ancestor":""} ${Te?"descendant":""} ${Se?"thread":""} ${Z?"hero":""}`,children:[Z?e(z,{children:[e(_t,{threshold:.1,onChange:K=>{queueMicrotask(()=>{requestAnimationFrame(()=>{de(K)})})},class:"status-focus",tabIndex:0,children:e(je,{statusID:fe,instance:u,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:m})}),C!=="loading"&&!w?e("div",{class:"post-status-banner",children:[e("p",{children:e(f,{id:"Vyeh4F"})}),e(ge,{to:is?`/login?instance=${is}&submit=1`:"/login",class:"button",children:e(f,{id:"sQia9P"})})]}):!S&&e("div",{class:"post-status-banner",children:[e("p",{children:e(f,{id:"j5roNG",values:{instance:u},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:C==="loading",onClick:()=>{I("loading"),(async()=>{try{const K=await v.v2.search.fetch({q:U.url,type:"statuses",resolve:!0,limit:1});if(K.statuses.length){const Oe=K.statuses[0];location.hash=y?`/${y}/s/${Oe.id}`:`/s/${Oe.id}`}else throw new Error("No results")}catch(K){I("default"),alert(o({id:"DnepCE",values:{e:K}}))}})()},children:[e(T,{icon:"transfer"})," ",e(f,{id:"ejAVrO"})]})]})]}):e(Zl,{linkable:re||N,to:u?`/${u}/s/${fe}`:`/s/${fe}`,onClick:()=>{Sn(fe)},children:[Q===0&&N?e(_t,{threshold:.5,onChange:K=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Pe(K)})})},children:e(je,{statusID:fe,instance:u,withinContext:!0,size:Se||N?"m":"s",enableTranslate:!0,onMediaClick:Le,onStatusLinkClick:Ae})}):e(je,{statusID:fe,instance:u,withinContext:!0,size:Se||N?"m":"s",enableTranslate:!0,onMediaClick:Le,onStatusLinkClick:Ae,showActionsBar:!!Te}),N&&Ye>1&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:o({id:"N8UzTV"})})," ",e("span",{title:Ye,children:Je(Ye)})]})," "]}),Te&&(Ne==null?void 0:Ne.length)>0&&e(ho,{instance:u,replies:Ne,hasParentThread:Se,level:D,accWeight:M,openAll:F.current<Vl,parentLink:{to:u?`/${u}/s/${fe}`:`/s/${fe}`,onClick:()=>Sn(fe)}}),C==="loading"&&Z&&!!(U!=null&&U.repliesCount)&&!be&&e("div",{class:"status-loading",children:e(Ue,{abrupt:U.repliesCount>=3})}),C==="error"&&Z&&!!(U!=null&&U.repliesCount)&&!be&&e("div",{class:"status-error",children:[e(f,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{A.reloadStatusPage++},children:e(f,{id:"KDw4GX"})})]})]},fe)},[n,u,C,w,S,m,Le,Ae,be]),_e=Ce(()=>{var O;if("navigation"in window&&(navigation!=null&&navigation.entries)){const Q=navigation.entries()[navigation.currentEntry.index-1];if(Q!=null&&Q.url)return os.test(Q.url)}return os.test((O=A.prevLocation)==null?void 0:O.pathname)},[L]),De=Ce(()=>{if(!se)return[];const O=[];function Q(fe){O.push(fe.id),fe.replies&&fe.replies.forEach(Q)}return k.slice(le).forEach(Q),O.map(fe=>at(fe,u))},[se,k,le,u]),ne=Ce(()=>k.slice(0,le).map(J),[k,le,J]);return ie(()=>{let O=setTimeout(()=>{if(!R.current)return;const Q=R.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");Q&&Q.click()},1e3);return()=>clearTimeout(O)},[n]),e("div",{tabIndex:"-1",ref:P,class:`status-deck deck contained ${k.length>1?"padded-bottom":""} ${ze.current==="status"&&!a.current?"slide-in":""} ${p?`deck-view-${p}`:""}`,onAnimationEnd:O=>{ze.current==="status"&&(ze.current=null)},children:[e("header",{class:`${C==="loading"?"loading":""}`,onDblClick:O=>{A.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[_e&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(T,{icon:"chevron-left",size:"xl",alt:o({id:"iH8pgl"})})}),!X&&U&&C!=="loading"?e(z,{children:[e("span",{class:"hero-heading",children:[e(mt,{account:U.account,instance:u,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(It,{datetime:U.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:O=>{O.preventDefault(),O.stopPropagation(),R.current.scrollIntoView({behavior:"smooth",block:"start"})},title:o({id:"NCy+Nw"}),children:e(T,{icon:Ee==="down"?"arrow-down":"arrow-up"})})]}):e(z,{children:[e(f,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:O=>{O.preventDefault(),O.stopPropagation(),P.current.scrollTo({top:0,behavior:"smooth"})},hidden:!we.length||$e,title:o({id:"R8CUl0",values:{0:we.length}}),children:[e(T,{icon:"arrow-up"}),we.filter((O,Q,fe)=>fe.findIndex(N=>N.accountID===O.accountID)===Q).slice(0,3).map(O=>e(ft,{url:O.account.avatar,alt:O.account.displayName},O.account.id)),we.length>3&&e(z,{children:[" ",e("span",{class:"insignificant",children:Je(we.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:p==="full"?"":"none"},onClick:()=>{b(null),c.delete("media"),c.delete("media-only"),c.delete("view"),r(c)},title:o({id:"+/xYEI"}),children:e(T,{icon:"layout4",size:"l"})}),W&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{A.reloadStatusPage++,j(!1)},children:e(T,{icon:"refresh",size:"l",alt:o({id:"lCF0wC"})})}),e(rt,{align:"end",portal:{target:P.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ye,{disabled:C==="loading",onClick:()=>{A.reloadStatusPage++},children:[e(T,{icon:"refresh"}),e("span",{children:e(f,{id:"lCF0wC"})})]}),e(ye,{className:"menu-switch-view",onClick:()=>{b(p==="full"?null:"full"),c.delete("media"),c.delete("media-only"),p==="full"?c.delete("view"):c.set("view","full"),r(c)},children:[e(T,{icon:{"":"layout5",full:"layout4"}[p||""]}),e("span",{children:o(p==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(ye,{onClick:()=>{Array.from(P.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(Q=>{Q.click()})},children:[e(T,{icon:"eye-open"})," ",e("span",{children:e(f,{id:"8r8KmB"})})]}),e(Ke,{}),e(As,{className:"plain",children:e(f,{id:"Rsjgm0"})}),e(ye,{disabled:!B||G,onClick:()=>{const O=wl(U.url);O?location.hash=O:alert(o({id:"9J6biQ"}))},children:[e(T,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:o(B?{id:"tElD3e",values:{1:rn.toUnicode(B)}}:{id:"lb07+k"})})]})]}),e(ge,{class:"button plain deck-close",to:i,children:e(T,{icon:"x",size:"xl",alt:o({id:"yz7wBu"})})})]})]})}),k.length&&U?e("ul",{class:`timeline flat contextual grow ${C==="loading"?"loading":""}`,children:[ne,se>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:C==="loading",onClick:()=>H(O=>O+mn),style:{marginBlockEnd:"6em"},"data-state-post-ids":De.join(" "),children:[e("div",{class:"ib avatars-bunch",children:k.slice(le,le+5).map(O=>e(ft,{url:O.account.avatarStatic},O.id))})," ",e("div",{class:"ib",children:[e(f,{id:"uXRAkV"})," ",e("span",{class:"tag",children:se>mn?`${mn}+`:se})]})]})})]}):e(z,{children:[C==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(je,{skeleton:!0,size:"l"})})}),C==="error"&&e("p",{class:"ui-state",children:[e(f,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{A.reloadStatusPage++},children:e(f,{id:"KDw4GX"})})]})]})]})}function ho({replies:n,instance:i,hasParentThread:s,level:o,accWeight:c,openAll:r,parentLink:h}){const{_:d}=ue(),[l,a]=bt(),p=I=>I.reduce((R,L)=>{const{repliesCount:F,replies:P}=L,q=(P==null?void 0:P.length)||F;return R+q+p(P||[])},0),b=n.length+p(n),m=n.length===b,g=n.map(I=>I.account).filter((I,R,L)=>L.findIndex(F=>F.id===I.id)===R).slice(0,3),u=Ce(()=>n==null?void 0:n.reduce((I,R)=>I+(R==null?void 0:R.weight),c),[c,n==null?void 0:n.length]);let v=!1;(r||u<=Gl||!s&&b===1&&tn(n[0])<2)&&(v=!0);const y=ni[n[0].id],w=st((I,R,L,F)=>{I.preventDefault(),I.stopPropagation(),a({media:R+1,mediaStatusID:F.id})},[]),S=Y();wt(()=>{var R;function I(L){L.target.dataset.scrollLeft=L.target.scrollLeft}return(R=S.current)==null||R.addEventListener("scroll",I,{passive:!0}),()=>{var L;(L=S.current)==null||L.removeEventListener("scroll",I)}},[]);const[_,k]=E(y||v);ie(()=>{let I;return!y&&!v&&(I=setTimeout(()=>k(!0),100)),()=>clearTimeout(I)},[y,v]);const x=v?"div":"details",C=x==="details";return e(x,{ref:S,class:"replies",open:C?y||v:void 0,onToggle:C?I=>{const{open:R}=I.target;ni[n[0].id]=R}:void 0,style:{"--comments-level":o},"data-comments-level":o,"data-comments-level-overflow":o>4,children:[!v&&e("summary",{class:"replies-summary",hidden:v,children:[e("span",{class:"avatars",children:g.map(I=>e(ft,{url:I.avatarStatic,title:`${I.displayName} @${I.username}`,squircle:I==null?void 0:I.bot},I.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(f,{id:"DOQUen",values:{0:n.length,1:Je(n.length)},components:{0:e("span",{title:n.length})}})}),!m&&b>1&&e(z,{children:[" ","·"," ",e("span",{children:e(f,{id:"qSQQSe",values:{0:Je(b),totalComments:b},components:{0:e("span",{title:b})}})})]})]}),e(T,{icon:"chevron-down",class:"replies-summary-chevron"}),!!h&&e(ge,{class:"replies-parent-link",to:h.to,onClick:h.onClick,title:d({id:"ZlV82A"}),children:"»"})]}),_&&e("ul",{children:n.map(I=>{var R,L;return e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(je,{statusID:I.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:w,showActionsBar:!0}),!((R=I.replies)!=null&&R.length)&&I.repliesCount>0&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:d({id:"N8UzTV"})})," ",e("span",{title:I.repliesCount,children:Je(I.repliesCount)})]})]}),((L=I.replies)==null?void 0:L.length)&&e(ho,{instance:i,replies:I.replies,level:I.level,accWeight:v?u:I.weight,openAll:r,parentLink:{to:i?`/${i}/s/${I.id}`:`/s/${I.id}`,onClick:()=>{Sn(I.id)}}})]},I.id)})})]})}const Xl=140,Jl=35,Ql=70,ed=140,ii=new Map;function tn(n){var g,u;const i=ii.get(n.id);if(i)return i;const{spoilerText:s,content:o,mediaAttachments:c,poll:r,card:h}=n,d=xs(s+o),l=c!=null&&c.length?Xl:0,a=(((g=r==null?void 0:r.options)==null?void 0:g.length)||0)*Jl,p=h&&(c!=null&&c.length||(u=r==null?void 0:r.options)!=null&&u.length)?0:Ql,m=(d+l+a+p)/ed;return ii.set(n.id,m),m}const td=lt(Kl);function nd(){const n=Lt(),{id:i,instance:s}=n;return e(td,{id:i,instance:s})}const id=""+new URL("boosts-carousel-BiOaNdMT.jpg",import.meta.url).href,sd=""+new URL("grouped-notifications-DFgwVVj3.jpg",import.meta.url).href,od=""+new URL("multi-column-ROck0NVt.jpg",import.meta.url).href,cd=""+new URL("multi-hashtag-timeline-DH5INVHi.jpg",import.meta.url).href,ad=""+new URL("nested-comments-thread-hv59kZLc.jpg",import.meta.url).href,rd="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",ld={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_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Qt,PHANPY_WEBSITE:as,PHANPY_PRIVACY_POLICY_URL:dd,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:rs}=ld,ls=as?as.replace(/https?:\/\//g,"").replace(/\/$/,""):null,ds=`${"2025-03-22T10:26:37.992Z".slice(0,10).replace(/-/g,".")}.85d964f`;function fo(){const{_:n}=ue();return tt(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:gi,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:rd,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(f,{id:"Ogtv0V"})}),e("p",{children:e(ge,{to:Qt?`/login?instance=${Qt}&submit=1`:"/login",class:"button",children:n(Qt?{id:"sQia9P"}:{id:"ZLoGls"})})}),Qt&&rs&&e("p",{children:e("a",{href:rs,class:"button plain5",children:e(f,{id:"e+RpCP"})})}),!Qt&&e("p",{class:"insignificant",children:e("small",{children:e(f,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(ls||ds)&&e("p",{class:"app-site-version",children:e("small",{children:[ls," ",ds]})}),e("p",{children:e(f,{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(),A.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:dd,target:"_blank"})}})}),e("div",{children:e(bi,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:id,alt:n({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(f,{id:"Tu+sCN"})}),e("p",{children:e(f,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:ad,alt:n({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(f,{id:"cYE45+"})}),e("p",{children:e(f,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:sd,alt:n({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(f,{id:"4RRMre"})}),e("p",{children:e(f,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:od,alt:n({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(f,{id:"pEkad9"})}),e("p",{children:e(f,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:cd,alt:n({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(f,{id:"Wi1Ov0"})}),e("p",{children:e(f,{id:"tS2i+h"})})]})]})})]})}const ud=window.alert;window.__nativeAlert||(window.__nativeAlert=ud);window.alert=function(n){n instanceof Error&&(n!=null&&n.message)&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=Xo({text:n,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{i.hideToast()}});i.showToast()};window.__STATES__=A;window.__STATES_STATS__=()=>{const n=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],i={};n.forEach(c=>{i[c]=Object.keys(A[c]).length});const{statuses:s}=A,o=[];for(const c in s)document.querySelector(`[data-state-post-id~="${c}"], [data-state-post-ids~="${c}"]`)||o.push(c)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:n,unfurledLinks:i,notifications:s}=A;let o=0;const{instance:c}=ce();for(const r in n){if(!window.__IDLE__)break;try{const h=document.querySelector(`[data-state-post-id~="${r}"], [data-state-post-ids~="${r}"]`),d=s.some(l=>{var a;return r===at((a=l.status)==null?void 0:a.id,c)});if(!h&&!d){delete A.statuses[r],delete A.statusQuotes[r];for(const l in i){const a=i[l];if(at(a.id,a.instance)===r){delete A.unfurledLinks[l];break}}o++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const n in Bt)setTimeout(()=>{var i,s,o,c,r,h;Array.isArray(Bt[n])?(s=(i=Bt[n])[0])==null||s.call(i):typeof Bt[n]=="object"?(c=(o=Bt[n]).module)==null||c.call(o):(h=(r=Bt)[n])==null||h.call(r)},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},o=Rs(i,3e3),c=()=>{window.__IDLE__=!1,o()};n.forEach(r=>{window.addEventListener(r,c,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",r=>{!r.relatedTarget&&!r.toElement&&i()},{passive:!0})})();const hd=/iPad|iPhone|iPod/.test(navigator.userAgent);hd&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=ve.local.get("theme");let s;if(i){if(s=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),s){const o=s.content,c=i==="light"?s.dataset.themeLightColorTemp:s.dataset.themeDarkColorTemp;s.content=c||"",setTimeout(()=>{s.content=o},10)}}else{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(s=document.querySelector(`meta[name="theme-color"][media*="${o}"]`),s){const c=s.dataset.content,r=s.dataset.contentTemp;s.content=r||"",setTimeout(()=>{s.content=c},10)}}}});{const n=ve.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"dark light");const s=document.querySelector('meta[data-theme-setting="manual"]');s&&(s.name="theme-color",s.content=n==="light"?s.dataset.themeLightColor:s.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(c=>{c.name=""})}const i=ve.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}fs(A,n=>{var i;for(const[s,o,c,r]of n){if(o.join(".")==="settings.shortcutsViewMode"){const h=document.getElementById("app");h&&(h.dataset.shortcutsViewMode=(i=A.shortcuts)!=null&&i.length?c:"")}o.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",c)}});const gn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};function fd(){const[n,i]=E(!1),[s,o]=E("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),ue(),ie(()=>{const r=ve.local.get("instanceURL"),h=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(h){window.history.replaceState({},document.title,window.location.pathname||"/");const d=ve.sessionCookie.get("clientID"),l=ve.sessionCookie.get("clientSecret"),a=ve.sessionCookie.get("vapidKey"),p=ve.sessionCookie.get("codeVerifier");(async()=>{o("loading");const{access_token:b}=await Ol({instanceURL:r,client_id:d,client_secret:l,code:h,code_verifier:p||void 0});if(b){const m=Ao({instance:r,accessToken:b});await Promise.allSettled([On(m),zn(m,r),Ro(m,r,b,a)]),xi(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),o("default")}else o("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const d=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let l;if(d&&(l=Eo(d),l&&(Cn(l.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),l||(l=si()),l){Cn(l.info.id);const{client:a}=ce({account:l}),{instance:p}=a;xi(),o("loading"),(async()=>{try{Lo()&&Mo(p)?(On(a),zn(a,p)):await Promise.allSettled([On(a),zn(a,p)])}catch{}finally{i(!0),o("default"),__BENCHMARK.end("app-init")}})()}else o("default"),__BENCHMARK.end("app-init")}ve.sessionCookie.del("clientID"),ve.sessionCookie.del("clientSecret"),ve.sessionCookie.del("codeVerifier")},[]);let c=Zt();return A.currentLocation=c.pathname,ie(Xn,[c,n]),/\/https?:/.test(c.pathname)?e(kl,{}):s==="loading"?e(Ue,{id:"loader-root"}):e(z,{children:[e(md,{isLoggedIn:n}),e(gd,{isLoggedIn:n}),e(ci,{children:e(Ge,{path:"/:instance?/s/:id",element:e(nd,{})})}),n&&e(nc,{}),n&&e(Ya,{}),e(za,{}),n&&e(Ha,{}),e(ec,{isLoggedIn:n}),e(qa,{onClose:Xn}),e(ic,{})]})}function pd({isLoggedIn:n}){return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(vl,{}):e(fo,{})}const md=lt(({isLoggedIn:n})=>{const i=Zt(),s=Ce(()=>{const{pathname:o}=i;return!/^\/(login|welcome)/i.test(o)},[i]);return e(ci,{location:s||i,children:[e(Ge,{path:"/",element:e(pd,{isLoggedIn:n})}),e(Ge,{path:"/login",element:e(Bl,{})}),e(Ge,{path:"/welcome",element:e(fo,{})})]})});function us(){return A.prevLocation||null}function gd({isLoggedIn:n}){const i=Zt(),s=Y(us());return Ce(()=>nn("/:instance/s/:id",i.pathname)||nn("/s/:id",i.pathname),[i.pathname,nn])?s.current||(s.current=us()):s.current=null,e(ci,{location:s.current||i,children:[n&&e(z,{children:[e(Ge,{path:"/notifications",element:e(oo,{})}),e(Ge,{path:"/mentions",element:e(no,{})}),e(Ge,{path:"/following",element:e(Ci,{})}),e(Ge,{path:"/b",element:e(Ks,{})}),e(Ge,{path:"/f",element:e(Zs,{})}),e(Ge,{path:"/l",children:[e(Ge,{index:!0,element:e(Sl,{})}),e(Ge,{path:":id",element:e(Js,{})})]}),e(Ge,{path:"/fh",element:e(Nr,{})}),e(Ge,{path:"/sp",element:e(Hl,{})}),e(Ge,{path:"/ft",element:e(Mr,{})}),e(Ge,{path:"/catchup",element:e(wr,{})}),e(Ge,{path:"/annual_report/:year",element:e(hr,{})})]}),e(Ge,{path:"/:instance?/t/:hashtag",element:e(Xs,{})}),e(Ge,{path:"/:instance?/a/:id",element:e(rr,{})}),e(Ge,{path:"/:instance?/p",children:[e(Ge,{index:!0,element:e(ti,{})}),e(Ge,{path:"l",element:e(ti,{local:!0})})]}),e(Ge,{path:"/:instance?/trending",element:e(ro,{})}),e(Ge,{path:"/:instance?/search",element:e(co,{})})]})}$o();Do(e(Po,{i18n:he,children:e(No,{children:e(fd,{})})}),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 s=!1;const o=1e4,c=60*60*1e3;async function r(){if(window.__IDLE__)try{const h=await caches.keys();for(const d of h){if(i.includes(d))continue;const l=await caches.open(d),a=await l.keys();if(a.length>50){const p=a.slice(50);for(const b of p)await l.delete(b)}}s=!0}catch{}setTimeout(r,s?c:o)}setTimeout(r,o)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")};
|
||
//# sourceMappingURL=main-DxpudQKD.js.map
|