393e9a0495
SHA256:b8034ef0df199436d8e8c0ca05b24a2e161dcd9d1789599b74f7bde41d6a56f9
65 lines
139 KiB
JavaScript
65 lines
139 KiB
JavaScript
import{L as no,O as ao,E as oo,P as _n,Q as pa,U as io,V as ro,x as fa,i as so,W as ga,_ as ee,p as ve,a as e,h as Q,u as je,X as co,e as lo,N as va,Y as uo,Z as mo,M as xe,$ as ho,S as po,w as Kt,g as K,a0 as fo,a1 as Et,a2 as go,a3 as vo,F as Ee,a4 as bo,a5 as yo,D as _o,a6 as ko,a7 as wo,a8 as Eo,a9 as xo,aa as To,ab as Lo,ac as Ao,ad as Co,ae as So,m as ba,af as Fo,f as ya,ag as $o,T as kn,y as bn,ah as qn,t as Po,b as rt,q as Ro,r as Io,d as on,J as _a,C as Do,ai as Mo,aj as Oo,ak as Kn,al as zo,am as Wn,n as No,z as Gn}from"./vendor-dr6WACk1.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function a(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=a(o);fetch(o.href,s)}})();function ka(t){const n=N.local.getJSON("accounts")||[];return n.find(a=>a.info.id===t)||n[0]}function Bo(t){return(N.local.getJSON("accounts")||[]).find(a=>a.accessToken===t)}function Vo(t){return(N.local.getJSON("accounts")||[]).find(a=>a.instanceURL===t)}function Wt(){window.__IGNORE_GET_ACCOUNT_ERROR__;const t=N.session.get("currentAccount");return ka(t)}function Vt(){const t=Wt(),{instanceURL:n,info:{id:a}}=t;return`${a}@${n}`}function Uo(t){const n=N.local.getJSON("accounts")||[],a=n.find(r=>r.info.id===t.info.id);a?(a.info=t.info,a.instanceURL=t.instanceURL,a.accessToken=t.accessToken,a.vapidKey=t.vapidKey):n.push(t),N.local.setJSON("accounts",n),N.session.set("currentAccount",t.info.id)}function Pr(t){const n=N.local.getJSON("accounts")||[],a=n.find(r=>r.info.id===t.id);a&&(a.info.displayName!==t.displayName||a.info.avatar!==t.avatar||a.info.avatar_static!==t.avatar_static)&&(a.info={...a.info,...t},N.local.setJSON("accounts",n))}let rn=null;function wa(){if(rn)return rn;try{const t=Wt(),n=N.local.getJSON("instances"),a=t.instanceURL.toLowerCase();return rn=n[a]}catch(t){return alert(`Failed to load instance configuration. Please try again.
|
||
|
||
${t}`),N.local.del("instances"),location.reload(),{}}}function jo(t){const{configuration:n,maxMediaAttachments:a,maxTootChars:r,pleroma:o,pollLimits:s}=t,c=(n==null?void 0:n.statuses)||{};a&&(c.maxMediaAttachments??(c.maxMediaAttachments=a)),r&&(c.maxCharacters??(c.maxCharacters=r));const u=(n==null?void 0:n.polls)||{};return s&&(u.maxCharactersPerOption??(u.maxCharactersPerOption=s.maxOptionChars),u.maxExpiration??(u.maxExpiration=s.maxExpiration),u.maxOptions??(u.maxOptions=s.maxOptions),u.minExpiration??(u.minExpiration=s.minExpiration)),{...n,statuses:c,polls:u}}function Ho(){const t=wa();return jo(t)}const He={get:t=>{try{return localStorage.getItem(t)}catch{return null}},getJSON:t=>{try{return JSON.parse(He.get(t))}catch{return null}},set:(t,n)=>{try{return localStorage.setItem(t,n)}catch{return null}},setJSON:(t,n)=>{try{return He.set(t,JSON.stringify(n))}catch{return null}},del:t=>{try{return localStorage.removeItem(t)}catch{return null}}},yn={get:t=>{try{return sessionStorage.getItem(t)}catch{return null}},getJSON:t=>{try{return JSON.parse(yn.get(t))}catch{return null}},set:(t,n)=>{try{return sessionStorage.setItem(t,n)}catch{return null}},setJSON:(t,n)=>{try{return yn.set(t,JSON.stringify(n))}catch{return null}},del:t=>{try{return sessionStorage.removeItem(t)}catch{return null}}},qo={get:t=>{try{return He.getJSON(t)[Vt()]}catch{return null}},set:(t,n)=>{try{const a=He.getJSON(t)||{};return a[Vt()]=n,He.setJSON(t,a)}catch{return null}},del:t=>{try{const n=He.getJSON(t)||{};return delete n[Vt()],He.setJSON(t,n)}catch{return null}}},N={local:He,session:yn,account:qo},Ut="mastodon.social",Ht={},Ie={};window.__ACCOUNT_APIS__=Ie;let be;function Ve({instance:t,accessToken:n}){/^https?:\/\//.test(t)&&(t=t.replace(/^https?:\/\//,"").replace(/\/+$/,"").toLowerCase());const a=t?`https://${t}`:`https://${Ut}`,o={masto:no({url:a,accessToken:n,timeout:3e4}),instance:t,accessToken:n};return Ht[t]=o,Ie[t]||(Ie[t]={}),n&&(Ie[t][n]=o),o}async function Rr(t,n){const{masto:a,accessToken:r}=t;let o;try{o=await a.v2.instance.fetch()}catch{}if(!o)try{o=await a.v1.instance.fetch()}catch{}if(!o)return;const{uri:s,urls:{streamingApi:c}={},domain:u,configuration:{urls:{streaming:d}={}}={}}=o,f=N.local.getJSON("instances")||{};if((s||u)&&(f[(u||s).replace(/^https?:\/\//,"").replace(/\/+$/,"").toLowerCase()]=o),n&&(f[n.toLowerCase()]=o),N.local.setJSON("instances",f),"WebSocket"in window&&(c||d)){const p=ao({streamingApiUrl:d||c,accessToken:r,implementation:WebSocket});t.streaming=p}}async function Ir(t,n,a,r){const{masto:o}=t,s=await o.v1.accounts.verifyCredentials();N.session.set("currentAccount",s.id),Uo({info:s,instanceURL:n.toLowerCase(),accessToken:a,vapidKey:r})}async function Dr(t){try{const{masto:n}=t,a=await n.v1.preferences.fetch();N.account.set("preferences",a)}catch{}}function We({instance:t,accessToken:n,accountID:a,account:r}={}){var d,f,m,p,h;if(t&&(t=t.toLowerCase().trim()),t&&n){const g=((d=Ie[t])==null?void 0:d[n])||Ve({instance:t,accessToken:n}),{masto:b,streaming:v}=g;return{masto:b,streaming:v,client:g,authenticated:!0,instance:t}}if(n)for(const g in Ie)if(Ie[g][n]){const b=Ie[g][n],{masto:v,streaming:y}=b;return{masto:v,streaming:y,client:b,authenticated:!0,instance:g}}else{const b=Bo(n);if(b){const v=b.accessToken,y=b.instanceURL.toLowerCase().trim(),E=Ve({instance:y,accessToken:v}),{masto:L,streaming:w}=E;return{masto:L,streaming:w,client:E,authenticated:!0,instance:y}}else throw new Error("Access token not found")}if(r||a)if(r=r||ka(a),r){const g=r.accessToken,b=r.instanceURL.toLowerCase().trim(),v=((f=Ie[b])==null?void 0:f[g])||Ve({instance:b,accessToken:g}),{masto:y,streaming:E}=v;return{masto:y,streaming:E,client:v,authenticated:!0,instance:b}}else throw new Error(`Account ${a} not found`);const o=Wt();if(t){if((be==null?void 0:be.instance)===t)return{masto:be.masto,streaming:be.streaming,client:be,authenticated:!0,instance:t};if((o==null?void 0:o.instanceURL)===t){const{accessToken:L}=o;return be=((m=Ie[t])==null?void 0:m[L])||Ve({instance:t,accessToken:L}),{masto:be.masto,streaming:be.streaming,client:be,authenticated:!0,instance:t}}const g=Vo(t);if(g){const L=g.accessToken,w=((p=Ie[t])==null?void 0:p[L])||Ve({instance:t,accessToken:L}),{masto:k,streaming:F}=w;return{masto:k,streaming:F,client:w,authenticated:!0,instance:t}}const b=Ht[t]||Ve({instance:t}),{masto:v,streaming:y,accessToken:E}=b;return{masto:v,streaming:y,client:b,authenticated:!!E,instance:t}}if(be)return{masto:be.masto,streaming:be.streaming,client:be,authenticated:!0,instance:be.instance};if(o){const{accessToken:g,instanceURL:b}=o;return be=((h=Ie[b])==null?void 0:h[g])||Ve({instance:b,accessToken:g}),{masto:be.masto,streaming:be.streaming,client:be,authenticated:!0,instance:b}}const s=Ht[Ut]||Ve({instance:Ut}),{masto:c,streaming:u}=s;return{masto:c,streaming:u,client:s,authenticated:!1,instance:Ut}}window.__API__={currentAccountApi:be,apis:Ht,accountApis:Ie};window._showToast=we;function we(t){typeof t=="string"&&(t={text:t});const{onClick:n,delay:a,...r}=t,o=oo({className:`${n||t.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...r,onClick:()=>{n==null||n(o)}});return a?setTimeout(()=>{o.showToast()},a):o.showToast(),o}function Ea(t){try{const{pathname:n,hash:a}=new URL(t);return/^\/.*\/\d+$/i.test(n)||/^\/(@[^/]+|users\/[^/]+)\/(statuses|posts)\/\w+\/?$/i.test(n)||/^\/notes\/[a-z0-9]+$/i.test(n)||/^\/(notice|objects)\/[a-z0-9-]+$/i.test(n)||/#\/[^\/]+\.[^\/]+\/s\/.+/i.test(a)}catch{return!1}}window._moize=_n;function Ye(t,n={}){return _n(t,{...n,maxSize:50,isDeepEqual:!0})}function Gt(t,n={}){return Ye(t,{isPromise:!0,...n})}function Ko(t,n){let a=[],r=!1;function o(){if(a.length===0){r=!1;return}a.shift()(),setTimeout(o,n)}return function(...s){const c=()=>t.apply(this,s);a.push(c),r||(r=!0,setTimeout(o,n))}}const Wo=pa({limit:1,interval:1e3}),Go=/(twitter|github)\.com/i,Yn={};function Yo(t,n){var v;const a=io(M);if(Go.test(n)||Yn[n])return;if(new RegExp(t+"/").test((v=a.unfurledLinks[n])==null?void 0:v.url))return Promise.resolve(a.unfurledLinks[n]);let o,s=n;/\/\/elk\.[^\/]+\/[^\/]+\.[^\/]+/i.test(s)&&(s=s.replace(/elk\.[^\/]+\//i,"")),/\/\/trunks\.[^\/]+\/status\/[^\/]+\.[^\/]+/i.test(s)&&(s=s.replace(/trunks\.[^\/]+\/status\//i,"")),/\/#\/[^\/]+\.[^\/]+\/s\/.+/i.test(s)&&(s=`https://${s.split("/#/")[1].replace(/\/s\//i,"/@fakeUsername/")}`);let c;try{c=new URL(s)}catch{return}const u=c.hostname,d=c.pathname,m=/\/@([^@\/]+)@?([^\/]+)?\/(\d+)$/i.exec(d);if(m){const y=m[3],{masto:E}=We({instance:u});o=E.v1.statuses.$select(y).fetch().then(L=>{if(L!=null&&L.id)return{status:L,instance:u};throw new Error("No results")})}const{masto:p}=We({instance:t}),h=p.v2.search.fetch({q:s,type:"statuses",resolve:!0,limit:1}).then(y=>{if(y.statuses.length>0)return{status:y.statuses[0],instance:t};throw new Error("No results")});function g(y){const{status:E,instance:L}=y,{id:w}=E,k=`/${L}/s/${w}`,F={id:w,instance:L,url:k};return M.unfurledLinks[n]=F,Me(E,L,{skipThreading:!0}),F}function b(y){Yn[n]=!0}return o?Promise.race([h,new Promise((E,L)=>setTimeout(L,3e3))]).catch(()=>o.catch(()=>h)).then(g).catch(b):h.then(g).catch(b)}const xa=Wo(Yo),ae=ro({appVersion:{},prevLocation:null,currentLocation:null,statuses:{},statusThreadNumber:{},home:[],homeNew:[],homeLast:null,homeLastFetchTime:null,notifications:[],notificationsLast:null,notificationsNew:[],notificationsShowNew:!1,notificationsLastFetchTime:null,reloadStatusPage:0,reloadGenericAccounts:{id:null,counter:0},spoilers:{},spoilersMedia:{},scrollPositions:{},unfurledLinks:{},statusQuotes:{},statusFollowedTags:{},statusReply:{},accounts:{},routeNotification:null,showCompose:!1,showSettings:!1,showAccount:!1,showAccounts:!1,showDrafts:!1,showMediaModal:!1,showShortcutsSettings:!1,showKeyboardShortcutsHelp:!1,showGenericAccounts:!1,showMediaAlt:!1,showEmbedModal:!1,shortcuts:[],settings:{autoRefresh:!1,shortcutsViewMode:null,shortcutsColumnsMode:!1,boostsCarousel:!0,contentTranslation:!0,contentTranslationTargetLanguage:null,contentTranslationHideLanguages:[],contentTranslationAutoInline:!1,mediaAltGenerator:!1,cloakMode:!1}}),M=ae;function Mr(){ae.notificationsLast=N.account.get("notificationsLast")||null,ae.shortcuts=N.account.get("shortcuts")??[],ae.settings.autoRefresh=N.account.get("settings-autoRefresh")??!1,ae.settings.shortcutsViewMode=N.account.get("settings-shortcutsViewMode")??null,N.account.get("settings-shortcutsColumnsMode")&&(ae.settings.shortcutsColumnsMode=!0),ae.settings.boostsCarousel=N.account.get("settings-boostsCarousel")??!0,ae.settings.contentTranslation=N.account.get("settings-contentTranslation")??!0,ae.settings.contentTranslationTargetLanguage=N.account.get("settings-contentTranslationTargetLanguage")||null,ae.settings.contentTranslationHideLanguages=N.account.get("settings-contentTranslationHideLanguages")||[],ae.settings.contentTranslationAutoInline=N.account.get("settings-contentTranslationAutoInline")??!1,ae.settings.mediaAltGenerator=N.account.get("settings-mediaAltGenerator")??!1,ae.settings.cloakMode=N.account.get("settings-cloakMode")??!1}fa(ae,"notificationsLast",t=>{N.account.set("notificationsLast",ae.notificationsLast)});so(ae,t=>{for(const[n,a,r,o]of t)a.join(".")==="settings.autoRefresh"&&N.account.set("settings-autoRefresh",!!r),a.join(".")==="settings.boostsCarousel"&&N.account.set("settings-boostsCarousel",!!r),a.join(".")==="settings.shortcutsViewMode"&&N.account.set("settings-shortcutsViewMode",r),a.join(".")==="settings.contentTranslation"&&N.account.set("settings-contentTranslation",!!r),a.join(".")==="settings.contentTranslationAutoInline"&&N.account.set("settings-contentTranslationAutoInline",!!r),a.join(".")==="settings.contentTranslationTargetLanguage"&&N.account.set("settings-contentTranslationTargetLanguage",r),/^settings\.contentTranslationHideLanguages/i.test(a.join("."))&&N.account.set("settings-contentTranslationHideLanguages",ae.settings.contentTranslationHideLanguages),a.join(".")==="settings.mediaAltGenerator"&&N.account.set("settings-mediaAltGenerator",!!r),(a==null?void 0:a[0])==="shortcuts"&&N.account.set("shortcuts",ae.shortcuts),a.join(".")==="settings.cloakMode"&&N.account.set("settings-cloakMode",!!r)});function Pe(t,n){if(t)return n?`${n}/${t}`:t}function wn(t,n){if(n){const a=Pe(t,n);return ae.statuses[a]}return ae.statuses[t]}function Me(t,n,a){typeof n=="object"&&(a=n,n=null);const{override:r=!0,skipThreading:o=!1,skipUnfurling:s=!1}=a||{};if(!t)return;const c=wn(t.id,n);!r&&c||ga(t,c)||(queueMicrotask(()=>{var d,f;const u=Pe(t.id,n);if(c!=null&&c._pinned&&(t._pinned=c._pinned),ae.statuses[u]=t,(d=t.reblog)!=null&&d.id){const m=Pe(t.reblog.id,n);ae.statuses[m]=t.reblog}if((f=t.quote)!=null&&f.id){const m=Pe(t.quote.id,n);ae.statuses[m]=t.quote,ae.statusQuotes[u]=[{id:t.quote.id,instance:n}]}}),o||queueMicrotask(()=>{Zo(t.reblog||t,n)}),s||queueMicrotask(()=>{Xo(t.reblog||t,n)}))}function Jo(t,n){const{masto:a,instance:r}=We({instance:n});let o=0;async function s(c,u=0){const{inReplyToId:d,inReplyToAccountId:f}=c;if(!d||f!==c.account.id)return[c];if(d&&f!==c.account.id)throw"Not a thread";const m=Pe(d,r);let p=ae.statuses[m];if(!p){if(o++>3)throw"Too many fetches for thread";await new Promise(h=>setTimeout(h,500*o)),p=await Qo(d,a),Me(p,r,{skipThreading:!0})}return[...await s(p,++u),c]}return s(t).then(c=>{c.length>1&&c.forEach((u,d)=>{const f=Pe(u.id,r);ae.statusThreadNumber[f]=d+1})}).catch(c=>{})}const Zo=Ko(Jo,100),Jn=document.createElement("div");function Xo(t,n){const{instance:a}=We(),r=t==null?void 0:t.content;if(/<a/i.test(r)){const s=Pe(t==null?void 0:t.id,n);Jn.innerHTML=r,[...Jn.querySelectorAll("a[href]:not(.u-url):not(.mention):not(.hashtag)")].filter(u=>{const d=u.href;return!(d===t.url||d===t.uri)&&Ea(d)}).forEach((u,d)=>{xa(a,u.href).then(f=>{f&&s&&(Array.isArray(ae.statusQuotes[s])||(ae.statusQuotes[s]=[]),ae.statusQuotes[s][d]||ae.statusQuotes[s].splice(d,0,f))})})}}const Qo=Gt((t,n)=>n.v1.statuses.$select(t).fetch());function ei(t,n,a,r){const o=ee(t);ve(()=>{o.current=t},[t,a]),ve(()=>{!r||n===null||n===!1||o.current()},[r]),ve(()=>{if(n===null||n===!1)return;const c=setInterval(()=>o.current(),n);return()=>clearInterval(c)},[n])}function Ta(t){const n=new URL("/compose/",window.location),{width:a,height:r}=window.screen,o=Math.max(0,(a-600)/2),s=Math.max(0,(r-450)/2),c=Math.min(a,600),u=Math.min(r,450),d=(t==null?void 0:t.uid)||Math.random(),f=window.open(n,"compose"+d,`width=${c},height=${u},left=${o},top=${s}`);return f?f.__COMPOSE__=t:alert("Looks like your browser is blocking popups."),f}const ti="modulepreload",ni=function(t,n){return new URL(t,n).href},Zn={},_=function(n,a,r){let o=Promise.resolve();if(a&&a.length>0){const s=document.getElementsByTagName("link");o=Promise.all(a.map(c=>{if(c=ni(c,r),c in Zn)return;Zn[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(!!r)for(let p=s.length-1;p>=0;p--){const h=s[p];if(h.href===c&&(!u||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${d}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":ti,u||(m.as="script",m.crossOrigin=""),m.href=c,document.head.appendChild(m),u)return new Promise((p,h)=>{m.addEventListener("load",p),m.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${c}`)))})}))}return o.then(()=>n()).catch(s=>{const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s})},La={x:()=>_(()=>import("./icons/close-line-YTE7hIJE.js"),__vite__mapDeps([]),import.meta.url),heart:()=>_(()=>import("./icons/heart-line-VwvWYh8h.js"),__vite__mapDeps([]),import.meta.url),bookmark:()=>_(()=>import("./icons/bookmark-line-D6jQ7QFs.js"),__vite__mapDeps([]),import.meta.url),"check-circle":()=>_(()=>import("./icons/check-circle-line-sE41WGxF.js"),__vite__mapDeps([]),import.meta.url),"x-circle":()=>_(()=>import("./icons/close-circle-line-qd3g541O.js"),__vite__mapDeps([]),import.meta.url),transfer:()=>_(()=>import("./icons/transfer-4-line-Q9QJoxz3.js"),__vite__mapDeps([]),import.meta.url),rocket:()=>_(()=>import("./icons/rocket-line-rZbVYYCZ.js"),__vite__mapDeps([]),import.meta.url),"arrow-left":()=>_(()=>import("./icons/arrow-left-line-_YC6-XGG.js"),__vite__mapDeps([]),import.meta.url),"arrow-right":()=>_(()=>import("./icons/arrow-right-line-PypiEqpu.js"),__vite__mapDeps([]),import.meta.url),"arrow-up":()=>_(()=>import("./icons/arrow-up-line-fcuKqhVE.js"),__vite__mapDeps([]),import.meta.url),"arrow-down":()=>_(()=>import("./icons/arrow-down-line-0TRJUP_K.js"),__vite__mapDeps([]),import.meta.url),earth:()=>_(()=>import("./icons/earth-line-t1Um8wpQ.js"),__vite__mapDeps([]),import.meta.url),lock:()=>_(()=>import("./icons/lock-line-0jNHqZpm.js"),__vite__mapDeps([]),import.meta.url),unlock:()=>_(()=>import("./icons/unlock-line-w3piJMVb.js"),__vite__mapDeps([]),import.meta.url),"eye-close":()=>_(()=>import("./icons/eye-close-line-lBiePPv9.js"),__vite__mapDeps([]),import.meta.url),"eye-open":()=>_(()=>import("./icons/eye-2-line-vz_Kw-rK.js"),__vite__mapDeps([]),import.meta.url),message:()=>_(()=>import("./icons/mail-line-5XLS6FEo.js"),__vite__mapDeps([]),import.meta.url),comment:()=>_(()=>import("./icons/chat-3-line-F0xcdpXY.js"),__vite__mapDeps([]),import.meta.url),comment2:()=>_(()=>import("./icons/comment-2-line-xEXuT-Ip.js"),__vite__mapDeps([]),import.meta.url),home:()=>_(()=>import("./icons/home-3-line-qJiZhXUH.js"),__vite__mapDeps([]),import.meta.url),notification:()=>_(()=>import("./icons/notification-line-olNPLtgS.js"),__vite__mapDeps([]),import.meta.url),follow:()=>_(()=>import("./icons/user-follow-line-k_GCWTtp.js"),__vite__mapDeps([]),import.meta.url),"follow-add":()=>_(()=>import("./icons/user-add-line-zzW9OULB.js"),__vite__mapDeps([]),import.meta.url),poll:[()=>_(()=>import("./icons/chart-bar-line-5r_DfN2w.js"),__vite__mapDeps([]),import.meta.url),"90deg"],pencil:()=>_(()=>import("./icons/pencil-line-bKXqElLR.js"),__vite__mapDeps([]),import.meta.url),quill:()=>_(()=>import("./icons/quill-pen-line-h_5-FsGz.js"),__vite__mapDeps([]),import.meta.url),at:()=>_(()=>import("./icons/at-line-9vJS_Hnl.js"),__vite__mapDeps([]),import.meta.url),attachment:()=>_(()=>import("./icons/attachment-line-C2PUa1Ke.js"),__vite__mapDeps([]),import.meta.url),upload:()=>_(()=>import("./icons/upload-3-line-Qsjvubiw.js"),__vite__mapDeps([]),import.meta.url),gear:()=>_(()=>import("./icons/settings-3-line-kt4MSpRv.js"),__vite__mapDeps([]),import.meta.url),more:()=>_(()=>import("./icons/more-3-line-wUD-Yhmj.js"),__vite__mapDeps([]),import.meta.url),more2:()=>_(()=>import("./icons/more-1-fill-je1-slyh.js"),__vite__mapDeps([]),import.meta.url),external:()=>_(()=>import("./icons/external-link-line-8nOOkmFu.js"),__vite__mapDeps([]),import.meta.url),popout:()=>_(()=>import("./icons/external-link-line-8nOOkmFu.js"),__vite__mapDeps([]),import.meta.url),popin:[()=>_(()=>import("./icons/external-link-line-8nOOkmFu.js"),__vite__mapDeps([]),import.meta.url),"180deg"],plus:()=>_(()=>import("./icons/add-circle-line--O-MfyNy.js"),__vite__mapDeps([]),import.meta.url),"chevron-left":()=>_(()=>import("./icons/left-line-Jck0yVmC.js"),__vite__mapDeps([]),import.meta.url),"chevron-right":()=>_(()=>import("./icons/right-line-7VBoqLdz.js"),__vite__mapDeps([]),import.meta.url),"chevron-down":()=>_(()=>import("./icons/down-line-9PeS5YhF.js"),__vite__mapDeps([]),import.meta.url),reply:[()=>_(()=>import("./icons/share-forward-line-4jL-2Q4u.js"),__vite__mapDeps([]),import.meta.url),"180deg","horizontal"],thread:()=>_(()=>import("./icons/route-line-2YYy3958.js"),__vite__mapDeps([]),import.meta.url),group:()=>_(()=>import("./icons/group-line-JvhJklhQ.js"),__vite__mapDeps([]),import.meta.url),bot:()=>_(()=>import("./icons/android-2-line-uPwvVubH.js"),__vite__mapDeps([]),import.meta.url),menu:()=>_(()=>import("./icons/rows-4-line-SxGPYpTa.js"),__vite__mapDeps([]),import.meta.url),list:()=>_(()=>import("./icons/list-check-line-qNqx9Mm4.js"),__vite__mapDeps([]),import.meta.url),search:()=>_(()=>import("./icons/search-2-line-G39AynEw.js"),__vite__mapDeps([]),import.meta.url),hashtag:()=>_(()=>import("./icons/hashtag-line-SS3QMu1R.js"),__vite__mapDeps([]),import.meta.url),info:()=>_(()=>import("./icons/information-line-8SOch6cR.js"),__vite__mapDeps([]),import.meta.url),shortcut:()=>_(()=>import("./icons/lightning-line-JMYUlCZM.js"),__vite__mapDeps([]),import.meta.url),user:()=>_(()=>import("./icons/user-4-line-zT_bpOrS.js"),__vite__mapDeps([]),import.meta.url),following:()=>_(()=>import("./icons/walk-line-CF7a5s4t.js"),__vite__mapDeps([]),import.meta.url),pin:()=>_(()=>import("./icons/pin-line-ULyRQyWZ.js"),__vite__mapDeps([]),import.meta.url),unpin:[()=>_(()=>import("./icons/pin-line-ULyRQyWZ.js"),__vite__mapDeps([]),import.meta.url),"180deg"],bus:()=>_(()=>import("./icons/bus-2-line-XuQdDZ_w.js"),__vite__mapDeps([]),import.meta.url),link:()=>_(()=>import("./icons/link-2-line-BUqp1EwN.js"),__vite__mapDeps([]),import.meta.url),history:()=>_(()=>import("./icons/history-line-yoG7K8wL.js"),__vite__mapDeps([]),import.meta.url),share:()=>_(()=>import("./icons/share-2-line-PYo-zN94.js"),__vite__mapDeps([]),import.meta.url),sparkles:()=>_(()=>import("./icons/sparkles-line-wjZWGZ1a.js"),__vite__mapDeps([]),import.meta.url),sparkles2:()=>_(()=>import("./icons/sparkles-2-line-g2FqdZ0R.js"),__vite__mapDeps([]),import.meta.url),exit:()=>_(()=>import("./icons/exit-line-l-1uUgI7.js"),__vite__mapDeps([]),import.meta.url),translate:()=>_(()=>import("./icons/translate-line-HpDtlqS2.js"),__vite__mapDeps([]),import.meta.url),play:()=>_(()=>import("./icons/play-fill-Ey-zv2eL.js"),__vite__mapDeps([]),import.meta.url),trash:()=>_(()=>import("./icons/delete-2-line-pjUduCFs.js"),__vite__mapDeps([]),import.meta.url),mute:()=>_(()=>import("./icons/volume-mute-line-WthBoXru.js"),__vite__mapDeps([]),import.meta.url),unmute:()=>_(()=>import("./icons/volume-line-PZujbN8h.js"),__vite__mapDeps([]),import.meta.url),block:()=>_(()=>import("./icons/forbid-circle-line-3FxopGoP.js"),__vite__mapDeps([]),import.meta.url),unblock:[()=>_(()=>import("./icons/forbid-circle-line-3FxopGoP.js"),__vite__mapDeps([]),import.meta.url),"180deg"],flag:()=>_(()=>import("./icons/flag-4-line-M3u-PO0J.js"),__vite__mapDeps([]),import.meta.url),time:()=>_(()=>import("./icons/time-line-ThP0kTRr.js"),__vite__mapDeps([]),import.meta.url),refresh:()=>_(()=>import("./icons/refresh-2-line-t42qqclb.js"),__vite__mapDeps([]),import.meta.url),emoji2:()=>_(()=>import("./icons/emoji-2-line--uNVc2IC.js"),__vite__mapDeps([]),import.meta.url),filter:()=>_(()=>import("./icons/filter-2-line-KyjbFYlO.js"),__vite__mapDeps([]),import.meta.url),chart:()=>_(()=>import("./icons/chart-line-line-pHaLt6yC.js"),__vite__mapDeps([]),import.meta.url),react:()=>_(()=>import("./icons/react-line-YfZPqZem.js"),__vite__mapDeps([]),import.meta.url),layout4:()=>_(()=>import("./icons/layout-4-line-FOdnyEcZ.js"),__vite__mapDeps([]),import.meta.url),layout5:()=>_(()=>import("./icons/layout-5-line-9Kks7dle.js"),__vite__mapDeps([]),import.meta.url),announce:()=>_(()=>import("./icons/announcement-line-MSlAmDH1.js"),__vite__mapDeps([]),import.meta.url),alert:()=>_(()=>import("./icons/alert-line-zyc6hy8V.js"),__vite__mapDeps([]),import.meta.url),round:()=>_(()=>import("./icons/round-fill-a0rplSmV.js"),__vite__mapDeps([]),import.meta.url),"arrow-up-circle":()=>_(()=>import("./icons/arrow-up-circle-line-e3kZqEZN.js"),__vite__mapDeps([]),import.meta.url),"arrow-down-circle":()=>_(()=>import("./icons/arrow-down-circle-line-mpqFtRtO.js"),__vite__mapDeps([]),import.meta.url),clipboard:()=>_(()=>import("./icons/clipboard-line-9F_Yeo71.js"),__vite__mapDeps([]),import.meta.url),"account-edit":()=>_(()=>import("./icons/user-edit-line-9VnWCh0X.js"),__vite__mapDeps([]),import.meta.url),"account-warning":()=>_(()=>import("./icons/user-warning-line-gL3RGb1N.js"),__vite__mapDeps([]),import.meta.url),keyboard:()=>_(()=>import("./icons/keyboard-line-10AZQcVH.js"),__vite__mapDeps([]),import.meta.url),cloud:()=>_(()=>import("./icons/cloud-line-abe0HgFS.js"),__vite__mapDeps([]),import.meta.url),month:()=>_(()=>import("./icons/calendar-month-line-VoXZVWAe.js"),__vite__mapDeps([]),import.meta.url),media:()=>_(()=>import("./icons/photo-album-line--GdJqjfq.js"),__vite__mapDeps([]),import.meta.url),speak:()=>_(()=>import("./icons/radar-line-ndI8IhOG.js"),__vite__mapDeps([]),import.meta.url),building:()=>_(()=>import("./icons/building-5-line-ew7lu83B.js"),__vite__mapDeps([]),import.meta.url),history:()=>_(()=>import("./icons/history-2-line-3yIVzoWo.js"),__vite__mapDeps([]),import.meta.url),document:()=>_(()=>import("./icons/document-line--D6ooZg1.js"),__vite__mapDeps([]),import.meta.url)},ai={s:12,m:16,l:20,xl:24,xxl:32},Xn={},oi=_n(function({width:t,height:n,body:a,rotate:r,flip:o}){return e("svg",{viewBox:`0 0 ${t} ${n}`,dangerouslySetInnerHTML:{__html:a},style:{transform:`${r?`rotate(${r})`:""} ${o?"scaleX(-1)":""}`}})},{isShallowEqual:!0,maxSize:Object.keys(La).length,matchesArg:(t,n)=>t.icon===n.icon&&t.body===n.body});function x({icon:t,size:n="m",alt:a,title:r,class:o="",style:s={}}){if(!t)return null;const c=ai[n];let u=La[t];if(!u)return null;let d,f;Array.isArray(u)&&([u,d,f]=u);const[m,p]=Q(Xn[t]),h=ee(t);return ve(()=>{m&&h.current===t||((async()=>{const g=await u();p(g.default),Xn[t]=g.default})(),h.current=t)},[t]),e("span",{class:`icon ${o}`,title:r||a,style:{width:`${c}px`,height:`${c}px`,...s},children:m&&e(oi,{icon:t,width:m.width,height:m.height,body:m.body,rotate:d,flip:f})})}function ii(t,n=[]){!t||typeof t!="function"||ve(()=>{const a=new CloseWatcher;return a.addEventListener("close",t),()=>{a.destroy()}},n)}const Aa=window.CloseWatcher?ii:()=>{},ri=document.getElementById("modal-container");function Yt({children:t,onClose:n,onClick:a,class:r}){if(!t)return null;const o=ee();ve(()=>{let d=setTimeout(()=>{var m;const f=(m=o.current)==null?void 0:m.querySelector('[tabindex="-1"]');f&&f.focus()},100);return()=>clearTimeout(d)},[]);const s=window.CloseWatcher,c=je("esc",()=>{setTimeout(()=>{n==null||n()},0)},{enabled:!s&&!!n,keydown:!1,keyup:!0},[n]);Aa(n,[n]);const u=e("div",{ref:d=>{var f;o.current=d,c.current=((f=d==null?void 0:d.querySelector)==null?void 0:f.call(d,'[tabindex="-1"]'))||d},className:r,onClick:d=>{a==null||a(d),d.target===d.currentTarget&&(n==null||n(d))},tabIndex:"-1",onFocus:d=>{var f,m,p,h;d.target===d.currentTarget&&((h=(p=(m=(f=o.current)==null?void 0:f.querySelector)==null?void 0:m.call(f,'[tabindex="-1"]'))==null?void 0:p.focus)==null||h.call(p))},children:t});return co(u,ri)}function Jt({abrupt:t,hidden:n,...a}){return e("span",{...a,class:`loader-container ${t?"abrupt":""} ${n?"hidden":""}`,children:e("span",{class:"loader"})})}const Qn={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},gt={},bt=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),sn=bt.getContext("2d",{willReadFrequently:!0});function si({url:t,size:n,alt:a="",squircle:r,...o}){n=Qn[n]||n||Qn.m;const s=ee(),c=/missing\.png$/.test(t);return e("span",{ref:s,class:`avatar ${r?"squircle":""} ${gt[t]?"has-alpha":""}`,style:{width:n,height:n},title:a,...o,children:!!t&&e("img",{src:t,width:n,height:n,alt:a,loading:"lazy",decoding:"async",crossOrigin:gt[t]===void 0&&!c?"anonymous":void 0,onError:u=>{u.target.crossOrigin&&(u.target.crossOrigin=null,u.target.src=t)},onLoad:u=>{s.current&&(s.current.dataset.loaded=!0),gt[t]===void 0&&(c||queueMicrotask(()=>{try{const{width:d,height:f}=u.target;bt.width!==d&&(bt.width=d),bt.height!==f&&(bt.height=f),sn.drawImage(u.target,0,0);const m=sn.getImageData(0,0,d,f),p=m.data.filter((h,g)=>g%4===3&&h<=128).length/(m.data.length/4)>.1;p&&s.current.classList.add("has-alpha"),gt[t]=p,sn.clearRect(0,0,d,f)}catch{gt[t]=!1}}))}})})}const Ge=Ye(si),it=va((t,n)=>{let a;try{a=lo()}catch{}let r=(location.hash||"").replace(/^#/,"").trim();r===""&&(r="/");const{to:o,...s}=t;if(r&&r!=="/"&&r.includes("?"))try{const u=new URL(r,location.origin);if(u.searchParams.size){const d=Array.from(u.searchParams.entries()).map(([f,m])=>`${f}=${encodeURIComponent(m)}`).join("&");r=u.pathname+"?"+d}}catch{}const c=r===o||decodeURIComponent(r)===o;return e("a",{ref:n,href:`#${o}`,...s,class:`${t.class||""} ${c?"is-active":""}`,onClick:u=>{var d,f,m;(f=(d=u.currentTarget)==null?void 0:d.parentNode)!=null&&f.closest("a")&&u.stopPropagation(),a&&(M.prevLocation=a),(m=t.onClick)==null||m.call(t,u)}})}),ci=document.documentElement,Bt=getComputedStyle(ci),li=8;let Ca=[0,0,0,0];function Sa(){const t=Bt.getPropertyValue("--sai-top"),n=Bt.getPropertyValue("--sai-right"),a=Bt.getPropertyValue("--sai-bottom"),r=Bt.getPropertyValue("--sai-left");Ca=[Math.max(0,parseInt(t,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(a,10)),Math.max(0,parseInt(r,10))]}requestAnimationFrame(Sa);function Fa(t=[]){return Ca.map((a,r)=>(a||li)+(t[r]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",Sa,{passive:!0});function En(t){const{containerProps:n,instanceRef:a}=t,r=uo(),o=a!=null&&a.current?a:ee();return e(mo,{boundingBoxPadding:Fa(),repositionFlag:`${r.width}x${r.height}`,unmountOnClose:!0,...t,instanceRef:o,containerProps:{onClick:s=>{var c,u,d;s.target===s.currentTarget&&((u=(c=o.current)==null?void 0:c.closeMenu)==null||u.call(c)),(d=n==null?void 0:n.onClick)==null||d.call(n,s)},...n}})}function cn({subMenu:t=!1,confirm:n=!0,confirmLabel:a,menuItemClassName:r,menuFooter:o,...s}){const{children:c,onClick:u,...d}=s;if(!n)return t?e(xe,{...s}):u?ho(c,{onClick:u}):c;const f=t?po:En,m=ee();return e(f,{instanceRef:m,openTrigger:"clickOnly",direction:"bottom",overflow:"auto",gap:-8,shift:8,menuClassName:"menu-emphasized",...d,menuButton:t?void 0:c,label:t?c:void 0,itemProps:{onPointerMove:p=>{var h,g;p.pointerType==="touch"&&((g=(h=m.current)==null?void 0:h.openMenu)==null||g.call(h))},onPointerLeave:p=>{var h,g;p.pointerType==="touch"&&((g=(h=m.current)==null?void 0:h.openMenu)==null||g.call(h))}},children:[e(xe,{className:r,onClick:u,children:a}),o]})}function ui({text:t,emojis:n}){if(!t)return"";if(!(n!=null&&n.length)||t.indexOf(":")===-1)return t;const a=new RegExp(`:(${n.map(o=>o.shortcode).join("|")}):`,"g");return t.split(a).map(o=>{const s=n.find(c=>c.shortcode===o);if(s){const{url:c,staticUrl:u}=s;return e("picture",{children:[e("source",{srcset:u,media:"(prefers-reduced-motion: reduce)"}),e("img",{src:c,alt:o,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async"},o)]})}return o})}const xt=Kt(ui,(t,n)=>{var a,r;return t.text===n.text&&((a=t.emojis)==null?void 0:a.length)===((r=n.emojis)==null?void 0:r.length)}),di=new Intl.Collator("en",{sensitivity:"base"});function mi({account:t,instance:n,showAvatar:a,showAcct:r,short:o,external:s,onClick:c}){const{acct:u,avatar:d,avatarStatic:f,id:m,url:p,displayName:h,emojis:g,bot:b}=t;let{username:v}=t;const[y,E,L]=u.match(/([^@]+)(@.+)/i)||[,u],w=v.toLowerCase().trim(),k=(h||"").toLowerCase().trim(),F=k.replace(/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,"").replace(/\s+/g,""),O=F.replace(/[^a-z0-9]/gi,"");return!o&&(w===k||w===F||w===O||di.compare(w,F)===0)&&(v=null),e("a",{class:`name-text ${r?"show-acct":""} ${o?"short":""}`,href:p,target:s?"_blank":null,title:`${h?`${h} `:""}@${u}`,onClick:$=>{if(!s){if($.preventDefault(),$.stopPropagation(),c)return c($);M.showAccount={account:t,instance:n}}},children:[a&&e(K,{children:[e(Ge,{url:f||d,squircle:b})," "]}),h&&!o?e(K,{children:[e("b",{children:e(xt,{text:h,emojis:g})}),!r&&v&&e(K,{children:[" ",e("i",{children:["@",v]})]})]}):o?e("i",{children:v}):e("b",{children:v}),r&&e(K,{children:[e("br",{}),e("i",{children:["@",E,e("span",{class:"ib",children:L})]})]})]})}const yt=Kt(mi,(t,n)=>{const{account:a}=t,{account:r}=n;return(a==null?void 0:a.acct)===(r==null?void 0:r.acct)});Et.extend(fo);Et.extend(go);Et.extend(vo);const hi=new Intl.DateTimeFormat;function Tt({datetime:t,format:n}){if(!t)return null;const a=Ee(()=>Et(t),[t]),r=Ee(()=>{if(n==="micro"){const c=Et();return c.diff(a,"day")<=1||c.year()===a.year()?a.twitter():hi.format(a.toDate())}return a.fromNow()},[a,n]),o=Ee(()=>a.toISOString(),[a]),s=Ee(()=>a.format("LLLL"),[a]);return e("time",{datetime:o,title:s,children:r})}const pi=[{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"}];function fi(...t){try{return bo(...t)}catch{return t[2]||!1}}const qt=Ye(fi),gi=[new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages],vi=qt(gi,pi.map(t=>t.code.replace("_","-")),"en");function $a(t=!1){if(t){const{contentTranslationTargetLanguage:n}=M.settings;if(n)return n}return vi}function ln(t){try{return new Intl.DisplayNames(navigator.languages,{type:"language"}).of(t)}catch{return null}}function xn(t,n=[]){return t?(!n.length||t.indexOf(":")===-1||n.forEach(a=>{const{shortcode:r,staticUrl:o,url:s}=a;t=t.replace(new RegExp(`:${r}:`,"g"),`<picture><source srcset="${o}" media="(prefers-reduced-motion: reduce)"></source><img class="shortcode-emoji emoji" src="${s}" alt=":${r}:" width="16" height="16" loading="lazy" decoding="async" /></picture>`)}),t):""}const nt=document.createElement("div"),bi=["u-url","mention","hashtag"];function yi(t,n={}){const{emojis:a,postEnhanceDOM:r=()=>{}}=n;let o=t;const s=document.createElement("div");s.innerHTML=o;const c=/<a/i.test(o),u=o.includes("```");if(c&&(s.querySelectorAll('a:not([target="_blank"])').forEach(p=>{p.setAttribute("target","_blank")}),s.querySelectorAll("a[class]").forEach(p=>{p.classList.forEach(h=>{bi.includes(h)||p.classList.remove(h)})})),c&&s.querySelectorAll("a[href]").forEach(m=>{/^https?:\/\//i.test(m.textContent.trim())&&(m.classList.add("has-url-text"),Ei(m))}),c){const f=s.querySelectorAll("a[href]"),m=[];f.forEach(p=>{const h=p.innerText.trim(),g=p.querySelector("*");if(/^@[^@]+(@[^@]+)?$/g.test(h)){const[b,v,y]=h.split("@");g||(!m.some(([E])=>E===v)||m.some(([E,L])=>E===v&&L===y)?(p.innerHTML=`@<span>${v}</span>`,m.push([v,y])):p.innerHTML=`@<span>${v}@${y}</span>`),p.classList.add("mention")}/^#[^#]+$/g.test(h)&&(g||(p.innerHTML=`#<span>${h.slice(1)}</span>`),p.classList.add("mention","hashtag"))})}let d;if(o.includes(":")&&(d=dn(s),d.forEach(f=>{let m=f.nodeValue.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");a&&(m=xn(m,a)),nt.innerHTML=m,f.replaceWith(...nt.childNodes)})),u&&[...s.querySelectorAll("p")].filter(m=>/^```[^]+```$/g.test(m.innerText.trim())).forEach(m=>{const p=document.createElement("pre");m.querySelectorAll("br").forEach(h=>h.replaceWith(`
|
||
`)),p.innerHTML=`<code>${m.innerHTML.trim()}</code>`,m.replaceWith(p)}),u&&[...s.querySelectorAll("p")].filter(p=>/^```/g.test(p.innerText)).forEach(p=>{const h=[p];let g=!1,b=p;for(;b.nextElementSibling;){const v=b.nextElementSibling;if(v&&v.tagName==="P")if(/```$/g.test(v.innerText)){h.push(v),g=!0;break}else h.push(v);else break;b=v}if(g){const v=document.createElement("pre");h.forEach(E=>{E.querySelectorAll("br").forEach(L=>L.replaceWith(`
|
||
`))});const y=h.map(E=>E.innerHTML).join(`
|
||
|
||
`);v.innerHTML=`<code tabindex="0">${y}</code>`,p.replaceWith(v),h.forEach(E=>E.remove())}}),o.includes("`")&&(d=dn(s),d.forEach(f=>{let m=f.nodeValue.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");/`[^`]+`/g.test(m)&&(m=m.replaceAll(/(`[^]+?`)/g,"<code>$1</code>")),nt.innerHTML=m,f.replaceWith(...nt.childNodes)})),/twitter\.com/i.test(o)&&(d=dn(s,{rejectFilter:["A"]}),d.forEach(f=>{let m=f.nodeValue.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");/@[a-zA-Z0-9_]+@twitter\.com/g.test(m)&&(m=m.replaceAll(/(@([a-zA-Z0-9_]+)@twitter\.com)/g,'<a href="https://twitter.com/$2" rel="nofollow noopener noreferrer" target="_blank">$1</a>')),nt.innerHTML=m,f.replaceWith(...nt.childNodes)})),o.includes("#")){let f=null;const m=[...s.querySelectorAll("p")].filter((p,h)=>{let g=0;for(let b=0;b<p.childNodes.length;b++){const v=p.childNodes[b];if(v.nodeType===Node.TEXT_NODE){if(v.textContent.trim()!=="")return!1}else if(v.tagName!=="BR")if(v.tagName==="A"){const y=v.textContent.trim();if(!y||!y.startsWith("#"))return!1;g++}else return!1}if(g>3||g>1&&f&&h===f+1)return f=h,!0});m!=null&&m.length&&m.forEach(p=>{p.classList.add("hashtag-stuffing"),p.title=p.innerText})}return r&&queueMicrotask(()=>r(s)),o=s.innerHTML,o}const Pa=Ye(yi),_i=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],ki=Object.fromEntries(_i.map(t=>[t,!0])),wi=/^(https?:\/\/(www\.)?|xmpp:)/,un=30;function Ei(t){var n;if(!(!t||(n=t.querySelector)!=null&&n.call(t,"*")))try{const a=t.innerText.trim(),r=(a.match(wi)||[])[0]||"";if(!r)return;const o=a.slice(r.length,r.length+un),s=a.slice(r.length+un),c=a.slice(r.length).length>un;t.innerHTML=`<span class="invisible">${r}</span><span class=${c?"ellipsis":""}>${o}</span><span class="invisible">${s}</span>`}catch{}}function dn(t,n={}){var c;const a=[],r=Object.assign({},ki,(c=n.rejectFilter)==null?void 0:c.reduce((u,d)=>(u[d]=!0,u),{})),o=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(u){return r[u.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let s;for(;s=o.nextNode();)a.push(s);return a}const vt=document.createElement("div");function xi(t){return t?(vt.innerHTML=t.replace(/<\/p>/g,`</p>
|
||
|
||
`).replace(/<\/li>/g,`</li>
|
||
`),vt.querySelectorAll("br").forEach(n=>{n.replaceWith(`
|
||
`)}),vt.querySelectorAll(".invisible").forEach(n=>{n.remove()}),vt.querySelectorAll(".ellipsis").forEach(n=>{n.append("...")}),vt.innerText.replace(/[\r\n]{3,}/g,`
|
||
|
||
`).trim()):""}const Tn=Ye(xi);function Ti(t){const{mentions:n=[],instance:a,previewMode:r,statusURL:o}=t||{};return s=>{var m,p;let{target:c}=s;if(c=c.closest("a"),!c||s.metaKey||s.ctrlKey||s.shiftKey||s.altKey||s.which===2)return;const u=(m=c.previousSibling)==null?void 0:m.textContent,d=u==null?void 0:u.endsWith("@"),f=c.innerText.startsWith("@");if(c.classList.contains("u-url")&&f||d&&!f){const h=(c.querySelector("span")||c).innerText.trim(),g=h.replace(/^@/,""),b=c.getAttribute("href"),v=n.find(y=>y.username===g||y.acct===g||y.url===b);if(v)s.preventDefault(),s.stopPropagation(),M.showAccount={account:v.acct,instance:a};else if(!/^http/i.test(h)){s.preventDefault(),s.stopPropagation();const y=c.getAttribute("href");M.showAccount={account:y,instance:a}}}else if(!r){const h=u==null?void 0:u.endsWith("#");if(c.classList.contains("hashtag")||h){s.preventDefault(),s.stopPropagation();const g=c.innerText.replace(/^#/,"").trim(),b=a?`#/${a}/t/${g}`:`#/t/${g}`;location.hash=b}else(p=M.unfurledLinks[c.href])!=null&&p.url&&o!==c.href&&(s.preventDefault(),s.stopPropagation(),M.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${M.unfurledLinks[c.href].url}`)}}}const{locale:Li}=new Intl.DateTimeFormat().resolvedOptions(),Ai=t=>{const{dateYear:n,hideTime:a,formatOpts:r}=t||{},o=new Date().getFullYear();return Intl.DateTimeFormat(Li,{year:n===o?void 0:"numeric",month:"short",day:"numeric",hour:a?void 0:"numeric",minute:a?void 0:"numeric",...r})},Ci=Ye(Ai);function Lt(t,n){return t instanceof Date||(t=new Date(t)),Ci({dateYear:t.getFullYear(),...n}).format(t)}const{locale:Si}=Intl.NumberFormat().resolvedOptions(),Ke=Intl.NumberFormat(Si,{notation:"compact"}).format;function Fi({skeleton:t,account:n,avatarSize:a="xl",useAvatarStatic:r=!1,instance:o,external:s,internal:c,onClick:u,showActivity:d=!1,showStats:f=!1,accountInstance:m,hideDisplayName:p=!1,relationship:h={},excludeRelationshipAttrs:g=[]}){if(t)return e("div",{class:"account-block skeleton",children:[e(Ge,{size:a}),e("span",{children:[e("b",{children:"████████"}),e("br",{}),e("span",{class:"account-block-acct",children:"@██████"})]})]});if(!n)return null;const{id:b,acct:v,avatar:y,avatarStatic:E,displayName:L,username:w,emojis:k,url:F,statusesCount:O,lastStatusAt:$,bot:C,fields:z,note:R,group:B,followersCount:H,createdAt:W}=n;let[pe,le,Y]=v.match(/([^@]+)(@.+)/i)||[,v];m&&(Y=`@${m}`);const te=z==null?void 0:z.find(A=>!!A.verifiedAt&&!!A.value),re={};for(const A in h)g.includes(A)||(re[A]=h[A]);const fe=re.following||re.followedBy||re.requested;return e("a",{class:"account-block",href:F,target:s?"_blank":null,title:`@${v}`,onClick:A=>{if(!s){if(A.preventDefault(),u)return u(A);c?location.hash=`/${o}/a/${b}`:M.showAccount={account:n,instance:o}}},children:[e(Ge,{url:r?E:y||E,size:a,squircle:C}),e("span",{class:"account-block-content",children:[!p&&e(K,{children:L?e("b",{children:e(xt,{text:L,emojis:k})}):e("b",{children:w})})," ",e("span",{class:"account-block-acct",children:["@",le,e("wbr",{}),Y]}),d&&e(K,{children:[e("br",{}),e("small",{class:"last-status-at insignificant",children:["Posts: ",O,!!$&&e(K,{children:[" ","· Last posted:"," ",Lt($,{hideTime:!0})]})]})]}),f&&e("div",{class:"account-block-stats",children:[C&&e(K,{children:e("span",{class:"tag collapsed",children:[e(x,{icon:"bot"})," Automated"]})}),!!B&&e(K,{children:e("span",{class:"tag collapsed",children:[e(x,{icon:"group"})," Group"]})}),fe&&e("div",{class:"shazam-container-horizontal",children:e("div",{class:"shazam-container-inner",children:re.following&&re.followedBy?e("span",{class:"tag minimal",children:"Mutual"}):re.requested?e("span",{class:"tag minimal",children:"Requested"}):re.following?e("span",{class:"tag minimal",children:"Following"}):re.followedBy?e("span",{class:"tag minimal",children:"Follows you"}):null})},h.id),!!H&&e("span",{class:"ib",children:[Ke(H)," ",H===1?"follower":"followers"]}),!!te&&e("span",{class:"verified-field",children:[e(x,{icon:"check-circle",size:"s"})," ",e("span",{dangerouslySetInnerHTML:{__html:Pa(te.value,{emojis:k})}})]}),!C&&!B&&!fe&&!H&&!te&&!!W&&e("span",{class:"created-at",children:["Joined"," ",e("time",{datetime:W,children:Lt(W,{hideTime:!0})})]})]})]})]})}const $i={"@mastodon/edit-media-attributes":">=4.1","@mastodon/list-exclusive":">=4.2"},mn={};function Ra(t){try{const{version:n,domain:a}=wa(),r=`${a}-${t}`;if(mn[r])return mn[r];const o=$i[t];return o?mn[r]=yo(n,o,{includePrerelease:!0,loose:!0}):!1}catch{return!1}}const Pi=[{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"}];var Ri={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{PHANPY_LINGVA_INSTANCES:ea}=Ri,wt=ea?ea.split(/\s+/):[],Ii=pa({limit:1,interval:2e3});let hn=0;function Di(t,n,a){return _o(()=>{let o=wt[hn];return fetch(`https://${o}/api/v1/${n}/${a}/${encodeURIComponent(t)}`).then(s=>{if(!s.ok)throw new Error(s.statusText);return s.json()}).then(s=>{var c;return{provider:"lingva",content:s.translation,detectedSourceLanguage:(c=s.info)==null?void 0:c.detectedSource,info:s.info}})},{retries:3,onFailedAttempt:o=>{hn=(hn+1)%wt.length}})}const Ia=1e3*60*60,Da=Gt(Di,{maxAge:Ia}),Mi=Gt(Ii(Da),{maxAge:Ia});function Oi({forceTranslate:t,sourceLanguage:n,onTranslate:a,text:r="",mini:o}){const s=$a(!0),[c,u]=Q("default"),[d,f]=Q(null),[m,p]=Q(null),[h,g]=Q(null),b=ee(),v=n?ln(n):null,y=ln(s),E=ee("auto");a||(a=o?Mi:Da);const L=async()=>{var w,k;u("loading");try{const{content:F,detectedSourceLanguage:O,provider:$,error:C,...z}=await a(r,E.current,s);if(F){if(O){const R=ln(O);g(R)}if($==="lingva"){const R=(k=(w=z==null?void 0:z.info)==null?void 0:w.pronunciation)==null?void 0:k.query;R&&f(R)}p(F),u("default"),!o&&F.trim()!==r.trim()&&(b.current.open=!0,b.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else u("error")}catch{u("error")}};return ve(()=>{t&&L()},[t]),o?m&&m.trim()!==r.trim()&&h!==y?e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"status-translation-block-mini",children:[e(x,{icon:"translate",alt:`Auto-translated from ${v}`}),e("output",{lang:s,dir:"auto",title:d||"",children:m})]})})}):null:e("div",{class:"status-translation-block",onClick:w=>{w.preventDefault()},children:e("details",{ref:b,children:[e("summary",{children:e("button",{type:"button",onClick:async w=>{w.preventDefault(),w.stopPropagation(),b.current.open=!b.current.open,c!=="loading"&&(m||L())},children:[e(x,{icon:"translate"})," ",e("span",{children:c==="loading"?"Translating…":n&&v&&!h?`Translate from ${v}`:"Translate"})]})}),e("div",{class:"translated-block",children:[e("div",{class:"translation-info insignificant",children:[e("select",{class:"translated-source-select",disabled:c==="loading",onChange:w=>{E.current=w.target.value,L()},children:Pi.map(w=>e("option",{value:w.code,children:w.code==="auto"?`Auto (${h??"…"})`:w.name}))})," ",e("span",{children:["→ ",y]}),e(Jt,{abrupt:!0,hidden:c!=="loading"})]}),c==="error"?e("p",{class:"ui-state",children:"Failed to translate"}):!!m&&e(K,{children:[e("output",{class:"translated-content",lang:s,dir:"auto",children:m}),!!d&&e("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:w=>{w.target.classList.toggle("expand")},children:d})]})]})]})})}const zi=wt!=null&&wt.length?Oi:()=>null,Ln=[["aa","Afar","Afaraf"],["ab","Abkhaz","аҧсуа бызшәа"],["ae","Avestan","avesta"],["af","Afrikaans","Afrikaans"],["ak","Akan","Akan"],["am","Amharic","አማርኛ"],["an","Aragonese","aragonés"],["ar","Arabic","اللغة العربية"],["as","Assamese","অসমীয়া"],["av","Avaric","авар мацӀ"],["ay","Aymara","aymar aru"],["az","Azerbaijani","azərbaycan dili"],["ba","Bashkir","башҡорт теле"],["be","Belarusian","беларуская мова"],["bg","Bulgarian","български език"],["bh","Bihari","भोजपुरी"],["bi","Bislama","Bislama"],["bm","Bambara","bamanankan"],["bn","Bengali","বাংলা"],["bo","Tibetan","བོད་ཡིག"],["br","Breton","brezhoneg"],["bs","Bosnian","bosanski jezik"],["ca","Catalan","Català"],["ce","Chechen","нохчийн мотт"],["ch","Chamorro","Chamoru"],["co","Corsican","corsu"],["cr","Cree","ᓀᐦᐃᔭᐍᐏᐣ"],["cs","Czech","čeština"],["cu","Old Church Slavonic","ѩзыкъ словѣньскъ"],["cv","Chuvash","чӑваш чӗлхи"],["cy","Welsh","Cymraeg"],["da","Danish","dansk"],["de","German","Deutsch"],["dv","Divehi","Dhivehi"],["dz","Dzongkha","རྫོང་ཁ"],["ee","Ewe","Eʋegbe"],["el","Greek","Ελληνικά"],["en","English","English"],["eo","Esperanto","Esperanto"],["es","Spanish","Español"],["et","Estonian","eesti"],["eu","Basque","euskara"],["fa","Persian","فارسی"],["ff","Fula","Fulfulde"],["fi","Finnish","suomi"],["fj","Fijian","Vakaviti"],["fo","Faroese","føroyskt"],["fr","French","Français"],["fy","Western Frisian","Frysk"],["ga","Irish","Gaeilge"],["gd","Scottish Gaelic","Gàidhlig"],["gl","Galician","galego"],["gu","Gujarati","ગુજરાતી"],["gv","Manx","Gaelg"],["ha","Hausa","هَوُسَ"],["he","Hebrew","עברית"],["hi","Hindi","हिन्दी"],["ho","Hiri Motu","Hiri Motu"],["hr","Croatian","Hrvatski"],["ht","Haitian","Kreyòl ayisyen"],["hu","Hungarian","magyar"],["hy","Armenian","Հայերեն"],["hz","Herero","Otjiherero"],["ia","Interlingua","Interlingua"],["id","Indonesian","Bahasa Indonesia"],["ie","Interlingue","Interlingue"],["ig","Igbo","Asụsụ Igbo"],["ii","Nuosu","ꆈꌠ꒿ Nuosuhxop"],["ik","Inupiaq","Iñupiaq"],["io","Ido","Ido"],["is","Icelandic","Íslenska"],["it","Italian","Italiano"],["iu","Inuktitut","ᐃᓄᒃᑎᑐᑦ"],["ja","Japanese","日本語"],["jv","Javanese","basa Jawa"],["ka","Georgian","ქართული"],["kg","Kongo","Kikongo"],["ki","Kikuyu","Gĩkũyũ"],["kj","Kwanyama","Kuanyama"],["kk","Kazakh","қазақ тілі"],["kl","Kalaallisut","kalaallisut"],["km","Khmer","ខេមរភាសា"],["kn","Kannada","ಕನ್ನಡ"],["ko","Korean","한국어"],["kr","Kanuri","Kanuri"],["ks","Kashmiri","कश्मीरी"],["ku","Kurmanji (Kurdish)","Kurmancî"],["kv","Komi","коми кыв"],["kw","Cornish","Kernewek"],["ky","Kyrgyz","Кыргызча"],["la","Latin","latine"],["lb","Luxembourgish","Lëtzebuergesch"],["lg","Ganda","Luganda"],["li","Limburgish","Limburgs"],["ln","Lingala","Lingála"],["lo","Lao","ລາວ"],["lt","Lithuanian","lietuvių kalba"],["lu","Luba-Katanga","Tshiluba"],["lv","Latvian","latviešu valoda"],["mg","Malagasy","fiteny malagasy"],["mh","Marshallese","Kajin M̧ajeļ"],["mi","Māori","te reo Māori"],["mk","Macedonian","македонски јазик"],["ml","Malayalam","മലയാളം"],["mn","Mongolian","Монгол хэл"],["mr","Marathi","मराठी"],["ms","Malay","Bahasa Melayu"],["mt","Maltese","Malti"],["my","Burmese","ဗမာစာ"],["na","Nauru","Ekakairũ Naoero"],["nb","Norwegian Bokmål","Norsk bokmål"],["nd","Northern Ndebele","isiNdebele"],["ne","Nepali","नेपाली"],["ng","Ndonga","Owambo"],["nl","Dutch","Nederlands"],["nn","Norwegian Nynorsk","Norsk Nynorsk"],["no","Norwegian","Norsk"],["nr","Southern Ndebele","isiNdebele"],["nv","Navajo","Diné bizaad"],["ny","Chichewa","chiCheŵa"],["oc","Occitan","occitan"],["oj","Ojibwe","ᐊᓂᔑᓈᐯᒧᐎᓐ"],["om","Oromo","Afaan Oromoo"],["or","Oriya","ଓଡ଼ିଆ"],["os","Ossetian","ирон æвзаг"],["pa","Panjabi","ਪੰਜਾਬੀ"],["pi","Pāli","पाऴि"],["pl","Polish","Polski"],["ps","Pashto","پښتو"],["pt","Portuguese","Português"],["qu","Quechua","Runa Simi"],["rm","Romansh","rumantsch grischun"],["rn","Kirundi","Ikirundi"],["ro","Romanian","Română"],["ru","Russian","Русский"],["rw","Kinyarwanda","Ikinyarwanda"],["sa","Sanskrit","संस्कृतम्"],["sc","Sardinian","sardu"],["sd","Sindhi","सिन्धी"],["se","Northern Sami","Davvisámegiella"],["sg","Sango","yângâ tî sängö"],["si","Sinhala","සිංහල"],["sk","Slovak","slovenčina"],["sl","Slovenian","slovenščina"],["sn","Shona","chiShona"],["so","Somali","Soomaaliga"],["sq","Albanian","Shqip"],["sr","Serbian","српски језик"],["ss","Swati","SiSwati"],["st","Southern Sotho","Sesotho"],["su","Sundanese","Basa Sunda"],["sv","Swedish","Svenska"],["sw","Swahili","Kiswahili"],["ta","Tamil","தமிழ்"],["te","Telugu","తెలుగు"],["tg","Tajik","тоҷикӣ"],["th","Thai","ไทย"],["ti","Tigrinya","ትግርኛ"],["tk","Turkmen","Türkmen"],["tl","Tagalog","Wikang Tagalog"],["tn","Tswana","Setswana"],["to","Tonga","faka Tonga"],["tr","Turkish","Türkçe"],["ts","Tsonga","Xitsonga"],["tt","Tatar","татар теле"],["tw","Twi","Twi"],["ty","Tahitian","Reo Tahiti"],["ug","Uyghur","ئۇيغۇرچە"],["uk","Ukrainian","Українська"],["ur","Urdu","اردو"],["uz","Uzbek","Ўзбек"],["ve","Venda","Tshivenḓa"],["vi","Vietnamese","Tiếng Việt"],["vo","Volapük","Volapük"],["wa","Walloon","walon"],["wo","Wolof","Wollof"],["xh","Xhosa","isiXhosa"],["yi","Yiddish","ייִדיש"],["yo","Yoruba","Yorùbá"],["za","Zhuang","Saɯ cueŋƅ"],["zh","Chinese","中文"],["zu","Zulu","isiZulu"],["zh-CN","Chinese (China)","简体中文"],["zh-HK","Chinese (Hong Kong)","繁體中文(香港)"],["zh-TW","Chinese (Taiwan)","繁體中文(臺灣)"],["zh-YUE","Cantonese","廣東話"],["ast","Asturian","Asturianu"],["chr","Cherokee","ᏣᎳᎩ ᎦᏬᏂᎯᏍᏗ"],["ckb","Sorani (Kurdish)","سۆرانی"],["cnr","Montenegrin","crnogorski"],["jbo","Lojban","la .lojban."],["kab","Kabyle","Taqbaylit"],["ldn","Láadan","Láadan"],["lfn","Lingua Franca Nova","lingua franca nova"],["sco","Scots","Scots"],["sma","Southern Sami","Åarjelsaemien Gïele"],["smj","Lule Sami","Julevsámegiella"],["szl","Silesian","ślůnsko godka"],["tok","Toki Pona","toki pona"],["xal","Kalmyk","Хальмг келн"],["zba","Balaibalan","باليبلن"],["zgh","Standard Moroccan Tamazight","ⵜⴰⵎⴰⵣⵉⵖⵜ"]],Ni="(((?:[^A-Za-z0-9@@$##\\uFFFE\\uFEFF\\uFFFF]|[\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069]|^))((https?:\\/\\/)((?:(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:[_-]|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)*(?:(?:[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/](?:-|[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/])*)?[^/\\!'#%&'\\(\\)*\\+,\\\\\\-\\.\\/:;<=>\\?@\\[\\]\\^_{|}~\\$//\\x09-\\x0D\\x20\\x85\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000//\\uFFFE\\uFEFF\\uFFFF//\\u202A-\\u202E\\u061C\\u200E\\u200F\\u2066\\u2067\\u2068\\u2069/]\\.)(?:(?:(?:삼성|닷컴|닷넷|香格里拉|餐厅|食品|飞利浦|電訊盈科|集团|通販|购物|谷歌|诺基亚|联通|网络|网站|网店|网址|组织机构|移动|珠宝|点看|游戏|淡马锡|机构|書籍|时尚|新闻|政府|政务|招聘|手表|手机|我爱你|慈善|微博|广东|工行|家電|娱乐|天主教|大拿|大众汽车|在线|嘉里大酒店|嘉里|商标|商店|商城|公益|公司|八卦|健康|信息|佛山|企业|中文网|中信|世界|ポイント|ファッション|セール|ストア|コム|グーグル|クラウド|みんな|คอม|संगठन|नेट|कॉम|همراه|موقع|موبايلي|كوم|كاثوليك|عرب|شبكة|بيتك|بازار|العليان|ارامكو|اتصالات|ابوظبي|קום|сайт|рус|орг|онлайн|москва|ком|католик|дети|zuerich|zone|zippo|zip|zero|zara|zappos|yun|youtube|you|yokohama|yoga|yodobashi|yandex|yamaxun|yahoo|yachts|xyz|xxx|xperia|xin|xihuan|xfinity|xerox|xbox|wtf|wtc|wow|world|works|work|woodside|wolterskluwer|wme|winners|wine|windows|win|williamhill|wiki|wien|whoswho|weir|weibo|wedding|wed|website|weber|webcam|weatherchannel|weather|watches|watch|warman|wanggou|wang|walter|walmart|wales|vuelos|voyage|voto|voting|vote|volvo|volkswagen|vodka|vlaanderen|vivo|viva|vistaprint|vista|vision|visa|virgin|vip|vin|villas|viking|vig|video|viajes|vet|versicherung|vermögensberatung|vermögensberater|verisign|ventures|vegas|vanguard|vana|vacations|ups|uol|uno|university|unicom|uconnect|ubs|ubank|tvs|tushu|tunes|tui|tube|trv|trust|travelersinsurance|travelers|travelchannel|travel|training|trading|trade|toys|toyota|town|tours|total|toshiba|toray|top|tools|tokyo|today|tmall|tkmaxx|tjx|tjmaxx|tirol|tires|tips|tiffany|tienda|tickets|tiaa|theatre|theater|thd|teva|tennis|temasek|telefonica|telecity|tel|technology|tech|team|tdk|tci|taxi|tax|tattoo|tatar|tatamotors|target|taobao|talk|taipei|tab|systems|symantec|sydney|swiss|swiftcover|swatch|suzuki|surgery|surf|support|supply|supplies|sucks|style|study|studio|stream|store|storage|stockholm|stcgroup|stc|statoil|statefarm|statebank|starhub|star|staples|stada|srt|srl|spreadbetting|spot|sport|spiegel|space|soy|sony|song|solutions|solar|sohu|software|softbank|social|soccer|sncf|smile|smart|sling|skype|sky|skin|ski|site|singles|sina|silk|shriram|showtime|show|shouji|shopping|shop|shoes|shiksha|shia|shell|shaw|sharp|shangrila|sfr|sexy|sex|sew|seven|ses|services|sener|select|seek|security|secure|seat|search|scot|scor|scjohnson|science|schwarz|schule|school|scholarships|schmidt|schaeffler|scb|sca|sbs|sbi|saxo|save|sas|sarl|sapo|sap|sanofi|sandvikcoromant|sandvik|samsung|samsclub|salon|sale|sakura|safety|safe|saarland|ryukyu|rwe|run|ruhr|rugby|rsvp|room|rogers|rodeo|rocks|rocher|rmit|rip|rio|ril|rightathome|ricoh|richardli|rich|rexroth|reviews|review|restaurant|rest|republican|report|repair|rentals|rent|ren|reliance|reit|reisen|reise|rehab|redumbrella|redstone|red|recipes|realty|realtor|realestate|read|raid|radio|racing|qvc|quest|quebec|qpon|pwc|pub|prudential|pru|protection|property|properties|promo|progressive|prof|productions|prod|pro|prime|press|praxi|pramerica|post|porn|politie|poker|pohl|pnc|plus|plumbing|playstation|play|place|pizza|pioneer|pink|ping|pin|pid|pictures|pictet|pics|piaget|physio|photos|photography|photo|phone|philips|phd|pharmacy|pfizer|pet|pccw|pay|passagens|party|parts|partners|pars|paris|panerai|panasonic|pamperedchef|page|ovh|ott|otsuka|osaka|origins|orientexpress|organic|org|orange|oracle|open|ooo|onyourside|online|onl|ong|one|omega|ollo|oldnavy|olayangroup|olayan|okinawa|office|off|observer|obi|nyc|ntt|nrw|nra|nowtv|nowruz|now|norton|northwesternmutual|nokia|nissay|nissan|ninja|nikon|nike|nico|nhk|ngo|nfl|nexus|nextdirect|next|news|newholland|new|neustar|network|netflix|netbank|net|nec|nba|navy|natura|nationwide|name|nagoya|nadex|nab|mutuelle|mutual|museum|mtr|mtpc|mtn|msd|movistar|movie|mov|motorcycles|moto|moscow|mortgage|mormon|mopar|montblanc|monster|money|monash|mom|moi|moe|moda|mobily|mobile|mobi|mma|mls|mlb|mitsubishi|mit|mint|mini|mil|microsoft|miami|metlife|merckmsd|meo|menu|men|memorial|meme|melbourne|meet|media|med|mckinsey|mcdonalds|mcd|mba|mattel|maserati|marshalls|marriott|markets|marketing|market|map|mango|management|man|makeup|maison|maif|madrid|macys|luxury|luxe|lupin|lundbeck|ltda|ltd|lplfinancial|lpl|love|lotto|lotte|london|lol|loft|locus|locker|loans|loan|llp|llc|lixil|living|live|lipsy|link|linde|lincoln|limo|limited|lilly|like|lighting|lifestyle|lifeinsurance|life|lidl|liaison|lgbt|lexus|lego|legal|lefrak|leclerc|lease|lds|lawyer|law|latrobe|latino|lat|lasalle|lanxess|landrover|land|lancome|lancia|lancaster|lamer|lamborghini|ladbrokes|lacaixa|kyoto|kuokgroup|kred|krd|kpn|kpmg|kosher|komatsu|koeln|kiwi|kitchen|kindle|kinder|kim|kia|kfh|kerryproperties|kerrylogistics|kerryhotels|kddi|kaufen|juniper|juegos|jprs|jpmorgan|joy|jot|joburg|jobs|jnj|jmp|jll|jlc|jio|jewelry|jetzt|jeep|jcp|jcb|java|jaguar|iwc|iveco|itv|itau|istanbul|ist|ismaili|iselect|irish|ipiranga|investments|intuit|international|intel|int|insure|insurance|institute|ink|ing|info|infiniti|industries|inc|immobilien|immo|imdb|imamat|ikano|iinet|ifm|ieee|icu|ice|icbc|ibm|hyundai|hyatt|hughes|htc|hsbc|how|house|hotmail|hotels|hoteles|hot|hosting|host|hospital|horse|honeywell|honda|homesense|homes|homegoods|homedepot|holiday|holdings|hockey|hkt|hiv|hitachi|hisamitsu|hiphop|hgtv|hermes|here|helsinki|help|healthcare|health|hdfcbank|hdfc|hbo|haus|hangout|hamburg|hair|guru|guitars|guide|guge|gucci|guardian|group|grocery|gripe|green|gratis|graphics|grainger|gov|got|gop|google|goog|goodyear|goodhands|goo|golf|goldpoint|gold|godaddy|gmx|gmo|gmbh|gmail|globo|global|gle|glass|glade|giving|gives|gifts|gift|ggee|george|genting|gent|gea|gdn|gbiz|gay|garden|gap|games|game|gallup|gallo|gallery|gal|fyi|futbol|furniture|fund|fun|fujixerox|fujitsu|ftr|frontier|frontdoor|frogans|frl|fresenius|free|fox|foundation|forum|forsale|forex|ford|football|foodnetwork|food|foo|fly|flsmidth|flowers|florist|flir|flights|flickr|fitness|fit|fishing|fish|firmdale|firestone|fire|financial|finance|final|film|fido|fidelity|fiat|ferrero|ferrari|feedback|fedex|fast|fashion|farmers|farm|fans|fan|family|faith|fairwinds|fail|fage|extraspace|express|exposed|expert|exchange|everbank|events|eus|eurovision|etisalat|esurance|estate|esq|erni|ericsson|equipment|epson|epost|enterprises|engineering|engineer|energy|emerck|email|education|edu|edeka|eco|eat|earth|dvr|dvag|durban|dupont|duns|dunlop|duck|dubai|dtv|drive|download|dot|doosan|domains|doha|dog|dodge|doctor|docs|dnp|diy|dish|discover|discount|directory|direct|digital|diet|diamonds|dhl|dev|design|desi|dentist|dental|democrat|delta|deloitte|dell|delivery|degree|deals|dealer|deal|dds|dclk|day|datsun|dating|date|data|dance|dad|dabur|cyou|cymru|cuisinella|csc|cruises|cruise|crs|crown|cricket|creditunion|creditcard|credit|cpa|courses|coupons|coupon|country|corsica|coop|cool|cookingchannel|cooking|contractors|contact|consulting|construction|condos|comsec|computer|compare|company|community|commbank|comcast|com|cologne|college|coffee|codes|coach|clubmed|club|cloud|clothing|clinique|clinic|click|cleaning|claims|cityeats|city|citic|citi|citadel|cisco|circle|cipriani|church|chrysler|chrome|christmas|chloe|chintai|cheap|chat|chase|charity|channel|chanel|cfd|cfa|cern|ceo|center|ceb|cbs|cbre|cbn|cba|catholic|catering|cat|casino|cash|caseih|case|casa|cartier|cars|careers|career|care|cards|caravan|car|capitalone|capital|capetown|canon|cancerresearch|camp|camera|cam|calvinklein|call|cal|cafe|cab|bzh|buzz|buy|business|builders|build|bugatti|budapest|brussels|brother|broker|broadway|bridgestone|bradesco|box|boutique|bot|boston|bostik|bosch|boots|booking|book|boo|bond|bom|bofa|boehringer|boats|bnpparibas|bnl|bmw|bms|blue|bloomberg|blog|blockbuster|blanco|blackfriday|black|biz|bio|bingo|bing|bike|bid|bible|bharti|bet|bestbuy|best|berlin|bentley|beer|beauty|beats|bcn|bcg|bbva|bbt|bbc|bayern|bauhaus|basketball|baseball|bargains|barefoot|barclays|barclaycard|barcelona|bar|bank|band|bananarepublic|banamex|baidu|baby|azure|axa|aws|avianca|autos|auto|author|auspost|audio|audible|audi|auction|attorney|athleta|associates|asia|asda|arte|art|arpa|army|archi|aramco|arab|aquarelle|apple|app|apartments|aol|anz|anquan|android|analytics|amsterdam|amica|amfam|amex|americanfamily|americanexpress|alstom|alsace|ally|allstate|allfinanz|alipay|alibaba|alfaromeo|akdn|airtel|airforce|airbus|aigo|aig|agency|agakhan|africa|afl|afamilycompany|aetna|aero|aeg|adult|ads|adac|actor|active|aco|accountants|accountant|accenture|academy|abudhabi|abogado|able|abc|abbvie|abbott|abb|abarth|aarp|aaa|onion)(?=[^0-9a-zA-Z@+-]|$))|(?:(?:한국|香港|澳門|新加坡|台灣|台湾|中國|中国|გე|ລາວ|ไทย|ලංකා|ഭാരതം|ಭಾರತ|భారత్|சிங்கப்பூர்|இலங்கை|இந்தியா|ଭାରତ|ભારત|ਭਾਰਤ|ভাৰত|ভারত|বাংলা|भारोत|भारतम्|भारत|ڀارت|پاکستان|موريتانيا|مليسيا|مصر|قطر|فلسطين|عمان|عراق|سورية|سودان|تونس|بھارت|بارت|ایران|امارات|المغرب|السعودية|الجزائر|البحرين|الاردن|հայ|қаз|укр|срб|рф|мон|мкд|ею|бел|бг|ευ|ελ|zw|zm|za|yt|ye|ws|wf|vu|vn|vi|vg|ve|vc|va|uz|uy|us|um|uk|ug|ua|tz|tw|tv|tt|tr|tp|to|tn|tm|tl|tk|tj|th|tg|tf|td|tc|sz|sy|sx|sv|su|st|ss|sr|so|sn|sm|sl|sk|sj|si|sh|sg|se|sd|sc|sb|sa|rw|ru|rs|ro|re|qa|py|pw|pt|ps|pr|pn|pm|pl|pk|ph|pg|pf|pe|pa|om|nz|nu|nr|np|no|nl|ni|ng|nf|ne|nc|na|mz|my|mx|mw|mv|mu|mt|ms|mr|mq|mp|mo|mn|mm|ml|mk|mh|mg|mf|me|md|mc|ma|ly|lv|lu|lt|ls|lr|lk|li|lc|lb|la|kz|ky|kw|kr|kp|kn|km|ki|kh|kg|ke|jp|jo|jm|je|it|is|ir|iq|io|in|im|il|ie|id|hu|ht|hr|hn|hm|hk|gy|gw|gu|gt|gs|gr|gq|gp|gn|gm|gl|gi|gh|gg|gf|ge|gd|gb|ga|fr|fo|fm|fk|fj|fi|eu|et|es|er|eh|eg|ee|ec|dz|do|dm|dk|dj|de|cz|cy|cx|cw|cv|cu|cr|co|cn|cm|cl|ck|ci|ch|cg|cf|cd|cc|ca|bz|by|bw|bv|bt|bs|br|bq|bo|bn|bm|bl|bj|bi|bh|bg|bf|be|bd|bb|ba|az|ax|aw|au|at|as|ar|aq|ao|an|am|al|ai|ag|af|ae|ad|ac)(?=[^0-9a-zA-Z@+-]|$))|(?:xn--[\\-0-9a-z]+))))(?::([0-9]+))?(\\/(?:(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*)*[\\+\\-a-z\\u0400-\\u04FF0-9=_#\\/\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]|(?:\\((?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+|(?:[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*\\([a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\)[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]*))\\)))|(?:@[a-z\\u0400-\\u04FF0-9!\\*';:=\\+,\\.\\$\\/%#\\[\\]\\-\\u2013_~@\\|&\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\xFF\\u0100-\\u024F\\u0253\\u0254\\u0256\\u0257\\u0259\\u025B\\u0263\\u0268\\u026F\\u0272\\u0289\\u028B\\u02BB\\u0300-\\u036F\\u1E00-\\u1EFF]+\\/))*)?(\\?[a-z0-9!?\\*'@\\(\\);:&=\\+\\$\\/%#\\[\\]\\-_\\.,~|]*[a-z0-9\\-_&=#\\/])?))",Bi="gi",ta={source:Ni,flags:Bi},Ze=ko("drafts-db","drafts-store"),Vi={set:(t,n)=>wo(t,n,Ze),get:t=>Eo(t,Ze),getMany:t=>xo(t,Ze),del:t=>To(t,Ze),delMany:t=>Lo(t,Ze),clear:()=>Ao(Ze),keys:()=>Co(Ze)},na={drafts:Vi},ot={public:"earth",unlisted:"group",private:"lock",direct:"message"};function Ui({poll:t,lang:n,readOnly:a,refresh:r=()=>{},votePoll:o=()=>{}}){const[s,c]=Q("default"),{expired:u,expiresAt:d,id:f,multiple:m,options:p,ownVotes:h,voted:g,votersCount:b,votesCount:v,emojis:y}=t,E=!!d&&new Date(d),L=b||v;let w=0;L<=1e3?w=0:L<=1e4?w=1:L<=1e5&&(w=2);const[k,F]=Q(!1),O=p.every($=>$.votesCount!==null);return e("div",{lang:n,dir:"auto",class:`poll ${a?"read-only":""} ${s==="loading"?"loading":""}`,children:[k&&O||g||u?e(K,{children:[e("div",{class:"poll-options",children:p.map(($,C)=>{const{title:z,votesCount:R}=$,B=L?(R/L*100).toFixed(w):0,H=R>0&&R===Math.max(...p.map(W=>W.votesCount));return e("div",{class:`poll-option poll-result ${H?"poll-option-leading":""}`,style:{"--percentage":`${B}%`},children:[e("div",{class:"poll-option-title",children:[e("span",{children:e(xt,{text:z,emojis:y})}),g&&h.includes(C)&&e(K,{children:[" ",e(x,{icon:"check-circle"})]})]}),e("div",{class:"poll-option-votes",title:`${R} vote${R===1?"":"s"}`,children:[B,"%"]})]},`${C}-${z}-${R}`)})}),!u&&!g&&e("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:$=>{$.preventDefault(),F(!1)},children:[e(x,{icon:"arrow-left",size:"s"})," Hide results"]})]}):e("form",{onSubmit:async $=>{$.preventDefault();const C=$.target,z=new FormData(C),R=[];z.forEach((B,H)=>{H==="poll"&&R.push(B)}),R.length&&(c("loading"),await o(R),c("default"))},children:[e("div",{class:"poll-options",children:p.map(($,C)=>{const{title:z}=$;return e("div",{class:"poll-option",children:e("label",{class:"poll-label",children:[e("input",{type:m?"checkbox":"radio",name:"poll",value:C,disabled:s==="loading",readOnly:a}),e("span",{class:"poll-option-title",children:e(xt,{text:z,emojis:y})})]})})})}),!a&&e("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:"Vote"})]}),e("p",{class:"poll-meta",children:[!u&&!a&&e("button",{type:"button",class:"plain small",disabled:s==="loading",style:{marginLeft:-8},onClick:$=>{$.preventDefault(),c("loading"),(async()=>(await r(),c("default")))()},title:"Refresh",children:e(x,{icon:"refresh",alt:"Refresh"})}),!g&&!u&&!a&&O&&e("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:$=>{$.preventDefault(),F(!k)},title:k?"Hide results":"Show results",children:[e(x,{icon:k?"eye-open":"eye-close",alt:k?"Hide results":"Show results"})," "]}),!u&&!a&&" ",e("span",{title:v,children:Ke(v)})," vote",v===1?"":"s",!!b&&b!==v&&e(K,{children:[" ","• ",e("span",{title:b,children:Ke(b)})," ","voter",b===1?"":"s"]})," ","• ",u?"Ended":"Ending"," ",!!E&&e(Tt,{datetime:E})]})," "]})}const ji=So();function Hi(t,n){if(!(t!=null&&t.length))return!1;const a=t.filter(s=>{const{filter:c}=s,u=c.context.includes(n);return u?c.expiresAt?new Date(c.expiresAt)>new Date:u:!1});if(!a.length)return!1;if(a.some(s=>s.filter.filterAction==="hide"))return{action:"hide"};if(a.some(s=>s.filter.filterAction==="warn")){const s=a.map(c=>c.filter.title);return{action:"warn",titles:s,titlesStr:s.join(" • ")}}return!1}const Ma=Ye(Hi);function qi(t,n,a){var c;const{filtered:r}=t;if(!(r!=null&&r.length)||a&&((c=t.account)==null?void 0:c.id)===a)return!0;const s=Ma(r,n);return s?s.action!=="hide":!0}function Or(t,n){if(!(t!=null&&t.length))return[];if(!n)return t;const a=N.session.get("currentAccount");return t.filter(r=>qi(r,n,a))}const pn=document.createElement("div");function fn(t){return t?(pn.innerHTML=t,pn.querySelectorAll(".invisible").forEach(n=>{n.remove()}),pn.innerText.length):0}const _t="speechSynthesis"in window;function aa(t,n){if(_t)try{speechSynthesis.speaking&&speechSynthesis.cancel();const a=new SpeechSynthesisUtterance(t);n&&(a.lang=n),speechSynthesis.speak(a)}catch(a){alert(a)}}function Oa(t){const{spoilerText:n,content:a,poll:r,mediaAttachments:o}=t;let s="";return n!=null&&n.trim()?s+=n:s+=Tn(a),s=s.trim(),r&&(s+=" 📊"),o!=null&&o.length&&(s+=" "+o.map(c=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[c.type]||"").join("")),s}function jt({className:t="truncated"}={}){const n=ee(),a=ba(({height:r})=>{if(n.current){const{scrollHeight:o}=n.current;let s=o>r;if(s){const{height:c,maxHeight:u}=getComputedStyle(n.current),d=parseInt(u||c,10);s=o>d}n.current.classList.toggle(t,s)}},300);return Fo({ref:n,box:"border-box",onResize:a}),n}const Ki=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Wi="ALT",gn=t=>{const{alt:n,lang:a,index:r,...o}=t;return!n||!n.trim()?null:e("button",{type:"button",class:"alt-badge clickable",...o,onClick:s=>{s.stopPropagation(),s.preventDefault(),M.showMediaAlt={alt:n,lang:a}},title:"Media description",children:[Wi,!!r&&e("sup",{children:r})]})},Gi=140,za=Ye(t=>t!=null&&t.length?t.length>Gi||/[\n\r].*[\n\r]/.test(t.trim()):!1);function Yi({class:t="",media:n,to:a,lang:r,showOriginal:o,autoAnimate:s,showCaption:c,altIndex:u,onClick:d=()=>{}}){const{blurhash:f,description:m,meta:p,previewRemoteUrl:h,previewUrl:g,remoteUrl:b,url:v,type:y}=n,{original:E={},small:L,focus:w}=p||{},k=o?E==null?void 0:E.width:L==null?void 0:L.width,F=o?E==null?void 0:E.height:L==null?void 0:L.height,O=o?v:g||v,$=o?b:h||b,C=k>=F?"landscape":"portrait",z=f?ya(f):null,R=ee();let B;if(w){const V=(w.x+1)/2*100,X=(1-w.y)/2*100;B=`${V.toFixed(0)}% ${X.toFixed(0)}%`}const H=ee(),W=kn(({x:V,y:X,scale:ge})=>{const{current:ne}=H;if(ne){const $e=$o({x:V,y:X,scale:ge});ge===1?ne.style.removeProperty("transform"):ne.style.setProperty("transform",$e),ne.closest(".media-zoom").style.touchAction=ge<=1.01?"pan-x":""}},[]),[pe,le]=Q(!1),Y={enabled:pe,draggableUnZoomed:!1,inertiaFriction:.9,doubleTapZoomOutOnMaxScale:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:W},te=Ee(()=>a?V=>e(it,{to:a,...V}):"div",[a]),re=$?new URL($):null,fe=y==="unknown"&&re&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(re.pathname),A=y==="unknown"&&re&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test(re.pathname),se=y==="image"||y==="unknown"&&g&&!fe&&!A,G=ee(),[Ae,ce]=Q(!1);bn(()=>{if(!se||!o||!G.current)return;const{offsetWidth:V,offsetHeight:X}=G.current,ge=k<V&&F<X;ge&&ce(ge)},[k,F]);const Oe=window.innerHeight*(C==="portrait"?.45:.33),Ce=C==="portrait"?0:160,Te={"--average-color":z&&`rgb(${z.join(",")})`},ze=k&&F?{"--width":`${k}px`,"--height":`${F}px`,"--aspectWidth":`${k/F*Math.max(Ce,Oe)}px`,aspectRatio:`${k} / ${F}`,...Te}:{...Te},Re=za(m),oe=!!c&&!o&&!!m&&!Re,de=oe?V=>{const{children:X,...ge}=V;return e("figure",{...ge,children:[X,e("figcaption",{class:"media-caption",lang:r,dir:"auto",onClick:ne=>{ne.preventDefault(),ne.stopPropagation(),M.showMediaAlt={alt:m,lang:r}},children:m})]})}:K;if(se)return Y.containerProps.style.display="inherit",bn(()=>{Ki&&o&&(async()=>{try{await fetch(O,{mode:"no-cors"}),H.current.src=O}catch{}})()},[O]),e(de,{children:e(te,{ref:G,class:`media media-image ${t}`,onClick:d,"data-orientation":C,"data-has-alt":!oe,style:o?{backgroundImage:`url(${g})`,backgroundSize:Ae?`${k}px ${F}px`:void 0,...Te}:ze,children:o?e(qn,{...Y,children:e("img",{ref:H,src:O,alt:m,width:k,height:F,"data-orientation":C,loading:"eager",decoding:"sync",onLoad:V=>{V.target.closest(".media-image").style.backgroundImage="",V.target.closest(".media-zoom").style.display="",le(!0)},onError:V=>{const{src:X}=V.target;X===O&&O!==$&&(V.target.src=$)}})}):e(K,{children:[e("img",{src:O,alt:oe?"":m,width:k,height:F,"data-orientation":C,loading:"lazy",style:{objectPosition:B||"center","--anim-duration":`${Math.min(Math.max(Math.max(k,F)/100,5),120)}s`},onLoad:V=>{V.target.dataset.loaded=!0},onError:V=>{const{src:X}=V.target;X===O&&O!==$&&(V.target.src=$)}}),!oe&&e(gn,{alt:m,lang:r,index:u})]})})});if(y==="gifv"||y==="video"||fe){const V=E.duration<31,X=y==="gifv"&&V,ge=E.duration<61,ne=ra(E.duration),$e=!o&&!s&&X,Le=!o&&s&&X,Se=E.duration>5,ye=`
|
||
<video
|
||
src="${v}"
|
||
poster="${g}"
|
||
width="${k}"
|
||
height="${F}"
|
||
data-orientation="${C}"
|
||
preload="auto"
|
||
autoplay
|
||
muted="${X}"
|
||
${X?"":"controls"}
|
||
playsinline
|
||
loop="${ge}"
|
||
${X?'ondblclick="this.paused ? this.play() : this.pause()"':""}
|
||
${X&&Se?"ontimeupdate=\"this.closest('.media-gif') && this.closest('.media-gif').style.setProperty('--progress', `${~~((this.currentTime / this.duration) * 100)}%`)\"":""}
|
||
></video>
|
||
`;return e(de,{children:e(te,{class:`media ${t} media-${X?"gif":"video"} ${Le?"media-contain":""} ${$e?"media-hover-animate":""}`,"data-orientation":C,"data-formatted-duration":o?void 0:ne,"data-label":X&&!o&&!Le?"GIF":"","data-has-alt":!oe,style:!o&&ze,onClick:_e=>{if($e)try{R.current.pause()}catch{}d(_e)},onMouseEnter:()=>{if($e)try{R.current.play()}catch{}},onMouseLeave:()=>{if($e)try{R.current.pause()}catch{}},onFocus:()=>{if($e)try{R.current.play()}catch{}},onBlur:()=>{if($e)try{R.current.pause()}catch{}},children:[o||Le?X&&o?e(qn,{...Y,enabled:!0,children:e("div",{ref:H,dangerouslySetInnerHTML:{__html:ye}})}):e("div",{class:"video-container",dangerouslySetInnerHTML:{__html:ye}}):X?e("video",{ref:R,src:v,poster:g,width:k,height:F,"data-orientation":C,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:Se?_e=>{const{target:ie}=_e,De=ie==null?void 0:ie.closest(".media-gif");if(De){const T=ie.currentTime/ie.duration*100;De.style.setProperty("--progress",`${T}%`)}}:void 0}):e(K,{children:[e("img",{src:g,alt:oe?"":m,width:k,height:F,"data-orientation":C,loading:"lazy"}),e("div",{class:"media-play",children:e(x,{icon:"play",size:"xl"})})]}),!o&&!oe&&e(gn,{alt:m,lang:r,index:u})]})})}else if(y==="audio"||A){const V=ra(E.duration);return e(de,{children:e(te,{class:`media media-audio ${t}`,"data-formatted-duration":o?void 0:V,"data-has-alt":!oe,onClick:d,style:!o&&ze,children:[o?e("audio",{src:b||v,preload:"none",controls:!0,autoplay:!0}):g?e("img",{src:g,alt:oe?"":m,width:k,height:F,"data-orientation":C,loading:"lazy",onError:X=>{var ge,ne;try{(ne=(ge=X.target)==null?void 0:ge.remove)==null||ne.call(ge)}catch{}}}):null,!o&&e(K,{children:[e("div",{class:"media-play",children:e(x,{icon:"play",size:"xl"})}),!oe&&e(gn,{alt:m,lang:r,index:u})]})]})})}}function oa(t){return e(Po,{children:({ref:n,closeMenu:a})=>e(it,{...t,ref:n,onClick:({detail:r})=>a(r===0?"Enter":void 0)})})}const Ji=280,Zi=140;function Xi(t,n){return n.v1.accounts.$select(t).fetch()}const Qi=Gt(Xi),kt={public:"Public",unlisted:"Unlisted",private:"Followers only",direct:"Private mention"},er=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),ia=80;function tr(t){var n;return(n=t==null?void 0:t.options)!=null&&n.length?`📊:
|
||
${t.options.map(a=>`- ${a.title}${a.votesCount>=0?` (${a.votesCount})`:""}`).join(`
|
||
`)}`:""}function vn(t){const{spoilerText:n,content:a,poll:r}=t;return(n?`${n}
|
||
|
||
`:"")+Tn(a)+tr(r)}function Qe({statusID:t,status:n,instance:a,size:r="m",contentTextWeight:o,readOnly:s,enableCommentHint:c,withinContext:u,skeleton:d,enableTranslate:f,forceTranslate:m,previewMode:p,onMediaClick:h,quoted:g,onStatusLinkClick:b=()=>{},showFollowedTags:v,allowContextMenu:y,showActionsBar:E,showReplyParent:L}){var Vn,Un,jn;if(d)return e("div",{class:"status skeleton",children:[e(Ge,{size:"xxl"}),e("div",{class:"container",children:[e("div",{class:"meta",children:"███ ████████"}),e("div",{class:"content-container",children:e("div",{class:"content",children:e("p",{children:"████ ████████"})})})]})]});const{masto:w,instance:k,authenticated:F}=We({instance:a}),{instance:O}=We(),$=k===O;let C=Pe(t||(n==null?void 0:n.id),k);const z=rt(M);if(n||(n=z.statuses[C]||z.statuses[t],C=Pe(n==null?void 0:n.id,k)),!n)return null;const{account:{acct:R,avatar:B,avatarStatic:H,id:W,url:pe,displayName:le,username:Y,emojis:te,bot:re,group:fe},id:A,repliesCount:se,reblogged:G,reblogsCount:Ae,favourited:ce,favouritesCount:Oe,bookmarked:Ce,poll:Te,muted:ze,sensitive:Re,spoilerText:oe,visibility:de,language:V,editedAt:X,filtered:ge,card:ne,createdAt:$e,inReplyToId:Le,inReplyToAccountId:Se,content:ye,mentions:_e,mediaAttachments:ie,reblog:De,uri:T,url:S,emojis:D,tags:I,_deleted:J,_pinned:j}=n,U=Ee(()=>N.session.get("currentAccount"),[]),q=Ee(()=>U&&U===W,[W,U]),me=Ro(ji),ke=!q&&!s&&!p&&Ma(ge,me);if((ke==null?void 0:ke.action)==="hide")return null;const Ne=l=>{l.shiftKey};if(r!=="l"&&ke)return e(sr,{status:n,filterInfo:ke,instance:k,containerProps:{onMouseEnter:Ne},showFollowedTags:!0});const Fe=new Date($e),Je=new Date(X);let st=_e==null?void 0:_e.find(l=>l.id===Se);!st&&Se===A&&(st={url:pe,username:Y,displayName:le});const[et,At]=Q(st);if(!u&&!et&&Se){const l=M.accounts[Se];l?At(l):Qi(Se,w).then(P=>{At(P),M.accounts[P.id]=P}).catch(P=>{})}const tt=Se===U||(_e==null?void 0:_e.find(l=>l.id===U)),ct=Ee(()=>!!(N.account.get("preferences")||{})["reading:expand:spoilers"],[]),An=Ee(()=>(N.account.get("preferences")||{})["reading:expand:media"]||"default",[]),lt=p||ct||!!z.spoilers[A],ut=p||An==="show_all"||!!z.spoilersMedia[A];if(De)return fe?e("div",{"data-state-post-id":C,class:"status-group",onMouseEnter:Ne,children:[e("div",{class:"status-pre-meta",children:[e(x,{icon:"group",size:"l",alt:"Group"})," ",e(yt,{account:n.account,instance:k,showAvatar:!0})]}),e(Qe,{status:t?null:De,statusID:t?De.id:null,instance:k,size:r,contentTextWeight:o,readOnly:s})]}):e("div",{"data-state-post-id":C,class:"status-reblog",onMouseEnter:Ne,children:[e("div",{class:"status-pre-meta",children:[e(x,{icon:"rocket",size:"l"})," ",e(yt,{account:n.account,instance:k,showAvatar:!0})," ",e("span",{children:"boosted"})]}),e(Qe,{status:t?null:De,statusID:t?De.id:null,instance:k,size:r,contentTextWeight:o,readOnly:s,enableCommentHint:!0})]});if(v&&((Vn=z.statusFollowedTags[C])!=null&&Vn.length))return e("div",{"data-state-post-id":C,class:"status-followed-tags",onMouseEnter:Ne,children:[e("div",{class:"status-pre-meta",children:[e(x,{icon:"hashtag",size:"l"})," ",z.statusFollowedTags[C].slice(0,3).map(l=>e(it,{to:k?`/${k}/t/${l}`:`/t/${l}`,class:"status-followed-tag-item",children:l},l))]}),e(Qe,{status:t?null:n,statusID:t?n.id:null,instance:k,size:r,contentTextWeight:o,readOnly:s,enableCommentHint:!0})]});const he=r==="l",[Zt,Va]=Q(m),Cn=$a(!0),Ua=z.settings.contentTranslationHideLanguages||[],{contentTranslation:Xt,contentTranslationAutoInline:Sn}=z.settings;Xt||(f=!1);const Fn=Ee(()=>{if(!Xt||!Sn||s||u&&!he||p||oe||Re||Te||ne||ie!=null&&ie.length)return!1;const l=fn(ye);return l>0&&l<=Zi},[Xt,Sn,s,u,he,p,oe,Re,Te,ne,ie,ye]),[Qt,Ct]=Q(!1),ja=jt(),Ha=jt(),qa=jt(),$n="Read more →",St=ee(null),dt="Sorry, your current logged-in instance can't interact with this post from another instance.",Pn=kn(()=>Math.max(Math.round((oe.length+fn(ye))/140)||1,1),[oe,ye]),Rn=Lt(Fe),In=X&&Lt(Je);let mt=F&&de!=="direct"&&de!=="private";de==="private"&&q&&(mt=!0);const Ft=l=>{var P;if(!$||!F)return alert(dt);(l!=null&&l.shiftKey||(P=l==null?void 0:l.syntheticEvent)!=null&&P.shiftKey)&&Ta({replyToStatus:n})||(M.showCompose={replyToStatus:n})},en=Ee(()=>ie.some(l=>{var P,Z;return!((Z=(P=l.description)==null?void 0:P.trim)!=null&&Z.call(P))}),[ie]),Fr=async()=>{if(!$||!F)return alert(dt),!1;try{if(!G){let l="Boost this post?";if(en&&(l+=`
|
||
|
||
⚠️ Some media have no descriptions.`),!confirm(l))return!1}if(M.statuses[C]={...n,reblogged:!G,reblogsCount:Ae+(G?-1:1)},G){const l=await w.v1.statuses.$select(A).unreblog();return Me(l,k),!0}else{const l=await w.v1.statuses.$select(A).reblog();return Me(l,k),!0}}catch{return M.statuses[C]=n,!1}},tn=async()=>{if(!$||!F)return alert(dt),!1;try{if(M.statuses[C]={...n,reblogged:!G,reblogsCount:Ae+(G?-1:1)},G){const l=await w.v1.statuses.$select(A).unreblog();return Me(l,k),!0}else{const l=await w.v1.statuses.$select(A).reblog();return Me(l,k),!0}}catch{return M.statuses[C]=n,!1}},$t=async()=>{if(!$||!F)return alert(dt);try{if(M.statuses[C]={...n,favourited:!ce,favouritesCount:Oe+(ce?-1:1)},ce){const l=await w.v1.statuses.$select(A).unfavourite();Me(l,k)}else{const l=await w.v1.statuses.$select(A).favourite();Me(l,k)}}catch{M.statuses[C]=n}},nn=async()=>{if(!$||!F)return alert(dt);try{if(M.statuses[C]={...n,bookmarked:!Ce},Ce){const l=await w.v1.statuses.$select(A).unbookmark();Me(l,k)}else{const l=await w.v1.statuses.$select(A).bookmark();Me(l,k)}}catch{M.statuses[C]=n}},Dn=!!V&&V!==Cn&&!qt([V],[Cn])&&!Ua.find(l=>V===l||qt([V],[l])),Mn=ee(),On=ee();async function Ka(l){var ue,Be,Nt,Hn;l&&(Mn.current=w.v1.statuses.$select(t).rebloggedBy.list({limit:ia}),On.current=w.v1.statuses.$select(t).favouritedBy.list({limit:ia}));const[{value:P},{value:Z}]=await Promise.allSettled([Mn.current.next(),On.current.next()]);if((ue=P.value)!=null&&ue.length||(Be=Z.value)!=null&&Be.length){const an=[];return(Nt=P.value)!=null&&Nt.length&&an.push(...P.value.map(ft=>(ft._types=["reblog"],ft))),(Hn=Z.value)!=null&&Hn.length&&an.push(...Z.value.map(ft=>(ft._types=["favourite"],ft))),{value:an,done:P.done&&Z.done}}return{value:[],done:!0}}const Wa=ee(),zn=e(K,{children:[!he&&e(K,{children:[e(Io,{children:[e("span",{class:"ib",children:[e(x,{icon:ot[de],size:"s"})," ",e("span",{children:kt[de]})]})," ",e("span",{class:"ib",children:[se>0&&e("span",{children:[e(x,{icon:"comment2",alt:"Replies",size:"s"})," ",e("span",{children:Ke(se)})]})," ",Ae>0&&e("span",{children:[e(x,{icon:"rocket",alt:"Boosts",size:"s"})," ",e("span",{children:Ke(Ae)})]})," ",Oe>0&&e("span",{children:[e(x,{icon:"heart",alt:"Likes",size:"s"})," ",e("span",{children:Ke(Oe)})]})]}),e("br",{}),Rn]}),e(oa,{to:k?`/${k}/s/${A}`:`/s/${A}`,onClick:l=>{b(l,n)},children:[e(x,{icon:"arrow-right"}),e("span",{children:["View post by @",Y||R]})]})]}),!!X&&e(xe,{onClick:()=>{Ct(A)},children:[e(x,{icon:"history"}),e("span",{children:["Show Edit History",e("br",{}),e("small",{class:"more-insignificant",children:["Edited: ",In]})]})]}),(!he||!!X)&&e(on,{}),he&&e(xe,{onClick:()=>{M.showGenericAccounts={heading:"Boosted/Liked by…",fetchAccounts:Ka,instance:k,showReactions:!0}},children:[e(x,{icon:"react"}),e("span",{children:["Boosted/Liked by",e("span",{class:"more-insignificant",children:"…"})]})]}),!he&&$&&e(K,{children:[e("div",{class:"menu-horizontal",children:[e(cn,{subMenu:!0,confirmLabel:e(K,{children:[e(x,{icon:"rocket"}),e("span",{children:G?"Unboost?":"Boost to everyone?"})]}),menuFooter:en&&!G&&e("div",{class:"footer",children:[e(x,{icon:"alert"}),"Some media have no descriptions."]}),disabled:!mt,onClick:async()=>{try{const l=await tn();!he&&l&&we(G?`Unboosted @${Y||R}'s post`:`Boosted @${Y||R}'s post`)}catch{}},children:[e(x,{icon:"rocket",style:{color:G&&"var(--reblog-color)"}}),e("span",{children:G?"Unboost":"Boost…"})]}),e(xe,{onClick:()=>{try{$t(),he||we(ce?`Unliked @${Y||R}'s post`:`Liked @${Y||R}'s post`)}catch{}},children:[e(x,{icon:"heart",style:{color:ce&&"var(--favourite-color)"}}),e("span",{children:ce?"Unlike":"Like"})]})]}),e("div",{class:"menu-horizontal",children:[e(xe,{onClick:Ft,children:[e(x,{icon:"comment"}),e("span",{children:"Reply"})]}),e(xe,{onClick:()=>{try{nn(),he||we(Ce?`Unbookmarked @${Y||R}'s post`:`Bookmarked @${Y||R}'s post`)}catch{}},children:[e(x,{icon:"bookmark",style:{color:Ce&&"var(--link-color)"}}),e("span",{children:Ce?"Unbookmark":"Bookmark"})]})]})]}),f?e("div",{class:_t?"menu-horizontal":"",children:[e(xe,{disabled:Zt,onClick:()=>{Va(!0)},children:[e(x,{icon:"translate"}),e("span",{children:"Translate"})]}),_t&&e(xe,{onClick:()=>{const l=vn(n);l&&aa(l,V)},children:[e(x,{icon:"speak"}),e("span",{children:"Speak"})]})]}):(!V||Dn)&&e("div",{class:_t?"menu-horizontal":"",children:[e(oa,{to:`${k?`/${k}`:""}/s/${A}?translate=1`,children:[e(x,{icon:"translate"}),e("span",{children:"Translate"})]}),_t&&e(xe,{onClick:()=>{const l=vn(n);l&&aa(l,V)},children:[e(x,{icon:"speak"}),e("span",{children:"Speak"})]})]}),(!he&&$||f)&&e(on,{}),e(xe,{href:S,target:"_blank",children:[e(x,{icon:"external"}),e("small",{class:"menu-double-lines",children:ir(S)})]}),e("div",{class:"menu-horizontal",children:[e(xe,{onClick:()=>{try{navigator.clipboard.writeText(S),we("Link copied")}catch{we("Unable to copy link")}},children:[e(x,{icon:"link"}),e("span",{children:"Copy"})]}),(navigator==null?void 0:navigator.share)&&((Un=navigator==null?void 0:navigator.canShare)==null?void 0:Un.call(navigator,{url:S}))&&e(xe,{onClick:()=>{try{navigator.share({url:S})}catch{alert("Sharing doesn't seem to work.")}},children:[e(x,{icon:"share"}),e("span",{children:"Share…"})]})]}),(q||tt)&&e(on,{}),(q||tt)&&e(xe,{onClick:async()=>{try{const l=await w.v1.statuses.$select(A)[ze?"unmute":"mute"]();Me(l,k),we(ze?"Conversation unmuted":"Conversation muted")}catch{we(ze?"Unable to unmute conversation":"Unable to mute conversation")}},children:ze?e(K,{children:[e(x,{icon:"unmute"}),e("span",{children:"Unmute conversation"})]}):e(K,{children:[e(x,{icon:"mute"}),e("span",{children:"Mute conversation"})]})}),q&&/(public|unlisted|private)/i.test(de)&&e(xe,{onClick:async()=>{try{const l=await w.v1.statuses.$select(A)[j?"unpin":"pin"]();we(j?"Post unpinned from profile":"Post pinned to profile")}catch{we(j?"Unable to unpin post":"Unable to pin post")}},children:j?e(K,{children:[e(x,{icon:"unpin"}),e("span",{children:"Unpin from profile"})]}):e(K,{children:[e(x,{icon:"pin"}),e("span",{children:"Pin to profile"})]})}),q&&e("div",{class:"menu-horizontal",children:[e(xe,{onClick:()=>{M.showCompose={editStatus:n}},children:[e(x,{icon:"pencil"}),e("span",{children:"Edit"})]}),he&&e(cn,{subMenu:!0,confirmLabel:e(K,{children:[e(x,{icon:"trash"}),e("span",{children:"Delete this post?"})]}),menuItemClassName:"danger",onClick:()=>{(async()=>{try{await w.v1.statuses.$select(A).remove();const l=wn(A,k);l._deleted=!0,we("Deleted")}catch{we("Unable to delete")}})()},children:[e(x,{icon:"trash"}),e("span",{children:"Delete…"})]})]})]}),Nn=ee(),[Pt,ht]=Q(!1),[Rt,It]=Q({}),Dt=y||!he&&!p&&!J&&!g,Ga=_a(er&&Dt?l=>{var Be;if(l.pointerType==="mouse")return;const{clientX:P,clientY:Z}=((Be=l.touches)==null?void 0:Be[0])||l,ue=l.target.closest("a");ue&&/^https?:\/\//.test(ue.getAttribute("href"))||(l.preventDefault(),It({anchorPoint:{x:P,y:Z},direction:"right"}),ht(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),Mt=!s&&!p&&!g,Ya=je("r, shift+r",Ft,{enabled:Mt}),Ja=je("f, l",()=>{try{$t(),he||we(ce?`Unliked @${Y||R}'s post`:`Liked @${Y||R}'s post`)}catch{}},{enabled:Mt}),Za=je("d",()=>{try{nn(),he||we(Ce?`Unbookmarked @${Y||R}'s post`:`Bookmarked @${Y||R}'s post`)}catch{}},{enabled:Mt}),Xa=je("shift+b",()=>{(async()=>{try{const l=await tn();!he&&l&&we(G?`Unboosted @${Y||R}'s post`:`Boosted @${Y||R}'s post`)}catch{}})()},{enabled:Mt&&mt}),Qa=je("x",l=>{const P=document.activeElement.closest(".status-link, .status-focus");if(P){const Z=P.querySelector(".spoiler-button:not(.spoiling)");if(Z)l.stopPropagation(),Z.click();else{const ue=P.querySelector(".spoiler-media-button:not(.spoiling)");ue&&(l.stopPropagation(),ue.click())}}}),Ot=ie.slice(0,he?void 0:4),zt=ie.length>1&&Ot.some(l=>!!l.description&&!za(l.description)),eo=Ee(()=>{if(!zt)return null;const l=[];return Ot.forEach((P,Z)=>{if(!P.description)return;const ue=l.findIndex(Be=>Be.media.description===P.description);ue===-1?l.push({media:P,indices:[Z]}):l[ue].indices.push(Z)}),l.map(({media:P,indices:Z})=>e("div",{"data-caption-index":Z.map(ue=>ue+1).join(" "),onClick:ue=>{ue.preventDefault(),ue.stopPropagation(),M.showMediaAlt={alt:P.description,lang:V}},title:P.description,children:[e("sup",{children:Z.map(ue=>ue+1).join(" ")})," ",P.description]},P.id))},[zt,Ot,V]),pt=Ee(()=>{var l;return!!Le&&Se===((l=n.account)==null?void 0:l.id)||!!z.statusThreadNumber[C]},[Le,Se,(jn=n.account)==null?void 0:jn.id,z.statusThreadNumber[C]]),to=Ee(()=>c&&!pt&&!u&&!Le&&de==="public"&&se>0,[c,pt,u,Le,se,de]),Bn=Ee(()=>{if(ne||Te||Re||oe||ie!=null&&ie.length||pt||u||Le||se<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(ye))return!1;const Z=fn(ye);if(Z>0&&Z<=Ji)return!0},[ne,Te,Re,oe,ie,De,pt,u,Le,se,ye]);return e(K,{children:[L&&!!(Le&&Se)&&e(rr,{sKey:C}),e("article",{"data-state-post-id":C,ref:l=>{var Z;St.current=l;const P=((Z=l==null?void 0:l.closest)==null?void 0:Z.call(l,".timeline-item, .timeline-item-alt, .status-link, .status-focus"))||l;Ya.current=P,Ja.current=P,Za.current=P,Xa.current=P,Qa.current=P},tabindex:"-1",class:`status ${!u&&Le&&et?"status-reply-to":""} visibility-${de} ${j?"status-pinned":""} ${{s:"small",m:"medium",l:"large"}[r]} ${J?"status-deleted":""} ${g?"status-card":""} ${Pt?"status-menu-open":""}`,onMouseEnter:Ne,onContextMenu:l=>{var ue,Be;if(!Dt||l.metaKey)return;const P=l.target.closest("a");if(P&&/^https?:\/\//.test(P.getAttribute("href")))return;const Z=(ue=window.getSelection)==null?void 0:ue.call(window);if(Z.toString().length>0){const{anchorNode:Nt}=Z;if((Be=St.current)!=null&&Be.contains(Nt))return}l.preventDefault(),It({anchorPoint:{x:l.clientX,y:l.clientY},direction:"right"}),ht(!0)},...Dt?Ga():{},children:[Dt&&e(Do,{ref:Nn,state:Pt?"open":void 0,...Rt,onClose:l=>{var P,Z,ue;ht(!1),(l==null?void 0:l.reason)==="click"&&((ue=(Z=(P=St.current)==null?void 0:P.closest("[tabindex]"))==null?void 0:Z.focus)==null||ue.call(Z))},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{var l,P;(P=(l=Nn.current)==null?void 0:l.closeMenu)==null||P.call(l)}},overflow:"auto",boundingBoxPadding:Fa(),unmountOnClose:!0,children:zn}),E&&r!=="l"&&!p&&!s&&!J&&!g&&e("div",{class:`status-actions ${Pt==="actions-bar"?"open":""}`,ref:Wa,children:[e(at,{size:"s",title:"Reply",alt:"Reply",class:"reply-button",icon:"comment",iconSize:"m",onClick:Ft}),e(at,{size:"s",checked:ce,title:["Like","Unlike"],alt:["Like","Liked"],class:"favourite-button",icon:"heart",iconSize:"m",count:Oe,onClick:()=>{try{$t(),we(ce?`Unliked @${Y||R}'s post`:`Liked @${Y||R}'s post`)}catch{}}}),e("button",{type:"button",title:"More",class:"plain more-button",onClick:l=>{l.preventDefault(),l.stopPropagation(),It({anchorRef:{current:l.currentTarget},align:"end",direction:"bottom",gap:4}),ht("actions-bar")},children:e(x,{icon:"more2",size:"m",alt:"More"})})]}),r!=="l"&&e("div",{class:"status-badge",children:[G&&e(x,{class:"reblog",icon:"rocket",size:"s"}),ce&&e(x,{class:"favourite",icon:"heart",size:"s"}),Ce&&e(x,{class:"bookmark",icon:"bookmark",size:"s"}),j&&e(x,{class:"pin",icon:"pin",size:"s"})]}),r!=="s"&&e("a",{href:pe,tabindex:"-1",title:`@${R}`,onClick:l=>{l.preventDefault(),l.stopPropagation(),M.showAccount={account:n.account,instance:k}},children:e(Ge,{url:H||B,size:"xxl",squircle:re})}),e("div",{class:"container",children:[e("div",{class:"meta",children:[e("span",{class:"meta-name",children:e(yt,{account:n.account,instance:k,showAvatar:r==="s",showAcct:he})})," ",r!=="l"&&(J?e("span",{class:"status-deleted-tag",children:"Deleted"}):S&&!p&&!g?e(it,{to:k?`/${k}/s/${A}`:`/s/${A}`,onClick:l=>{l.metaKey||l.ctrlKey||l.shiftKey||l.altKey||l.which===2||(l.preventDefault(),l.stopPropagation(),b==null||b(l,n),It({anchorRef:{current:l.currentTarget},align:"end",direction:"bottom",gap:4}),ht(!0))},class:`time ${Pt&&(Rt!=null&&Rt.anchorRef)?"is-open":""}`,children:[to&&!Bn?e(x,{icon:"comment2",size:"s",alt:`${se} ${se===1?"reply":"replies"}`}):e(x,{icon:ot[de],alt:kt[de],size:"s"})," ",e(Tt,{datetime:Fe,format:"micro"}),!p&&e(x,{icon:"more2",class:"more"})]}):e("span",{class:"time",children:[e(x,{icon:ot[de],alt:kt[de],size:"s"})," ",e(Tt,{datetime:Fe,format:"micro"})]}))]}),de==="direct"&&e(K,{children:[e("div",{class:"status-direct-badge",children:"Private mention"})," "]}),!u&&e(K,{children:pt?e("div",{class:"status-thread-badge",children:[e(x,{icon:"thread",size:"s"}),"Thread",z.statusThreadNumber[C]?` ${z.statusThreadNumber[C]}/X`:""]}):!!Le&&!!et&&(!!oe||!_e.find(l=>l.id===Se))&&e("div",{class:"status-reply-badge",children:[e(x,{icon:"reply"})," ",e(yt,{account:et,instance:k,short:!0})]})}),e("div",{class:`content-container ${oe||Re?"has-spoiler":""} ${lt?"show-spoiler":""} ${ut?"show-media":""}`,"data-content-text-weight":o?Pn():null,style:(he||o)&&{"--content-text-weight":Pn()},children:[!!oe&&e(K,{children:[e("div",{class:"content spoiler-content",lang:V,dir:"auto",ref:ja,"data-read-more":$n,children:e("p",{children:e(xt,{text:oe,emojis:D})})}),ct||p?e("div",{class:"spoiler-divider",children:[e(x,{icon:"eye-open"})," Content warning"]}):e("button",{class:`light spoiler-button ${lt?"spoiling":""}`,type:"button",onClick:l=>{l.preventDefault(),l.stopPropagation(),lt?(delete M.spoilers[A],ct||delete M.spoilersMedia[A]):(M.spoilers[A]=!0,ct||(M.spoilersMedia[A]=!0))},children:[e(x,{icon:lt?"eye-open":"eye-close"})," ",lt?"Show less":"Show content"]})]}),!!ye&&e("div",{class:"content",ref:Ha,"data-read-more":$n,children:[e("div",{lang:V,dir:"auto",class:"inner-content",onClick:Ti({mentions:_e,instance:k,previewMode:p,statusURL:S}),dangerouslySetInnerHTML:{__html:Pa(ye,{emojis:D,postEnhanceDOM:l=>{l.querySelectorAll('a.u-url[target="_blank"]').forEach(P=>{/http/i.test(P.innerText.trim())||P.removeAttribute("target")})}})}}),e(cr,{id:A,instance:k,level:g})]}),!!Te&&e(Ui,{lang:V,poll:Te,readOnly:s||!$||!F,onUpdate:l=>{M.statuses[C].poll=l},refresh:()=>w.v1.polls.$select(Te.id).fetch().then(l=>{M.statuses[C].poll=l}).catch(l=>{}),votePoll:l=>w.v1.polls.$select(Te.id).votes.create({choices:l}).then(P=>{M.statuses[C].poll=P}).catch(P=>{})}),((f||Fn)&&!!ye.trim()&&!!Tn(xn(ye,D))&&Dn||Zt)&&e(zi,{forceTranslate:Zt||Fn,mini:!he&&!u,sourceLanguage:V,text:vn(n)}),!p&&Re&&!!ie.length&&An!=="show_all"&&e("button",{class:`plain spoiler-media-button ${ut?"spoiling":""}`,type:"button",hidden:!ct&&!!oe,onClick:l=>{l.preventDefault(),l.stopPropagation(),ut?delete M.spoilersMedia[A]:M.spoilersMedia[A]=!0},children:[e(x,{icon:ut?"eye-open":"eye-close"})," ",ut?"Show less":"Show media"]}),!!ie.length&&e(nr,{lang:V,enabled:zt,captionChildren:eo,children:e("div",{ref:qa,class:`media-container media-eq${ie.length} ${ie.length>2?"media-gt2":""} ${ie.length>4?"media-gt4":""}`,children:Ot.map((l,P)=>e(Yi,{media:l,autoAnimate:he,showCaption:ie.length===1,lang:V,altIndex:zt&&!!l.description&&P+1,to:`/${k}/s/${A}?${u?"media":"media-only"}=${P+1}`,onClick:h?Z=>{h(Z,P,l,n)}:void 0},l.id))})}),!!ne&&/^https/i.test(ne==null?void 0:ne.url)&&!Re&&!oe&&!Te&&!ie.length&&!z.statusQuotes[C]&&e(ar,{card:ne,selfReferential:(ne==null?void 0:ne.url)===n.url||(ne==null?void 0:ne.url)===n.uri,instance:O})]}),!he&&Bn&&e("div",{class:"content-comment-hint insignificant",children:[e(x,{icon:"comment2",alt:"Replies"})," ",se]}),he&&e(K,{children:[e("div",{class:"extra-meta",children:J?e("span",{class:"status-deleted-tag",children:"Deleted"}):e(K,{children:[e(x,{icon:ot[de],alt:kt[de]})," ",e("a",{href:S,target:"_blank",rel:"noopener noreferrer",children:e("time",{class:"created",datetime:Fe.toISOString(),title:Fe.toLocaleString(),children:Rn})}),X&&e(K,{children:[" ","• ",e(x,{icon:"pencil",alt:"Edited"})," ",e("time",{tabIndex:"0",class:"edited",datetime:Je.toISOString(),onClick:()=>{Ct(A)},children:In})]})]})}),e("div",{class:`actions ${J?"disabled":""}`,children:[e("div",{class:"action has-count",children:e(at,{title:"Reply",alt:"Comments",class:"reply-button",icon:"comment",count:se,onClick:Ft})}),e(cn,{disabled:!mt,onClick:tn,confirmLabel:e(K,{children:[e(x,{icon:"rocket"}),e("span",{children:G?"Unboost?":"Boost to everyone?"})]}),menuFooter:en&&!G&&e("div",{class:"footer",children:[e(x,{icon:"alert"}),"Some media have no descriptions."]}),children:e("div",{class:"action has-count",children:e(at,{checked:G,title:["Boost","Unboost"],alt:["Boost","Boosted"],class:"reblog-button",icon:"rocket",count:Ae,disabled:!mt})})}),e("div",{class:"action has-count",children:e(at,{checked:ce,title:["Like","Unlike"],alt:["Like","Liked"],class:"favourite-button",icon:"heart",count:Oe,onClick:$t})}),e("div",{class:"action",children:e(at,{checked:Ce,title:["Bookmark","Unbookmark"],alt:["Bookmark","Bookmarked"],class:"bookmark-button",icon:"bookmark",onClick:nn})}),e(En,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:e("div",{class:"action",children:e("button",{type:"button",title:"More",class:"plain more-button",children:e(x,{icon:"more",size:"l",alt:"More"})})}),children:zn})]})]})]}),!!Qt&&e(Yt,{class:"light",onClick:l=>{l.target===l.currentTarget&&Ct(!1)},children:e(or,{statusID:Qt,instance:k,fetchStatusHistory:()=>w.v1.statuses.$select(Qt).history.list(),onClose:()=>{var l;Ct(!1),(l=St.current)==null||l.focus()}})})]})]})}function nr(t){const{enabled:n,children:a,lang:r,captionChildren:o}=t;return!n||!o?a:e("figure",{class:"media-figure-multiple",children:[a,e("figcaption",{lang:r,dir:"auto",children:o})]})}function ar({card:t,selfReferential:n,instance:a}){var H;const r=rt(M),{blurhash:o,title:s,description:c,html:u,providerName:d,providerUrl:f,authorName:m,authorUrl:p,width:h,height:g,image:b,imageDescription:v,url:y,type:E,embedUrl:L,language:w,publishedAt:k}=t,F=s||d||m,$=h/g>=1.2?"large":"",[C,z]=Q(null);if(ve(()=>{F&&b&&!n&&Ea(y)&&xa(a,y).then(W=>{if(!W)return;const{id:pe,url:le}=W;z("#"+le)})},[F,b,n]),r.unfurledLinks[y])return null;const R=/<iframe/i.test(u),B=kn(W=>{R&&(W.preventDefault(),M.showEmbedModal={html:u,url:y||L,width:h,height:g})},[R]);if(F&&(b||E==="photo"&&o)){const W=new URL(y).hostname.replace(/^www\./,"").replace(/\/$/,"");let pe;const le=b&&o?ya(o):null;if(!b){const re=Mo(o,44,44),fe=document.createElement("canvas");fe.width=44,fe.height=44;const A=fe.getContext("2d"),se=A.createImageData(44,44);se.data.set(re),A.putImageData(se,0,0),pe=fe.toDataURL()}return e("a",{href:C||y,target:C?null:"_blank",rel:"nofollow noopener noreferrer",class:`card link ${pe?"":$}`,lang:w,dir:"auto",style:{"--average-color":le&&`rgb(${le.join(",")})`},onClick:B,children:[e("div",{class:"card-image",children:e("img",{src:b||pe,width:h,height:g,loading:"lazy",alt:v||"",onError:Y=>{try{Y.target.style.display="none"}catch{}}})}),e("div",{class:"meta-container",children:[e("p",{class:"meta domain",dir:"auto",children:W}),e("p",{class:"title",dir:"auto",children:s}),e("p",{class:"meta",dir:"auto",children:c||!!k&&e(Tt,{datetime:k,format:"micro"})})]})]})}else{if(E==="photo")return e("a",{href:y,target:"_blank",rel:"nofollow noopener noreferrer",class:"card photo",onClick:B,children:e("img",{src:L,width:h,height:g,alt:s||c,loading:"lazy",style:{height:"auto",aspectRatio:`${h}/${g}`}})});if(E==="video"&&/youtube/i.test(d)){const W=(H=y.match(/watch\?v=([^&]+)/))==null?void 0:H[1];if(W)return e("lite-youtube",{videoid:W,nocookie:!0})}if(F&&!b){const W=new URL(y).hostname.replace(/^www\./,"");return e("a",{href:C||y,target:C?null:"_blank",rel:"nofollow noopener noreferrer",class:"card link no-image",lang:w,onClick:B,children:e("div",{class:"meta-container",children:[e("p",{class:"meta domain",children:[e(x,{icon:"link",size:"s"})," ",e("span",{children:W})]}),e("p",{class:"title",children:s}),e("p",{class:"meta",children:c||d||m})]})})}}}function or({statusID:t,instance:n,fetchStatusHistory:a=()=>{},onClose:r}){const[o,s]=Q("default"),[c,u]=Q([]);return ve(()=>{s("loading"),(async()=>{try{const d=await a();u(d),s("default")}catch{s("error")}})()},[]),e("div",{id:"edit-history",class:"sheet",children:[!!r&&e("button",{type:"button",class:"sheet-close",onClick:r,children:e(x,{icon:"x"})}),e("header",{children:[e("h2",{children:"Edit History"}),o==="error"&&e("p",{children:"Failed to load history"}),o==="loading"&&e("p",{children:[e(Jt,{abrupt:!0})," Loading…"]})]}),e("main",{tabIndex:"-1",children:c.length>0&&e("ol",{children:c.map(d=>{const{createdAt:f}=d,m=new Date(f);return e("li",{class:"history-item",children:[e("h3",{children:e("time",{children:Lt(m,{formatOpts:{weekday:"short",second:"numeric"}})})}),e(Qe,{status:d,instance:n,size:"s",withinContext:!0,readOnly:!0,previewMode:!0})]},f)})})})]})}function at({checked:t,count:n,class:a,title:r,alt:o,size:s,icon:c,iconSize:u="l",onClick:d,...f}){typeof r=="string"&&(r=[r,r]),typeof o=="string"&&(o=[o,o]);const[m,p]=Q(r[0]||""),[h,g]=Q(o[0]||"");return ve(()=>{t?(p(r[1]||""),g(o[1]||"")):(p(r[0]||""),g(o[0]||""))},[t,r,o]),e("button",{type:"button",title:m,class:`plain ${s?"small":""} ${a} ${t?"checked":""}`,onClick:b=>{d&&(b.preventDefault(),b.stopPropagation(),d(b))},...f,children:[e(x,{icon:c,size:u,alt:h}),!!n&&e(K,{children:[" ",e("small",{title:n,children:Ke(n)})]})]})}function ra(t){if(!t)return;let n=Math.floor(t/3600),a=Math.floor(t%3600/60),r=Math.round(t%60);return n===0?`${a}:${r.toString().padStart(2,"0")}`:`${n}:${a.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function ir(t){if(!t)return;const n=new URL(t),{host:a,pathname:r}=n,o=r.replace(/\/$/,""),[s,c,u]=o.match(/\/(@[^\/]+)\/(.*)/)||[];return e(K,{children:[a,c?e(K,{children:["/",c,e("wbr",{}),e("span",{class:"more-insignificant",children:["/",u]})]}):e("span",{class:"more-insignificant",children:o})]})}function rr({sKey:t}){const a=rt(M).statusReply[t];if(!a)return null;const{id:r,instance:o}=a,s=wn(r,o);if(!s)return null;const{sensitive:c,spoilerText:u,account:{avatar:d,avatarStatic:f,bot:m},visibility:p,content:h,language:g}=s;if(c||u||!h)return null;const b=Pe(r,o),v=Oa(s);return e("article",{class:`status compact-reply ${p==="direct"?"visibility-direct":""}`,tabindex:"-1","data-state-post-id":b,children:[e(Ge,{url:f||d,squircle:m}),e("div",{class:"content-compact",title:v,lang:g,dir:"auto",children:v})]})}function sr({status:t,filterInfo:n,instance:a,containerProps:r={},showFollowedTags:o}){var B;const s=rt(M),{id:c,account:{avatar:u,avatarStatic:d,bot:f,group:m},createdAt:p,visibility:h,reblog:g}=t,b=!!g,v=(n==null?void 0:n.titlesStr)||"",y=new Date(p),E=Oa(t.reblog||t),[L,w]=Q(!1),k=_a(()=>{w(!0)},{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),F=jt(),O=Pe(t.id,a),$=Pe(t.id,a)+" "+(Pe(g==null?void 0:g.id,a)||""),C=(g==null?void 0:g.id)||c,z=a?`/${a}/s/${C}`:`/s/${C}`,R=o&&!!((B=s.statusFollowedTags[O])!=null&&B.length);return e("div",{class:b?m?"status-group":"status-reblog":R?"status-followed-tags":"",...r,onContextMenu:H=>{H.preventDefault(),w(!0)},...k(),children:[e("article",{"data-state-post-id":$,class:"status filtered",tabindex:"-1",children:[e("b",{class:"status-filtered-badge clickable badge-meta",title:v,onClick:H=>{H.preventDefault(),w(!0)},children:[e("span",{children:"Filtered"}),e("span",{children:v})]})," ",e(Ge,{url:d||u,squircle:f}),e("span",{class:"status-filtered-info",children:[e("span",{class:"status-filtered-info-1",children:[e(yt,{account:t.account,instance:a})," ",e(x,{icon:ot[h],alt:kt[h],size:"s"})," ",b?"boosted":R?e("span",{children:s.statusFollowedTags[O].slice(0,3).map(H=>e("span",{class:"status-followed-tag-item",children:["#",H]},H))}):e(Tt,{datetime:y,format:"micro"})]}),e("span",{class:"status-filtered-info-2",children:[b&&e(K,{children:[e(Ge,{url:g.account.avatarStatic||g.account.avatar,squircle:f})," "]}),E]})]})]}),!!L&&e(Yt,{class:"light",onClick:H=>{H.target===H.currentTarget&&w(!1)},children:e("div",{id:"filtered-status-peek",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>w(!1),children:e(x,{icon:"x"})}),e("header",{children:[e("b",{class:"status-filtered-badge",children:"Filtered"})," ",v]}),e("main",{tabIndex:"-1",children:e(it,{ref:F,class:"status-link",to:z,onClick:()=>{w(!1)},"data-read-more":"Read more →",children:e(Qe,{status:t,instance:a,size:"s",readOnly:!0})})})]})})]})}const cr=Kt(({id:t,instance:n,level:a=0})=>{if(!t||!n)return;const r=rt(M),o=Pe(t,n),s=r.statusQuotes[o],c=s==null?void 0:s.filter((u,d,f)=>f.findIndex(m=>m.url===u.url)===d);if(c!=null&&c.length&&!(a>2))return c.map(u=>e(it,{to:`${u.instance?`/${u.instance}`:""}/s/${u.id}`,class:"status-card-link","data-read-more":"Read more →",children:e(Qe,{statusID:u.id,instance:u.instance,size:"s",quoted:a+1,enableCommentHint:!0})},u.instance+u.id))}),sa=Kt(Qe,(t,n)=>{const{status:a,...r}=t,{status:o,...s}=n;return(a==null?void 0:a.id)===(o==null?void 0:o.id)&&Oo(r,s)});var lr={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{PHANPY_IMG_ALT_API_URL:ca}=lr,ur=Ln.reduce((t,n)=>{const[a,r,o]=n;return t[a]={common:r,native:o},t},{}),Na={"5 minutes":5*60,"30 minutes":30*60,"1 hour":60*60,"6 hours":6*60*60,"12 hours":12*60*60,"1 day":24*60*60,"3 days":3*24*60*60,"7 days":7*24*60*60},dr=Object.values(Na),la=24*60*60,ua=t=>{if(!t)return la;const n=(new Date(t).getTime()-Date.now())/1e3;return dr.find(a=>a>=n)||la},qe=document.createElement("ul");qe.role="listbox";qe.className="text-expander-menu";const mr=16,hr=new IntersectionObserver(t=>{t.forEach(n=>{if(n.isIntersecting){const{left:a,width:r}=n.boundingClientRect,{innerWidth:o}=window;a+r>o&&(qe.style.left=o-r-mr+"px")}})});hr.observe(qe);const Xe=qt([new Intl.DateTimeFormat().resolvedOptions().locale,...navigator.languages],Ln.map(t=>t[0]),"en"),Ba=new RegExp(ta.source,ta.flags),pr=/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/gi,fr="$2xxxxxxxxxxxxxxxxxxxxxxx";function gr(t){return t.replace(Ba,fr).replace(pr,"$1@$3")}const vr=/[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?/i,br=new RegExp(`(^|[^=\\/\\w])(@${vr.source}(?:@[\\p{L}\\w.-]+[\\w]+)?)`,"uig"),yr=new RegExp("(^|[^=\\/\\w])(#[a-z0-9_]+([a-z0-9_.-]+[a-z0-9_]+)?)(?![\\/\\w])","ig"),_r="[a-zA-Z0-9_]{2,}",kr=new RegExp(`([^A-Za-z0-9_:\\n]|^)(:${_r}:)(?=[^A-Za-z0-9_:]|$)`,"g");function wr(t,{maxCharacters:n=1/0}){let a=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");const{composerCharacterCount:r}=M;let o="";return r>n?(o='<mark class="compose-highlight-exceeded">'+Kn(a,n)+"</mark>",a=Kn(a,0,n),a+o):a.replace(Ba,'$2<mark class="compose-highlight-url">$3</mark>').replace(br,'$1<mark class="compose-highlight-mention">$2</mark>').replace(yr,'$1<mark class="compose-highlight-hashtag">$2</mark>').replace(kr,'$1<mark class="compose-highlight-emoji-shortcode">$2</mark>')}function zr({onClose:t,replyToStatus:n,editStatus:a,draftStatus:r,standalone:o,hasOpener:s}){var De;const{masto:c,instance:u}=We(),[d,f]=Q("default"),m=ee((r==null?void 0:r.uid)||zo()),p=Wt(),h=p.info,g=Ho(),{statuses:{maxCharacters:b,maxMediaAttachments:v,charactersReservedPerUrl:y}={},mediaAttachments:{supportedMimeTypes:E=[],imageSizeLimit:L,imageMatrixLimit:w,videoSizeLimit:k,videoMatrixLimit:F,videoFrameRateLimit:O}={},polls:{maxOptions:$,maxCharactersPerOption:C,maxExpiration:z,minExpiration:R}={}}=g||{},B=ee(),H=ee(),[W,pe]=Q("public"),[le,Y]=Q(!1),[te,re]=Q(N.session.get("currentLanguage")||Xe),fe=ee(te),[A,se]=Q([]),[G,Ae]=Q(null),ce=N.account.get("preferences")||{},Oe=()=>{B.current&&B.current.dispatchEvent(new Event("input"))},Ce=()=>{setTimeout(()=>{var T;(T=B.current)==null||T.focus()},300)};ve(()=>{if(n){const{spoilerText:T,visibility:S,language:D,sensitive:I}=n;T&&H.current&&(H.current.value=T);const j=[...new Set([n.account.acct,...n.mentions.map(U=>U.acct)])].filter(U=>U!==h.acct);j.length>0&&(B.current.value=`${j.map(U=>`@${U}`).join(" ")} `,Oe()),Ce(),pe(S==="public"&&ce["posting:default:visibility"]?ce["posting:default:visibility"]:S),re(D||ce.postingDefaultLanguage||Xe),Y(I&&!!T)}else if(a){const{visibility:T,language:S,sensitive:D,poll:I,mediaAttachments:J}=a,j=!!(I!=null&&I.options)&&{...I,options:I.options.map(U=>(U==null?void 0:U.title)||U),expiresIn:(I==null?void 0:I.expiresIn)||ua(I.expiresAt)};f("loading"),(async()=>{try{const U=await c.v1.statuses.$select(a.id).source.fetch(),{text:q,spoilerText:me}=U;B.current.value=q,B.current.dataset.source=q,Oe(),Ce(),H.current.value=me,pe(T),re(S||presf.postingDefaultLanguage||Xe),Y(D),Ae(j),se(J),f("default")}catch(U){alert((U==null?void 0:U.reason)||U),f("error")}})()}else Ce(),ce["posting:default:visibility"]&&pe(ce["posting:default:visibility"]),ce["posting:default:language"]&&re(ce["posting:default:language"]),ce["posting:default:sensitive"]&&Y(ce["posting:default:sensitive"]);if(r){const{status:T,spoilerText:S,visibility:D,language:I,sensitive:J,poll:j,mediaAttachments:U}=r,q=!!(j!=null&&j.options)&&{...j,options:j.options.map(me=>(me==null?void 0:me.title)||me),expiresIn:(j==null?void 0:j.expiresIn)||ua(j.expiresAt)};B.current.value=T,Oe(),Ce(),S&&(H.current.value=S),D&&pe(D),re(I||ce.postingDefaultLanguage||Xe),J!==null&&Y(J),q&&Ae(q),U&&se(U)}},[r,a,n]);const Te=ee(),ze="You have unsaved changes. Discard this post?",Re=()=>{const{value:T,dataset:S}=B.current;if(d==="loading")return!1;const D=A.length>0;if(!T&&!D||A.length>0&&A.every(q=>q.id))return!0;const J=(n==null?void 0:n.account.id)===h.id,j=n&&T.trim()===`@${n.account.acct}`;return!!(!J&&j||T===(S==null?void 0:S.source))},oe=()=>Re()?!0:confirm(ze);ve(()=>{const T=S=>{Re()||(S.preventDefault(),S.returnValue=ze)};return window.addEventListener("beforeunload",T,{capture:!0}),()=>window.removeEventListener("beforeunload",T,{capture:!0})},[]);const de=()=>{const{value:T}=B.current,{value:S}=H.current;return Wn(gr(T))+Wn(S)},V=()=>{const T=de();M.composerCharacterCount=T};ve(V,[]);const X=window.CloseWatcher,ge=ee(!1);je("esc",()=>{ge.current=!0},{enabled:!X,enableOnFormTags:!0}),je("esc",()=>{!o&&ge.current&&oe()&&t(),ge.current=!1},{enabled:!X,enableOnFormTags:!0,keyup:!0,ignoreEventWhen:T=>{const S=document.querySelectorAll("#modal-container > *"),D=!!S,I=S.length===1&&S[0].querySelector("#compose-container");return D&&!I}}),Aa(()=>{!o&&oe()&&t()},[o,oe,t]);const ne=ee({}),$e=()=>`${Vt()}#${m.current}`,Le=()=>{if(a)return;const T=$e(),S={key:T,replyTo:n?{id:n.id,account:{id:n.account.id,username:n.account.username,acct:n.account.acct}}:null,draftStatus:{uid:m.current,status:B.current.value,spoilerText:H.current.value,visibility:W,language:te,sensitive:le,poll:G,mediaAttachments:A}};!ga(S,ne.current)&&!Re()&&(na.drafts.set(T,{...S,state:"unsaved",updatedAt:Date.now()}).then(()=>{}).catch(D=>{}),ne.current=structuredClone(S))};ei(Le,5e3),ve(()=>(Le(),()=>{na.drafts.del($e())}),[]),ve(()=>{const T=D=>{const{items:I}=D.clipboardData||D.dataTransfer,J=[];for(let j=0;j<I.length;j++){const U=I[j];if(U.kind==="file"){const q=U.getAsFile();q&&E.includes(q.type)&&J.push(q)}}if(J.length>0&&A.length>=v){alert(`You can only attach up to ${v} files.`);return}if(J.length>0){D.preventDefault(),D.stopPropagation();const j=v-A.length,U=J.slice(0,j);if(U.length<=0){alert(`You can only attach up to ${v} files.`);return}const q=U.map(me=>({file:me,type:me.type,size:me.size,url:URL.createObjectURL(me),id:null,description:null}));se([...A,...q])}};window.addEventListener("paste",T);const S=D=>{D.dataTransfer.items.length>0&&(D.preventDefault(),D.stopPropagation())};return window.addEventListener("dragover",S),window.addEventListener("drop",T),()=>{window.removeEventListener("paste",T),window.removeEventListener("dragover",S),window.removeEventListener("drop",T)}},[A]);const[Se,ye]=Q(!1),[_e,ie]=Ee(()=>{const T=[],S=[],{contentTranslationHideLanguages:D=[]}=M.settings;return Ln.forEach(I=>{const[J]=I;J===te||J===fe.current||J===Xe||D.includes(J)?T.push(I):S.push(I)}),T.sort(([I,J],[j,U])=>I===te?-1:j===te?1:J.localeCompare(U)),S.sort(([I,J],[j,U])=>J.localeCompare(U)),[T,S]},[te]);return e("div",{id:"compose-container-outer",children:[e("div",{id:"compose-container",class:o?"standalone":"",children:[e("div",{class:"compose-top",children:[(h==null?void 0:h.avatarStatic)&&e(Fi,{account:h,accountInstance:p.instanceURL,hideDisplayName:!0,useAvatarStatic:!0}),o?s&&e("button",{type:"button",class:"light pop-button",disabled:d==="loading",onClick:()=>{if(!window.opener){alert("Looks like you closed the parent window.");return}window.opener.__STATES__.showCompose&&!confirm("Looks like you already have a compose field open in the parent window. Popping in this window will discard the changes you made in the parent window. Continue?")||t({fn:()=>{const T={editStatus:a,replyToStatus:n,draftStatus:{uid:m.current,status:B.current.value,spoilerText:H.current.value,visibility:W,language:te,sensitive:le,poll:G,mediaAttachments:A}};window.opener.__COMPOSE__=T,window.opener.__STATES__.showCompose=!0}})},children:e(x,{icon:"popin",alt:"Pop in"})}):e("span",{children:[e("button",{type:"button",class:"light pop-button",disabled:d==="loading",onClick:()=>{Ta({editStatus:a,replyToStatus:n,draftStatus:{uid:m.current,status:B.current.value,spoilerText:H.current.value,visibility:W,language:te,sensitive:le,poll:G,mediaAttachments:A}})&&t()},children:e(x,{icon:"popout",alt:"Pop out"})})," ",e("button",{type:"button",class:"light close-button",disabled:d==="loading",onClick:()=>{oe()&&t()},children:e(x,{icon:"x"})})]})]}),!!n&&e("div",{class:"status-preview",children:[e(sa,{status:n,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend reply-to",children:["Replying to @",n.account.acct||n.account.username,"’s post"]})]}),!!a&&e("div",{class:"status-preview",children:[e(sa,{status:a,size:"s",previewMode:!0}),e("div",{class:"status-preview-legend",children:"Editing source post"})]}),e("form",{ref:Te,class:`form-visibility-${W}`,style:{pointerEvents:d==="loading"?"none":"auto",opacity:d==="loading"?.5:1},onKeyDown:T=>{T.key==="Enter"&&(T.ctrlKey||T.metaKey)&&Te.current.dispatchEvent(new Event("submit",{cancelable:!0}))},onSubmit:T=>{T.preventDefault();const S=new FormData(T.target),D=Object.fromEntries(S.entries());let{status:I,visibility:J,sensitive:j,spoilerText:U}=D;if(j=j==="on",G){if(G.options.length<2){alert("Poll must have at least 2 options");return}if(G.options.some(q=>q==="")){alert("Some poll choices are empty");return}}A.length>0&&A.some(me=>{var ke,Ne;return!((Ne=(ke=me.description)==null?void 0:ke.trim)!=null&&Ne.call(ke))})&&!confirm("Some media have no descriptions. Continue?")||(U=j&&U||void 0,I=I===""?void 0:I,f("loading"),(async()=>{try{if(A.length>0){const ke=A.map(Fe=>{const{file:Je,description:st,id:et}=Fe;if(et)return Fe;{const At=ma({file:Je,description:st});return c.v2.media.create(At).then(tt=>(tt.id&&(Fe.id=tt.id),tt))}}),Ne=await Promise.allSettled(ke);if(Ne.some(Fe=>{var Je;return Fe.status==="rejected"||!((Je=Fe.value)!=null&&Je.id)})){f("error"),Ne.forEach(Fe=>{Fe.status==="rejected"&&alert(Fe.reason||`Attachment #${i} failed`)});return}}let q={status:I,spoiler_text:U,language:te,sensitive:j,poll:G,media_ids:A.map(ke=>ke.id)};a&&Ra("@mastodon/edit-media-attributes")?q.media_attributes=A.map(ke=>({id:ke.id,description:ke.description})):a||(q.visibility=J,q.in_reply_to_id=(n==null?void 0:n.id)||void 0),q=ma(q);let me;if(a)me=await c.v1.statuses.$select(a.id).update(q),Me(me,u,{skipThreading:!0});else try{me=await c.v1.statuses.create(q,{idempotencyKey:m.current})}catch{me=await c.v1.statuses.create(q)}f("default"),t({type:a?"edit":n?"reply":"post",newStatus:me,instance:u})}catch(q){alert((q==null?void 0:q.reason)||q),f("error")}})())},children:[e("div",{class:"toolbar stretch",children:[e("input",{ref:H,type:"text",name:"spoilerText",placeholder:"Content warning",disabled:d==="loading",class:"spoiler-text-field",lang:te,spellCheck:"true",dir:"auto",style:{opacity:le?1:0,pointerEvents:le?"auto":"none"},onInput:()=>{V()}}),e("label",{class:`toolbar-button ${le?"highlight":""}`,title:"Content warning or sensitive media",children:[e("input",{name:"sensitive",type:"checkbox",checked:le,disabled:d==="loading",onChange:T=>{var D,I;const S=T.target.checked;Y(S),S?(D=H.current)==null||D.focus():(I=B.current)==null||I.focus()}}),e(x,{icon:`eye-${le?"close":"open"}`})]})," ",e("label",{class:`toolbar-button ${W!=="public"&&!le?"show-field":""} ${W!=="public"?"highlight":""}`,title:`Visibility: ${W}`,children:[e(x,{icon:ot[W],alt:W}),e("select",{name:"visibility",value:W,onChange:T=>{pe(T.target.value)},disabled:d==="loading"||!!a,children:[e("option",{value:"public",children:["Public ",e(x,{icon:"earth"})]}),e("option",{value:"unlisted",children:"Unlisted"}),e("option",{value:"private",children:"Followers only"}),e("option",{value:"direct",children:"Private mention"})]})]})," "]}),e(Er,{ref:B,placeholder:n?"Post your reply":a?"Edit your post":"What are you doing?",required:(A==null?void 0:A.length)===0,disabled:d==="loading",lang:te,onInput:()=>{V()},maxCharacters:b,performSearch:T=>{const{type:S,q:D,limit:I}=T;return S==="accounts"?c.v1.accounts.search.list({q:D,limit:I,resolve:!1}):c.v2.search.fetch(T)}}),(A==null?void 0:A.length)>0&&e("div",{class:"media-attachments",children:[A.map((T,S)=>{const{id:D,file:I}=T,J=(I==null?void 0:I.size)+(I==null?void 0:I.type)+(I==null?void 0:I.name);return e(Tr,{attachment:T,disabled:d==="loading",lang:te,onDescriptionChange:j=>{se(U=>{const q=[...U];return q[S].description=j,q})},onRemove:()=>{se(j=>j.filter((U,q)=>q!==S))}},D||J||S)}),e("label",{class:"media-sensitive",children:[e("input",{name:"sensitive",type:"checkbox",checked:le,disabled:d==="loading",onChange:T=>{const S=T.target.checked;Y(S)}})," ",e("span",{children:"Mark media as sensitive"})," ",e(x,{icon:`eye-${le?"close":"open"}`})]})]}),!!G&&e(Lr,{lang:te,maxOptions:$,maxExpiration:z,minExpiration:R,maxCharactersPerOption:C,poll:G,disabled:d==="loading",onInput:T=>{if(T){const S={...T};Ae(S)}else Ae(null)}}),e("div",{class:"toolbar wrap",style:{justifyContent:"flex-end"},children:[e("span",{children:[e("label",{class:"toolbar-button",children:[e("input",{type:"file",accept:E.join(","),multiple:A.length<v-1,disabled:d==="loading"||A.length>=v||!!G,onChange:T=>{const S=T.target.files;if(!S)return;const D=Array.from(S).map(I=>({file:I,type:I.type,size:I.size,url:URL.createObjectURL(I),id:null,description:null}));A.length+D.length>v?alert(`You can only attach up to ${v} files.`):se(I=>I.concat(D)),T.target.value=""}}),e(x,{icon:"attachment"})]})," ",e("button",{type:"button",class:"toolbar-button",disabled:d==="loading"||!!G||!!A.length,onClick:()=>{Ae({options:["",""],expiresIn:24*60*60,multiple:!1})},children:e(x,{icon:"poll",alt:"Add poll"})})," ",e("button",{type:"button",class:"toolbar-button",disabled:d==="loading",onClick:()=>{ye(!0)},children:e(x,{icon:"emoji2"})})]}),e("div",{class:"spacer"}),d==="loading"?e(Jt,{abrupt:!0}):e(xr,{maxCharacters:b,hidden:d==="loading"}),e("label",{class:`toolbar-button ${te!==fe.current?"highlight":""}`,children:[e("span",{class:"icon-text",children:(De=ur[te])==null?void 0:De.native}),e("select",{name:"language",value:te,onChange:T=>{const{value:S}=T.target;re(S||Xe),N.session.set("currentLanguage",S||Xe)},disabled:d==="loading",children:[_e.map(([T,S,D])=>e("option",{value:T,children:[S," (",D,")"]},T)),e("hr",{}),ie.map(([T,S,D])=>e("option",{value:T,children:[S," (",D,")"]},T))]})]})," ",e("button",{type:"submit",class:"large",disabled:d==="loading",children:n?"Reply":a?"Update":"Post"})]})]})]}),Se&&e(Yt,{class:"light",onClick:T=>{T.target===T.currentTarget&&ye(!1)},children:e(Cr,{masto:c,instance:u,onClose:()=>{ye(!1)},onSelect:T=>{const S=` ${T} `,D=B.current;if(!D)return;const{selectionStart:I,selectionEnd:J}=D,j=D.value,U=j.slice(0,I)+S+j.slice(J);D.value=U,D.selectionStart=D.selectionEnd=J+S.length,D.focus(),D.dispatchEvent(new Event("input"))}})})]})}function da(t){if(!t)return;const{value:n,offsetHeight:a,scrollHeight:r,clientHeight:o}=t;if(a<window.innerHeight){const s=a-o,c=n?r+s+"px":null;t.style.height=c}}const Er=va((t,n)=>{var b;const{masto:a}=We(),[r,o]=Q(((b=n.current)==null?void 0:b.value)||""),{maxCharacters:s,performSearch:c=()=>{},...u}=t,d=ee();ve(()=>{(async()=>{try{const v=await a.v1.customEmojis.list();d.current=v}catch{}})()},[]);const f=ee(),m=ee("");ve(()=>{let v,y,E;return f.current&&(v=L=>{const{key:w,provide:k,text:F}=L.detail;if(m.current=F,F===""){k(Promise.resolve({matched:!1}));return}if(w===":"){const $=Ar(d.current,F);let C="";$.forEach(z=>{const{shortcode:R,url:B}=z;C+=`
|
||
<li role="option" data-value="${Ue(R)}">
|
||
<img src="${Ue(B)}" width="16" height="16" alt="" loading="lazy" />
|
||
:${Ue(R)}:
|
||
</li>`}),qe.innerHTML=C,k(Promise.resolve({matched:$.length>0,fragment:qe}));return}const O={"@":"accounts","#":"hashtags"}[w];k(new Promise($=>{c({type:O,q:F,limit:5}).then(z=>{if(F!==m.current)return;const R=z[O]||z;let B="";R.forEach(H=>{var se;const{name:W,avatarStatic:pe,displayName:le,username:Y,acct:te,emojis:re,history:fe}=H,A=xn(le,re);if(te)B+=`
|
||
<li role="option" data-value="${Ue(te)}">
|
||
<span class="avatar">
|
||
<img src="${Ue(pe)}" width="16" height="16" alt="" loading="lazy" />
|
||
</span>
|
||
<span>
|
||
<b>${A||Y}</b>
|
||
<br>@${Ue(te)}
|
||
</span>
|
||
</li>
|
||
`;else{const G=(se=fe==null?void 0:fe.reduce)==null?void 0:se.call(fe,(Ae,ce)=>Ae+ +ce.uses,0);B+=`
|
||
<li role="option" data-value="${Ue(W)}">
|
||
<span class="grow">#<b>${Ue(W)}</b></span>
|
||
${G?`<span class="count">${Ke(G)}</span>`:""}
|
||
</li>
|
||
`}qe.innerHTML=B}),$({matched:R.length>0,fragment:qe})})}))},f.current.addEventListener("text-expander-change",v),y=L=>{const{key:w,item:k}=L.detail;w===":"?L.detail.value=`:${k.dataset.value}:`:L.detail.value=`${w}${k.dataset.value}`},f.current.addEventListener("text-expander-value",y),E=L=>{const{input:w}=L.detail;if(o(w.value),n.current){const k=new Event("input",{bubbles:!0});n.current.dispatchEvent(k)}},f.current.addEventListener("text-expander-committed",E)),()=>{f.current&&(f.current.removeEventListener("text-expander-change",v),f.current.removeEventListener("text-expander-value",y),f.current.removeEventListener("text-expander-committed",E))}},[]),ve(()=>{const v=n.current;if(!v)return;new ResizeObserver(()=>{if(f.current){const{height:E}=v.getBoundingClientRect();f.current.style.height=E+"px"}}).observe(v)},[]);const p=ee(0),h=ee(),g=ba(v=>{var L;if(!h.current)return;if(p.current>3){h.current.innerHTML="",h.current=null,(L=g==null?void 0:g.cancel)==null||L.call(g);return}let y,E;p.current<=3&&(y=Date.now()),h.current.innerHTML=wr(v,{maxCharacters:s})+`
|
||
`,p.current<=3&&(E=Date.now()),y&&E&&E-y>50&&p.current++},500);return e("text-expander",{ref:f,keys:"@ # :",class:"compose-field-container",children:[e("textarea",{class:"compose-field",autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",rows:"6",cols:"50",...u,ref:n,name:"status",value:r,onKeyDown:v=>{const{key:y,target:E}=v;if(y==="Enter")try{const{value:L,selectionStart:w}=E,F=L.slice(0,w).split(`
|
||
`).slice(-1)[0];if(F&&/^\s*(-|\d+\.)\s/.test(F)){const[O,$,C,z,R]=F.match(/^(\s*)(-|\d+\.)(\s+)(.+)?/)||[];if(R){v.preventDefault();const[B]=C.match(/\d+/)||[],H=B?`${+B+1}.`:"-",W=`
|
||
${$}${H}${z}`;E.setRangeText(W,w,w);const pe=w+W.length;E.setSelectionRange(pe,pe)}else{const B=w-F.length;E.setRangeText("",B,w)}da(E),E.dispatchEvent(new Event("input"))}}catch{}h.current&&(h.current.scrollTop=E.scrollTop)},onInput:v=>{var L;const{target:y}=v,E=y.value;o(E),da(y),(L=t.onInput)==null||L.call(t,v),g(E)},style:{width:"100%",height:"4em"},onScroll:v=>{if(h.current){const{scrollTop:y}=v.target;h.current.scrollTop=y}}}),e("div",{ref:h,class:"compose-highlight","aria-hidden":"true"})]})});function xr({maxCharacters:t=500,hidden:n}){const r=rt(M).composerCharacterCount,o=t-r;return n?e("meter",{class:"donut",hidden:!0}):e("meter",{class:`donut ${o<=-10?"explode":o<=0?"danger":o<=20?"warning":""}`,value:r,max:t,"data-left":o,title:`${o}/${t}`,style:{"--percentage":r/t*100}})}function Tr({attachment:t,disabled:n,lang:a,onDescriptionChange:r=()=>{},onRemove:o=()=>{}}){const[s,c]=Q("default"),u=Ra("@mastodon/edit-media-attributes"),{type:d,id:f,file:m}=t,p=Ee(()=>m?URL.createObjectURL(m):t.url,[m,t.url]),[h,g]=Q(t.description),[b,v]=d.split("/"),y=No(r,250),[E,L]=Q(!1),w=ee(null);ve(()=>{let O;return E&&w.current&&(O=setTimeout(()=>{w.current.focus()},100)),()=>{clearTimeout(O)}},[E]);const k=e(K,{children:f&&!u?e("div",{class:"media-desc",children:[e("span",{class:"tag",children:"Uploaded"}),e("p",{title:h,children:t.description||e("i",{children:"No description"})})]}):e("textarea",{ref:w,value:h||"",lang:a,placeholder:{image:"Image description",video:"Video description",audio:"Audio description"}[b],autoCapitalize:"sentences",autoComplete:"on",autoCorrect:"on",spellCheck:"true",dir:"auto",disabled:n||s==="loading",class:s==="loading"?"loading":"",maxlength:"1500",onInput:O=>{const{value:$}=O.target;g($),y($)}})}),F=ee(null);return ve(()=>()=>{var O,$;($=(O=F.current)==null?void 0:O.hideToast)==null||$.call(O)},[]),e(K,{children:[e("div",{class:"media-attachment",children:[e("div",{class:"media-preview",tabIndex:"0",onClick:()=>{L(!0)},children:b==="image"?e("img",{src:p,alt:""}):b==="video"||b==="gifv"?e("video",{src:p,playsinline:!0,muted:!0}):b==="audio"?e("audio",{src:p,controls:!0}):null}),k,e("div",{class:"media-aside",children:e("button",{type:"button",class:"plain close-button",disabled:n,onClick:o,children:e(x,{icon:"x"})})})]}),E&&e(Yt,{class:"light",onClick:O=>{O.target===O.currentTarget&&L(!1)},children:e("div",{id:"media-sheet",class:"sheet sheet-max",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>{L(!1)},children:e(x,{icon:"x"})}),e("header",{children:e("h2",{children:{image:"Edit image description",video:"Edit video description",audio:"Edit audio description"}[b]})}),e("main",{tabIndex:"-1",children:[e("div",{class:"media-preview",children:b==="image"?e("img",{src:p,alt:""}):b==="video"||b==="gifv"?e("video",{src:p,playsinline:!0,controls:!0}):b==="audio"?e("audio",{src:p,controls:!0}):null}),e("div",{class:"media-form",children:[k,e("footer",{children:[b==="image"&&/^(png|jpe?g|gif|webp)$/i.test(v)&&!!M.settings.mediaAltGenerator&&!!ca&&e(En,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",title:"More",class:"plain",children:e(x,{icon:"more",size:"l",alt:"More"})}),children:e(xe,{disabled:s==="loading",onClick:()=>{c("loading"),F.current=we({text:"Generating description. Please wait...",duration:-1}),async function(){var O,$;try{const C=new FormData;C.append("image",m);const z=await fetch(ca,{method:"POST",body:C}).then(R=>R.json());if(z.error)throw new Error(z.error);g(z.description)}catch(C){we(`Failed to generate description${C!=null&&C.message?`: ${C.message}`:""}`)}finally{c("default"),($=(O=F.current)==null?void 0:O.hideToast)==null||$.call(O)}}()},children:[e(x,{icon:"sparkles2"}),e("span",{children:"Generate description…"})]})}),e("button",{type:"button",class:"light block",onClick:()=>{L(!1)},disabled:s==="loading",children:"Done"})]})]})]})]})})]})}function Lr({lang:t,poll:n,disabled:a,onInput:r=()=>{},maxOptions:o,maxExpiration:s,minExpiration:c,maxCharactersPerOption:u}){const{options:d,expiresIn:f,multiple:m}=n;return e("div",{class:`poll ${m?"multiple":""}`,children:[e("div",{class:"poll-choices",children:d.map((p,h)=>e("div",{class:"poll-choice",children:[e("input",{required:!0,type:"text",value:p,disabled:a,maxlength:u,placeholder:`Choice ${h+1}`,lang:t,spellCheck:"true",dir:"auto",onInput:g=>{const{value:b}=g.target;d[h]=b,r(n)}}),e("button",{type:"button",class:"plain2 poll-button",disabled:a||d.length<=1,onClick:()=>{d.splice(h,1),r(n)},children:e(x,{icon:"x",size:"s"})})]},h))}),e("div",{class:"poll-toolbar",children:[e("button",{type:"button",class:"plain2 poll-button",disabled:a||d.length>=o,onClick:()=>{d.push(""),r(n)},children:"+"})," ",e("label",{class:"multiple-choices",children:[e("input",{type:"checkbox",checked:m,disabled:a,onChange:p=>{const{checked:h}=p.target;n.multiple=h,r(n)}})," ","Multiple choices"]}),e("label",{class:"expires-in",children:["Duration"," ",e("select",{value:f,disabled:a,onChange:p=>{const{value:h}=p.target;n.expiresIn=h,r(n)},children:Object.entries(Na).filter(([p,h])=>h>=c&&h<=s).map(([p,h])=>e("option",{value:h,children:p},h))})]})]}),e("div",{class:"poll-toolbar",children:e("button",{type:"button",class:"plain remove-poll-button",disabled:a,onClick:()=>{r(null)},children:"Remove poll"})})]})}function Ar(t,n){return n=n.toLowerCase(),t.sort((a,r)=>{let o=a.shortcode.toLowerCase(),s=r.shortcode.toLowerCase(),c=o.startsWith(n),u=s.startsWith(n),d=o.includes(n),f=s.includes(n);return c&&u?a.length-r.length:c?-1:u?1:d&&f?a.length-r.length:d?-1:f?1:0}).slice(0,5)}function Ue(t){return t.replace(/[&<>"']/g,function(n){return"&#"+n.charCodeAt(0)+";"})}function ma(t){for(let n in t)(t[n]===null||t[n]===void 0)&&delete t[n];return t}function Cr({masto:t,instance:n,onClose:a=()=>{},onSelect:r=()=>{}}){const[o,s]=Q("default"),c=ee([]),[u,d]=Q({}),f=Ee(()=>N.account.get("recentlyUsedCustomEmojis")||[]);return ve(()=>{s("loading"),(async()=>{try{const m=await t.v1.customEmojis.list(),p={"--recent--":f.filter(g=>m.find(b=>b.shortcode===g.shortcode))},h=[];m.forEach(g=>{var b,v;if(g.visibleInPicker){if((v=(b=c.current)==null?void 0:b.push)==null||v.call(b,g),!g.category){h.push(g);return}p[g.category]||(p[g.category]=[]),p[g.category].push(g)}}),h.length&&(p["--others--"]=h),d(p),s("default")}catch{s("error")}})()},[]),e("div",{id:"custom-emojis-sheet",class:"sheet",children:[!!a&&e("button",{type:"button",class:"sheet-close",onClick:a,children:e(x,{icon:"x"})}),e("header",{children:[e("b",{children:"Custom emojis"})," ",o==="loading"?e(Jt,{}):e("small",{class:"insignificant",children:[" • ",n]})]}),e("main",{children:e("div",{class:"custom-emojis-list",children:[o==="error"&&e("div",{class:"ui-state",children:e("p",{children:"Error loading custom emojis"})}),o==="default"&&Object.entries(u).map(([m,p])=>!!(p!=null&&p.length)&&e(K,{children:[e("div",{class:"section-header",children:{"--recent--":"Recently used","--others--":"Others"}[m]||m}),e("section",{children:p.map(h=>e("button",{type:"button",class:"plain4",onClick:()=>{a(),requestAnimationFrame(()=>{r(`:${h.shortcode}:`)});let g=N.account.get("recentlyUsedCustomEmojis")||[];const b=g.findIndex(v=>v.shortcode===h.shortcode);b!==-1?(g.splice(b,1),g.unshift(h)):(g.unshift(h),g=g.filter(v=>{var y,E;return(E=(y=c.current)==null?void 0:y.find)==null?void 0:E.call(y,L=>L.shortcode===v.shortcode)}),g=g.slice(0,10)),N.account.set("recentlyUsedCustomEmojis",g)},title:`:${h.shortcode}:`,children:e("picture",{children:[!!h.staticUrl&&e("source",{srcset:h.staticUrl,media:"(prefers-reduced-motion: reduce)"}),e("img",{class:"shortcode-emoji",src:h.url||h.staticUrl,alt:h.shortcode,width:"16",height:"16",loading:"lazy",decoding:"async"})]})},h))})]}))]})})]})}var Sr={PHANPY_CLIENT_NAME:"Phanpy",PHANPY_WEBSITE:"https://phanpy.social",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",VITE_APP_ENV:"production",BASE_URL:"./",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{PHANPY_CLIENT_NAME:ha}=Sr;function Nr(t,n){function a(){const{currentLocation:r}=M,o=Array.isArray(n);let s=o?n:[];!o&&/:?\w+\?/.test(n)&&(s.push(n.replace(/(:\w+)\?/g,"$1")),s.push(n.replace(/\/?:\w+\?/g,"")));let c=!1;s.length?c=s.some(u=>Gn(u,r)):n&&(c=Gn(n,r)),c&&(document.title=t?`${t} / ${ha}`:ha)}bn(()=>{const r=fa(M,"currentLocation",a);return a(),r},[t,n])}export{La as $,Ge as A,_t as B,aa as C,Yi as D,xt as E,oa as F,zr as G,jt as H,x as I,Bo as J,Pe as K,it as L,Yt as M,yt as N,ji as O,Ma as P,Fa as Q,Tt as R,sa as S,zi as T,Or as U,Oa as V,Nr as W,wn as X,wa as Y,Zo as Z,fn as _,We as a,Ve as a0,Rr as a1,Ir as a2,Mr as a3,Dr as a4,Me as b,we as c,N as d,En as e,cn as f,Wt as g,$a as h,Ra as i,Fi as j,Ti as k,ln as l,Pa as m,Ke as n,Ta as o,Gt as p,Lt as q,Pr as r,M as s,pi as t,ei as u,Jt as v,Tn as w,na as x,Vt as y,qt as z};
|
||
function __vite__mapDeps(indexes) {
|
||
if (!__vite__mapDeps.viteFileDeps) {
|
||
__vite__mapDeps.viteFileDeps = []
|
||
}
|
||
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
|
||
}
|
||
//# sourceMappingURL=useTitle-Dle6_vca.js.map
|