From 7a9fd0a61bac8e78993479744404a7f3b23895dd Mon Sep 17 00:00:00 2001 From: archos Date: Sun, 27 Apr 2025 11:07:02 +0200 Subject: [PATCH] =?UTF-8?q?Aktualizace=20Phanpy=20na=20nejnov=C4=9Bj=C5=A1?= =?UTF-8?q?=C3=AD=20verzi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/ScheduledAtField-DT-yp6SF.js | 189 ++++++++++++++++++++++++ assets/ScheduledAtField-DT-yp6SF.js.map | 1 + assets/compose-Bdw5opPy.js | 2 + assets/compose-Bdw5opPy.js.map | 1 + assets/compose-D71SF5ss.js | 26 ++++ assets/compose-D71SF5ss.js.map | 1 + assets/main-D109JZV4.js | 34 +++++ assets/main-D109JZV4.js.map | 1 + assets/polyfill-force-Dff0FtIl.js | 9 ++ assets/polyfill-force-Dff0FtIl.js.map | 1 + assets/useTitle-sufxcPBJ.js | 46 ++++++ assets/useTitle-sufxcPBJ.js.map | 1 + compose/index.html | 4 +- index.html | 6 +- version.json | 2 +- 15 files changed, 318 insertions(+), 6 deletions(-) create mode 100644 assets/ScheduledAtField-DT-yp6SF.js create mode 100644 assets/ScheduledAtField-DT-yp6SF.js.map create mode 100644 assets/compose-Bdw5opPy.js create mode 100644 assets/compose-Bdw5opPy.js.map create mode 100644 assets/compose-D71SF5ss.js create mode 100644 assets/compose-D71SF5ss.js.map create mode 100644 assets/main-D109JZV4.js create mode 100644 assets/main-D109JZV4.js.map create mode 100644 assets/polyfill-force-Dff0FtIl.js create mode 100644 assets/polyfill-force-Dff0FtIl.js.map create mode 100644 assets/useTitle-sufxcPBJ.js create mode 100644 assets/useTitle-sufxcPBJ.js.map diff --git a/assets/ScheduledAtField-DT-yp6SF.js b/assets/ScheduledAtField-DT-yp6SF.js new file mode 100644 index 0000000..81d0cbc --- /dev/null +++ b/assets/ScheduledAtField-DT-yp6SF.js @@ -0,0 +1,189 @@ +import{ae as he,R as Nt,e as r,d as j,q as xt,A as O,_ as Ie,y as et,E as wr,af as Da,j as it,O as ye,h as ts,ag as Ma,ah as io,ai as Ra,aj as es,Q as ns,k as F,M as Qe,W as Lt,z as En,t as Dt,s as U,ak as C,al as Pa,r as Oa,f as os,am as $a,u as re,a as so,B as Fa,an as Na,ao as za,T as R,ap as rs,aq as Ba,ar as is,p as mo,w as ss,g as Er,as as Va,at as $t,au as Ha,av as Ua,aw as Un,J as ce,c as xn,b as pe,X as as,ax as Ka,ay as ja,az as Wa}from"./useTitle-sufxcPBJ.js";const cs=["shift","alt","meta","mod","ctrl","control"],Za={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function We(t){return(Za[t.trim()]||t.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function qa(t){return cs.includes(t)}function ko(t,e=","){return t.toLowerCase().split(e)}function Co(t,e="+",n=!1,o){const i=t.toLocaleLowerCase().split(e).map(c=>We(c)),a={alt:i.includes("alt"),ctrl:i.includes("ctrl")||i.includes("control"),shift:i.includes("shift"),meta:i.includes("meta"),mod:i.includes("mod"),useKey:n},s=i.filter(c=>!cs.includes(c));return{...a,keys:s,description:o}}typeof document<"u"&&(document.addEventListener("keydown",t=>{t.code!==void 0&&ls([We(t.code)])}),document.addEventListener("keyup",t=>{t.code!==void 0&&us([We(t.code)])})),typeof window<"u"&&window.addEventListener("blur",()=>{ve.clear()});const ve=new Set;function Tr(t){return Array.isArray(t)}function Ga(t,e=","){return(Tr(t)?t:t.split(e)).every(n=>ve.has(n.trim().toLowerCase()))}function ls(t){const e=Array.isArray(t)?t:[t];ve.has("meta")&&ve.forEach(n=>!qa(n)&&ve.delete(n.toLowerCase())),e.forEach(n=>ve.add(n.toLowerCase()))}function us(t){const e=Array.isArray(t)?t:[t];t==="meta"?ve.clear():e.forEach(n=>ve.delete(n.toLowerCase()))}function Ya(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function Xa(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function Qa(t){return ds(t,["input","textarea","select"])}function ds(t,e=!1){const{target:n,composed:o}=t;let i;return Ja(n)&&o?i=t.composedPath()[0]&&t.composedPath()[0].tagName:i=n&&n.tagName,Tr(e)?!!(i&&e&&e.some(a=>a.toLowerCase()===i.toLowerCase())):!!(i&&e&&e)}function Ja(t){return!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-")}function tc(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a '),!0):e?t.some(n=>e.includes(n))||t.includes("*"):!0}const ec=(t,e,n=!1)=>{const{alt:o,meta:i,mod:a,shift:s,ctrl:c,keys:l,useKey:u}=e,{code:h,key:d,ctrlKey:f,metaKey:m,shiftKey:p,altKey:g}=t,w=We(h);if(u&&(l==null?void 0:l.length)===1&&l.includes(d))return!0;if(!(l!=null&&l.includes(w))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(w))return!1;if(!n){if(o!==g&&w!=="alt"||s!==p&&w!=="shift")return!1;if(a){if(!m&&!f)return!1}else if(i!==m&&w!=="meta"&&w!=="os"||c!==f&&w!=="ctrl"&&w!=="control")return!1}return l&&l.length===1&&l.includes(w)?!0:l?Ga(l):!l},nc=he(void 0),oc=()=>Nt(nc);function hs(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce((n,o)=>n&&hs(t[o],e[o]),!0):t===e}const rc=he({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),ic=()=>Nt(rc);function sc(t){const e=O(void 0);return hs(e.current,t)||(e.current=t),e.current}const ri=t=>{t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},ac=typeof window<"u"?Ie:et;function Ve(t,e,n,o){const i=O(null),a=O(!1),s=n instanceof Array?o instanceof Array?void 0:o:n,c=Tr(t)?t.join(s==null?void 0:s.delimiter):t,l=n instanceof Array?n:o instanceof Array?o:void 0,u=xt(e,l??[]),h=O(u);l?h.current=u:h.current=e;const d=sc(s),{activeScopes:f}=ic(),m=oc();return ac(()=>{if((d==null?void 0:d.enabled)===!1||!tc(f,d==null?void 0:d.scopes))return;const p=(v,T=!1)=>{var S;if(!(Qa(v)&&!ds(v,d==null?void 0:d.enableOnFormTags))){if(i.current!==null){const _=i.current.getRootNode();if((_ instanceof Document||_ instanceof ShadowRoot)&&_.activeElement!==i.current&&!i.current.contains(_.activeElement)){ri(v);return}}(S=v.target)!=null&&S.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||ko(c,d==null?void 0:d.delimiter).forEach(_=>{var y,k;const A=Co(_,d==null?void 0:d.splitKey,d==null?void 0:d.useKey,d==null?void 0:d.description);if(ec(v,A,d==null?void 0:d.ignoreModifiers)||(y=A.keys)!=null&&y.includes("*")){if((k=d==null?void 0:d.ignoreEventWhen)!=null&&k.call(d,v)||T&&a.current)return;if(Ya(v,A,d==null?void 0:d.preventDefault),!Xa(v,A,d==null?void 0:d.enabled)){ri(v);return}h.current(v,A),T||(a.current=!0)}})}},g=v=>{v.code!==void 0&&(ls(We(v.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&p(v))},w=v=>{v.code!==void 0&&(us(We(v.code)),a.current=!1,d!=null&&d.keyup&&p(v,!0))},E=i.current||(s==null?void 0:s.document)||document;return E.addEventListener("keyup",w,s==null?void 0:s.eventListenerOptions),E.addEventListener("keydown",g,s==null?void 0:s.eventListenerOptions),m&&ko(c,d==null?void 0:d.delimiter).forEach(v=>m.addHotkey(Co(v,d==null?void 0:d.splitKey,d==null?void 0:d.useKey,d==null?void 0:d.description))),()=>{E.removeEventListener("keyup",w,s==null?void 0:s.eventListenerOptions),E.removeEventListener("keydown",g,s==null?void 0:s.eventListenerOptions),m&&ko(c,d==null?void 0:d.delimiter).forEach(v=>m.removeHotkey(Co(v,d==null?void 0:d.splitKey,d==null?void 0:d.useKey,d==null?void 0:d.description)))}},[c,d,f]),i}var eo={exports:{}};/*! + * Toastify js 1.12.0 + * https://github.com/apvarun/toastify-js + * @license MIT licensed + * + * Copyright (C) 2018 Varun A P + */var cc=eo.exports,ii;function lc(){return ii||(ii=1,function(t){(function(e,n){t.exports?t.exports=n():e.Toastify=n()})(cc,function(e){var n=function(s){return new n.lib.init(s)},o="1.12.0";n.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},n.lib=n.prototype={toastify:o,constructor:n,init:function(s){return s||(s={}),this.options={},this.toastElement=null,this.options.text=s.text||n.defaults.text,this.options.node=s.node||n.defaults.node,this.options.duration=s.duration===0?0:s.duration||n.defaults.duration,this.options.selector=s.selector||n.defaults.selector,this.options.callback=s.callback||n.defaults.callback,this.options.destination=s.destination||n.defaults.destination,this.options.newWindow=s.newWindow||n.defaults.newWindow,this.options.close=s.close||n.defaults.close,this.options.gravity=s.gravity==="bottom"?"toastify-bottom":n.defaults.gravity,this.options.positionLeft=s.positionLeft||n.defaults.positionLeft,this.options.position=s.position||n.defaults.position,this.options.backgroundColor=s.backgroundColor||n.defaults.backgroundColor,this.options.avatar=s.avatar||n.defaults.avatar,this.options.className=s.className||n.defaults.className,this.options.stopOnFocus=s.stopOnFocus===void 0?n.defaults.stopOnFocus:s.stopOnFocus,this.options.onClick=s.onClick||n.defaults.onClick,this.options.offset=s.offset||n.defaults.offset,this.options.escapeMarkup=s.escapeMarkup!==void 0?s.escapeMarkup:n.defaults.escapeMarkup,this.options.ariaLive=s.ariaLive||n.defaults.ariaLive,this.options.style=s.style||n.defaults.style,s.backgroundColor&&(this.options.style.background=s.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var s=document.createElement("div");s.className="toastify on "+this.options.className,this.options.position?s.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(s.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):s.className+=" toastify-right",s.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var c in this.options.style)s.style[c]=this.options.style[c];if(this.options.ariaLive&&s.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)s.appendChild(this.options.node);else if(this.options.escapeMarkup?s.innerText=this.options.text:s.innerHTML=this.options.text,this.options.avatar!==""){var l=document.createElement("img");l.src=this.options.avatar,l.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?s.appendChild(l):s.insertAdjacentElement("afterbegin",l)}if(this.options.close===!0){var u=document.createElement("button");u.type="button",u.setAttribute("aria-label","Close"),u.className="toast-close",u.innerHTML="✖",u.addEventListener("click",(function(w){w.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}).bind(this));var h=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&h>360?s.insertAdjacentElement("afterbegin",u):s.appendChild(u)}if(this.options.stopOnFocus&&this.options.duration>0){var d=this;s.addEventListener("mouseover",function(w){window.clearTimeout(s.timeOutValue)}),s.addEventListener("mouseleave",function(){s.timeOutValue=window.setTimeout(function(){d.removeElement(s)},d.options.duration)})}if(typeof this.options.destination<"u"&&s.addEventListener("click",(function(w){w.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}).bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&s.addEventListener("click",(function(w){w.stopPropagation(),this.options.onClick()}).bind(this)),typeof this.options.offset=="object"){var f=i("x",this.options),m=i("y",this.options),p=this.options.position=="left"?f:"-"+f,g=this.options.gravity=="toastify-top"?m:"-"+m;s.style.transform="translate("+p+","+g+")"}return s},showToast:function(){this.toastElement=this.buildToast();var s;if(typeof this.options.selector=="string"?s=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?s=this.options.selector:s=document.body,!s)throw"Root element is not defined";var c=n.defaults.oldestFirst?s.firstChild:s.lastChild;return s.insertBefore(this.toastElement,c),n.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout((function(){this.removeElement(this.toastElement)}).bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(s){s.className=s.className.replace(" on",""),window.setTimeout((function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),s.parentNode&&s.parentNode.removeChild(s),this.options.callback.call(s),n.reposition()}).bind(this),400)}},n.reposition=function(){for(var s={top:15,bottom:15},c={top:15,bottom:15},l={top:15,bottom:15},u=document.getElementsByClassName("toastify"),h,d=0;d0?window.innerWidth:screen.width;p<=360?(u[d].style[h]=l[h]+"px",l[h]+=f+m):a(u[d],"toastify-left")===!0?(u[d].style[h]=s[h]+"px",s[h]+=f+m):(u[d].style[h]=c[h]+"px",c[h]+=f+m)}return this};function i(s,c){return c.offset[s]?isNaN(c.offset[s])?c.offset[s]:c.offset[s]+"px":"0px"}function a(s,c){return!s||typeof c!="string"?!1:!!(s.className&&s.className.trim().split(/\s+/gi).indexOf(c)>-1)}return n.lib.init.prototype=n.lib,n})}(eo)),eo.exports}var uc=lc();const dc=wr(uc);window._showToast=St;function St(t){typeof t=="string"&&(t={text:t});const{onClick:e,delay:n,...o}=t,i=dc({className:`${e||t.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...o,onClick:()=>{e==null||e(i)}});return n?setTimeout(()=>{i.showToast()},n):i.showToast(),i}function mv(t,e,n,o){const i=O(t);et(()=>{i.current=t},[t,n]),et(()=>{!o||e===null||e===!1||i.current()},[o]),et(()=>{if(e===null||e===!1)return;const s=setInterval(()=>i.current(),e);return()=>clearInterval(s)},[e])}const Ar=t=>!!t&&t[0]==="o",er=Da,Tn=(t,e)=>t===!0||!!(t&&t[e]),Ut=(t,e)=>typeof t=="function"?t(e):t,hc="_szhsinMenu",fc=t=>t[hc];const Je=(t,e)=>(e&&Object.keys(e).forEach(n=>{const o=t[n],i=e[n];typeof i=="function"&&o?t[n]=(...a)=>{i(...a),o(...a)}:t[n]=i}),t),mc=t=>{if(typeof t!="string")return{top:0,right:0,bottom:0,left:0};const e=t.trim().split(/\s+/,4).map(parseFloat),n=isNaN(e[0])?0:e[0],o=isNaN(e[1])?n:e[1];return{top:n,right:o,bottom:isNaN(e[2])?n:e[2],left:isNaN(e[3])?o:e[3]}},So=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:n,overflowY:o}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+o+n))return t}};function po(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function si(t,e){for(let n=0;nit(()=>{const i=e?`${t}__${e}`:t;let a=i;n&&Object.keys(n).forEach(c=>{const l=n[c];l&&(a+=` ${i}--${l===!0?c:`${c}-${l}`}`)});let s=typeof o=="function"?o(n):o;return typeof s=="string"&&(s=s.trim(),s&&(a+=` ${s}`)),a},[t,e,n,o]),pc="szh-menu-container",ne="szh-menu";const gc="arrow",kr="item",vc="divider",_c="header",yc="group",bc="submenu";const fs=he(),Cr=he({}),ao=he({}),Sr=he({}),wc=he({}),go=he({}),Ft=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),yt=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),An=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),He=Object.freeze({FIRST:"first",LAST:"last"}),Ec=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),ai="absolute",xr="none",Lr="menuitem",nr={preventScroll:!0};const Tc=({className:t,containerRef:e,containerProps:n,children:o,isOpen:i,theming:a,transition:s,onClose:c})=>{const l=Tn(s,"item");return r("div",{...Je({onKeyDown:({key:d})=>{switch(d){case Ft.ESC:Ut(c,{key:d,reason:An.CANCEL});break}},onBlur:d=>{i&&!d.currentTarget.contains(d.relatedTarget)&&Ut(c,{reason:An.BLUR})}},n),className:oe({block:pc,modifiers:it(()=>({theme:a,itemTransition:l}),[a,l]),className:t}),style:{position:"absolute",...n==null?void 0:n.style},ref:e,children:o})},Ac=()=>{let t,e=0;return{toggle:n=>{n?e++:e--,e=Math.max(e,0)},on:(n,o,i)=>{e?t||(t=setTimeout(()=>{t=0,o()},n)):i==null||i()},off:()=>{t&&(clearTimeout(t),t=0)}}},kc=t=>{const[e,n]=j(),i=O({items:[],hoverIndex:-1,sorted:!1}).current,a=xt((c,l)=>{const{items:u}=i;if(!c)i.items=[];else if(l)u.push(c);else{const h=u.indexOf(c);h>-1&&(u.splice(h,1),c.contains(document.activeElement)&&(t.current.focus(nr),n()))}i.hoverIndex=-1,i.sorted=!1},[i,t]),s=xt((c,l,u)=>{const{items:h,hoverIndex:d}=i,f=()=>{if(i.sorted)return;const g=t.current.querySelectorAll(".szh-menu__item");h.sort((w,E)=>si(g,w)-si(g,E)),i.sorted=!0};let m=-1,p;switch(c){case yt.RESET:break;case yt.SET:p=l;break;case yt.UNSET:p=g=>g===l?void 0:g;break;case yt.FIRST:f(),m=0,p=h[m];break;case yt.LAST:f(),m=h.length-1,p=h[m];break;case yt.SET_INDEX:f(),m=u,p=h[m];break;case yt.INCREASE:f(),m=d,m<0&&(m=h.indexOf(l)),m++,m>=h.length&&(m=0),p=h[m];break;case yt.DECREASE:f(),m=d,m<0&&(m=h.indexOf(l)),m--,m<0&&(m=h.length-1),p=h[m];break;default:}p||(m=-1),n(p),i.hoverIndex=m},[t,i]);return{hoverItem:e,dispatch:s,updateItems:a}},ci=(t,e)=>Math.round(t)===e?t:e,ms=t=>{const e=t.getBoundingClientRect();return e.width=ci(e.width,t.offsetWidth),e.height=ci(e.height,t.offsetHeight),e},Cc=(t,e,n,o)=>{const i=ms(e),a=t.getBoundingClientRect(),s=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),c=mc(o),l=p=>p+a.left-s.left-c.left,u=p=>p+a.left+i.width-s.right+c.right,h=p=>p+a.top-s.top-c.top,d=p=>p+a.top+i.height-s.bottom+c.bottom;return{menuRect:i,containerRect:a,getLeftOverflow:l,getRightOverflow:u,getTopOverflow:h,getBottomOverflow:d,confineHorizontally:p=>{let g=l(p);if(g<0)p-=g;else{const w=u(p);w>0&&(p-=w,g=l(p),g<0&&(p-=g))}return p},confineVertically:p=>{let g=h(p);if(g<0)p-=g;else{const w=d(p);w>0&&(p-=w,g=h(p),g<0&&(p-=g))}return p}}},Sc=({arrowRef:t,menuY:e,anchorRect:n,containerRect:o,menuRect:i})=>{let a=n.top-o.top-e+n.height/2;const s=t.current.offsetHeight*1.25;return a=Math.max(s,a),a=Math.min(a,i.height-s),a},xc=({anchorRect:t,containerRect:e,menuRect:n,placeLeftorRightY:o,placeLeftX:i,placeRightX:a,getLeftOverflow:s,getRightOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:h,arrow:d,direction:f,position:m})=>{let p=f,g=o;m!=="initial"&&(g=u(g),m==="anchor"&&(g=Math.min(g,t.bottom-e.top),g=Math.max(g,t.top-e.top-n.height)));let w,E,v;return p==="left"?(w=i,m!=="initial"&&(E=s(w),E<0&&(v=c(a),(v<=0||-E>v)&&(w=a,p="right")))):(w=a,m!=="initial"&&(v=c(w),v>0&&(E=s(i),(E>=0||-E{let a=n.left-o.left-e+n.width/2;const s=t.current.offsetWidth*1.25;return a=Math.max(s,a),a=Math.min(a,i.width-s),a},Ic=({anchorRect:t,containerRect:e,menuRect:n,placeToporBottomX:o,placeTopY:i,placeBottomY:a,getTopOverflow:s,getBottomOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:h,arrow:d,direction:f,position:m})=>{let p=f==="top"?"top":"bottom",g=o;m!=="initial"&&(g=l(g),m==="anchor"&&(g=Math.min(g,t.right-e.left),g=Math.max(g,t.left-e.left-n.width)));let w,E,v;return p==="top"?(w=i,m!=="initial"&&(E=s(w),E<0&&(v=c(a),(v<=0||-E>v)&&(w=a,p="bottom")))):(w=a,m!=="initial"&&(v=c(w),v>0&&(E=s(i),(E>=0||-E{const{menuRect:u,containerRect:h}=l,d=n==="left"||n==="right";let f=d?o:i,m=d?i:o;if(t){const _=c.current;d?f+=_.offsetWidth:m+=_.offsetHeight}const p=s.left-h.left-u.width-f,g=s.right-h.left+f,w=s.top-h.top-u.height-m,E=s.bottom-h.top+m;let v,T;e==="end"?(v=s.right-h.left-u.width,T=s.bottom-h.top-u.height):e==="center"?(v=s.left-h.left-(u.width-s.width)/2,T=s.top-h.top-(u.height-s.height)/2):(v=s.left-h.left,T=s.top-h.top),v+=f,T+=m;const S={...l,anchorRect:s,placeLeftX:p,placeRightX:g,placeLeftorRightY:T,placeTopY:w,placeBottomY:E,placeToporBottomX:v,arrowRef:c,arrow:t,direction:n,position:a};switch(n){case"left":case"right":return xc(S);case"top":case"bottom":default:return Ic(S)}},Ue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Ie:et;function li(t,e){typeof t=="function"?t(e):t.current=e}const tn=(t,e)=>it(()=>t?e?n=>{li(t,n),li(e,n)}:t:e,[t,e]),ui=-9999,ps=({ariaLabel:t,menuClassName:e,menuStyle:n,arrow:o,arrowProps:i={},anchorPoint:a,anchorRef:s,containerRef:c,containerProps:l,externalRef:u,parentScrollingRef:h,align:d="start",direction:f="bottom",position:m="auto",overflow:p="visible",setDownOverflow:g,repositionFlag:w,captureFocus:E=!0,state:v,endTransition:T,isDisabled:S,menuItemFocus:_,gap:y=0,shift:k=0,children:A,onClose:D,focusProps:P,...L})=>{const[I,$]=j({x:ui,y:ui}),[z,W]=j({}),[nt,st]=j(),[ot,ct]=j(f),[K]=j(Ac),[bt,lt]=ts(Y=>Y+1,1),{transition:wt,boundingBoxRef:N,boundingBoxPadding:ft,rootMenuRef:ut,rootAnchorRef:At,scrollNodesRef:Et,reposition:zt,viewScroll:Mt,submenuCloseDelay:Rt}=Nt(go),{submenuCtx:Bt,reposSubmenu:X=w}=Nt(ao),Q=O(),mt=O(),kt=O(!1),{hoverItem:Gt,dispatch:Pt,updateItems:dt}=kc(Q),B=Ar(v),J=Tn(wt,"open"),Z=Tn(wt,"close"),V=Et.current,It=Y=>{switch(Y.key){case Ft.HOME:Pt(yt.FIRST);break;case Ft.END:Pt(yt.LAST);break;case Ft.UP:Pt(yt.DECREASE,Gt);break;case Ft.DOWN:Pt(yt.INCREASE,Gt);break;case Ft.SPACE:Y.target&&Y.target.className.indexOf(ne)!==-1&&Y.preventDefault();return;default:return}Y.preventDefault(),Y.stopPropagation()},G=()=>{v==="closing"&&st(),Ut(T)},Kt=Y=>{Y.stopPropagation(),K.on(Rt,()=>{Pt(yt.RESET),Q.current.focus(nr)})},we=Y=>{Y.target===Y.currentTarget&&K.off()},vt=xt(Y=>{var nn;const gt=Q.current,Wt=c.current;if(!gt||!Wt)return;const tt=s?(nn=s.current)==null?void 0:nn.getBoundingClientRect():a?{left:a.x,right:a.x,top:a.y,bottom:a.y,width:0,height:0}:null;if(!tt)return;V.menu||(V.menu=(N?N.current:So(ut.current))||window);const ht=Cc(Wt,gt,V.menu,ft);let{arrowX:Vt,arrowY:In,x:en,y:ie,computedDirection:Dn}=Dc({arrow:o,align:d,direction:f,gap:y,shift:k,position:m,anchorRect:tt,arrowRef:mt,positionHelpers:ht});const{menuRect:Mn}=ht,Xt=Mn.height;if(!Y&&p!=="visible"){const{getTopOverflow:Yt,getBottomOverflow:Ee}=ht;let Te,on;const rt=Ee(ie);if(rt>0)Te=Xt-rt,on=rt;else{const me=Yt(ie);me<0&&(Te=Xt+me,on=0-me,Te>=0&&(ie-=me))}Te>=0&&st({height:Te,overflowAmt:on})}o&&W({x:Vt,y:In}),$({x:en,y:ie}),ct(Dn)},[o,d,ft,f,y,k,m,p,a,s,c,N,ut,V]);Ue(()=>{B&&(vt(),kt.current&<()),kt.current=B},[B,vt,X]),Ue(()=>{nt&&!g&&(Q.current.scrollTop=0)},[nt,g]),Ue(()=>dt,[dt]),et(()=>{let{menu:Y}=V;if(!B||!Y)return;if(Y=Y.addEventListener?Y:window,!V.anchors){V.anchors=[];let ht=So(At&&At.current);for(;ht&&ht!==Y;)V.anchors.push(ht),ht=So(ht)}let gt=Mt;if(V.anchors.length&>==="initial"&&(gt="auto"),gt==="initial")return;const Wt=()=>{gt==="auto"?er(()=>vt(!0)):Ut(D,{reason:An.SCROLL})},tt=V.anchors.concat(Mt!=="initial"?Y:[]);return tt.forEach(ht=>ht.addEventListener("scroll",Wt)),()=>tt.forEach(ht=>ht.removeEventListener("scroll",Wt))},[At,V,B,D,Mt,vt]);const Qt=!!nt&&nt.overflowAmt>0;et(()=>{if(Qt||!B||!h)return;const Y=()=>er(vt),gt=h.current;return gt.addEventListener("scroll",Y),()=>gt.removeEventListener("scroll",Y)},[B,Qt,h,vt]),et(()=>{if(!B||typeof ResizeObserver!="function"||zt==="initial")return;const Y=[],gt=new ResizeObserver(ht=>ht.forEach(({target:Vt})=>{Y.indexOf(Vt)<0?Y.push(Vt):Ma(()=>{vt(),lt()})})),Wt={box:"border-box"};gt.observe(Q.current,Wt);const tt=s==null?void 0:s.current;return tt&>.observe(tt,Wt),()=>gt.disconnect()},[B,zt,s,vt]),et(()=>{if(!B){Pt(yt.RESET),Z||st();return}const{position:Y,alwaysUpdate:gt}=_||{},Wt=()=>{Y===He.FIRST?Pt(yt.FIRST):Y===He.LAST?Pt(yt.LAST):Y>=-1&&Pt(yt.SET_INDEX,void 0,Y)};if(gt)Wt();else if(E){const tt=setTimeout(()=>{const ht=Q.current;ht&&!ht.contains(document.activeElement)&&(ht.focus(nr),Wt())},J?170:100);return()=>clearTimeout(tt)}},[B,J,Z,E,_,Pt]);const Ot=it(()=>({isParentOpen:B,submenuCtx:K,dispatch:Pt,updateItems:dt}),[B,K,Pt,dt]);let pt,Ct;nt&&(g?Ct=nt.overflowAmt:pt=nt.height);const jt=it(()=>({reposSubmenu:bt,submenuCtx:K,overflow:p,overflowAmt:Ct,parentMenuRef:Q,parentDir:ot}),[bt,K,p,Ct,ot]),Me=pt>=0?{maxHeight:pt,overflow:p}:void 0,Re=it(()=>({state:v,align:d,dir:ot}),[v,d,ot]),_o=it(()=>({dir:ot}),[ot]),_t=oe({block:ne,element:gc,modifiers:_o,className:i.className}),Pe=r("ul",{role:"menu","aria-label":t,...po(S),...Je({onPointerEnter:Bt==null?void 0:Bt.off,onPointerMove:Kt,onPointerLeave:we,onKeyDown:It,onAnimationEnd:G},L),ref:tn(u,Q),className:oe({block:ne,modifiers:Re,className:e}),style:{...n,...Me,margin:0,display:v==="closed"?"none":void 0,position:ai,left:I.x,top:I.y},children:[o&&r("li",{"aria-hidden":!0,...i,className:_t,style:{display:"block",position:ai,left:z.x,top:z.y,...i.style},ref:mt}),r(ao.Provider,{value:jt,children:r(Cr.Provider,{value:Ot,children:r(fs.Provider,{value:Gt,children:Ut(A,Re)})})})]});return l?r(Tc,{...l,isOpen:B,children:Pe}):Pe},gs=ye(function({"aria-label":e,className:n,containerProps:o,initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,reposition:h="auto",submenuOpenDelay:d=300,submenuCloseDelay:f=150,viewScroll:m="initial",portal:p,theming:g,onItemClick:w,...E},v){const T=O(null),S=O({}),{anchorRef:_,state:y,onClose:k}=E,A=it(()=>({initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:T,rootAnchorRef:_,scrollNodesRef:S,reposition:h,viewScroll:m,submenuOpenDelay:d,submenuCloseDelay:f}),[i,a,s,c,_,l,u,h,m,d,f]),D=it(()=>({handleClick(L,I){L.stopPropagation||Ut(w,L);let $=L.keepOpen;$===void 0&&($=I&&L.key===Ft.SPACE),$||Ut(k,{value:L.value,key:L.key,reason:An.CLICK})},handleClose(L){Ut(k,{key:L,reason:An.CLICK})}}),[w,k]);if(!y)return null;const P=r(go.Provider,{value:A,children:r(Sr.Provider,{value:D,children:r(ps,{...E,ariaLabel:e||"Menu",externalRef:v,containerRef:T,containerProps:{className:n,containerRef:T,containerProps:o,theming:g,transition:s,onClose:k}})})});return p===!0&&typeof document<"u"?io(P,document.body):p?p.target?io(P,p.target):p.stablePosition?null:P:P}),or=0,rr=1,co=2,lo=3,uo=4,Mc=5,vs=6,Rc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],_s=t=>({_s:t,status:Rc[t],isEnter:tuo}),ir=t=>t?vs:Mc,Pc=(t,e)=>{switch(t){case rr:case or:return co;case uo:case lo:return ir(e)}},Oc=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],$c=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),di=(t,e,n,o,i)=>{clearTimeout(o.current);const a=_s(t);e(a),n.current=a,i&&i({current:a})},Fc=({enter:t=!0,exit:e=!0,preEnter:n,preExit:o,timeout:i,initialEntered:a,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{const[u,h]=j(()=>_s(a?co:ir(s))),d=O(u),f=O(),[m,p]=Oc(i),g=xt(()=>{const E=Pc(d.current._s,c);E&&di(E,h,d,f,l)},[l,c]),w=xt(E=>{const v=S=>{switch(di(S,h,d,f,l),S){case rr:m>=0&&(f.current=setTimeout(g,m));break;case uo:p>=0&&(f.current=setTimeout(g,p));break;case or:case lo:f.current=$c(v,S);break}},T=d.current.isEnter;typeof E!="boolean"&&(E=!T),E?!T&&v(t?n?or:rr:co):T&&v(e?o?lo:uo:ir(c))},[g,l,t,e,n,o,m,p,c]);return[u,w,g]};const Nc=({initialOpen:t,initialMounted:e,unmountOnClose:n,transition:o,transitionTimeout:i=500,onMenuChange:a}={})=>{const s=Tn(o,"open"),c=Tn(o,"close"),[{status:l},u,h]=Fc({initialEntered:t,mountOnEnter:!e,unmountOnExit:n,timeout:i,enter:s,exit:c,onStateChange:xt(({current:{isEnter:d,isResolved:f}})=>{!a||d&&s&&f||!d&&c&&f||a({open:d})},[a,s,c])});return[{state:Ec[l],endTransition:h},u]},ys=t=>{const[e,n]=Nc(t),[o,i]=j(),a=(s,c)=>{i({position:s,alwaysUpdate:c}),n(!0)};return[{menuItemFocus:o,...e},n,a]},zc=(t,e)=>{const[n]=j({});return{onMouseDown:()=>{n.v=t&&t!=="closed"},onClick:o=>n.v?n.v=!1:e(!0,o)}},Bc=parseInt(Ra)<19,Vc=ye(function({"aria-label":e,captureFocus:n,initialOpen:o,menuButton:i,instanceRef:a,onMenuChange:s,...c},l){const[u,h,d]=ys({...c,onMenuChange:s}),{state:f}=u,m=Ar(f),p=O(null),g=zc(f,(_,y)=>d(y.detail?void 0:He.FIRST)),w=xt(_=>{h(!1),_.key&&p.current.focus()},[h]),E=_=>{switch(_.key){case Ft.UP:d(He.LAST);break;case Ft.DOWN:d(He.FIRST);break;default:return}_.preventDefault()},v=Ut(i,{open:m});if(!v||!v.type)throw new Error("Menu requires a menuButton prop.");const T={...Je({onKeyDown:E,...g},v.props),ref:tn(Bc?v.ref:v.props.ref,p)};fc(v.type)==="MenuButton"&&(T.isOpen=m);const S=es(v,T);return ns(a,()=>({openMenu:d,closeMenu:()=>h(!1)})),r(F,{children:[S,r(gs,{...c,...u,"aria-label":e||(typeof v.props.children=="string"?v.props.children:"Menu"),anchorRef:p,ref:l,onClose:w})]})}),Ir=(t,e)=>{const n=Qe(e),o=ye((i,a)=>{const s=O(null);return r(n,{...i,itemRef:s,externalRef:a,isHovering:Nt(fs)===s.current})});return o.displayName=`WithHovering(${t})`,o},bs=(t,e,n)=>{Ue(()=>{if(t)return;const o=e.current;return n(o,!0),()=>{n(o)}},[t,e,n])},Hc=Ir("SubMenu",function({"aria-label":e,className:n,disabled:o,direction:i,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:u,itemRef:h,captureFocus:d,repositionFlag:f,itemProps:m={},...p}){const g=Nt(go),{rootMenuRef:w,submenuOpenDelay:E,submenuCloseDelay:v}=g,{parentMenuRef:T,parentDir:S,overflow:_}=Nt(ao),{isParentOpen:y,submenuCtx:k,dispatch:A,updateItems:D}=Nt(Cr),P=_!=="visible",[L,I,$]=ys({...g,onMenuChange:c}),{state:z}=L,W=!!o,nt=Ar(z),st=O(null),[ot]=j({v:0}),ct=()=>{k.off(),ot.v&&(clearTimeout(ot.v),ot.v=0)},K=(...X)=>{ct(),bt(),!W&&$(...X)},bt=()=>!l&&!W&&A(yt.SET,h.current),lt=X=>{bt(),s||(ot.v=setTimeout(()=>er(K),Math.max(X,0)))},wt=X=>{W||(X.stopPropagation(),!(ot.v||nt)&&k.on(v,()=>lt(E-v),()=>lt(E)))},N=()=>{ct(),nt||A(yt.UNSET,h.current)},ft=X=>{if(l)switch(X.key){case Ft.ENTER:X.preventDefault();case Ft.SPACE:case Ft.RIGHT:s!=="none"&&K(He.FIRST)}},ut=X=>{let Q=!1;switch(X.key){case Ft.LEFT:nt&&(h.current.focus(),I(!1),Q=!0);break;case Ft.RIGHT:nt||(Q=!0);break}Q&&(X.preventDefault(),X.stopPropagation())};bs(W,h,D),et(()=>k.toggle(nt),[k,nt]),et(()=>()=>{clearTimeout(ot.v),k.toggle(!1)},[ot,k]),et(()=>{l&&y?h.current.focus():I(!1)},[l,y,I,h]),ns(u,()=>({openMenu:(...X)=>{y&&K(...X)},closeMenu:()=>{nt&&(h.current.focus(),I(!1))}}));const At=it(()=>({open:nt,hover:l,disabled:W,submenu:!0}),[nt,l,W]),{ref:Et,className:zt,...Mt}=m,Rt=Je({onPointerEnter:k.off,onPointerMove:wt,onPointerLeave:N,onKeyDown:ft,onClick:()=>s!=="none"&&K()},Mt),Bt=()=>{const X=r(ps,{...p,...L,ariaLabel:e||(typeof a=="string"?a:"Submenu"),anchorRef:h,containerRef:P?w:st,direction:i||(S==="right"||S==="left"?S:"right"),parentScrollingRef:P&&T,isDisabled:W}),Q=w.current;return P&&Q?io(X,Q):X};return r("li",{className:oe({block:ne,element:bc,className:n}),style:{position:"relative"},role:xr,ref:st,onKeyDown:ut,children:[r("div",{role:Lr,"aria-haspopup":!0,"aria-expanded":nt,...po(W,l),...Rt,ref:tn(Et,h),className:oe({block:ne,element:kr,modifiers:At,className:zt}),children:it(()=>Ut(a,At),[a,At])}),z&&Bt()]})}),ws=(t,e,n,o)=>{const{submenuCloseDelay:i}=Nt(go),{isParentOpen:a,submenuCtx:s,dispatch:c,updateItems:l}=Nt(Cr),u=()=>{!n&&!o&&c(yt.SET,t.current)},h=()=>{!o&&c(yt.UNSET,t.current)},d=p=>{n&&!p.currentTarget.contains(p.relatedTarget)&&h()},f=p=>{o||(p.stopPropagation(),s.on(i,u,u))},m=(p,g)=>{s.off(),!g&&h()};return bs(o,t,l),et(()=>{n&&a&&e.current&&e.current.focus()},[e,n,a]),{setHover:u,onBlur:d,onPointerMove:f,onPointerLeave:m}},Tt=Ir("MenuItem",function({className:e,value:n,href:o,type:i,checked:a,disabled:s,children:c,onClick:l,isHovering:u,itemRef:h,externalRef:d,...f}){const m=!!s,{setHover:p,...g}=ws(h,h,u,m),w=Nt(Sr),E=Nt(wc),v=i==="radio",T=i==="checkbox",S=!!o&&!m&&!v&&!T,_=v?E.value===n:T?!!a:!1,y=L=>{if(m){L.stopPropagation(),L.preventDefault();return}const I={value:n,syntheticEvent:L};L.key!==void 0&&(I.key=L.key),T&&(I.checked=!_),v&&(I.name=E.name),Ut(l,I),v&&Ut(E.onRadioChange,I),w.handleClick(I,T||v)},k=L=>{if(u)switch(L.key){case Ft.ENTER:L.preventDefault();case Ft.SPACE:S?h.current.click():y(L)}},A=it(()=>({type:i,disabled:m,hover:u,checked:_,anchor:S}),[i,m,u,_,S]),D=Je({...g,onPointerDown:p,onKeyDown:k,onClick:y},f),P={role:v?"menuitemradio":T?"menuitemcheckbox":Lr,"aria-checked":v||T?_:void 0,...po(m,u),...D,ref:tn(d,h),className:oe({block:ne,element:kr,modifiers:A,className:e}),children:it(()=>Ut(c,A),[c,A])};return S?r("li",{role:xr,children:r("a",{href:o,...P})}):r("li",{...P})}),Uc=Ir("FocusableItem",function({className:e,disabled:n,children:o,isHovering:i,itemRef:a,externalRef:s,...c}){const l=!!n,u=O(null),{setHover:h,onPointerLeave:d,...f}=ws(a,u,i,l),{handleClose:m}=Nt(Sr),p=it(()=>({disabled:l,hover:i,focusable:!0}),[l,i]),g=it(()=>Ut(o,{...p,ref:u,closeMenu:m}),[o,p,m]),w=Je({...f,onPointerLeave:E=>d(E,!0),onFocus:h},c);return r("li",{role:Lr,...po(l),...w,ref:tn(s,a),className:oe({block:ne,element:kr,modifiers:p,className:e}),children:g})}),ln=Qe(ye(function({className:e,...n},o){return r("li",{role:"separator",...n,ref:o,className:oe({block:ne,element:vc,className:e})})})),pv=Qe(ye(function({className:e,...n},o){return r("li",{role:xr,...n,ref:o,className:oe({block:ne,element:_c,className:e})})})),gv=ye(function({className:e,style:n,takeOverflow:o,...i},a){const s=O(null),[c,l]=j(),{overflow:u,overflowAmt:h}=Nt(ao);return Ue(()=>{let d;o&&h>=0&&(d=ms(s.current).height-h,d<0&&(d=0)),l(d>=0?{maxHeight:d,overflow:u}:void 0)},[o,u,h]),Ue(()=>{c&&(s.current.scrollTop=0)},[c]),r("div",{...i,ref:tn(a,s),className:oe({block:ne,element:yc,className:e}),style:{...n,...c}})});var mn=(t=>(t.Mouse="mouse",t.Touch="touch",t.Pointer="pointer",t))(mn||{}),pn=(t=>(t.CancelledByMovement="cancelled-by-movement",t.CancelledByRelease="cancelled-by-release",t.CancelledOutsideElement="cancelled-outside-element",t))(pn||{});const Kc=["mousedown","mousemove","mouseup","mouseleave","mouseout"],jc=["touchstart","touchmove","touchend","touchcancel"],Wc=["pointerdown","pointermove","pointerup","pointerleave","pointerout"];function Zc(t){return typeof t=="object"&&t!==null&&"pageX"in t&&typeof t.pageX=="number"&&"pageY"in t&&typeof t.pageY=="number"}function qc(t){var e;return Kc.includes((e=t==null?void 0:t.nativeEvent)==null?void 0:e.type)}function Es(t){var e;return jc.includes((e=t==null?void 0:t.nativeEvent)==null?void 0:e.type)||"touches"in t}function Gc(t){const{nativeEvent:e}=t;return e?Wc.includes(e==null?void 0:e.type)||"pointerId"in e:!1}function xo(t){return qc(t)||Es(t)||Gc(t)}function hi(t){var e;const n=Es(t)?(e=t==null?void 0:t.touches)==null?void 0:e[0]:t;return Zc(n)?{x:n.pageX,y:n.pageY}:null}function Yc(t){return{target:t.target,currentTarget:t.currentTarget,nativeEvent:t,persist:()=>{}}}function Ts(t,{threshold:e=400,captureEvent:n=!1,detect:o=mn.Pointer,cancelOnMovement:i=!1,cancelOutsideElement:a=!0,filterEvents:s,onStart:c,onMove:l,onFinish:u,onCancel:h}={}){const d=O(!1),f=O(!1),m=O(),p=O(),g=O(t),w=O(null),E=xt(_=>y=>{f.current||xo(y)&&(s!==void 0&&!s(y)||(n&&y.persist(),c==null||c(y,{context:_}),w.current=hi(y),f.current=!0,m.current=y.currentTarget,p.current=setTimeout(()=>{g.current&&(g.current(y,{context:_}),d.current=!0)},e)))},[n,s,c,e]),v=xt(_=>(y,k)=>{xo(y)&&f.current&&(w.current=null,n&&y.persist(),d.current?u==null||u(y,{context:_}):f.current&&(h==null||h(y,{context:_,reason:k??pn.CancelledByRelease})),d.current=!1,f.current=!1,p.current!==void 0&&clearTimeout(p.current))},[n,u,h]),T=xt(_=>y=>{if(xo(y)&&(l==null||l(y,{context:_}),i!==!1&&w.current)){const k=hi(y);if(k){const A=i===!0?25:i,D={x:Math.abs(k.x-w.current.x),y:Math.abs(k.y-w.current.y)};(D.x>A||D.y>A)&&v(_)(y,pn.CancelledByMovement)}}},[v,i,l]),S=xt(_=>{if(t===null)return{};switch(o){case mn.Mouse:{const y={onMouseDown:E(_),onMouseMove:T(_),onMouseUp:v(_)};return a&&(y.onMouseLeave=k=>{v(_)(k,pn.CancelledOutsideElement)}),y}case mn.Touch:return{onTouchStart:E(_),onTouchMove:T(_),onTouchEnd:v(_)};case mn.Pointer:{const y={onPointerDown:E(_),onPointerMove:T(_),onPointerUp:v(_)};return a&&(y.onPointerLeave=k=>v(_)(k,pn.CancelledOutsideElement)),y}}},[t,v,a,o,T,E]);return et(()=>{function _(y){const k=Yc(y);v()(k)}return window.addEventListener("mouseup",_),window.addEventListener("touchend",_),window.addEventListener("pointerup",_),()=>{window.removeEventListener("mouseup",_),window.removeEventListener("touchend",_),window.removeEventListener("pointerup",_)}},[v]),et(()=>()=>{p.current!==void 0&&clearTimeout(p.current)},[]),et(()=>{g.current=t},[t]),S}const Xc=Lt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),Qc=t=>{const{locale:e,dateYear:n,hideTime:o,formatOpts:i,forceOpts:a}=t||{},s=e.replace(/-[a-z]+$/i,""),c=En([s],[Xc],e),l=new Date().getFullYear(),u=a||{year:n===l?void 0:"numeric",month:"short",day:"numeric",hour:o?void 0:"numeric",minute:o?void 0:"numeric",...i};try{return Intl.DateTimeFormat(c,u)}catch{}try{return Intl.DateTimeFormat(e,u)}catch{}return Intl.DateTimeFormat(void 0,u)},Jc=Lt(Qc);function kn(t,e){return t instanceof Date||(t=new Date(t)),Jc({dateYear:t.getFullYear(),locale:Dt.locale,...e}).format(t)}function tl(t){const e=URL.parse("/compose/",window.location),{width:n,height:o}=window.screen,i=Math.max(0,(n-600)/2),a=Math.max(0,(o-450)/2),s=Math.min(n,600),c=Math.min(o,450),l=(t==null?void 0:t.uid)||Math.random(),u=window.open(e,"compose"+l,`width=${s},height=${c},left=${i},top=${a}`);return u?u.__COMPOSE__=t:alert(Dt._({id:"4S86wI"})),u}const el=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function nl(){if(el){const t=document.createElement("input");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),setTimeout(()=>{document.body.removeChild(t)},500)}}const ol=document.documentElement,Kn=getComputedStyle(ol),rl=8;let As=[0,0,0,0];function ks(){const t=Kn.getPropertyValue("--sai-top"),e=Kn.getPropertyValue("--sai-right"),n=Kn.getPropertyValue("--sai-bottom"),o=Kn.getPropertyValue("--sai-left");As=[Math.max(0,parseInt(t,10)),Math.max(0,parseInt(e,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(o,10))]}requestAnimationFrame(ks);function Cs(t=[]){return As.map((n,o)=>(n||rl)+(t[o]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",ks,{passive:!0});const fi=5e3;function jn(t){if(t||(t=!0),U.showCompose){U.composerState.minimized?St({duration:fi,text:Dt._({id:"/4fHR1"})}):St({duration:fi,text:Dt._({id:"vvl08N"})});return}nl(),U.showCompose=t}const Fe=document.createElement("div");function il(t,e){if(!t)return"";const{preProcess:n}=e||{};return Fe.innerHTML=t.replace(/<\/p>/g,`

+ +`).replace(/<\/li>/g,` +`),Fe.querySelectorAll("br").forEach(o=>{o.replaceWith(` +`)}),n==null||n(Fe),Fe.querySelectorAll(".invisible").forEach(o=>{o.remove()}),Fe.querySelectorAll(".ellipsis").forEach(o=>{o.append("...")}),Fe.innerText.replace(/[\r\n]{3,}/g,` + +`).trim()}const vo=Lt(il);function Ss(t){var s;const{spoilerText:e,content:n,poll:o,mediaAttachments:i}=t;let a="";return e!=null&&e.trim()?a+=e:a+=vo(n),a=a.trim(),(s=o==null?void 0:o.options)!=null&&s.length&&(a+=` + +📊: +${o.options.map(c=>`${o.multiple?"▪️":"•"} ${c.title}`).join(` +`)}`),i!=null&&i.length&&(a+=" "+i.map(c=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[c.type]||"").join("")),a}const xs={x:()=>C(()=>import("./icons/close-line-Bfj902o4.js"),[],import.meta.url),heart:()=>C(()=>import("./icons/heart-line-vi3QqJTo.js"),[],import.meta.url),bookmark:()=>C(()=>import("./icons/bookmark-line-BMGZc_Mc.js"),[],import.meta.url),"check-circle":()=>C(()=>import("./icons/check-circle-line-CSlVj8QA.js"),[],import.meta.url),"x-circle":()=>C(()=>import("./icons/close-circle-line-DlCWcUwK.js"),[],import.meta.url),transfer:()=>C(()=>import("./icons/transfer-4-line-BHXBUumZ.js"),[],import.meta.url),rocket:()=>C(()=>import("./icons/rocket-line-B7gBxy4I.js"),[],import.meta.url),"arrow-left":{module:()=>C(()=>import("./icons/arrow-left-line-BGgZ0udH.js"),[],import.meta.url),rtl:!0},"arrow-right":{module:()=>C(()=>import("./icons/arrow-right-line-zKtS4vm5.js"),[],import.meta.url),rtl:!0},"arrow-up":()=>C(()=>import("./icons/arrow-up-line-Bow_AQZ6.js"),[],import.meta.url),"arrow-down":()=>C(()=>import("./icons/arrow-down-line-RSwsrALM.js"),[],import.meta.url),earth:()=>C(()=>import("./icons/earth-line-DW_CwNjP.js"),[],import.meta.url),lock:()=>C(()=>import("./icons/lock-line-BbTC1fux.js"),[],import.meta.url),unlock:()=>C(()=>import("./icons/unlock-line-CGrzBxul.js"),[],import.meta.url),"eye-close":()=>C(()=>import("./icons/eye-close-line-DQnawnJE.js"),[],import.meta.url),"eye-open":()=>C(()=>import("./icons/eye-2-line-Dvog5oyl.js"),[],import.meta.url),message:()=>C(()=>import("./icons/mail-line-Cadg2cpP.js"),[],import.meta.url),comment:{module:()=>C(()=>import("./icons/chat-3-line-C4e7R0Zy.js"),[],import.meta.url),rtl:!0},comment2:{module:()=>C(()=>import("./icons/comment-2-line-DfD-95ou.js"),[],import.meta.url),rtl:!0},home:()=>C(()=>import("./icons/home-3-line-BLD1YYP8.js"),[],import.meta.url),notification:()=>C(()=>import("./icons/notification-line-Cc2m6sh5.js"),[],import.meta.url),follow:()=>C(()=>import("./icons/user-follow-line-CsL-DB1N.js"),[],import.meta.url),"follow-add":()=>C(()=>import("./icons/user-add-line-DuegJyfy.js"),[],import.meta.url),poll:[()=>C(()=>import("./icons/chart-bar-line-W9BuvVdR.js"),[],import.meta.url),"90deg"],pencil:()=>C(()=>import("./icons/pencil-line-BwUdLENj.js"),[],import.meta.url),quill:()=>C(()=>import("./icons/quill-pen-line-oAx8SSeF.js"),[],import.meta.url),at:()=>C(()=>import("./icons/at-line-C4-OGRKX.js"),[],import.meta.url),attachment:()=>C(()=>import("./icons/attachment-line-C4ysC1zZ.js"),[],import.meta.url),upload:()=>C(()=>import("./icons/upload-3-line-BB2RA_2Z.js"),[],import.meta.url),gear:()=>C(()=>import("./icons/settings-3-line-BGrM7a5R.js"),[],import.meta.url),more:()=>C(()=>import("./icons/more-3-line-WfszpsFu.js"),[],import.meta.url),more2:()=>C(()=>import("./icons/more-1-fill-Cnnj9cLP.js"),[],import.meta.url),external:{module:()=>C(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popout:{module:()=>C(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popin:{module:()=>C(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rotate:"180deg",rtl:!0},plus:()=>C(()=>import("./icons/add-circle-line-VUOz5dLS.js"),[],import.meta.url),"chevron-left":{module:()=>C(()=>import("./icons/left-line-8vYaPuok.js"),[],import.meta.url),rtl:!0},"chevron-right":{module:()=>C(()=>import("./icons/right-line-E80CeS1Q.js"),[],import.meta.url),rtl:!0},"chevron-down":()=>C(()=>import("./icons/down-line-PlS1iUy8.js"),[],import.meta.url),reply:{module:()=>C(()=>import("./icons/share-forward-line-DX1QbiUu.js"),[],import.meta.url),rotate:"180deg",flip:"horizontal",rtl:!0},thread:()=>C(()=>import("./icons/route-line-D10jSVCO.js"),[],import.meta.url),group:{module:()=>C(()=>import("./icons/group-line-Cw2Phg9p.js"),[],import.meta.url),rtl:!0},bot:()=>C(()=>import("./icons/android-2-line-C7qVwx2U.js"),[],import.meta.url),menu:()=>C(()=>import("./icons/rows-4-line-DIXu-DVG.js"),[],import.meta.url),list:{module:()=>C(()=>import("./icons/list-check-line-BaMf8v8i.js"),[],import.meta.url),rtl:!0},search:()=>C(()=>import("./icons/search-2-line-CoCbFBVR.js"),[],import.meta.url),hashtag:()=>C(()=>import("./icons/hashtag-line-Cml-0qv2.js"),[],import.meta.url),info:()=>C(()=>import("./icons/information-line-Dn255DD5.js"),[],import.meta.url),shortcut:()=>C(()=>import("./icons/lightning-line-cvW5NR-M.js"),[],import.meta.url),user:()=>C(()=>import("./icons/user-4-line-C89P3h09.js"),[],import.meta.url),following:()=>C(()=>import("./icons/walk-line-BZwRwcxJ.js"),[],import.meta.url),pin:()=>C(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),unpin:[()=>C(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),"180deg"],bus:()=>C(()=>import("./icons/bus-2-line-CfBaNBAi.js"),[],import.meta.url),link:()=>C(()=>import("./icons/link-2-line-SnIkQ_rZ.js"),[],import.meta.url),history:()=>C(()=>import("./icons/history-line-Bi2So-je.js"),[],import.meta.url),share:()=>C(()=>import("./icons/share-2-line-C2byQ30z.js"),[],import.meta.url),sparkles:()=>C(()=>import("./icons/sparkles-line-DWyRj8uB.js"),[],import.meta.url),sparkles2:()=>C(()=>import("./icons/sparkles-2-line-H731KO3v.js"),[],import.meta.url),exit:{module:()=>C(()=>import("./icons/exit-line-NjC63GxM.js"),[],import.meta.url),rtl:!0},translate:()=>C(()=>import("./icons/translate-line-cdOWN72F.js"),[],import.meta.url),play:()=>C(()=>import("./icons/play-fill-D1o3ePO2.js"),[],import.meta.url),trash:()=>C(()=>import("./icons/delete-2-line-C-lQIJNC.js"),[],import.meta.url),mute:{module:()=>C(()=>import("./icons/volume-mute-line-BluUkhVT.js"),[],import.meta.url),rtl:!0},unmute:{module:()=>C(()=>import("./icons/volume-line-dtC5ZFr8.js"),[],import.meta.url),rtl:!0},block:()=>C(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),unblock:[()=>C(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),"180deg"],flag:()=>C(()=>import("./icons/flag-1-line-sWzx_4o4.js"),[],import.meta.url),time:()=>C(()=>import("./icons/time-line-CHAmvUdg.js"),[],import.meta.url),refresh:()=>C(()=>import("./icons/refresh-2-line-B3CD5yz0.js"),[],import.meta.url),emoji2:()=>C(()=>import("./icons/emoji-2-line-DODV8bnC.js"),[],import.meta.url),filter:()=>C(()=>import("./icons/filter-2-line-DLBEPhKS.js"),[],import.meta.url),filters:()=>C(()=>import("./icons/filter-line-CuUlgBZU.js"),[],import.meta.url),chart:()=>C(()=>import("./icons/chart-line-line-noCpZUdN.js"),[],import.meta.url),react:()=>C(()=>import("./icons/react-line-C6TecPWI.js"),[],import.meta.url),layout4:{module:()=>C(()=>import("./icons/layout-4-line-BFFb1cPy.js"),[],import.meta.url),rtl:!0},layout5:()=>C(()=>import("./icons/layout-5-line-tauINoiF.js"),[],import.meta.url),announce:{module:()=>C(()=>import("./icons/announcement-line-BdsFnqjO.js"),[],import.meta.url),rtl:!0},alert:()=>C(()=>import("./icons/alert-line-CcwmWSBO.js"),[],import.meta.url),round:()=>C(()=>import("./icons/round-fill-CaZIeOWe.js"),[],import.meta.url),"arrow-up-circle":()=>C(()=>import("./icons/arrow-up-circle-line-SO68bPTf.js"),[],import.meta.url),"arrow-down-circle":()=>C(()=>import("./icons/arrow-down-circle-line-SfuiravZ.js"),[],import.meta.url),clipboard:{module:()=>C(()=>import("./icons/clipboard-line-CIOFpSsX.js"),[],import.meta.url),rtl:!0},"account-edit":()=>C(()=>import("./icons/user-edit-line-CC6Y-fJT.js"),[],import.meta.url),"account-warning":()=>C(()=>import("./icons/user-warning-line-BLfdr8Bj.js"),[],import.meta.url),keyboard:()=>C(()=>import("./icons/keyboard-line-BRd9ohM1.js"),[],import.meta.url),cloud:()=>C(()=>import("./icons/cloud-line-CCOdtB64.js"),[],import.meta.url),month:{module:()=>C(()=>import("./icons/calendar-month-line-DGpTEHfi.js"),[],import.meta.url),rtl:!0},media:()=>C(()=>import("./icons/photo-album-line-DkklX4P5.js"),[],import.meta.url),speak:()=>C(()=>import("./icons/radar-line-Dch2zZ5p.js"),[],import.meta.url),building:()=>C(()=>import("./icons/building-5-line-jPUf3HeC.js"),[],import.meta.url),history2:{module:()=>C(()=>import("./icons/history-2-line-C2uKqj-3.js"),[],import.meta.url),rtl:!0},document:()=>C(()=>import("./icons/document-line-ewA3UKpU.js"),[],import.meta.url),"arrows-right":{module:()=>C(()=>import("./icons/arrows-right-line-B7gMPCMB.js"),[],import.meta.url),rtl:!0},code:()=>C(()=>import("./icons/code-line-_8nrb8Yp.js"),[],import.meta.url),copy:()=>C(()=>import("./icons/copy-2-line-SBRewLs-.js"),[],import.meta.url),quote:{module:()=>C(()=>import("./icons/quote-left-line-D0CgS7V6.js"),[],import.meta.url),rtl:!0},settings:()=>C(()=>import("./icons/settings-6-line-3dTfr4F6.js"),[],import.meta.url),"heart-break":()=>C(()=>import("./icons/heart-crack-line-BlrTdexG.js"),[],import.meta.url),"user-x":()=>C(()=>import("./icons/user-x-line-Dahn1YZg.js"),[],import.meta.url),minimize:()=>C(()=>import("./icons/arrows-down-line-4JmRUmoO.js"),[],import.meta.url),celebrate:()=>C(()=>import("./icons/celebrate-line-CwClz8eZ.js"),[],import.meta.url),schedule:()=>C(()=>import("./icons/calendar-time-add-line-BwP_cVys.js"),[],import.meta.url),month:()=>C(()=>import("./icons/calendar-month-line-DGpTEHfi.js"),[],import.meta.url),day:()=>C(()=>import("./icons/calendar-day-line-zQlj2fPr.js"),[],import.meta.url),camera:()=>C(()=>import("./icons/camera-line-DK82q_yA.js"),[],import.meta.url)},sl={s:12,m:16,l:20,xl:24,xxl:32},mi={},al=Pa(function({width:t,height:e,body:n,rotate:o,flip:i}){return r("svg",{viewBox:`0 0 ${t} ${e}`,dangerouslySetInnerHTML:{__html:n},style:{transform:`${o?`rotate(${o})`:""} ${i?"scaleX(-1)":""}`}})},{isShallowEqual:!0,maxSize:Object.keys(xs).length,matchesArg:(t,e)=>t.icon===e.icon&&t.body===e.body});function M({icon:t,size:e="m",alt:n,title:o,class:i="",style:a={}}){if(!t)return null;const s=sl[e];let c=xs[t];if(!c)return null;let l,u,h=!1;Array.isArray(c)?[c,l,u]=c:typeof c=="object"&&({rotate:l,flip:u,rtl:h}=c,c=c.module);const[d,f]=j(mi[t]),m=O(t);return et(()=>{d&&m.current===t||((async()=>{const p=await c();f(p.default),mi[t]=p.default})(),m.current=t)},[t]),r("span",{class:`icon ${i} ${h?"rtl-flip":""}`,title:o||n,style:{width:`${s}px`,height:`${s}px`,...a},"data-icon":t,children:d&&r(al,{icon:t,width:d.width,height:d.height,body:d.body,rotate:l,flip:u})})}const Ze=ye((t,e)=>{var c;let n;try{n=Oa()}catch{}let o=(location.hash||"").replace(/^#/,"").trim();o===""&&(o="/");const{to:i,...a}=t;if(o&&o!=="/"&&o.includes("?")){const l=URL.parse(o,location.origin);if((c=l==null?void 0:l.searchParams)!=null&&c.size){const u=Array.from(l.searchParams.entries()).map(([h,d])=>`${h}=${encodeURIComponent(d)}`).join("&");o=l.pathname+"?"+u}}const s=o===i||decodeURIComponent(o)===i;return r("a",{ref:e,href:`#${i}`,...a,class:`${t.class||""} ${s?"is-active":""}`,onClick:l=>{var u,h,d;(h=(u=l.currentTarget)==null?void 0:u.parentNode)!=null&&h.closest("a")&&l.stopPropagation(),n&&(U.prevLocation=n),(d=t.onClick)==null||d.call(t,l)}})});function pi(t){const{className:e,disabled:n,...o}=t;return r(Uc,{className:e,disabled:n,children:({ref:i,closeMenu:a})=>r(Ze,{...o,ref:i,onClick:({detail:s})=>a(s===0?"Enter":void 0)})})}function gi(t){if(t instanceof Date)return!isNaN(t.getTime());{const e=new Date(t);return!isNaN(e.getTime())}}const cl=Lt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),vi=Lt((t,e={})=>{const n=t.replace(/-[a-z]+$/i,""),o=En([n],[cl()],t);try{return new Intl.DateTimeFormat(o,e)}catch{}try{return new Intl.DateTimeFormat(t,e)}catch{}return new Intl.DateTimeFormat(void 0,e)}),ll=Lt(t=>new Intl.RelativeTimeFormat(t||void 0)),qe=60,Ge=60*qe,gn=24*Ge,ul=t=>{const e=ll(Dt.locale),n=(t.getTime()-Date.now())/1e3,o=Math.abs(n);return o{const e=(Date.now()-t.getTime())/1e3;return el+1,0),i=it(()=>new Date(t),[t]),[a,s,c]=it(()=>{if(!gi(i))return[""+(typeof t=="string"?t:""),"",""];let l;if(e==="micro"){const u=new Date;(u.getTime()-i.getTime())/1e3/gn<=1?l=dl(i):u.getFullYear()===i.getFullYear()?l=vi(Dt.locale,{year:void 0,month:"short",day:"numeric"}).format(i):l=vi(Dt.locale,{dateStyle:"short"}).format(i)}return l||(l=ul(i)),[l,i.toISOString(),i.toLocaleString()]},[i,e,n]);return et(()=>{if(!gi(i))return;let l,u;function h(){u=requestAnimationFrame(()=>{o(),d()})}function d(){const f=(Date.now()-i.getTime())/1e3;f{clearTimeout(l),cancelAnimationFrame(u)}},[]),r("time",{datetime:s,title:c,children:a})}function hl(t){const e=O();return r(Hc,{...t,instanceRef:e,itemProps:{onPointerMove:n=>{var o,i;n.pointerType==="touch"&&((i=(o=e.current)==null?void 0:o.openMenu)==null||i.call(o))},onPointerLeave:n=>{var o,i;n.pointerType==="touch"&&((i=(o=e.current)==null?void 0:o.openMenu)==null||i.call(o))},...t.itemProps}})}function fl(t,e=[]){!t||typeof t!="function"||et(()=>{const n=new CloseWatcher;return n.addEventListener("close",t),()=>{n.destroy()}},e)}const ml=window.CloseWatcher?fl:()=>{},pl=document.getElementById("modal-container");function _i(){return getComputedStyle(document.documentElement).getPropertyValue("--backdrop-theme-color")}function sr({children:t,onClose:e,onClick:n,class:o,minimized:i}){if(!t)return null;const a=O();et(()=>{let d=setTimeout(()=>{var m;const f=(m=a.current)==null?void 0:m.querySelector('[tabindex="-1"]');f&&f.focus()},100);return()=>clearTimeout(d)},[]);const s=window.CloseWatcher,c=Ve("esc",()=>{setTimeout(()=>{e==null||e()},0)},{enabled:!s&&!!e,keydown:!1,keyup:!0},[e]);ml(e,[e]),et(()=>{const d=document.querySelectorAll(".deck-container");if(i){const f=d[d.length-1];f&&f.tabIndex===-1&&f.focus()}else t?d.forEach(f=>{f.setAttribute("inert","")}):d.forEach(f=>{f.removeAttribute("inert")});return()=>{d.forEach(f=>{f.removeAttribute("inert")})}},[t,i]);const l=O(),u=O();Ie(()=>{if(t&&!i)if(os.local.get("theme")){const f=_i();l.current=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),l.current&&(u.current=l.current.content,l.current.content=f)}else{const f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",m=_i();l.current=document.querySelector(`meta[name="theme-color"][media*="${f}"]`),l.current&&(u.current=l.current.content,l.current.content=m)}else l.current&&u.current&&(l.current.content=u.current);return()=>{l.current&&u.current&&(l.current.content=u.current)}},[t,i]);const h=r("div",{ref:d=>{var f;a.current=d,c.current=((f=d==null?void 0:d.querySelector)==null?void 0:f.call(d,'[tabindex="-1"]'))||d},className:o,onClick:d=>{n==null||n(d),d.target===d.currentTarget&&(e==null||e(d))},tabIndex:i?0:"-1",inert:i,onFocus:d=>{var f,m;try{if(d.target===d.currentTarget){const p=(f=a.current)==null?void 0:f.querySelector('[tabindex="-1"]'),g=!!p&&((m=getComputedStyle(p))==null?void 0:m.pointerEvents)!=="none";p&&g&&p.focus()}}catch{}},children:t});return io(h,pl)}const yi={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},un={},vn=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),no=vn.getContext("2d",{willReadFrequently:!0});no.imageSmoothingEnabled=!1;const gl=/missing\.png$/;function vl({url:t,staticUrl:e,size:n,alt:o="",squircle:i,...a}){n=yi[n]||n||yi.m;const s=O(),c=gl.test(t);return r("picture",{ref:s,class:`avatar ${i?"squircle":""} ${un[t]?"has-alpha":""}`,style:{width:n,height:n},title:o,...a,children:[!!e&&r("source",{srcset:e,media:"(prefers-reduced-motion: reduce)"}),!!t&&r("img",{src:t,width:n,height:n,alt:o,loading:"lazy",decoding:"async",fetchPriority:"low",crossOrigin:un[t]===void 0&&!c?"anonymous":void 0,onError:l=>{l.target.crossOrigin&&(l.target.crossOrigin=null,l.target.src=t)},onLoad:l=>{s.current&&(s.current.dataset.loaded=!0),un[t]===void 0&&(c||setTimeout(()=>{try{const{width:u,height:h}=l.target;vn.width!==u&&(vn.width=u),vn.height!==h&&(vn.height=h),no.drawImage(l.target,0,0);const d=no.getImageData(0,0,u,h),f=d.data.filter((m,p)=>p%4===3&&m<=128).length/(d.data.length/4)>.1;f&&s.current.classList.add("has-alpha"),un[t]=f,no.clearRect(0,0,u,h)}catch{un[t]=!1}},1))}})]})}const ue=Lt(vl);let ar=!1;const _l=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"){const{dir:n}=e.target;n==="rtl"?ar=!0:ar=!1}})});_l.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});function cr(){return ar}function yl(){const[t,e]=j({width:null,height:null});return Ie(()=>{const n=()=>{e({width:window.innerWidth,height:window.innerHeight})};return n(),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("resize",n)}},[]),t}function Ls(t){const{containerProps:e,instanceRef:n,align:o}=t,i=yl(),a=n!=null&&n.current?n:O(),s=cr()?o==="end"?"start":o==="start"?"end":o:o;return r(Vc,{boundingBoxPadding:Cs(),repositionFlag:`${i.width}x${i.height}`,unmountOnClose:!0,...t,align:s,instanceRef:a,containerProps:{onClick:c=>{var l,u,h;c.target===c.currentTarget&&((u=(l=a.current)==null?void 0:l.closeMenu)==null||u.call(l)),(h=e==null?void 0:e.onClick)==null||h.call(e,c)},...e}})}function Lo({subMenu:t=!1,confirm:e=!0,confirmLabel:n,menuItemClassName:o,menuFooter:i,menuExtras:a,...s}){const{children:c,onClick:l,...u}=s;return e?r(t?hl:Ls,{openTrigger:"clickOnly",direction:"bottom",overflow:"auto",gap:-8,shift:8,menuClassName:"menu-emphasized",...u,menuButton:t?void 0:c,label:t?c:void 0,children:[r(Tt,{className:o,onClick:l,children:n}),a,i]}):t?r(Tt,{...s}):l?$a(c,{onClick:l}):c}function lr({staticUrl:t,alt:e,url:n}){return r("picture",{children:[t&&r("source",{srcset:t,media:"(prefers-reduced-motion: reduce)"}),r("img",{src:n,alt:e,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async",fetchPriority:"low"},e||n)]})}const bl=Lt(t=>new RegExp(`:(${t.join("|")}):`,"g"));function wl({text:t,emojis:e}){if(!t)return"";if(!(e!=null&&e.length)||t.indexOf(":")===-1)return t;const n=bl(e.map(i=>i.shortcode));return t.split(n).map((i,a)=>{const s=e.find(c=>c.shortcode===i);if(s){const{url:c,staticUrl:l}=s;return r(lr,{staticUrl:l,alt:i,url:c},i+"-"+a)}return i})}const Ye=Lt(wl),El=Lt(t=>{const e={sensitivity:"base"};try{return new Intl.Collator(t||void 0,e)}catch{return new Intl.Collator(void 0,e)}}),Tl=/([^@]+)(@.+)/i,Al=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,kl=/\s+/g,Cl=/[^a-z0-9@\.]/gi;function Sl({account:t,instance:e,showAvatar:n,showAcct:o,short:i,external:a,onClick:s}){const{i18n:c}=re();if(!t)return null;const{acct:l,avatar:u,avatarStatic:h,id:d,url:f,displayName:m,emojis:p,bot:g,username:w}=t,[E,v,T]=l.match(Tl)||[,l];e||(e=so().instance);const S=w.toLowerCase().trim(),_=(m||"").toLowerCase().trim(),y=_.replace(Al,"").replace(kl,""),k=y.replace(Cl,""),A=!i&&(S===_||S===y||S===k||El(c.locale).compare(S,y)===0)||k===l.toLowerCase();return r("a",{class:`name-text ${o?"show-acct":""} ${i?"short":""}`,href:f,target:a?"_blank":null,title:m?`${m} (${T?"":"@"}${l})`:`${T?"":"@"}${l}`,onClick:D=>{if(!a&&!D.shiftKey){if(D.preventDefault(),D.stopPropagation(),s)return s(D);if(D.metaKey||D.ctrlKey||D.shiftKey||D.which===2){const P=`#/${e}/a/${d}`;window.open(P,"_blank");return}U.showAccount={account:t,instance:e}}},children:[n&&r(F,{children:[r(ue,{url:h||u,squircle:g})," "]}),m&&!i?r(F,{children:[r("b",{dir:"auto",children:r(Ye,{text:m,emojis:p})}),!o&&!A&&r(F,{children:[" ",r("i",{class:"bidi-isolate",children:["@",w]})]})]}):i?r("i",{children:w}):r("b",{children:w}),o&&r(F,{children:[r("br",{}),r("i",{class:"bidi-isolate",children:[T?"":"@",v,!!T&&r("span",{class:"ib",children:T})]})]})]})}const _e=Lt(Sl),xl="Аҧсшәа",Ll="Acèh",Il="Lëbacoli",Dl="Afár",Ml="Afrikaans",Rl="Shqip",Pl="Dhalur",Ol="አማርኛ",$l="العربية",Fl="Հայերեն",Nl="অসমীয়া",zl="Авар мацӀ",Bl="अवधी",Vl="Aymar aru",Hl="Azərbaycanca",Ul="Basa Bali",Kl="بلوچی",jl="Bamanankan",Wl="Baoulé",Zl="Башҡортса",ql="Euskara",Gl="Batak Karo",Yl="Batak Simalungun",Xl="Batak Toba",Ql="Беларуская",Jl="Ichibemba",tu="বাংলা",eu="Betawi",nu="भोजपुरी",ou="Bikol",ru="Bosanski",iu="Brezhoneg",su="Български",au="Буряад",cu="粵語",lu="Català",uu="Cebuano",du="Chamoru",hu="Нохчийн мотт",fu="Chichewa",mu="Kapasen Chuuk",pu="Чӑвашла",gu="Corsu",vu="Qırımtatarca (Кирилл)",_u="Hrvatski",yu="Čeština",bu="Dansk",wu="ދިވެހި",Eu="Thuɔŋjäŋ",Tu="डोगरी",Au="Dombe",ku="Nederlands",Cu="Jula",Su="རྫོང་ཁ",xu="English",Lu="Esperanto",Iu="Eesti",Du="Eʋegbe",Mu="Føroyskt",Ru="Vosa Vakaviti",Pu="Tagalog",Ou="Suomi",$u="Fon",Fu="Français",Nu="Frysk",zu="Furlan",Bu="Fulfulde",Vu="Gã",Hu="Galego",Uu="ქართული",Ku="Deutsch",ju="Ελληνικά",Wu="Avañe'ẽ",Zu="ગુજરાતી",qu="Kreyòl ayisyen",Gu="Hakha Chin",Yu="Hausa",Xu="ʻŌlelo Hawaiʻi",Qu="עברית",Ju="Hiligaynon",td="हिन्दी",ed="Hmoob",nd="Magyar",od="Hunsrik",rd="Iban",id="Íslenska",sd="Igbo",ad="Iloko",cd="Bahasa Indonesia",ld="ᐃᓄᒃᑎᑐᑦ",ud="Gaeilge",dd="Italiano",hd="Patwa",fd="日本語",md="Basa Jawa",pd="Jinghpaw",gd="Kalaallisut",vd="ಕನ್ನಡ",_d="Kanuri",yd="Kapampangan",bd="Қазақша",wd="Khasi",Ed="ភាសាខ្មែរ",Td="Rukiga",Ad="Kikongo",kd="Kinyarwanda",Cd="Kituba",Sd="Kokborok",xd="Коми кыв",Ld="कोंकणी",Id="한국어",Dd="Krio",Md="Kurdî (Kurmancî)",Rd="کوردی (سۆرانی)",Pd="Кыргызча",Od="ລາວ",$d="Latgaļu",Fd="Latina",Nd="Latviešu",zd="Ligure",Bd="Limburgs",Vd="Lingála",Hd="Lietuvių",Ud="Lombard",Kd="Luganda",jd="Dholuo",Wd="Lëtzebuergesch",Zd="Македонски",qd="Madhurâ",Gd="मैथिली",Yd="Makassar",Xd="Malagasy",Qd="Bahasa Melayu",Jd="മലയാളം",th="Malti",eh="Mam",nh="Gaelg",oh="Te Reo Māori",rh="मराठी",ih="Kajin M̧ajeļ",sh="मारवाड़ी",ah="Kreol Morisien",ch="Олык марий",lh="Baso Minang",uh="Mizo ṭawng",dh="Монгол",hh="မြန်မာစာ",fh="Náhuatl",mh="isiNdebele",ph="नेपाली",gh="Norsk",vh="Thok Nath",_h="Occitan",yh="ଓଡ଼ିଆ",bh="Afaan Oromoo",wh="Ирон æвзаг",Eh="Pangasinan",Th="Papiamentu",Ah="پښتو",kh="فارسی",Ch="Polski",Sh="Português (Brasil)",xh="ਪੰਜਾਬੀ",Lh="Runa Simi",Ih="Qʼeqchiʼ",Dh="Romani čhib",Mh="Română",Rh="Ikirundi",Ph="Русский",Oh="Davvisámegiella",$h="Gagana Samoa",Fh="Sängö",Nh="संस्कृतम्",zh="ᱥᱟᱱᱛᱟᱲᱤ",Bh="Gàidhlig",Vh="Sepedi",Hh="Српски",Uh="Sesotho",Kh="Kreol seselwa",jh="လိၵ်ႈတႆး",Wh="chiShona",Zh="Sicilianu",qh="Ślōnskŏ",Gh="سنڌي",Yh="සිංහල",Xh="Slovenčina",Qh="Slovenščina",Jh="Soomaali",tf="Español",ef="Basa Sunda",nf="Susu",of="Kiswahili",rf="siSwati",sf="Svenska",af="Reo Tahiti",cf="Тоҷикӣ",lf="ⵜⴰⵎⴰⵣⵉⵖⵜ",uf="தமிழ்",df="Татарча",hf="తెలుగు",ff="Tetun",mf="ไทย",pf="བོད་ཡིག",gf="ትግርኛ",vf="Tiv",_f="Tok Pisin",yf="Lea fakatonga",bf="Tshiluba",wf="Xitsonga",Ef="Setswana",Tf="ತುಳು",Af="chiTumbuka",kf="Türkçe",Cf="Türkmençe",Sf="Тыва дыл",xf="Akankasa",Lf="Удмурт кыл",If="Українська",Df="اردو",Mf="ئۇيغۇرچە",Rf="Oʻzbekcha",Pf="Tshivenḓa",Of="Vèneto",$f="Tiếng Việt",Ff="Winaray",Nf="Cymraeg",zf="Wolof",Bf="isiXhosa",Vf="Саха тыла",Hf="ייִדיש",Uf="Yorùbá",Kf="Màaya T'àan",jf="Didxazá",Wf="isiZulu",Io={ab:xl,ace:Ll,ach:Il,aa:Dl,af:Ml,sq:Rl,alz:Pl,am:Ol,ar:$l,hy:Fl,as:Nl,av:zl,awa:Bl,ay:Vl,az:Hl,ban:Ul,bal:Kl,bm:jl,bci:Wl,ba:Zl,eu:ql,btx:Gl,bts:Yl,bbc:Xl,be:Ql,bem:Jl,bn:tu,bew:eu,bho:nu,bik:ou,bs:ru,br:iu,bg:su,bua:au,yue:cu,ca:lu,ceb:uu,ch:du,ce:hu,ny:fu,"zh-CN":"简体中文","zh-TW":"繁體中文",chk:mu,cv:pu,co:gu,crh:vu,"crh-Latn":"Qırımtatarca (Latin)",hr:_u,cs:yu,da:bu,"fa-AF":"درى",dv:wu,din:Eu,doi:Tu,dov:Au,nl:ku,dyu:Cu,dz:Su,en:xu,eo:Lu,et:Iu,ee:Du,fo:Mu,fj:Ru,tl:Pu,fi:Ou,fon:$u,fr:Fu,"fr-CA":"Français (Canada)",fy:Nu,fur:zu,ff:Bu,gaa:Vu,gl:Hu,ka:Uu,de:Ku,el:ju,gn:Wu,gu:Zu,ht:qu,cnh:Gu,ha:Yu,haw:Xu,iw:Qu,hil:Ju,hi:td,hmn:ed,hu:nd,hrx:od,iba:rd,is:id,ig:sd,ilo:ad,id:cd,"iu-Latn":"Inuktitut (Latin)",iu:ld,ga:ud,it:dd,jam:hd,ja:fd,jw:md,kac:pd,kl:gd,kn:vd,kr:_d,pam:yd,kk:bd,kha:wd,km:Ed,cgg:Td,kg:Ad,rw:kd,ktu:Cd,trp:Sd,kv:xd,gom:Ld,ko:Id,kri:Dd,ku:Md,ckb:Rd,ky:Pd,lo:Od,ltg:$d,la:Fd,lv:Nd,lij:zd,li:Bd,ln:Vd,lt:Hd,lmo:Ud,lg:Kd,luo:jd,lb:Wd,mk:Zd,mad:qd,mai:Gd,mak:Yd,mg:Xd,ms:Qd,"ms-Arab":"بهاس ملايو",ml:Jd,mt:th,mam:eh,gv:nh,mi:oh,mr:rh,mh:ih,mwr:sh,mfe:ah,chm:ch,"mni-Mtei":"ꯃꯤꯇꯩꯂꯣꯟ",min:lh,lus:uh,mn:dh,my:hh,nhe:fh,"ndc-ZW":"Ndau",nr:mh,new:"नेपाल भाषा",ne:ph,"bm-Nkoo":"ߒߞߏ",no:gh,nus:vh,oc:_h,or:yh,om:bh,os:wh,pag:Eh,pap:Th,ps:Ah,fa:kh,pl:Ch,pt:Sh,"pt-PT":"Português (Portugal)",pa:xh,"pa-Arab":"پنجابی",qu:Lh,kek:Ih,rom:Dh,ro:Mh,rn:Rh,ru:Ph,se:Oh,sm:$h,sg:Fh,sa:Nh,"sat-Latn":"Santali (Latin)",sat:zh,gd:Bh,nso:Vh,sr:Hh,st:Uh,crs:Kh,shn:jh,sn:Wh,scn:Zh,szl:qh,sd:Gh,si:Yh,sk:Xh,sl:Qh,so:Jh,es:tf,su:ef,sus:nf,sw:of,ss:rf,sv:sf,ty:af,tg:cf,"ber-Latn":"Tamazight (Latin)",ber:lf,ta:uf,tt:df,te:hf,tet:ff,th:mf,bo:pf,ti:gf,tiv:vf,tpi:_f,to:yf,lua:bf,ts:wf,tn:Ef,tcy:Tf,tum:Af,tr:kf,tk:Cf,tyv:Sf,ak:xf,udm:Lf,uk:If,ur:Df,ug:Mf,uz:Rf,ve:Pf,vec:Of,vi:$f,war:Ff,cy:Nf,wo:zf,xh:Bf,sah:Vf,yi:Hf,yo:Uf,yua:Kf,zap:jf,zu:Wf},Wn={"zh-YUE":"YUE",zh_HANT:"zh-Hant"},Do=Lt(t=>new Intl.DisplayNames(t||void 0,{type:"language"}));function Zf(t){let e,n;typeof t=="object"&&({code:t,locale:e,fallback:n}=t);try{const o=Do(e||Dt.locale).of(t);if(o!==t)return o;if(!n){const i=Do(t).of(t);if(i!==t)return i;const a=Io==null?void 0:Io[e];if(a!==t)return a}return n||""}catch{if(Wn[t])try{const i=Do(Wn[e]||e||Dt.locale).of(Wn[t]);return i!==Wn[t]?i:n||""}catch{}return n||""}}const dn=Lt(Zf),qf={auto:"Detect language",ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},Gf={ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},Yf={},Is={sl:qf,tl:Gf,al:Yf},Xf=Object.entries(Is.tl).map(([t,{name:e}])=>({code:t,name:e})),Qf=Lt(()=>[new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages]),Jf=()=>En(Qf(),Xf.map(t=>t.code.replace("_","-")),"en");function Ds(t=!1){if(t){const{contentTranslationTargetLanguage:e}=U.settings;if(e)return e}return Jf()}const bi=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function vv(t){const e=Math.min(Math.floor(Math.log2(t)/10),bi.length-1),n=t/1024**e;return Dt.number(n,{style:"unit",unit:bi[e],unitDisplay:"narrow",maximumFractionDigits:0})}const tm={"@mastodon/edit-media-attributes":">=4.1","@mastodon/list-exclusive":">=4.2","@gotosocial/list-exclusive":">=0.17","@mastodon/filtered-notifications":"~4.3 || >=4.3","@mastodon/fetch-multiple-statuses":"~4.3 || >=4.3","@mastodon/trending-link-posts":"~4.3 || >=4.3","@mastodon/grouped-notifications":"~4.3 || >=4.3","@mastodon/annual-report":"~4.4 || >=4.4"},Mo=/pixelfed/i,se=/^(?!.*pixelfed).*$/i,em=/pleroma/i,nm=/akkoma/i;const wi={"@mastodon/lists":se,"@mastodon/filters":se,"@mastodon/mentions":se,"@mastodon/trending-hashtags":se,"@mastodon/trending-links":se,"@mastodon/post-bookmark":se,"@mastodon/post-edit":se,"@mastodon/profile-edit":se,"@mastodon/profile-private-note":se,"@pixelfed/trending":Mo,"@pixelfed/home-include-reblogs":Mo,"@pixelfed/global-feed":Mo,"@pleroma/local-visibility-post":em,"@akkoma/local-visibility-post":nm},Zn={};function qn(t){var e,n;try{let{version:o,domain:i}=Fa(),a=((n=(e=Na())==null?void 0:e.software)==null?void 0:n.name)||"mastodon";a==="hometown"&&(a="mastodon");const s=`${i}-${t}`;if(Zn[s])return Zn[s];if(wi[t])return Zn[s]=wi[t].test(o);const c=tm[t];if(!c)return!1;const u=t.match(/^@([a-z]+)\//)[1]===a.toLowerCase();return Zn[s]=u&&za(o,c,{includePrerelease:!0,loose:!0})}catch{return!1}}const Ke=2147483647,Jt=36,Dr=1,Cn=26,om=38,rm=700,Ms=72,Rs=128,Ps="-",im=/^xn--/,sm=/[^\0-\x7F]/,am=/[\x2E\u3002\uFF0E\uFF61]/g,cm={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Ro=Jt-Dr,te=Math.floor,Po=String.fromCharCode;function ge(t){throw new RangeError(cm[t])}function lm(t,e){const n=[];let o=t.length;for(;o--;)n[o]=e(t[o]);return n}function Os(t,e){const n=t.split("@");let o="";n.length>1&&(o=n[0]+"@",t=n[1]),t=t.replace(am,".");const i=t.split("."),a=lm(i,e).join(".");return o+a}function $s(t){const e=[];let n=0;const o=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),dm=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Jt},Ei=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Fs=function(t,e,n){let o=0;for(t=n?te(t/rm):t>>1,t+=te(t/e);t>Ro*Cn>>1;o+=Jt)t=te(t/Ro);return te(o+(Ro+1)*t/(t+om))},Ns=function(t){const e=[],n=t.length;let o=0,i=Rs,a=Ms,s=t.lastIndexOf(Ps);s<0&&(s=0);for(let c=0;c=128&&ge("not-basic"),e.push(t.charCodeAt(c));for(let c=s>0?s+1:0;c=n&&ge("invalid-input");const f=dm(t.charCodeAt(c++));f>=Jt&&ge("invalid-input"),f>te((Ke-o)/h)&&ge("overflow"),o+=f*h;const m=d<=a?Dr:d>=a+Cn?Cn:d-a;if(fte(Ke/p)&&ge("overflow"),h*=p}const u=e.length+1;a=Fs(o-l,u,l==0),te(o/u)>Ke-i&&ge("overflow"),i+=te(o/u),o%=u,e.splice(o++,0,i)}return String.fromCodePoint(...e)},zs=function(t){const e=[];t=$s(t);const n=t.length;let o=Rs,i=0,a=Ms;for(const l of t)l<128&&e.push(Po(l));const s=e.length;let c=s;for(s&&e.push(Ps);c=o&&hte((Ke-i)/u)&&ge("overflow"),i+=(l-o)*u,o=l;for(const h of t)if(hKe&&ge("overflow"),h===o){let d=i;for(let f=Jt;;f+=Jt){const m=f<=a?Dr:f>=a+Cn?Cn:f-a;if(d{const{shortcode:o,staticUrl:i,url:a}=n;t=t.replace(new RegExp(`:${o}:`,"g"),`:${o}:`)}),t):""}const Ne=document.createElement("div"),mm=["u-url","mention","hashtag"],pm=/[&<>]/g;function Oo(t){return t.replace(pm,e=>({"&":"&","<":"<",">":">"})[e])}const gm=/{}}=e;let a=t;const s=xm(a,o),c=gm.test(a),l=a.includes("```");if(c){const f=s.querySelectorAll('a:not([target="_blank"])');for(const p of f)p.setAttribute("target","_blank");const m=s.querySelectorAll("a[class]");for(const p of m)for(const g of p.classList)mm.includes(g)||p.classList.remove(g)}if(c){const f=s.querySelectorAll("a[href]");for(const m of f)vm.test(m.textContent.trim())&&(m.classList.add("has-url-text"),Rm(m))}if(c){const f=s.querySelectorAll("a[href]"),m=[];for(const p of f){const g=p.innerText.trim(),w=p.querySelector("*");if(_m.test(g)){const[E,v,T]=g.split("@");w||(!m.some(([S])=>S===v)||m.some(([S,_])=>S===v&&_===T)?(p.innerHTML=`@${v}`,m.push([v,T])):p.innerHTML=`@${v}@${T}`),p.classList.add("mention")}ym.test(g)&&(w||(p.innerHTML=`#${g.slice(1)}`),p.classList.add("mention","hashtag"))}}let u;if(a.includes(":")&&(n!=null&&n.length)){u=Fo(s);for(const f of u){let m=Oo(f.nodeValue);m=ur(m,n),Ne.innerHTML=m,f.replaceWith(...Ne.childNodes)}}if(l){const f=[...s.querySelectorAll("p")].filter(m=>bm.test(m.innerText.trim()));for(const m of f){const p=document.createElement("pre");for(const g of m.querySelectorAll("br"))g.replaceWith(` +`);p.innerHTML=`${m.innerHTML.trim()}`,m.replaceWith(p)}}if(l){const m=[...s.querySelectorAll("p")].filter(p=>wm.test(p.innerText));for(const p of m){const g=[p];let w=!1,E=p;for(;E.nextElementSibling;){const v=E.nextElementSibling;if(v&&v.tagName==="P")if(Em.test(v.innerText)){g.push(v),w=!0;break}else g.push(v);else break;E=v}if(w){const v=document.createElement("pre");for(const S of g)for(const _ of S.querySelectorAll("br"))_.replaceWith(` +`);const T=g.map(S=>S.innerHTML).join(` + +`);v.innerHTML=`${T}`,p.replaceWith(v);for(const S of g)S.remove()}}}if(a.includes("`")){u=Fo(s);for(const f of u){let m=Oo(f.nodeValue);Tm.test(m)&&(m=m.replaceAll(Sm,"$1")),Ne.innerHTML=m,f.replaceWith(...Ne.childNodes)}}if(Am.test(a)){u=Fo(s,{rejectFilter:["A"]});for(const f of u){let m=Oo(f.nodeValue);km.test(m)&&(m=m.replaceAll(Cm,'$1')),Ne.innerHTML=m,f.replaceWith(...Ne.childNodes)}}if(a.includes("#")){let f=null;const m=[...s.querySelectorAll("p")].filter((p,g)=>{let w=0;for(let E=0;E3||w>1&&f&&g===f+1)return f=g,!0});if(m!=null&&m.length)for(const p of m)p.classList.add("hashtag-stuffing"),p.title=p.innerText}if(a.includes("i(s)),o?s:s.innerHTML}const Vs=Lt(Lm),Im=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],Dm=Object.fromEntries(Im.map(t=>[t,!0])),Mm=/^(https?:\/\/(www\.)?|xmpp:)/,$o=30;function Rm(t){var e;if(!(!t||(e=t.querySelector)!=null&&e.call(t,"*")))try{const n=t.innerText.trim(),o=(n.match(Mm)||[])[0]||"";if(!o)return;const i=n.slice(o.length,o.length+$o),a=n.slice(o.length+$o),s=n.slice(o.length).length>$o;t.innerHTML=`${i}`}catch{}}function Fo(t,e={}){var s;const n=[],o=Object.assign({},Dm,(s=e.rejectFilter)==null?void 0:s.reduce((c,l)=>(c[l]=!0,c),{})),i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(c){return o[c.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let a;for(;a=i.nextNode();)n.push(a);return n}function Pm(t){const{mentions:e=[],instance:n,previewMode:o,statusURL:i}=t||{};return a=>{var h,d;let{target:s}=a;if(s=s.closest("a"),!s||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.which===2)return;const c=(h=s.previousSibling)==null?void 0:h.textContent,l=c==null?void 0:c.endsWith("@"),u=s.innerText.startsWith("@");if((s.classList.contains("u-url")||s.classList.contains("mention"))&&u||l&&!u){const f=(s.querySelector("span")||s).innerText.trim(),m=f.replace(/^@/,""),p=s.getAttribute("href"),g=e.find(w=>w.url===p)||e.find(w=>w.acct===m||w.username===m);if(g)a.preventDefault(),a.stopPropagation(),U.showAccount={account:g.acct,instance:n};else if(!/^http/i.test(f)){a.preventDefault(),a.stopPropagation();const w=s.getAttribute("href");U.showAccount={account:w,instance:n}}}else if(!o){const f=c==null?void 0:c.endsWith("#");if(s.classList.contains("hashtag")||f){a.preventDefault(),a.stopPropagation();const m=s.innerText.replace(/^#/,"").trim(),p=n?`#/${n}/t/${m}`:`#/t/${m}`;location.hash=p}else(d=U.unfurledLinks[s.href])!=null&&d.url&&i!==s.href&&(a.preventDefault(),a.stopPropagation(),U.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${U.unfurledLinks[s.href].url}`)}}}function _v(t,e){return()=>Dt.number(t,{style:"unit",unit:e,unitDisplay:"long"})}function ae(t){try{return Dt.number(t,{notation:"compact",roundingMode:"floor"})}catch{return t}}function yv({skeleton:t,account:e,avatarSize:n="xl",useAvatarStatic:o=!1,instance:i,external:a,internal:s,onClick:c,showActivity:l=!1,showStats:u=!1,accountInstance:h,hideDisplayName:d=!1,relationship:f={},excludeRelationshipAttrs:m=[]}){const{_:p}=re();if(t)return r("div",{class:"account-block skeleton",children:[r(ue,{size:n}),r("span",{children:[r("b",{children:"████████"}),r("br",{}),r("span",{class:"account-block-acct",children:"██████"})]})]});if(!e)return null;const{id:g,acct:w,avatar:E,avatarStatic:v,displayName:T,username:S,emojis:_,url:y,statusesCount:k,lastStatusAt:A,bot:D,fields:P,note:L,group:I,followersCount:$,createdAt:z,locked:W}=e;let[nt,st,ot]=w.match(/([^@]+)(@.+)/i)||[,w];h&&(ot=`@${h}`);const ct=P==null?void 0:P.find(lt=>!!lt.verifiedAt&&!!lt.value),K={};for(const lt in f)m.includes(lt)||(K[lt]=f[lt]);const bt=K.following||K.followedBy||K.requested;return r("a",{class:"account-block",href:y,target:a?"_blank":null,title:ot?w:`@${w}`,onClick:lt=>{if(!a){if(lt.preventDefault(),c)return c(lt);s?location.hash=`/${i}/a/${g}`:U.showAccount={account:e,instance:i}}},children:[r("div",{class:"avatar-container",children:r(ue,{url:o?v:E||v,staticUrl:o?void 0:v,size:n,squircle:D})}),r("span",{class:"account-block-content",children:[!d&&r(F,{children:T?r("b",{children:r(Ye,{text:T,emojis:_})}):r("b",{children:S})})," ",r("span",{class:"account-block-acct bidi-isolate",children:[ot?"":"@",st,r("wbr",{}),ot,W&&r(F,{children:[" ",r(M,{icon:"lock",size:"s",alt:p({id:"G2fuEb"})})]})]}),l&&r("div",{class:"account-block-stats",children:[r(R,{id:"ajzDof",values:{0:ae(k)}}),!!A&&r(F,{children:[" ","·"," ",r(R,{id:"f8bJ3C",values:{0:kn(A,{hideTime:!0})}})]})]}),u&&r("div",{class:"account-block-stats",children:[D&&r(F,{children:r("span",{class:"tag collapsed",children:[r(M,{icon:"bot"})," ",r(R,{id:"9Vdq+j"})]})}),!!I&&r(F,{children:r("span",{class:"tag collapsed",children:[r(M,{icon:"group"})," ",r(R,{id:"L8fEEm"})]})}),bt&&r("div",{class:"shazam-container-horizontal",children:r("div",{class:"shazam-container-inner",children:K.following&&K.followedBy?r("span",{class:"tag minimal",children:r(R,{id:"7oRLbi"})}):K.requested?r("span",{class:"tag minimal",children:r(R,{id:"Yx0Ud8"})}):K.following?r("span",{class:"tag minimal",children:r(R,{id:"y6sq5j"})}):K.followedBy?r("span",{class:"tag minimal",children:r(R,{id:"p3UO/y"})}):null})},f.id),!!$&&r("span",{class:"ib",children:r(R,{id:"Mn1E9C",values:{followersCount:$}})}),!!ct&&r("span",{class:"verified-field",children:[r(M,{icon:"check-circle",size:"s",alt:p({id:"QDEWii"})})," ",r("span",{dangerouslySetInnerHTML:{__html:Vs(ct.value,{emojis:_})}})]}),!D&&!I&&!bt&&!$&&!ct&&!!z&&r("span",{class:"created-at",children:r(R,{id:"PCcEFZ",values:{0:kn(z,{hideTime:!0})},components:{0:r("time",{datetime:z})}})})]})]})]})}var No={},zo,Ti;function Om(){if(Ti)return zo;Ti=1;function t(e,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return zo=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var n=new Date().getTime();if(e&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var o=this._timeouts.shift();if(o===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),o=this._cachedTimeouts.slice(-1);else return!1;var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},o),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,n){this._fn=e,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var o=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){o._operationTimeoutCb()},o._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},n=null,o=0,i=0;i=o&&(n=a,o=c)}return n},zo}var Ai;function $m(){return Ai||(Ai=1,function(t){var e=Om();t.operation=function(n){var o=t.timeouts(n);return new e(o,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},t.timeouts=function(n){if(n instanceof Array)return[].concat(n);var o={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in n)o[i]=n[i];if(o.minTimeout>o.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],s=0;sBm.call(t)==="[object Error]",Hm=new Set(["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed"]);function Um(t){return t&&Vm(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:Hm.has(t.message):!1}class Km extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const Ci=(t,e,n)=>{const o=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=o,t};async function jm(t,e){return new Promise((n,o)=>{e={...e},e.onFailedAttempt??(e.onFailedAttempt=()=>{}),e.shouldRetry??(e.shouldRetry=()=>!0),e.retries??(e.retries=10);const i=zm.operation(e),a=()=>{var c;i.stop(),o((c=e.signal)==null?void 0:c.reason)};e.signal&&!e.signal.aborted&&e.signal.addEventListener("abort",a,{once:!0});const s=()=>{var c;(c=e.signal)==null||c.removeEventListener("abort",a),i.stop()};i.attempt(async c=>{try{const l=await t(c);s(),n(l)}catch(l){try{if(!(l instanceof Error))throw new TypeError(`Non-error was thrown: "${l}". You should only throw errors.`);if(l instanceof Km)throw l.originalError;if(l instanceof TypeError&&!Um(l))throw l;if(Ci(l,c,e),await e.shouldRetry(l)||(i.stop(),o(l)),await e.onFailedAttempt(l),!i.retry(l))throw i.mainError()}catch(u){Ci(u,c,e),s(),o(u)}}})})}const Hs="ai"in self&&"translator"in self.ai;let je;Hs&&(async()=>{try{const e=(await self.ai.languageDetector.capabilities()).capabilities;e==="readily"?je=await self.ai.languageDetector.create():(je=await self.ai.languageDetector.create({monitor(n){n.addEventListener("downloadprogress",o=>{})}}),await je.ready)}catch{}})();const Wm=async(t,e,n)=>{let o;const i=e;if(e==="auto")try{e=(await je.detect(t))[0].detectedLanguage,o=e}catch(a){return{error:a}}console.groupCollapsed("💬 BROWSER TRANSLATE",i,o,n);try{const s=(await self.ai.translator.capabilities()).languagePairAvailable(e,n);if(s==="no")return console.groupEnd(),{error:`Unsupported language pair: ${e} -> ${n}`};let c;s==="readily"?c=await self.ai.translator.create({sourceLanguage:e,targetLanguage:n}):c=await self.ai.translator.create({sourceLanguage:e,targetLanguage:n,monitor(u){u.addEventListener("downloadprogress",h=>{})}});const l=await c.translate(t);return console.groupEnd(),{content:l,detectedSourceLanguage:o,provider:"browser"}}catch(a){return console.groupEnd(),{error:a}}};var Zm=Object.defineProperty,qm=(t,e,n)=>e in t?Zm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gn=(t,e,n)=>qm(t,typeof e!="symbol"?e+"":e,n),dr=new Map,Yn=new WeakMap,Si=0,Gm=void 0;function Ym(t){return t?(Yn.has(t)||(Si+=1,Yn.set(t,Si.toString())),Yn.get(t)):"0"}function Xm(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?Ym(t.root):t[e]}`).toString()}function Qm(t){const e=Xm(t);let n=dr.get(e);if(!n){const o=new Map;let i;const a=new IntersectionObserver(s=>{s.forEach(c=>{var l;const u=c.isIntersecting&&i.some(h=>c.intersectionRatio>=h);t.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=u),(l=o.get(c.target))==null||l.forEach(h=>{h(u,c)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:o},dr.set(e,n)}return n}function Us(t,e,n={},o=Gm){if(typeof window.IntersectionObserver>"u"&&o!==void 0){const l=t.getBoundingClientRect();return e(o,{isIntersecting:o,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:i,observer:a,elements:s}=Qm(n),c=s.get(t)||[];return s.has(t)||s.set(t,c),c.push(e),a.observe(t),function(){c.splice(c.indexOf(e),1),c.length===0&&(s.delete(t),a.unobserve(t)),s.size===0&&(a.disconnect(),dr.delete(i))}}function Jm(t){return typeof t.children!="function"}var bv=class extends rs{constructor(t){super(t),Gn(this,"node",null),Gn(this,"_unobserveCb",null),Gn(this,"handleNode",e=>{this.node&&(this.unobserve(),!e&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()}),Gn(this,"handleChange",(e,n)=>{e&&this.props.triggerOnce&&this.unobserve(),Jm(this.props)||this.setState({inView:e,entry:n}),this.props.onChange&&this.props.onChange(e,n)}),this.state={inView:!!t.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(t){(t.rootMargin!==this.props.rootMargin||t.root!==this.props.root||t.threshold!==this.props.threshold||t.skip!==this.props.skip||t.trackVisibility!==this.props.trackVisibility||t.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:o,delay:i,fallbackInView:a}=this.props;this._unobserveCb=Us(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:o,delay:i},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if(typeof t=="function"){const{inView:m,entry:p}=this.state;return t({inView:m,entry:p,ref:this.handleNode})}const{as:e,triggerOnce:n,threshold:o,root:i,rootMargin:a,onChange:s,skip:c,trackVisibility:l,delay:u,initialInView:h,fallbackInView:d,...f}=this.props;return Ba(e||"div",{ref:this.handleNode,...f},t)}};function tp({threshold:t,delay:e,trackVisibility:n,rootMargin:o,root:i,triggerOnce:a,skip:s,initialInView:c,fallbackInView:l,onChange:u}={}){var h;const[d,f]=j(null),m=O(u),[p,g]=j({inView:!!c,entry:void 0});m.current=u,et(()=>{if(s||!d)return;let T;return T=Us(d,(S,_)=>{g({inView:S,entry:_}),m.current&&m.current(S,_),_.isIntersecting&&a&&T&&(T(),T=void 0)},{root:i,rootMargin:o,threshold:t,trackVisibility:n,delay:e},l),()=>{T&&T()}},[Array.isArray(t)?t.toString():t,d,i,o,a,s,n,l,e]);const w=(h=p.entry)==null?void 0:h.target,E=O(void 0);!d&&w&&!a&&!s&&E.current!==w&&(E.current=w,g({inView:!!c,entry:void 0}));const v=[f,p.inView,p.entry];return v.ref=v[0],v.inView=v[1],v.entry=v[2],v}const xi=48,Vo={};function Ks({id:t,children:e}){const n=O(),o=!!Vo[t],[i,a]=j(!1),[s,c]=j(o||!1),{ref:l}=tp({root:null,rootMargin:`-${xi}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,onChange:u=>{u&&(a(!0),t&&(Vo[t]=!0))},triggerOnce:!0,skip:s||i});return et(()=>{if(!n.current)return;const u=n.current.getBoundingClientRect();u.bottom>xi&&(u.top({code:t,name:e})),{PHANPY_TRANSLANG_INSTANCES:Li}=ep,_n=Li?Li.split(/\s+/):[],op=is({limit:1,interval:2e3}),js=1e3*60*60;let Ho=0;function rp(t,e,n){return jm(()=>{let i=_n[Ho];const a=t.length>2e3;let s;return a?s=fetch(`https://${i}/api/v1/translate`,{method:"POST",priority:"low",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/json"},body:JSON.stringify({sl:e,tl:n,text:t})}):s=fetch(`https://${i}/api/v1/translate?sl=${encodeURIComponent(e)}&tl=${encodeURIComponent(n)}&text=${encodeURIComponent(t)}`,{priority:"low",referrerPolicy:"no-referrer"}),s.then(c=>{if(!c.ok)throw new Error(c.statusText);return c.json()}).then(c=>({provider:"translang",content:c.translated_text,detectedSourceLanguage:c.detected_language,pronunciation:c.pronunciation}))},{retries:3,onFailedAttempt:i=>{Ho=(Ho+1)%_n.length}})}const Ws=mo(rp,{maxAge:js}),ip=mo(op(Ws),{maxAge:js});function sp({forceTranslate:t,sourceLanguage:e,onTranslate:n,text:o="",mini:i,autoDetected:a}){const{_:s}=re(),c=Ds(!0),[l,u]=j("default"),[h,d]=j(null),[f,m]=j(null),[p,g]=j(null),w=O(),E=e?dn(e):null,v=dn(c),T=O("auto");n||(n=async(..._)=>{if(Hs){const y=await Wm(..._);if(y&&!y.error)return y}return i?await ip(..._):await Ws(..._)});const S=async()=>{u("loading");try{const{content:_,detectedSourceLanguage:y,provider:k,error:A,...D}=await n(o,T.current,c);if(_){if(y){const P=dn(y);g(P)}if(k==="translang"){const P=D==null?void 0:D.pronunciation;P&&d(P)}m(_),u("default"),!i&&_.trim()!==o.trim()&&(w.current.open=!0,w.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else u("error")}catch{u("error")}};return et(()=>{t&&S()},[t]),i?f&&f.trim()!==o.trim()&&p!==v?r(Ks,{children:r("div",{class:"status-translation-block-mini",children:[r(M,{icon:"translate",alt:s({id:"zVJKbG",values:{sourceLangText:E}})}),r("output",{lang:c,dir:"auto",title:h||"",children:f})]})}):null:r("div",{class:"status-translation-block",onClick:_=>{_.preventDefault()},children:r("details",{ref:w,children:[r("summary",{children:r("button",{type:"button",onClick:async _=>{_.preventDefault(),_.stopPropagation(),w.current.open=!w.current.open,l!=="loading"&&(f||S())},children:[r(M,{icon:"translate"})," ",r("span",{children:s(l==="loading"?{id:"Zxkt/v"}:e&&E&&!p?a?{id:"R20Yf9",values:{sourceLangText:E}}:{id:"h8zDAI",values:{sourceLangText:E}}:{id:"pi8x/S"})})]})}),r("div",{class:"translated-block",children:[r("div",{class:"translation-info insignificant",children:[r("select",{class:"translated-source-select",disabled:l==="loading",onChange:_=>{T.current=_.target.value,S()},children:np.map(_=>{const y=dn({code:_.code,fallback:_.name}),k=dn({code:_.code,locale:_.code}),A=k&&y!==k;return r("option",{value:_.code,children:_.code==="auto"?s({id:"Bze3gr",values:{0:p??"…"}}):A?`${k} - ${y}`:y})})})," ",r("span",{children:["→ ",v]}),r(ss,{abrupt:!0,hidden:l!=="loading"})]}),l==="error"?r("p",{class:"ui-state",children:r(R,{id:"m5LihO"})}):!!f&&r(F,{children:[r("output",{class:"translated-content",lang:c,dir:"auto",children:f}),!!h&&r("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:_=>{_.target.classList.toggle("expand")},children:h})]})]})]})})}const ap=_n!=null&&_n.length?sp:()=>null;function fe(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Zs(t,e){const n=indexedDB.open(t);n.onupgradeneeded=()=>n.result.createObjectStore(e);const o=fe(n);return(i,a)=>o.then(s=>a(s.transaction(e,i).objectStore(e)))}let Uo;function De(){return Uo||(Uo=Zs("keyval-store","keyval")),Uo}function cp(t,e=De()){return e("readonly",n=>fe(n.get(t)))}function lp(t,e,n=De()){return n("readwrite",o=>(o.put(e,t),fe(o.transaction)))}function up(t,e=De()){return e("readonly",n=>Promise.all(t.map(o=>fe(n.get(o)))))}function dp(t,e=De()){return e("readwrite",n=>(n.delete(t),fe(n.transaction)))}function hp(t,e=De()){return e("readwrite",n=>(t.forEach(o=>n.delete(o)),fe(n.transaction)))}function fp(t=De()){return t("readwrite",e=>(e.clear(),fe(e.transaction)))}function mp(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},fe(t.transaction)}function pp(t=De()){return t("readonly",e=>{if(e.getAllKeys)return fe(e.getAllKeys());const n=[];return mp(e,o=>n.push(o.key)).then(()=>n)})}function Ii(t,e){const n=Zs(t,e);return{set:(o,i)=>lp(o,i,n),get:o=>cp(o,n),getMany:o=>up(o,n),del:o=>dp(o,n),delMany:o=>hp(o,n),clear:()=>fp(n),keys:()=>pp(n)}}const wv={drafts:Ii("drafts-db","drafts-store"),catchup:Ii("catchup-db","catchup-store")};async function Ev(t,e={}){if(!(t!=null&&t.length))return;const{masto:n}=so(),o=Er(),i=t.reduce((a,s)=>(!a.includes(s.id)&&!e[s.id]&&s.id!==o&&a.push(s.id),a),[]);if(!i.length)return null;try{return(await n.v1.accounts.relationships.fetch({id:i})).reduce((c,l)=>(c[l.id]=l,c),{})}catch{return null}}class Ht extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>Ht.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(e){this.setAttribute("videoid",e)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(e){this.setAttribute("playlistid",e)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(e){this.setAttribute("videotitle",e)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(e){this.setAttribute("videoplay",e)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(e){this.setAttribute("params",e)}set posterQuality(e){this.setAttribute("posterquality",e)}get disableNoscript(){return this.hasAttribute("disablenoscript")}setupDom(){const e=this.attachShadow({mode:"open"});let n="";window.liteYouTubeNonce&&(n=`nonce="${window.liteYouTubeNonce}"`),e.innerHTML=` + +
+ + + + + + + + +
+ `,this.domRefFrame=e.querySelector("#frame"),this.domRefImg={fallback:e.querySelector("#fallbackPlaceholder"),webp:e.querySelector("#webpPlaceholder"),jpeg:e.querySelector("#jpegPlaceholder")},this.domRefPlayButton=e.querySelector("#playButton")}setupComponent(){this.shadowRoot.querySelector("slot[name=image]").assignedNodes().length===0&&this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver(),this.disableNoscript||this.injectSearchNoScript()}attributeChangedCallback(e,n,o){n!==o&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){const e=document.createElement("noscript");this.prepend(e),e.innerHTML=this.generateIframe()}generateIframe(e=!1){let n=e?0:1;const o=this.noCookie?"-nocookie":"";let i;return this.playlistId?i=`?listType=playlist&list=${this.playlistId}&`:i=`${this.videoId}?`,this.autoPause&&(this.params="enablejsapi=1"),this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,n=1),` +`}addIframe(e=!1){if(!this.isIframeLoaded){const n=this.generateIframe(e);this.domRefFrame.insertAdjacentHTML("beforeend",n),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){var e,n;this.testPosterImage(),this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),(n=(e=this.domRefImg)==null?void 0:e.fallback)==null||n.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}async testPosterImage(){setTimeout(()=>{const e=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,n=new Image;n.fetchPriority="low",n.referrerPolicy="origin",n.src=e,n.onload=async o=>{const i=o.target;(i==null?void 0:i.naturalHeight)==90&&(i==null?void 0:i.naturalWidth)==120&&(this.posterQuality="hqdefault");const s=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=s;const c=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.jpeg.srcset=c,this.domRefImg.fallback.src=c,this.domRefImg.fallback.loading=this.posterLoading}},100)}initIntersectionObserver(){const e={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((o,i)=>{o.forEach(a=>{a.isIntersecting&&!this.isIframeLoaded&&(Ht.warmConnections(this),this.addIframe(!0),i.unobserve(this))})},e).observe(this),this.autoPause&&new IntersectionObserver((i,a)=>{i.forEach(s=>{var c,l;s.intersectionRatio!==1&&((l=(c=this.shadowRoot.querySelector("iframe"))==null?void 0:c.contentWindow)==null||l.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*"))})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{var e,n;(n=(e=this.shadowRoot.querySelector("iframe"))==null?void 0:e.contentWindow)==null||n.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return this.getAttribute("short")===""&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(e,n){const o=document.createElement("link");o.rel=e,o.href=n,o.crossOrigin="true",document.head.append(o)}static warmConnections(e){Ht.isPreconnected||window.liteYouTubeIsPreconnected||(Ht.addPrefetch("preconnect","https://i.ytimg.com/"),Ht.addPrefetch("preconnect","https://s.ytimg.com"),e.noCookie?Ht.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(Ht.addPrefetch("preconnect","https://www.youtube.com"),Ht.addPrefetch("preconnect","https://www.google.com"),Ht.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),Ht.addPrefetch("preconnect","https://static.doubleclick.net")),Ht.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}Ht.isPreconnected=!1;customElements.define("lite-youtube",Ht);const qs=new Uint8Array(128);for(let t=0;t<83;t++)qs["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(t)]=t;const oo=(t,e,n)=>{let o=0;for(;et>10.31475?Gs(t/Xs+.052132,2.4):t/Ys,Ko=t=>~~(t>1227e-8?Xs*Gs(t,.416666)-13.025:t*Ys+1),yn=t=>(t<0?-1:1)*t*t,Di=t=>{for(t+=Sn/2;t>Sn;)t-=gp;const e=1.27323954*t-.405284735*yn(t);return .225*(yn(e)-e)+e};function Mr(t){const e=oo(t,2,6);return[e>>16,e>>8&255,e&255]}function _p(t,e,n,o){const i=oo(t,0,1),a=i%9+1,s=~~(i/9)+1,c=a*s;let l=0,u=0,h=0,d=0,f=0,m=0,p=0,g=0,w=0,E=0,v=0,T=0;const S=(oo(t,1,2)+1)/13446*(o|1),_=new Float64Array(c*3),y=Mr(t);for(l=0;l<3;l++)_[l]=vp(y[l]);for(l=1;l{const o=n.char||" ",i=n.count||2;let a=0;const s=[];return e.reverse().reduce((c,l)=>{s.length&&a&&s[a]&&s[a]===l.substring(1,s[a].length+1)&&(s.splice(a,1),a--);const h=[`${o.repeat(a?a*i:0)}${l}`,...c];return l.substring(0,2)==="n.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");return Wo={mergeAttributesWithElements:n=>{const o=t(n).split(` +`),i=[];let a="";for(let s=0;s")){i.push(`${a}${c.slice(0,-2)} />`),a="";continue}if(c.endsWith(">")){i.push(`${a}${c.startsWith(">")||c.startsWith("<")?"":" "}${c}`),a="";continue}a+=a.length?` ${c}`:c}return i},removeEmptyLines:t},Wo}var Zo,Pi;function wp(){if(Pi)return Zo;Pi=1;const t=yp(),{mergeAttributesWithElements:e}=bp();return Zo=(o,i={})=>{const a=e(o);return t(a,i)},Zo}var Ep=wp();const Tp=wr(Ep);function Ap({poll:t,lang:e,readOnly:n,refresh:o=()=>{},votePoll:i=()=>{}}){const{_:a}=re(),[s,c]=j("default"),{expired:l,expiresAt:u,id:h,multiple:d,options:f,ownVotes:m,voted:p,votersCount:g,votesCount:w=0,emojis:E}=t,v=!!u&&new Date(u),T=d?g:w;let S=0;T<=1e3?S=0:T<=1e4?S=1:T<=1e5&&(S=2);const[_,y]=j(!1),k=f.every(A=>A.votesCount!==null);return r("div",{lang:e,dir:"auto",class:`poll ${n?"read-only":""} ${s==="loading"?"loading":""}`,children:[_&&k||p||l?r(F,{children:[r("div",{class:"poll-options",children:f.map((A,D)=>{const{title:P,votesCount:L}=A,I=T?L/T:0,$=I?I.toLocaleString(Dt.locale||void 0,{style:"percent",maximumFractionDigits:S}):"0%",z=L>0&&L===Math.max(...f.map(W=>W.votesCount));return r("div",{class:`poll-option poll-result ${z?"poll-option-leading":""}`,style:{"--percentage":`${I*100}%`},children:[r("div",{class:"poll-option-title",children:[r("span",{children:r(Ye,{text:P,emojis:E})}),p&&m.includes(D)&&r(F,{children:[" ",r(M,{icon:"check-circle",alt:a({id:"IeO7us"})})]})]}),r("div",{class:"poll-option-votes",title:Dt._({id:"+syLpm",values:{optionVotesCount:L}}),children:$})]},`${D}-${P}-${L}`)})}),!l&&!p&&r("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:A=>{A.preventDefault(),y(!1)},children:[r(M,{icon:"arrow-left",size:"s"})," ",r(R,{id:"L96xSt"})]})]}):r("form",{onSubmit:async A=>{A.preventDefault();const D=A.target,P=new FormData(D),L=[];P.forEach((I,$)=>{$==="poll"&&L.push(I)}),L.length&&(c("loading"),await i(L),c("default"))},children:[r("div",{class:"poll-options",children:f.map((A,D)=>{const{title:P}=A;return r("div",{class:"poll-option",children:r("label",{class:"poll-label",children:[r("input",{type:d?"checkbox":"radio",name:"poll",value:D,disabled:s==="loading",readOnly:n}),r("span",{class:"poll-option-title",children:r(Ye,{text:P,emojis:E})})]})})})}),!n&&r("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:r(R,{id:"lQXQKs"})})]}),r("p",{class:"poll-meta",children:[!l&&!n&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:A=>{A.preventDefault(),c("loading"),(async()=>(await o(),c("default")))()},title:a({id:"lCF0wC"}),children:r(M,{icon:"refresh",alt:a({id:"lCF0wC"})})}),!p&&!l&&!n&&k&&r("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:A=>{A.preventDefault(),y(!_)},title:a(_?{id:"L96xSt"}:{id:"zCjei3"}),children:[r(M,{icon:_?"eye-open":"eye-close",alt:a(_?{id:"L96xSt"}:{id:"zCjei3"})})," "]}),!l&&!n&&" ",r(R,{id:"k7v0Rh",values:{0:ae(w),1:ae(w),votesCount:w},components:{0:r("span",{title:w}),1:r("span",{title:w})}}),!!g&&g!==w&&r(F,{children:[" ","•"," ",r(R,{id:"jf1i1L",values:{0:ae(g),1:ae(g),votersCount:g},components:{0:r("span",{title:g}),1:r("span",{title:g})}})]})," ","•"," ",l?v?r(R,{id:"5LwCCI",components:{0:r(le,{datetime:v})}}):a({id:"237hSL"}):v?r(R,{id:"ooHDPY",components:{0:r(le,{datetime:v})}}):a({id:"O2tNG0"})]})]})}const Qs=he();function kp(t,e){if(!(t!=null&&t.length))return!1;const n=t.filter(s=>{const{filter:c}=s,l=c.context.includes(e);return l?c.expiresAt?new Date(c.expiresAt)>new Date:l:!1});if(!n.length)return!1;if(n.some(s=>s.filter.filterAction==="hide"))return{action:"hide"};if(n.every(s=>s.filter.filterAction==="blur")){const s=n.map(c=>c.filter.title);return{action:"blur",titles:s,titlesStr:s.join(" • ")}}if(n.some(s=>!!s.filter.filterAction)){const s=n.map(c=>c.filter.title);return{action:"warn",titles:s,titlesStr:s.join(" • ")}}return!1}const Rr=Lt(kp);function Cp(t,e,n){var s;const{filtered:o}=t;if(!(o!=null&&o.length)||n&&((s=t.account)==null?void 0:s.id)===n)return!0;const a=Rr(o,e);return a?a.action!=="hide":!0}function Tv(t,e){if(!(t!=null&&t.length))return[];if(!e)return t;const n=Er();return t.filter(o=>Cp(o,e,n))}function Oi(t){try{return Bs.toUnicode(URL.parse(t).hostname.replace(/^www\./,"").replace(/\/$/,""))}catch{return""}}const qo=document.createElement("div");function Go(t){return t?(qo.innerHTML=t,qo.querySelectorAll(".invisible").forEach(e=>{e.remove()}),qo.innerText.length):0}const hr="speechSynthesis"in window;function Sp(t,e){if(hr)try{speechSynthesis.speaking&&speechSynthesis.cancel();const n=new SpeechSynthesisUtterance(t);e&&(n.lang=e),speechSynthesis.speak(n)}catch(n){alert(n)}}function xp(t,e,n){var o=this,i=O(null),a=O(0),s=O(null),c=O([]),l=O(),u=O(),h=O(t),d=O(!0);h.current=t;var f=typeof window<"u",m=!e&&e!==0&&f;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var p=!!(n=n||{}).leading,g=!("trailing"in n)||!!n.trailing,w="maxWait"in n,E="debounceOnServer"in n&&!!n.debounceOnServer,v=w?Math.max(+n.maxWait||0,e):null;et(function(){return d.current=!0,function(){d.current=!1}},[]);var T=it(function(){var S=function(P){var L=c.current,I=l.current;return c.current=l.current=null,a.current=P,u.current=h.current.apply(I,L)},_=function(P,L){m&&cancelAnimationFrame(s.current),s.current=m?requestAnimationFrame(P):setTimeout(P,L)},y=function(P){if(!d.current)return!1;var L=P-i.current;return!i.current||L>=e||L<0||w&&P-a.current>=v},k=function(P){return s.current=null,g&&c.current?S(P):(c.current=l.current=null,u.current)},A=function P(){var L=Date.now();if(y(L))return k(L);if(d.current){var I=e-(L-i.current),$=w?Math.min(I,v-(L-a.current)):I;_(P,$)}},D=function(){if(f||E){var P=Date.now(),L=y(P);if(c.current=[].slice.call(arguments),l.current=o,i.current=P,L){if(!s.current&&d.current)return a.current=i.current,_(A,e),p?S(i.current):u.current;if(w)return _(A,e),S(i.current)}return s.current||_(A,e),u.current}};return D.cancel=function(){s.current&&(m?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,c.current=i.current=l.current=s.current=null},D.isPending=function(){return!!s.current},D.flush=function(){return s.current?k(Date.now()):u.current},D},[p,w,e,v,g,m,f,E]);return T}function Lp(t,e,n){var o=n===void 0?{}:n,i=o.leading,a=o.trailing;return xp(t,e,{maxWait:e,leading:i===void 0||i,trailing:a===void 0||a})}function Ip(t,e){var n=O(null),o=O(null);o.current=e;var i=O(null);et(function(){a()});var a=xt(function(){var s=i.current,c=o.current,l=s||(c?c instanceof Element?c:c.current:null);n.current&&n.current.element===l&&n.current.subscriber===t||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:t,cleanup:l?t(l):void 0})},[t]);return et(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),xt(function(s){i.current=s,a()},[a])}function $i(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function Dp(t){t===void 0&&(t={});var e=t.onResize,n=O(void 0);n.current=e;var o=t.round||Math.round,i=O(),a=j({width:void 0,height:void 0}),s=a[0],c=a[1],l=O(!1);et(function(){return l.current=!1,function(){l.current=!0}},[]);var u=O({width:void 0,height:void 0}),h=Ip(xt(function(d){return(!i.current||i.current.box!==t.box||i.current.round!==o)&&(i.current={box:t.box,round:o,instance:new ResizeObserver(function(f){var m=f[0],p=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=$i(m,p,"inlineSize"),w=$i(m,p,"blockSize"),E=g?o(g):void 0,v=w?o(w):void 0;if(u.current.width!==E||u.current.height!==v){var T={width:E,height:v};u.current.width=E,u.current.height=v,n.current?n.current(T):l.current||c(T)}})}),i.current.instance.observe(d,{box:t.box}),function(){i.current&&i.current.instance.unobserve(d)}},[t.box,o]),t.ref);return it(function(){return{ref:h,width:s.width,height:s.height}},[h,s.width,s.height])}function ro({className:t="truncated"}={}){const e=O(),n=Lp(({height:o})=>{if(e.current){const{scrollHeight:i}=e.current;let a=i>o;if(a){const{height:s,maxHeight:c}=getComputedStyle(e.current),l=parseInt(c||s,10);a=i>l}e.current.classList.toggle(t,a)}},300);return Dp({ref:e,box:"border-box",onResize:n}),e}const bn={public:"earth",unlisted:"group",private:"lock",direct:"message",local:"building"};var Js="kvfysmfp",ta="ufhsfnkm",Mp=".".concat(Js,"{overflow:hidden;touch-action:none}.").concat(ta,"{transform-origin: 0 0}"),Rp=typeof window>"u",Pp=function(){return!Rp&&("ontouchstart"in window||navigator.maxTouchPoints>0)};var Op=function(t){var e=t.x,n=t.y,o=t.scale;return"scale3d(".concat(o,",").concat(o,", 1) translate3d(").concat(e,"px, ").concat(n,"px, 0)")};var $p=Math.min,Fp=Math.max;function Fi(t){var e=t.containerDimension,n=t.childDimension,o=t.padding,i=t.centerContained,a=n-e;return a+2*o<=0&&i?[a/2,a/2]:[$p(a+o,0)-o,Fp(0,a+o)]}var Ni=function(t,e){return e?"".concat(t," ").concat(e):t},Xn=Math.abs,Np=Math.min,zp=Math.sqrt,ea=typeof window>"u",Bp=ea?!1:/(Mac)/i.test(navigator.platform),ze=function(t){return t==="drag"},hn=function(t){return t==="zoom"},Vp=function(t){return Bp&&t.ctrlKey},fn=function(t){t.stopPropagation(),t.preventDefault()},zi=function(t,e){var n=t.x-e.x,o=t.y-e.y;return zp(n*n+o*o)},Hp=function(t,e){var n=zi(t[0],t[1]),o=zi(e[0],e[1]);return o/n},Up=function(t,e){return t>e-.01&&te?e:n},Zp=function(t){return!(t.ctrlKey||t.metaKey)},qp=function(t){if(t){var e=t.offsetWidth,n=t.offsetHeight;if(e&&n)return{width:e,height:n};var o=getComputedStyle(t),i=parseFloat(o.width),a=parseFloat(o.height);if(a&&i)return{width:i,height:a}}return{width:0,height:0}},Gp=function(t,e){return{x:e.x-t.x,y:e.y-t.y}},Yp=function(t,e){return t.x===e.x&&t.y===e.y},Se=function(){},Jn={x:0,y:0},Vi=function(t){Va(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._prevDragMovePoint=null,n._containerObserver=null,n._fingers=0,n._firstMove=!0,n._initialOffset=$t({},Jn),n._interaction=null,n._isDoubleTap=!1,n._isOffsetsSet=!1,n._lastDragPosition=null,n._lastScale=1,n._lastTouchStart=0,n._lastZoomCenter=null,n._listenMouseMove=!1,n._nthZoom=0,n._offset=$t({},Jn),n._startOffset=$t({},Jn),n._startTouches=null,n._updatePlaned=!1,n._wheelTimeOut=null,n._zoomFactor=1,n._initialZoomFactor=1,n._draggingPoint=$t({},Jn),n._ignoreNextClick=!1,n._containerRef=Ha(),n._handleClick=function(o){n._ignoreNextClick&&(n._ignoreNextClick=!1,o.stopPropagation())},n._onResize=function(){var o;!((o=n._containerRef)===null||o===void 0)&&o.current&&(n._updateInitialZoomFactor(),n._setupOffsets(),n._update())},n._handlerOnTouchEnd=n._handlerIfEnable(function(o){n._fingers=o.touches.length,n.props.shouldCancelHandledTouchEndEvents&&(hn(n._interaction)||ze(n._interaction)&&(n._startOffset.x!==n._offset.x||n._startOffset.y!==n._offset.y))&&fn(o),ze(n._interaction)&&!n._enoughToDrag()&&n._handleClick(o),n._updateInteraction(o)}),n._handlerOnTouchStart=n._handlerIfEnable(function(o){n._firstMove=!0,n._fingers=o.touches.length,n._detectDoubleTap(o)}),n._handlerOnTouchMove=n._handlerIfEnable(function(o){n._isDoubleTap||(n._collectInertia(o),n._firstMove?(n._updateInteraction(o),n._interaction&&fn(o),n._startOffset=$t({},n._offset),n._startTouches=Qn(o.touches)):(hn(n._interaction)?n._startTouches&&n._startTouches.length===2&&o.touches.length===2&&n._handleZoom(o,Hp(n._startTouches,Qn(o.touches))):ze(n._interaction)&&n._handleDrag(o),n._interaction&&(fn(o),n._update())),n._firstMove=!1)}),n._handlerWheel=function(o){if(!n.props.shouldInterceptWheel(o)){fn(o);var i=o.pageX,a=o.pageY,s=o.deltaY,c=o.deltaMode,l=1;(Vp(o)||c===1)&&(l=15);var u={touches:[{pageX:i,pageY:a}]},h=n._getOffsetByFirstTouch(u),d=s*l;n._stopAnimation(),n._scaleTo(n._zoomFactor-d/n.props.wheelScaleFactor,h),n._update(),clearTimeout(n._wheelTimeOut),n._wheelTimeOut=setTimeout(function(){return n._sanitize()},100)}},n._handlers=n.props.isTouch()?[["touchstart",n._handlerOnTouchStart],["touchend",n._handlerOnTouchEnd],["touchmove",n._handlerOnTouchMove]]:[["mousemove",n.simulate(n._handlerOnTouchMove),n.props._document],["mouseup",n.simulate(n._handlerOnTouchEnd),n.props._document],["mousedown",n.simulate(n._handlerOnTouchStart)],["click",n._handleClick],["wheel",n._handlerWheel]],n}return e.prototype._handleDragStart=function(n){this._ignoreNextClick=!0,this.props.onDragStart(),this._stopAnimation(),this._resetInertia(),this._lastDragPosition=null,this._hasInteraction=!0,this._draggingPoint=this._offset,this._handleDrag(n)},e.prototype._handleDrag=function(n){var o=this._getOffsetByFirstTouch(n);this._enoughToDrag()?this._drag(o,this._lastDragPosition):this._virtualDrag(o,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=o},e.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},e.prototype._realizeInertia=function(){var n=this,o=this.props,i=o.inertiaFriction,a=o.inertia;if(!(!a||!this._velocity)){var s=this._velocity,c=s.x,l=s.y;if(c||l){this._stopAnimation(),this._resetInertia();var u=function(){if(c*=i,l*=i,!c&&!l)return n._stopAnimation();var h=$t({},n._offset);if(n._addOffset({x:c,y:l}),n._offset=n._sanitizeOffset(n._offset),Yp(h,n._offset))return n._stopAnimation();n._update({isAnimation:!0})};this._animate(u,{duration:9999})}}},e.prototype._collectInertia=function(n){var o=n.touches;if(this.props.inertia){var i=Qn(o)[0],a=this._prevDragMovePoint;a&&(this._velocity=Gp(i,a)),this._prevDragMovePoint=i}},e.prototype._handleDragEnd=function(){this.props.onDragEnd(),this._end(),this._realizeInertia()},e.prototype._handleZoomStart=function(){this.props.onZoomStart(),this._stopAnimation(),this._lastScale=1,this._nthZoom=0,this._lastZoomCenter=null,this._hasInteraction=!0},e.prototype._handleZoom=function(n,o){var i=Wp(this._getOffsetTouches(n)),a=o/this._lastScale;this._lastScale=o,this._nthZoom+=1,this._nthZoom>3&&(this._scale(a,i),this._drag(i,this._lastZoomCenter),this.props.enforceBoundsDuringZoom&&(this._offset=this._sanitizeOffset(this._offset))),this._lastZoomCenter=i},e.prototype._handleZoomEnd=function(){this.props.onZoomEnd(),this._end()},e.prototype._handleDoubleTap=function(n){var o=this;if(!(this._hasInteraction||this.props.tapZoomFactor===0)){var i=this.props.doubleTapZoomOutOnMaxScale&&this._zoomFactor===this.props.maxZoom||this.props.doubleTapToggleZoom&&this._zoomFactor>1;this.props.onDoubleTap(),this._ignoreNextClick=!0;var a=this._zoomFactor+this.props.tapZoomFactor,s=this._zoomFactor,c=function(u){o._scaleTo(s+u*(a-s),l)},l=this._getOffsetByFirstTouch(n);this._isDoubleTap=!0,s>a&&(l=this._getCurrentZoomCenter()),i?this._zoomOutAnimation():this._animate(c)}},e.prototype._computeInitialOffset=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=o.width,a=o.height,s=-Xn(i*this._getInitialZoomFactor()-n.width)/2,c=-Xn(a*this._getInitialZoomFactor()-n.height)/2;this._initialOffset={x:s,y:c}},e.prototype._resetOffset=function(){this._offset=$t({},this._initialOffset)},e.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},e.prototype._sanitizeOffset=function(n){var o=this._getContainerRect(),i=this._getChildSize(),a=i.width,s=i.height,c=a*this._getInitialZoomFactor()*this._zoomFactor,l=s*this._getInitialZoomFactor()*this._zoomFactor,u=Fi({containerDimension:o.width,childDimension:c,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),h=u[0],d=u[1],f=Fi({containerDimension:o.height,childDimension:l,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),m=f[0],p=f[1];return{x:Yo(h,d,n.x),y:Yo(m,p,n.y)}},e.prototype.alignCenter=function(n){var o=this,i=$t({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,h=a*this._initialZoomFactor,d=s*this._initialZoomFactor,f=this._zoomFactor,m=$t({},this._offset),p=this._getContainerRect(),g={x:p.width/2,y:p.height/2};if(this._zoomFactor=1,this._offset={x:-(g.x-h),y:-(g.y-d)},this._scaleTo(c,g),this._stopAnimation(),!l)return this._update();var w=this._zoomFactor-f,E={x:this._offset.x-m.x,y:this._offset.y-m.y};this._zoomFactor=f,this._offset=$t({},m);var v=function(T){var S=m.x+E.x*T,_=m.y+E.y*T;o._zoomFactor=f+w*T,o._offset=o._sanitizeOffset({x:S,y:_}),o._update()};this._animate(v,{callback:function(){return o._sanitize()},duration:u})},e.prototype.scaleTo=function(n){var o=this,i=$t({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,h=this._zoomFactor,d=$t({},this._offset);if(this._zoomFactor=1,this._offset={x:0,y:0},this._scaleTo(c,{x:a,y:s}),this._stopAnimation(),!l)return this._update();var f=this._zoomFactor-h,m={x:this._offset.x-d.x,y:this._offset.y-d.y};this._zoomFactor=h,this._offset=$t({},d);var p=function(g){var w=d.x+m.x*g,E=d.y+m.y*g;o._zoomFactor=h+f*g,o._offset={x:w,y:E},o._update()};this._animate(p,{callback:function(){return o._sanitize()},duration:u})},e.prototype._scaleTo=function(n,o){this._scale(n/this._zoomFactor,o),this._offset=this._sanitizeOffset(this._offset)},e.prototype._scale=function(n,o){n=this._scaleZoomFactor(n),this._addOffset({x:(n-1)*(o.x+this._offset.x),y:(n-1)*(o.y+this._offset.y)}),this.props.onZoomUpdate()},e.prototype._scaleZoomFactor=function(n){var o=this._zoomFactor;return this._zoomFactor*=n,this._zoomFactor=Yo(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/o},e.prototype._canDrag=function(){return this.props.draggableUnZoomed||!Up(this._zoomFactor,1)},e.prototype._drag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this.props.lockDragAxis?Xn(a)>Xn(i)?this._addOffset({x:a,y:0}):this._addOffset({y:i,x:0}):this._addOffset({x:a,y:i}),this.props.onDragUpdate()}},e.prototype._virtualDrag=function(n,o){if(o){var i=-(n.y-o.y),a=-(n.x-o.x);this._draggingPoint={x:a+this._draggingPoint.x,y:i+this._draggingPoint.y}}},e.prototype._addOffset=function(n){var o=this._offset,i=o.x,a=o.y;this._offset={x:i+n.x,y:a+n.y}},e.prototype._sanitize=function(){this._zoomFactor=u?(n(1),i._stopAnimation(),l(),i._update()):(f=c(f),n(f),i._update({isAnimation:!0}),requestAnimationFrame(h))}};this._inAnimation=!0,requestAnimationFrame(h)},e.prototype._stopAnimation=function(){this._inAnimation=!1},e.prototype._end=function(){this._hasInteraction=!1,this._sanitize(),this._update()},e.prototype._getContainerRect=function(){var n=this._containerRef.current;return n.getBoundingClientRect()},e.prototype._getChildSize=function(){var n=this._containerRef.current;return qp(n==null?void 0:n.firstElementChild)},e.prototype._updateInitialZoomFactor=function(){var n=this._getContainerRect(),o=this._getChildSize(),i=n.width/o.width,a=n.height/o.height;this._initialZoomFactor=Np(i,a)},e.prototype._bindEvents=function(){var n=this,o=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(o)):window.addEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).addEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.addEventListener("load",n._onResize)})},e.prototype._unSubscribe=function(){var n=this,o=this._containerRef.current;this._containerObserver&&(this._containerObserver.disconnect(),this._containerObserver=null),window.removeEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||o).removeEventListener(a,s,!0)}),Array.from(o.querySelectorAll("img")).forEach(function(i){return i.removeEventListener("load",n._onResize)})},e.prototype._update=function(n){var o=this;if(!this._updatePlaned){var i=function(){var a=o._getInitialZoomFactor()*o._zoomFactor,s=-o._offset.x/a,c=-o._offset.y/a;o.props.onUpdate({scale:a,x:s,y:c})};if(n!=null&&n.isAnimation)return i();this._updatePlaned=!0,requestAnimationFrame(function(){o._updatePlaned=!1,i()})}},e.prototype._handlerIfEnable=function(n){var o=this;return function(){for(var i=[],a=0;ao?n-o:o-n},e.prototype._enoughToDrag=function(){return this._distanceBetweenNumbers(this._startOffset.x,this._draggingPoint.x)>5||this._distanceBetweenNumbers(this._startOffset.y,this._draggingPoint.y)>5},e.prototype._updateInteraction=function(n){var o=this._fingers;if(o===2)return this._setInteraction("zoom",n);if(o===1&&this._canDrag())return this._setInteraction("drag",n);this._setInteraction(null,n)},e.prototype._detectDoubleTap=function(n){var o=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),o-this._lastTouchStart<300?(fn(n),this._handleDoubleTap(n),hn(this._interaction)?this._handleZoomEnd():ze(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=o)},e.prototype.simulate=function(n){var o=this;return function(i){var a=i.pageX,s=i.pageY,c=i.type,l=c==="mouseup",u=c==="mousedown";u&&(i.preventDefault(),o._listenMouseMove=!0),o._listenMouseMove&&(i.touches=l?[]:[{pageX:a,pageY:s}],n(i)),l&&(o._listenMouseMove=!1)}},e.prototype.componentDidMount=function(){this._bindEvents(),this._update()},e.prototype.componentWillUnmount=function(){this._stopAnimation(),this._unSubscribe()},e.prototype.render=function(){var n=this.props,o=n.children,i=n.containerProps,a=Ua.only(o),s=i||{};return Un.createElement(Un.Fragment,null,Un.createElement("style",null,Mp),Un.createElement("div",$t({},s,{ref:this._containerRef,className:Ni(Js,s.className)}),es(a,{className:Ni(ta,a.props.className)})))},e.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:Pp,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:Se,onDragEnd:Se,onDragStart:Se,onDragUpdate:Se,onZoomEnd:Se,onZoomStart:Se,onZoomUpdate:Se,setOffsetsOnce:!1,shouldInterceptWheel:Zp,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:ea?null:window.document},e}(rs);if(0)var Av,kv,Cv,Sv,xv,Lv,Iv;function Xo(t){if(!t)return;let e=Math.floor(t/3600),n=Math.floor(t%3600/60),o=Math.round(t%60);return e===0?`${n}:${o.toString().padStart(2,"0")}`:`${e}:${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}const Xp=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Qp="ALT",Qo=t=>{const{_:e}=re(),{alt:n,lang:o,index:i,...a}=t;return!n||!n.trim()?null:r("button",{type:"button",class:"alt-badge clickable",...a,onClick:s=>{s.stopPropagation(),s.preventDefault(),U.showMediaAlt={alt:n,lang:o}},title:e({id:"5gfDMm"}),children:[Qp,!!i&&r("sup",{children:i})]})},Jp=140,tg=280,na=Lt(t=>t!=null&&t.length?t.length>Jp||/[\n\r].*[\n\r]/.test(t.trim()):!1);function eg({class:t="",media:e,to:n,lang:o,showOriginal:i,autoAnimate:a,showCaption:s,allowLongerCaption:c,altIndex:l,checkAspectRatio:u=!0,onClick:h=()=>{}}){let{blurhash:d,description:f,meta:m,previewRemoteUrl:p,previewUrl:g,remoteUrl:w,url:E,type:v}=e;/no\-preview\./i.test(g)&&(g=null);const{original:T={},small:S,focus:_}=m||{},y=i?T==null?void 0:T.width:(S==null?void 0:S.width)||(T==null?void 0:T.width),k=i?T==null?void 0:T.height:(S==null?void 0:S.height)||(T==null?void 0:T.height),A=i?E:g||E,D=i?w:p||w,P=y&&k,L=P?y>k?"landscape":"portrait":null,I=d?Mr(d):null,$=O();let z;if(_){const B=(_.x+1)/2*100,J=(1-_.y)/2*100;z=`${B.toFixed(0)}% ${J.toFixed(0)}%`}const W=O(),nt=xt(({x:B,y:J,scale:Z})=>{const{current:V}=W;if(V){const It=Op({x:B,y:J,scale:Z});Z===1?V.style.removeProperty("transform"):V.style.setProperty("transform",It),V.closest(".media-zoom").style.touchAction=Z<=1.01?"pan-x":""}},[]),[st,ot]=j(!1),ct={enabled:st,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:nt},[K,bt]=j(!1),lt=it(()=>n&&!K?B=>r(Ze,{to:n,...B}):"div",[n,K]),wt=D?Hi(D):null,N=v==="unknown"&&wt&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(wt.pathname),ft=v==="unknown"&&wt&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(wt.pathname),ut=v==="image"||v==="unknown"&&g&&!N&&!ft,At=g&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(Hi(g).pathname),Et=O(),[zt,Mt]=j(!1);Ie(()=>{if(!ut||!i||!Et.current)return;const{offsetWidth:B,offsetHeight:J}=Et.current,Z=y{const{children:J,...Z}=B;return r("figure",{...Z,children:[J,r("figcaption",{class:"media-caption",lang:o,dir:"auto",onClick:V=>{V.preventDefault(),V.stopPropagation(),U.showMediaAlt={alt:f,lang:o}},children:f})]})}:F,[Pt,dt]=j(void 0);if(ut)return ct.containerProps.style.display="inherit",Ie(()=>{Xp&&i&&(async()=>{try{await fetch(A,{mode:"no-cors"}),W.current.src=A}catch{}})()},[A]),r(Gt,{children:[r(lt,{ref:Et,class:`media media-image ${t}`,onClick:h,"data-orientation":L,"data-has-alt":!kt||void 0,"data-has-natural-aspect-ratio":Pt||void 0,style:i?{backgroundImage:`url(${g})`,backgroundSize:zt?`${y}px ${k}px`:void 0,...X}:Q,children:i?r(Vi,{...ct,children:r("img",{ref:W,src:A,alt:f,width:y,height:k,"data-orientation":L,loading:"eager",decoding:"sync",onLoad:B=>{B.target.closest(".media-image").style.backgroundImage="",B.target.closest(".media-zoom").style.display="",ot(!0)},onError:B=>{const{src:J}=B.target;J===A&&D&&A!==D&&(B.target.src=D)}})}):r(F,{children:[r("img",{src:A,alt:kt?"":f,width:y,height:k,"data-orientation":L,loading:"lazy",style:{objectPosition:z||"center","--anim-duration":`${Math.min(Math.max(Math.max(y,k)/100,5),120)}s`},onLoad:B=>{B.target.dataset.loaded=!0;const J=B.target.closest(".media");if(!P&&J){const{naturalWidth:Z,naturalHeight:V}=B.target;J.dataset.orientation=Z>V?"landscape":"portrait",J.style.setProperty("--width",`${Z}px`),J.style.setProperty("--height",`${V}px`),J.style.aspectRatio=`${Z}/${V}`}if(u&&J){const{clientWidth:Z,clientHeight:V,naturalWidth:It,naturalHeight:G}=B.target;if(Z&&V&&It&&G)if(It<88||G<88)J.dataset.hasSmallDimension=!0;else{const we=G*Z/It;Math.abs(we-V)<5&&dt(!0)}}},onError:B=>{const{src:J}=B.target;J===A&&A!==D?B.target.src=D:bt(!0)}}),!kt&&r(Qo,{alt:f,lang:o,index:l})]})}),K&&r("div",{children:r("a",{href:w,class:"button plain6 small",target:"_blank",children:[r(M,{icon:"external"})," ",r("span",{children:r(R,{id:"9npOH9"})})]})})]});if(v==="gifv"||v==="video"||N){const B=T.duration>0,J=T.duration<31,Z=v==="gifv"&&J,V=T.duration<61,It=Xo(T.duration),G=!i&&!a&&Z,Kt=!i&&a&&Z,we=T.duration>5,vt=` + + `,Qt=` + + `;return r(Gt,{children:r(lt,{class:`media ${t} media-${Z?"gif":"video"} ${Kt?"media-contain":""} ${G?"media-hover-animate":""}`,"data-orientation":L,"data-formatted-duration":i?void 0:It,"data-label":Z&&!i&&!Kt?"GIF":void 0,"data-has-alt":!kt||void 0,style:!i&&Q,onClick:Ot=>{if(G)try{$.current.pause()}catch{}h(Ot)},onMouseEnter:()=>{if(G)try{$.current.play()}catch{}},onMouseLeave:()=>{if(G)try{$.current.pause()}catch{}},onFocus:()=>{if(G)try{$.current.play()}catch{}},onBlur:()=>{if(G)try{$.current.pause()}catch{}},children:[i||Kt?Z&&i?r(Vi,{...ct,enabled:!0,children:r("div",{ref:W,dangerouslySetInnerHTML:{__html:vt}})}):Z?r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:vt}}):r("div",{class:"video-container",dangerouslySetInnerHTML:{__html:Qt}}):Z?r("video",{ref:$,src:E,poster:g,width:y,height:k,"data-orientation":L,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:we?Ot=>{const{target:pt}=Ot,Ct=pt==null?void 0:pt.closest(".media-gif");if(Ct){const jt=pt.currentTime/pt.duration*100;Ct.style.setProperty("--progress",`${jt}%`)}}:void 0}):r(F,{children:[g&&!At?r("img",{src:g,alt:kt?"":f,width:y,height:k,"data-orientation":L,loading:"lazy",decoding:"async",onLoad:Ot=>{if(!P){const pt=Ot.target.closest(".media");if(pt){const{naturalHeight:Ct,naturalWidth:jt}=Ot.target;pt.dataset.orientation=jt>Ct?"landscape":"portrait",pt.style.setProperty("--width",`${jt}px`),pt.style.setProperty("--height",`${Ct}px`),pt.style.aspectRatio=`${jt}/${Ct}`}}}}):r("video",{src:E+"#t=0.1",width:y,height:k,"data-orientation":L,preload:"metadata",muted:!0,disablePictureInPicture:!0,onLoadedMetadata:Ot=>{if(!B){const{duration:pt}=Ot.target;if(pt){const Ct=Xo(pt),jt=Ot.target.closest(".media-video");jt&&(jt.dataset.formattedDuration=Ct)}}}}),r("div",{class:"media-play",children:r(M,{icon:"play",size:"xl",alt:"▶"})})]}),!i&&!kt&&r(Qo,{alt:f,lang:o,index:l})]})})}else if(v==="audio"||ft){const B=Xo(T.duration);return r(Gt,{children:r(lt,{class:`media media-audio ${t}`,"data-formatted-duration":i?void 0:B,"data-has-alt":!kt||void 0,onClick:h,style:!i&&Q,children:[i?r("audio",{src:w||E,preload:"none",controls:!0,autoPlay:!0}):g?r("img",{src:g,alt:kt?"":f,width:y,height:k,"data-orientation":L,loading:"lazy",onError:J=>{var Z,V;try{(V=(Z=J.target)==null?void 0:Z.remove)==null||V.call(Z)}catch{}}}):null,!i&&r(F,{children:[r("div",{class:"media-play",children:r(M,{icon:"play",size:"xl",alt:"▶"})}),!kt&&r(Qo,{alt:f,lang:o,index:l})]})]})})}}function Hi(t){return URL.parse(t,location.origin)}const fr=Qe(eg,(t,e)=>{const n=t.media||{},o=e.media||{};return(n==null?void 0:n.id)===(o==null?void 0:o.id)&&n.url===o.url&&t.to===e.to&&t.class===e.class}),ng=280,og=140,rg=is({limit:1,interval:1e3});function ig(t,e){return e.v1.accounts.$select(t).fetch()}const sg=mo(rg(ig)),Le={public:{id:"7d1a0d"},local:{id:"d5zxa4"},unlisted:{id:"WDcQq9"},private:{id:"o34OrG"},direct:{id:"IV4QaU"}},ag=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),cg=new Intl.RelativeTimeFormat,Ui=80;function lg(t){var e;return(e=t==null?void 0:t.options)!=null&&e.length?`📊: +${t.options.map(n=>`- ${n.title}${n.votesCount>=0?` (${n.votesCount})`:""}`).join(` +`)}`:""}function Jo(t,e){const{maskCustomEmojis:n}=e||{},{spoilerText:o,poll:i,emojis:a}=t;let{content:s}=t;if(n&&(a!=null&&a.length)){const c=new RegExp(`:(${a.map(l=>l.shortcode).join("|")}):`,"g");s=s.replace(c,"⬚")}return(o?`${o} + +`:"")+vo(s)+lg(i)}function oa(t=[],e=document){for(const n of t)try{return e.querySelectorAll(n)}catch{}return[]}function ug(t,e){if(!t)return!1;if(e!=null&&e.length){const o=new RegExp(`:(${e.map(i=>i.shortcode).join("|")}):`,"g");t=t.replace(o,"")}return t=t.trim(),t?!!vo(t,{preProcess:o=>{for(const i of oa([".mention, pre, code, a:has(.invisible)",".mention, pre, code"],o))i.remove()}}):!1}function dg(t,e){if(e!=null&&e.length){const n=new RegExp(`:(${e.map(o=>o.shortcode).join("|")}):`,"g");t=t.replace(n,"")}return vo(t,{preProcess:n=>{for(const o of oa([".mention, .hashtag, pre, code, a:has(.invisible)",".mention, .hashtag, pre, code"],n))o.remove();for(const o of n.querySelectorAll("a")){const i=o.innerText.trim();(i.startsWith("https://")||i.startsWith("http://"))&&o.remove()}}})}const hg=/^http/i,Ki=({post:t,instance:e,previewMode:n})=>{const{content:o,emojis:i,language:a,mentions:s,url:c}=t,l=O();return Ie(()=>{if(!l.current)return;const u=Vs(o,{emojis:i,returnDOM:!0});for(const h of u.querySelectorAll('a.u-url[target="_blank"]'))hg.test(h.innerText.trim())||h.removeAttribute("target");l.current.replaceChildren(u.cloneNode(!0))},[o,i==null?void 0:i.length]),r("div",{ref:l,lang:a,dir:"auto",class:"inner-content",onClick:Pm({mentions:s,instance:e,previewMode:n,statusURL:c})})},fg={s:"small",m:"medium",l:"large"},mg=mo(async t=>{if(t=t==null?void 0:t.trim(),(t==null?void 0:t.length)>500)return null;if(je){const i=await je.detect(t);console.groupCollapsed("💬 DETECTLANG BROWSER",i.slice(0,3).map(s=>s.detectedLanguage)),console.groupEnd();const a=i[0];if(a!=null&&a.detectedLanguage&&(a==null?void 0:a.confidence)>.5)return a.detectedLanguage}const{detectAll:e}=await C(async()=>{const{detectAll:i}=await import("./tinyld-light-CT4H0yPw.js");return{detectAll:i}},[],import.meta.url),n=e(t);console.groupCollapsed("💬 DETECTLANG TINYLD",n.slice(0,3).map(i=>i.lang)),console.groupEnd();const o=n[0];return o!=null&&o.lang&&(o==null?void 0:o.accuracy)>.5?o.lang:null}),wn={id:"8fZueG"},mr={},ji=(t,e=[])=>{if(!t)return!1;const n=Ds(!0),o=t!==n&&!En([t],[n])&&!e.find(i=>t===i||En([t],[i]));return o&&(mr[t+e]=!0),o},ra=Lt(()=>Er(),{maxAge:60*1e3}),Wi=Lt(()=>os.account.get("preferences")||{},{maxAge:60*1e3});function Xe({statusID:t,status:e,instance:n,size:o="m",contentTextWeight:i,readOnly:a,enableCommentHint:s,withinContext:c,skeleton:l,enableTranslate:u,forceTranslate:h,previewMode:d,allowFilters:f,onMediaClick:m,quoted:p,onStatusLinkClick:g=()=>{},showFollowedTags:w,allowContextMenu:E,showActionsBar:v,showReplyParent:T,mediaFirst:S}){var ti,ei,ni,oi;const{_,_:y}=re();if(l)return r("div",{class:`status skeleton ${S?"status-media-first small":""}`,children:[!S&&r(ue,{size:"xxl"}),r("div",{class:"container",children:[r("div",{class:"meta",children:[(o==="s"||S)&&r(ue,{size:"m"})," ███ ████████"]}),r("div",{class:"content-container",children:[S&&r("div",{class:"media-first-container"}),r("div",{class:`content ${S?"media-first-content":""}`,children:r("p",{children:"████ ████████"})})]})]})]});const{masto:k,instance:A,authenticated:D}=so({instance:n}),{instance:P}=so(),L=A===P;let I=ce(t||(e==null?void 0:e.id),A);const $=xn(U);if(e||(e=$.statuses[I]||$.statuses[t],I=ce(e==null?void 0:e.id,A)),!e)return null;const{account:{acct:z,avatar:W,avatarStatic:nt,id:st,url:ot,displayName:ct,username:K,emojis:bt,bot:lt,group:wt}={},id:N,repliesCount:ft,reblogged:ut,reblogsCount:At,favourited:Et,favouritesCount:zt,bookmarked:Mt,poll:Rt,muted:Bt,sensitive:X,spoilerText:Q,visibility:mt,language:kt,editedAt:Gt,filtered:Pt,card:dt,createdAt:B,inReplyToId:J,inReplyToAccountId:Z,content:V,mentions:It,mediaAttachments:G,reblog:Kt,uri:we,url:vt,emojis:Qt,tags:Ot,pinned:pt,_deleted:Ct,_pinned:jt,emojiReactions:Me}=e,[Re,_o]=j(null);et(()=>{if(!V||kt||Re)return;let b;return b=setTimeout(async()=>{let x=await mg(dg(V,Qt));_o(x)},1e3),()=>clearTimeout(b)},[V,kt]);const _t=kt||Re,Pe=!!(G!=null&&G.length);S&&Pe&&(o="s");const Y=ra(),gt=it(()=>Y&&Y===st,[st,Y]),Wt=Nt(Qs),tt=!gt&&(!a&&!d||f)&&Rr(Pt,Wt);if((tt==null?void 0:tt.action)==="hide")return null;const ht=b=>{b.shiftKey};if((f||o!=="l")&&tt&&tt.action!=="blur")return r(Tg,{status:e,filterInfo:tt,instance:A,containerProps:{onMouseEnter:ht},showFollowedTags:!0,quoted:p});const Vt=new Date(B),In=new Date(Gt);let en=It==null?void 0:It.find(b=>b.id===Z);!en&&Z===N&&(en={url:ot,username:K,displayName:ct});const[ie,Dn]=j(en);if(!c&&!ie&&Z){const b=U.accounts[Z];b?Dn(b):sg(Z,k).then(x=>{Dn(x),U.accounts[x.id]=x}).catch(x=>{})}const Mn=Z===Y||(It==null?void 0:It.find(b=>b.id===Y)),Xt=it(()=>!!Wi()["reading:expand:spoilers"],[]),nn=it(()=>{var x;return((x=Wi()["reading:expand:media"])==null?void 0:x.toLowerCase())||"default"},[]),Yt=d||Xt||!!$.spoilers[N],Ee=d||nn==="show_all"&&(tt==null?void 0:tt.action)!=="blur"||!!$.spoilersMedia[N];if(Kt)return wt?r("div",{"data-state-post-id":I,class:"status-group",onMouseEnter:ht,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"group",size:"l",alt:y({id:"L8fEEm"})})," ",r(_e,{account:e.account,instance:A,showAvatar:!0})]}),r(Xe,{status:t?null:Kt,statusID:t?Kt.id:null,instance:A,size:o,contentTextWeight:i,readOnly:a,mediaFirst:S})]}):r("div",{"data-state-post-id":I,class:"status-reblog",onMouseEnter:ht,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"rocket",size:"l"})," ",r(R,{id:"DlhB4J",components:{0:r(_e,{account:e.account,instance:A,showAvatar:!0}),1:r("span",{})}})]}),r(Xe,{status:t?null:Kt,statusID:t?Kt.id:null,instance:A,size:o,contentTextWeight:i,readOnly:a,enableCommentHint:!0,mediaFirst:S})]});const Te=xt(({children:b})=>r("div",{"data-state-post-id":I,class:"status-followed-tags",onMouseEnter:ht,children:[r("div",{class:"status-pre-meta",children:[r(M,{icon:"hashtag",size:"l"})," ",$.statusFollowedTags[I].slice(0,3).map(x=>r(Ze,{to:A?`/${A}/t/${x}`:`/t/${x}`,class:"status-followed-tag-item",children:x},x))]}),b]}),[I,A,$.statusFollowedTags[I]]),on=w&&((ti=$.statusFollowedTags[I])!=null&&ti.length)?Te:F,rt=o==="l",[me,ga]=j(h),{contentTranslation:yo,contentTranslationAutoInline:Or}=$.settings;yo||(u=!1);const $r=it(()=>{if(!yo||!Or||a||c&&!rt||d||Q||X||Rt||dt||G!=null&&G.length)return!1;const b=Go(V);return b>0&&b<=og},[yo,Or,a,c,rt,d,Q,X,Rt,dt,G,V]),[bo,Rn]=j(!1),[va,wo]=j(!1),Fr=ro(),Nr=ro(),_a=ro(),Oe=O(null),Pn=y({id:"7jyUKe"}),zr=xt(()=>Math.max(Math.round((Q.length+Go(V))/140)||1,1),[Q,V]),Br=B&&kn(Vt),Vr=Gt&&kn(In);let rn=D&&mt!=="direct"&&mt!=="private";mt==="private"&>&&(rn=!0);const On=b=>{var x;if(!L||!D)return alert(Pn);(b!=null&&b.shiftKey||(x=b==null?void 0:b.syntheticEvent)!=null&&x.shiftKey)&&tl({replyToStatus:e})||jn({replyToStatus:e})},ya=it(()=>G.some(b=>{var x,q;return!((q=(x=b.description)==null?void 0:x.trim)!=null&&q.call(x))}),[G]),Hr=it(()=>Math.floor((new Date-Vt)/(1e3*60*60*24*30)),[Vt]),Eo=async()=>{if(!L||!D)return alert(Pn),!1;try{if(U.statuses[I]={...e,reblogged:!ut,reblogsCount:At+(ut?-1:1)},ut){const b=await k.v1.statuses.$select(N).unreblog();pe(b,A)}else{const b=await k.v1.statuses.$select(N).reblog();pe(b,A)}return!0}catch{return U.statuses[I]=e,!1}},Ur=async()=>{if(!L||!D)return alert(Pn),!1;try{if(U.statuses[I]={...e,favourited:!Et,favouritesCount:zt+(Et?-1:1)},Et){const b=await k.v1.statuses.$select(N).unfavourite();pe(b,A)}else{const b=await k.v1.statuses.$select(N).favourite();pe(b,A)}return!0}catch{return U.statuses[I]=e,!1}},To=async()=>{try{const b=await Ur();!rt&&b&&St(y(Et?{id:"sZvpIt",values:{0:K||z}}:{id:"yUngDO",values:{0:K||z}}))}catch{}},Kr=async()=>{if(qn("@mastodon/post-bookmark")){if(!L||!D)return alert(Pn),!1;try{if(U.statuses[I]={...e,bookmarked:!Mt},Mt){const b=await k.v1.statuses.$select(N).unbookmark();pe(b,A)}else{const b=await k.v1.statuses.$select(N).bookmark();pe(b,A)}return!0}catch{return U.statuses[I]=e,!1}}},jr=async()=>{try{const b=await Kr();!rt&&b&&St(y(Mt?{id:"lWQguj",values:{0:K||z}}:{id:"Fb2K8h",values:{0:K||z}}))}catch{}},sn=$.settings.contentTranslationHideLanguages||[],[Ae,Wr]=j(()=>mr[_t+sn]||ji(_t,sn));et(()=>{if(!_t||Ae)return;if(!Ae&&mr[_t+sn]){Wr(!0);return}let b=setTimeout(()=>{const x=ji(_t,sn);x&&Wr(x)},1);return()=>clearTimeout(b)},[_t,Ae,sn]);const Zr=O(),qr=O();async function ba(b){var at,Zt,$e,Ao;b&&(Zr.current=k.v1.statuses.$select(t).rebloggedBy.list({limit:Ui}),qr.current=k.v1.statuses.$select(t).favouritedBy.list({limit:Ui}));const[{value:x},{value:q}]=await Promise.allSettled([Zr.current.next(),qr.current.next()]);if((at=x.value)!=null&&at.length||(Zt=q.value)!=null&&Zt.length){const ke=[];return($e=x.value)!=null&&$e.length&&ke.push(...x.value.map(Ce=>(Ce._types=["reblog"],Ce))),(Ao=q.value)!=null&&Ao.length&&ke.push(...q.value.map(Ce=>(Ce._types=["favourite"],Ce))),{value:ke,done:x.done&&q.done}}return{value:[],done:!0}}const wa=O(),Gr=["public","unlisted"].includes(mt),Ea=["public","unlisted","private"].includes(mt),Yr=ya&&!ut?r("div",{class:"footer",children:[r(M,{icon:"alert"}),r(R,{id:"MB+wJL"})]}):Hr>=3&&r("div",{class:"footer",children:[r(M,{icon:"info"}),r("span",{children:r(R,{id:"dBme/4",values:{0:cg.format(-Hr,"month")},components:{0:r("strong",{})}})})]}),Xr=r(F,{children:[!rt&&L&&r(F,{children:r("div",{class:"menu-control-group-horizontal status-menu",children:[r(Tt,{onClick:On,children:[r(M,{icon:"comment"}),r("span",{children:ft>0?ae(ft):y({id:"ImOQa9"})})]}),r(Lo,{subMenu:!0,confirmLabel:r(F,{children:[r(M,{icon:"rocket"}),r("span",{children:y(ut?{id:"QzzGsY"}:{id:"kulphB"})})]}),className:`menu-reblog ${ut?"checked":""}`,menuExtras:r(Tt,{onClick:()=>{jn({draftStatus:{status:` +${vt}`}})},children:[r(M,{icon:"quote"}),r("span",{children:r(R,{id:"ZhhOwV"})})]}),menuFooter:Yr,disabled:!rn,onClick:async()=>{try{const b=await Eo();!rt&&b&&St(y(ut?{id:"bpDheH",values:{0:K||z}}:{id:"dbNZdP",values:{0:K||z}}))}catch{}},children:[r(M,{icon:"rocket"}),r("span",{children:At>0?ae(At):y(ut?{id:"QzzGsY"}:{id:"PiVIlD"})})]}),r(Tt,{onClick:To,className:`menu-favourite ${Et?"checked":""}`,children:[r(M,{icon:"heart"}),r("span",{children:zt>0?ae(zt):y(Et?{id:"OcUmcH"}:{id:"W9FRBT"})})]}),qn("@mastodon/post-bookmark")&&r(Tt,{onClick:jr,className:`menu-bookmark ${Mt?"checked":""}`,children:[r(M,{icon:"bookmark"}),r("span",{children:y(Mt?{id:"q8EQYI"}:{id:"PZlHt8"})})]})]})}),!rt&&L&&(rt||v)&&r(ln,{}),(rt||v)&&r(F,{children:r(Tt,{onClick:()=>{U.showGenericAccounts={heading:y({id:"+XOeb+"}),fetchAccounts:ba,instance:A,showReactions:!0,postID:I}},children:[r(M,{icon:"react"}),r("span",{children:r(R,{id:"+XOeb+"})})]})}),(rt||!S&&(u||!_t||Ae))&&r(ln,{}),!S&&(u||!_t||Ae)&&r("div",{class:hr?"menu-horizontal":"",children:[u?r(Tt,{disabled:me,onClick:()=>ga(!0),children:[r(M,{icon:"translate"}),r("span",{children:r(R,{id:"pi8x/S"})})]}):r(pi,{to:`${A?`/${A}`:""}/s/${N}?translate=1`,children:[r(M,{icon:"translate"}),r("span",{children:r(R,{id:"pi8x/S"})})]}),hr&&r(Tt,{onClick:()=>{try{const b=Jo(e);b&&Sp(b,_t)}catch{}},children:[r(M,{icon:"speak"}),r("span",{children:r(R,{id:"yIBLq8"})})]})]}),rt&&r(Tt,{onClick:()=>{try{const b=Jo(e);navigator.clipboard.writeText(b),St(y({id:"iSRQvy"}))}catch{St(y({id:"N1MyiN"}))}},children:[r(M,{icon:"clipboard"}),r("span",{children:r(R,{id:"iQgJaz"})})]}),(!rt&&L||u||!_t||Ae)&&r(ln,{}),!rt&&r(F,{children:r(pi,{to:A?`/${A}/s/${N}`:`/s/${N}`,onClick:b=>{g(b,e)},children:[r(M,{icon:"arrows-right"}),r("small",{children:[r(R,{id:"8MkSAW",values:{0:K||z},components:{0:r("span",{class:"bidi-isolate"})}}),r("br",{}),r("span",{class:"more-insignificant",children:[_(Le[mt])," • ",Br]})]})]})}),!!Gt&&r(F,{children:r(Tt,{onClick:()=>{Rn(N)},children:[r(M,{icon:"history"}),r("small",{children:[r(R,{id:"QL+7Jw"}),r("br",{}),r("span",{class:"more-insignificant",children:r(R,{id:"DuJJm9",values:{editedDateText:Vr}})})]})]})}),r(Tt,{href:vt,target:"_blank",children:[r(M,{icon:"external"}),r("small",{class:"menu-double-lines",style:{maxWidth:"16em"},children:wg(vt)})]}),r("div",{class:"menu-horizontal",children:[r(Tt,{onClick:()=>{try{navigator.clipboard.writeText(vt),St(y({id:"edWbV6"}))}catch{St(y({id:"W1ewR0"}))}},children:[r(M,{icon:"link"}),r("span",{children:r(R,{id:"he3ygx"})})]}),Gr&&(navigator==null?void 0:navigator.share)&&((ei=navigator==null?void 0:navigator.canShare)==null?void 0:ei.call(navigator,{url:vt}))&&r(Tt,{onClick:()=>{try{navigator.share({url:vt})}catch{alert(y({id:"TtG3Uh"}))}},children:[r(M,{icon:"share"}),r("span",{children:r(R,{id:"LFKLqp"})})]})]}),Gr&&rt&&r(Tt,{onClick:()=>{wo(!0)},children:[r(M,{icon:"code"}),r("span",{children:r(R,{id:"jdVwsS"})})]}),(gt||Mn)&&r(ln,{}),(gt||Mn)&&r(Tt,{onClick:async()=>{try{const b=await k.v1.statuses.$select(N)[Bt?"unmute":"mute"]();pe(b,A),St(y(Bt?{id:"Pm+5jw"}:{id:"ywB7JM"}))}catch{St(y(Bt?{id:"c6jxNY"}:{id:"8SN9kN"}))}},children:Bt?r(F,{children:[r(M,{icon:"unmute"}),r("span",{children:r(R,{id:"i51zUR"})})]}):r(F,{children:[r(M,{icon:"mute"}),r("span",{children:r(R,{id:"OiUYO5"})})]})}),gt&&Ea&&r(Tt,{onClick:async()=>{try{const b=await k.v1.statuses.$select(N)[pt?"unpin":"pin"]();pe(b,A),St(y(pt?{id:"Yx809+"}:{id:"S6P6E+"}))}catch{St(y(pt?{id:"A6cs15"}:{id:"vgUfWO"}))}},children:pt?r(F,{children:[r(M,{icon:"unpin"}),r("span",{children:r(R,{id:"XQMQZw"})})]}):r(F,{children:[r(M,{icon:"pin"}),r("span",{children:r(R,{id:"lfHLsx"})})]})}),gt&&r("div",{class:"menu-horizontal",children:[qn("@mastodon/post-edit")&&r(Tt,{onClick:()=>{jn({editStatus:e})},children:[r(M,{icon:"pencil"}),r("span",{children:r(R,{id:"ePK91l"})})]}),rt&&r(Lo,{subMenu:!0,confirmLabel:r(F,{children:[r(M,{icon:"trash"}),r("span",{children:r(R,{id:"FbPNuJ"})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{await k.v1.statuses.$select(N).remove();const b=as(N,A);b._deleted=!0,St(y({id:"KiyvHV"}))}catch{St(y({id:"Yb6p2q"}))}})()},children:[r(M,{icon:"trash"}),r("span",{children:r(R,{id:"Jb6/SB"})})]})]}),!gt&&rt&&r(F,{children:[r(ln,{}),r(Tt,{className:"danger",onClick:()=>{U.showReportModal={account:e.account,post:e}},children:[r(M,{icon:"flag"}),r("span",{children:r(R,{id:"7PQAMY"})})]})]})]}),Qr=O(),[$n,an]=j(!1),[Fn,Nn]=j({}),zn=E||!rt&&!d&&!Ct&&!p,Ta=Ts(ag&&zn?b=>{var Zt;if(b.pointerType==="mouse")return;const{clientX:x,clientY:q}=((Zt=b.touches)==null?void 0:Zt[0])||b,at=b.target.closest("a");at&&Oe.current.contains(at)&&!at.getAttribute("href").startsWith("#")||(b.preventDefault(),Nn({anchorPoint:{x,y:q},direction:"right"}),an(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),Bn=!a&&!d&&!p,Aa=Ve("r, shift+r",On,{enabled:Bn,useKey:!0}),ka=Ve("f, l",To,{enabled:Bn,useKey:!0}),Ca=Ve("d",jr,{enabled:Bn,useKey:!0}),Sa=Ve("shift+b",b=>{b.shiftKey&&(async()=>{try{const x=await Eo();!rt&&x&&St(y(ut?{id:"bpDheH",values:{0:K||z}}:{id:"dbNZdP",values:{0:K||z}}))}catch{}})()},{enabled:Bn&&rn,useKey:!0}),xa=Ve("x",b=>{const x=document.activeElement.closest(".status-link, .status-focus");if(x){const q=x.querySelector(".spoiler-button:not(.spoiling)");if(q)b.stopPropagation(),q.click();else{const at=x.querySelector(".spoiler-media-button:not(.spoiling)");at&&(b.stopPropagation(),at.click())}}},{useKey:!0}),Vn=G.slice(0,rt?void 0:4),Hn=G.length>1&&Vn.some(b=>!!b.description&&!na(b.description)),La=it(()=>{if(!Hn)return null;const b=[];return Vn.forEach((x,q)=>{if(!x.description)return;const at=b.findIndex(Zt=>Zt.media.description===x.description);at===-1?b.push({media:x,indices:[q]}):b[at].indices.push(q)}),b.map(({media:x,indices:q})=>r("div",{"data-caption-index":q.map(at=>at+1).join(" "),onClick:at=>{at.preventDefault(),at.stopPropagation(),U.showMediaAlt={alt:x.description,lang:_t}},title:x.description,children:[r("sup",{children:q.map(at=>at+1).join(" ")})," ",x.description]},x.id))},[Hn,Vn,_t]),cn=it(()=>{var b;return!!J&&Z===((b=e.account)==null?void 0:b.id)||!!$.statusThreadNumber[I]},[J,Z,(ni=e.account)==null?void 0:ni.id,$.statusThreadNumber[I]]),Ia=it(()=>s&&!cn&&!c&&!J&&mt==="public"&&ft>0,[s,cn,c,J,ft,mt]),Jr=it(()=>{if(dt||Rt||X||Q||G!=null&&G.length||cn||c||J||ft<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(V))return!1;const q=Go(V);if(q>0&&q<=ng)return!0},[dt,Rt,X,Q,G,Kt,cn,c,J,ft,V]);return r(on,{children:[T&&!!(J&&Z)&&r(Eg,{sKey:I}),r("article",{"data-state-post-id":I,ref:b=>{var q;Oe.current=b;const x=((q=b==null?void 0:b.closest)==null?void 0:q.call(b,".timeline-item, .timeline-item-alt, .status-link, .status-focus"))||b;Aa.current=x,ka.current=x,Ca.current=x,Sa.current=x,xa.current=x},tabindex:"-1",class:`status ${!c&&J&&ie?"status-reply-to":""} visibility-${mt} ${jt?"status-pinned":""} ${fg[o]} ${Ct?"status-deleted":""} ${p?"status-card":""} ${$n?"status-menu-open":""} ${S&&Pe?"status-media-first":""}`,onMouseEnter:ht,onContextMenu:b=>{var at,Zt;if(!zn||b.metaKey)return;const x=b.target.closest("a");if(x&&Oe.current.contains(x)&&!x.getAttribute("href").startsWith("#"))return;const q=(at=window.getSelection)==null?void 0:at.call(window);if(q.toString().length>0){const{anchorNode:$e}=q;if((Zt=Oe.current)!=null&&Zt.contains($e))return}b.preventDefault(),Nn({anchorPoint:{x:b.clientX,y:b.clientY},direction:"right"}),an(!0)},...zn?Ta():{},children:[zn&&r(gs,{ref:Qr,state:$n?"open":void 0,...Fn,onClose:b=>{var x,q,at;an(!1),(b==null?void 0:b.reason)==="click"&&((at=(q=(x=Oe.current)==null?void 0:x.closest("[tabindex]"))==null?void 0:q.focus)==null||at.call(q))},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{var b,x;(x=(b=Qr.current)==null?void 0:b.closeMenu)==null||x.call(b)}},overflow:"auto",boundingBoxPadding:Cs(),unmountOnClose:!0,children:Xr}),v&&o!=="l"&&!d&&!a&&!Ct&&!p&&r("div",{class:`status-actions ${$n==="actions-bar"?"open":""}`,ref:wa,children:[r(Be,{size:"s",title:y({id:"ImOQa9"}),alt:y({id:"ImOQa9"}),class:"reply-button",icon:"comment",iconSize:"m",onClick:On}),r(Be,{size:"s",checked:Et,title:[y({id:"W9FRBT"}),y({id:"OcUmcH"})],alt:[y({id:"W9FRBT"}),y({id:"8ab1sR"})],class:"favourite-button",icon:"heart",iconSize:"m",count:zt,onClick:To}),r("button",{type:"button",title:y({id:"2FYpfJ"}),class:"plain more-button",onClick:b=>{b.preventDefault(),b.stopPropagation(),Nn({anchorRef:{current:b.currentTarget},align:"start",direction:"left",gap:0,shift:-8}),an("actions-bar")},children:r(M,{icon:"more2",size:"m",alt:y({id:"2FYpfJ"})})})]}),o!=="l"&&r("div",{class:"status-badge",children:[ut&&r(M,{class:"reblog",icon:"rocket",size:"s",alt:y({id:"b7T5Zj"})}),Et&&r(M,{class:"favourite",icon:"heart",size:"s",alt:y({id:"8ab1sR"})}),Mt&&r(M,{class:"bookmark",icon:"bookmark",size:"s",alt:y({id:"1C/9Sa"})}),jt&&r(M,{class:"pin",icon:"pin",size:"s",alt:y({id:"kNiQp6"})})]}),o!=="s"&&r("a",{href:ot,tabindex:"-1",title:`@${z}`,onClick:b=>{b.preventDefault(),b.stopPropagation(),U.showAccount={account:e.account,instance:A}},children:r(ue,{url:nt||W,size:"xxl",squircle:lt})}),r("div",{class:"container",children:[!!(e.account||B)&&r("div",{class:"meta",children:[r("span",{class:"meta-name",children:r(_e,{account:e.account,instance:A,showAvatar:o==="s",showAcct:rt})})," ",o!=="l"&&(Ct?r("span",{class:"status-deleted-tag",children:r(R,{id:"vGjmyl"})}):vt&&!d&&!a&&!p?r(Ze,{to:A?`/${A}/s/${N}`:`/s/${N}`,onClick:b=>{b.metaKey||b.ctrlKey||b.shiftKey||b.altKey||b.which===2||(b.preventDefault(),b.stopPropagation(),g==null||g(b,e),Nn({anchorRef:{current:b.currentTarget},align:"end",direction:"bottom",gap:4}),an(!0))},class:`time ${$n&&(Fn!=null&&Fn.anchorRef)?"is-open":""}`,children:[Ia&&!Jr?r(M,{icon:"comment2",size:"s",alt:Dt._({id:"RXmXDR",values:{repliesCount:ft}})}):mt!=="public"&&mt!=="direct"&&r(M,{icon:bn[mt],alt:_(Le[mt]),size:"s"})," ",r(le,{datetime:Vt,format:"micro"}),!d&&!a&&r(M,{icon:"more2",class:"more",alt:y({id:"2FYpfJ"})})]}):r("span",{class:"time",children:[mt!=="public"&&mt!=="direct"&&r(F,{children:[r(M,{icon:bn[mt],alt:_(Le[mt]),size:"s"})," "]}),r(le,{datetime:Vt,format:"micro"})]}))]}),mt==="direct"&&r(F,{children:[r("div",{class:"status-direct-badge",children:r(R,{id:"IV4QaU"})})," "]}),!c&&r(F,{children:cn?r("div",{class:"status-thread-badge",children:[r(M,{icon:"thread",size:"s"}),r(R,{id:"lQ8zCz",values:{0:$.statusThreadNumber[I]?` ${$.statusThreadNumber[I]}/X`:""}})]}):!!J&&!!ie&&(!!Q||!It.find(b=>b.id===Z))&&r("div",{class:"status-reply-badge",children:[r(M,{icon:"reply"})," ",r(_e,{account:ie,instance:A,short:!0})]})}),r("div",{class:`content-container ${Q||X||(tt==null?void 0:tt.action)==="blur"?"has-spoiler":""} ${Yt?"show-spoiler":""} ${Ee?"show-media":""}`,"data-content-text-weight":i?zr():null,style:(rt||i)&&{"--content-text-weight":zr()},children:S&&Pe?r(F,{children:[(!!Q||!!X)&&!Xt&&r(F,{children:[!!Q&&r("span",{class:"spoiler-content media-first-spoiler-content",lang:_t,dir:"auto",ref:Fr,"data-read-more":_(wn),children:[r(Ye,{text:Q,emojis:Qt})," "]}),r("button",{class:`light spoiler-button media-first-spoiler-button ${Yt?"spoiling":""}`,type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),Yt?(delete U.spoilers[N],Xt||delete U.spoilersMedia[N]):(U.spoilers[N]=!0,Xt||(U.spoilersMedia[N]=!0))},children:[r(M,{icon:Yt?"eye-open":"eye-close"})," ",y(Yt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),r(gg,{mediaAttachments:G,language:_t,postID:N,instance:A}),!!V&&r("div",{class:"media-first-content content",ref:Nr,children:r(Ki,{post:e,instance:A,previewMode:d})})]}):r(F,{children:[!!Q&&r(F,{children:[r("div",{class:"content spoiler-content",lang:_t,dir:"auto",ref:Fr,"data-read-more":_(wn),children:r("p",{children:r(Ye,{text:Q,emojis:Qt})})}),Xt||d?r("div",{class:"spoiler-divider",children:[r(M,{icon:"eye-open"})," ",r(R,{id:"gnKo7f"})]}):r("button",{class:`light spoiler-button ${Yt?"spoiling":""}`,type:"button",onClick:b=>{b.preventDefault(),b.stopPropagation(),Yt?(delete U.spoilers[N],Xt||delete U.spoilersMedia[N]):(U.spoilers[N]=!0,Xt||(U.spoilersMedia[N]=!0))},children:[r(M,{icon:Yt?"eye-open":"eye-close"})," ",y(Yt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),!!V&&r("div",{class:"content",ref:Nr,"data-read-more":_(wn),inert:Q&&!Yt?!0:void 0,children:[r(Ki,{post:e,instance:A,previewMode:d}),r(Ag,{id:N,instance:A,level:p})]}),!!Rt&&r(Ap,{lang:_t,poll:Rt,readOnly:a||!L||!D,onUpdate:b=>{U.statuses[I].poll=b},refresh:()=>k.v1.polls.$select(Rt.id).fetch().then(b=>{U.statuses[I].poll=b}).catch(b=>{}),votePoll:b=>k.v1.polls.$select(Rt.id).votes.create({choices:b}).then(x=>{U.statuses[I].poll=x}).catch(x=>{})}),((u||$r)&&ug(V,Qt)&&Ae||me)&&r(ap,{forceTranslate:me||$r,mini:!rt&&!c,sourceLanguage:_t,autoDetected:Re,text:Jo(e,{maskCustomEmojis:!0})}),!d&&(X||(tt==null?void 0:tt.action)==="blur")&&!!G.length&&(nn!=="show_all"||(tt==null?void 0:tt.action)==="blur")&&r("button",{class:`plain spoiler-media-button ${Ee?"spoiling":""}`,type:"button",hidden:!Xt&&!!Q,onClick:b=>{b.preventDefault(),b.stopPropagation(),Ee?delete U.spoilersMedia[N]:U.spoilersMedia[N]=!0},children:[r(M,{icon:Ee?"eye-open":"eye-close"})," ",r("span",{children:[(tt==null?void 0:tt.action)==="blur"&&r("small",{children:[r(R,{id:"suKjh3",values:{0:tt==null?void 0:tt.titlesStr}}),r("br",{})]}),y(Ee?{id:"6lGV3K"}:{id:"9ZCilh"})]})]}),!!G.length&&(G.length>1&&(rt||c&&o==="m")?r("div",{class:"media-large-container",children:G.map((b,x)=>r("div",{class:"media-container media-eq1",children:r(fr,{media:b,autoAnimate:!0,showCaption:!0,allowLongerCaption:!V,lang:_t,to:`/${A}/s/${N}?${c?"media":"media-only"}=${x+1}`,onClick:m?q=>m(q,x,b,e):void 0})},b.id))}):r(pg,{lang:_t,enabled:Hn,captionChildren:La,children:r("div",{ref:_a,class:`media-container media-eq${G.length} ${G.length>2?"media-gt2":""} ${G.length>4?"media-gt4":""}`,children:Vn.map((b,x)=>r(fr,{media:b,autoAnimate:rt,showCaption:G.length===1,allowLongerCaption:!V&&G.length===1,lang:_t,altIndex:Hn&&!!b.description&&x+1,to:`/${A}/s/${N}?${c?"media":"media-only"}=${x+1}`,onClick:m?q=>{m(q,x,b,e)}:void 0,checkAspectRatio:G.length===1},b.id))})})),!!dt&&/^https/i.test(dt==null?void 0:dt.url)&&!X&&!Q&&!Rt&&!G.length&&!$.statusQuotes[I]&&r(_g,{card:dt,selfReferential:(dt==null?void 0:dt.url)===e.url||(dt==null?void 0:dt.url)===e.uri,selfAuthor:(oi=dt==null?void 0:dt.authors)==null?void 0:oi.some(b=>{var x;return((x=b.account)==null?void 0:x.url)===ot}),instance:P})]})}),!rt&&Jr&&r("div",{class:"content-comment-hint insignificant",children:[r(M,{icon:"comment2",alt:y({id:"N8UzTV"})})," ",ft]}),rt&&r(F,{children:[r("div",{class:"extra-meta",children:Ct?r("span",{class:"status-deleted-tag",children:r(R,{id:"vGjmyl"})}):r(F,{children:[r("span",{children:_(Le[mt])})," •"," ",r("a",{href:vt,target:"_blank",rel:"noopener",children:[new Date().getTime()-Vt.getTime()<864e5&&r(F,{children:[r(le,{datetime:Vt,format:"micro"})," ","‒"," "]}),!!B&&r("time",{class:"created",datetime:Vt.toISOString(),title:Vt.toLocaleString(),children:Br})]}),Gt&&r(F,{children:[" ","• ",r(M,{icon:"pencil",alt:y({id:"MRZxAn"})})," ",r("time",{tabIndex:"0",class:"edited",datetime:In.toISOString(),onClick:()=>{Rn(N)},children:Vr})]})]})}),!!(Me!=null&&Me.length)&&r("div",{class:"emoji-reactions",children:Me.map(b=>{const{name:x,count:q,me:at,url:Zt,staticUrl:$e}=b;if(Zt)return r("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[r(lr,{alt:x,url:Zt,staticUrl:$e})," ",q]});if(/^:.+?:$/.test(x)){const ke=Qt.find(Ce=>Ce.shortcode===x.replace(/^:/,"").replace(/:$/,""));if(ke)return r("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[r(lr,{alt:x,url:ke.url,staticUrl:ke.staticUrl})," ",q]})}return r("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[x," ",q]})})}),r("div",{class:`actions ${Ct?"disabled":""}`,children:[r("div",{class:"action has-count",children:r(Be,{title:y({id:"ImOQa9"}),alt:y({id:"VbyRUy"}),class:"reply-button",icon:"comment",count:ft,onClick:On})}),r("div",{class:"action has-count",children:r(Lo,{disabled:!rn,onClick:Eo,confirmLabel:r(F,{children:[r(M,{icon:"rocket"}),r("span",{children:y(ut?{id:"QzzGsY"}:{id:"kulphB"})})]}),menuExtras:r(Tt,{onClick:()=>{jn({draftStatus:{status:` +${vt}`}})},children:[r(M,{icon:"quote"}),r("span",{children:r(R,{id:"ZhhOwV"})})]}),menuFooter:Yr,children:r(Be,{checked:ut,title:[y({id:"kulphB"}),y({id:"QzzGsY"})],alt:[y({id:"kulphB"}),y({id:"b7T5Zj"})],class:"reblog-button",icon:"rocket",count:At,disabled:!rn})})}),r("div",{class:"action has-count",children:r(Be,{checked:Et,title:[y({id:"W9FRBT"}),y({id:"OcUmcH"})],alt:[y({id:"W9FRBT"}),y({id:"8ab1sR"})],class:"favourite-button",icon:"heart",count:zt,onClick:Ur})}),qn("@mastodon/post-bookmark")&&r("div",{class:"action",children:r(Be,{checked:Mt,title:[y({id:"PZlHt8"}),y({id:"q8EQYI"})],alt:[y({id:"PZlHt8"}),y({id:"1C/9Sa"})],class:"bookmark-button",icon:"bookmark",onClick:Kr})}),r(Ls,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:r("div",{class:"action",children:r("button",{type:"button",title:y({id:"2FYpfJ"}),class:"plain more-button",children:r(M,{icon:"more",size:"l",alt:y({id:"2FYpfJ"})})})}),children:[Xr," "]})]})]})]}),!!bo&&r(sr,{onClick:b=>{b.target===b.currentTarget&&Rn(!1)},children:r(yg,{statusID:bo,instance:A,fetchStatusHistory:()=>k.v1.statuses.$select(bo).history.list(),onClose:()=>{var b;Rn(!1),(b=Oe.current)==null||b.focus()}})}),!!va&&r(sr,{onClick:b=>{b.target===b.currentTarget&&wo(!1)},children:r(bg,{post:e,instance:A,onClose:()=>{wo(!1)}})})]})]})}function pg(t){const{enabled:e,children:n,lang:o,captionChildren:i}=t;return!e||!i?n:r("figure",{class:"media-figure-multiple",children:[n,r("figcaption",{lang:o,dir:"auto",children:i})]})}function gg(t){const{mediaAttachments:e,language:n,postID:o,instance:i}=t,a=e.length>1,s=O(),[c,l]=j(0);return et(()=>{let u=()=>{const{clientWidth:h,scrollLeft:d}=s.current,f=Math.round(Math.abs(d)/h);l(f)};return s.current&&s.current.addEventListener("scroll",u,{passive:!0}),()=>{s.current&&s.current.removeEventListener("scroll",u)}},[]),r(F,{children:[r("div",{class:"media-first-container",children:[r("div",{class:"media-first-carousel",ref:s,children:e.map((u,h)=>r("div",{class:"media-first-item",children:r(fr,{media:u,lang:n,to:`/${i}/s/${o}?media=${h+1}`})},u.id))}),a&&r("div",{class:"media-carousel-controls",children:[r("div",{class:"carousel-indexer",children:[c+1,"/",e.length]}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===0,onClick:u=>{u.preventDefault(),u.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c-1)*(cr()?-1:1),behavior:"smooth"})},children:r(M,{icon:"arrow-left"})})}),r("label",{class:"media-carousel-button",children:r("button",{type:"button",class:"carousel-button",hidden:c===e.length-1,onClick:u=>{u.preventDefault(),u.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c+1)*(cr()?-1:1),behavior:"smooth"})},children:r(M,{icon:"arrow-right"})})})]})]}),a&&r("div",{class:"media-carousel-dots",style:{"--dots-count":e.length},children:e.map((u,h)=>r("span",{class:`carousel-dot ${h===c?"active":""}`},u.id))})]})}function Zi(t){return["x.com","twitter.com","threads.net","bsky.app"].includes(t)}function vg({authors:t,hidden:e,children:n}){var i,a;if(e||!((a=(i=t==null?void 0:t[0])==null?void 0:i.account)!=null&&a.id))return n;const o=t[0].account;return r("div",{class:"card-byline",children:[n,r("div",{class:"card-byline-author",children:[r(M,{icon:"link",size:"s"})," ",r("small",{children:r(R,{id:"4LHHK6",components:{0:r(_e,{account:o,showAvatar:!0})}})})]})]})}function _g({card:t,selfReferential:e,selfAuthor:n,instance:o}){var nt;const i=xn(U),{blurhash:a,title:s,description:c,html:l,providerName:u,providerUrl:h,authorName:d,authorUrl:f,width:m,height:p,image:g,imageDescription:w,url:E,type:v,embedUrl:T,language:S,publishedAt:_,authors:y}=t,k=s||u||d,D=m/p>=1.2?"large":"",[P,L]=j(null);if(et(()=>{k&&g&&!e&&Ka(E)&&ja(o,E).then(st=>{if(!st)return;const{id:ot,url:ct}=st;L("#"+ct)})},[k,g,e]),i.unfurledLinks[E])return null;const I=/`;\n }\n addIframe(isIntersectionObserver = false) {\n if (!this.isIframeLoaded) {\n const iframeHTML = this.generateIframe(isIntersectionObserver);\n this.domRefFrame.insertAdjacentHTML('beforeend', iframeHTML);\n this.domRefFrame.classList.add('activated');\n this.isIframeLoaded = true;\n this.attemptShortAutoPlay();\n this.dispatchEvent(new CustomEvent('liteYoutubeIframeLoaded', {\n detail: {\n videoId: this.videoId,\n },\n bubbles: true,\n cancelable: true,\n }));\n }\n }\n initImagePlaceholder() {\n this.testPosterImage();\n this.domRefImg.fallback.setAttribute('aria-label', `${this.videoPlay}: ${this.videoTitle}`);\n this.domRefImg?.fallback?.setAttribute('alt', `${this.videoPlay}: ${this.videoTitle}`);\n }\n async testPosterImage() {\n setTimeout(() => {\n const webpUrl = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n const img = new Image();\n img.fetchPriority = 'low';\n img.referrerPolicy = 'origin';\n img.src = webpUrl;\n img.onload = async (e) => {\n const target = e.target;\n const noPoster = target?.naturalHeight == 90 && target?.naturalWidth == 120;\n if (noPoster) {\n this.posterQuality = 'hqdefault';\n }\n const posterUrlWebp = `https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;\n this.domRefImg.webp.srcset = posterUrlWebp;\n const posterUrlJpeg = `https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;\n this.domRefImg.fallback.loading = this.posterLoading;\n this.domRefImg.jpeg.srcset = posterUrlJpeg;\n this.domRefImg.fallback.src = posterUrlJpeg;\n this.domRefImg.fallback.loading = this.posterLoading;\n };\n }, 100);\n }\n initIntersectionObserver() {\n const options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n };\n const observer = new IntersectionObserver((entries, observer) => {\n entries.forEach(entry => {\n if (entry.isIntersecting && !this.isIframeLoaded) {\n LiteYTEmbed.warmConnections(this);\n this.addIframe(true);\n observer.unobserve(this);\n }\n });\n }, options);\n observer.observe(this);\n if (this.autoPause) {\n const windowPause = new IntersectionObserver((e, o) => {\n e.forEach(entry => {\n if (entry.intersectionRatio !== 1) {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}', '*');\n }\n });\n }, { threshold: 1 });\n windowPause.observe(this);\n }\n }\n attemptShortAutoPlay() {\n if (this.isYouTubeShort()) {\n setTimeout(() => {\n this.shadowRoot\n .querySelector('iframe')\n ?.contentWindow?.postMessage('{\"event\":\"command\",\"func\":\"' + 'playVideo' + '\",\"args\":\"\"}', '*');\n }, 2000);\n }\n }\n isYouTubeShort() {\n return (this.getAttribute('short') === '' &&\n window.matchMedia('(max-width: 40em)').matches);\n }\n static addPrefetch(kind, url) {\n const linkElem = document.createElement('link');\n linkElem.rel = kind;\n linkElem.href = url;\n linkElem.crossOrigin = 'true';\n document.head.append(linkElem);\n }\n static warmConnections(context) {\n if (LiteYTEmbed.isPreconnected || window.liteYouTubeIsPreconnected)\n return;\n LiteYTEmbed.addPrefetch('preconnect', 'https://i.ytimg.com/');\n LiteYTEmbed.addPrefetch('preconnect', 'https://s.ytimg.com');\n if (!context.noCookie) {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.google.com');\n LiteYTEmbed.addPrefetch('preconnect', 'https://googleads.g.doubleclick.net');\n LiteYTEmbed.addPrefetch('preconnect', 'https://static.doubleclick.net');\n }\n else {\n LiteYTEmbed.addPrefetch('preconnect', 'https://www.youtube-nocookie.com');\n }\n LiteYTEmbed.isPreconnected = true;\n window.liteYouTubeIsPreconnected = true;\n }\n}\nLiteYTEmbed.isPreconnected = false;\ncustomElements.define('lite-youtube', LiteYTEmbed);\n//# sourceMappingURL=lite-youtube.js.map","const digitLookup = new Uint8Array(128);\nfor (let i = 0; i < 83; i++) {\n digitLookup[\n '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~'.charCodeAt(\n i,\n )\n ] = i;\n}\nconst decode83 = (str, start, end) => {\n let value = 0;\n while (start < end) {\n value *= 83;\n value += digitLookup[str.charCodeAt(start++)];\n }\n return value;\n};\n\nconst pow = Math.pow;\nconst PI = Math.PI;\nconst PI2 = PI * 2;\n\nconst d = 3294.6;\nconst e = 269.025;\nconst sRGBToLinear = (value) =>\n value > 10.31475 ? pow(value / e + 0.052132, 2.4) : value / d;\n\nconst linearTosRGB = (v) =>\n ~~(v > 0.00001227 ? e * pow(v, 0.416666) - 13.025 : v * d + 1);\n\nconst signSqr = (x) => (x < 0 ? -1 : 1) * x * x;\n\n/**\n * Fast approximate cosine implementation\n * Based on FTrig https://github.com/netcell/FTrig\n */\nconst fastCos = (x) => {\n x += PI / 2;\n while (x > PI) {\n x -= PI2;\n }\n const cos = 1.27323954 * x - 0.405284735 * signSqr(x);\n return 0.225 * (signSqr(cos) - cos) + cos;\n};\n\n/**\n * Extracts average color from BlurHash image\n * @param {string} blurHash BlurHash image string\n * @returns {[number, number, number]}\n */\nexport function getBlurHashAverageColor(blurHash) {\n const val = decode83(blurHash, 2, 6);\n return [val >> 16, (val >> 8) & 255, val & 255];\n}\n\n/**\n * Decodes BlurHash image\n * @param {string} blurHash BlurHash image string\n * @param {number} width Output image width\n * @param {number} height Output image height\n * @param {?number} punch\n * @returns {Uint8ClampedArray}\n */\nexport function decodeBlurHash(blurHash, width, height, punch) {\n const sizeFlag = decode83(blurHash, 0, 1);\n const numX = (sizeFlag % 9) + 1;\n const numY = ~~(sizeFlag / 9) + 1;\n const size = numX * numY;\n\n let i = 0,\n j = 0,\n x = 0,\n y = 0,\n r = 0,\n g = 0,\n b = 0,\n basis = 0,\n basisY = 0,\n colorIndex = 0,\n pixelIndex = 0,\n value = 0;\n\n const maximumValue = ((decode83(blurHash, 1, 2) + 1) / 13446) * (punch | 1);\n\n const colors = new Float64Array(size * 3);\n\n const averageColor = getBlurHashAverageColor(blurHash);\n for (i = 0; i < 3; i++) {\n colors[i] = sRGBToLinear(averageColor[i]);\n }\n\n for (i = 1; i < size; i++) {\n value = decode83(blurHash, 4 + i * 2, 6 + i * 2);\n colors[i * 3] = signSqr(~~(value / 361) - 9) * maximumValue;\n colors[i * 3 + 1] = signSqr((~~(value / 19) % 19) - 9) * maximumValue;\n colors[i * 3 + 2] = signSqr((value % 19) - 9) * maximumValue;\n }\n\n const cosinesY = new Float64Array(numY * height);\n const cosinesX = new Float64Array(numX * width);\n for (j = 0; j < numY; j++) {\n for (y = 0; y < height; y++) {\n cosinesY[j * height + y] = fastCos((PI * y * j) / height);\n }\n }\n for (i = 0; i < numX; i++) {\n for (x = 0; x < width; x++) {\n cosinesX[i * width + x] = fastCos((PI * x * i) / width);\n }\n }\n\n const bytesPerRow = width * 4;\n const pixels = new Uint8ClampedArray(bytesPerRow * height);\n\n for (y = 0; y < height; y++) {\n for (x = 0; x < width; x++) {\n r = g = b = 0;\n for (j = 0; j < numY; j++) {\n basisY = cosinesY[j * height + y];\n for (i = 0; i < numX; i++) {\n basis = cosinesX[i * width + x] * basisY;\n colorIndex = (i + j * numX) * 3;\n r += colors[colorIndex] * basis;\n g += colors[colorIndex + 1] * basis;\n b += colors[colorIndex + 2] * basis;\n }\n }\n\n pixelIndex = 4 * x + y * bytesPerRow;\n pixels[pixelIndex] = linearTosRGB(r);\n pixels[pixelIndex + 1] = linearTosRGB(g);\n pixels[pixelIndex + 2] = linearTosRGB(b);\n pixels[pixelIndex + 3] = 255; // alpha\n }\n }\n return pixels;\n}\n","/**\n * @param {string[]} splittedHtml\n * @param {{ char?: string; count?: number}} options\n * @returns {string}\n */\nconst addIndentation = (splittedHtml, options = {}) => {\n const char = options.char || ' '\n const count = options.count || 2\n\n let level = 0\n const opened = []\n\n return splittedHtml.reverse().reduce((indented, elTag) => {\n if (opened.length\n && level\n && opened[level]\n /* if current element tag is the same as previously opened one */\n && opened[level] === elTag.substring(1, opened[level].length + 1)\n ) {\n opened.splice(level, 1)\n level--\n }\n\n const indentation = char.repeat(level ? level * count : 0)\n\n const newIndented = [\n `${indentation}${elTag}`,\n ...indented,\n ]\n\n // if current element tag is closing tag\n // add it to opened elements\n if (elTag.substring(0, 2) === ' (\n // Replace\n // - 1 or more spaces or tabs at the start of line\n // - 1 or more spaces or tabs at the end of line\n // - empty lines\n // with empty string\n nonFormattedString.trim().replace(/(^(\\s|\\t)+|(( |\\t)+)$)/gm, '')\n)\n\n/**\n * @param {string} markup\n * @returns {string[]} Array of strings splitted on new lines without empty lines\n */\nconst mergeAttributesWithElements = (markup) => {\n const splittedMarkup = removeEmptyLines(markup).split('\\n')\n\n const mergedLines = []\n let currentElement = ''\n for (let i = 0; i < splittedMarkup.length; i += 1) {\n const line = splittedMarkup[i]\n\n // If line is closing element/tag separate closing tag from rest of the line with space\n if (line.endsWith('/>')) {\n mergedLines.push(`${currentElement}${line.slice(0, -2)} />`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n if (line.endsWith('>')) {\n mergedLines.push(`${currentElement}${\n line.startsWith('>') || line.startsWith('<') ? '' : ' '\n }${line}`)\n currentElement = ''\n // eslint-disable-next-line no-continue\n continue\n }\n\n currentElement += currentElement.length ? ` ${line}` : line\n }\n\n return mergedLines\n}\n\nmodule.exports = {\n mergeAttributesWithElements,\n removeEmptyLines,\n}\n","const addIndentation = require('./utils/addIndentation')\nconst { mergeAttributesWithElements } = require('./utils/toLines')\n\n/**\n * @param {string} markup\n * @param {{ char?: string; count?: number }} options\n * @returns {string}\n */\nconst prettify = (markup, options = {}) => {\n const splitted = mergeAttributesWithElements(markup)\n\n return addIndentation(splitted, options)\n}\n\nmodule.exports = prettify\n","import { i18n } from '@lingui/core';\nimport { plural } from '@lingui/core/macro';\nimport { Plural, Trans, useLingui } from '@lingui/react/macro';\nimport { useState } from 'preact/hooks';\n\nimport shortenNumber from '../utils/shorten-number';\n\nimport EmojiText from './emoji-text';\nimport Icon from './icon';\nimport RelativeTime from './relative-time';\n\nexport default function Poll({\n poll,\n lang,\n readOnly,\n refresh = () => {},\n votePoll = () => {},\n}) {\n const { t } = useLingui();\n const [uiState, setUIState] = useState('default');\n const {\n expired,\n expiresAt,\n id,\n multiple,\n options,\n ownVotes,\n voted,\n votersCount,\n votesCount = 0,\n emojis,\n } = poll;\n const expiresAtDate = !!expiresAt && new Date(expiresAt); // Update poll at point of expiry\n // NOTE: Disable this because setTimeout runs immediately if delay is too large\n // https://stackoverflow.com/a/56718027/20838\n // useEffect(() => {\n // let timeout;\n // if (!expired && expiresAtDate) {\n // const ms = expiresAtDate.getTime() - Date.now() + 1; // +1 to give it a little buffer\n // if (ms > 0) {\n // timeout = setTimeout(() => {\n // setUIState('loading');\n // (async () => {\n // // await refresh();\n // setUIState('default');\n // })();\n // }, ms);\n // }\n // }\n // return () => {\n // clearTimeout(timeout);\n // };\n // }, [expired, expiresAtDate]);\n\n const pollVotesCount = multiple ? votersCount : votesCount;\n let roundPrecision = 0;\n\n if (pollVotesCount <= 1000) {\n roundPrecision = 0;\n } else if (pollVotesCount <= 10000) {\n roundPrecision = 1;\n } else if (pollVotesCount <= 100000) {\n roundPrecision = 2;\n }\n\n const [showResults, setShowResults] = useState(false);\n const optionsHaveVoteCounts = options.every((o) => o.votesCount !== null);\n\n return (\n \n {(showResults && optionsHaveVoteCounts) || voted || expired ? (\n <>\n
\n {options.map((option, i) => {\n const { title, votesCount: optionVotesCount } = option;\n const ratio = pollVotesCount\n ? optionVotesCount / pollVotesCount\n : 0;\n const percentage = ratio\n ? ratio.toLocaleString(i18n.locale || undefined, {\n style: 'percent',\n maximumFractionDigits: roundPrecision,\n })\n : '0%';\n\n const isLeading =\n optionVotesCount > 0 &&\n optionVotesCount ===\n Math.max(...options.map((o) => o.votesCount));\n return (\n \n
\n \n \n \n {voted && ownVotes.includes(i) && (\n <>\n {' '}\n \n \n )}\n
\n \n {percentage}\n
\n \n );\n })}\n \n {!expired && !voted && (\n {\n e.preventDefault();\n setShowResults(false);\n }}\n >\n Hide results\n \n )}\n \n ) : (\n {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const choices = [];\n formData.forEach((value, key) => {\n if (key === 'poll') {\n choices.push(value);\n }\n });\n if (!choices.length) return;\n setUIState('loading');\n await votePoll(choices);\n setUIState('default');\n }}\n >\n
\n {options.map((option, i) => {\n const { title } = option;\n return (\n
\n \n
\n );\n })}\n
\n {!readOnly && (\n \n Vote\n \n )}\n \n )}\n

\n {!expired && !readOnly && (\n {\n e.preventDefault();\n setUIState('loading');\n\n (async () => {\n await refresh();\n setUIState('default');\n })();\n }}\n title={t`Refresh`}\n >\n \n \n )}\n {!voted && !expired && !readOnly && optionsHaveVoteCounts && (\n {\n e.preventDefault();\n setShowResults(!showResults);\n }}\n title={showResults ? t`Hide results` : t`Show results`}\n >\n {' '}\n \n )}\n {!expired && !readOnly && ' '}\n \n {shortenNumber(votesCount)} vote\n \n }\n other={\n \n {shortenNumber(votesCount)} votes\n \n }\n />\n {!!votersCount && votersCount !== votesCount && (\n <>\n {' '}\n •{' '}\n \n {shortenNumber(votersCount)}{' '}\n voter\n \n }\n other={\n \n {shortenNumber(votersCount)}{' '}\n voters\n \n }\n />\n \n )}{' '}\n •{' '}\n {expired ? (\n !!expiresAtDate ? (\n \n Ended \n \n ) : (\n t`Ended`\n )\n ) : !!expiresAtDate ? (\n \n Ending \n \n ) : (\n t`Ending`\n )}\n

\n \n );\n}\n","import { createContext } from 'preact';\n\nconst FilterContext = createContext();\nexport default FilterContext;\n","import mem from './mem';\nimport { getCurrentAccountID } from './store-utils';\n\nfunction _isFiltered(filtered, filterContext) {\n if (!filtered?.length) return false;\n const appliedFilters = filtered.filter((f) => {\n const { filter } = f;\n const hasContext = filter.context.includes(filterContext);\n if (!hasContext) return false;\n if (!filter.expiresAt) return hasContext;\n return new Date(filter.expiresAt) > new Date();\n });\n if (!appliedFilters.length) return false;\n const isHidden = appliedFilters.some((f) => f.filter.filterAction === 'hide');\n if (isHidden)\n return {\n action: 'hide',\n };\n const isBlur = appliedFilters.every((f) => f.filter.filterAction === 'blur');\n if (isBlur) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'blur',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n // const isWarn = appliedFilters.some((f) => f.filter.filterAction === 'warn');\n const isWarn = appliedFilters.some((f) => !!f.filter.filterAction);\n // Re: spec; unknown values for filter_action should be treated as warn.\n if (isWarn) {\n const filterTitles = appliedFilters.map((f) => f.filter.title);\n return {\n action: 'warn',\n titles: filterTitles,\n titlesStr: filterTitles.join(' • '),\n };\n }\n return false;\n}\nexport const isFiltered = mem(_isFiltered);\n\nexport function filteredItem(item, filterContext, currentAccountID) {\n const { filtered } = item;\n if (!filtered?.length) return true;\n const isSelf = currentAccountID && item.account?.id === currentAccountID;\n if (isSelf) return true;\n const filterState = isFiltered(filtered, filterContext);\n if (!filterState) return true;\n if (filterState.action === 'hide') return false;\n // item._filtered = filterState;\n return true;\n}\nexport function filteredItems(items, filterContext) {\n if (!items?.length) return [];\n if (!filterContext) return items;\n const currentAccountID = getCurrentAccountID();\n return items.filter((item) =>\n filteredItem(item, filterContext, currentAccountID),\n );\n}\n","import punycode from 'punycode/';\n\nexport default function getDomain(url) {\n try {\n return punycode.toUnicode(\n URL.parse(url)\n .hostname.replace(/^www\\./, '')\n .replace(/\\/$/, ''),\n );\n } catch (e) {\n return ''; // just give up\n }\n}\n","const div = document.createElement('div');\nexport default function htmlContentLength(html) {\n if (!html) return 0;\n div.innerHTML = html;\n // .invisible spans for links\n // e.g. https://mastodon.social\n div.querySelectorAll('.invisible').forEach((el) => {\n el.remove();\n });\n return div.innerText.length;\n}\n","export const supportsTTS = 'speechSynthesis' in window;\n\nexport function speak(text, lang) {\n if (!supportsTTS) return;\n try {\n if (speechSynthesis.speaking) {\n speechSynthesis.cancel();\n }\n const utterance = new SpeechSynthesisUtterance(text);\n if (lang) utterance.lang = lang;\n speechSynthesis.speak(utterance);\n } catch (e) {\n alert(e);\n }\n}\n","import{useRef as r,useEffect as n,useMemo as t,useState as e,useCallback as u}from\"react\";function c(e,u,c){var i=this,a=r(null),o=r(0),f=r(null),l=r([]),v=r(),m=r(),d=r(e),g=r(!0);d.current=e;var p=\"undefined\"!=typeof window,w=!u&&0!==u&&p;if(\"function\"!=typeof e)throw new TypeError(\"Expected a function\");u=+u||0;var s=!!(c=c||{}).leading,x=!(\"trailing\"in c)||!!c.trailing,h=\"maxWait\"in c,y=\"debounceOnServer\"in c&&!!c.debounceOnServer,F=h?Math.max(+c.maxWait||0,u):null;n(function(){return g.current=!0,function(){g.current=!1}},[]);var A=t(function(){var r=function(r){var n=l.current,t=v.current;return l.current=v.current=null,o.current=r,m.current=d.current.apply(t,n)},n=function(r,n){w&&cancelAnimationFrame(f.current),f.current=w?requestAnimationFrame(r):setTimeout(r,n)},t=function(r){if(!g.current)return!1;var n=r-a.current;return!a.current||n>=u||n<0||h&&r-o.current>=F},e=function(n){return f.current=null,x&&l.current?r(n):(l.current=v.current=null,m.current)},c=function r(){var c=Date.now();if(t(c))return e(c);if(g.current){var i=u-(c-a.current),f=h?Math.min(i,F-(c-o.current)):i;n(r,f)}},A=function(){if(p||y){var e=Date.now(),d=t(e);if(l.current=[].slice.call(arguments),v.current=i,a.current=e,d){if(!f.current&&g.current)return o.current=a.current,n(c,u),s?r(a.current):m.current;if(h)return n(c,u),r(a.current)}return f.current||n(c,u),m.current}};return A.cancel=function(){f.current&&(w?cancelAnimationFrame(f.current):clearTimeout(f.current)),o.current=0,l.current=a.current=v.current=f.current=null},A.isPending=function(){return!!f.current},A.flush=function(){return f.current?e(Date.now()):m.current},A},[s,h,u,F,x,w,p,y]);return A}function i(r,n){return r===n}function a(n,t,a){var o=a&&a.equalityFn||i,f=r(n),l=e({})[1],v=c(u(function(r){f.current=r,l({})},[l]),t,a),m=r(n);return o(m.current,n)||(v(n),m.current=n),[f.current,v]}function o(r,n,t){var e=void 0===t?{}:t,u=e.leading,i=e.trailing;return c(r,n,{maxWait:n,leading:void 0===u||u,trailing:void 0===i||i})}export{a as useDebounce,c as useDebouncedCallback,o as useThrottledCallback};\n//# sourceMappingURL=index.module.js.map\n","import { useRef, useEffect, useCallback, useState, useMemo } from 'react';\n\n// This could've been more streamlined with internal state instead of abusing\n// refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.\nfunction useResolvedElement(subscriber, refOrElement) {\n var lastReportRef = useRef(null);\n var refOrElementRef = useRef(null);\n refOrElementRef.current = refOrElement;\n var cbElementRef = useRef(null); // Calling re-evaluation after each render without using a dep array,\n // as the ref object's current value could've changed since the last render.\n\n useEffect(function () {\n evaluateSubscription();\n });\n var evaluateSubscription = useCallback(function () {\n var cbElement = cbElementRef.current;\n var refOrElement = refOrElementRef.current; // Ugly ternary. But smaller than an if-else block.\n\n var element = cbElement ? cbElement : refOrElement ? refOrElement instanceof Element ? refOrElement : refOrElement.current : null;\n\n if (lastReportRef.current && lastReportRef.current.element === element && lastReportRef.current.subscriber === subscriber) {\n return;\n }\n\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n }\n\n lastReportRef.current = {\n element: element,\n subscriber: subscriber,\n // Only calling the subscriber, if there's an actual element to report.\n // Setting cleanup to undefined unless a subscriber returns one, as an existing cleanup function would've been just called.\n cleanup: element ? subscriber(element) : undefined\n };\n }, [subscriber]); // making sure we call the cleanup function on unmount\n\n useEffect(function () {\n return function () {\n if (lastReportRef.current && lastReportRef.current.cleanup) {\n lastReportRef.current.cleanup();\n lastReportRef.current = null;\n }\n };\n }, []);\n return useCallback(function (element) {\n cbElementRef.current = element;\n evaluateSubscription();\n }, [evaluateSubscription]);\n}\n\n// We're only using the first element of the size sequences, until future versions of the spec solidify on how\n// exactly it'll be used for fragments in multi-column scenarios:\n// From the spec:\n// > The box size properties are exposed as FrozenArray in order to support elements that have multiple fragments,\n// > which occur in multi-column scenarios. However the current definitions of content rect and border box do not\n// > mention how those boxes are affected by multi-column layout. In this spec, there will only be a single\n// > ResizeObserverSize returned in the FrozenArray, which will correspond to the dimensions of the first column.\n// > A future version of this spec will extend the returned FrozenArray to contain the per-fragment size information.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-entry-interface)\n//\n// Also, testing these new box options revealed that in both Chrome and FF everything is returned in the callback,\n// regardless of the \"box\" option.\n// The spec states the following on this:\n// > This does not have any impact on which box dimensions are returned to the defined callback when the event\n// > is fired, it solely defines which box the author wishes to observe layout changes on.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// I'm not exactly clear on what this means, especially when you consider a later section stating the following:\n// > This section is non-normative. An author may desire to observe more than one CSS box.\n// > In this case, author will need to use multiple ResizeObservers.\n// (https://drafts.csswg.org/resize-observer/#resize-observer-interface)\n// Which is clearly not how current browser implementations behave, and seems to contradict the previous quote.\n// For this reason I decided to only return the requested size,\n// even though it seems we have access to results for all box types.\n// This also means that we get to keep the current api, being able to return a simple { width, height } pair,\n// regardless of box option.\nfunction extractSize(entry, boxProp, sizeType) {\n if (!entry[boxProp]) {\n if (boxProp === \"contentBoxSize\") {\n // The dimensions in `contentBoxSize` and `contentRect` are equivalent according to the spec.\n // See the 6th step in the description for the RO algorithm:\n // https://drafts.csswg.org/resize-observer/#create-and-populate-resizeobserverentry-h\n // > Set this.contentRect to logical this.contentBoxSize given target and observedBox of \"content-box\".\n // In real browser implementations of course these objects differ, but the width/height values should be equivalent.\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n\n return undefined;\n } // A couple bytes smaller than calling Array.isArray() and just as effective here.\n\n\n return entry[boxProp][0] ? entry[boxProp][0][sizeType] : // TS complains about this, because the RO entry type follows the spec and does not reflect Firefox's current\n // behaviour of returning objects instead of arrays for `borderBoxSize` and `contentBoxSize`.\n // @ts-ignore\n entry[boxProp][sizeType];\n}\n\nfunction useResizeObserver(opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n // Saving the callback as a ref. With this, I don't need to put onResize in the\n // effect dep array, and just passing in an anonymous function without memoising\n // will not reinstantiate the hook's ResizeObserver.\n var onResize = opts.onResize;\n var onResizeRef = useRef(undefined);\n onResizeRef.current = onResize;\n var round = opts.round || Math.round; // Using a single instance throughout the hook's lifetime\n\n var resizeObserverRef = useRef();\n\n var _useState = useState({\n width: undefined,\n height: undefined\n }),\n size = _useState[0],\n setSize = _useState[1]; // In certain edge cases the RO might want to report a size change just after\n // the component unmounted.\n\n\n var didUnmount = useRef(false);\n useEffect(function () {\n didUnmount.current = false;\n return function () {\n didUnmount.current = true;\n };\n }, []); // Using a ref to track the previous width / height to avoid unnecessary renders.\n\n var previous = useRef({\n width: undefined,\n height: undefined\n }); // This block is kinda like a useEffect, only it's called whenever a new\n // element could be resolved based on the ref option. It also has a cleanup\n // function.\n\n var refCallback = useResolvedElement(useCallback(function (element) {\n // We only use a single Resize Observer instance, and we're instantiating it on demand, only once there's something to observe.\n // This instance is also recreated when the `box` option changes, so that a new observation is fired if there was a previously observed element with a different box option.\n if (!resizeObserverRef.current || resizeObserverRef.current.box !== opts.box || resizeObserverRef.current.round !== round) {\n resizeObserverRef.current = {\n box: opts.box,\n round: round,\n instance: new ResizeObserver(function (entries) {\n var entry = entries[0];\n var boxProp = opts.box === \"border-box\" ? \"borderBoxSize\" : opts.box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n var reportedWidth = extractSize(entry, boxProp, \"inlineSize\");\n var reportedHeight = extractSize(entry, boxProp, \"blockSize\");\n var newWidth = reportedWidth ? round(reportedWidth) : undefined;\n var newHeight = reportedHeight ? round(reportedHeight) : undefined;\n\n if (previous.current.width !== newWidth || previous.current.height !== newHeight) {\n var newSize = {\n width: newWidth,\n height: newHeight\n };\n previous.current.width = newWidth;\n previous.current.height = newHeight;\n\n if (onResizeRef.current) {\n onResizeRef.current(newSize);\n } else {\n if (!didUnmount.current) {\n setSize(newSize);\n }\n }\n }\n })\n };\n }\n\n resizeObserverRef.current.instance.observe(element, {\n box: opts.box\n });\n return function () {\n if (resizeObserverRef.current) {\n resizeObserverRef.current.instance.unobserve(element);\n }\n };\n }, [opts.box, round]), opts.ref);\n return useMemo(function () {\n return {\n ref: refCallback,\n width: size.width,\n height: size.height\n };\n }, [refCallback, size.width, size.height]);\n}\n\nexport { useResizeObserver as default };\n","import { useRef } from 'preact/hooks';\nimport { useThrottledCallback } from 'use-debounce';\nimport useResizeObserver from 'use-resize-observer';\n\nexport default function useTruncated({ className = 'truncated' } = {}) {\n const ref = useRef();\n const onResize = useThrottledCallback(({ height }) => {\n if (ref.current) {\n const { scrollHeight } = ref.current;\n let truncated = scrollHeight > height;\n if (truncated) {\n const { height: _height, maxHeight } = getComputedStyle(ref.current);\n const computedHeight = parseInt(maxHeight || _height, 10);\n truncated = scrollHeight > computedHeight;\n }\n ref.current.classList.toggle(className, truncated);\n }\n }, 300);\n useResizeObserver({\n ref,\n box: 'border-box',\n onResize,\n });\n return ref;\n}\n","export default {\n public: 'earth',\n unlisted: 'group',\n private: 'lock',\n direct: 'message',\n local: 'building',\n};\n","export var styleRoot = 'kvfysmfp';\nexport var styleChild = 'ufhsfnkm';\nexport var styles = \".\".concat(styleRoot, \"{overflow:hidden;touch-action:none}.\").concat(styleChild, \"{transform-origin: 0 0}\");\n","var isSsr = typeof window === 'undefined';\nexport var isTouch = function () {\n return !isSsr && ('ontouchstart' in window || navigator.maxTouchPoints > 0);\n};\nexport var make2dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale(\".concat(scale, \") translate(\").concat(x, \"px, \").concat(y, \"px)\");\n};\nexport var make3dTransformValue = function (_a) {\n var x = _a.x, y = _a.y, scale = _a.scale;\n return \"scale3d(\".concat(scale, \",\").concat(scale, \", 1) translate3d(\").concat(x, \"px, \").concat(y, \"px, 0)\");\n};\nexport var hasTranslate3DSupport = function () {\n var css = !isSsr && window.CSS;\n return css && css.supports && css.supports('transform', 'translate3d(0,0,0)');\n};\n","var min = Math.min, max = Math.max;\nexport function getOffsetBounds(_a) {\n var containerDimension = _a.containerDimension, childDimension = _a.childDimension, padding = _a.padding, centerContained = _a.centerContained;\n var diff = childDimension - containerDimension;\n if (diff + 2 * padding <= 0 && centerContained) {\n return [diff / 2, diff / 2];\n }\n else {\n return [min(diff + padding, 0) - padding, max(0, diff + padding)];\n }\n}\n","import { __assign, __extends } from \"tslib\";\nimport React, { Component, createRef, Children, cloneElement } from 'react';\nimport { styleRoot, styleChild, styles } from './styles.css';\nimport { isTouch } from '../utils';\nimport { getOffsetBounds } from './getOffsetBounds';\nvar classnames = function (base, other) {\n return other ? \"\".concat(base, \" \").concat(other) : base;\n};\nvar abs = Math.abs, min = Math.min, sqrt = Math.sqrt;\nvar isSsr = typeof window === 'undefined';\nvar isMac = isSsr ? false : /(Mac)/i.test(navigator.platform);\nvar isDragInteraction = function (i) { return i === 'drag'; };\nvar isZoomInteraction = function (i) { return i === 'zoom'; };\nvar isZoomGesture = function (wheelEvent) { return isMac && wheelEvent.ctrlKey; };\nvar cancelEvent = function (event) {\n event.stopPropagation();\n event.preventDefault();\n};\nvar getDistance = function (a, b) {\n var x = a.x - b.x;\n var y = a.y - b.y;\n return sqrt(x * x + y * y);\n};\nvar calculateScale = function (startTouches, endTouches) {\n var startDistance = getDistance(startTouches[0], startTouches[1]);\n var endDistance = getDistance(endTouches[0], endTouches[1]);\n return endDistance / startDistance;\n};\nvar isCloseTo = function (value, expected) {\n return value > expected - 0.01 && value < expected + 0.01;\n};\nvar swing = function (p) { return -Math.cos(p * Math.PI) / 2 + 0.5; };\nvar getPointByPageCoordinates = function (touch) { return ({\n x: touch.pageX,\n y: touch.pageY,\n}); };\nvar getPageCoordinatesByTouches = function (touches) {\n return Array.from(touches).map(getPointByPageCoordinates);\n};\nvar sum = function (a, b) { return a + b; };\nvar getVectorAvg = function (vectors) { return ({\n x: vectors.map(function (_a) {\n var x = _a.x;\n return x;\n }).reduce(sum, 0) / vectors.length,\n y: vectors.map(function (_a) {\n var y = _a.y;\n return y;\n }).reduce(sum, 0) / vectors.length,\n}); };\nvar clamp = function (min, max, value) {\n return value < min ? min : value > max ? max : value;\n};\nvar shouldInterceptWheel = function (event) {\n return !(event.ctrlKey || event.metaKey);\n};\nvar getElementSize = function (element) {\n if (element) {\n var offsetWidth = element.offsetWidth, offsetHeight = element.offsetHeight;\n // Any DOMElement\n if (offsetWidth && offsetHeight) {\n return { width: offsetWidth, height: offsetHeight };\n }\n // Svg support\n var style = getComputedStyle(element);\n var width = parseFloat(style.width);\n var height = parseFloat(style.height);\n if (height && width) {\n return { width: width, height: height };\n }\n }\n return { width: 0, height: 0 };\n};\nvar calculateVelocity = function (startPoint, endPoint) { return ({\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y,\n}); };\nvar comparePoints = function (p1, p2) { return p1.x === p2.x && p1.y === p2.y; };\nvar noup = function () { };\nvar zeroPoint = { x: 0, y: 0 };\nvar PinchZoom = /** @class */ (function (_super) {\n __extends(PinchZoom, _super);\n function PinchZoom() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this._prevDragMovePoint = null;\n _this._containerObserver = null;\n _this._fingers = 0;\n _this._firstMove = true;\n _this._initialOffset = __assign({}, zeroPoint);\n _this._interaction = null;\n _this._isDoubleTap = false;\n _this._isOffsetsSet = false;\n _this._lastDragPosition = null;\n _this._lastScale = 1;\n _this._lastTouchStart = 0;\n _this._lastZoomCenter = null;\n _this._listenMouseMove = false;\n _this._nthZoom = 0;\n _this._offset = __assign({}, zeroPoint);\n _this._startOffset = __assign({}, zeroPoint);\n _this._startTouches = null;\n _this._updatePlaned = false;\n _this._wheelTimeOut = null;\n _this._zoomFactor = 1;\n _this._initialZoomFactor = 1;\n _this._draggingPoint = __assign({}, zeroPoint);\n // It help reduce behavior difference between touch and mouse events\n _this._ignoreNextClick = false;\n // @ts-ignore\n _this._containerRef = createRef();\n _this._handleClick = function (clickEvent) {\n if (_this._ignoreNextClick) {\n _this._ignoreNextClick = false;\n clickEvent.stopPropagation();\n }\n };\n _this._onResize = function () {\n var _a;\n if ((_a = _this._containerRef) === null || _a === void 0 ? void 0 : _a.current) {\n _this._updateInitialZoomFactor();\n _this._setupOffsets();\n _this._update();\n }\n };\n _this._handlerOnTouchEnd = _this._handlerIfEnable(function (touchEndEvent) {\n _this._fingers = touchEndEvent.touches.length;\n if (_this.props.shouldCancelHandledTouchEndEvents &&\n (isZoomInteraction(_this._interaction) ||\n (isDragInteraction(_this._interaction) &&\n (_this._startOffset.x !== _this._offset.x ||\n _this._startOffset.y !== _this._offset.y)))) {\n cancelEvent(touchEndEvent);\n }\n if (isDragInteraction(_this._interaction) && !_this._enoughToDrag()) {\n _this._handleClick(touchEndEvent);\n }\n _this._updateInteraction(touchEndEvent);\n });\n _this._handlerOnTouchStart = _this._handlerIfEnable(function (touchStartEvent) {\n _this._firstMove = true;\n _this._fingers = touchStartEvent.touches.length;\n _this._detectDoubleTap(touchStartEvent);\n });\n _this._handlerOnTouchMove = _this._handlerIfEnable(function (touchMoveEvent) {\n if (_this._isDoubleTap) {\n return;\n }\n _this._collectInertia(touchMoveEvent);\n if (_this._firstMove) {\n _this._updateInteraction(touchMoveEvent);\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n }\n _this._startOffset = __assign({}, _this._offset);\n _this._startTouches = getPageCoordinatesByTouches(touchMoveEvent.touches);\n }\n else {\n if (isZoomInteraction(_this._interaction)) {\n if (_this._startTouches &&\n _this._startTouches.length === 2 &&\n touchMoveEvent.touches.length === 2) {\n _this._handleZoom(touchMoveEvent, calculateScale(_this._startTouches, getPageCoordinatesByTouches(touchMoveEvent.touches)));\n }\n }\n else if (isDragInteraction(_this._interaction)) {\n _this._handleDrag(touchMoveEvent);\n }\n if (_this._interaction) {\n cancelEvent(touchMoveEvent);\n _this._update();\n }\n }\n _this._firstMove = false;\n });\n _this._handlerWheel = function (wheelEvent) {\n if (_this.props.shouldInterceptWheel(wheelEvent)) {\n return;\n }\n cancelEvent(wheelEvent);\n var pageX = wheelEvent.pageX, pageY = wheelEvent.pageY, deltaY = wheelEvent.deltaY, deltaMode = wheelEvent.deltaMode;\n var scaleDelta = 1;\n if (isZoomGesture(wheelEvent) || deltaMode === 1) {\n scaleDelta = 15;\n }\n var likeTouchEvent = {\n touches: [\n // @ts-ignore\n { pageX: pageX, pageY: pageY },\n ],\n };\n var center = _this._getOffsetByFirstTouch(likeTouchEvent);\n var dScale = deltaY * scaleDelta;\n _this._stopAnimation();\n _this._scaleTo(_this._zoomFactor - dScale / _this.props.wheelScaleFactor, center);\n _this._update();\n clearTimeout(\n // @ts-ignore\n _this._wheelTimeOut);\n _this._wheelTimeOut = setTimeout(function () { return _this._sanitize(); }, 100);\n };\n // @ts-ignore\n _this._handlers = _this.props.isTouch()\n ? [\n ['touchstart', _this._handlerOnTouchStart],\n ['touchend', _this._handlerOnTouchEnd],\n ['touchmove', _this._handlerOnTouchMove],\n ]\n : [\n [\n 'mousemove',\n _this.simulate(_this._handlerOnTouchMove),\n _this.props._document,\n ],\n [\n 'mouseup',\n _this.simulate(_this._handlerOnTouchEnd),\n _this.props._document,\n ],\n ['mousedown', _this.simulate(_this._handlerOnTouchStart)],\n ['click', _this._handleClick],\n ['wheel', _this._handlerWheel],\n ];\n return _this;\n }\n PinchZoom.prototype._handleDragStart = function (event) {\n this._ignoreNextClick = true;\n this.props.onDragStart();\n this._stopAnimation();\n this._resetInertia();\n this._lastDragPosition = null;\n this._hasInteraction = true;\n this._draggingPoint = this._offset;\n this._handleDrag(event);\n };\n PinchZoom.prototype._handleDrag = function (event) {\n var touch = this._getOffsetByFirstTouch(event);\n if (this._enoughToDrag()) {\n this._drag(touch, this._lastDragPosition);\n }\n else {\n this._virtualDrag(touch, this._lastDragPosition);\n }\n this._offset = this._sanitizeOffset(this._offset);\n this._lastDragPosition = touch;\n };\n PinchZoom.prototype._resetInertia = function () {\n this._velocity = null;\n this._prevDragMovePoint = null;\n };\n PinchZoom.prototype._realizeInertia = function () {\n var _this = this;\n var _a = this.props, inertiaFriction = _a.inertiaFriction, inertia = _a.inertia;\n if (!inertia || !this._velocity) {\n return;\n }\n var _b = this._velocity, x = _b.x, y = _b.y;\n if (x || y) {\n this._stopAnimation();\n this._resetInertia();\n var renderFrame = function () {\n x *= inertiaFriction;\n y *= inertiaFriction;\n if (!x && !y) {\n return _this._stopAnimation();\n }\n var prevOffset = __assign({}, _this._offset);\n _this._addOffset({ x: x, y: y });\n _this._offset = _this._sanitizeOffset(_this._offset);\n if (comparePoints(prevOffset, _this._offset)) {\n return _this._stopAnimation();\n }\n _this._update({ isAnimation: true });\n };\n this._animate(renderFrame, { duration: 9999 });\n }\n };\n PinchZoom.prototype._collectInertia = function (_a) {\n var touches = _a.touches;\n if (!this.props.inertia) {\n return;\n }\n var currentCoordinates = getPageCoordinatesByTouches(touches)[0];\n var prevPoint = this._prevDragMovePoint;\n if (prevPoint) {\n this._velocity = calculateVelocity(currentCoordinates, prevPoint);\n }\n this._prevDragMovePoint = currentCoordinates;\n };\n PinchZoom.prototype._handleDragEnd = function () {\n this.props.onDragEnd();\n this._end();\n this._realizeInertia();\n };\n PinchZoom.prototype._handleZoomStart = function () {\n this.props.onZoomStart();\n this._stopAnimation();\n this._lastScale = 1;\n this._nthZoom = 0;\n this._lastZoomCenter = null;\n this._hasInteraction = true;\n };\n PinchZoom.prototype._handleZoom = function (event, newScale) {\n var touchCenter = getVectorAvg(this._getOffsetTouches(event));\n var scale = newScale / this._lastScale;\n this._lastScale = newScale;\n // The first touch events are thrown away since they are not precise\n this._nthZoom += 1;\n if (this._nthZoom > 3) {\n this._scale(scale, touchCenter);\n this._drag(touchCenter, this._lastZoomCenter);\n if (this.props.enforceBoundsDuringZoom) {\n this._offset = this._sanitizeOffset(this._offset);\n }\n }\n this._lastZoomCenter = touchCenter;\n };\n PinchZoom.prototype._handleZoomEnd = function () {\n this.props.onZoomEnd();\n this._end();\n };\n PinchZoom.prototype._handleDoubleTap = function (event) {\n var _this = this;\n if (this._hasInteraction || this.props.tapZoomFactor === 0) {\n return;\n }\n var needZoomOut = (this.props.doubleTapZoomOutOnMaxScale &&\n this._zoomFactor === this.props.maxZoom) ||\n (this.props.doubleTapToggleZoom && this._zoomFactor > 1);\n this.props.onDoubleTap();\n this._ignoreNextClick = true;\n var zoomFactor = this._zoomFactor + this.props.tapZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var updateProgress = function (progress) {\n _this._scaleTo(startZoomFactor + progress * (zoomFactor - startZoomFactor), center);\n };\n var center = this._getOffsetByFirstTouch(event);\n this._isDoubleTap = true;\n if (startZoomFactor > zoomFactor) {\n center = this._getCurrentZoomCenter();\n }\n needZoomOut ? this._zoomOutAnimation() : this._animate(updateProgress);\n };\n PinchZoom.prototype._computeInitialOffset = function () {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var x = -abs(width * this._getInitialZoomFactor() - rect.width) / 2;\n var y = -abs(height * this._getInitialZoomFactor() - rect.height) / 2;\n this._initialOffset = { x: x, y: y };\n };\n PinchZoom.prototype._resetOffset = function () {\n this._offset = __assign({}, this._initialOffset);\n };\n PinchZoom.prototype._setupOffsets = function () {\n if (this.props.setOffsetsOnce && this._isOffsetsSet) {\n return;\n }\n this._isOffsetsSet = true;\n this._computeInitialOffset();\n this._resetOffset();\n };\n PinchZoom.prototype._sanitizeOffset = function (offset) {\n var rect = this._getContainerRect();\n var _a = this._getChildSize(), width = _a.width, height = _a.height;\n var elWidth = width * this._getInitialZoomFactor() * this._zoomFactor;\n var elHeight = height * this._getInitialZoomFactor() * this._zoomFactor;\n var _b = getOffsetBounds({\n containerDimension: rect.width,\n childDimension: elWidth,\n padding: this.props.horizontalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetX = _b[0], maxOffsetX = _b[1];\n var _c = getOffsetBounds({\n containerDimension: rect.height,\n childDimension: elHeight,\n padding: this.props.verticalPadding,\n centerContained: this.props.centerContained,\n }), minOffsetY = _c[0], maxOffsetY = _c[1];\n return {\n x: clamp(minOffsetX, maxOffsetX, offset.x),\n y: clamp(minOffsetY, maxOffsetY, offset.y),\n };\n };\n PinchZoom.prototype.alignCenter = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), __x = _a.x, __y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n // Bug-Fix: https://github.com/retyui/react-quick-pinch-zoom/issues/58\n var x = __x * this._initialZoomFactor;\n var y = __y * this._initialZoomFactor;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n var rect = this._getContainerRect();\n var containerCenter = { x: rect.width / 2, y: rect.height / 2 };\n this._zoomFactor = 1;\n this._offset = { x: -(containerCenter.x - x), y: -(containerCenter.y - y) };\n this._scaleTo(scale, containerCenter);\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = _this._sanitizeOffset({ x: x, y: y });\n _this._update();\n };\n this._animate(updateFrame, {\n callback: function () { return _this._sanitize(); },\n duration: duration,\n });\n };\n PinchZoom.prototype.scaleTo = function (options) {\n var _this = this;\n var _a = __assign({ duration: 250, animated: true }, options), x = _a.x, y = _a.y, scale = _a.scale, animated = _a.animated, duration = _a.duration;\n var startZoomFactor = this._zoomFactor;\n var startOffset = __assign({}, this._offset);\n this._zoomFactor = 1;\n this._offset = { x: 0, y: 0 };\n this._scaleTo(scale, { x: x, y: y });\n this._stopAnimation();\n if (!animated) {\n return this._update();\n }\n var diffZoomFactor = this._zoomFactor - startZoomFactor;\n var diffOffset = {\n x: this._offset.x - startOffset.x,\n y: this._offset.y - startOffset.y,\n };\n this._zoomFactor = startZoomFactor;\n this._offset = __assign({}, startOffset);\n var updateFrame = function (progress) {\n var x = startOffset.x + diffOffset.x * progress;\n var y = startOffset.y + diffOffset.y * progress;\n _this._zoomFactor = startZoomFactor + diffZoomFactor * progress;\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateFrame, { callback: function () { return _this._sanitize(); }, duration: duration });\n };\n PinchZoom.prototype._scaleTo = function (zoomFactor, center) {\n this._scale(zoomFactor / this._zoomFactor, center);\n this._offset = this._sanitizeOffset(this._offset);\n };\n PinchZoom.prototype._scale = function (scale, center) {\n scale = this._scaleZoomFactor(scale);\n this._addOffset({\n x: (scale - 1) * (center.x + this._offset.x),\n y: (scale - 1) * (center.y + this._offset.y),\n });\n this.props.onZoomUpdate();\n };\n PinchZoom.prototype._scaleZoomFactor = function (scale) {\n var originalZoomFactor = this._zoomFactor;\n this._zoomFactor *= scale;\n this._zoomFactor = clamp(this.props.minZoom, this.props.maxZoom, this._zoomFactor);\n return this._zoomFactor / originalZoomFactor;\n };\n PinchZoom.prototype._canDrag = function () {\n return this.props.draggableUnZoomed || !isCloseTo(this._zoomFactor, 1);\n };\n PinchZoom.prototype._drag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n if (!this.props.lockDragAxis) {\n this._addOffset({\n x: x,\n y: y,\n });\n }\n else {\n // lock scroll to position that was changed the most\n if (abs(x) > abs(y)) {\n this._addOffset({\n x: x,\n y: 0,\n });\n }\n else {\n this._addOffset({\n y: y,\n x: 0,\n });\n }\n }\n this.props.onDragUpdate();\n }\n };\n PinchZoom.prototype._virtualDrag = function (center, lastCenter) {\n if (lastCenter) {\n var y = -(center.y - lastCenter.y);\n var x = -(center.x - lastCenter.x);\n this._draggingPoint = {\n x: x + this._draggingPoint.x,\n y: y + this._draggingPoint.y,\n };\n }\n };\n PinchZoom.prototype._addOffset = function (offset) {\n var _a = this._offset, x = _a.x, y = _a.y;\n this._offset = {\n x: x + offset.x,\n y: y + offset.y,\n };\n };\n PinchZoom.prototype._sanitize = function () {\n if (this._zoomFactor < this.props.zoomOutFactor) {\n this._resetInertia();\n this._zoomOutAnimation();\n }\n else if (this._isInsaneOffset()) {\n this._sanitizeOffsetAnimation();\n }\n };\n PinchZoom.prototype._isInsaneOffset = function () {\n var offset = this._offset;\n var sanitizedOffset = this._sanitizeOffset(offset);\n return sanitizedOffset.x !== offset.x || sanitizedOffset.y !== offset.y;\n };\n PinchZoom.prototype._sanitizeOffsetAnimation = function () {\n var _this = this;\n var targetOffset = this._sanitizeOffset(this._offset);\n var startOffset = __assign({}, this._offset);\n var updateProgress = function (progress) {\n var x = startOffset.x + progress * (targetOffset.x - startOffset.x);\n var y = startOffset.y + progress * (targetOffset.y - startOffset.y);\n _this._offset = { x: x, y: y };\n _this._update();\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._zoomOutAnimation = function () {\n var _this = this;\n if (this._zoomFactor === 1) {\n return;\n }\n var startZoomFactor = this._zoomFactor;\n var zoomFactor = 1;\n var center = this._getCurrentZoomCenter();\n var updateProgress = function (progress) {\n var scaleFactor = startZoomFactor + progress * (zoomFactor - startZoomFactor);\n _this._scaleTo(scaleFactor, center);\n };\n this._animate(updateProgress);\n };\n PinchZoom.prototype._getInitialZoomFactor = function () {\n return this._initialZoomFactor;\n };\n PinchZoom.prototype._getCurrentZoomCenter = function () {\n var _a = this._offset, x = _a.x, y = _a.y;\n var offsetLeft = x - this._initialOffset.x;\n var offsetTop = y - this._initialOffset.y;\n return {\n x: -1 * x - offsetLeft / (1 / this._zoomFactor - 1),\n y: -1 * y - offsetTop / (1 / this._zoomFactor - 1),\n };\n };\n PinchZoom.prototype._getOffsetByFirstTouch = function (event) {\n return this._getOffsetTouches(event)[0];\n };\n PinchZoom.prototype._getOffsetTouches = function (event) {\n var _document = this.props._document;\n var _html = _document.documentElement;\n var _body = _document.body;\n var _a = this._getContainerRect(), top = _a.top, left = _a.left;\n var scrollTop = _html.scrollTop || _body.scrollTop;\n var scrollLeft = _html.scrollLeft || _body.scrollLeft;\n var posTop = top + scrollTop;\n var posLeft = left + scrollLeft;\n return getPageCoordinatesByTouches(event.touches).map(function (_a) {\n var x = _a.x, y = _a.y;\n return ({\n x: x - posLeft,\n y: y - posTop,\n });\n });\n };\n PinchZoom.prototype._animate = function (frameFn, options) {\n var _this = this;\n var startTime = new Date().getTime();\n var _a = __assign({ timeFn: swing, callback: function () { }, duration: this.props.animationDuration }, options), timeFn = _a.timeFn, callback = _a.callback, duration = _a.duration;\n var renderFrame = function () {\n if (!_this._inAnimation) {\n return;\n }\n var frameTime = new Date().getTime() - startTime;\n var progress = frameTime / duration;\n if (frameTime >= duration) {\n frameFn(1);\n _this._stopAnimation();\n callback();\n _this._update();\n }\n else {\n progress = timeFn(progress);\n frameFn(progress);\n _this._update({ isAnimation: true });\n requestAnimationFrame(renderFrame);\n }\n };\n this._inAnimation = true;\n requestAnimationFrame(renderFrame);\n };\n PinchZoom.prototype._stopAnimation = function () {\n this._inAnimation = false;\n };\n PinchZoom.prototype._end = function () {\n this._hasInteraction = false;\n this._sanitize();\n this._update();\n };\n PinchZoom.prototype._getContainerRect = function () {\n var div = this._containerRef.current;\n return div.getBoundingClientRect();\n };\n PinchZoom.prototype._getChildSize = function () {\n var div = this._containerRef.current;\n return getElementSize(div === null || div === void 0 ? void 0 : div.firstElementChild);\n };\n PinchZoom.prototype._updateInitialZoomFactor = function () {\n var rect = this._getContainerRect();\n var size = this._getChildSize();\n var xZoomFactor = rect.width / size.width;\n var yZoomFactor = rect.height / size.height;\n this._initialZoomFactor = min(xZoomFactor, yZoomFactor);\n };\n PinchZoom.prototype._bindEvents = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (window.ResizeObserver) {\n this._containerObserver = new ResizeObserver(this._onResize);\n this._containerObserver.observe(div);\n }\n else {\n window.addEventListener('resize', this._onResize);\n }\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).addEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.addEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._unSubscribe = function () {\n var _this = this;\n var div = this._containerRef.current;\n if (this._containerObserver) {\n this._containerObserver.disconnect();\n this._containerObserver = null;\n }\n window.removeEventListener('resize', this._onResize);\n this._handlers.forEach(function (_a) {\n var eventName = _a[0], fn = _a[1], target = _a[2];\n (target || div).removeEventListener(eventName, fn, true);\n });\n Array.from(div.querySelectorAll('img')).forEach(function (img) {\n return img.removeEventListener('load', _this._onResize);\n });\n };\n PinchZoom.prototype._update = function (options) {\n var _this = this;\n if (this._updatePlaned) {\n return;\n }\n var updateFrame = function () {\n var scale = _this._getInitialZoomFactor() * _this._zoomFactor;\n var x = -_this._offset.x / scale;\n var y = -_this._offset.y / scale;\n _this.props.onUpdate({ scale: scale, x: x, y: y });\n };\n if (options === null || options === void 0 ? void 0 : options.isAnimation) {\n return updateFrame();\n }\n this._updatePlaned = true;\n requestAnimationFrame(function () {\n _this._updatePlaned = false;\n updateFrame();\n });\n };\n PinchZoom.prototype._handlerIfEnable = function (fn) {\n var _this = this;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (_this.props.enabled) {\n fn.apply(void 0, args);\n }\n };\n };\n PinchZoom.prototype._setInteraction = function (newInteraction, event) {\n var interaction = this._interaction;\n if (interaction !== newInteraction) {\n if (interaction && !newInteraction) {\n if (isZoomInteraction(interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(interaction)) {\n this._handleDragEnd();\n }\n }\n if (isZoomInteraction(newInteraction)) {\n this._handleZoomStart();\n }\n else if (isDragInteraction(newInteraction)) {\n this._handleDragStart(event);\n }\n }\n this._interaction = newInteraction;\n };\n PinchZoom.prototype._distanceBetweenNumbers = function (a, b) {\n return a > b ? a - b : b - a;\n };\n PinchZoom.prototype._enoughToDrag = function () {\n if (this._distanceBetweenNumbers(this._startOffset.x, this._draggingPoint.x) >\n 5 ||\n this._distanceBetweenNumbers(this._startOffset.y, this._draggingPoint.y) >\n 5)\n return true;\n return false;\n };\n PinchZoom.prototype._updateInteraction = function (event) {\n var fingers = this._fingers;\n if (fingers === 2) {\n return this._setInteraction('zoom', event);\n }\n if (fingers === 1 && this._canDrag()) {\n return this._setInteraction('drag', event);\n }\n this._setInteraction(null, event);\n };\n PinchZoom.prototype._detectDoubleTap = function (event) {\n var time = new Date().getTime();\n if (this._fingers > 1) {\n this._lastTouchStart = 0;\n }\n if (time - this._lastTouchStart < 300) {\n cancelEvent(event);\n this._handleDoubleTap(event);\n if (isZoomInteraction(this._interaction)) {\n this._handleZoomEnd();\n }\n else if (isDragInteraction(this._interaction)) {\n this._handleDragEnd();\n }\n }\n else {\n this._isDoubleTap = false;\n }\n if (this._fingers === 1) {\n this._lastTouchStart = time;\n }\n };\n PinchZoom.prototype.simulate = function (fn) {\n var _this = this;\n return function (mouseEvent) {\n var pageX = mouseEvent.pageX, pageY = mouseEvent.pageY, type = mouseEvent.type;\n var isEnd = type === 'mouseup';\n var isStart = type === 'mousedown';\n if (isStart) {\n mouseEvent.preventDefault();\n _this._listenMouseMove = true;\n }\n if (_this._listenMouseMove) {\n // @ts-ignore\n mouseEvent.touches = isEnd ? [] : [{ pageX: pageX, pageY: pageY }];\n fn(\n // @ts-ignore\n mouseEvent);\n }\n if (isEnd) {\n _this._listenMouseMove = false;\n }\n };\n };\n PinchZoom.prototype.componentDidMount = function () {\n this._bindEvents();\n this._update();\n };\n PinchZoom.prototype.componentWillUnmount = function () {\n this._stopAnimation();\n this._unSubscribe();\n };\n PinchZoom.prototype.render = function () {\n var _a = this.props, children = _a.children, containerProps = _a.containerProps;\n var child = Children.only(children);\n var props = containerProps || {};\n return (React.createElement(React.Fragment, null,\n React.createElement(\"style\", null, styles),\n React.createElement(\"div\", __assign({}, props, { ref: this._containerRef, className: classnames(styleRoot, props.className) }), cloneElement(child, {\n className: classnames(styleChild, child.props.className),\n }))));\n };\n PinchZoom.defaultProps = {\n animationDuration: 250,\n draggableUnZoomed: true,\n enforceBoundsDuringZoom: false,\n centerContained: false,\n enabled: true,\n inertia: true,\n inertiaFriction: 0.96,\n horizontalPadding: 0,\n isTouch: isTouch,\n lockDragAxis: false,\n maxZoom: 5,\n minZoom: 0.5,\n onDoubleTap: noup,\n onDragEnd: noup,\n onDragStart: noup,\n onDragUpdate: noup,\n onZoomEnd: noup,\n onZoomStart: noup,\n onZoomUpdate: noup,\n setOffsetsOnce: false,\n shouldInterceptWheel: shouldInterceptWheel,\n shouldCancelHandledTouchEndEvents: false,\n tapZoomFactor: 1,\n verticalPadding: 0,\n wheelScaleFactor: 1500,\n zoomOutFactor: 1.3,\n doubleTapZoomOutOnMaxScale: false,\n doubleTapToggleZoom: false,\n // @ts-expect-error\n _document: isSsr ? null : window.document,\n };\n return PinchZoom;\n}(Component));\nif (process.env.NODE_ENV !== 'production') {\n var _a = require('prop-types'), any = _a.any, element = _a.element, object = _a.object, number = _a.number, func = _a.func, bool = _a.bool;\n // @ts-ignore\n PinchZoom.propTypes = {\n children: element,\n containerProps: object,\n wheelScaleFactor: number,\n animationDuration: number,\n draggableUnZoomed: bool,\n enforceBoundsDuringZoom: bool,\n centerContained: bool,\n enabled: bool,\n horizontalPadding: number,\n lockDragAxis: bool,\n onUpdate: func.isRequired,\n maxZoom: number,\n minZoom: number,\n onDoubleTap: func,\n onDragEnd: func,\n onDragStart: func,\n onDragUpdate: func,\n onZoomEnd: func,\n onZoomStart: func,\n onZoomUpdate: func,\n setOffsetsOnce: bool,\n tapZoomFactor: number,\n verticalPadding: number,\n zoomOutFactor: number,\n doubleTapZoomOutOnMaxScale: bool,\n doubleTapToggleZoom: bool,\n isTouch: func,\n _document: any,\n };\n}\nexport default PinchZoom;\n","export default function formatDuration(time) {\n if (!time) return;\n let hours = Math.floor(time / 3600);\n let minutes = Math.floor((time % 3600) / 60);\n let seconds = Math.round(time % 60);\n\n if (hours === 0) {\n return `${minutes}:${seconds.toString().padStart(2, '0')}`;\n } else {\n return `${hours}:${minutes.toString().padStart(2, '0')}:${seconds\n .toString()\n .padStart(2, '0')}`;\n }\n}\n","import { Trans, useLingui } from '@lingui/react/macro';\nimport { getBlurHashAverageColor } from 'fast-blurhash';\nimport { Fragment } from 'preact';\nimport { memo } from 'preact/compat';\nimport {\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport QuickPinchZoom, { make3dTransformValue } from 'react-quick-pinch-zoom';\n\nimport formatDuration from '../utils/format-duration';\nimport mem from '../utils/mem';\nimport states from '../utils/states';\n\nimport Icon from './icon';\nimport Link from './link';\n\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); // https://stackoverflow.com/a/23522755\n\n/*\nMedia type\n===\nunknown = unsupported or unrecognized file type\nimage = Static image\ngifv = Looping, soundless animation\nvideo = Video clip\naudio = Audio track\n*/\n\nconst dataAltLabel = 'ALT';\nconst AltBadge = (props) => {\n const { t } = useLingui();\n const { alt, lang, index, ...rest } = props;\n if (!alt || !alt.trim()) return null;\n return (\n {\n e.stopPropagation();\n e.preventDefault();\n states.showMediaAlt = {\n alt,\n lang,\n };\n }}\n title={t`Media description`}\n >\n {dataAltLabel}\n {!!index && {index}}\n \n );\n};\n\nconst MEDIA_CAPTION_LIMIT = 140;\nconst MEDIA_CAPTION_LIMIT_LONGER = 280;\nexport const isMediaCaptionLong = mem((caption) =>\n caption?.length\n ? caption.length > MEDIA_CAPTION_LIMIT ||\n /[\\n\\r].*[\\n\\r]/.test(caption.trim())\n : false,\n);\n\nfunction Media({\n class: className = '',\n media,\n to,\n lang,\n showOriginal,\n autoAnimate,\n showCaption,\n allowLongerCaption,\n altIndex,\n checkAspectRatio = true,\n onClick = () => {},\n}) {\n let {\n blurhash,\n description,\n meta,\n previewRemoteUrl,\n previewUrl,\n remoteUrl,\n url,\n type,\n } = media;\n if (/no\\-preview\\./i.test(previewUrl)) {\n previewUrl = null;\n }\n const { original = {}, small, focus } = meta || {};\n\n const width = showOriginal\n ? original?.width\n : small?.width || original?.width;\n const height = showOriginal\n ? original?.height\n : small?.height || original?.height;\n const mediaURL = showOriginal ? url : previewUrl || url;\n const remoteMediaURL = showOriginal\n ? remoteUrl\n : previewRemoteUrl || remoteUrl;\n const hasDimensions = width && height;\n const orientation = hasDimensions\n ? width > height\n ? 'landscape'\n : 'portrait'\n : null;\n\n const rgbAverageColor = blurhash ? getBlurHashAverageColor(blurhash) : null;\n\n const videoRef = useRef();\n\n let focalPosition;\n if (focus) {\n // Convert focal point to CSS background position\n // Formula from jquery-focuspoint\n // x = -1, y = 1 => 0% 0%\n // x = 0, y = 0 => 50% 50%\n // x = 1, y = -1 => 100% 100%\n const x = ((focus.x + 1) / 2) * 100;\n const y = ((1 - focus.y) / 2) * 100;\n focalPosition = `${x.toFixed(0)}% ${y.toFixed(0)}%`;\n }\n\n const mediaRef = useRef();\n const onUpdate = useCallback(({ x, y, scale }) => {\n const { current: media } = mediaRef;\n\n if (media) {\n const value = make3dTransformValue({ x, y, scale });\n\n if (scale === 1) {\n media.style.removeProperty('transform');\n } else {\n media.style.setProperty('transform', value);\n }\n\n media.closest('.media-zoom').style.touchAction =\n scale <= 1.01 ? 'pan-x' : '';\n }\n }, []);\n\n const [pinchZoomEnabled, setPinchZoomEnabled] = useState(false);\n const quickPinchZoomProps = {\n enabled: pinchZoomEnabled,\n draggableUnZoomed: false,\n inertiaFriction: 0.9,\n tapZoomFactor: 2,\n doubleTapToggleZoom: true,\n containerProps: {\n className: 'media-zoom',\n style: {\n overflow: 'visible',\n // width: 'inherit',\n // height: 'inherit',\n // justifyContent: 'inherit',\n // alignItems: 'inherit',\n // display: 'inherit',\n },\n },\n onUpdate,\n };\n\n const [mediaLoadError, setMediaLoadError] = useState(false);\n\n const Parent = useMemo(\n () =>\n to && !mediaLoadError ? (props) => : 'div',\n [to, mediaLoadError],\n );\n\n const remoteMediaURLObj = remoteMediaURL ? getURLObj(remoteMediaURL) : null;\n const isVideoMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(remoteMediaURLObj.pathname);\n const isAudioMaybe =\n type === 'unknown' &&\n remoteMediaURLObj &&\n /\\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(remoteMediaURLObj.pathname);\n const isImage =\n type === 'image' ||\n (type === 'unknown' && previewUrl && !isVideoMaybe && !isAudioMaybe);\n const isPreviewVideoMaybe =\n previewUrl &&\n /\\.(mp4|m4r|m4v|mov|webm)$/i.test(getURLObj(previewUrl).pathname);\n\n const parentRef = useRef();\n const [imageSmallerThanParent, setImageSmallerThanParent] = useState(false);\n useLayoutEffect(() => {\n if (!isImage) return;\n if (!showOriginal) return;\n if (!parentRef.current) return;\n const { offsetWidth, offsetHeight } = parentRef.current;\n const smaller = width < offsetWidth && height < offsetHeight;\n if (smaller) setImageSmallerThanParent(smaller);\n }, [width, height]);\n\n const maxAspectHeight =\n window.innerHeight * (orientation === 'portrait' ? 0.45 : 0.33);\n const maxHeight = orientation === 'portrait' ? 0 : 160;\n const averageColorStyle = {\n '--average-color': rgbAverageColor && `rgb(${rgbAverageColor.join(',')})`,\n };\n const mediaStyles =\n width && height\n ? {\n '--width': `${width}px`,\n '--height': `${height}px`,\n // Calculate '--aspectWidth' based on aspect ratio calculated from '--width' and '--height', max height has to be 160px\n '--aspectWidth': `${\n (width / height) * Math.max(maxHeight, maxAspectHeight)\n }px`,\n aspectRatio: `${width} / ${height}`,\n ...averageColorStyle,\n }\n : {\n ...averageColorStyle,\n };\n\n const longDesc = isMediaCaptionLong(description);\n let showInlineDesc =\n !!showCaption && !showOriginal && !!description && !longDesc;\n if (\n allowLongerCaption &&\n !showInlineDesc &&\n description?.length <= MEDIA_CAPTION_LIMIT_LONGER\n ) {\n showInlineDesc = true;\n }\n const Figure = !showInlineDesc\n ? Fragment\n : (props) => {\n const { children, ...restProps } = props;\n return (\n
\n {children}\n {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: description,\n lang,\n };\n }}\n >\n {description}\n \n
\n );\n };\n\n const [hasNaturalAspectRatio, setHasNaturalAspectRatio] = useState(undefined);\n\n if (isImage) {\n // Note: type: unknown might not have width/height\n quickPinchZoomProps.containerProps.style.display = 'inherit';\n\n useLayoutEffect(() => {\n if (!isSafari) return;\n if (!showOriginal) return;\n (async () => {\n try {\n await fetch(mediaURL, { mode: 'no-cors' });\n mediaRef.current.src = mediaURL;\n } catch (e) {\n // Ignore\n }\n })();\n }, [mediaURL]);\n\n return (\n
\n \n {showOriginal ? (\n \n {\n e.target.closest('.media-image').style.backgroundImage = '';\n e.target.closest('.media-zoom').style.display = '';\n setPinchZoomEnabled(true);\n }}\n onError={(e) => {\n const { src } = e.target;\n if (\n src === mediaURL &&\n remoteMediaURL &&\n mediaURL !== remoteMediaURL\n ) {\n e.target.src = remoteMediaURL;\n }\n }}\n />\n \n ) : (\n <>\n {\n // e.target.closest('.media-image').style.backgroundImage = '';\n e.target.dataset.loaded = true;\n const $media = e.target.closest('.media');\n if (!hasDimensions && $media) {\n const { naturalWidth, naturalHeight } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight ? 'landscape' : 'portrait';\n $media.style.setProperty('--width', `${naturalWidth}px`);\n $media.style.setProperty('--height', `${naturalHeight}px`);\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n\n // Check natural aspect ratio vs display aspect ratio\n if (checkAspectRatio && $media) {\n const {\n clientWidth,\n clientHeight,\n naturalWidth,\n naturalHeight,\n } = e.target;\n if (\n clientWidth &&\n clientHeight &&\n naturalWidth &&\n naturalHeight\n ) {\n const minDimension = 88;\n if (\n naturalWidth < minDimension ||\n naturalHeight < minDimension\n ) {\n $media.dataset.hasSmallDimension = true;\n } else {\n const displayNaturalHeight =\n (naturalHeight * clientWidth) / naturalWidth;\n const almostSimilarHeight =\n Math.abs(displayNaturalHeight - clientHeight) < 5;\n\n if (almostSimilarHeight) {\n setHasNaturalAspectRatio(true);\n }\n }\n }\n }\n }}\n onError={(e) => {\n const { src } = e.target;\n if (src === mediaURL && mediaURL !== remoteMediaURL) {\n e.target.src = remoteMediaURL;\n } else {\n setMediaLoadError(true);\n }\n }}\n />\n {!showInlineDesc && (\n \n )}\n \n )}\n \n {mediaLoadError && (\n \n )}\n
\n );\n } else if (type === 'gifv' || type === 'video' || isVideoMaybe) {\n const hasDuration = original.duration > 0;\n const shortDuration = original.duration < 31;\n const isGIF = type === 'gifv' && shortDuration;\n // If GIF is too long, treat it as a video\n const loopable = original.duration < 61;\n const formattedDuration = formatDuration(original.duration);\n const hoverAnimate = !showOriginal && !autoAnimate && isGIF;\n const autoGIFAnimate = !showOriginal && autoAnimate && isGIF;\n const showProgress = original.duration > 5;\n\n // This string is only for autoplay + muted to work on Mobile Safari\n const gifHTML = `\n \n `;\n\n const videoHTML = `\n \n `;\n\n return (\n
\n {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n onClick(e);\n }}\n onMouseEnter={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onMouseLeave={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n onFocus={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.play();\n } catch (e) {}\n }\n }}\n onBlur={() => {\n if (hoverAnimate) {\n try {\n videoRef.current.pause();\n } catch (e) {}\n }\n }}\n >\n {showOriginal || autoGIFAnimate ? (\n isGIF && showOriginal ? (\n \n \n \n ) : isGIF ? (\n \n ) : (\n \n )\n ) : isGIF ? (\n {\n const { target } = e;\n const container = target?.closest('.media-gif');\n if (container) {\n const percentage =\n (target.currentTime / target.duration) * 100;\n container.style.setProperty(\n '--progress',\n `${percentage}%`,\n );\n }\n }\n : undefined\n }\n />\n ) : (\n <>\n {previewUrl && !isPreviewVideoMaybe ? (\n {\n if (!hasDimensions) {\n const $media = e.target.closest('.media');\n if ($media) {\n const { naturalHeight, naturalWidth } = e.target;\n $media.dataset.orientation =\n naturalWidth > naturalHeight\n ? 'landscape'\n : 'portrait';\n $media.style.setProperty(\n '--width',\n `${naturalWidth}px`,\n );\n $media.style.setProperty(\n '--height',\n `${naturalHeight}px`,\n );\n $media.style.aspectRatio = `${naturalWidth}/${naturalHeight}`;\n }\n }\n }}\n />\n ) : (\n {\n if (!hasDuration) {\n const { duration } = e.target;\n if (duration) {\n const formattedDuration = formatDuration(duration);\n const container = e.target.closest('.media-video');\n if (container) {\n container.dataset.formattedDuration =\n formattedDuration;\n }\n }\n }\n }}\n />\n )}\n
\n \n
\n \n )}\n {!showOriginal && !showInlineDesc && (\n \n )}\n \n
\n );\n } else if (type === 'audio' || isAudioMaybe) {\n const formattedDuration = formatDuration(original.duration);\n return (\n
\n \n {showOriginal ? (\n
\n );\n }\n}\n\nfunction getURLObj(url) {\n // Fake base URL if url doesn't have https:// prefix\n return URL.parse(url, location.origin);\n}\n\nexport default memo(Media, (oldProps, newProps) => {\n const oldMedia = oldProps.media || {};\n const newMedia = newProps.media || {};\n\n return (\n oldMedia?.id === newMedia?.id &&\n oldMedia.url === newMedia.url &&\n oldProps.to === newProps.to &&\n oldProps.class === newProps.class\n );\n});\n","import './status.css';\nimport '@justinribeiro/lite-youtube';\n\nimport { msg, plural } from '@lingui/core/macro';\nimport { Trans, useLingui } from '@lingui/react/macro';\nimport {\n ControlledMenu,\n Menu,\n MenuDivider,\n MenuHeader,\n MenuItem,\n} from '@szhsin/react-menu';\nimport { decodeBlurHash, getBlurHashAverageColor } from 'fast-blurhash';\nimport { shallowEqual } from 'fast-equals';\nimport prettify from 'html-prettify';\nimport pThrottle from 'p-throttle';\nimport { Fragment } from 'preact';\nimport { forwardRef, memo } from 'preact/compat';\nimport {\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'preact/hooks';\nimport punycode from 'punycode/';\nimport { useHotkeys } from 'react-hotkeys-hook';\n// import { detectAll } from 'tinyld/light';\nimport { useLongPress } from 'use-long-press';\nimport { useSnapshot } from 'valtio';\n\nimport CustomEmoji from '../components/custom-emoji';\nimport EmojiText from '../components/emoji-text';\nimport LazyShazam from '../components/lazy-shazam';\nimport Loader from '../components/loader';\nimport MenuConfirm from '../components/menu-confirm';\nimport Menu2 from '../components/menu2';\nimport Modal from '../components/modal';\nimport NameText from '../components/name-text';\nimport Poll from '../components/poll';\nimport { api } from '../utils/api';\nimport { langDetector } from '../utils/browser-translator';\nimport emojifyText from '../utils/emojify-text';\nimport enhanceContent from '../utils/enhance-content';\nimport FilterContext from '../utils/filter-context';\nimport { isFiltered } from '../utils/filters';\nimport getDomain from '../utils/get-domain';\nimport getTranslateTargetLanguage from '../utils/get-translate-target-language';\nimport getHTMLText from '../utils/getHTMLText';\nimport handleContentLinks from '../utils/handle-content-links';\nimport htmlContentLength from '../utils/html-content-length';\nimport isRTL from '../utils/is-rtl';\nimport isMastodonLinkMaybe from '../utils/isMastodonLinkMaybe';\nimport localeMatch from '../utils/locale-match';\nimport mem from '../utils/mem';\nimport niceDateTime from '../utils/nice-date-time';\nimport openCompose from '../utils/open-compose';\nimport pmem from '../utils/pmem';\nimport safeBoundingBoxPadding from '../utils/safe-bounding-box-padding';\nimport shortenNumber from '../utils/shorten-number';\nimport showCompose from '../utils/show-compose';\nimport showToast from '../utils/show-toast';\nimport { speak, supportsTTS } from '../utils/speech';\nimport states, { getStatus, saveStatus, statusKey } from '../utils/states';\nimport statusPeek from '../utils/status-peek';\nimport store from '../utils/store';\nimport { getCurrentAccountID } from '../utils/store-utils';\nimport supports from '../utils/supports';\nimport unfurlMastodonLink from '../utils/unfurl-link';\nimport useTruncated from '../utils/useTruncated';\nimport visibilityIconsMap from '../utils/visibility-icons-map';\n\nimport Avatar from './avatar';\nimport Icon from './icon';\nimport Link from './link';\nimport Media, { isMediaCaptionLong } from './media';\nimport MenuLink from './menu-link';\nimport RelativeTime from './relative-time';\nimport TranslationBlock from './translation-block';\n\nconst SHOW_COMMENT_COUNT_LIMIT = 280;\nconst INLINE_TRANSLATE_LIMIT = 140;\n\nconst throttle = pThrottle({\n limit: 1,\n interval: 1000,\n});\nfunction fetchAccount(id, masto) {\n return masto.v1.accounts.$select(id).fetch();\n}\nconst memFetchAccount = pmem(throttle(fetchAccount));\n\nconst visibilityText = {\n public: msg`Public`,\n local: msg`Local`,\n unlisted: msg`Unlisted`,\n private: msg`Followers only`,\n direct: msg`Private mention`,\n};\n\nconst isIOS =\n window.ontouchstart !== undefined &&\n /iPad|iPhone|iPod/.test(navigator.userAgent);\n\nconst rtf = new Intl.RelativeTimeFormat();\n\nconst REACTIONS_LIMIT = 80;\n\nfunction getPollText(poll) {\n if (!poll?.options?.length) return '';\n return `📊:\\n${poll.options\n .map(\n (option) =>\n `- ${option.title}${\n option.votesCount >= 0 ? ` (${option.votesCount})` : ''\n }`,\n )\n .join('\\n')}`;\n}\nfunction getPostText(status, opts) {\n const { maskCustomEmojis } = opts || {};\n const { spoilerText, poll, emojis } = status;\n let { content } = status;\n if (maskCustomEmojis && emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '⬚');\n }\n return (\n (spoilerText ? `${spoilerText}\\n\\n` : '') +\n getHTMLText(content) +\n getPollText(poll)\n );\n}\n\nfunction forgivingQSA(selectors = [], dom = document) {\n // Run QSA for list of selectors\n // If a selector return invalid selector error, try the next one\n for (const selector of selectors) {\n try {\n return dom.querySelectorAll(selector);\n } catch (e) {}\n }\n return [];\n}\n\nfunction isTranslateble(content, emojis) {\n if (!content) return false;\n // Remove custom emojis\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n content = content.trim();\n if (!content) return false;\n const text = getHTMLText(content, {\n preProcess: (dom) => {\n // Remove .mention, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'],\n dom,\n )) {\n a.remove();\n }\n },\n });\n return !!text;\n}\n\nfunction getHTMLTextForDetectLang(content, emojis) {\n if (emojis?.length) {\n const emojisRegex = new RegExp(\n `:(${emojis.map((e) => e.shortcode).join('|')}):`,\n 'g',\n );\n content = content.replace(emojisRegex, '');\n }\n\n return getHTMLText(content, {\n preProcess: (dom) => {\n // Remove anything that can skew the language detection\n\n // Remove .mention, .hashtag, pre, code, a:has(.invisible)\n for (const a of forgivingQSA(\n [\n '.mention, .hashtag, pre, code, a:has(.invisible)',\n '.mention, .hashtag, pre, code',\n ],\n dom,\n )) {\n a.remove();\n }\n\n // Remove links that contains text that starts with https?://\n for (const a of dom.querySelectorAll('a')) {\n const text = a.innerText.trim();\n if (text.startsWith('https://') || text.startsWith('http://')) {\n a.remove();\n }\n }\n },\n });\n}\n\nconst HTTP_REGEX = /^http/i;\nconst PostContent =\n /*memo(*/\n ({ post, instance, previewMode }) => {\n const { content, emojis, language, mentions, url } = post;\n\n const divRef = useRef();\n useLayoutEffect(() => {\n if (!divRef.current) return;\n const dom = enhanceContent(content, {\n emojis,\n returnDOM: true,\n });\n // Remove target=\"_blank\" from links\n for (const a of dom.querySelectorAll('a.u-url[target=\"_blank\"]')) {\n if (!HTTP_REGEX.test(a.innerText.trim())) {\n a.removeAttribute('target');\n }\n }\n divRef.current.replaceChildren(dom.cloneNode(true));\n }, [content, emojis?.length]);\n\n return (\n {\n // // Remove target=\"_blank\" from links\n // dom.querySelectorAll('a.u-url[target=\"_blank\"]').forEach((a) => {\n // if (!/http/i.test(a.innerText.trim())) {\n // a.removeAttribute('target');\n // }\n // });\n // },\n // }),\n // }}\n />\n );\n }; /*,\n (oldProps, newProps) => {\n const { post: oldPost } = oldProps;\n const { post: newPost } = newProps;\n return oldPost.content === newPost.content;\n },\n);*/\n\nconst SIZE_CLASS = {\n s: 'small',\n m: 'medium',\n l: 'large',\n};\n\nconst detectLang = pmem(async (text) => {\n text = text?.trim();\n\n // Ref: https://github.com/komodojp/tinyld/blob/develop/docs/benchmark.md\n // 500 should be enough for now, also the default max chars for Mastodon\n if (text?.length > 500) {\n return null;\n }\n\n if (langDetector) {\n const langs = await langDetector.detect(text);\n console.groupCollapsed(\n '💬 DETECTLANG BROWSER',\n langs.slice(0, 3).map((l) => l.detectedLanguage),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.detectedLanguage && lang?.confidence > 0.5) {\n return lang.detectedLanguage;\n }\n }\n\n const { detectAll } = await import('tinyld/light');\n const langs = detectAll(text);\n console.groupCollapsed(\n '💬 DETECTLANG TINYLD',\n langs.slice(0, 3).map((l) => l.lang),\n );\n console.log(text, langs.slice(0, 3));\n console.groupEnd();\n const lang = langs[0];\n if (lang?.lang && lang?.accuracy > 0.5) {\n // If > 50% accurate, use it\n // It can be accurate if < 50% but better be safe\n // Though > 50% also can be inaccurate 🤷‍♂️\n return lang.lang;\n }\n return null;\n});\n\nconst readMoreText = msg`Read more →`;\n\n// All this work just to make sure this only lazy-run once\n// Because first run is slow due to intl-localematcher\nconst DIFFERENT_LANG_CHECK = {};\nconst checkDifferentLanguage = (\n language,\n contentTranslationHideLanguages = [],\n) => {\n if (!language) return false;\n const targetLanguage = getTranslateTargetLanguage(true);\n const different =\n language !== targetLanguage &&\n !localeMatch([language], [targetLanguage]) &&\n !contentTranslationHideLanguages.find(\n (l) => language === l || localeMatch([language], [l]),\n );\n if (different)\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] = true;\n return different;\n};\n\nconst getCurrentAccID = mem(\n () => {\n return getCurrentAccountID();\n },\n {\n maxAge: 60 * 1000, // 1 minute\n },\n);\n\nconst getPrefs = mem(\n () => {\n return store.account.get('preferences') || {};\n },\n {\n maxAge: 60 * 1000, // 1 minute\n },\n);\n\nfunction Status({\n statusID,\n status,\n instance: propInstance,\n size = 'm',\n contentTextWeight,\n readOnly,\n enableCommentHint,\n withinContext,\n skeleton,\n enableTranslate,\n forceTranslate: _forceTranslate,\n previewMode,\n allowFilters,\n onMediaClick,\n quoted,\n onStatusLinkClick = () => {},\n showFollowedTags,\n allowContextMenu,\n showActionsBar,\n showReplyParent,\n mediaFirst,\n}) {\n const { _, t } = useLingui();\n\n if (skeleton) {\n return (\n \n {!mediaFirst && }\n
\n
\n {(size === 's' || mediaFirst) && } ███ ████████\n
\n
\n {mediaFirst &&
}\n
\n

████ ████████

\n
\n
\n
\n
\n );\n }\n const { masto, instance, authenticated } = api({ instance: propInstance });\n const { instance: currentInstance } = api();\n const sameInstance = instance === currentInstance;\n\n let sKey = statusKey(statusID || status?.id, instance);\n const snapStates = useSnapshot(states);\n if (!status) {\n status = snapStates.statuses[sKey] || snapStates.statuses[statusID];\n sKey = statusKey(status?.id, instance);\n }\n if (!status) {\n return null;\n }\n\n const {\n account: {\n acct,\n avatar,\n avatarStatic,\n id: accountId,\n url: accountURL,\n displayName,\n username,\n emojis: accountEmojis,\n bot,\n group,\n } = {},\n id,\n repliesCount,\n reblogged,\n reblogsCount,\n favourited,\n favouritesCount,\n bookmarked,\n poll,\n muted,\n sensitive,\n spoilerText,\n visibility, // public, unlisted, private, direct\n language: _language,\n editedAt,\n filtered,\n card,\n createdAt,\n inReplyToId,\n inReplyToAccountId,\n content,\n mentions,\n mediaAttachments,\n reblog,\n uri,\n url,\n emojis,\n tags,\n pinned,\n // Non-API props\n _deleted,\n _pinned,\n // _filtered,\n // Non-Mastodon\n emojiReactions,\n } = status;\n\n const [languageAutoDetected, setLanguageAutoDetected] = useState(null);\n useEffect(() => {\n if (!content) return;\n if (_language) return;\n if (languageAutoDetected) return;\n let timer;\n timer = setTimeout(async () => {\n let detected = await detectLang(\n getHTMLTextForDetectLang(content, emojis),\n );\n setLanguageAutoDetected(detected);\n }, 1000);\n return () => clearTimeout(timer);\n }, [content, _language]);\n const language = _language || languageAutoDetected;\n\n // if (!mediaAttachments?.length) mediaFirst = false;\n const hasMediaAttachments = !!mediaAttachments?.length;\n if (mediaFirst && hasMediaAttachments) size = 's';\n\n const currentAccount = getCurrentAccID();\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf &&\n ((!readOnly && !previewMode) || allowFilters) &&\n isFiltered(filtered, filterContext);\n\n if (filterInfo?.action === 'hide') {\n return null;\n }\n\n console.debug('RENDER Status', id, status?.account?.displayName, quoted);\n\n const debugHover = (e) => {\n if (e.shiftKey) {\n console.log({\n ...status,\n });\n }\n };\n\n if (\n (allowFilters || size !== 'l') &&\n filterInfo &&\n filterInfo.action !== 'blur'\n ) {\n return (\n \n );\n }\n\n const createdAtDate = new Date(createdAt);\n const editedAtDate = new Date(editedAt);\n\n let inReplyToAccountRef = mentions?.find(\n (mention) => mention.id === inReplyToAccountId,\n );\n if (!inReplyToAccountRef && inReplyToAccountId === id) {\n inReplyToAccountRef = { url: accountURL, username, displayName };\n }\n const [inReplyToAccount, setInReplyToAccount] = useState(inReplyToAccountRef);\n if (!withinContext && !inReplyToAccount && inReplyToAccountId) {\n const account = states.accounts[inReplyToAccountId];\n if (account) {\n setInReplyToAccount(account);\n } else {\n memFetchAccount(inReplyToAccountId, masto)\n .then((account) => {\n setInReplyToAccount(account);\n states.accounts[account.id] = account;\n })\n .catch((e) => {});\n }\n }\n const mentionSelf =\n inReplyToAccountId === currentAccount ||\n mentions?.find((mention) => mention.id === currentAccount);\n\n const readingExpandSpoilers = useMemo(() => {\n const prefs = getPrefs();\n return !!prefs['reading:expand:spoilers'];\n }, []);\n const readingExpandMedia = useMemo(() => {\n // default | show_all | hide_all\n // Ignore hide_all because it means hide *ALL* media including non-sensitive ones\n const prefs = getPrefs();\n return prefs['reading:expand:media']?.toLowerCase() || 'default';\n }, []);\n // FOR TESTING:\n // const readingExpandSpoilers = true;\n // const readingExpandMedia = 'show_all';\n const showSpoiler =\n previewMode || readingExpandSpoilers || !!snapStates.spoilers[id];\n const showSpoilerMedia =\n previewMode ||\n (readingExpandMedia === 'show_all' && filterInfo?.action !== 'blur') ||\n !!snapStates.spoilersMedia[id];\n\n if (reblog) {\n // If has statusID, means useItemID (cached in states)\n\n if (group) {\n return (\n \n
\n {' '}\n \n
\n \n \n );\n }\n\n return (\n \n
\n {' '}\n \n {' '}\n boosted\n \n
\n \n \n );\n }\n\n // Check followedTags\n const FollowedTagsParent = useCallback(\n ({ children }) => (\n \n
\n {' '}\n {snapStates.statusFollowedTags[sKey].slice(0, 3).map((tag) => (\n \n {tag}\n \n ))}\n
\n {children}\n \n ),\n [sKey, instance, snapStates.statusFollowedTags[sKey]],\n );\n const StatusParent =\n showFollowedTags && !!snapStates.statusFollowedTags[sKey]?.length\n ? FollowedTagsParent\n : Fragment;\n\n const isSizeLarge = size === 'l';\n\n const [forceTranslate, setForceTranslate] = useState(_forceTranslate);\n // const targetLanguage = getTranslateTargetLanguage(true);\n // const contentTranslationHideLanguages =\n // snapStates.settings.contentTranslationHideLanguages || [];\n const { contentTranslation, contentTranslationAutoInline } =\n snapStates.settings;\n if (!contentTranslation) enableTranslate = false;\n const inlineTranslate = useMemo(() => {\n if (\n !contentTranslation ||\n !contentTranslationAutoInline ||\n readOnly ||\n (withinContext && !isSizeLarge) ||\n previewMode ||\n spoilerText ||\n sensitive ||\n poll ||\n card ||\n mediaAttachments?.length\n ) {\n return false;\n }\n const contentLength = htmlContentLength(content);\n return contentLength > 0 && contentLength <= INLINE_TRANSLATE_LIMIT;\n }, [\n contentTranslation,\n contentTranslationAutoInline,\n readOnly,\n withinContext,\n isSizeLarge,\n previewMode,\n spoilerText,\n sensitive,\n poll,\n card,\n mediaAttachments,\n content,\n ]);\n\n const [showEdited, setShowEdited] = useState(false);\n const [showEmbed, setShowEmbed] = useState(false);\n\n const spoilerContentRef = useTruncated();\n const contentRef = useTruncated();\n const mediaContainerRef = useTruncated();\n\n const statusRef = useRef(null);\n\n const unauthInteractionErrorMessage = t`Sorry, your current logged-in instance can't interact with this post from another instance.`;\n\n const textWeight = useCallback(\n () =>\n Math.max(\n Math.round((spoilerText.length + htmlContentLength(content)) / 140) ||\n 1,\n 1,\n ),\n [spoilerText, content],\n );\n\n const createdDateText = createdAt && niceDateTime(createdAtDate);\n const editedDateText = editedAt && niceDateTime(editedAtDate);\n\n // Can boost if:\n // - authenticated AND\n // - visibility != direct OR\n // - visibility = private AND isSelf\n let canBoost =\n authenticated && visibility !== 'direct' && visibility !== 'private';\n if (visibility === 'private' && isSelf) {\n canBoost = true;\n }\n\n const replyStatus = (e) => {\n if (!sameInstance || !authenticated) {\n return alert(unauthInteractionErrorMessage);\n }\n // syntheticEvent comes from MenuItem\n if (e?.shiftKey || e?.syntheticEvent?.shiftKey) {\n const newWin = openCompose({\n replyToStatus: status,\n });\n if (newWin) return;\n }\n showCompose({\n replyToStatus: status,\n });\n };\n\n // Check if media has no descriptions\n const mediaNoDesc = useMemo(() => {\n return mediaAttachments.some(\n (attachment) => !attachment.description?.trim?.(),\n );\n }, [mediaAttachments]);\n\n const statusMonthsAgo = useMemo(() => {\n return Math.floor(\n (new Date() - createdAtDate) / (1000 * 60 * 60 * 24 * 30),\n );\n }, [createdAtDate]);\n\n // const boostStatus = async () => {\n // if (!sameInstance || !authenticated) {\n // alert(unauthInteractionErrorMessage);\n // return false;\n // }\n // try {\n // if (!reblogged) {\n // let confirmText = 'Boost this post?';\n // if (mediaNoDesc) {\n // confirmText += '\\n\\n⚠️ Some media have no descriptions.';\n // }\n // const yes = confirm(confirmText);\n // if (!yes) {\n // return false;\n // }\n // }\n // // Optimistic\n // states.statuses[sKey] = {\n // ...status,\n // reblogged: !reblogged,\n // reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n // };\n // if (reblogged) {\n // const newStatus = await masto.v1.statuses.$select(id).unreblog();\n // saveStatus(newStatus, instance);\n // return true;\n // } else {\n // const newStatus = await masto.v1.statuses.$select(id).reblog();\n // saveStatus(newStatus, instance);\n // return true;\n // }\n // } catch (e) {\n // console.error(e);\n // // Revert optimistism\n // states.statuses[sKey] = status;\n // return false;\n // }\n // };\n const confirmBoostStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n reblogged: !reblogged,\n reblogsCount: reblogsCount + (reblogged ? -1 : 1),\n };\n if (reblogged) {\n const newStatus = await masto.v1.statuses.$select(id).unreblog();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).reblog();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n\n const favouriteStatus = async () => {\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n favourited: !favourited,\n favouritesCount: favouritesCount + (favourited ? -1 : 1),\n };\n if (favourited) {\n const newStatus = await masto.v1.statuses.$select(id).unfavourite();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).favourite();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const favouriteStatusNotify = async () => {\n try {\n const done = await favouriteStatus();\n if (!isSizeLarge && done) {\n showToast(\n favourited\n ? t`Unliked @${username || acct}'s post`\n : t`Liked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n const bookmarkStatus = async () => {\n if (!supports('@mastodon/post-bookmark')) return;\n if (!sameInstance || !authenticated) {\n alert(unauthInteractionErrorMessage);\n return false;\n }\n try {\n // Optimistic\n states.statuses[sKey] = {\n ...status,\n bookmarked: !bookmarked,\n };\n if (bookmarked) {\n const newStatus = await masto.v1.statuses.$select(id).unbookmark();\n saveStatus(newStatus, instance);\n } else {\n const newStatus = await masto.v1.statuses.$select(id).bookmark();\n saveStatus(newStatus, instance);\n }\n return true;\n } catch (e) {\n console.error(e);\n // Revert optimistism\n states.statuses[sKey] = status;\n return false;\n }\n };\n const bookmarkStatusNotify = async () => {\n try {\n const done = await bookmarkStatus();\n if (!isSizeLarge && done) {\n showToast(\n bookmarked\n ? t`Unbookmarked @${username || acct}'s post`\n : t`Bookmarked @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n };\n\n // const differentLanguage =\n // !!language &&\n // language !== targetLanguage &&\n // !localeMatch([language], [targetLanguage]) &&\n // !contentTranslationHideLanguages.find(\n // (l) => language === l || localeMatch([language], [l]),\n // );\n const contentTranslationHideLanguages =\n snapStates.settings.contentTranslationHideLanguages || [];\n const [differentLanguage, setDifferentLanguage] = useState(\n () =>\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages] ||\n checkDifferentLanguage(language, contentTranslationHideLanguages),\n );\n useEffect(() => {\n if (!language || differentLanguage) {\n return;\n }\n if (\n !differentLanguage &&\n DIFFERENT_LANG_CHECK[language + contentTranslationHideLanguages]\n ) {\n setDifferentLanguage(true);\n return;\n }\n let timeout = setTimeout(() => {\n const different = checkDifferentLanguage(\n language,\n contentTranslationHideLanguages,\n );\n if (different) setDifferentLanguage(different);\n }, 1);\n return () => clearTimeout(timeout);\n }, [language, differentLanguage, contentTranslationHideLanguages]);\n\n const reblogIterator = useRef();\n const favouriteIterator = useRef();\n async function fetchBoostedLikedByAccounts(firstLoad) {\n if (firstLoad) {\n reblogIterator.current = masto.v1.statuses\n .$select(statusID)\n .rebloggedBy.list({\n limit: REACTIONS_LIMIT,\n });\n favouriteIterator.current = masto.v1.statuses\n .$select(statusID)\n .favouritedBy.list({\n limit: REACTIONS_LIMIT,\n });\n }\n const [{ value: reblogResults }, { value: favouriteResults }] =\n await Promise.allSettled([\n reblogIterator.current.next(),\n favouriteIterator.current.next(),\n ]);\n if (reblogResults.value?.length || favouriteResults.value?.length) {\n const accounts = [];\n if (reblogResults.value?.length) {\n accounts.push(\n ...reblogResults.value.map((a) => {\n a._types = ['reblog'];\n return a;\n }),\n );\n }\n if (favouriteResults.value?.length) {\n accounts.push(\n ...favouriteResults.value.map((a) => {\n a._types = ['favourite'];\n return a;\n }),\n );\n }\n return {\n value: accounts,\n done: reblogResults.done && favouriteResults.done,\n };\n }\n return {\n value: [],\n done: true,\n };\n }\n\n const actionsRef = useRef();\n const isPublic = ['public', 'unlisted'].includes(visibility);\n const isPinnable = ['public', 'unlisted', 'private'].includes(visibility);\n const menuFooter =\n mediaNoDesc && !reblogged ? (\n
\n \n Some media have no descriptions.\n
\n ) : (\n statusMonthsAgo >= 3 && (\n
\n \n \n \n Old post ({rtf.format(-statusMonthsAgo, 'month')}\n )\n \n \n
\n )\n );\n const StatusMenuItems = (\n <>\n {!isSizeLarge && sameInstance && (\n <>\n
\n \n \n \n {repliesCount > 0 ? shortenNumber(repliesCount) : t`Reply`}\n \n \n \n \n {reblogged ? t`Unboost` : t`Boost`}\n \n }\n className={`menu-reblog ${reblogged ? 'checked' : ''}`}\n menuExtras={\n {\n showCompose({\n draftStatus: {\n status: `\\n${url}`,\n },\n });\n }}\n >\n \n \n Quote\n \n \n }\n menuFooter={menuFooter}\n disabled={!canBoost}\n onClick={async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n }}\n >\n \n \n {reblogsCount > 0\n ? shortenNumber(reblogsCount)\n : reblogged\n ? t`Unboost`\n : t`Boost…`}\n \n \n \n \n \n {favouritesCount > 0\n ? shortenNumber(favouritesCount)\n : favourited\n ? t`Unlike`\n : t`Like`}\n \n \n {supports('@mastodon/post-bookmark') && (\n \n \n {bookmarked ? t`Unbookmark` : t`Bookmark`}\n \n )}\n
\n \n )}\n {!isSizeLarge && sameInstance && (isSizeLarge || showActionsBar) && (\n \n )}\n {(isSizeLarge || showActionsBar) && (\n <>\n {\n states.showGenericAccounts = {\n heading: t`Boosted/Liked by…`,\n fetchAccounts: fetchBoostedLikedByAccounts,\n instance,\n showReactions: true,\n postID: sKey,\n };\n }}\n >\n \n \n Boosted/Liked by…\n \n \n \n )}\n {(isSizeLarge ||\n (!mediaFirst &&\n (enableTranslate || !language || differentLanguage))) && (\n \n )}\n {!mediaFirst && (enableTranslate || !language || differentLanguage) && (\n
\n {enableTranslate ? (\n setForceTranslate(true)}\n >\n \n \n Translate\n \n \n ) : (\n \n \n \n Translate\n \n \n )}\n {supportsTTS && (\n {\n try {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n } catch (error) {\n console.error('Failed to speak text:', error);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
\n )}\n {isSizeLarge && (\n {\n try {\n const postText = getPostText(status);\n navigator.clipboard.writeText(postText);\n showToast(t`Post text copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy post text`);\n }\n }}\n >\n \n \n Copy post text\n \n \n )}\n {((!isSizeLarge && sameInstance) ||\n enableTranslate ||\n !language ||\n differentLanguage) && }\n {!isSizeLarge && (\n <>\n {\n onStatusLinkClick(e, status);\n }}\n >\n \n \n \n View post by{' '}\n @{username || acct}\n \n
\n \n {_(visibilityText[visibility])} • {createdDateText}\n \n
\n \n \n )}\n {!!editedAt && (\n <>\n {\n setShowEdited(id);\n }}\n >\n \n \n Show Edit History\n
\n \n Edited: {editedDateText}\n \n
\n \n \n )}\n \n \n \n {nicePostURL(url)}\n \n \n
\n {\n // Copy url to clipboard\n try {\n navigator.clipboard.writeText(url);\n showToast(t`Link copied`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to copy link`);\n }\n }}\n >\n \n \n Copy\n \n \n {isPublic &&\n navigator?.share &&\n navigator?.canShare?.({\n url,\n }) && (\n {\n try {\n navigator.share({\n url,\n });\n } catch (e) {\n console.error(e);\n alert(t`Sharing doesn't seem to work.`);\n }\n }}\n >\n \n \n Share…\n \n \n )}\n
\n {isPublic && isSizeLarge && (\n {\n setShowEmbed(true);\n }}\n >\n \n \n Embed post\n \n \n )}\n {(isSelf || mentionSelf) && }\n {(isSelf || mentionSelf) && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [muted ? 'unmute' : 'mute']();\n saveStatus(newStatus, instance);\n showToast(\n muted ? t`Conversation unmuted` : t`Conversation muted`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n muted\n ? t`Unable to unmute conversation`\n : t`Unable to mute conversation`,\n );\n }\n }}\n >\n {muted ? (\n <>\n \n \n Unmute conversation\n \n \n ) : (\n <>\n \n \n Mute conversation\n \n \n )}\n \n )}\n {isSelf && isPinnable && (\n {\n try {\n const newStatus = await masto.v1.statuses\n .$select(id)\n [pinned ? 'unpin' : 'pin']();\n saveStatus(newStatus, instance);\n showToast(\n pinned\n ? t`Post unpinned from profile`\n : t`Post pinned to profile`,\n );\n } catch (e) {\n console.error(e);\n showToast(\n pinned ? t`Unable to unpin post` : t`Unable to pin post`,\n );\n }\n }}\n >\n {pinned ? (\n <>\n \n \n Unpin from profile\n \n \n ) : (\n <>\n \n \n Pin to profile\n \n \n )}\n \n )}\n {isSelf && (\n
\n {supports('@mastodon/post-edit') && (\n {\n showCompose({\n editStatus: status,\n });\n }}\n >\n \n \n Edit\n \n \n )}\n {isSizeLarge && (\n \n \n \n Delete this post?\n \n \n }\n itemProps={{\n className: 'danger',\n }}\n menuItemClassName=\"danger\"\n onClick={() => {\n // const yes = confirm('Delete this post?');\n // if (yes) {\n (async () => {\n try {\n await masto.v1.statuses.$select(id).remove();\n const cachedStatus = getStatus(id, instance);\n cachedStatus._deleted = true;\n showToast(t`Post deleted`);\n } catch (e) {\n console.error(e);\n showToast(t`Unable to delete post`);\n }\n })();\n // }\n }}\n >\n \n \n Delete…\n \n \n )}\n
\n )}\n {!isSelf && isSizeLarge && (\n <>\n \n {\n states.showReportModal = {\n account: status.account,\n post: status,\n };\n }}\n >\n \n \n Report post…\n \n \n \n )}\n \n );\n\n const contextMenuRef = useRef();\n const [isContextMenuOpen, setIsContextMenuOpen] = useState(false);\n const [contextMenuProps, setContextMenuProps] = useState({});\n\n const showContextMenu =\n allowContextMenu || (!isSizeLarge && !previewMode && !_deleted && !quoted);\n\n // Only iOS/iPadOS browsers don't support contextmenu\n // Some comments report iPadOS might support contextmenu if a mouse is connected\n const bindLongPressContext = useLongPress(\n isIOS && showContextMenu\n ? (e) => {\n if (e.pointerType === 'mouse') return;\n // There's 'pen' too, but not sure if contextmenu event would trigger from a pen\n\n const { clientX, clientY } = e.touches?.[0] || e;\n // link detection copied from onContextMenu because here it works\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: clientX,\n y: clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }\n : null,\n {\n threshold: 600,\n captureEvent: true,\n detect: 'touch',\n cancelOnMovement: 2, // true allows movement of up to 25 pixels\n },\n );\n\n const hotkeysEnabled = !readOnly && !previewMode && !quoted;\n const rRef = useHotkeys('r, shift+r', replyStatus, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const fRef = useHotkeys('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\n useKey: true,\n });\n const bRef = useHotkeys(\n 'shift+b',\n (e) => {\n // Need shiftKey check due to useKey: true\n if (!e.shiftKey) return;\n\n (async () => {\n try {\n const done = await confirmBoostStatus();\n if (!isSizeLarge && done) {\n showToast(\n reblogged\n ? t`Unboosted @${username || acct}'s post`\n : t`Boosted @${username || acct}'s post`,\n );\n }\n } catch (e) {}\n })();\n },\n {\n enabled: hotkeysEnabled && canBoost,\n useKey: true,\n },\n );\n const xRef = useHotkeys(\n 'x',\n (e) => {\n const activeStatus = document.activeElement.closest(\n '.status-link, .status-focus',\n );\n if (activeStatus) {\n const spoilerButton = activeStatus.querySelector(\n '.spoiler-button:not(.spoiling)',\n );\n if (spoilerButton) {\n e.stopPropagation();\n spoilerButton.click();\n } else {\n const spoilerMediaButton = activeStatus.querySelector(\n '.spoiler-media-button:not(.spoiling)',\n );\n if (spoilerMediaButton) {\n e.stopPropagation();\n spoilerMediaButton.click();\n }\n }\n }\n },\n {\n useKey: true,\n },\n );\n\n const displayedMediaAttachments = mediaAttachments.slice(\n 0,\n isSizeLarge ? undefined : 4,\n );\n const showMultipleMediaCaptions =\n mediaAttachments.length > 1 &&\n displayedMediaAttachments.some(\n (media) => !!media.description && !isMediaCaptionLong(media.description),\n );\n const captionChildren = useMemo(() => {\n if (!showMultipleMediaCaptions) return null;\n const attachments = [];\n displayedMediaAttachments.forEach((media, i) => {\n if (!media.description) return;\n const index = attachments.findIndex(\n (attachment) => attachment.media.description === media.description,\n );\n if (index === -1) {\n attachments.push({\n media,\n indices: [i],\n });\n } else {\n attachments[index].indices.push(i);\n }\n });\n return attachments.map(({ media, indices }) => (\n i + 1).join(' ')}\n onClick={(e) => {\n e.preventDefault();\n e.stopPropagation();\n states.showMediaAlt = {\n alt: media.description,\n lang: language,\n };\n }}\n title={media.description}\n >\n {indices.map((i) => i + 1).join(' ')} {media.description}\n \n ));\n\n // return displayedMediaAttachments.map(\n // (media, i) =>\n // !!media.description && (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // states.showMediaAlt = {\n // alt: media.description,\n // lang: language,\n // };\n // }}\n // title={media.description}\n // >\n // {i + 1} {media.description}\n // \n // ),\n // );\n }, [showMultipleMediaCaptions, displayedMediaAttachments, language]);\n\n const isThread = useMemo(() => {\n return (\n (!!inReplyToId && inReplyToAccountId === status.account?.id) ||\n !!snapStates.statusThreadNumber[sKey]\n );\n }, [\n inReplyToId,\n inReplyToAccountId,\n status.account?.id,\n snapStates.statusThreadNumber[sKey],\n ]);\n\n const showCommentHint = useMemo(() => {\n return (\n enableCommentHint &&\n !isThread &&\n !withinContext &&\n !inReplyToId &&\n visibility === 'public' &&\n repliesCount > 0\n );\n }, [\n enableCommentHint,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n visibility,\n ]);\n const showCommentCount = useMemo(() => {\n if (\n card ||\n poll ||\n sensitive ||\n spoilerText ||\n mediaAttachments?.length ||\n isThread ||\n withinContext ||\n inReplyToId ||\n repliesCount <= 0\n ) {\n return false;\n }\n const questionRegex = /[???︖❓❔⁇⁈⁉¿‽؟]/;\n const containsQuestion = questionRegex.test(content);\n if (!containsQuestion) return false;\n const contentLength = htmlContentLength(content);\n if (contentLength > 0 && contentLength <= SHOW_COMMENT_COUNT_LIMIT) {\n return true;\n }\n }, [\n card,\n poll,\n sensitive,\n spoilerText,\n mediaAttachments,\n reblog,\n isThread,\n withinContext,\n inReplyToId,\n repliesCount,\n content,\n ]);\n\n return (\n \n {showReplyParent && !!(inReplyToId && inReplyToAccountId) && (\n \n )}\n {\n statusRef.current = node;\n // Use parent node if it's in focus\n // Use case: \n // When navigating (j/k), the is focused instead of \n // Hotkey binding doesn't bubble up thus this hack\n const nodeRef =\n node?.closest?.(\n '.timeline-item, .timeline-item-alt, .status-link, .status-focus',\n ) || node;\n rRef.current = nodeRef;\n fRef.current = nodeRef;\n dRef.current = nodeRef;\n bRef.current = nodeRef;\n xRef.current = nodeRef;\n }}\n tabindex=\"-1\"\n class={`status ${\n !withinContext && inReplyToId && inReplyToAccount\n ? 'status-reply-to'\n : ''\n } visibility-${visibility} ${_pinned ? 'status-pinned' : ''} ${\n SIZE_CLASS[size]\n } ${_deleted ? 'status-deleted' : ''} ${quoted ? 'status-card' : ''} ${\n isContextMenuOpen ? 'status-menu-open' : ''\n } ${mediaFirst && hasMediaAttachments ? 'status-media-first' : ''}`}\n onMouseEnter={debugHover}\n onContextMenu={(e) => {\n if (!showContextMenu) return;\n if (e.metaKey) return;\n // console.log('context menu', e);\n const link = e.target.closest('a');\n if (\n link &&\n statusRef.current.contains(link) &&\n !link.getAttribute('href').startsWith('#')\n )\n return;\n\n // If there's selected text, don't show custom context menu\n const selection = window.getSelection?.();\n if (selection.toString().length > 0) {\n const { anchorNode } = selection;\n if (statusRef.current?.contains(anchorNode)) {\n return;\n }\n }\n e.preventDefault();\n setContextMenuProps({\n anchorPoint: {\n x: e.clientX,\n y: e.clientY,\n },\n direction: 'right',\n });\n setIsContextMenuOpen(true);\n }}\n {...(showContextMenu ? bindLongPressContext() : {})}\n >\n {showContextMenu && (\n {\n setIsContextMenuOpen(false);\n // statusRef.current?.focus?.();\n if (e?.reason === 'click') {\n statusRef.current?.closest('[tabindex]')?.focus?.();\n }\n }}\n portal={{\n target: document.body,\n }}\n containerProps={{\n style: {\n // Higher than the backdrop\n zIndex: 1001,\n },\n onClick: () => {\n contextMenuRef.current?.closeMenu?.();\n },\n }}\n overflow=\"auto\"\n boundingBoxPadding={safeBoundingBoxPadding()}\n unmountOnClose\n >\n {StatusMenuItems}\n \n )}\n {showActionsBar &&\n size !== 'l' &&\n !previewMode &&\n !readOnly &&\n !_deleted &&\n !quoted && (\n \n \n \n {\n e.preventDefault();\n e.stopPropagation();\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'start',\n direction: 'left',\n gap: 0,\n shift: -8,\n });\n setIsContextMenuOpen('actions-bar');\n }}\n >\n \n \n \n )}\n {size !== 'l' && (\n
\n {reblogged && (\n \n )}\n {favourited && (\n \n )}\n {bookmarked && (\n \n )}\n {_pinned && (\n \n )}\n
\n )}\n {size !== 's' && (\n {\n e.preventDefault();\n e.stopPropagation();\n states.showAccount = {\n account: status.account,\n instance,\n };\n }}\n >\n \n
\n )}\n
\n {!!(status.account || createdAt) && (\n
\n \n \n \n {/* {inReplyToAccount && !withinContext && size !== 's' && (\n <>\n {' '}\n \n {' '}\n \n \n \n )} */}\n {/* */}{' '}\n {size !== 'l' &&\n (_deleted ? (\n \n Deleted\n \n ) : url && !previewMode && !readOnly && !quoted ? (\n {\n if (\n e.metaKey ||\n e.ctrlKey ||\n e.shiftKey ||\n e.altKey ||\n e.which === 2\n ) {\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n onStatusLinkClick?.(e, status);\n setContextMenuProps({\n anchorRef: {\n current: e.currentTarget,\n },\n align: 'end',\n direction: 'bottom',\n gap: 4,\n });\n setIsContextMenuOpen(true);\n }}\n class={`time ${\n isContextMenuOpen && contextMenuProps?.anchorRef\n ? 'is-open'\n : ''\n }`}\n >\n {showCommentHint && !showCommentCount ? (\n \n ) : (\n visibility !== 'public' &&\n visibility !== 'direct' && (\n \n )\n )}{' '}\n \n {!previewMode && !readOnly && (\n \n )}\n \n ) : (\n // {\n // if (e.target === e.currentTarget)\n // menuInstanceRef.current?.closeMenu?.();\n // },\n // }}\n // align=\"end\"\n // gap={4}\n // overflow=\"auto\"\n // viewScroll=\"close\"\n // boundingBoxPadding=\"8 8 8 8\"\n // unmountOnClose\n // menuButton={({ open }) => (\n // {\n // e.preventDefault();\n // e.stopPropagation();\n // onStatusLinkClick?.(e, status);\n // }}\n // class={`time ${open ? 'is-open' : ''}`}\n // >\n // {' '}\n // \n // \n // )}\n // >\n // {StatusMenuItems}\n // \n \n {visibility !== 'public' && visibility !== 'direct' && (\n <>\n {' '}\n \n )}\n \n \n ))}\n
\n )}\n {visibility === 'direct' && (\n <>\n
\n Private mention\n
{' '}\n \n )}\n {!withinContext && (\n <>\n {isThread ? (\n
\n \n \n Thread\n {snapStates.statusThreadNumber[sKey]\n ? ` ${snapStates.statusThreadNumber[sKey]}/X`\n : ''}\n \n
\n ) : (\n !!inReplyToId &&\n !!inReplyToAccount &&\n (!!spoilerText ||\n !mentions.find((mention) => {\n return mention.id === inReplyToAccountId;\n })) && (\n
\n {' '}\n \n
\n )\n )}\n \n )}\n \n {mediaFirst && hasMediaAttachments ? (\n <>\n {(!!spoilerText || !!sensitive) && !readingExpandSpoilers && (\n <>\n {!!spoilerText && (\n \n {' '}\n \n )}\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n \n )}\n \n {!!content && (\n
\n \n
\n )}\n \n ) : (\n <>\n {!!spoilerText && (\n <>\n \n

\n \n

\n
\n {readingExpandSpoilers || previewMode ? (\n
\n Content warning\n
\n ) : (\n {\n e.preventDefault();\n e.stopPropagation();\n if (showSpoiler) {\n delete states.spoilers[id];\n if (!readingExpandSpoilers) {\n delete states.spoilersMedia[id];\n }\n } else {\n states.spoilers[id] = true;\n if (!readingExpandSpoilers) {\n states.spoilersMedia[id] = true;\n }\n }\n }}\n >\n {' '}\n {showSpoiler ? t`Show less` : t`Show content`}\n \n )}\n \n )}\n {!!content && (\n \n \n \n \n )}\n {!!poll && (\n {\n states.statuses[sKey].poll = newPoll;\n }}\n refresh={() => {\n return masto.v1.polls\n .$select(poll.id)\n .fetch()\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n votePoll={(choices) => {\n return masto.v1.polls\n .$select(poll.id)\n .votes.create({\n choices,\n })\n .then((pollResponse) => {\n states.statuses[sKey].poll = pollResponse;\n })\n .catch((e) => {}); // Silently fail\n }}\n />\n )}\n {(((enableTranslate || inlineTranslate) &&\n isTranslateble(content, emojis) &&\n differentLanguage) ||\n forceTranslate) && (\n \n )}\n {!previewMode &&\n (sensitive || filterInfo?.action === 'blur') &&\n !!mediaAttachments.length &&\n (readingExpandMedia !== 'show_all' ||\n filterInfo?.action === 'blur') && (\n
\n );\n}\n\nfunction MultipleMediaFigure(props) {\n const { enabled, children, lang, captionChildren } = props;\n if (!enabled || !captionChildren) return children;\n return (\n
\n {children}\n
\n {captionChildren}\n
\n
\n );\n}\n\nfunction MediaFirstContainer(props) {\n const { mediaAttachments, language, postID, instance } = props;\n const moreThanOne = mediaAttachments.length > 1;\n\n const carouselRef = useRef();\n const [currentIndex, setCurrentIndex] = useState(0);\n\n useEffect(() => {\n let handleScroll = () => {\n const { clientWidth, scrollLeft } = carouselRef.current;\n const index = Math.round(Math.abs(scrollLeft) / clientWidth);\n setCurrentIndex(index);\n };\n if (carouselRef.current) {\n carouselRef.current.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n }\n return () => {\n if (carouselRef.current) {\n carouselRef.current.removeEventListener('scroll', handleScroll);\n }\n };\n }, []);\n\n return (\n <>\n
\n
\n {mediaAttachments.map((media, i) => (\n
\n \n
\n ))}\n
\n {moreThanOne && (\n \n )}\n
\n {moreThanOne && (\n \n {mediaAttachments.map((media, i) => (\n \n ))}\n \n )}\n \n );\n}\n\n// \"Post\": Quote post + card link preview combo\n// Assume all links from these domains are \"posts\"\n// Mastodon links are \"posts\" too but they are converted to real quote posts and there's too many domains to check\n// This is just \"Progressive Enhancement\"\nfunction isCardPost(domain) {\n return ['x.com', 'twitter.com', 'threads.net', 'bsky.app'].includes(domain);\n}\n\nfunction Byline({ authors, hidden, children }) {\n if (hidden) return children;\n if (!authors?.[0]?.account?.id) return children;\n const author = authors[0].account;\n\n return (\n \n );\n}\n\nfunction Card({ card, selfReferential, selfAuthor, instance }) {\n const snapStates = useSnapshot(states);\n const {\n blurhash,\n title,\n description,\n html,\n providerName,\n providerUrl,\n authorName,\n authorUrl,\n width,\n height,\n image,\n imageDescription,\n url,\n type,\n embedUrl,\n language,\n publishedAt,\n authors,\n } = card;\n\n /* type\n link = Link OEmbed\n photo = Photo OEmbed\n video = Video OEmbed\n rich = iframe OEmbed. Not currently accepted, so won’t show up in practice.\n */\n\n const hasText = title || providerName || authorName;\n const isLandscape = width / height >= 1.2;\n const size = isLandscape ? 'large' : '';\n\n const [cardStatusURL, setCardStatusURL] = useState(null);\n // const [cardStatusID, setCardStatusID] = useState(null);\n useEffect(() => {\n if (hasText && image && !selfReferential && isMastodonLinkMaybe(url)) {\n unfurlMastodonLink(instance, url).then((result) => {\n if (!result) return;\n const { id, url } = result;\n setCardStatusURL('#' + url);\n\n // NOTE: This is for quote post\n // (async () => {\n // const { masto } = api({ instance });\n // const status = await masto.v1.statuses.$select(id).fetch();\n // saveStatus(status, instance);\n // setCardStatusID(id);\n // })();\n });\n }\n }, [hasText, image, selfReferential]);\n\n // if (cardStatusID) {\n // return (\n // \n // );\n // }\n\n if (snapStates.unfurledLinks[url]) return null;\n\n const hasIframeHTML = /