From 07c081cdac298edb03044b4278c5be7c33f847e3 Mon Sep 17 00:00:00 2001 From: archos Date: Sun, 23 Mar 2025 08:05:23 +0100 Subject: [PATCH] =?UTF-8?q?nov=C3=A1=20verze=20phanpy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/ScheduledAtField-ely_oZde.js | 189 +++++++++++++++++++ assets/ScheduledAtField-ely_oZde.js.map | 1 + assets/compose-BoxFdGQa.js | 2 + assets/compose-BoxFdGQa.js.map | 1 + assets/compose-Cc1vo2Eb.js | 26 +++ assets/compose-Cc1vo2Eb.js.map | 1 + assets/locales/ar-SA-BKDop0KP.js | 2 + assets/locales/ar-SA-BKDop0KP.js.map | 1 + assets/locales/ca-ES-B6qgZE-Q.js | 2 + assets/locales/ca-ES-B6qgZE-Q.js.map | 1 + assets/locales/cs-CZ-BRBECUth.js | 2 + assets/locales/cs-CZ-BRBECUth.js.map | 1 + assets/locales/de-DE-BeU9hNWZ.js | 2 + assets/locales/de-DE-BeU9hNWZ.js.map | 1 + assets/locales/eo-UY-s5UPknhY.js | 2 + assets/locales/eo-UY-s5UPknhY.js.map | 1 + assets/locales/es-ES-DM1LlQgX.js | 2 + assets/locales/es-ES-DM1LlQgX.js.map | 1 + assets/locales/eu-ES-C1fJp1MP.js | 2 + assets/locales/eu-ES-C1fJp1MP.js.map | 1 + assets/locales/fa-IR-BX-s04jW.js | 2 + assets/locales/fa-IR-BX-s04jW.js.map | 1 + assets/locales/fi-FI-CixdNOfp.js | 2 + assets/locales/fi-FI-CixdNOfp.js.map | 1 + assets/locales/fr-FR-DMpzd5aT.js | 2 + assets/locales/fr-FR-DMpzd5aT.js.map | 1 + assets/locales/gl-ES-BpWq-enh.js | 2 + assets/locales/gl-ES-BpWq-enh.js.map | 1 + assets/locales/he-IL-BKDop0KP.js | 2 + assets/locales/he-IL-BKDop0KP.js.map | 1 + assets/locales/it-IT-Cj9xRaYV.js | 2 + assets/locales/it-IT-Cj9xRaYV.js.map | 1 + assets/locales/ja-JP-BKDop0KP.js | 2 + assets/locales/ja-JP-BKDop0KP.js.map | 1 + assets/locales/kab-BSo8QL-M.js | 2 + assets/locales/kab-BSo8QL-M.js.map | 1 + assets/locales/ko-KR-CCi4AY19.js | 2 + assets/locales/ko-KR-CCi4AY19.js.map | 1 + assets/locales/lt-LT-QZz23k3d.js | 2 + assets/locales/lt-LT-QZz23k3d.js.map | 1 + assets/locales/nb-NO-BKDop0KP.js | 2 + assets/locales/nb-NO-BKDop0KP.js.map | 1 + assets/locales/nl-NL-C0LWgGmr.js | 2 + assets/locales/nl-NL-C0LWgGmr.js.map | 1 + assets/locales/oc-FR-BKDop0KP.js | 2 + assets/locales/oc-FR-BKDop0KP.js.map | 1 + assets/locales/pl-PL-DRhZvGKv.js | 2 + assets/locales/pl-PL-DRhZvGKv.js.map | 1 + assets/locales/pseudo-LOCALE-BRX56zE-.js | 2 + assets/locales/pseudo-LOCALE-BRX56zE-.js.map | 1 + assets/locales/pt-BR-C4cVvrKb.js | 2 + assets/locales/pt-BR-C4cVvrKb.js.map | 1 + assets/locales/pt-PT-BD2kqSFu.js | 2 + assets/locales/pt-PT-BD2kqSFu.js.map | 1 + assets/locales/ru-RU-CJU5joyS.js | 2 + assets/locales/ru-RU-CJU5joyS.js.map | 1 + assets/locales/th-TH-BKDop0KP.js | 2 + assets/locales/th-TH-BKDop0KP.js.map | 1 + assets/locales/tr-TR-BKDop0KP.js | 2 + assets/locales/tr-TR-BKDop0KP.js.map | 1 + assets/locales/uk-UA-Buz66hDH.js | 2 + assets/locales/uk-UA-Buz66hDH.js.map | 1 + assets/locales/zh-CN-CFJRN5B6.js | 2 + assets/locales/zh-CN-CFJRN5B6.js.map | 1 + assets/locales/zh-TW-BKDop0KP.js | 2 + assets/locales/zh-TW-BKDop0KP.js.map | 1 + assets/main-DxpudQKD.js | 34 ++++ assets/main-DxpudQKD.js.map | 1 + assets/polyfill-force-CVqFwhoc.js | 9 + assets/polyfill-force-CVqFwhoc.js.map | 1 + assets/useTitle-C_BZYcuR.js | 46 +++++ assets/useTitle-C_BZYcuR.js.map | 1 + assets/useTitle-F84OMduh.css | 7 + compose/index.html | 6 +- index.html | 8 +- version.json | 2 +- 76 files changed, 417 insertions(+), 8 deletions(-) create mode 100644 assets/ScheduledAtField-ely_oZde.js create mode 100644 assets/ScheduledAtField-ely_oZde.js.map create mode 100644 assets/compose-BoxFdGQa.js create mode 100644 assets/compose-BoxFdGQa.js.map create mode 100644 assets/compose-Cc1vo2Eb.js create mode 100644 assets/compose-Cc1vo2Eb.js.map create mode 100644 assets/locales/ar-SA-BKDop0KP.js create mode 100644 assets/locales/ar-SA-BKDop0KP.js.map create mode 100644 assets/locales/ca-ES-B6qgZE-Q.js create mode 100644 assets/locales/ca-ES-B6qgZE-Q.js.map create mode 100644 assets/locales/cs-CZ-BRBECUth.js create mode 100644 assets/locales/cs-CZ-BRBECUth.js.map create mode 100644 assets/locales/de-DE-BeU9hNWZ.js create mode 100644 assets/locales/de-DE-BeU9hNWZ.js.map create mode 100644 assets/locales/eo-UY-s5UPknhY.js create mode 100644 assets/locales/eo-UY-s5UPknhY.js.map create mode 100644 assets/locales/es-ES-DM1LlQgX.js create mode 100644 assets/locales/es-ES-DM1LlQgX.js.map create mode 100644 assets/locales/eu-ES-C1fJp1MP.js create mode 100644 assets/locales/eu-ES-C1fJp1MP.js.map create mode 100644 assets/locales/fa-IR-BX-s04jW.js create mode 100644 assets/locales/fa-IR-BX-s04jW.js.map create mode 100644 assets/locales/fi-FI-CixdNOfp.js create mode 100644 assets/locales/fi-FI-CixdNOfp.js.map create mode 100644 assets/locales/fr-FR-DMpzd5aT.js create mode 100644 assets/locales/fr-FR-DMpzd5aT.js.map create mode 100644 assets/locales/gl-ES-BpWq-enh.js create mode 100644 assets/locales/gl-ES-BpWq-enh.js.map create mode 100644 assets/locales/he-IL-BKDop0KP.js create mode 100644 assets/locales/he-IL-BKDop0KP.js.map create mode 100644 assets/locales/it-IT-Cj9xRaYV.js create mode 100644 assets/locales/it-IT-Cj9xRaYV.js.map create mode 100644 assets/locales/ja-JP-BKDop0KP.js create mode 100644 assets/locales/ja-JP-BKDop0KP.js.map create mode 100644 assets/locales/kab-BSo8QL-M.js create mode 100644 assets/locales/kab-BSo8QL-M.js.map create mode 100644 assets/locales/ko-KR-CCi4AY19.js create mode 100644 assets/locales/ko-KR-CCi4AY19.js.map create mode 100644 assets/locales/lt-LT-QZz23k3d.js create mode 100644 assets/locales/lt-LT-QZz23k3d.js.map create mode 100644 assets/locales/nb-NO-BKDop0KP.js create mode 100644 assets/locales/nb-NO-BKDop0KP.js.map create mode 100644 assets/locales/nl-NL-C0LWgGmr.js create mode 100644 assets/locales/nl-NL-C0LWgGmr.js.map create mode 100644 assets/locales/oc-FR-BKDop0KP.js create mode 100644 assets/locales/oc-FR-BKDop0KP.js.map create mode 100644 assets/locales/pl-PL-DRhZvGKv.js create mode 100644 assets/locales/pl-PL-DRhZvGKv.js.map create mode 100644 assets/locales/pseudo-LOCALE-BRX56zE-.js create mode 100644 assets/locales/pseudo-LOCALE-BRX56zE-.js.map create mode 100644 assets/locales/pt-BR-C4cVvrKb.js create mode 100644 assets/locales/pt-BR-C4cVvrKb.js.map create mode 100644 assets/locales/pt-PT-BD2kqSFu.js create mode 100644 assets/locales/pt-PT-BD2kqSFu.js.map create mode 100644 assets/locales/ru-RU-CJU5joyS.js create mode 100644 assets/locales/ru-RU-CJU5joyS.js.map create mode 100644 assets/locales/th-TH-BKDop0KP.js create mode 100644 assets/locales/th-TH-BKDop0KP.js.map create mode 100644 assets/locales/tr-TR-BKDop0KP.js create mode 100644 assets/locales/tr-TR-BKDop0KP.js.map create mode 100644 assets/locales/uk-UA-Buz66hDH.js create mode 100644 assets/locales/uk-UA-Buz66hDH.js.map create mode 100644 assets/locales/zh-CN-CFJRN5B6.js create mode 100644 assets/locales/zh-CN-CFJRN5B6.js.map create mode 100644 assets/locales/zh-TW-BKDop0KP.js create mode 100644 assets/locales/zh-TW-BKDop0KP.js.map create mode 100644 assets/main-DxpudQKD.js create mode 100644 assets/main-DxpudQKD.js.map create mode 100644 assets/polyfill-force-CVqFwhoc.js create mode 100644 assets/polyfill-force-CVqFwhoc.js.map create mode 100644 assets/useTitle-C_BZYcuR.js create mode 100644 assets/useTitle-C_BZYcuR.js.map create mode 100644 assets/useTitle-F84OMduh.css diff --git a/assets/ScheduledAtField-ely_oZde.js b/assets/ScheduledAtField-ely_oZde.js new file mode 100644 index 0000000..db79a0e --- /dev/null +++ b/assets/ScheduledAtField-ely_oZde.js @@ -0,0 +1,189 @@ +import{ad as le,Q as Ot,d as o,h as H,q as At,A as O,_ as Ie,y as tt,B as bo,ae as Da,j as it,N as _e,f as Ji,af as La,ag as ir,ah as Ra,ai as ts,P as es,k as $,M as Ge,V as Rt,x as wn,r as kt,s as V,aj as S,ak as Ma,o as Pa,e as Qr,al as Oa,u as ne,a as sr,z as $a,am as Fa,an as Na,T as P,ao as ns,ap as Ba,aq as rs,p as hr,v as os,g as Eo,ar as za,as as Mt,at as Va,au as Ha,av as Un,I as ie,c as xn,b as he,W as is,aw as Ua,ax as ja,ay as Ka}from"./useTitle-C_BZYcuR.js";function Jr(){return Jr=Object.assign?Object.assign.bind():function(t){for(var e=1;e'),!0):e?t.some(function(n){return e.includes(n)})||t.includes("*"):!0}var tc=function(e,n,r){r===void 0&&(r=!1);var i=n.alt,a=n.meta,s=n.mod,c=n.shift,l=n.ctrl,u=n.keys,f=e.key,h=e.code,m=e.ctrlKey,d=e.metaKey,p=e.shiftKey,v=e.altKey,y=pe(h),E=f.toLowerCase();if(!(u!=null&&u.includes(y))&&!(u!=null&&u.includes(E))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(y))return!1;if(!r){if(i===!v&&E!=="alt"||c===!p&&E!=="shift")return!1;if(s){if(!d&&!m)return!1}else if(a===!d&&E!=="meta"&&E!=="os"||l===!m&&E!=="ctrl"&&E!=="control")return!1}return u&&u.length===1&&(u.includes(E)||u.includes(y))?!0:u?qa(u):!u},ec=le(void 0),nc=function(){return Ot(ec)};function us(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce(function(n,r){return n&&us(t[r],e[r])},!0):t===e}var rc=le({hotkeys:[],enabledScopes:[],toggleScope:function(){},enableScope:function(){},disableScope:function(){}}),oc=function(){return Ot(rc)};function ic(t){var e=O(void 0);return us(e.current,t)||(e.current=t),e.current}var ri=function(e){e.stopPropagation(),e.preventDefault(),e.stopImmediatePropagation()},sc=typeof window<"u"?Ie:tt;function Be(t,e,n,r){var i=H(null),a=i[0],s=i[1],c=O(!1),l=n instanceof Array?r instanceof Array?void 0:r:n,u=wo(t)?t.join(l==null?void 0:l.splitKey):t,f=n instanceof Array?n:r instanceof Array?r:void 0,h=At(e,f??[]),m=O(h);f?m.current=h:m.current=e;var d=ic(l),p=oc(),v=p.enabledScopes,y=nc();return sc(function(){if(!((d==null?void 0:d.enabled)===!1||!Ja(v,d==null?void 0:d.scopes))){var E=function(A,T){var D;if(T===void 0&&(T=!1),!(Xa(A)&&!ls(A,d==null?void 0:d.enableOnFormTags))){if(a!==null){var M=a.getRootNode();if((M instanceof Document||M instanceof ShadowRoot)&&M.activeElement!==a&&!a.contains(M.activeElement)){ri(A);return}}(D=A.target)!=null&&D.isContentEditable&&!(d!=null&&d.enableOnContentEditable)||Ar(u,d==null?void 0:d.splitKey).forEach(function(L){var C,x=Cr(L,d==null?void 0:d.combinationKey);if(tc(A,x,d==null?void 0:d.ignoreModifiers)||(C=x.keys)!=null&&C.includes("*")){if(d!=null&&d.ignoreEventWhen!=null&&d.ignoreEventWhen(A)||T&&c.current)return;if(Ga(A,x,d==null?void 0:d.preventDefault),!Ya(A,x,d==null?void 0:d.enabled)){ri(A);return}m.current(A,x),T||(c.current=!0)}})}},b=function(A){A.key!==void 0&&(as(pe(A.code)),((d==null?void 0:d.keydown)===void 0&&(d==null?void 0:d.keyup)!==!0||d!=null&&d.keydown)&&E(A))},w=function(A){A.key!==void 0&&(cs(pe(A.code)),c.current=!1,d!=null&&d.keyup&&E(A,!0))},k=a||(l==null?void 0:l.document)||document;return k.addEventListener("keyup",w),k.addEventListener("keydown",b),y&&Ar(u,d==null?void 0:d.splitKey).forEach(function(g){return y.addHotkey(Cr(g,d==null?void 0:d.combinationKey,d==null?void 0:d.description))}),function(){k.removeEventListener("keyup",w),k.removeEventListener("keydown",b),y&&Ar(u,d==null?void 0:d.splitKey).forEach(function(g){return y.removeHotkey(Cr(g,d==null?void 0:d.combinationKey,d==null?void 0:d.description))})}}},[a,u,d,v]),s}var er={exports:{}};/*! + * Toastify js 1.12.0 + * https://github.com/apvarun/toastify-js + * @license MIT licensed + * + * Copyright (C) 2018 Varun A P + */var ac=er.exports,oi;function cc(){return oi||(oi=1,function(t){(function(e,n){t.exports?t.exports=n():e.Toastify=n()})(ac,function(e){var n=function(s){return new n.lib.init(s)},r="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:r,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(y){y.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}).bind(this));var f=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&f>360?s.insertAdjacentElement("afterbegin",u):s.appendChild(u)}if(this.options.stopOnFocus&&this.options.duration>0){var h=this;s.addEventListener("mouseover",function(y){window.clearTimeout(s.timeOutValue)}),s.addEventListener("mouseleave",function(){s.timeOutValue=window.setTimeout(function(){h.removeElement(s)},h.options.duration)})}if(typeof this.options.destination<"u"&&s.addEventListener("click",(function(y){y.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(y){y.stopPropagation(),this.options.onClick()}).bind(this)),typeof this.options.offset=="object"){var m=i("x",this.options),d=i("y",this.options),p=this.options.position=="left"?m:"-"+m,v=this.options.gravity=="toastify-top"?d:"-"+d;s.style.transform="translate("+p+","+v+")"}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"),f,h=0;h0?window.innerWidth:screen.width;p<=360?(u[h].style[f]=l[f]+"px",l[f]+=m+d):a(u[h],"toastify-left")===!0?(u[h].style[f]=s[f]+"px",s[f]+=m+d):(u[h].style[f]=c[f]+"px",c[f]+=m+d)}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})}(er)),er.exports}var lc=cc();const uc=bo(lc);window._showToast=Lt;function Lt(t){typeof t=="string"&&(t={text:t});const{onClick:e,delay:n,...r}=t,i=uc({className:`${e||t.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...r,onClick:()=>{e==null||e(i)}});return n?setTimeout(()=>{i.showToast()},n):i.showToast(),i}function Vf(t,e,n,r){const i=O(t);tt(()=>{i.current=t},[t,n]),tt(()=>{!r||e===null||e===!1||i.current()},[r]),tt(()=>{if(e===null||e===!1)return;const s=setInterval(()=>i.current(),e);return()=>clearInterval(s)},[e])}const To=t=>!!t&&t[0]==="o",to=Da,Tn=(t,e)=>t===!0||!!(t&&t[e]),Ht=(t,e)=>typeof t=="function"?t(e):t,dc="_szhsinMenu",fc=t=>t[dc];const Ye=(t,e)=>(e&&Object.keys(e).forEach(n=>{const r=t[n],i=e[n];typeof i=="function"&&r?t[n]=(...a)=>{i(...a),r(...a)}:t[n]=i}),t),hc=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],r=isNaN(e[1])?n:e[1];return{top:n,right:r,bottom:isNaN(e[2])?n:e[2],left:isNaN(e[3])?r:e[3]}},Sr=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+r+n))return t}};function mr(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function ii(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 r=="function"?r(n):r;return typeof s=="string"&&(s=s.trim(),s&&(a+=` ${s}`)),a},[t,e,n,r]),mc="szh-menu-container",te="szh-menu";const pc="arrow",Ao="item",gc="divider",vc="header",_c="group",yc="submenu";const ds=le(),Co=le({}),ar=le({}),So=le({}),bc=le({}),pr=le({}),Pt=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),_t=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"}),ze=Object.freeze({FIRST:"first",LAST:"last"}),Ec=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),si="absolute",ko="none",xo="menuitem",eo={preventScroll:!0};const wc=({className:t,containerRef:e,containerProps:n,children:r,isOpen:i,theming:a,transition:s,onClose:c})=>{const l=Tn(s,"item");return o("div",{...Ye({onKeyDown:({key:h})=>{switch(h){case Pt.ESC:Ht(c,{key:h,reason:An.CANCEL});break}},onBlur:h=>{i&&!h.currentTarget.contains(h.relatedTarget)&&Ht(c,{reason:An.BLUR})}},n),className:ee({block:mc,modifiers:it(()=>({theme:a,itemTransition:l}),[a,l]),className:t}),style:{position:"absolute",...n==null?void 0:n.style},ref:e,children:r})},Tc=()=>{let t,e=0;return{toggle:n=>{n?e++:e--,e=Math.max(e,0)},on:(n,r,i)=>{e?t||(t=setTimeout(()=>{t=0,r()},n)):i==null||i()},off:()=>{t&&(clearTimeout(t),t=0)}}},Ac=t=>{const[e,n]=H(),i=O({items:[],hoverIndex:-1,sorted:!1}).current,a=At((c,l)=>{const{items:u}=i;if(!c)i.items=[];else if(l)u.push(c);else{const f=u.indexOf(c);f>-1&&(u.splice(f,1),c.contains(document.activeElement)&&(t.current.focus(eo),n()))}i.hoverIndex=-1,i.sorted=!1},[i,t]),s=At((c,l,u)=>{const{items:f,hoverIndex:h}=i,m=()=>{if(i.sorted)return;const v=t.current.querySelectorAll(".szh-menu__item");f.sort((y,E)=>ii(v,y)-ii(v,E)),i.sorted=!0};let d=-1,p;switch(c){case _t.RESET:break;case _t.SET:p=l;break;case _t.UNSET:p=v=>v===l?void 0:v;break;case _t.FIRST:m(),d=0,p=f[d];break;case _t.LAST:m(),d=f.length-1,p=f[d];break;case _t.SET_INDEX:m(),d=u,p=f[d];break;case _t.INCREASE:m(),d=h,d<0&&(d=f.indexOf(l)),d++,d>=f.length&&(d=0),p=f[d];break;case _t.DECREASE:m(),d=h,d<0&&(d=f.indexOf(l)),d--,d<0&&(d=f.length-1),p=f[d];break;default:}p||(d=-1),n(p),i.hoverIndex=d},[t,i]);return{hoverItem:e,dispatch:s,updateItems:a}},ai=(t,e)=>Math.round(t)===e?t:e,fs=t=>{const e=t.getBoundingClientRect();return e.width=ai(e.width,t.offsetWidth),e.height=ai(e.height,t.offsetHeight),e},Cc=(t,e,n,r)=>{const i=fs(e.current),a=t.current.getBoundingClientRect(),s=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),c=hc(r),l=p=>p+a.left-s.left-c.left,u=p=>p+a.left+i.width-s.right+c.right,f=p=>p+a.top-s.top-c.top,h=p=>p+a.top+i.height-s.bottom+c.bottom;return{menuRect:i,containerRect:a,getLeftOverflow:l,getRightOverflow:u,getTopOverflow:f,getBottomOverflow:h,confineHorizontally:p=>{let v=l(p);if(v<0)p-=v;else{const y=u(p);y>0&&(p-=y,v=l(p),v<0&&(p-=v))}return p},confineVertically:p=>{let v=f(p);if(v<0)p-=v;else{const y=h(p);y>0&&(p-=y,v=f(p),v<0&&(p-=v))}return p}}},Sc=({arrowRef:t,menuY:e,anchorRect:n,containerRect:r,menuRect:i})=>{let a=n.top-r.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},kc=({anchorRect:t,containerRect:e,menuRect:n,placeLeftorRightY:r,placeLeftX:i,placeRightX:a,getLeftOverflow:s,getRightOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:f,arrow:h,direction:m,position:d})=>{let p=m,v=r;d!=="initial"&&(v=u(v),d==="anchor"&&(v=Math.min(v,t.bottom-e.top),v=Math.max(v,t.top-e.top-n.height)));let y,E,b;return p==="left"?(y=i,d!=="initial"&&(E=s(y),E<0&&(b=c(a),(b<=0||-E>b)&&(y=a,p="right")))):(y=a,d!=="initial"&&(b=c(y),b>0&&(E=s(i),(E>=0||-E{let a=n.left-r.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:r,placeTopY:i,placeBottomY:a,getTopOverflow:s,getBottomOverflow:c,confineHorizontally:l,confineVertically:u,arrowRef:f,arrow:h,direction:m,position:d})=>{let p=m==="top"?"top":"bottom",v=r;d!=="initial"&&(v=l(v),d==="anchor"&&(v=Math.min(v,t.right-e.left),v=Math.max(v,t.left-e.left-n.width)));let y,E,b;return p==="top"?(y=i,d!=="initial"&&(E=s(y),E<0&&(b=c(a),(b<=0||-E>b)&&(y=a,p="bottom")))):(y=a,d!=="initial"&&(b=c(y),b>0&&(E=s(i),(E>=0||-E{const{menuRect:u,containerRect:f}=l,h=n==="left"||n==="right";let m=h?r:i,d=h?i:r;if(t){const g=c.current;h?m+=g.offsetWidth:d+=g.offsetHeight}const p=s.left-f.left-u.width-m,v=s.right-f.left+m,y=s.top-f.top-u.height-d,E=s.bottom-f.top+d;let b,w;e==="end"?(b=s.right-f.left-u.width,w=s.bottom-f.top-u.height):e==="center"?(b=s.left-f.left-(u.width-s.width)/2,w=s.top-f.top-(u.height-s.height)/2):(b=s.left-f.left,w=s.top-f.top),b+=m,w+=d;const k={...l,anchorRect:s,placeLeftX:p,placeRightX:v,placeLeftorRightY:w,placeTopY:y,placeBottomY:E,placeToporBottomX:b,arrowRef:c,arrow:t,direction:n,position:a};switch(n){case"left":case"right":return kc(k);case"top":case"bottom":default:return Ic(k)}},Ve=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?Ie:tt;function ci(t,e){typeof t=="function"?t(e):t.current=e}const Xe=(t,e)=>it(()=>t?e?n=>{ci(t,n),ci(e,n)}:t:e,[t,e]),li=-9999,hs=({ariaLabel:t,menuClassName:e,menuStyle:n,arrow:r,arrowProps:i={},anchorPoint:a,anchorRef:s,containerRef:c,containerProps:l,externalRef:u,parentScrollingRef:f,align:h="start",direction:m="bottom",position:d="auto",overflow:p="visible",setDownOverflow:v,repositionFlag:y,captureFocus:E=!0,state:b,endTransition:w,isDisabled:k,menuItemFocus:g,gap:A=0,shift:T=0,children:D,onClose:M,focusProps:L,...C})=>{const[x,F]=H({x:li,y:li}),[W,j]=H({}),[et,st]=H(),[ot,nt]=H(m),[J]=H(Tc),[vt,ht]=Ji(Z=>Z+1,1),{transition:N,boundingBoxRef:at,boundingBoxPadding:dt,rootMenuRef:xt,rootAnchorRef:mt,scrollNodesRef:zt,reposition:It,viewScroll:Et,submenuCloseDelay:Wt}=Ot(pr),{submenuCtx:yt,reposSubmenu:U=y}=Ot(ar),Q=O(),wt=O(),qt=O(!1),{hoverItem:be,dispatch:rt,updateItems:X}=Ac(Q),B=To(b),K=Tn(N,"open"),Y=Tn(N,"close"),ut=zt.current,G=Z=>{switch(Z.key){case Pt.HOME:rt(_t.FIRST);break;case Pt.END:rt(_t.LAST);break;case Pt.UP:rt(_t.DECREASE,be);break;case Pt.DOWN:rt(_t.INCREASE,be);break;case Pt.SPACE:Z.target&&Z.target.className.indexOf(te)!==-1&&Z.preventDefault();return;default:return}Z.preventDefault(),Z.stopPropagation()},Ut=()=>{b==="closing"&&st(),Ht(w)},Ee=Z=>{Z.stopPropagation(),J.on(Wt,()=>{rt(_t.RESET),Q.current.focus(eo)})},$t=Z=>{Z.target===Z.currentTarget&&J.off()},Ft=At(Z=>{var Gt;const Ct=s?(Gt=s.current)==null?void 0:Gt.getBoundingClientRect():a?{left:a.x,right:a.x,top:a.y,bottom:a.y,width:0,height:0}:null;if(!Ct)return;ut.menu||(ut.menu=(at?at.current:Sr(xt.current))||window);const St=Cc(c,Q,ut.menu,dt);let{arrowX:Bt,arrowY:ft,x:we,y:fe,computedDirection:Re}=Dc({arrow:r,align:h,direction:m,gap:A,shift:T,position:d,anchorRect:Ct,arrowRef:wt,positionHelpers:St});const{menuRect:Ln}=St,tn=Ln.height;if(!Z&&p!=="visible"){const{getTopOverflow:Rn,getBottomOverflow:Zt}=St;let Yt,en;const nn=Zt(fe);if(nn>0)Yt=tn-nn,en=nn;else{const ct=Rn(fe);ct<0&&(Yt=tn+ct,en=0-ct,Yt>=0&&(fe-=ct))}Yt>=0&&st({height:Yt,overflowAmt:en})}r&&j({x:Bt,y:ft}),F({x:we,y:fe}),nt(Re)},[r,h,dt,m,A,T,d,p,a,s,c,at,xt,ut]);Ve(()=>{B&&(Ft(),qt.current&&ht()),qt.current=B},[B,Ft,U]),Ve(()=>{et&&!v&&(Q.current.scrollTop=0)},[et,v]),Ve(()=>X,[X]),tt(()=>{let{menu:Z}=ut;if(!B||!Z)return;if(Z=Z.addEventListener?Z:window,!ut.anchors){ut.anchors=[];let ft=Sr(mt&&mt.current);for(;ft&&ft!==Z;)ut.anchors.push(ft),ft=Sr(ft)}let Ct=Et;if(ut.anchors.length&&Ct==="initial"&&(Ct="auto"),Ct==="initial")return;const St=()=>{Ct==="auto"?to(()=>Ft(!0)):Ht(M,{reason:An.SCROLL})},Bt=ut.anchors.concat(Et!=="initial"?Z:[]);return Bt.forEach(ft=>ft.addEventListener("scroll",St)),()=>Bt.forEach(ft=>ft.removeEventListener("scroll",St))},[mt,ut,B,M,Et,Ft]);const Dt=!!et&&et.overflowAmt>0;tt(()=>{if(Dt||!B||!f)return;const Z=()=>to(Ft),Ct=f.current;return Ct.addEventListener("scroll",Z),()=>Ct.removeEventListener("scroll",Z)},[B,Dt,f,Ft]),tt(()=>{if(!B||typeof ResizeObserver!="function"||It==="initial")return;const Z=[],Ct=new ResizeObserver(ft=>ft.forEach(({target:we})=>{Z.indexOf(we)<0?Z.push(we):La(()=>{Ft(),ht()})})),St={box:"border-box"};Ct.observe(Q.current,St);const Bt=s==null?void 0:s.current;return Bt&&Ct.observe(Bt,St),()=>Ct.disconnect()},[B,It,s,Ft]),tt(()=>{if(!B){rt(_t.RESET),Y||st();return}const{position:Z,alwaysUpdate:Ct}=g||{},St=()=>{Z===ze.FIRST?rt(_t.FIRST):Z===ze.LAST?rt(_t.LAST):Z>=-1&&rt(_t.SET_INDEX,void 0,Z)};if(Ct)St();else if(E){const Bt=setTimeout(()=>{const ft=Q.current;ft&&!ft.contains(document.activeElement)&&(ft.focus(eo),St())},K?170:100);return()=>clearTimeout(Bt)}},[B,K,Y,E,g,rt]);const gt=it(()=>({isParentOpen:B,submenuCtx:J,dispatch:rt,updateItems:X}),[B,J,rt,X]);let Tt,Nt;et&&(v?Nt=et.overflowAmt:Tt=et.height);const Le=it(()=>({reposSubmenu:vt,submenuCtx:J,overflow:p,overflowAmt:Nt,parentMenuRef:Q,parentDir:ot}),[vt,J,p,Nt,ot]),Qe=Tt>=0?{maxHeight:Tt,overflow:p}:void 0,Dn=it(()=>({state:b,align:h,dir:ot}),[b,h,ot]),pt=it(()=>({dir:ot}),[ot]),Je=ee({block:te,element:pc,modifiers:pt,className:i.className}),de=o("ul",{role:"menu","aria-label":t,...mr(k),...Ye({onPointerEnter:yt==null?void 0:yt.off,onPointerMove:Ee,onPointerLeave:$t,onKeyDown:G,onAnimationEnd:Ut},C),ref:Xe(u,Q),className:ee({block:te,modifiers:Dn,className:e}),style:{...n,...Qe,margin:0,display:b==="closed"?"none":void 0,position:si,left:x.x,top:x.y},children:[r&&o("li",{"aria-hidden":!0,...i,className:Je,style:{display:"block",position:si,left:W.x,top:W.y,...i.style},ref:wt}),o(ar.Provider,{value:Le,children:o(Co.Provider,{value:gt,children:o(ds.Provider,{value:be,children:Ht(D,Dn)})})})]});return l?o(wc,{...l,isOpen:B,children:de}):de},ms=_e(function({"aria-label":e,className:n,containerProps:r,initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,reposition:f="auto",submenuOpenDelay:h=300,submenuCloseDelay:m=150,viewScroll:d="initial",portal:p,theming:v,onItemClick:y,...E},b){const w=O(null),k=O({}),{anchorRef:g,state:A,onClose:T}=E,D=it(()=>({initialMounted:i,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:u,rootMenuRef:w,rootAnchorRef:g,scrollNodesRef:k,reposition:f,viewScroll:d,submenuOpenDelay:h,submenuCloseDelay:m}),[i,a,s,c,g,l,u,f,d,h,m]),M=it(()=>({handleClick(C,x){C.stopPropagation||Ht(y,C);let F=C.keepOpen;F===void 0&&(F=x&&C.key===Pt.SPACE),F||Ht(T,{value:C.value,key:C.key,reason:An.CLICK})},handleClose(C){Ht(T,{key:C,reason:An.CLICK})}}),[y,T]);if(!A)return null;const L=o(pr.Provider,{value:D,children:o(So.Provider,{value:M,children:o(hs,{...E,ariaLabel:e||"Menu",externalRef:b,containerRef:w,containerProps:{className:n,containerRef:w,containerProps:r,theming:v,transition:s,onClose:T}})})});return p===!0&&typeof document<"u"?ir(L,document.body):p?p.target?ir(L,p.target):p.stablePosition?null:L:L}),no=0,ro=1,cr=2,lr=3,ur=4,Lc=5,ps=6,Rc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],gs=t=>({_s:t,status:Rc[t],isEnter:tur}),oo=t=>t?ps:Lc,Mc=(t,e)=>{switch(t){case ro:case no:return cr;case ur:case lr:return oo(e)}},Pc=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],Oc=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),ui=(t,e,n,r,i)=>{clearTimeout(r.current);const a=gs(t);e(a),n.current=a,i&&i({current:a})},$c=({enter:t=!0,exit:e=!0,preEnter:n,preExit:r,timeout:i,initialEntered:a,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{const[u,f]=H(()=>gs(a?cr:oo(s))),h=O(u),m=O(),[d,p]=Pc(i),v=At(()=>{const E=Mc(h.current._s,c);E&&ui(E,f,h,m,l)},[l,c]),y=At(E=>{const b=k=>{switch(ui(k,f,h,m,l),k){case ro:d>=0&&(m.current=setTimeout(v,d));break;case ur:p>=0&&(m.current=setTimeout(v,p));break;case no:case lr:m.current=Oc(b,k);break}},w=h.current.isEnter;typeof E!="boolean"&&(E=!w),E?!w&&b(t?n?no:ro:cr):w&&b(e?r?lr:ur:oo(c))},[v,l,t,e,n,r,d,p,c]);return tt(()=>()=>clearTimeout(m.current),[]),[u,y,v]};const Fc=({initialOpen:t,initialMounted:e,unmountOnClose:n,transition:r,transitionTimeout:i=500,onMenuChange:a}={})=>{const s=Tn(r,"open"),c=Tn(r,"close"),[{status:l},u,f]=$c({initialEntered:t,mountOnEnter:!e,unmountOnExit:n,timeout:i,enter:s,exit:c,onStateChange:At(({current:{isEnter:h,isResolved:m}})=>{!a||h&&s&&m||!h&&c&&m||a({open:h})},[a,s,c])});return[{state:Ec[l],endTransition:f},u]},vs=t=>{const[e,n]=Fc(t),[r,i]=H(),a=(s,c)=>{i({position:s,alwaysUpdate:c}),n(!0)};return[{menuItemFocus:r,...e},n,a]},Nc=(t,e)=>{const[n]=H({});return{onMouseDown:()=>{n.v=t&&t!=="closed"},onClick:r=>n.v?n.v=!1:e(!0,r)}},Bc=parseInt(Ra)<19,zc=_e(function({"aria-label":e,captureFocus:n,initialOpen:r,menuButton:i,instanceRef:a,onMenuChange:s,...c},l){const[u,f,h]=vs({...c,onMenuChange:s}),{state:m}=u,d=To(m),p=O(null),v=Nc(m,(g,A)=>h(A.detail?void 0:ze.FIRST)),y=At(g=>{f(!1),g.key&&p.current.focus()},[f]),E=g=>{switch(g.key){case Pt.UP:h(ze.LAST);break;case Pt.DOWN:h(ze.FIRST);break;default:return}g.preventDefault()},b=Ht(i,{open:d});if(!b||!b.type)throw new Error("Menu requires a menuButton prop.");const w={...Ye({onKeyDown:E,...v},b.props),ref:Xe(Bc?b.ref:b.props.ref,p)};fc(b.type)==="MenuButton"&&(w.isOpen=d);const k=ts(b,w);return es(a,()=>({openMenu:h,closeMenu:()=>f(!1)})),o($,{children:[k,o(ms,{...c,...u,"aria-label":e||(typeof b.props.children=="string"?b.props.children:"Menu"),anchorRef:p,ref:l,onClose:y})]})}),Io=(t,e)=>{const n=Ge(e),r=_e((i,a)=>{const s=O(null);return o(n,{...i,itemRef:s,externalRef:a,isHovering:Ot(ds)===s.current})});return r.displayName=`WithHovering(${t})`,r},_s=(t,e,n)=>{Ve(()=>{if(t)return;const r=e.current;return n(r,!0),()=>{n(r)}},[t,e,n])},Vc=Io("SubMenu",function({"aria-label":e,className:n,disabled:r,direction:i,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:u,itemRef:f,captureFocus:h,repositionFlag:m,itemProps:d={},...p}){const v=Ot(pr),{rootMenuRef:y,submenuOpenDelay:E,submenuCloseDelay:b}=v,{parentMenuRef:w,parentDir:k,overflow:g}=Ot(ar),{isParentOpen:A,submenuCtx:T,dispatch:D,updateItems:M}=Ot(Co),L=g!=="visible",[C,x,F]=vs({...v,onMenuChange:c}),{state:W}=C,j=!!r,et=To(W),st=O(null),[ot]=H({v:0}),nt=()=>{T.off(),ot.v&&(clearTimeout(ot.v),ot.v=0)},J=(...U)=>{nt(),vt(),!j&&F(...U)},vt=()=>!l&&!j&&D(_t.SET,f.current),ht=U=>{vt(),s||(ot.v=setTimeout(()=>to(J),Math.max(U,0)))},N=U=>{j||(U.stopPropagation(),!(ot.v||et)&&T.on(b,()=>ht(E-b),()=>ht(E)))},at=()=>{nt(),et||D(_t.UNSET,f.current)},dt=U=>{if(l)switch(U.key){case Pt.ENTER:U.preventDefault();case Pt.SPACE:case Pt.RIGHT:s!=="none"&&J(ze.FIRST)}},xt=U=>{let Q=!1;switch(U.key){case Pt.LEFT:et&&(f.current.focus(),x(!1),Q=!0);break;case Pt.RIGHT:et||(Q=!0);break}Q&&(U.preventDefault(),U.stopPropagation())};_s(j,f,M),tt(()=>T.toggle(et),[T,et]),tt(()=>()=>clearTimeout(ot.v),[ot]),tt(()=>{l&&A?f.current.focus():x(!1)},[l,A,x,f]),es(u,()=>({openMenu:(...U)=>{A&&J(...U)},closeMenu:()=>{et&&(f.current.focus(),x(!1))}}));const mt=it(()=>({open:et,hover:l,disabled:j,submenu:!0}),[et,l,j]),{ref:zt,className:It,...Et}=d,Wt=Ye({onPointerEnter:T.off,onPointerMove:N,onPointerLeave:at,onKeyDown:dt,onClick:()=>s!=="none"&&J()},Et),yt=()=>{const U=o(hs,{...p,...C,ariaLabel:e||(typeof a=="string"?a:"Submenu"),anchorRef:f,containerRef:L?y:st,direction:i||(k==="right"||k==="left"?k:"right"),parentScrollingRef:L&&w,isDisabled:j}),Q=y.current;return L&&Q?ir(U,Q):U};return o("li",{className:ee({block:te,element:yc,className:n}),style:{position:"relative"},role:ko,ref:st,onKeyDown:xt,children:[o("div",{role:xo,"aria-haspopup":!0,"aria-expanded":et,...mr(j,l),...Wt,ref:Xe(zt,f),className:ee({block:te,element:Ao,modifiers:mt,className:It}),children:it(()=>Ht(a,mt),[a,mt])}),W&&yt()]})}),ys=(t,e,n,r)=>{const{submenuCloseDelay:i}=Ot(pr),{isParentOpen:a,submenuCtx:s,dispatch:c,updateItems:l}=Ot(Co),u=()=>{!n&&!r&&c(_t.SET,t.current)},f=()=>{!r&&c(_t.UNSET,t.current)},h=p=>{n&&!p.currentTarget.contains(p.relatedTarget)&&f()},m=p=>{r||(p.stopPropagation(),s.on(i,u,u))},d=(p,v)=>{s.off(),!v&&f()};return _s(r,t,l),tt(()=>{n&&a&&e.current&&e.current.focus()},[e,n,a]),{setHover:u,onBlur:h,onPointerMove:m,onPointerLeave:d}},bt=Io("MenuItem",function({className:e,value:n,href:r,type:i,checked:a,disabled:s,children:c,onClick:l,isHovering:u,itemRef:f,externalRef:h,...m}){const d=!!s,{setHover:p,...v}=ys(f,f,u,d),y=Ot(So),E=Ot(bc),b=i==="radio",w=i==="checkbox",k=!!r&&!d&&!b&&!w,g=b?E.value===n:w?!!a:!1,A=C=>{if(d){C.stopPropagation(),C.preventDefault();return}const x={value:n,syntheticEvent:C};C.key!==void 0&&(x.key=C.key),w&&(x.checked=!g),b&&(x.name=E.name),Ht(l,x),b&&Ht(E.onRadioChange,x),y.handleClick(x,w||b)},T=C=>{if(u)switch(C.key){case Pt.ENTER:C.preventDefault();case Pt.SPACE:k?f.current.click():A(C)}},D=it(()=>({type:i,disabled:d,hover:u,checked:g,anchor:k}),[i,d,u,g,k]),M=Ye({...v,onPointerDown:p,onKeyDown:T,onClick:A},m),L={role:b?"menuitemradio":w?"menuitemcheckbox":xo,"aria-checked":b||w?g:void 0,...mr(d,u),...M,ref:Xe(h,f),className:ee({block:te,element:Ao,modifiers:D,className:e}),children:it(()=>Ht(c,D),[c,D])};return k?o("li",{role:ko,children:o("a",{href:r,...L})}):o("li",{...L})}),Hc=Io("FocusableItem",function({className:e,disabled:n,children:r,isHovering:i,itemRef:a,externalRef:s,...c}){const l=!!n,u=O(null),{setHover:f,onPointerLeave:h,...m}=ys(a,u,i,l),{handleClose:d}=Ot(So),p=it(()=>({disabled:l,hover:i,focusable:!0}),[l,i]),v=it(()=>Ht(r,{...p,ref:u,closeMenu:d}),[r,p,d]),y=Ye({...m,onPointerLeave:E=>h(E,!0),onFocus:f},c);return o("li",{role:xo,...mr(l),...y,ref:Xe(s,a),className:ee({block:te,element:Ao,modifiers:p,className:e}),children:v})}),cn=Ge(_e(function({className:e,...n},r){return o("li",{role:"separator",...n,ref:r,className:ee({block:te,element:gc,className:e})})})),Hf=Ge(_e(function({className:e,...n},r){return o("li",{role:ko,...n,ref:r,className:ee({block:te,element:vc,className:e})})})),Uf=_e(function({className:e,style:n,takeOverflow:r,...i},a){const s=O(null),[c,l]=H(),{overflow:u,overflowAmt:f}=Ot(ar);return Ve(()=>{let h;r&&f>=0&&(h=fs(s.current).height-f,h<0&&(h=0)),l(h>=0?{maxHeight:h,overflow:u}:void 0)},[r,u,f]),Ve(()=>{c&&(s.current.scrollTop=0)},[c]),o("div",{...i,ref:Xe(a,s),className:ee({block:te,element:_c,className:e}),style:{...n,...c}})});var hn=(t=>(t.Mouse="mouse",t.Touch="touch",t.Pointer="pointer",t))(hn||{}),mn=(t=>(t.CancelledByMovement="cancelled-by-movement",t.CancelledByRelease="cancelled-by-release",t.CancelledOutsideElement="cancelled-outside-element",t))(mn||{});const bs=()=>typeof window=="object"?(window==null?void 0:window.PointerEvent)??null:null,Uc=()=>typeof window=="object"?(window==null?void 0:window.TouchEvent)??null:null;function Es(t){const{nativeEvent:e}=t,n=Uc();return n&&e instanceof n||"touches"in t}function ws(t){const e=bs();return t.nativeEvent instanceof MouseEvent&&!(e&&t.nativeEvent instanceof e)}function Ts(t){const{nativeEvent:e}=t;if(!e)return!1;const n=bs();return n&&e instanceof n||"pointerId"in e}function di(t){return ws(t)||Es(t)||Ts(t)}function fi(t){return Es(t)?{x:t.touches[0].pageX,y:t.touches[0].pageY}:ws(t)||Ts(t)?{x:t.pageX,y:t.pageY}:null}function jc(t){return{target:t.target,currentTarget:t.currentTarget,nativeEvent:t,persist:()=>{}}}function As(t,{threshold:e=400,captureEvent:n=!1,detect:r=hn.Pointer,cancelOnMovement:i=!1,cancelOutsideElement:a=!0,filterEvents:s,onStart:c,onMove:l,onFinish:u,onCancel:f}={}){const h=O(!1),m=O(!1),d=O(),p=O(),v=O(t),y=O(null),E=At(g=>A=>{m.current||di(A)&&(s!==void 0&&!s(A)||(n&&A.persist(),c==null||c(A,{context:g}),y.current=fi(A),m.current=!0,d.current=A.currentTarget,p.current=setTimeout(()=>{v.current&&(v.current(A,{context:g}),h.current=!0)},e)))},[n,s,c,e]),b=At(g=>(A,T)=>{di(A)&&m.current&&(y.current=null,n&&A.persist(),h.current?u==null||u(A,{context:g}):m.current&&(f==null||f(A,{context:g,reason:T??mn.CancelledByRelease})),h.current=!1,m.current=!1,p.current!==void 0&&clearTimeout(p.current))},[n,u,f]),w=At(g=>A=>{if(l==null||l(A,{context:g}),i!==!1&&y.current){const T=fi(A);if(T){const D=i===!0?25:i,M={x:Math.abs(T.x-y.current.x),y:Math.abs(T.y-y.current.y)};(M.x>D||M.y>D)&&b(g)(A,mn.CancelledByMovement)}}},[b,i,l]),k=At(g=>{if(t===null)return{};switch(r){case hn.Mouse:{const A={onMouseDown:E(g),onMouseMove:w(g),onMouseUp:b(g)};return a&&(A.onMouseLeave=T=>{b(g)(T,mn.CancelledOutsideElement)}),A}case hn.Touch:return{onTouchStart:E(g),onTouchMove:w(g),onTouchEnd:b(g)};case hn.Pointer:{const A={onPointerDown:E(g),onPointerMove:w(g),onPointerUp:b(g)};return a&&(A.onPointerLeave=T=>b(g)(T,mn.CancelledOutsideElement)),A}}},[t,b,a,r,w,E]);return tt(()=>{if(!window)return;function g(A){const T=jc(A);b()(T)}return window.addEventListener("mouseup",g),window.addEventListener("touchend",g),window.addEventListener("pointerup",g),()=>{window.removeEventListener("mouseup",g),window.removeEventListener("touchend",g),window.removeEventListener("pointerup",g)}},[b]),tt(()=>()=>{p.current!==void 0&&clearTimeout(p.current)},[]),tt(()=>{v.current=t},[t]),k}const Kc=Rt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),Wc=t=>{const{locale:e,dateYear:n,hideTime:r,formatOpts:i,forceOpts:a}=t||{},s=e.replace(/-[a-z]+$/i,""),c=wn([s],[Kc],e),l=new Date().getFullYear(),u=a||{year:n===l?void 0:"numeric",month:"short",day:"numeric",hour:r?void 0:"numeric",minute:r?void 0:"numeric",...i};try{return Intl.DateTimeFormat(c,u)}catch{}try{return Intl.DateTimeFormat(e,u)}catch{}return Intl.DateTimeFormat(void 0,u)},Zc=Rt(Wc);function Cn(t,e){return t instanceof Date||(t=new Date(t)),Zc({dateYear:t.getFullYear(),locale:kt.locale,...e}).format(t)}function qc(t){const e=URL.parse("/compose/",window.location),{width:n,height:r}=window.screen,i=Math.max(0,(n-600)/2),a=Math.max(0,(r-450)/2),s=Math.min(n,600),c=Math.min(r,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(kt._({id:"4S86wI"})),u}const Gc=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function Yc(){if(Gc){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 Xc=document.documentElement,jn=getComputedStyle(Xc),Qc=8;let Cs=[0,0,0,0];function Ss(){const t=jn.getPropertyValue("--sai-top"),e=jn.getPropertyValue("--sai-right"),n=jn.getPropertyValue("--sai-bottom"),r=jn.getPropertyValue("--sai-left");Cs=[Math.max(0,parseInt(t,10)),Math.max(0,parseInt(e,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(r,10))]}requestAnimationFrame(Ss);function ks(t=[]){return Cs.map((n,r)=>(n||Qc)+(t[r]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",Ss,{passive:!0});const hi=5e3;function Kn(t){if(t||(t=!0),V.showCompose){V.composerState.minimized?Lt({duration:hi,text:kt._({id:"/4fHR1"})}):Lt({duration:hi,text:kt._({id:"vvl08N"})});return}Yc(),V.showCompose=t}const Oe=document.createElement("div");function Jc(t,e){if(!t)return"";const{preProcess:n}=e||{};return Oe.innerHTML=t.replace(/<\/p>/g,`

+ +`).replace(/<\/li>/g,` +`),Oe.querySelectorAll("br").forEach(r=>{r.replaceWith(` +`)}),n==null||n(Oe),Oe.querySelectorAll(".invisible").forEach(r=>{r.remove()}),Oe.querySelectorAll(".ellipsis").forEach(r=>{r.append("...")}),Oe.innerText.replace(/[\r\n]{3,}/g,` + +`).trim()}const gr=Rt(Jc);function xs(t){var s;const{spoilerText:e,content:n,poll:r,mediaAttachments:i}=t;let a="";return e!=null&&e.trim()?a+=e:a+=gr(n),a=a.trim(),(s=r==null?void 0:r.options)!=null&&s.length&&(a+=` + +📊: +${r.options.map(c=>`${r.multiple?"▪️":"•"} ${c.title}`).join(` +`)}`),i!=null&&i.length&&(a+=" "+i.map(c=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[c.type]||"").join("")),a}const Is={x:()=>S(()=>import("./icons/close-line-Bfj902o4.js"),[],import.meta.url),heart:()=>S(()=>import("./icons/heart-line-vi3QqJTo.js"),[],import.meta.url),bookmark:()=>S(()=>import("./icons/bookmark-line-BMGZc_Mc.js"),[],import.meta.url),"check-circle":()=>S(()=>import("./icons/check-circle-line-CSlVj8QA.js"),[],import.meta.url),"x-circle":()=>S(()=>import("./icons/close-circle-line-DlCWcUwK.js"),[],import.meta.url),transfer:()=>S(()=>import("./icons/transfer-4-line-BHXBUumZ.js"),[],import.meta.url),rocket:()=>S(()=>import("./icons/rocket-line-B7gBxy4I.js"),[],import.meta.url),"arrow-left":{module:()=>S(()=>import("./icons/arrow-left-line-BGgZ0udH.js"),[],import.meta.url),rtl:!0},"arrow-right":{module:()=>S(()=>import("./icons/arrow-right-line-zKtS4vm5.js"),[],import.meta.url),rtl:!0},"arrow-up":()=>S(()=>import("./icons/arrow-up-line-Bow_AQZ6.js"),[],import.meta.url),"arrow-down":()=>S(()=>import("./icons/arrow-down-line-RSwsrALM.js"),[],import.meta.url),earth:()=>S(()=>import("./icons/earth-line-DW_CwNjP.js"),[],import.meta.url),lock:()=>S(()=>import("./icons/lock-line-BbTC1fux.js"),[],import.meta.url),unlock:()=>S(()=>import("./icons/unlock-line-CGrzBxul.js"),[],import.meta.url),"eye-close":()=>S(()=>import("./icons/eye-close-line-DQnawnJE.js"),[],import.meta.url),"eye-open":()=>S(()=>import("./icons/eye-2-line-Dvog5oyl.js"),[],import.meta.url),message:()=>S(()=>import("./icons/mail-line-Cadg2cpP.js"),[],import.meta.url),comment:{module:()=>S(()=>import("./icons/chat-3-line-C4e7R0Zy.js"),[],import.meta.url),rtl:!0},comment2:{module:()=>S(()=>import("./icons/comment-2-line-DfD-95ou.js"),[],import.meta.url),rtl:!0},home:()=>S(()=>import("./icons/home-3-line-BLD1YYP8.js"),[],import.meta.url),notification:()=>S(()=>import("./icons/notification-line-Cc2m6sh5.js"),[],import.meta.url),follow:()=>S(()=>import("./icons/user-follow-line-CsL-DB1N.js"),[],import.meta.url),"follow-add":()=>S(()=>import("./icons/user-add-line-DuegJyfy.js"),[],import.meta.url),poll:[()=>S(()=>import("./icons/chart-bar-line-W9BuvVdR.js"),[],import.meta.url),"90deg"],pencil:()=>S(()=>import("./icons/pencil-line-BwUdLENj.js"),[],import.meta.url),quill:()=>S(()=>import("./icons/quill-pen-line-oAx8SSeF.js"),[],import.meta.url),at:()=>S(()=>import("./icons/at-line-C4-OGRKX.js"),[],import.meta.url),attachment:()=>S(()=>import("./icons/attachment-line-C4ysC1zZ.js"),[],import.meta.url),upload:()=>S(()=>import("./icons/upload-3-line-BB2RA_2Z.js"),[],import.meta.url),gear:()=>S(()=>import("./icons/settings-3-line-BGrM7a5R.js"),[],import.meta.url),more:()=>S(()=>import("./icons/more-3-line-WfszpsFu.js"),[],import.meta.url),more2:()=>S(()=>import("./icons/more-1-fill-Cnnj9cLP.js"),[],import.meta.url),external:{module:()=>S(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popout:{module:()=>S(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rtl:!0},popin:{module:()=>S(()=>import("./icons/external-link-line-BYXsdcMa.js"),[],import.meta.url),rotate:"180deg",rtl:!0},plus:()=>S(()=>import("./icons/add-circle-line-VUOz5dLS.js"),[],import.meta.url),"chevron-left":{module:()=>S(()=>import("./icons/left-line-8vYaPuok.js"),[],import.meta.url),rtl:!0},"chevron-right":{module:()=>S(()=>import("./icons/right-line-E80CeS1Q.js"),[],import.meta.url),rtl:!0},"chevron-down":()=>S(()=>import("./icons/down-line-PlS1iUy8.js"),[],import.meta.url),reply:{module:()=>S(()=>import("./icons/share-forward-line-DX1QbiUu.js"),[],import.meta.url),rotate:"180deg",flip:"horizontal",rtl:!0},thread:()=>S(()=>import("./icons/route-line-D10jSVCO.js"),[],import.meta.url),group:{module:()=>S(()=>import("./icons/group-line-Cw2Phg9p.js"),[],import.meta.url),rtl:!0},bot:()=>S(()=>import("./icons/android-2-line-C7qVwx2U.js"),[],import.meta.url),menu:()=>S(()=>import("./icons/rows-4-line-DIXu-DVG.js"),[],import.meta.url),list:{module:()=>S(()=>import("./icons/list-check-line-BaMf8v8i.js"),[],import.meta.url),rtl:!0},search:()=>S(()=>import("./icons/search-2-line-CoCbFBVR.js"),[],import.meta.url),hashtag:()=>S(()=>import("./icons/hashtag-line-Cml-0qv2.js"),[],import.meta.url),info:()=>S(()=>import("./icons/information-line-Dn255DD5.js"),[],import.meta.url),shortcut:()=>S(()=>import("./icons/lightning-line-cvW5NR-M.js"),[],import.meta.url),user:()=>S(()=>import("./icons/user-4-line-C89P3h09.js"),[],import.meta.url),following:()=>S(()=>import("./icons/walk-line-BZwRwcxJ.js"),[],import.meta.url),pin:()=>S(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),unpin:[()=>S(()=>import("./icons/pin-line-BqseDe3t.js"),[],import.meta.url),"180deg"],bus:()=>S(()=>import("./icons/bus-2-line-CfBaNBAi.js"),[],import.meta.url),link:()=>S(()=>import("./icons/link-2-line-SnIkQ_rZ.js"),[],import.meta.url),history:()=>S(()=>import("./icons/history-line-Bi2So-je.js"),[],import.meta.url),share:()=>S(()=>import("./icons/share-2-line-C2byQ30z.js"),[],import.meta.url),sparkles:()=>S(()=>import("./icons/sparkles-line-DWyRj8uB.js"),[],import.meta.url),sparkles2:()=>S(()=>import("./icons/sparkles-2-line-H731KO3v.js"),[],import.meta.url),exit:{module:()=>S(()=>import("./icons/exit-line-NjC63GxM.js"),[],import.meta.url),rtl:!0},translate:()=>S(()=>import("./icons/translate-line-cdOWN72F.js"),[],import.meta.url),play:()=>S(()=>import("./icons/play-fill-D1o3ePO2.js"),[],import.meta.url),trash:()=>S(()=>import("./icons/delete-2-line-C-lQIJNC.js"),[],import.meta.url),mute:{module:()=>S(()=>import("./icons/volume-mute-line-BluUkhVT.js"),[],import.meta.url),rtl:!0},unmute:{module:()=>S(()=>import("./icons/volume-line-dtC5ZFr8.js"),[],import.meta.url),rtl:!0},block:()=>S(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),unblock:[()=>S(()=>import("./icons/forbid-circle-line-f_JQE7a8.js"),[],import.meta.url),"180deg"],flag:()=>S(()=>import("./icons/flag-1-line-sWzx_4o4.js"),[],import.meta.url),time:()=>S(()=>import("./icons/time-line-CHAmvUdg.js"),[],import.meta.url),refresh:()=>S(()=>import("./icons/refresh-2-line-B3CD5yz0.js"),[],import.meta.url),emoji2:()=>S(()=>import("./icons/emoji-2-line-DODV8bnC.js"),[],import.meta.url),filter:()=>S(()=>import("./icons/filter-2-line-DLBEPhKS.js"),[],import.meta.url),filters:()=>S(()=>import("./icons/filter-line-CuUlgBZU.js"),[],import.meta.url),chart:()=>S(()=>import("./icons/chart-line-line-noCpZUdN.js"),[],import.meta.url),react:()=>S(()=>import("./icons/react-line-C6TecPWI.js"),[],import.meta.url),layout4:{module:()=>S(()=>import("./icons/layout-4-line-BFFb1cPy.js"),[],import.meta.url),rtl:!0},layout5:()=>S(()=>import("./icons/layout-5-line-tauINoiF.js"),[],import.meta.url),announce:{module:()=>S(()=>import("./icons/announcement-line-BdsFnqjO.js"),[],import.meta.url),rtl:!0},alert:()=>S(()=>import("./icons/alert-line-CcwmWSBO.js"),[],import.meta.url),round:()=>S(()=>import("./icons/round-fill-CaZIeOWe.js"),[],import.meta.url),"arrow-up-circle":()=>S(()=>import("./icons/arrow-up-circle-line-SO68bPTf.js"),[],import.meta.url),"arrow-down-circle":()=>S(()=>import("./icons/arrow-down-circle-line-SfuiravZ.js"),[],import.meta.url),clipboard:{module:()=>S(()=>import("./icons/clipboard-line-CIOFpSsX.js"),[],import.meta.url),rtl:!0},"account-edit":()=>S(()=>import("./icons/user-edit-line-CC6Y-fJT.js"),[],import.meta.url),"account-warning":()=>S(()=>import("./icons/user-warning-line-BLfdr8Bj.js"),[],import.meta.url),keyboard:()=>S(()=>import("./icons/keyboard-line-BRd9ohM1.js"),[],import.meta.url),cloud:()=>S(()=>import("./icons/cloud-line-CCOdtB64.js"),[],import.meta.url),month:{module:()=>S(()=>import("./icons/calendar-month-line-DGpTEHfi.js"),[],import.meta.url),rtl:!0},media:()=>S(()=>import("./icons/photo-album-line-DkklX4P5.js"),[],import.meta.url),speak:()=>S(()=>import("./icons/radar-line-Dch2zZ5p.js"),[],import.meta.url),building:()=>S(()=>import("./icons/building-5-line-jPUf3HeC.js"),[],import.meta.url),history2:{module:()=>S(()=>import("./icons/history-2-line-C2uKqj-3.js"),[],import.meta.url),rtl:!0},document:()=>S(()=>import("./icons/document-line-ewA3UKpU.js"),[],import.meta.url),"arrows-right":{module:()=>S(()=>import("./icons/arrows-right-line-B7gMPCMB.js"),[],import.meta.url),rtl:!0},code:()=>S(()=>import("./icons/code-line-_8nrb8Yp.js"),[],import.meta.url),copy:()=>S(()=>import("./icons/copy-2-line-SBRewLs-.js"),[],import.meta.url),quote:{module:()=>S(()=>import("./icons/quote-left-line-D0CgS7V6.js"),[],import.meta.url),rtl:!0},settings:()=>S(()=>import("./icons/settings-6-line-3dTfr4F6.js"),[],import.meta.url),"heart-break":()=>S(()=>import("./icons/heart-crack-line-BlrTdexG.js"),[],import.meta.url),"user-x":()=>S(()=>import("./icons/user-x-line-Dahn1YZg.js"),[],import.meta.url),minimize:()=>S(()=>import("./icons/arrows-down-line-4JmRUmoO.js"),[],import.meta.url),celebrate:()=>S(()=>import("./icons/celebrate-line-CwClz8eZ.js"),[],import.meta.url),schedule:()=>S(()=>import("./icons/calendar-time-add-line-BwP_cVys.js"),[],import.meta.url),month:()=>S(()=>import("./icons/calendar-month-line-DGpTEHfi.js"),[],import.meta.url),day:()=>S(()=>import("./icons/calendar-day-line-zQlj2fPr.js"),[],import.meta.url),camera:()=>S(()=>import("./icons/camera-line-DK82q_yA.js"),[],import.meta.url)},tl={s:12,m:16,l:20,xl:24,xxl:32},mi={},el=Ma(function({width:t,height:e,body:n,rotate:r,flip:i}){return o("svg",{viewBox:`0 0 ${t} ${e}`,dangerouslySetInnerHTML:{__html:n},style:{transform:`${r?`rotate(${r})`:""} ${i?"scaleX(-1)":""}`}})},{isShallowEqual:!0,maxSize:Object.keys(Is).length,matchesArg:(t,e)=>t.icon===e.icon&&t.body===e.body});function R({icon:t,size:e="m",alt:n,title:r,class:i="",style:a={}}){if(!t)return null;const s=tl[e];let c=Is[t];if(!c)return null;let l,u,f=!1;Array.isArray(c)?[c,l,u]=c:typeof c=="object"&&({rotate:l,flip:u,rtl:f}=c,c=c.module);const[h,m]=H(mi[t]),d=O(t);return tt(()=>{h&&d.current===t||((async()=>{const p=await c();m(p.default),mi[t]=p.default})(),d.current=t)},[t]),o("span",{class:`icon ${i} ${f?"rtl-flip":""}`,title:r||n,style:{width:`${s}px`,height:`${s}px`,...a},"data-icon":t,children:h&&o(el,{icon:t,width:h.width,height:h.height,body:h.body,rotate:l,flip:u})})}const je=_e((t,e)=>{var c;let n;try{n=Pa()}catch{}let r=(location.hash||"").replace(/^#/,"").trim();r===""&&(r="/");const{to:i,...a}=t;if(r&&r!=="/"&&r.includes("?")){const l=URL.parse(r,location.origin);if((c=l==null?void 0:l.searchParams)!=null&&c.size){const u=Array.from(l.searchParams.entries()).map(([f,h])=>`${f}=${encodeURIComponent(h)}`).join("&");r=l.pathname+"?"+u}}const s=r===i||decodeURIComponent(r)===i;return o("a",{ref:e,href:`#${i}`,...a,class:`${t.class||""} ${s?"is-active":""}`,onClick:l=>{var u,f,h;(f=(u=l.currentTarget)==null?void 0:u.parentNode)!=null&&f.closest("a")&&l.stopPropagation(),n&&(V.prevLocation=n),(h=t.onClick)==null||h.call(t,l)}})});function pi(t){const{className:e,disabled:n,...r}=t;return o(Hc,{className:e,disabled:n,children:({ref:i,closeMenu:a})=>o(je,{...r,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 nl=Rt(()=>new Intl.DateTimeFormat().resolvedOptions().locale),vi=Rt((t,e={})=>{const n=t.replace(/-[a-z]+$/i,""),r=wn([n],[nl()],t);try{return new Intl.DateTimeFormat(r,e)}catch{}try{return new Intl.DateTimeFormat(t,e)}catch{}return new Intl.DateTimeFormat(void 0,e)}),rl=Rt(t=>new Intl.RelativeTimeFormat(t||void 0)),Ke=60,We=60*Ke,pn=24*We,ol=t=>{const e=rl(kt.locale),n=(t.getTime()-Date.now())/1e3,r=Math.abs(n);return r{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/pn<=1?l=il(i):u.getFullYear()===i.getFullYear()?l=vi(kt.locale,{year:void 0,month:"short",day:"numeric"}).format(i):l=vi(kt.locale,{dateStyle:"short"}).format(i)}return l||(l=ol(i)),[l,i.toISOString(),i.toLocaleString()]},[i,e,n]);return tt(()=>{if(!gi(i))return;let l,u;function f(){u=requestAnimationFrame(()=>{r(),h()})}function h(){const m=(Date.now()-i.getTime())/1e3;m{clearTimeout(l),cancelAnimationFrame(u)}},[]),o("time",{datetime:s,title:c,children:a})}function sl(t){const e=O();return o(Vc,{...t,instanceRef:e,itemProps:{onPointerMove:n=>{var r,i;n.pointerType==="touch"&&((i=(r=e.current)==null?void 0:r.openMenu)==null||i.call(r))},onPointerLeave:n=>{var r,i;n.pointerType==="touch"&&((i=(r=e.current)==null?void 0:r.openMenu)==null||i.call(r))},...t.itemProps}})}function al(t,e=[]){!t||typeof t!="function"||tt(()=>{const n=new CloseWatcher;return n.addEventListener("close",t),()=>{n.destroy()}},e)}const cl=window.CloseWatcher?al:()=>{},ll=document.getElementById("modal-container");function _i(){return getComputedStyle(document.documentElement).getPropertyValue("--backdrop-theme-color")}function io({children:t,onClose:e,onClick:n,class:r,minimized:i}){if(!t)return null;const a=O();tt(()=>{let h=setTimeout(()=>{var d;const m=(d=a.current)==null?void 0:d.querySelector('[tabindex="-1"]');m&&m.focus()},100);return()=>clearTimeout(h)},[]);const s=window.CloseWatcher,c=Be("esc",()=>{setTimeout(()=>{e==null||e()},0)},{enabled:!s&&!!e,keydown:!1,keyup:!0},[e]);cl(e,[e]),tt(()=>{const h=document.querySelectorAll(".deck-container");if(i){const m=h[h.length-1];m&&m.tabIndex===-1&&m.focus()}else t?h.forEach(m=>{m.setAttribute("inert","")}):h.forEach(m=>{m.removeAttribute("inert")});return()=>{h.forEach(m=>{m.removeAttribute("inert")})}},[t,i]);const l=O(),u=O();Ie(()=>{if(t&&!i)if(Qr.local.get("theme")){const m=_i();l.current=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),l.current&&(u.current=l.current.content,l.current.content=m)}else{const m=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",d=_i();l.current=document.querySelector(`meta[name="theme-color"][media*="${m}"]`),l.current&&(u.current=l.current.content,l.current.content=d)}else l.current&&u.current&&(l.current.content=u.current);return()=>{l.current&&u.current&&(l.current.content=u.current)}},[t,i]);const f=o("div",{ref:h=>{var m;a.current=h,c(((m=h==null?void 0:h.querySelector)==null?void 0:m.call(h,'[tabindex="-1"]'))||h)},className:r,onClick:h=>{n==null||n(h),h.target===h.currentTarget&&(e==null||e(h))},tabIndex:i?0:"-1",inert:i,onFocus:h=>{var m,d;try{if(h.target===h.currentTarget){const p=(m=a.current)==null?void 0:m.querySelector('[tabindex="-1"]'),v=!!p&&((d=getComputedStyle(p))==null?void 0:d.pointerEvents)!=="none";p&&v&&p.focus()}}catch{}},children:t});return ir(f,ll)}const yi={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},ln={},gn=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),nr=gn.getContext("2d",{willReadFrequently:!0});nr.imageSmoothingEnabled=!1;const ul=/missing\.png$/;function dl({url:t,size:e,alt:n="",squircle:r,...i}){e=yi[e]||e||yi.m;const a=O(),s=ul.test(t);return o("span",{ref:a,class:`avatar ${r?"squircle":""} ${ln[t]?"has-alpha":""}`,style:{width:e,height:e},title:n,...i,children:!!t&&o("img",{src:t,width:e,height:e,alt:n,loading:"lazy",decoding:"async",fetchPriority:"low",crossOrigin:ln[t]===void 0&&!s?"anonymous":void 0,onError:c=>{c.target.crossOrigin&&(c.target.crossOrigin=null,c.target.src=t)},onLoad:c=>{a.current&&(a.current.dataset.loaded=!0),ln[t]===void 0&&(s||setTimeout(()=>{try{const{width:l,height:u}=c.target;gn.width!==l&&(gn.width=l),gn.height!==u&&(gn.height=u),nr.drawImage(c.target,0,0);const f=nr.getImageData(0,0,l,u),h=f.data.filter((m,d)=>d%4===3&&m<=128).length/(f.data.length/4)>.1;h&&a.current.classList.add("has-alpha"),ln[t]=h,nr.clearRect(0,0,l,u)}catch{ln[t]=!1}},1))}})})}const ae=Rt(dl);let so=!1;const fl=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"){const{dir:n}=e.target;n==="rtl"?so=!0:so=!1}})});fl.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});function ao(){return so}function hl(){const[t,e]=H({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 Ds(t){const{containerProps:e,instanceRef:n,align:r}=t,i=hl(),a=n!=null&&n.current?n:O(),s=ao()?r==="end"?"start":r==="start"?"end":r:r;return o(zc,{boundingBoxPadding:ks(),repositionFlag:`${i.width}x${i.height}`,unmountOnClose:!0,...t,align:s,instanceRef:a,containerProps:{onClick:c=>{var l,u,f;c.target===c.currentTarget&&((u=(l=a.current)==null?void 0:l.closeMenu)==null||u.call(l)),(f=e==null?void 0:e.onClick)==null||f.call(e,c)},...e}})}function kr({subMenu:t=!1,confirm:e=!0,confirmLabel:n,menuItemClassName:r,menuFooter:i,menuExtras:a,...s}){const{children:c,onClick:l,...u}=s;return e?o(t?sl:Ds,{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:[o(bt,{className:r,onClick:l,children:n}),a,i]}):t?o(bt,{...s}):l?Oa(c,{onClick:l}):c}function co({staticUrl:t,alt:e,url:n}){return o("picture",{children:[t&&o("source",{srcset:t,media:"(prefers-reduced-motion: reduce)"}),o("img",{src:n,alt:e,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async",fetchPriority:"low"},e||n)]})}const ml=Rt(t=>new RegExp(`:(${t.join("|")}):`,"g"));function pl({text:t,emojis:e}){if(!t)return"";if(!(e!=null&&e.length)||t.indexOf(":")===-1)return t;const n=ml(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 o(co,{staticUrl:l,alt:i,url:c},i+"-"+a)}return i})}const Ze=Rt(pl),gl=Rt(t=>{const e={sensitivity:"base"};try{return new Intl.Collator(t||void 0,e)}catch{return new Intl.Collator(void 0,e)}}),vl=/([^@]+)(@.+)/i,_l=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,yl=/\s+/g,bl=/[^a-z0-9@\.]/gi;function El({account:t,instance:e,showAvatar:n,showAcct:r,short:i,external:a,onClick:s}){const{i18n:c}=ne();if(!t)return null;const{acct:l,avatar:u,avatarStatic:f,id:h,url:m,displayName:d,emojis:p,bot:v,username:y}=t,[E,b,w]=l.match(vl)||[,l];e||(e=sr().instance);const k=y.toLowerCase().trim(),g=(d||"").toLowerCase().trim(),A=g.replace(_l,"").replace(yl,""),T=A.replace(bl,""),D=!i&&(k===g||k===A||k===T||gl(c.locale).compare(k,A)===0)||T===l.toLowerCase();return o("a",{class:`name-text ${r?"show-acct":""} ${i?"short":""}`,href:m,target:a?"_blank":null,title:d?`${d} (${w?"":"@"}${l})`:`${w?"":"@"}${l}`,onClick:M=>{if(!a&&!M.shiftKey){if(M.preventDefault(),M.stopPropagation(),s)return s(M);if(M.metaKey||M.ctrlKey||M.shiftKey||M.which===2){const L=`#/${e}/a/${h}`;window.open(L,"_blank");return}V.showAccount={account:t,instance:e}}},children:[n&&o($,{children:[o(ae,{url:f||u,squircle:v})," "]}),d&&!i?o($,{children:[o("b",{dir:"auto",children:o(Ze,{text:d,emojis:p})}),!r&&!D&&o($,{children:[" ",o("i",{class:"bidi-isolate",children:["@",y]})]})]}):i?o("i",{children:y}):o("b",{children:y}),r&&o($,{children:[o("br",{}),o("i",{class:"bidi-isolate",children:[w?"":"@",b,!!w&&o("span",{class:"ib",children:w})]})]})]})}const ve=Rt(El),Wn={"zh-YUE":"YUE",zh_HANT:"zh-Hant"},xr=Rt(t=>new Intl.DisplayNames(t||void 0,{type:"language"}));function wl(t){let e,n;typeof t=="object"&&({code:t,locale:e,fallback:n}=t);try{const r=xr(e||kt.locale).of(t);if(r!==t)return r;if(!n){const i=xr(t).of(t);if(i!==t)return i}return n||""}catch{if(Wn[t])try{const i=xr(Wn[e]||e||kt.locale).of(Wn[t]);return i!==Wn[t]?i:n||""}catch{}return n||""}}const un=Rt(wl),Tl=[{code:"af",name:"Afrikaans"},{code:"sq",name:"Albanian"},{code:"am",name:"Amharic"},{code:"ar",name:"Arabic"},{code:"hy",name:"Armenian"},{code:"as",name:"Assamese"},{code:"ay",name:"Aymara"},{code:"az",name:"Azerbaijani"},{code:"bm",name:"Bambara"},{code:"eu",name:"Basque"},{code:"be",name:"Belarusian"},{code:"bn",name:"Bengali"},{code:"bho",name:"Bhojpuri"},{code:"bs",name:"Bosnian"},{code:"bg",name:"Bulgarian"},{code:"ca",name:"Catalan"},{code:"ceb",name:"Cebuano"},{code:"ny",name:"Chichewa"},{code:"zh",name:"Chinese"},{code:"zh_HANT",name:"Chinese (Traditional)"},{code:"co",name:"Corsican"},{code:"hr",name:"Croatian"},{code:"cs",name:"Czech"},{code:"da",name:"Danish"},{code:"dv",name:"Dhivehi"},{code:"doi",name:"Dogri"},{code:"nl",name:"Dutch"},{code:"en",name:"English"},{code:"eo",name:"Esperanto"},{code:"et",name:"Estonian"},{code:"ee",name:"Ewe"},{code:"tl",name:"Filipino"},{code:"fi",name:"Finnish"},{code:"fr",name:"French"},{code:"fy",name:"Frisian"},{code:"gl",name:"Galician"},{code:"ka",name:"Georgian"},{code:"de",name:"German"},{code:"el",name:"Greek"},{code:"gn",name:"Guarani"},{code:"gu",name:"Gujarati"},{code:"ht",name:"Haitian Creole"},{code:"ha",name:"Hausa"},{code:"haw",name:"Hawaiian"},{code:"iw",name:"Hebrew"},{code:"hi",name:"Hindi"},{code:"hmn",name:"Hmong"},{code:"hu",name:"Hungarian"},{code:"is",name:"Icelandic"},{code:"ig",name:"Igbo"},{code:"ilo",name:"Ilocano"},{code:"id",name:"Indonesian"},{code:"ga",name:"Irish"},{code:"it",name:"Italian"},{code:"ja",name:"Japanese"},{code:"jw",name:"Javanese"},{code:"kn",name:"Kannada"},{code:"kk",name:"Kazakh"},{code:"km",name:"Khmer"},{code:"rw",name:"Kinyarwanda"},{code:"gom",name:"Konkani"},{code:"ko",name:"Korean"},{code:"kri",name:"Krio"},{code:"ku",name:"Kurdish (Kurmanji)"},{code:"ckb",name:"Kurdish (Sorani)"},{code:"ky",name:"Kyrgyz"},{code:"lo",name:"Lao"},{code:"la",name:"Latin"},{code:"lv",name:"Latvian"},{code:"ln",name:"Lingala"},{code:"lt",name:"Lithuanian"},{code:"lg",name:"Luganda"},{code:"lb",name:"Luxembourgish"},{code:"mk",name:"Macedonian"},{code:"mai",name:"Maithili"},{code:"mg",name:"Malagasy"},{code:"ms",name:"Malay"},{code:"ml",name:"Malayalam"},{code:"mt",name:"Maltese"},{code:"mi",name:"Maori"},{code:"mr",name:"Marathi"},{code:"mni-Mtei",name:"Meiteilon (Manipuri)"},{code:"lus",name:"Mizo"},{code:"mn",name:"Mongolian"},{code:"my",name:"Myanmar (Burmese)"},{code:"ne",name:"Nepali"},{code:"no",name:"Norwegian"},{code:"or",name:"Odia (Oriya)"},{code:"om",name:"Oromo"},{code:"ps",name:"Pashto"},{code:"fa",name:"Persian"},{code:"pl",name:"Polish"},{code:"pt",name:"Portuguese"},{code:"pa",name:"Punjabi"},{code:"qu",name:"Quechua"},{code:"ro",name:"Romanian"},{code:"ru",name:"Russian"},{code:"sm",name:"Samoan"},{code:"sa",name:"Sanskrit"},{code:"gd",name:"Scots Gaelic"},{code:"nso",name:"Sepedi"},{code:"sr",name:"Serbian"},{code:"st",name:"Sesotho"},{code:"sn",name:"Shona"},{code:"sd",name:"Sindhi"},{code:"si",name:"Sinhala"},{code:"sk",name:"Slovak"},{code:"sl",name:"Slovenian"},{code:"so",name:"Somali"},{code:"es",name:"Spanish"},{code:"su",name:"Sundanese"},{code:"sw",name:"Swahili"},{code:"sv",name:"Swedish"},{code:"tg",name:"Tajik"},{code:"ta",name:"Tamil"},{code:"tt",name:"Tatar"},{code:"te",name:"Telugu"},{code:"th",name:"Thai"},{code:"ti",name:"Tigrinya"},{code:"ts",name:"Tsonga"},{code:"tr",name:"Turkish"},{code:"tk",name:"Turkmen"},{code:"ak",name:"Twi"},{code:"uk",name:"Ukrainian"},{code:"ur",name:"Urdu"},{code:"ug",name:"Uyghur"},{code:"uz",name:"Uzbek"},{code:"vi",name:"Vietnamese"},{code:"cy",name:"Welsh"},{code:"xh",name:"Xhosa"},{code:"yi",name:"Yiddish"},{code:"yo",name:"Yoruba"},{code:"zu",name:"Zulu"}],Al=Rt(()=>[new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages]),Cl=()=>wn(Al(),Tl.map(t=>t.code.replace("_","-")),"en");function Ls(t=!1){if(t){const{contentTranslationTargetLanguage:e}=V.settings;if(e)return e}return Cl()}const bi=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function jf(t){const e=Math.min(Math.floor(Math.log2(t)/10),bi.length-1),n=t/1024**e;return kt.number(n,{style:"unit",unit:bi[e],unitDisplay:"narrow",maximumFractionDigits:0})}const Sl={"@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"},Ir=/pixelfed/i,re=/^(?!.*pixelfed).*$/i,kl=/pleroma/i,xl=/akkoma/i;const Ei={"@mastodon/lists":re,"@mastodon/filters":re,"@mastodon/mentions":re,"@mastodon/trending-hashtags":re,"@mastodon/trending-links":re,"@mastodon/post-bookmark":re,"@mastodon/post-edit":re,"@mastodon/profile-edit":re,"@mastodon/profile-private-note":re,"@pixelfed/trending":Ir,"@pixelfed/home-include-reblogs":Ir,"@pixelfed/global-feed":Ir,"@pleroma/local-visibility-post":kl,"@akkoma/local-visibility-post":xl},Zn={};function qn(t){var e,n;try{let{version:r,domain:i}=$a(),a=((n=(e=Fa())==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(Ei[t])return Zn[s]=Ei[t].test(r);const c=Sl[t];if(!c)return!1;const u=t.match(/^@([a-z]+)\//)[1]===a.toLowerCase();return Zn[s]=u&&Na(r,c,{includePrerelease:!0,loose:!0})}catch{return!1}}const He=2147483647,Xt=36,Do=1,Sn=26,Il=38,Dl=700,Rs=72,Ms=128,Ps="-",Ll=/^xn--/,Rl=/[^\0-\x7F]/,Ml=/[\x2E\u3002\uFF0E\uFF61]/g,Pl={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Dr=Xt-Do,Qt=Math.floor,Lr=String.fromCharCode;function me(t){throw new RangeError(Pl[t])}function Ol(t,e){const n=[];let r=t.length;for(;r--;)n[r]=e(t[r]);return n}function Os(t,e){const n=t.split("@");let r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(Ml,".");const i=t.split("."),a=Ol(i,e).join(".");return r+a}function $s(t){const e=[];let n=0;const r=t.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...t),Fl=function(t){return t>=48&&t<58?26+(t-48):t>=65&&t<91?t-65:t>=97&&t<123?t-97:Xt},wi=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},Fs=function(t,e,n){let r=0;for(t=n?Qt(t/Dl):t>>1,t+=Qt(t/e);t>Dr*Sn>>1;r+=Xt)t=Qt(t/Dr);return Qt(r+(Dr+1)*t/(t+Il))},Ns=function(t){const e=[],n=t.length;let r=0,i=Ms,a=Rs,s=t.lastIndexOf(Ps);s<0&&(s=0);for(let c=0;c=128&&me("not-basic"),e.push(t.charCodeAt(c));for(let c=s>0?s+1:0;c=n&&me("invalid-input");const m=Fl(t.charCodeAt(c++));m>=Xt&&me("invalid-input"),m>Qt((He-r)/f)&&me("overflow"),r+=m*f;const d=h<=a?Do:h>=a+Sn?Sn:h-a;if(mQt(He/p)&&me("overflow"),f*=p}const u=e.length+1;a=Fs(r-l,u,l==0),Qt(r/u)>He-i&&me("overflow"),i+=Qt(r/u),r%=u,e.splice(r++,0,i)}return String.fromCodePoint(...e)},Bs=function(t){const e=[];t=$s(t);const n=t.length;let r=Ms,i=0,a=Rs;for(const l of t)l<128&&e.push(Lr(l));const s=e.length;let c=s;for(s&&e.push(Ps);c=r&&fQt((He-i)/u)&&me("overflow"),i+=(l-r)*u,r=l;for(const f of t)if(fHe&&me("overflow"),f===r){let h=i;for(let m=Xt;;m+=Xt){const d=m<=a?Do:m>=a+Sn?Sn:m-a;if(h{const{shortcode:r,staticUrl:i,url:a}=n;t=t.replace(new RegExp(`:${r}:`,"g"),`:${r}:`)}),t):""}const $e=document.createElement("div"),zl=["u-url","mention","hashtag"],Vl=/[&<>]/g;function Rr(t){return t.replace(Vl,e=>({"&":"&","<":"<",">":">"})[e])}const Hl=/{}}=e;let a=t;const s=tu(a,r),c=Hl.test(a),l=a.includes("```");if(c){const m=s.querySelectorAll('a:not([target="_blank"])');for(const p of m)p.setAttribute("target","_blank");const d=s.querySelectorAll("a[class]");for(const p of d)for(const v of p.classList)zl.includes(v)||p.classList.remove(v)}if(c){const m=s.querySelectorAll("a[href]");for(const d of m)Ul.test(d.textContent.trim())&&(d.classList.add("has-url-text"),iu(d))}if(c){const m=s.querySelectorAll("a[href]"),d=[];for(const p of m){const v=p.innerText.trim(),y=p.querySelector("*");if(jl.test(v)){const[E,b,w]=v.split("@");y||(!d.some(([k])=>k===b)||d.some(([k,g])=>k===b&&g===w)?(p.innerHTML=`@${b}`,d.push([b,w])):p.innerHTML=`@${b}@${w}`),p.classList.add("mention")}Kl.test(v)&&(y||(p.innerHTML=`#${v.slice(1)}`),p.classList.add("mention","hashtag"))}}let u;if(a.includes(":")&&(n!=null&&n.length)){u=Pr(s);for(const m of u){let d=Rr(m.nodeValue);d=lo(d,n),$e.innerHTML=d,m.replaceWith(...$e.childNodes)}}if(l){const m=[...s.querySelectorAll("p")].filter(d=>Wl.test(d.innerText.trim()));for(const d of m){const p=document.createElement("pre");for(const v of d.querySelectorAll("br"))v.replaceWith(` +`);p.innerHTML=`${d.innerHTML.trim()}`,d.replaceWith(p)}}if(l){const d=[...s.querySelectorAll("p")].filter(p=>Zl.test(p.innerText));for(const p of d){const v=[p];let y=!1,E=p;for(;E.nextElementSibling;){const b=E.nextElementSibling;if(b&&b.tagName==="P")if(ql.test(b.innerText)){v.push(b),y=!0;break}else v.push(b);else break;E=b}if(y){const b=document.createElement("pre");for(const k of v)for(const g of k.querySelectorAll("br"))g.replaceWith(` +`);const w=v.map(k=>k.innerHTML).join(` + +`);b.innerHTML=`${w}`,p.replaceWith(b);for(const k of v)k.remove()}}}if(a.includes("`")){u=Pr(s);for(const m of u){let d=Rr(m.nodeValue);Gl.test(d)&&(d=d.replaceAll(Jl,"$1")),$e.innerHTML=d,m.replaceWith(...$e.childNodes)}}if(Yl.test(a)){u=Pr(s,{rejectFilter:["A"]});for(const m of u){let d=Rr(m.nodeValue);Xl.test(d)&&(d=d.replaceAll(Ql,'$1')),$e.innerHTML=d,m.replaceWith(...$e.childNodes)}}if(a.includes("#")){let m=null;const d=[...s.querySelectorAll("p")].filter((p,v)=>{let y=0;for(let E=0;E3||y>1&&m&&v===m+1)return m=v,!0});if(d!=null&&d.length)for(const p of d)p.classList.add("hashtag-stuffing"),p.title=p.innerText}if(a.includes("i(s)),r?s:s.innerHTML}const Vs=Rt(eu),nu=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],ru=Object.fromEntries(nu.map(t=>[t,!0])),ou=/^(https?:\/\/(www\.)?|xmpp:)/,Mr=30;function iu(t){var e;if(!(!t||(e=t.querySelector)!=null&&e.call(t,"*")))try{const n=t.innerText.trim(),r=(n.match(ou)||[])[0]||"";if(!r)return;const i=n.slice(r.length,r.length+Mr),a=n.slice(r.length+Mr),s=n.slice(r.length).length>Mr;t.innerHTML=`${i}`}catch{}}function Pr(t,e={}){var s;const n=[],r=Object.assign({},ru,(s=e.rejectFilter)==null?void 0:s.reduce((c,l)=>(c[l]=!0,c),{})),i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(c){return r[c.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let a;for(;a=i.nextNode();)n.push(a);return n}function su(t){const{mentions:e=[],instance:n,previewMode:r,statusURL:i}=t||{};return a=>{var f,h;let{target:s}=a;if(s=s.closest("a"),!s||a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.which===2)return;const c=(f=s.previousSibling)==null?void 0:f.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 m=(s.querySelector("span")||s).innerText.trim(),d=m.replace(/^@/,""),p=s.getAttribute("href"),v=e.find(y=>y.url===p)||e.find(y=>y.acct===d||y.username===d);if(v)a.preventDefault(),a.stopPropagation(),V.showAccount={account:v.acct,instance:n};else if(!/^http/i.test(m)){a.preventDefault(),a.stopPropagation();const y=s.getAttribute("href");V.showAccount={account:y,instance:n}}}else if(!r){const m=c==null?void 0:c.endsWith("#");if(s.classList.contains("hashtag")||m){a.preventDefault(),a.stopPropagation();const d=s.innerText.replace(/^#/,"").trim(),p=n?`#/${n}/t/${d}`:`#/t/${d}`;location.hash=p}else(h=V.unfurledLinks[s.href])!=null&&h.url&&i!==s.href&&(a.preventDefault(),a.stopPropagation(),V.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${V.unfurledLinks[s.href].url}`)}}}function Kf(t,e){return()=>kt.number(t,{style:"unit",unit:e,unitDisplay:"long"})}function oe(t){try{return kt.number(t,{notation:"compact",roundingMode:"floor"})}catch{return t}}function Wf({skeleton:t,account:e,avatarSize:n="xl",useAvatarStatic:r=!1,instance:i,external:a,internal:s,onClick:c,showActivity:l=!1,showStats:u=!1,accountInstance:f,hideDisplayName:h=!1,relationship:m={},excludeRelationshipAttrs:d=[]}){const{_:p}=ne();if(t)return o("div",{class:"account-block skeleton",children:[o(ae,{size:n}),o("span",{children:[o("b",{children:"████████"}),o("br",{}),o("span",{class:"account-block-acct",children:"██████"})]})]});if(!e)return null;const{id:v,acct:y,avatar:E,avatarStatic:b,displayName:w,username:k,emojis:g,url:A,statusesCount:T,lastStatusAt:D,bot:M,fields:L,note:C,group:x,followersCount:F,createdAt:W,locked:j}=e;let[et,st,ot]=y.match(/([^@]+)(@.+)/i)||[,y];f&&(ot=`@${f}`);const nt=L==null?void 0:L.find(ht=>!!ht.verifiedAt&&!!ht.value),J={};for(const ht in m)d.includes(ht)||(J[ht]=m[ht]);const vt=J.following||J.followedBy||J.requested;return o("a",{class:"account-block",href:A,target:a?"_blank":null,title:ot?y:`@${y}`,onClick:ht=>{if(!a){if(ht.preventDefault(),c)return c(ht);s?location.hash=`/${i}/a/${v}`:V.showAccount={account:e,instance:i}}},children:[o("div",{class:"avatar-container",children:o(ae,{url:r?b:E||b,size:n,squircle:M})}),o("span",{class:"account-block-content",children:[!h&&o($,{children:w?o("b",{children:o(Ze,{text:w,emojis:g})}):o("b",{children:k})})," ",o("span",{class:"account-block-acct bidi-isolate",children:[ot?"":"@",st,o("wbr",{}),ot,j&&o($,{children:[" ",o(R,{icon:"lock",size:"s",alt:p({id:"G2fuEb"})})]})]}),l&&o("div",{class:"account-block-stats",children:[o(P,{id:"ajzDof",values:{0:oe(T)}}),!!D&&o($,{children:[" ","·"," ",o(P,{id:"f8bJ3C",values:{0:Cn(D,{hideTime:!0})}})]})]}),u&&o("div",{class:"account-block-stats",children:[M&&o($,{children:o("span",{class:"tag collapsed",children:[o(R,{icon:"bot"})," ",o(P,{id:"9Vdq+j"})]})}),!!x&&o($,{children:o("span",{class:"tag collapsed",children:[o(R,{icon:"group"})," ",o(P,{id:"L8fEEm"})]})}),vt&&o("div",{class:"shazam-container-horizontal",children:o("div",{class:"shazam-container-inner",children:J.following&&J.followedBy?o("span",{class:"tag minimal",children:o(P,{id:"7oRLbi"})}):J.requested?o("span",{class:"tag minimal",children:o(P,{id:"Yx0Ud8"})}):J.following?o("span",{class:"tag minimal",children:o(P,{id:"y6sq5j"})}):J.followedBy?o("span",{class:"tag minimal",children:o(P,{id:"p3UO/y"})}):null})},m.id),!!F&&o("span",{class:"ib",children:o(P,{id:"Mn1E9C",values:{followersCount:F}})}),!!nt&&o("span",{class:"verified-field",children:[o(R,{icon:"check-circle",size:"s",alt:p({id:"QDEWii"})})," ",o("span",{dangerouslySetInnerHTML:{__html:Vs(nt.value,{emojis:g})}})]}),!M&&!x&&!vt&&!F&&!nt&&!!W&&o("span",{class:"created-at",children:o(P,{id:"PCcEFZ",values:{0:Cn(W,{hideTime:!0})},components:{0:o("time",{datetime:W})}})})]})]})]})}var Or={},$r,Ti;function au(){if(Ti)return $r;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 $r=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 r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=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)},r),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 r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._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,r=0,i=0;i=r&&(n=a,r=c)}return n},$r}var Ai;function cu(){return Ai||(Ai=1,function(t){var e=au();t.operation=function(n){var r=t.timeouts(n);return new e(r,{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 r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in n)r[i]=n[i];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var a=[],s=0;sfu.call(t)==="[object Error]",mu=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 pu(t){return t&&hu(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:mu.has(t.message):!1}class gu 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 Si=(t,e,n)=>{const r=n.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=r,t};async function vu(t,e){return new Promise((n,r)=>{e={...e},e.onFailedAttempt??(e.onFailedAttempt=()=>{}),e.shouldRetry??(e.shouldRetry=()=>!0),e.retries??(e.retries=10);const i=du.operation(e),a=()=>{var c;i.stop(),r((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 gu)throw l.originalError;if(l instanceof TypeError&&!pu(l))throw l;if(Si(l,c,e),await e.shouldRetry(l)||(i.stop(),r(l)),await e.onFailedAttempt(l),!i.retry(l))throw i.mainError()}catch(u){Si(u,c,e),s(),r(u)}}})})}const _u=[{code:"auto",name:"Detect"},{code:"af",name:"Afrikaans"},{code:"sq",name:"Albanian"},{code:"am",name:"Amharic"},{code:"ar",name:"Arabic"},{code:"hy",name:"Armenian"},{code:"as",name:"Assamese"},{code:"ay",name:"Aymara"},{code:"az",name:"Azerbaijani"},{code:"bm",name:"Bambara"},{code:"eu",name:"Basque"},{code:"be",name:"Belarusian"},{code:"bn",name:"Bengali"},{code:"bho",name:"Bhojpuri"},{code:"bs",name:"Bosnian"},{code:"bg",name:"Bulgarian"},{code:"ca",name:"Catalan"},{code:"ceb",name:"Cebuano"},{code:"ny",name:"Chichewa"},{code:"zh",name:"Chinese"},{code:"co",name:"Corsican"},{code:"hr",name:"Croatian"},{code:"cs",name:"Czech"},{code:"da",name:"Danish"},{code:"dv",name:"Dhivehi"},{code:"doi",name:"Dogri"},{code:"nl",name:"Dutch"},{code:"en",name:"English"},{code:"eo",name:"Esperanto"},{code:"et",name:"Estonian"},{code:"ee",name:"Ewe"},{code:"tl",name:"Filipino"},{code:"fi",name:"Finnish"},{code:"fr",name:"French"},{code:"fy",name:"Frisian"},{code:"gl",name:"Galician"},{code:"ka",name:"Georgian"},{code:"de",name:"German"},{code:"el",name:"Greek"},{code:"gn",name:"Guarani"},{code:"gu",name:"Gujarati"},{code:"ht",name:"Haitian Creole"},{code:"ha",name:"Hausa"},{code:"haw",name:"Hawaiian"},{code:"iw",name:"Hebrew"},{code:"hi",name:"Hindi"},{code:"hmn",name:"Hmong"},{code:"hu",name:"Hungarian"},{code:"is",name:"Icelandic"},{code:"ig",name:"Igbo"},{code:"ilo",name:"Ilocano"},{code:"id",name:"Indonesian"},{code:"ga",name:"Irish"},{code:"it",name:"Italian"},{code:"ja",name:"Japanese"},{code:"jw",name:"Javanese"},{code:"kn",name:"Kannada"},{code:"kk",name:"Kazakh"},{code:"km",name:"Khmer"},{code:"rw",name:"Kinyarwanda"},{code:"gom",name:"Konkani"},{code:"ko",name:"Korean"},{code:"kri",name:"Krio"},{code:"ku",name:"Kurdish (Kurmanji)"},{code:"ckb",name:"Kurdish (Sorani)"},{code:"ky",name:"Kyrgyz"},{code:"lo",name:"Lao"},{code:"la",name:"Latin"},{code:"lv",name:"Latvian"},{code:"ln",name:"Lingala"},{code:"lt",name:"Lithuanian"},{code:"lg",name:"Luganda"},{code:"lb",name:"Luxembourgish"},{code:"mk",name:"Macedonian"},{code:"mai",name:"Maithili"},{code:"mg",name:"Malagasy"},{code:"ms",name:"Malay"},{code:"ml",name:"Malayalam"},{code:"mt",name:"Maltese"},{code:"mi",name:"Maori"},{code:"mr",name:"Marathi"},{code:"mni-Mtei",name:"Meiteilon (Manipuri)"},{code:"lus",name:"Mizo"},{code:"mn",name:"Mongolian"},{code:"my",name:"Myanmar (Burmese)"},{code:"ne",name:"Nepali"},{code:"no",name:"Norwegian"},{code:"or",name:"Odia (Oriya)"},{code:"om",name:"Oromo"},{code:"ps",name:"Pashto"},{code:"fa",name:"Persian"},{code:"pl",name:"Polish"},{code:"pt",name:"Portuguese"},{code:"pa",name:"Punjabi"},{code:"qu",name:"Quechua"},{code:"ro",name:"Romanian"},{code:"ru",name:"Russian"},{code:"sm",name:"Samoan"},{code:"sa",name:"Sanskrit"},{code:"gd",name:"Scots Gaelic"},{code:"nso",name:"Sepedi"},{code:"sr",name:"Serbian"},{code:"st",name:"Sesotho"},{code:"sn",name:"Shona"},{code:"sd",name:"Sindhi"},{code:"si",name:"Sinhala"},{code:"sk",name:"Slovak"},{code:"sl",name:"Slovenian"},{code:"so",name:"Somali"},{code:"es",name:"Spanish"},{code:"su",name:"Sundanese"},{code:"sw",name:"Swahili"},{code:"sv",name:"Swedish"},{code:"tg",name:"Tajik"},{code:"ta",name:"Tamil"},{code:"tt",name:"Tatar"},{code:"te",name:"Telugu"},{code:"th",name:"Thai"},{code:"ti",name:"Tigrinya"},{code:"ts",name:"Tsonga"},{code:"tr",name:"Turkish"},{code:"tk",name:"Turkmen"},{code:"ak",name:"Twi"},{code:"uk",name:"Ukrainian"},{code:"ur",name:"Urdu"},{code:"ug",name:"Uyghur"},{code:"uz",name:"Uzbek"},{code:"vi",name:"Vietnamese"},{code:"cy",name:"Welsh"},{code:"xh",name:"Xhosa"},{code:"yi",name:"Yiddish"},{code:"yo",name:"Yoruba"},{code:"zu",name:"Zulu"}],Hs="ai"in self&&"translator"in self.ai;let Ue;Hs&&(async()=>{try{const e=(await self.ai.languageDetector.capabilities()).capabilities;e==="readily"?Ue=await self.ai.languageDetector.create():(Ue=await self.ai.languageDetector.create({monitor(n){n.addEventListener("downloadprogress",r=>{})}}),await Ue.ready)}catch{}})();const yu=async(t,e,n)=>{let r;const i=e;if(e==="auto")try{e=(await Ue.detect(t))[0].detectedLanguage,r=e}catch(a){return{error:a}}console.groupCollapsed("💬 BROWSER TRANSLATE",i,r,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",f=>{})}});const l=await c.translate(t);return console.groupEnd(),{content:l,detectedSourceLanguage:r,provider:"browser"}}catch(a){return console.groupEnd(),{error:a}}};var bu=Object.defineProperty,Eu=(t,e,n)=>e in t?bu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Gn=(t,e,n)=>Eu(t,typeof e!="symbol"?e+"":e,n),uo=new Map,Yn=new WeakMap,ki=0,wu=void 0;function Tu(t){return t?(Yn.has(t)||(ki+=1,Yn.set(t,ki.toString())),Yn.get(t)):"0"}function Au(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?Tu(t.root):t[e]}`).toString()}function Cu(t){const e=Au(t);let n=uo.get(e);if(!n){const r=new Map;let i;const a=new IntersectionObserver(s=>{s.forEach(c=>{var l;const u=c.isIntersecting&&i.some(f=>c.intersectionRatio>=f);t.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=u),(l=r.get(c.target))==null||l.forEach(f=>{f(u,c)})})},t);i=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:r},uo.set(e,n)}return n}function Us(t,e,n={},r=wu){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const l=t.getBoundingClientRect();return e(r,{isIntersecting:r,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}=Cu(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(),uo.delete(i))}}function Su(t){return typeof t.children!="function"}var Zf=class extends ns{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(),Su(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:r,delay:i,fallbackInView:a}=this.props;this._unobserveCb=Us(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:r,delay:i},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if(typeof t=="function"){const{inView:d,entry:p}=this.state;return t({inView:d,entry:p,ref:this.handleNode})}const{as:e,triggerOnce:n,threshold:r,root:i,rootMargin:a,onChange:s,skip:c,trackVisibility:l,delay:u,initialInView:f,fallbackInView:h,...m}=this.props;return Ba(e||"div",{ref:this.handleNode,...m},t)}};function ku({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:i,triggerOnce:a,skip:s,initialInView:c,fallbackInView:l,onChange:u}={}){var f;const[h,m]=H(null),d=O(u),[p,v]=H({inView:!!c,entry:void 0});d.current=u,tt(()=>{if(s||!h)return;let w;return w=Us(h,(k,g)=>{v({inView:k,entry:g}),d.current&&d.current(k,g),g.isIntersecting&&a&&w&&(w(),w=void 0)},{root:i,rootMargin:r,threshold:t,trackVisibility:n,delay:e},l),()=>{w&&w()}},[Array.isArray(t)?t.toString():t,h,i,r,a,s,n,l,e]);const y=(f=p.entry)==null?void 0:f.target,E=O(void 0);!h&&y&&!a&&!s&&E.current!==y&&(E.current=y,v({inView:!!c,entry:void 0}));const b=[m,p.inView,p.entry];return b.ref=b[0],b.inView=b[1],b.entry=b[2],b}const xi=48,Nr={};function js({id:t,children:e}){const n=O(),r=!!Nr[t],[i,a]=H(!1),[s,c]=H(r||!1),{ref:l}=ku({root:null,rootMargin:`-${xi}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,onChange:u=>{u&&(a(!0),t&&(Nr[t]=!0))},triggerOnce:!0,skip:s||i});return tt(()=>{if(!n.current)return;const u=n.current.getBoundingClientRect();u.bottom>xi&&(u.top{let i=_n[Br];return fetch(`https://${i}/api/v1/${e}/${n}/${encodeURIComponent(t)}`).then(a=>{if(!a.ok)throw new Error(a.statusText);return a.json()}).then(a=>{var s;return{provider:"lingva",content:a.translation,detectedSourceLanguage:(s=a.info)==null?void 0:s.detectedSource,info:a.info}})},{retries:3,onFailedAttempt:i=>{Br=(Br+1)%_n.length}})}const Ks=1e3*60*60,Ws=hr(Du,{maxAge:Ks}),Lu=hr(Iu(Ws),{maxAge:Ks});function Ru({forceTranslate:t,sourceLanguage:e,onTranslate:n,text:r="",mini:i,autoDetected:a}){const{_:s}=ne(),c=Ls(!0),[l,u]=H("default"),[f,h]=H(null),[m,d]=H(null),[p,v]=H(null),y=O(),E=e?un(e):null,b=un(c),w=O("auto");n||(n=async(...g)=>{if(Hs){const A=await yu(...g);if(A&&!A.error)return A}return i?await Lu(...g):await Ws(...g)});const k=async()=>{var g,A;u("loading");try{const{content:T,detectedSourceLanguage:D,provider:M,error:L,...C}=await n(r,w.current,c);if(T){if(D){const x=un(D);v(x)}if(M==="lingva"){const x=(A=(g=C==null?void 0:C.info)==null?void 0:g.pronunciation)==null?void 0:A.query;x&&h(x)}d(T),u("default"),!i&&T.trim()!==r.trim()&&(y.current.open=!0,y.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else u("error")}catch{u("error")}};return tt(()=>{t&&k()},[t]),i?m&&m.trim()!==r.trim()&&p!==b?o(js,{children:o("div",{class:"status-translation-block-mini",children:[o(R,{icon:"translate",alt:s({id:"zVJKbG",values:{sourceLangText:E}})}),o("output",{lang:c,dir:"auto",title:f||"",children:m})]})}):null:o("div",{class:"status-translation-block",onClick:g=>{g.preventDefault()},children:o("details",{ref:y,children:[o("summary",{children:o("button",{type:"button",onClick:async g=>{g.preventDefault(),g.stopPropagation(),y.current.open=!y.current.open,l!=="loading"&&(m||k())},children:[o(R,{icon:"translate"})," ",o("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"})})]})}),o("div",{class:"translated-block",children:[o("div",{class:"translation-info insignificant",children:[o("select",{class:"translated-source-select",disabled:l==="loading",onChange:g=>{w.current=g.target.value,k()},children:_u.map(g=>{const A=un({code:g.code,fallback:g.name}),T=un({code:g.code,locale:g.code}),D=A!==T;return o("option",{value:g.code,children:g.code==="auto"?s({id:"Bze3gr",values:{0:p??"…"}}):D?`${T} - ${A}`:T})})})," ",o("span",{children:["→ ",b]}),o(os,{abrupt:!0,hidden:l!=="loading"})]}),l==="error"?o("p",{class:"ui-state",children:o(P,{id:"m5LihO"})}):!!m&&o($,{children:[o("output",{class:"translated-content",lang:c,dir:"auto",children:m}),!!f&&o("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:g=>{g.target.classList.toggle("expand")},children:f})]})]})]})})}const Mu=_n!=null&&_n.length?Ru:()=>null;function ue(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 r=ue(n);return(i,a)=>r.then(s=>a(s.transaction(e,i).objectStore(e)))}let zr;function De(){return zr||(zr=Zs("keyval-store","keyval")),zr}function Pu(t,e=De()){return e("readonly",n=>ue(n.get(t)))}function Ou(t,e,n=De()){return n("readwrite",r=>(r.put(e,t),ue(r.transaction)))}function $u(t,e=De()){return e("readonly",n=>Promise.all(t.map(r=>ue(n.get(r)))))}function Fu(t,e=De()){return e("readwrite",n=>(n.delete(t),ue(n.transaction)))}function Nu(t,e=De()){return e("readwrite",n=>(t.forEach(r=>n.delete(r)),ue(n.transaction)))}function Bu(t=De()){return t("readwrite",e=>(e.clear(),ue(e.transaction)))}function zu(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},ue(t.transaction)}function Vu(t=De()){return t("readonly",e=>{if(e.getAllKeys)return ue(e.getAllKeys());const n=[];return zu(e,r=>n.push(r.key)).then(()=>n)})}function Di(t,e){const n=Zs(t,e);return{set:(r,i)=>Ou(r,i,n),get:r=>Pu(r,n),getMany:r=>$u(r,n),del:r=>Fu(r,n),delMany:r=>Nu(r,n),clear:()=>Bu(n),keys:()=>Vu(n)}}const qf={drafts:Di("drafts-db","drafts-store"),catchup:Di("catchup-db","catchup-store")};async function Gf(t,e={}){if(!(t!=null&&t.length))return;const{masto:n}=sr(),r=Eo(),i=t.reduce((a,s)=>(!a.includes(s.id)&&!e[s.id]&&s.id!==r&&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 Vt extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>Vt.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,r){n!==r&&(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 r=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 r=>{const i=r.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((r,i)=>{r.forEach(a=>{a.isIntersecting&&!this.isIframeLoaded&&(Vt.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 r=document.createElement("link");r.rel=e,r.href=n,r.crossOrigin="true",document.head.append(r)}static warmConnections(e){Vt.isPreconnected||window.liteYouTubeIsPreconnected||(Vt.addPrefetch("preconnect","https://i.ytimg.com/"),Vt.addPrefetch("preconnect","https://s.ytimg.com"),e.noCookie?Vt.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(Vt.addPrefetch("preconnect","https://www.youtube.com"),Vt.addPrefetch("preconnect","https://www.google.com"),Vt.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),Vt.addPrefetch("preconnect","https://static.doubleclick.net")),Vt.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}Vt.isPreconnected=!1;customElements.define("lite-youtube",Vt);const qs=new Uint8Array(128);for(let t=0;t<83;t++)qs["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(t)]=t;const rr=(t,e,n)=>{let r=0;for(;et>10.31475?Gs(t/Xs+.052132,2.4):t/Ys,Vr=t=>~~(t>1227e-8?Xs*Gs(t,.416666)-13.025:t*Ys+1),yn=t=>(t<0?-1:1)*t*t,Li=t=>{for(t+=kn/2;t>kn;)t-=Hu;const e=1.27323954*t-.405284735*yn(t);return .225*(yn(e)-e)+e};function Lo(t){const e=rr(t,2,6);return[e>>16,e>>8&255,e&255]}function ju(t,e,n,r){const i=rr(t,0,1),a=i%9+1,s=~~(i/9)+1,c=a*s;let l=0,u=0,f=0,h=0,m=0,d=0,p=0,v=0,y=0,E=0,b=0,w=0;const k=(rr(t,1,2)+1)/13446*(r|1),g=new Float64Array(c*3),A=Lo(t);for(l=0;l<3;l++)g[l]=Uu(A[l]);for(l=1;l{const r=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 f=[`${r.repeat(a?a*i:0)}${l}`,...c];return l.substring(0,2)==="n.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");return Ur={mergeAttributesWithElements:n=>{const r=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},Ur}var jr,Pi;function Zu(){if(Pi)return jr;Pi=1;const t=Ku(),{mergeAttributesWithElements:e}=Wu();return jr=(r,i={})=>{const a=e(r);return t(a,i)},jr}var qu=Zu();const Gu=bo(qu);function Yu({poll:t,lang:e,readOnly:n,refresh:r=()=>{},votePoll:i=()=>{}}){const{_:a}=ne(),[s,c]=H("default"),{expired:l,expiresAt:u,id:f,multiple:h,options:m,ownVotes:d,voted:p,votersCount:v,votesCount:y=0,emojis:E}=t,b=!!u&&new Date(u),w=h?v:y;let k=0;w<=1e3?k=0:w<=1e4?k=1:w<=1e5&&(k=2);const[g,A]=H(!1),T=m.every(D=>D.votesCount!==null);return o("div",{lang:e,dir:"auto",class:`poll ${n?"read-only":""} ${s==="loading"?"loading":""}`,children:[g&&T||p||l?o($,{children:[o("div",{class:"poll-options",children:m.map((D,M)=>{const{title:L,votesCount:C}=D,x=w?C/w:0,F=x?x.toLocaleString(kt.locale||void 0,{style:"percent",maximumFractionDigits:k}):"0%",W=C>0&&C===Math.max(...m.map(j=>j.votesCount));return o("div",{class:`poll-option poll-result ${W?"poll-option-leading":""}`,style:{"--percentage":`${x*100}%`},children:[o("div",{class:"poll-option-title",children:[o("span",{children:o(Ze,{text:L,emojis:E})}),p&&d.includes(M)&&o($,{children:[" ",o(R,{icon:"check-circle",alt:a({id:"IeO7us"})})]})]}),o("div",{class:"poll-option-votes",title:kt._({id:"+syLpm",values:{optionVotesCount:C}}),children:F})]},`${M}-${L}-${C}`)})}),!l&&!p&&o("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:D=>{D.preventDefault(),A(!1)},children:[o(R,{icon:"arrow-left",size:"s"})," ",o(P,{id:"L96xSt"})]})]}):o("form",{onSubmit:async D=>{D.preventDefault();const M=D.target,L=new FormData(M),C=[];L.forEach((x,F)=>{F==="poll"&&C.push(x)}),C.length&&(c("loading"),await i(C),c("default"))},children:[o("div",{class:"poll-options",children:m.map((D,M)=>{const{title:L}=D;return o("div",{class:"poll-option",children:o("label",{class:"poll-label",children:[o("input",{type:h?"checkbox":"radio",name:"poll",value:M,disabled:s==="loading",readOnly:n}),o("span",{class:"poll-option-title",children:o(Ze,{text:L,emojis:E})})]})})})}),!n&&o("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:o(P,{id:"lQXQKs"})})]}),o("p",{class:"poll-meta",children:[!l&&!n&&o("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:D=>{D.preventDefault(),c("loading"),(async()=>(await r(),c("default")))()},title:a({id:"lCF0wC"}),children:o(R,{icon:"refresh",alt:a({id:"lCF0wC"})})}),!p&&!l&&!n&&T&&o("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:D=>{D.preventDefault(),A(!g)},title:a(g?{id:"L96xSt"}:{id:"zCjei3"}),children:[o(R,{icon:g?"eye-open":"eye-close",alt:a(g?{id:"L96xSt"}:{id:"zCjei3"})})," "]}),!l&&!n&&" ",o(P,{id:"k7v0Rh",values:{0:oe(y),1:oe(y),votesCount:y},components:{0:o("span",{title:y}),1:o("span",{title:y})}}),!!v&&v!==y&&o($,{children:[" ","•"," ",o(P,{id:"jf1i1L",values:{0:oe(v),1:oe(v),votersCount:v},components:{0:o("span",{title:v}),1:o("span",{title:v})}})]})," ","•"," ",l?b?o(P,{id:"5LwCCI",components:{0:o(se,{datetime:b})}}):a({id:"237hSL"}):b?o(P,{id:"ooHDPY",components:{0:o(se,{datetime:b})}}):a({id:"O2tNG0"})]})]})}const Qs=le();function Xu(t,e){if(!(t!=null&&t.length))return!1;const n=t.filter(a=>{const{filter:s}=a,c=s.context.includes(e);return c?s.expiresAt?new Date(s.expiresAt)>new Date:c:!1});if(!n.length)return!1;if(n.some(a=>a.filter.filterAction==="hide"))return{action:"hide"};if(n.some(a=>a.filter.filterAction==="warn")){const a=n.map(s=>s.filter.title);return{action:"warn",titles:a,titlesStr:a.join(" • ")}}return!1}const Ro=Rt(Xu);function Qu(t,e,n){var s;const{filtered:r}=t;if(!(r!=null&&r.length)||n&&((s=t.account)==null?void 0:s.id)===n)return!0;const a=Ro(r,e);return a?a.action!=="hide":!0}function Yf(t,e){if(!(t!=null&&t.length))return[];if(!e)return t;const n=Eo();return t.filter(r=>Qu(r,e,n))}function Oi(t){try{return zs.toUnicode(URL.parse(t).hostname.replace(/^www\./,"").replace(/\/$/,""))}catch{return""}}const Kr=document.createElement("div");function Wr(t){return t?(Kr.innerHTML=t,Kr.querySelectorAll(".invisible").forEach(e=>{e.remove()}),Kr.innerText.length):0}const vn="speechSynthesis"in window;function $i(t,e){if(vn)try{speechSynthesis.speaking&&speechSynthesis.cancel();const n=new SpeechSynthesisUtterance(t);e&&(n.lang=e),speechSynthesis.speak(n)}catch(n){alert(n)}}function Ju(t,e,n){var r=this,i=O(null),a=O(0),s=O(null),c=O([]),l=O(),u=O(),f=O(t),h=O(!0);f.current=t;var m=typeof window<"u",d=!e&&e!==0&&m;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var p=!!(n=n||{}).leading,v=!("trailing"in n)||!!n.trailing,y="maxWait"in n,E="debounceOnServer"in n&&!!n.debounceOnServer,b=y?Math.max(+n.maxWait||0,e):null;tt(function(){return h.current=!0,function(){h.current=!1}},[]);var w=it(function(){var k=function(L){var C=c.current,x=l.current;return c.current=l.current=null,a.current=L,u.current=f.current.apply(x,C)},g=function(L,C){d&&cancelAnimationFrame(s.current),s.current=d?requestAnimationFrame(L):setTimeout(L,C)},A=function(L){if(!h.current)return!1;var C=L-i.current;return!i.current||C>=e||C<0||y&&L-a.current>=b},T=function(L){return s.current=null,v&&c.current?k(L):(c.current=l.current=null,u.current)},D=function L(){var C=Date.now();if(A(C))return T(C);if(h.current){var x=e-(C-i.current),F=y?Math.min(x,b-(C-a.current)):x;g(L,F)}},M=function(){if(m||E){var L=Date.now(),C=A(L);if(c.current=[].slice.call(arguments),l.current=r,i.current=L,C){if(!s.current&&h.current)return a.current=i.current,g(D,e),p?k(i.current):u.current;if(y)return g(D,e),k(i.current)}return s.current||g(D,e),u.current}};return M.cancel=function(){s.current&&(d?cancelAnimationFrame(s.current):clearTimeout(s.current)),a.current=0,c.current=i.current=l.current=s.current=null},M.isPending=function(){return!!s.current},M.flush=function(){return s.current?T(Date.now()):u.current},M},[p,y,e,b,v,d,m,E]);return w}function td(t,e,n){var r=n===void 0?{}:n,i=r.leading,a=r.trailing;return Ju(t,e,{maxWait:e,leading:i===void 0||i,trailing:a===void 0||a})}function ed(t,e){var n=O(null),r=O(null);r.current=e;var i=O(null);tt(function(){a()});var a=At(function(){var s=i.current,c=r.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 tt(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),At(function(s){i.current=s,a()},[a])}function Fi(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 nd(t){t===void 0&&(t={});var e=t.onResize,n=O(void 0);n.current=e;var r=t.round||Math.round,i=O(),a=H({width:void 0,height:void 0}),s=a[0],c=a[1],l=O(!1);tt(function(){return l.current=!1,function(){l.current=!0}},[]);var u=O({width:void 0,height:void 0}),f=ed(At(function(h){return(!i.current||i.current.box!==t.box||i.current.round!==r)&&(i.current={box:t.box,round:r,instance:new ResizeObserver(function(m){var d=m[0],p=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",v=Fi(d,p,"inlineSize"),y=Fi(d,p,"blockSize"),E=v?r(v):void 0,b=y?r(y):void 0;if(u.current.width!==E||u.current.height!==b){var w={width:E,height:b};u.current.width=E,u.current.height=b,n.current?n.current(w):l.current||c(w)}})}),i.current.instance.observe(h,{box:t.box}),function(){i.current&&i.current.instance.unobserve(h)}},[t.box,r]),t.ref);return it(function(){return{ref:f,width:s.width,height:s.height}},[f,s.width,s.height])}function or({className:t="truncated"}={}){const e=O(),n=td(({height:r})=>{if(e.current){const{scrollHeight:i}=e.current;let a=i>r;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 nd({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",rd=".".concat(Js,"{overflow:hidden;touch-action:none}.").concat(ta,"{transform-origin: 0 0}"),od=typeof window>"u",id=function(){return!od&&("ontouchstart"in window||navigator.maxTouchPoints>0)};var sd=function(t){var e=t.x,n=t.y,r=t.scale;return"scale3d(".concat(r,",").concat(r,", 1) translate3d(").concat(e,"px, ").concat(n,"px, 0)")};var ad=Math.min,cd=Math.max;function Ni(t){var e=t.containerDimension,n=t.childDimension,r=t.padding,i=t.centerContained,a=n-e;return a+2*r<=0&&i?[a/2,a/2]:[ad(a+r,0)-r,cd(0,a+r)]}var Bi=function(t,e){return e?"".concat(t," ").concat(e):t},Xn=Math.abs,ld=Math.min,ud=Math.sqrt,ea=typeof window>"u",dd=ea?!1:/(Mac)/i.test(navigator.platform),Fe=function(t){return t==="drag"},dn=function(t){return t==="zoom"},fd=function(t){return dd&&t.ctrlKey},fn=function(t){t.stopPropagation(),t.preventDefault()},zi=function(t,e){var n=t.x-e.x,r=t.y-e.y;return ud(n*n+r*r)},hd=function(t,e){var n=zi(t[0],t[1]),r=zi(e[0],e[1]);return r/n},md=function(t,e){return t>e-.01&&te?e:n},_d=function(t){return!(t.ctrlKey||t.metaKey)},yd=function(t){if(t){var e=t.offsetWidth,n=t.offsetHeight;if(e&&n)return{width:e,height:n};var r=getComputedStyle(t),i=parseFloat(r.width),a=parseFloat(r.height);if(a&&i)return{width:i,height:a}}return{width:0,height:0}},bd=function(t,e){return{x:e.x-t.x,y:e.y-t.y}},Ed=function(t,e){return t.x===e.x&&t.y===e.y},Se=function(){},Jn={x:0,y:0},Hi=function(t){za(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=Mt({},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=Mt({},Jn),n._startOffset=Mt({},Jn),n._startTouches=null,n._updatePlaned=!1,n._wheelTimeOut=null,n._zoomFactor=1,n._initialZoomFactor=1,n._draggingPoint=Mt({},Jn),n._ignoreNextClick=!1,n._containerRef=Va(),n._handleClick=function(r){n._ignoreNextClick&&(n._ignoreNextClick=!1,r.stopPropagation())},n._onResize=function(){var r;!((r=n._containerRef)===null||r===void 0)&&r.current&&(n._updateInitialZoomFactor(),n._setupOffsets(),n._update())},n._handlerOnTouchEnd=n._handlerIfEnable(function(r){n._fingers=r.touches.length,n.props.shouldCancelHandledTouchEndEvents&&(dn(n._interaction)||Fe(n._interaction)&&(n._startOffset.x!==n._offset.x||n._startOffset.y!==n._offset.y))&&fn(r),Fe(n._interaction)&&!n._enoughToDrag()&&n._handleClick(r),n._updateInteraction(r)}),n._handlerOnTouchStart=n._handlerIfEnable(function(r){n._firstMove=!0,n._fingers=r.touches.length,n._detectDoubleTap(r)}),n._handlerOnTouchMove=n._handlerIfEnable(function(r){n._isDoubleTap||(n._collectInertia(r),n._firstMove?(n._updateInteraction(r),n._interaction&&fn(r),n._startOffset=Mt({},n._offset),n._startTouches=Qn(r.touches)):(dn(n._interaction)?n._startTouches&&n._startTouches.length===2&&r.touches.length===2&&n._handleZoom(r,hd(n._startTouches,Qn(r.touches))):Fe(n._interaction)&&n._handleDrag(r),n._interaction&&(fn(r),n._update())),n._firstMove=!1)}),n._handlerWheel=function(r){if(!n.props.shouldInterceptWheel(r)){fn(r);var i=r.pageX,a=r.pageY,s=r.deltaY,c=r.deltaMode,l=1;(fd(r)||c===1)&&(l=15);var u={touches:[{pageX:i,pageY:a}]},f=n._getOffsetByFirstTouch(u),h=s*l;n._stopAnimation(),n._scaleTo(n._zoomFactor-h/n.props.wheelScaleFactor,f),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 r=this._getOffsetByFirstTouch(n);this._enoughToDrag()?this._drag(r,this._lastDragPosition):this._virtualDrag(r,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=r},e.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},e.prototype._realizeInertia=function(){var n=this,r=this.props,i=r.inertiaFriction,a=r.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 f=Mt({},n._offset);if(n._addOffset({x:c,y:l}),n._offset=n._sanitizeOffset(n._offset),Ed(f,n._offset))return n._stopAnimation();n._update({isAnimation:!0})};this._animate(u,{duration:9999})}}},e.prototype._collectInertia=function(n){var r=n.touches;if(this.props.inertia){var i=Qn(r)[0],a=this._prevDragMovePoint;a&&(this._velocity=bd(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,r){var i=vd(this._getOffsetTouches(n)),a=r/this._lastScale;this._lastScale=r,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 r=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){r._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(),r=this._getChildSize(),i=r.width,a=r.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=Mt({},this._initialOffset)},e.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},e.prototype._sanitizeOffset=function(n){var r=this._getContainerRect(),i=this._getChildSize(),a=i.width,s=i.height,c=a*this._getInitialZoomFactor()*this._zoomFactor,l=s*this._getInitialZoomFactor()*this._zoomFactor,u=Ni({containerDimension:r.width,childDimension:c,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),f=u[0],h=u[1],m=Ni({containerDimension:r.height,childDimension:l,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),d=m[0],p=m[1];return{x:Zr(f,h,n.x),y:Zr(d,p,n.y)}},e.prototype.alignCenter=function(n){var r=this,i=Mt({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,f=a*this._initialZoomFactor,h=s*this._initialZoomFactor,m=this._zoomFactor,d=Mt({},this._offset),p=this._getContainerRect(),v={x:p.width/2,y:p.height/2};if(this._zoomFactor=1,this._offset={x:-(v.x-f),y:-(v.y-h)},this._scaleTo(c,v),this._stopAnimation(),!l)return this._update();var y=this._zoomFactor-m,E={x:this._offset.x-d.x,y:this._offset.y-d.y};this._zoomFactor=m,this._offset=Mt({},d);var b=function(w){var k=d.x+E.x*w,g=d.y+E.y*w;r._zoomFactor=m+y*w,r._offset=r._sanitizeOffset({x:k,y:g}),r._update()};this._animate(b,{callback:function(){return r._sanitize()},duration:u})},e.prototype.scaleTo=function(n){var r=this,i=Mt({duration:250,animated:!0},n),a=i.x,s=i.y,c=i.scale,l=i.animated,u=i.duration,f=this._zoomFactor,h=Mt({},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 m=this._zoomFactor-f,d={x:this._offset.x-h.x,y:this._offset.y-h.y};this._zoomFactor=f,this._offset=Mt({},h);var p=function(v){var y=h.x+d.x*v,E=h.y+d.y*v;r._zoomFactor=f+m*v,r._offset={x:y,y:E},r._update()};this._animate(p,{callback:function(){return r._sanitize()},duration:u})},e.prototype._scaleTo=function(n,r){this._scale(n/this._zoomFactor,r),this._offset=this._sanitizeOffset(this._offset)},e.prototype._scale=function(n,r){n=this._scaleZoomFactor(n),this._addOffset({x:(n-1)*(r.x+this._offset.x),y:(n-1)*(r.y+this._offset.y)}),this.props.onZoomUpdate()},e.prototype._scaleZoomFactor=function(n){var r=this._zoomFactor;return this._zoomFactor*=n,this._zoomFactor=Zr(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/r},e.prototype._canDrag=function(){return this.props.draggableUnZoomed||!md(this._zoomFactor,1)},e.prototype._drag=function(n,r){if(r){var i=-(n.y-r.y),a=-(n.x-r.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,r){if(r){var i=-(n.y-r.y),a=-(n.x-r.x);this._draggingPoint={x:a+this._draggingPoint.x,y:i+this._draggingPoint.y}}},e.prototype._addOffset=function(n){var r=this._offset,i=r.x,a=r.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()):(m=c(m),n(m),i._update({isAnimation:!0}),requestAnimationFrame(f))}};this._inAnimation=!0,requestAnimationFrame(f)},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 yd(n==null?void 0:n.firstElementChild)},e.prototype._updateInitialZoomFactor=function(){var n=this._getContainerRect(),r=this._getChildSize(),i=n.width/r.width,a=n.height/r.height;this._initialZoomFactor=ld(i,a)},e.prototype._bindEvents=function(){var n=this,r=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(r)):window.addEventListener("resize",this._onResize),this._handlers.forEach(function(i){var a=i[0],s=i[1],c=i[2];(c||r).addEventListener(a,s,!0)}),Array.from(r.querySelectorAll("img")).forEach(function(i){return i.addEventListener("load",n._onResize)})},e.prototype._unSubscribe=function(){var n=this,r=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||r).removeEventListener(a,s,!0)}),Array.from(r.querySelectorAll("img")).forEach(function(i){return i.removeEventListener("load",n._onResize)})},e.prototype._update=function(n){var r=this;if(!this._updatePlaned){var i=function(){var a=r._getInitialZoomFactor()*r._zoomFactor,s=-r._offset.x/a,c=-r._offset.y/a;r.props.onUpdate({scale:a,x:s,y:c})};if(n!=null&&n.isAnimation)return i();this._updatePlaned=!0,requestAnimationFrame(function(){r._updatePlaned=!1,i()})}},e.prototype._handlerIfEnable=function(n){var r=this;return function(){for(var i=[],a=0;ar?n-r:r-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 r=this._fingers;if(r===2)return this._setInteraction("zoom",n);if(r===1&&this._canDrag())return this._setInteraction("drag",n);this._setInteraction(null,n)},e.prototype._detectDoubleTap=function(n){var r=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),r-this._lastTouchStart<300?(fn(n),this._handleDoubleTap(n),dn(this._interaction)?this._handleZoomEnd():Fe(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=r)},e.prototype.simulate=function(n){var r=this;return function(i){var a=i.pageX,s=i.pageY,c=i.type,l=c==="mouseup",u=c==="mousedown";u&&(i.preventDefault(),r._listenMouseMove=!0),r._listenMouseMove&&(i.touches=l?[]:[{pageX:a,pageY:s}],n(i)),l&&(r._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,r=n.children,i=n.containerProps,a=Ha.only(r),s=i||{};return Un.createElement(Un.Fragment,null,Un.createElement("style",null,rd),Un.createElement("div",Mt({},s,{ref:this._containerRef,className:Bi(Js,s.className)}),ts(a,{className:Bi(ta,a.props.className)})))},e.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:id,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:Se,onDragEnd:Se,onDragStart:Se,onDragUpdate:Se,onZoomEnd:Se,onZoomStart:Se,onZoomUpdate:Se,setOffsetsOnce:!1,shouldInterceptWheel:_d,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:ea?null:window.document},e}(ns);if(0)var Xf,Qf,Jf,th,eh,nh,rh;function qr(t){if(!t)return;let e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.round(t%60);return e===0?`${n}:${r.toString().padStart(2,"0")}`:`${e}:${n.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}const wd=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Td="ALT",Gr=t=>{const{_:e}=ne(),{alt:n,lang:r,index:i,...a}=t;return!n||!n.trim()?null:o("button",{type:"button",class:"alt-badge clickable",...a,onClick:s=>{s.stopPropagation(),s.preventDefault(),V.showMediaAlt={alt:n,lang:r}},title:e({id:"5gfDMm"}),children:[Td,!!i&&o("sup",{children:i})]})},Ad=140,Cd=280,na=Rt(t=>t!=null&&t.length?t.length>Ad||/[\n\r].*[\n\r]/.test(t.trim()):!1);function Sd({class:t="",media:e,to:n,lang:r,showOriginal:i,autoAnimate:a,showCaption:s,allowLongerCaption:c,altIndex:l,checkAspectRatio:u=!0,onClick:f=()=>{}}){let{blurhash:h,description:m,meta:d,previewRemoteUrl:p,previewUrl:v,remoteUrl:y,url:E,type:b}=e;/no\-preview\./i.test(v)&&(v=null);const{original:w={},small:k,focus:g}=d||{},A=i?w==null?void 0:w.width:(k==null?void 0:k.width)||(w==null?void 0:w.width),T=i?w==null?void 0:w.height:(k==null?void 0:k.height)||(w==null?void 0:w.height),D=i?E:v||E,M=i?y:p||y,L=A&&T,C=L?A>T?"landscape":"portrait":null,x=h?Lo(h):null,F=O();let W;if(g){const X=(g.x+1)/2*100,B=(1-g.y)/2*100;W=`${X.toFixed(0)}% ${B.toFixed(0)}%`}const j=O(),et=At(({x:X,y:B,scale:K})=>{const{current:Y}=j;if(Y){const ut=sd({x:X,y:B,scale:K});K===1?Y.style.removeProperty("transform"):Y.style.setProperty("transform",ut),Y.closest(".media-zoom").style.touchAction=K<=1.01?"pan-x":""}},[]),[st,ot]=H(!1),nt={enabled:st,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:et},[J,vt]=H(!1),ht=it(()=>n&&!J?X=>o(je,{to:n,...X}):"div",[n,J]),N=M?kd(M):null,at=b==="unknown"&&N&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(N.pathname),dt=b==="unknown"&&N&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(N.pathname),xt=b==="image"||b==="unknown"&&v&&!at&&!dt,mt=O(),[zt,It]=H(!1);Ie(()=>{if(!xt||!i||!mt.current)return;const{offsetWidth:X,offsetHeight:B}=mt.current,K=A{const{children:B,...K}=X;return o("figure",{...K,children:[B,o("figcaption",{class:"media-caption",lang:r,dir:"auto",onClick:Y=>{Y.preventDefault(),Y.stopPropagation(),V.showMediaAlt={alt:m,lang:r}},children:m})]})}:$,[be,rt]=H(void 0);if(xt)return nt.containerProps.style.display="inherit",Ie(()=>{wd&&i&&(async()=>{try{await fetch(D,{mode:"no-cors"}),j.current.src=D}catch{}})()},[D]),o(qt,{children:[o(ht,{ref:mt,class:`media media-image ${t}`,onClick:f,"data-orientation":C,"data-has-alt":!wt||void 0,"data-has-natural-aspect-ratio":be||void 0,style:i?{backgroundImage:`url(${v})`,backgroundSize:zt?`${A}px ${T}px`:void 0,...yt}:U,children:i?o(Hi,{...nt,children:o("img",{ref:j,src:D,alt:m,width:A,height:T,"data-orientation":C,loading:"eager",decoding:"sync",onLoad:X=>{X.target.closest(".media-image").style.backgroundImage="",X.target.closest(".media-zoom").style.display="",ot(!0)},onError:X=>{const{src:B}=X.target;B===D&&M&&D!==M&&(X.target.src=M)}})}):o($,{children:[o("img",{src:D,alt:wt?"":m,width:A,height:T,"data-orientation":C,loading:"lazy",style:{objectPosition:W||"center","--anim-duration":`${Math.min(Math.max(Math.max(A,T)/100,5),120)}s`},onLoad:X=>{X.target.dataset.loaded=!0;const B=X.target.closest(".media");if(!L&&B){const{naturalWidth:K,naturalHeight:Y}=X.target;B.dataset.orientation=K>Y?"landscape":"portrait",B.style.setProperty("--width",`${K}px`),B.style.setProperty("--height",`${Y}px`),B.style.aspectRatio=`${K}/${Y}`}if(u&&B){const{clientWidth:K,clientHeight:Y,naturalWidth:ut,naturalHeight:G}=X.target;if(K&&Y&&ut&&G)if(ut<88||G<88)B.dataset.hasSmallDimension=!0;else{const Ee=G*K/ut;Math.abs(Ee-Y)<5&&rt(!0)}}},onError:X=>{const{src:B}=X.target;B===D&&D!==M?X.target.src=M:vt(!0)}}),!wt&&o(Gr,{alt:m,lang:r,index:l})]})}),J&&o("div",{children:o("a",{href:y,class:"button plain6 small",target:"_blank",children:[o(R,{icon:"external"})," ",o("span",{children:o(P,{id:"9npOH9"})})]})})]});if(b==="gifv"||b==="video"||at){const X=w.duration>0,B=w.duration<31,K=b==="gifv"&&B,Y=w.duration<61,ut=qr(w.duration),G=!i&&!a&&K,Ut=!i&&a&&K,Ee=w.duration>5,$t=` + + `,Ft=` + + `;return o(qt,{children:o(ht,{class:`media ${t} media-${K?"gif":"video"} ${Ut?"media-contain":""} ${G?"media-hover-animate":""}`,"data-orientation":C,"data-formatted-duration":i?void 0:ut,"data-label":K&&!i&&!Ut?"GIF":void 0,"data-has-alt":!wt||void 0,style:!i&&U,onClick:Dt=>{if(G)try{F.current.pause()}catch{}f(Dt)},onMouseEnter:()=>{if(G)try{F.current.play()}catch{}},onMouseLeave:()=>{if(G)try{F.current.pause()}catch{}},onFocus:()=>{if(G)try{F.current.play()}catch{}},onBlur:()=>{if(G)try{F.current.pause()}catch{}},children:[i||Ut?K&&i?o(Hi,{...nt,enabled:!0,children:o("div",{ref:j,dangerouslySetInnerHTML:{__html:$t}})}):K?o("div",{class:"video-container",dangerouslySetInnerHTML:{__html:$t}}):o("div",{class:"video-container",dangerouslySetInnerHTML:{__html:Ft}}):K?o("video",{ref:F,src:E,poster:v,width:A,height:T,"data-orientation":C,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:Ee?Dt=>{const{target:gt}=Dt,Tt=gt==null?void 0:gt.closest(".media-gif");if(Tt){const Nt=gt.currentTime/gt.duration*100;Tt.style.setProperty("--progress",`${Nt}%`)}}:void 0}):o($,{children:[v?o("img",{src:v,alt:wt?"":m,width:A,height:T,"data-orientation":C,loading:"lazy",decoding:"async",onLoad:Dt=>{if(!L){const gt=Dt.target.closest(".media");if(gt){const{naturalHeight:Tt,naturalWidth:Nt}=Dt.target;gt.dataset.orientation=Nt>Tt?"landscape":"portrait",gt.style.setProperty("--width",`${Nt}px`),gt.style.setProperty("--height",`${Tt}px`),gt.style.aspectRatio=`${Nt}/${Tt}`}}}}):o("video",{src:E+"#t=0.1",width:A,height:T,"data-orientation":C,preload:"metadata",muted:!0,disablePictureInPicture:!0,onLoadedMetadata:Dt=>{if(!X){const{duration:gt}=Dt.target;if(gt){const Tt=qr(gt),Nt=Dt.target.closest(".media-video");Nt&&(Nt.dataset.formattedDuration=Tt)}}}}),o("div",{class:"media-play",children:o(R,{icon:"play",size:"xl",alt:"▶"})})]}),!i&&!wt&&o(Gr,{alt:m,lang:r,index:l})]})})}else if(b==="audio"||dt){const X=qr(w.duration);return o(qt,{children:o(ht,{class:`media media-audio ${t}`,"data-formatted-duration":i?void 0:X,"data-has-alt":!wt||void 0,onClick:f,style:!i&&U,children:[i?o("audio",{src:y||E,preload:"none",controls:!0,autoPlay:!0}):v?o("img",{src:v,alt:wt?"":m,width:A,height:T,"data-orientation":C,loading:"lazy",onError:B=>{var K,Y;try{(Y=(K=B.target)==null?void 0:K.remove)==null||Y.call(K)}catch{}}}):null,!i&&o($,{children:[o("div",{class:"media-play",children:o(R,{icon:"play",size:"xl",alt:"▶"})}),!wt&&o(Gr,{alt:m,lang:r,index:l})]})]})})}}function kd(t){return URL.parse(t,location.origin)}const fo=Ge(Sd,(t,e)=>{const n=t.media||{},r=e.media||{};return(n==null?void 0:n.id)===(r==null?void 0:r.id)&&n.url===r.url&&t.to===e.to&&t.class===e.class}),xd=280,Id=140,Dd=rs({limit:1,interval:1e3});function Ld(t,e){return e.v1.accounts.$select(t).fetch()}const Rd=hr(Dd(Ld)),xe={public:{id:"7d1a0d"},local:{id:"d5zxa4"},unlisted:{id:"WDcQq9"},private:{id:"o34OrG"},direct:{id:"IV4QaU"}},Md=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),Pd=new Intl.RelativeTimeFormat,Ui=80;function Od(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 Yr(t){const{spoilerText:e,content:n,poll:r}=t;return(e?`${e} + +`:"")+gr(n)+Od(r)}function ra(t=[],e=document){for(const n of t)try{return e.querySelectorAll(n)}catch{}return[]}function $d(t){return!t||(t=t.trim(),!t)?!1:!!gr(t,{preProcess:n=>{for(const r of ra([".mention, pre, code, a:has(.invisible)",".mention, pre, code"],n))r.remove()}})}function Fd(t,e){if(e!=null&&e.length){const n=new RegExp(`:(${e.map(r=>r.shortcode).join("|")}):`,"g");t=t.replace(n,"")}return gr(t,{preProcess:n=>{for(const r of ra([".mention, .hashtag, pre, code, a:has(.invisible)",".mention, .hashtag, pre, code"],n))r.remove();for(const r of n.querySelectorAll("a")){const i=r.innerText.trim();(i.startsWith("https://")||i.startsWith("http://"))&&r.remove()}}})}const Nd=/^http/i,ji=({post:t,instance:e,previewMode:n})=>{const{content:r,emojis:i,language:a,mentions:s,url:c}=t,l=O();return Ie(()=>{if(!l.current)return;const u=Vs(r,{emojis:i,returnDOM:!0});for(const f of u.querySelectorAll('a.u-url[target="_blank"]'))Nd.test(f.innerText.trim())||f.removeAttribute("target");l.current.replaceChildren(u.cloneNode(!0))},[r,i==null?void 0:i.length]),o("div",{ref:l,lang:a,dir:"auto",class:"inner-content",onClick:su({mentions:s,instance:e,previewMode:n,statusURL:c})})},Bd={s:"small",m:"medium",l:"large"},zd=hr(async t=>{if(t=t==null?void 0:t.trim(),(t==null?void 0:t.length)>500)return null;if(Ue){const i=await Ue.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 S(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 r=n[0];return r!=null&&r.lang&&(r==null?void 0:r.accuracy)>.5?r.lang:null}),En={id:"8fZueG"},ho={},Ki=(t,e=[])=>{if(!t)return!1;const n=Ls(!0),r=t!==n&&!wn([t],[n])&&!e.find(i=>t===i||wn([t],[i]));return r&&(ho[t+e]=!0),r};function qe({statusID:t,status:e,instance:n,size:r="m",contentTextWeight:i,readOnly:a,enableCommentHint:s,withinContext:c,skeleton:l,enableTranslate:u,forceTranslate:f,previewMode:h,onMediaClick:m,quoted:d,onStatusLinkClick:p=()=>{},showFollowedTags:v,allowContextMenu:y,showActionsBar:E,showReplyParent:b,mediaFirst:w}){var Jo,ti,ei,ni;const{_:k,_:g}=ne();if(l)return o("div",{class:`status skeleton ${w?"status-media-first small":""}`,children:[!w&&o(ae,{size:"xxl"}),o("div",{class:"container",children:[o("div",{class:"meta",children:[(r==="s"||w)&&o(ae,{size:"m"})," ███ ████████"]}),o("div",{class:"content-container",children:[w&&o("div",{class:"media-first-container"}),o("div",{class:`content ${w?"media-first-content":""}`,children:o("p",{children:"████ ████████"})})]})]})]});const{masto:A,instance:T,authenticated:D}=sr({instance:n}),{instance:M}=sr(),L=T===M;let C=ie(t||(e==null?void 0:e.id),T);const x=xn(V);if(e||(e=x.statuses[C]||x.statuses[t],C=ie(e==null?void 0:e.id,T)),!e)return null;const{account:{acct:F,avatar:W,avatarStatic:j,id:et,url:st,displayName:ot,username:nt,emojis:J,bot:vt,group:ht}={},id:N,repliesCount:at,reblogged:dt,reblogsCount:xt,favourited:mt,favouritesCount:zt,bookmarked:It,poll:Et,muted:Wt,sensitive:yt,spoilerText:U,visibility:Q,language:wt,editedAt:qt,filtered:be,card:rt,createdAt:X,inReplyToId:B,inReplyToAccountId:K,content:Y,mentions:ut,mediaAttachments:G,reblog:Ut,uri:Ee,url:$t,emojis:Ft,tags:Dt,pinned:gt,_deleted:Tt,_pinned:Nt,emojiReactions:Le}=e,[Qe,Dn]=H(null);tt(()=>{if(!Y||wt||Qe)return;let _;return _=setTimeout(async()=>{let I=await zd(Fd(Y,Ft));Dn(I)},1e3),()=>clearTimeout(_)},[Y,wt]);const pt=wt||Qe,Je=!!(G!=null&&G.length);w&&Je&&(r="s");const de=it(()=>Eo(),[]),Z=it(()=>de&&de===et,[et,de]),Ct=Ot(Qs),St=!Z&&!a&&!h&&Ro(be,Ct);if((St==null?void 0:St.action)==="hide")return null;const Bt=_=>{_.shiftKey};if(r!=="l"&&St)return o(Gd,{status:e,filterInfo:St,instance:T,containerProps:{onMouseEnter:Bt},showFollowedTags:!0,quoted:d});const ft=new Date(X),we=new Date(qt);let fe=ut==null?void 0:ut.find(_=>_.id===K);!fe&&K===N&&(fe={url:st,username:nt,displayName:ot});const[Re,Ln]=H(fe);if(!c&&!Re&&K){const _=V.accounts[K];_?Ln(_):Rd(K,A).then(I=>{Ln(I),V.accounts[I.id]=I}).catch(I=>{})}const tn=K===de||(ut==null?void 0:ut.find(_=>_.id===de)),Gt=it(()=>!!(Qr.account.get("preferences")||{})["reading:expand:spoilers"],[]),Rn=it(()=>{var I;return((I=(Qr.account.get("preferences")||{})["reading:expand:media"])==null?void 0:I.toLowerCase())||"default"},[]),Zt=h||Gt||!!x.spoilers[N],Yt=h||Rn==="show_all"||!!x.spoilersMedia[N];if(Ut)return ht?o("div",{"data-state-post-id":C,class:"status-group",onMouseEnter:Bt,children:[o("div",{class:"status-pre-meta",children:[o(R,{icon:"group",size:"l",alt:g({id:"L8fEEm"})})," ",o(ve,{account:e.account,instance:T,showAvatar:!0})]}),o(qe,{status:t?null:Ut,statusID:t?Ut.id:null,instance:T,size:r,contentTextWeight:i,readOnly:a,mediaFirst:w})]}):o("div",{"data-state-post-id":C,class:"status-reblog",onMouseEnter:Bt,children:[o("div",{class:"status-pre-meta",children:[o(R,{icon:"rocket",size:"l"})," ",o(P,{id:"DlhB4J",components:{0:o(ve,{account:e.account,instance:T,showAvatar:!0}),1:o("span",{})}})]}),o(qe,{status:t?null:Ut,statusID:t?Ut.id:null,instance:T,size:r,contentTextWeight:i,readOnly:a,enableCommentHint:!0,mediaFirst:w})]});const en=At(({children:_})=>o("div",{"data-state-post-id":C,class:"status-followed-tags",onMouseEnter:Bt,children:[o("div",{class:"status-pre-meta",children:[o(R,{icon:"hashtag",size:"l"})," ",x.statusFollowedTags[C].slice(0,3).map(I=>o(je,{to:T?`/${T}/t/${I}`:`/t/${I}`,class:"status-followed-tag-item",children:I},I))]}),_]}),[C,T,x.statusFollowedTags[C]]),nn=v&&((Jo=x.statusFollowedTags[C])!=null&&Jo.length)?en:$,ct=r==="l",[vr,pa]=H(f),{contentTranslation:_r,contentTranslationAutoInline:Po}=x.settings;_r||(u=!1);const Oo=it(()=>{if(!_r||!Po||a||c&&!ct||h||U||yt||Et||rt||G!=null&&G.length)return!1;const _=Wr(Y);return _>0&&_<=Id},[_r,Po,a,c,ct,h,U,yt,Et,rt,G,Y]),[yr,Mn]=H(!1),[ga,br]=H(!1),$o=or(),Fo=or(),va=or(),Me=O(null),Pn=g({id:"7jyUKe"}),No=At(()=>Math.max(Math.round((U.length+Wr(Y))/140)||1,1),[U,Y]),Bo=X&&Cn(ft),zo=qt&&Cn(we);let rn=D&&Q!=="direct"&&Q!=="private";Q==="private"&&Z&&(rn=!0);const On=_=>{var I;if(!L||!D)return alert(Pn);(_!=null&&_.shiftKey||(I=_==null?void 0:_.syntheticEvent)!=null&&I.shiftKey)&&qc({replyToStatus:e})||Kn({replyToStatus:e})},_a=it(()=>G.some(_=>{var I,q;return!((q=(I=_.description)==null?void 0:I.trim)!=null&&q.call(I))}),[G]),Vo=it(()=>Math.floor((new Date-ft)/(1e3*60*60*24*30)),[ft]),Er=async()=>{if(!L||!D)return alert(Pn),!1;try{if(V.statuses[C]={...e,reblogged:!dt,reblogsCount:xt+(dt?-1:1)},dt){const _=await A.v1.statuses.$select(N).unreblog();he(_,T)}else{const _=await A.v1.statuses.$select(N).reblog();he(_,T)}return!0}catch{return V.statuses[C]=e,!1}},Ho=async()=>{if(!L||!D)return alert(Pn),!1;try{if(V.statuses[C]={...e,favourited:!mt,favouritesCount:zt+(mt?-1:1)},mt){const _=await A.v1.statuses.$select(N).unfavourite();he(_,T)}else{const _=await A.v1.statuses.$select(N).favourite();he(_,T)}return!0}catch{return V.statuses[C]=e,!1}},wr=async()=>{try{const _=await Ho();!ct&&_&&Lt(g(mt?{id:"sZvpIt",values:{0:nt||F}}:{id:"QB/n+J",values:{1:nt||F}}))}catch{}},Uo=async()=>{if(qn("@mastodon/post-bookmark")){if(!L||!D)return alert(Pn),!1;try{if(V.statuses[C]={...e,bookmarked:!It},It){const _=await A.v1.statuses.$select(N).unbookmark();he(_,T)}else{const _=await A.v1.statuses.$select(N).bookmark();he(_,T)}return!0}catch{return V.statuses[C]=e,!1}}},jo=async()=>{try{const _=await Uo();!ct&&_&&Lt(g(It?{id:"+Q6x2B",values:{2:nt||F}}:{id:"cQEDZY",values:{3:nt||F}}))}catch{}},on=x.settings.contentTranslationHideLanguages||[],[Te,Ko]=H(()=>ho[pt+on]||Ki(pt,on));tt(()=>{if(!pt||Te)return;if(!Te&&ho[pt+on]){Ko(!0);return}let _=setTimeout(()=>{const I=Ki(pt,on);I&&Ko(I)},1);return()=>clearTimeout(_)},[pt,Te,on]);const Wo=O(),Zo=O();async function ya(_){var lt,jt,Pe,Tr;_&&(Wo.current=A.v1.statuses.$select(t).rebloggedBy.list({limit:Ui}),Zo.current=A.v1.statuses.$select(t).favouritedBy.list({limit:Ui}));const[{value:I},{value:q}]=await Promise.allSettled([Wo.current.next(),Zo.current.next()]);if((lt=I.value)!=null&<.length||(jt=q.value)!=null&&jt.length){const Ae=[];return(Pe=I.value)!=null&&Pe.length&&Ae.push(...I.value.map(Ce=>(Ce._types=["reblog"],Ce))),(Tr=q.value)!=null&&Tr.length&&Ae.push(...q.value.map(Ce=>(Ce._types=["favourite"],Ce))),{value:Ae,done:I.done&&q.done}}return{value:[],done:!0}}const ba=O(),qo=["public","unlisted"].includes(Q),Ea=["public","unlisted","private"].includes(Q),Go=_a&&!dt?o("div",{class:"footer",children:[o(R,{icon:"alert"}),o(P,{id:"MB+wJL"})]}):Vo>=3&&o("div",{class:"footer",children:[o(R,{icon:"info"}),o("span",{children:o(P,{id:"dBme/4",values:{0:Pd.format(-Vo,"month")},components:{0:o("strong",{})}})})]}),Yo=o($,{children:[!ct&&L&&o($,{children:o("div",{class:"menu-control-group-horizontal status-menu",children:[o(bt,{onClick:On,children:[o(R,{icon:"comment"}),o("span",{children:at>0?oe(at):g({id:"ImOQa9"})})]}),o(kr,{subMenu:!0,confirmLabel:o($,{children:[o(R,{icon:"rocket"}),o("span",{children:g(dt?{id:"QzzGsY"}:{id:"kulphB"})})]}),className:`menu-reblog ${dt?"checked":""}`,menuExtras:o(bt,{onClick:()=>{Kn({draftStatus:{status:` +${$t}`}})},children:[o(R,{icon:"quote"}),o("span",{children:o(P,{id:"ZhhOwV"})})]}),menuFooter:Go,disabled:!rn,onClick:async()=>{try{const _=await Er();!ct&&_&&Lt(g(dt?{id:"BgT3ls",values:{4:nt||F}}:{id:"iSYdyi",values:{5:nt||F}}))}catch{}},children:[o(R,{icon:"rocket"}),o("span",{children:xt>0?oe(xt):g(dt?{id:"QzzGsY"}:{id:"PiVIlD"})})]}),o(bt,{onClick:wr,className:`menu-favourite ${mt?"checked":""}`,children:[o(R,{icon:"heart"}),o("span",{children:zt>0?oe(zt):g(mt?{id:"OcUmcH"}:{id:"W9FRBT"})})]}),qn("@mastodon/post-bookmark")&&o(bt,{onClick:jo,className:`menu-bookmark ${It?"checked":""}`,children:[o(R,{icon:"bookmark"}),o("span",{children:g(It?{id:"q8EQYI"}:{id:"PZlHt8"})})]})]})}),!ct&&L&&(ct||E)&&o(cn,{}),(ct||E)&&o($,{children:o(bt,{onClick:()=>{V.showGenericAccounts={heading:g({id:"+XOeb+"}),fetchAccounts:ya,instance:T,showReactions:!0,postID:C}},children:[o(R,{icon:"react"}),o("span",{children:o(P,{id:"+XOeb+"})})]})}),!w&&o($,{children:[(u||!pt||Te)&&o(cn,{}),u?o("div",{class:vn?"menu-horizontal":"",children:[o(bt,{disabled:vr,onClick:()=>{pa(!0)},children:[o(R,{icon:"translate"}),o("span",{children:o(P,{id:"pi8x/S"})})]}),vn&&o(bt,{onClick:()=>{const _=Yr(e);_&&$i(_,pt)},children:[o(R,{icon:"speak"}),o("span",{children:o(P,{id:"yIBLq8"})})]})]}):(!pt||Te)&&o("div",{class:vn?"menu-horizontal":"",children:[o(pi,{to:`${T?`/${T}`:""}/s/${N}?translate=1`,children:[o(R,{icon:"translate"}),o("span",{children:o(P,{id:"pi8x/S"})})]}),vn&&o(bt,{onClick:()=>{const _=Yr(e);_&&$i(_,pt)},children:[o(R,{icon:"speak"}),o("span",{children:o(P,{id:"yIBLq8"})})]})]})]}),(!ct&&L||u||!pt||Te)&&o(cn,{}),!ct&&o($,{children:o(pi,{to:T?`/${T}/s/${N}`:`/s/${N}`,onClick:_=>{p(_,e)},children:[o(R,{icon:"arrows-right"}),o("small",{children:[o(P,{id:"8MkSAW",values:{0:nt||F},components:{0:o("span",{class:"bidi-isolate"})}}),o("br",{}),o("span",{class:"more-insignificant",children:[k(xe[Q])," • ",Bo]})]})]})}),!!qt&&o($,{children:o(bt,{onClick:()=>{Mn(N)},children:[o(R,{icon:"history"}),o("small",{children:[o(P,{id:"QL+7Jw"}),o("br",{}),o("span",{class:"more-insignificant",children:o(P,{id:"DuJJm9",values:{editedDateText:zo}})})]})]})}),o(bt,{href:$t,target:"_blank",children:[o(R,{icon:"external"}),o("small",{class:"menu-double-lines",style:{maxWidth:"16em"},children:Zd($t)})]}),o("div",{class:"menu-horizontal",children:[o(bt,{onClick:()=>{try{navigator.clipboard.writeText($t),Lt(g({id:"edWbV6"}))}catch{Lt(g({id:"W1ewR0"}))}},children:[o(R,{icon:"link"}),o("span",{children:o(P,{id:"he3ygx"})})]}),qo&&(navigator==null?void 0:navigator.share)&&((ti=navigator==null?void 0:navigator.canShare)==null?void 0:ti.call(navigator,{url:$t}))&&o(bt,{onClick:()=>{try{navigator.share({url:$t})}catch{alert(g({id:"TtG3Uh"}))}},children:[o(R,{icon:"share"}),o("span",{children:o(P,{id:"LFKLqp"})})]})]}),qo&&ct&&o(bt,{onClick:()=>{br(!0)},children:[o(R,{icon:"code"}),o("span",{children:o(P,{id:"jdVwsS"})})]}),(Z||tn)&&o(cn,{}),(Z||tn)&&o(bt,{onClick:async()=>{try{const _=await A.v1.statuses.$select(N)[Wt?"unmute":"mute"]();he(_,T),Lt(g(Wt?{id:"Pm+5jw"}:{id:"ywB7JM"}))}catch{Lt(g(Wt?{id:"c6jxNY"}:{id:"8SN9kN"}))}},children:Wt?o($,{children:[o(R,{icon:"unmute"}),o("span",{children:o(P,{id:"i51zUR"})})]}):o($,{children:[o(R,{icon:"mute"}),o("span",{children:o(P,{id:"OiUYO5"})})]})}),Z&&Ea&&o(bt,{onClick:async()=>{try{const _=await A.v1.statuses.$select(N)[gt?"unpin":"pin"]();he(_,T),Lt(g(gt?{id:"Yx809+"}:{id:"S6P6E+"}))}catch{Lt(g(gt?{id:"A6cs15"}:{id:"vgUfWO"}))}},children:gt?o($,{children:[o(R,{icon:"unpin"}),o("span",{children:o(P,{id:"XQMQZw"})})]}):o($,{children:[o(R,{icon:"pin"}),o("span",{children:o(P,{id:"lfHLsx"})})]})}),Z&&o("div",{class:"menu-horizontal",children:[qn("@mastodon/post-edit")&&o(bt,{onClick:()=>{Kn({editStatus:e})},children:[o(R,{icon:"pencil"}),o("span",{children:o(P,{id:"ePK91l"})})]}),ct&&o(kr,{subMenu:!0,confirmLabel:o($,{children:[o(R,{icon:"trash"}),o("span",{children:o(P,{id:"FbPNuJ"})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{await A.v1.statuses.$select(N).remove();const _=is(N,T);_._deleted=!0,Lt(g({id:"KiyvHV"}))}catch{Lt(g({id:"Yb6p2q"}))}})()},children:[o(R,{icon:"trash"}),o("span",{children:o(P,{id:"Jb6/SB"})})]})]}),!Z&&ct&&o($,{children:[o(cn,{}),o(bt,{className:"danger",onClick:()=>{V.showReportModal={account:e.account,post:e}},children:[o(R,{icon:"flag"}),o("span",{children:o(P,{id:"7PQAMY"})})]})]})]}),Xo=O(),[$n,sn]=H(!1),[Fn,Nn]=H({}),Bn=y||!ct&&!h&&!Tt&&!d,wa=As(Md&&Bn?_=>{var jt;if(_.pointerType==="mouse")return;const{clientX:I,clientY:q}=((jt=_.touches)==null?void 0:jt[0])||_,lt=_.target.closest("a");lt&&Me.current.contains(lt)&&!lt.getAttribute("href").startsWith("#")||(_.preventDefault(),Nn({anchorPoint:{x:I,y:q},direction:"right"}),sn(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),zn=!a&&!h&&!d,Ta=Be("r, shift+r",On,{enabled:zn}),Aa=Be("f, l",wr,{enabled:zn}),Ca=Be("d",jo,{enabled:zn}),Sa=Be("shift+b",()=>{(async()=>{try{const _=await Er();!ct&&_&&Lt(g(dt?{id:"G3tPNv",values:{6:nt||F}}:{id:"r8jwY4",values:{7:nt||F}}))}catch{}})()},{enabled:zn&&rn}),ka=Be("x",_=>{const I=document.activeElement.closest(".status-link, .status-focus");if(I){const q=I.querySelector(".spoiler-button:not(.spoiling)");if(q)_.stopPropagation(),q.click();else{const lt=I.querySelector(".spoiler-media-button:not(.spoiling)");lt&&(_.stopPropagation(),lt.click())}}}),Vn=G.slice(0,ct?void 0:4),Hn=G.length>1&&Vn.some(_=>!!_.description&&!na(_.description)),xa=it(()=>{if(!Hn)return null;const _=[];return Vn.forEach((I,q)=>{if(!I.description)return;const lt=_.findIndex(jt=>jt.media.description===I.description);lt===-1?_.push({media:I,indices:[q]}):_[lt].indices.push(q)}),_.map(({media:I,indices:q})=>o("div",{"data-caption-index":q.map(lt=>lt+1).join(" "),onClick:lt=>{lt.preventDefault(),lt.stopPropagation(),V.showMediaAlt={alt:I.description,lang:pt}},title:I.description,children:[o("sup",{children:q.map(lt=>lt+1).join(" ")})," ",I.description]},I.id))},[Hn,Vn,pt]),an=it(()=>{var _;return!!B&&K===((_=e.account)==null?void 0:_.id)||!!x.statusThreadNumber[C]},[B,K,(ei=e.account)==null?void 0:ei.id,x.statusThreadNumber[C]]),Ia=it(()=>s&&!an&&!c&&!B&&Q==="public"&&at>0,[s,an,c,B,at,Q]),Qo=it(()=>{if(rt||Et||yt||U||G!=null&&G.length||an||c||B||at<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(Y))return!1;const q=Wr(Y);if(q>0&&q<=xd)return!0},[rt,Et,yt,U,G,Ut,an,c,B,at,Y]);return o(nn,{children:[b&&!!(B&&K)&&o(qd,{sKey:C}),o("article",{"data-state-post-id":C,ref:_=>{var q;Me.current=_;const I=((q=_==null?void 0:_.closest)==null?void 0:q.call(_,".timeline-item, .timeline-item-alt, .status-link, .status-focus"))||_;Ta(I),Aa(I),Ca(I),Sa(I),ka(I)},tabindex:"-1",class:`status ${!c&&B&&Re?"status-reply-to":""} visibility-${Q} ${Nt?"status-pinned":""} ${Bd[r]} ${Tt?"status-deleted":""} ${d?"status-card":""} ${$n?"status-menu-open":""} ${w&&Je?"status-media-first":""}`,onMouseEnter:Bt,onContextMenu:_=>{var lt,jt;if(!Bn||_.metaKey)return;const I=_.target.closest("a");if(I&&Me.current.contains(I)&&!I.getAttribute("href").startsWith("#"))return;const q=(lt=window.getSelection)==null?void 0:lt.call(window);if(q.toString().length>0){const{anchorNode:Pe}=q;if((jt=Me.current)!=null&&jt.contains(Pe))return}_.preventDefault(),Nn({anchorPoint:{x:_.clientX,y:_.clientY},direction:"right"}),sn(!0)},...Bn?wa():{},children:[Bn&&o(ms,{ref:Xo,state:$n?"open":void 0,...Fn,onClose:_=>{var I,q,lt;sn(!1),(_==null?void 0:_.reason)==="click"&&((lt=(q=(I=Me.current)==null?void 0:I.closest("[tabindex]"))==null?void 0:q.focus)==null||lt.call(q))},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{var _,I;(I=(_=Xo.current)==null?void 0:_.closeMenu)==null||I.call(_)}},overflow:"auto",boundingBoxPadding:ks(),unmountOnClose:!0,children:Yo}),E&&r!=="l"&&!h&&!a&&!Tt&&!d&&o("div",{class:`status-actions ${$n==="actions-bar"?"open":""}`,ref:ba,children:[o(Ne,{size:"s",title:g({id:"ImOQa9"}),alt:g({id:"ImOQa9"}),class:"reply-button",icon:"comment",iconSize:"m",onClick:On}),o(Ne,{size:"s",checked:mt,title:[g({id:"W9FRBT"}),g({id:"OcUmcH"})],alt:[g({id:"W9FRBT"}),g({id:"8ab1sR"})],class:"favourite-button",icon:"heart",iconSize:"m",count:zt,onClick:wr}),o("button",{type:"button",title:g({id:"2FYpfJ"}),class:"plain more-button",onClick:_=>{_.preventDefault(),_.stopPropagation(),Nn({anchorRef:{current:_.currentTarget},align:"start",direction:"left",gap:0,shift:-8}),sn("actions-bar")},children:o(R,{icon:"more2",size:"m",alt:g({id:"2FYpfJ"})})})]}),r!=="l"&&o("div",{class:"status-badge",children:[dt&&o(R,{class:"reblog",icon:"rocket",size:"s",alt:g({id:"b7T5Zj"})}),mt&&o(R,{class:"favourite",icon:"heart",size:"s",alt:g({id:"8ab1sR"})}),It&&o(R,{class:"bookmark",icon:"bookmark",size:"s",alt:g({id:"1C/9Sa"})}),Nt&&o(R,{class:"pin",icon:"pin",size:"s",alt:g({id:"kNiQp6"})})]}),r!=="s"&&o("a",{href:st,tabindex:"-1",title:`@${F}`,onClick:_=>{_.preventDefault(),_.stopPropagation(),V.showAccount={account:e.account,instance:T}},children:o(ae,{url:j||W,size:"xxl",squircle:vt})}),o("div",{class:"container",children:[!!(e.account||X)&&o("div",{class:"meta",children:[o("span",{class:"meta-name",children:o(ve,{account:e.account,instance:T,showAvatar:r==="s",showAcct:ct})})," ",r!=="l"&&(Tt?o("span",{class:"status-deleted-tag",children:o(P,{id:"vGjmyl"})}):$t&&!h&&!a&&!d?o(je,{to:T?`/${T}/s/${N}`:`/s/${N}`,onClick:_=>{_.metaKey||_.ctrlKey||_.shiftKey||_.altKey||_.which===2||(_.preventDefault(),_.stopPropagation(),p==null||p(_,e),Nn({anchorRef:{current:_.currentTarget},align:"end",direction:"bottom",gap:4}),sn(!0))},class:`time ${$n&&(Fn!=null&&Fn.anchorRef)?"is-open":""}`,children:[Ia&&!Qo?o(R,{icon:"comment2",size:"s",alt:kt._({id:"RXmXDR",values:{repliesCount:at}})}):Q!=="public"&&Q!=="direct"&&o(R,{icon:bn[Q],alt:k(xe[Q]),size:"s"})," ",o(se,{datetime:ft,format:"micro"}),!h&&!a&&o(R,{icon:"more2",class:"more",alt:g({id:"2FYpfJ"})})]}):o("span",{class:"time",children:[Q!=="public"&&Q!=="direct"&&o($,{children:[o(R,{icon:bn[Q],alt:k(xe[Q]),size:"s"})," "]}),o(se,{datetime:ft,format:"micro"})]}))]}),Q==="direct"&&o($,{children:[o("div",{class:"status-direct-badge",children:o(P,{id:"IV4QaU"})})," "]}),!c&&o($,{children:an?o("div",{class:"status-thread-badge",children:[o(R,{icon:"thread",size:"s"}),o(P,{id:"lQ8zCz",values:{0:x.statusThreadNumber[C]?` ${x.statusThreadNumber[C]}/X`:""}})]}):!!B&&!!Re&&(!!U||!ut.find(_=>_.id===K))&&o("div",{class:"status-reply-badge",children:[o(R,{icon:"reply"})," ",o(ve,{account:Re,instance:T,short:!0})]})}),o("div",{class:`content-container ${U||yt?"has-spoiler":""} ${Zt?"show-spoiler":""} ${Yt?"show-media":""}`,"data-content-text-weight":i?No():null,style:(ct||i)&&{"--content-text-weight":No()},children:w&&Je?o($,{children:[(!!U||!!yt)&&!Gt&&o($,{children:[!!U&&o("span",{class:"spoiler-content media-first-spoiler-content",lang:pt,dir:"auto",ref:$o,"data-read-more":k(En),children:[o(Ze,{text:U,emojis:Ft})," "]}),o("button",{class:`light spoiler-button media-first-spoiler-button ${Zt?"spoiling":""}`,type:"button",onClick:_=>{_.preventDefault(),_.stopPropagation(),Zt?(delete V.spoilers[N],Gt||delete V.spoilersMedia[N]):(V.spoilers[N]=!0,Gt||(V.spoilersMedia[N]=!0))},children:[o(R,{icon:Zt?"eye-open":"eye-close"})," ",g(Zt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),o(Hd,{mediaAttachments:G,language:pt,postID:N,instance:T}),!!Y&&o("div",{class:"media-first-content content",ref:Fo,children:o(ji,{post:e,instance:T,previewMode:h})})]}):o($,{children:[!!U&&o($,{children:[o("div",{class:"content spoiler-content",lang:pt,dir:"auto",ref:$o,"data-read-more":k(En),children:o("p",{children:o(Ze,{text:U,emojis:Ft})})}),Gt||h?o("div",{class:"spoiler-divider",children:[o(R,{icon:"eye-open"})," ",o(P,{id:"gnKo7f"})]}):o("button",{class:`light spoiler-button ${Zt?"spoiling":""}`,type:"button",onClick:_=>{_.preventDefault(),_.stopPropagation(),Zt?(delete V.spoilers[N],Gt||delete V.spoilersMedia[N]):(V.spoilers[N]=!0,Gt||(V.spoilersMedia[N]=!0))},children:[o(R,{icon:Zt?"eye-open":"eye-close"})," ",g(Zt?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),!!Y&&o("div",{class:"content",ref:Fo,"data-read-more":k(En),inert:U&&!Zt?!0:void 0,children:[o(ji,{post:e,instance:T,previewMode:h}),o(Yd,{id:N,instance:T,level:d})]}),!!Et&&o(Yu,{lang:pt,poll:Et,readOnly:a||!L||!D,onUpdate:_=>{V.statuses[C].poll=_},refresh:()=>A.v1.polls.$select(Et.id).fetch().then(_=>{V.statuses[C].poll=_}).catch(_=>{}),votePoll:_=>A.v1.polls.$select(Et.id).votes.create({choices:_}).then(I=>{V.statuses[C].poll=I}).catch(I=>{})}),((u||Oo)&&$d(Y)&&Te||vr)&&o(Mu,{forceTranslate:vr||Oo,mini:!ct&&!c,sourceLanguage:pt,autoDetected:Qe,text:Yr(e)}),!h&&yt&&!!G.length&&Rn!=="show_all"&&o("button",{class:`plain spoiler-media-button ${Yt?"spoiling":""}`,type:"button",hidden:!Gt&&!!U,onClick:_=>{_.preventDefault(),_.stopPropagation(),Yt?delete V.spoilersMedia[N]:V.spoilersMedia[N]=!0},children:[o(R,{icon:Yt?"eye-open":"eye-close"})," ",g(Yt?{id:"6lGV3K"}:{id:"9ZCilh"})]}),!!G.length&&(G.length>1&&(ct||c&&r==="m")?o("div",{class:"media-large-container",children:G.map((_,I)=>o("div",{class:"media-container media-eq1",children:o(fo,{media:_,autoAnimate:!0,showCaption:!0,allowLongerCaption:!Y,lang:pt,to:`/${T}/s/${N}?${c?"media":"media-only"}=${I+1}`,onClick:m?q=>m(q,I,_,e):void 0})},_.id))}):o(Vd,{lang:pt,enabled:Hn,captionChildren:xa,children:o("div",{ref:va,class:`media-container media-eq${G.length} ${G.length>2?"media-gt2":""} ${G.length>4?"media-gt4":""}`,children:Vn.map((_,I)=>o(fo,{media:_,autoAnimate:ct,showCaption:G.length===1,allowLongerCaption:!Y&&G.length===1,lang:pt,altIndex:Hn&&!!_.description&&I+1,to:`/${T}/s/${N}?${c?"media":"media-only"}=${I+1}`,onClick:m?q=>{m(q,I,_,e)}:void 0,checkAspectRatio:G.length===1},_.id))})})),!!rt&&/^https/i.test(rt==null?void 0:rt.url)&&!yt&&!U&&!Et&&!G.length&&!x.statusQuotes[C]&&o(jd,{card:rt,selfReferential:(rt==null?void 0:rt.url)===e.url||(rt==null?void 0:rt.url)===e.uri,selfAuthor:(ni=rt==null?void 0:rt.authors)==null?void 0:ni.some(_=>{var I;return((I=_.account)==null?void 0:I.url)===st}),instance:M})]})}),!ct&&Qo&&o("div",{class:"content-comment-hint insignificant",children:[o(R,{icon:"comment2",alt:g({id:"N8UzTV"})})," ",at]}),ct&&o($,{children:[o("div",{class:"extra-meta",children:Tt?o("span",{class:"status-deleted-tag",children:o(P,{id:"vGjmyl"})}):o($,{children:[o("span",{children:k(xe[Q])})," •"," ",o("a",{href:$t,target:"_blank",rel:"noopener",children:[new Date().getTime()-ft.getTime()<864e5&&o($,{children:[o(se,{datetime:ft,format:"micro"})," ","‒"," "]}),!!X&&o("time",{class:"created",datetime:ft.toISOString(),title:ft.toLocaleString(),children:Bo})]}),qt&&o($,{children:[" ","• ",o(R,{icon:"pencil",alt:g({id:"MRZxAn"})})," ",o("time",{tabIndex:"0",class:"edited",datetime:we.toISOString(),onClick:()=>{Mn(N)},children:zo})]})]})}),!!(Le!=null&&Le.length)&&o("div",{class:"emoji-reactions",children:Le.map(_=>{const{name:I,count:q,me:lt,url:jt,staticUrl:Pe}=_;if(jt)return o("span",{class:`emoji-reaction tag ${lt?"":"insignificant"}`,children:[o(co,{alt:I,url:jt,staticUrl:Pe})," ",q]});if(/^:.+?:$/.test(I)){const Ae=Ft.find(Ce=>Ce.shortcode===I.replace(/^:/,"").replace(/:$/,""));if(Ae)return o("span",{class:`emoji-reaction tag ${lt?"":"insignificant"}`,children:[o(co,{alt:I,url:Ae.url,staticUrl:Ae.staticUrl})," ",q]})}return o("span",{class:`emoji-reaction tag ${lt?"":"insignificant"}`,children:[I," ",q]})})}),o("div",{class:`actions ${Tt?"disabled":""}`,children:[o("div",{class:"action has-count",children:o(Ne,{title:g({id:"ImOQa9"}),alt:g({id:"VbyRUy"}),class:"reply-button",icon:"comment",count:at,onClick:On})}),o("div",{class:"action has-count",children:o(kr,{disabled:!rn,onClick:Er,confirmLabel:o($,{children:[o(R,{icon:"rocket"}),o("span",{children:g(dt?{id:"QzzGsY"}:{id:"kulphB"})})]}),menuExtras:o(bt,{onClick:()=>{Kn({draftStatus:{status:` +${$t}`}})},children:[o(R,{icon:"quote"}),o("span",{children:o(P,{id:"ZhhOwV"})})]}),menuFooter:Go,children:o(Ne,{checked:dt,title:[g({id:"kulphB"}),g({id:"QzzGsY"})],alt:[g({id:"kulphB"}),g({id:"b7T5Zj"})],class:"reblog-button",icon:"rocket",count:xt,disabled:!rn})})}),o("div",{class:"action has-count",children:o(Ne,{checked:mt,title:[g({id:"W9FRBT"}),g({id:"OcUmcH"})],alt:[g({id:"W9FRBT"}),g({id:"8ab1sR"})],class:"favourite-button",icon:"heart",count:zt,onClick:Ho})}),qn("@mastodon/post-bookmark")&&o("div",{class:"action",children:o(Ne,{checked:It,title:[g({id:"PZlHt8"}),g({id:"q8EQYI"})],alt:[g({id:"PZlHt8"}),g({id:"1C/9Sa"})],class:"bookmark-button",icon:"bookmark",onClick:Uo})}),o(Ds,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:o("div",{class:"action",children:o("button",{type:"button",title:g({id:"2FYpfJ"}),class:"plain more-button",children:o(R,{icon:"more",size:"l",alt:g({id:"2FYpfJ"})})})}),children:[Yo," "]})]})]})]}),!!yr&&o(io,{onClick:_=>{_.target===_.currentTarget&&Mn(!1)},children:o(Kd,{statusID:yr,instance:T,fetchStatusHistory:()=>A.v1.statuses.$select(yr).history.list(),onClose:()=>{var _;Mn(!1),(_=Me.current)==null||_.focus()}})}),!!ga&&o(io,{onClick:_=>{_.target===_.currentTarget&&br(!1)},children:o(Wd,{post:e,instance:T,onClose:()=>{br(!1)}})})]})]})}function Vd(t){const{enabled:e,children:n,lang:r,captionChildren:i}=t;return!e||!i?n:o("figure",{class:"media-figure-multiple",children:[n,o("figcaption",{lang:r,dir:"auto",children:i})]})}function Hd(t){const{mediaAttachments:e,language:n,postID:r,instance:i}=t,a=e.length>1,s=O(),[c,l]=H(0);return tt(()=>{let u=()=>{const{clientWidth:f,scrollLeft:h}=s.current,m=Math.round(Math.abs(h)/f);l(m)};return s.current&&s.current.addEventListener("scroll",u,{passive:!0}),()=>{s.current&&s.current.removeEventListener("scroll",u)}},[]),o($,{children:[o("div",{class:"media-first-container",children:[o("div",{class:"media-first-carousel",ref:s,children:e.map((u,f)=>o("div",{class:"media-first-item",children:o(fo,{media:u,lang:n,to:`/${i}/s/${r}?media=${f+1}`})},u.id))}),a&&o("div",{class:"media-carousel-controls",children:[o("div",{class:"carousel-indexer",children:[c+1,"/",e.length]}),o("label",{class:"media-carousel-button",children:o("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)*(ao()?-1:1),behavior:"smooth"})},children:o(R,{icon:"arrow-left"})})}),o("label",{class:"media-carousel-button",children:o("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)*(ao()?-1:1),behavior:"smooth"})},children:o(R,{icon:"arrow-right"})})})]})]}),a&&o("div",{class:"media-carousel-dots",style:{"--dots-count":e.length},children:e.map((u,f)=>o("span",{class:`carousel-dot ${f===c?"active":""}`},u.id))})]})}function Wi(t){return["x.com","twitter.com","threads.net","bsky.app"].includes(t)}function Ud({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 r=t[0].account;return o("div",{class:"card-byline",children:[n,o("div",{class:"card-byline-author",children:[o(R,{icon:"link",size:"s"})," ",o("small",{children:o(P,{id:"4LHHK6",components:{0:o(ve,{account:r,showAvatar:!0})}})})]})]})}function jd({card:t,selfReferential:e,selfAuthor:n,instance:r}){var et;const i=xn(V),{blurhash:a,title:s,description:c,html:l,providerName:u,providerUrl:f,authorName:h,authorUrl:m,width:d,height:p,image:v,imageDescription:y,url:E,type:b,embedUrl:w,language:k,publishedAt:g,authors:A}=t,T=s||u||h,M=d/p>=1.2?"large":"",[L,C]=H(null);if(tt(()=>{T&&v&&!e&&Ua(E)&&ja(r,E).then(st=>{if(!st)return;const{id:ot,url:nt}=st;C("#"+nt)})},[T,v,e]),i.unfurledLinks[E])return null;const x=/`;\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 isWarn = appliedFilters.some((f) => f.filter.filterAction === '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\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 ? (\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 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) {\n const { spoilerText, content, poll } = status;\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) {\n if (!content) return false;\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\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 = useMemo(() => {\n return getCurrentAccountID();\n }, []);\n const isSelf = useMemo(() => {\n return currentAccount && currentAccount === accountId;\n }, [accountId, currentAccount]);\n\n const filterContext = useContext(FilterContext);\n const filterInfo =\n !isSelf && !readOnly && !previewMode && 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 (/*allowFilters && */ size !== 'l' && filterInfo) {\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 = store.account.get('preferences') || {};\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 = store.account.get('preferences') || {};\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' ||\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 {!mediaFirst && (\n <>\n {(enableTranslate || !language || differentLanguage) && (\n \n )}\n {enableTranslate ? (\n
\n {\n setForceTranslate(true);\n }}\n >\n \n \n Translate\n \n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
\n ) : (\n (!language || differentLanguage) && (\n
\n \n \n \n Translate\n \n \n {supportsTTS && (\n {\n const postText = getPostText(status);\n if (postText) {\n speak(postText, language);\n }\n }}\n >\n \n \n Speak\n \n \n )}\n
\n )\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 });\n const fRef = useHotkeys('f, l', favouriteStatusNotify, {\n enabled: hotkeysEnabled,\n });\n const dRef = useHotkeys('d', bookmarkStatusNotify, {\n enabled: hotkeysEnabled,\n });\n const bRef = useHotkeys(\n 'shift+b',\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 },\n );\n const xRef = useHotkeys('x', (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 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(nodeRef);\n fRef(nodeRef);\n dRef(nodeRef);\n bRef(nodeRef);\n xRef(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) &&\n differentLanguage) ||\n forceTranslate) && (\n \n )}\n {!previewMode &&\n sensitive &&\n !!mediaAttachments.length &&\n readingExpandMedia !== 'show_all' && (\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 = /