PageSourceSearch

https://infosec.exchange/packs/poll-CiSbVnkU.js

js infosec.exchange collected 2026-09-24 07:26:00 UTC 23,605 bytes, 2 lines download raw bytes

1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{n as t,t as n}from"./jsx-runtime-D3F0h15I.js";import{a as r,c as i,s as a}from"./react-intl-CZJDGRhA.js";import{r as o}from"./preload-helper-C17SfWRL.js";import{n as s}from"./esm-DrOrXu-Y.js";import{j as c,t as l,w as u}from"./initial_state-CQfWVRE7.js";import{a as d}from"./locales-DZmLvkbO.js";import{A as f,C as p,D as m,E as h,M as g,O as _,P as v,S as y,T as b,b as x,j as S,n as C,v as w,w as T,x as E,y as D}from"./chevron_right-D7sFWRVh.js";import{Lt as O,Mt as k,Tt as A,en as j,wt as M}from"./detect-it.esm-DVND6rlI.js";import{Ma as ee,Mn as te,Na as N,Nn as ne,Pa as re,a as P,at as F,c as ie,d as ae,eo as oe,f as se,g as ce,go as le,io as ue,l as de,lt as fe,o as pe,p as me,pn as he,r as ge,rt as _e,s as ve,u as ye,yi as be}from"./time-BMcu91WH.js";import{b as xe,f as Se}from"./react-router-D0L-bsDO.js";import{i as Ce,o as we}from"./api-CFnNWVnx.js";import{$ as Te,J as Ee}from"./accounts_typed-Dtk3HjqX.js";import{a as De,n as Oe,o as I,s as L,t as ke}from"./typed_functions--Rew8955.js";import"./locale-BNeEG1rT.js";import{t as Ae}from"./react-router-dom-o_eSX_Kh.js";import{n as je,t as Me}from"./modal-CxkWa4aF.js";import{t as Ne}from"./classnames-CfLRLWYq.js";import{t as R}from"./short_number-CHNMv1Rn.js";import{t as Pe}from"./skeleton-B7DUl0I_.js";var z=e(Ne()),B=n(),V=({size:e,strokeWidth:t,className:n,...r})=>{let i=`0 0 ${e} ${e}`,a=(e-t)/2;return(0,B.jsx)(`svg`,{width:e,height:e,viewBox:i,className:(0,z.default)(`circular-progress`,n),role:`progressbar`,...r,children:(0,B.jsx)(`circle`,{fill:`none`,cx:e/2,cy:e/2,r:a,strokeWidth:`${t}px`})})},Fe=a({loading:{id:`loading_indicator.label`,defaultMessage:`Loading…`}}),Ie=({role:e=`progressbar`})=>{let t=i();return(0,B.jsx)(`div`,{className:`loading-indicator`,...e===`progressbar`?{role:e,"aria-busy":!0,"aria-live":`polite`}:void 0,"aria-label":t.formatMessage(Fe.loading),children:(0,B.jsx)(V,{size:50,strokeWidth:2})})},H=e(t());function Le(e){let[{previous:t,current:n},r]=(0,H.useState)(()=>({previous:void 0,current:e})),i=t;return e!==n&&(r({previous:n,current:e}),i=n),i}var U=e=>e<0?0:e<=1?e:`1+`,Re=({value:e,obfuscate:t})=>{let[n,r]=(0,H.useState)(e),i=e>n?-1:1,[a,o]=v(()=>({from:{transform:`translateY(${100*i}%)`},to:{transform:`translateY(0%)`},onRest(){r(e)},config:{...g.gentle,duration:200},immediate:!0}),[e,n]);return(0,H.useEffect)(()=>{e!==n&&o.start({reset:!0})},[o,n,e]),c?t?(0,B.jsx)(B.Fragment,{children:U(e)}):(0,B.jsx)(R,{value:e}):(0,B.jsxs)(`span`,{className:`animated-number`,children:[(0,B.jsx)(S.span,{style:a,children:t?U(e):(0,B.jsx)(R,{value:e})}),e!==n&&(0,B.jsxs)(S.span,{style:{...a,position:`absolute`,top:`${-100*i}%`},role:`presentation`,children:[(0,B.jsx)(R,{value:n}),t?U(n):(0,B.jsx)(R,{value:n})]})]})},W=({id:e,icon:t,className:n,"aria-label":r,noFill:i=!1,...a})=>{if(!t){if(!d())throw Error(`<Icon id="${e}" className="${n}"> is missing an "icon" prop.`);t=_}let o=!r||void 0,s=o?void 0:`img`,c=r||``;return(0,B.jsx)(t,{className:(0,z.default)(`icon`,e&&`icon-${e}`,i&&`icon--no-fill`,n),title:c,"aria-hidden":o,"aria-label":r,role:s,...a})},ze=(e,t)=>n=>(0,B.jsx)(e,{...n,weight:t||`regular`});function Be(e,t){return(0,H.useCallback)(n=>(0,B.jsx)(e,{...n,weight:t||`regular`}),[e,t])}var G=(0,H.forwardRef)(({className:e,expanded:t,icon:n,iconComponent:r,inverted:i,title:a,counter:o,href:s,style:c,activeStyle:l,onClick:u,onKeyDown:d,onMouseDown:f,active:p=!1,disabled:m=!1,animate:h=!1,overlay:g=!1,tabIndex:_=0,ariaHidden:v=!1,ariaControls:y,label:b,obfuscateCount:x},S)=>{let C=(0,H.useCallback)(e=>{e.preventDefault(),m||u?.(e)},[m,u]),w=(0,H.useCallback)(e=>{m||f?.(e)},[m,f]),T=(0,H.useCallback)(e=>{m||d?.(e)},[m,d]),E={...c,...p?l:{}},D=Le(p)??p,O=h&&p!==D,k=(0,z.default)(e,`icon-button`,{active:p,disabled:m,inverted:i,activate:O&&p,deactivate:O&&!p,overlayed:g,"icon-button--with-counter":o!==void 0}),A=(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(W,{id:n,icon:r,"aria-hidden":`true`}),` `,o!==void 0&&(0,B.jsx)(`span`,{className:`icon-button__counter`,children:(0,B.jsx)(Re,{value:o,obfuscate:x})}),b]});return s!=null&&(A=(0,B.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,children:A})),(0,B.jsx)(`button`,{type:`button`,"aria-label":a,"aria-expanded":t,"aria-hidden":v,"aria-controls":y,title:a,className:k,onClick:C,onMouseDown:w,onKeyDown:T,style:E,tabIndex:_,disabled:m,ref:S,
1children:A})});G.displayName=`IconButton`;var Ve=e(o()),He=e(O());k();var K=e(xe()),Ue=e(Se()),We=K.default.shape({signedIn:K.default.bool.isRequired,accountId:K.default.string,disabledAccountId:K.default.string}).isRequired,Ge=e=>({signedIn:!!e.meta.me,accountId:e.meta.me,disabledAccountId:e.meta.disabled_account_id,permissions:e.role?.permissions??0}),q=(0,H.createContext)({signedIn:!1,permissions:0,accountId:void 0,disabledAccountId:void 0}),Ke=()=>(0,H.useContext)(q);function qe(e){let t=`withIdentity(${e.displayName??e.name})`,n=t=>{let{wrappedComponentRef:n,...r}=t;return(0,B.jsx)(q.Consumer,{children:t=>(0,B.jsx)(e,{...r,identity:t,ref:n})})};return n.displayName=t,n.WrappedComponent=e,(0,Ue.default)(n,e)}var Je=Oe([e=>e.emojis.custom],e=>{let t={};for(let n in e){let r=e[n];r&&(t[n]={shortcode:n,...r})}return t});function Ye(){return L(Je)}var J=(0,H.createContext)(null),Y=f(({children:e,as:t=`div`,className:n,onMouseEnter:r,onMouseLeave:i,...a},o)=>{let[s,c]=(0,H.useState)(l??!1),u=(0,H.useCallback)(e=>{r?.(e),l||c(!0)},[r]),d=(0,H.useCallback)(e=>{i?.(e),l||c(!1)},[i]);return(0,H.useContext)(J)===null?(0,B.jsx)(t,{...a,className:n,onMouseEnter:u,onMouseLeave:d,ref:o,children:(0,B.jsx)(J.Provider,{value:s,children:e})}):(0,B.jsx)(t,{...a,className:n,ref:o,children:e})});Y.displayName=`AnimateEmojiProvider`;var Xe=(0,H.createContext)({}),Ze=({children:e,emojis:t})=>{let n=(0,H.useMemo)(()=>ee(t),[t]);return n?(0,B.jsx)(Xe.Provider,{value:n,children:e}):e},Qe=({children:e})=>{let t=Ye();return(0,B.jsx)(Ze,{emojis:t,children:e})},$e=({code:e,showFallback:t=!0,showLoading:n=!0})=>{let r=(0,H.useContext)(Xe),[i,a]=(0,H.useState)(()=>se(e,r)),o=ce();(0,H.useEffect)(()=>{i!==null&&ye(i,o.currentLocale).then(a)},[o.currentLocale,i]);let s=(0,H.useContext)(J),c=t?e:null;if(!i)return c;if(!de(i))return n?(0,B.jsx)(`span`,{className:`emojione emoji-loading`,title:e}):c;let l=i.type===`unicode`&&N(i.data.unicode);if(!ae(i,o.mode))return i.type===`unicode`?i.data.unicode:e;if(i.type===`custom`){let e=`:${i.code}:`;return(0,B.jsx)(`img`,{src:s?i.data.url:i.data.static_url,alt:e,title:e,className:`emojione custom-emoji`,loading:`lazy`})}let u=re({unicodeHex:i.code,...o});return(0,B.jsx)(`img`,{src:u,alt:i.data.unicode,title:i.data.label,className:(0,z.default)(`emojione`,l),loading:`lazy`})};function et(e){return me(e).map((e,t)=>typeof e==`string`?e:(0,B.jsx)($e,{code:e.code},`emoji-${e.code}-${t}`))}var X=({extraEmojis:e,htmlString:t,onElement:n,onAttribute:r,extraArgs:i,children:a,...o})=>{let s=(0,H.useMemo)(()=>le(t,{onText:et,onElement:n,onAttribute:r,extraArgs:i}),[i,t,r,n]);return(0,B.jsx)(Ze,{emojis:e,children:(0,B.jsxs)(Y,{...o,children:[s,a]})})},tt=`xn--`,nt=e=>e.split(`.`).map(e=>e.startsWith(tt)?m.decode(e.slice(4)):e).join(`.`),rt=e=>{let[t,n]=(0,H.useState)(e??!1);return{hovering:t,handleMouseEnter:(0,H.useCallback)(()=>{e||n(!0)},[e]),handleMouseLeave:(0,H.useCallback)(()=>{e||n(!1)},[e])}},it=Oe([e=>e.accounts,(e,t)=>t],(e,t)=>t?e.get(t):void 0);function at(e){let t=L(t=>it(t,e)),n=I(),r=!!t;return(0,H.useEffect)(()=>{e&&!r&&n(oe(e))},[e,r,n]),t}var ot=({account:e,alt:t=``,animate:n=l,size:r=20,inline:i=!1,withLink:a=!1,style:o,className:s,counter:c,counterBorderColor:u})=>{let{hovering:d,handleMouseEnter:f,handleMouseLeave:p}=rt(n),[m,h]=(0,H.useState)(!0),[g,_]=(0,H.useState)(!1),v=r===null?o:{...o,width:`${r}px`,height:`${r}px`},y=d||n?e?.avatar:e?.avatar_static,b=(0,H.useCallback)(()=>{h(!1)},[h]),x=(0,H.useCallback)(()=>{_(!0)},[_]),S=(0,B.jsxs)(`span`,{className:(0,z.default)(s,`account__avatar`,{"account__avatar--inline":i,"account__avatar--loading":m}),onMouseEnter:f,onMouseLeave:p,style:v,"data-avatar-of":e&&`@${e.acct}`,children:[y&&!g&&(0,B.jsx)(`img`,{src:y,alt:t,onLoad:b,onError:x}),c&&(0,B.jsx)(`span`,{className:`account__avatar__counter`,style:{borderColor:u},children:c})]});return a?(0,B.jsx)(Ae,{to:`/@${e?.acct}`,title:`@${e?.acct}`,"data-hover-card-account":e?.id,children:S}):S},st=({accountId:e,...t})=>{let n=at(e);return(0,B.jsx)(ot,{account:n,...t})},ct=({account:e,className:t,children:n,localDomain:r,...i})=>(0,B.jsxs)(Y,{...i,as:`span`,className:(0,z.default)(`display-name`,t),children:[(0,B.jsx)(`bdi`,{children:e?(0,B.jsx)(X,{className:`display-name__html`,htmlString:e.display_name_html,as:`strong`,extraEmojis:e.emojis}):(0,B.jsx)(`strong`,{className:`display-name__html`,children:(0,B.jsx)(Pe,{width:`10ch`})})}),n]}
1),lt=a({invalidHandle:{id:`account.hame.invalid_handle`,defaultMessage:`Handle unavailable`}});function ut(e,t){let n=i();return(0,H.useMemo)(()=>{if(!e)return null;if(e.invalid_handle)return n.formatMessage(lt.invalidHandle);let r=e.acct;return!r.includes(`@`)&&t&&(r=`${r}@${t}`),`@${r}`},[e,t,n])}var dt=({account:e,localDomain:t,className:n,...r})=>{let i=ut(e,t);return(0,B.jsxs)(ct,{account:e,className:n,...r,children:[` `,(0,B.jsx)(`span`,{className:`display-name__account`,children:i??(0,B.jsx)(Pe,{width:`7ch`})})]})},ft=({account:e,localDomain:t,...n})=>e?(0,B.jsx)(`bdi`,{children:(0,B.jsx)(X,{...n,as:`span`,htmlString:e.display_name_html,extraEmojis:e.emojis})}):null;function pt(e,t,n=!0){let r=(0,H.useEffectEvent)(n=>{let r=Array.isArray(e)?e:[e];for(let e of r){let t=e instanceof Element?e:e?.current;if(t&&(t===n.target||t===document.activeElement||t.contains(n.target)||t.contains(document.activeElement)))return}t(n)});(0,H.useEffect)(()=>n?(document.addEventListener(`click`,r),()=>{document.removeEventListener(`click`,r)}):()=>null,[n])}var mt=({container:e,children:t})=>e===null?t:(0,Ve.createPortal)(t,e??document.body),ht=({isOpen:e,onClose:t,reference:n,popoverElement:r,placement:i=`bottom`,offset:a,strategy:o=`absolute`,flip:s=!0,container:c,matchReferenceWidth:l=!1,closeOnClickOutside:u=!0,children:d})=>{let{placement:f,update:m,refs:h,floatingStyles:g,middlewareData:_,elements:v}=T({elements:{reference:n,floating:r},placement:i,strategy:o,whileElementsMounted:b,middleware:[E(a),x(),y(),s?w():null,l?p({apply({rects:e,elements:t}){Object.assign(t.floating.style,{minWidth:`${e.reference.width}px`})}}):null,D()]});if(pt([v.floating,v.reference instanceof Element?v.reference:null],e=>{t(e)},e&&u),(0,H.useEffect)(()=>{if(!e)return()=>null;function n(e){e.key===`Escape`&&t(e)}return document.addEventListener(`keyup`,n),()=>{document.removeEventListener(`keyup`,n)}},[e,t]),!e)return null;let S={style:g,"data-popover-placement":f,"data-popover-reference-hidden":_.hide?.referenceHidden,"data-popover-escaped":_.hide?.escaped};return r||(S.ref=h.setFloating),(0,B.jsx)(mt,{container:c,children:d({placement:f,update:m,props:S})})},gt=(0,H.memo)(({hash:e,width:t=32,height:n=t,dummy:r=!1,...i})=>{let a=(0,H.useRef)(null);return(0,H.useEffect)(()=>{let i=a.current;if(i.width=i.width,!r&&e)try{let r=s(e,t,n),a=i.getContext(`2d`),o=a?.createImageData(t,n);o?.data.set(r),o&&a?.putImageData(o,0,0)}catch(t){console.error(`Blurhash decoding failure`,{err:t,hash:e})}},[r,e,t,n]),(0,B.jsx)(`canvas`,{...i,ref:a,width:t,height:n})});function _t(e){return L(t=>F(t,e))}function vt(e){return L(t=>_e(t,e??void 0))}var Z=e=>e===null||typeof e==`object`&&`text`in e,Q=e=>!e||!Z(e)?!1:`action`in e,yt=e=>!e||!Z(e)?!1:`href`in e,bt=0,$=({item:e})=>
1{if(e===null)return null;let{text:t,description:n,icon:r,iconId:i}=e;return(0,B.jsxs)(B.Fragment,{children:[r&&(0,B.jsx)(W,{icon:r,id:i??t.toLowerCase().replaceAll(/[^a-z]+/g,`-`)}),(0,B.jsxs)(`span`,{className:`dropdown-menu__item-content`,children:[t,!!n&&(0,B.jsx)(`span`,{className:`dropdown-menu__item-subtitle`,children:n})]})]})},xt=({items:e,loading:t,scrollable:n,onClose:r,openedViaKeyboard:i,renderItem:a,renderHeader:o,onItemClick:s})=>{let c=(0,H.useRef)(null);(0,H.useEffect)(()=>{let e=e=>{e.target instanceof Node&&c.current&&!c.current.contains(e.target)&&(r(),e.stopPropagation(),e.preventDefault())},t=e=>{if(!c.current)return;let t=Array.from(c.current.querySelectorAll(`a, button`)),n=document.activeElement?t.indexOf(document.activeElement):-1,i;switch(e.key){case`ArrowDown`:i=t[n+1]??t[0];break;case`ArrowUp`:i=t[n-1]??t[t.length-1];break;case`Tab`:i=e.shiftKey?t[n-1]??t[t.length-1]:t[n+1]??t[0];break;case`Home`:i=t[0];break;case`End`:i=t[t.length-1];break;case`Escape`:r()}i&&i instanceof HTMLElement&&(i.focus(),e.preventDefault(),e.stopPropagation())};return document.addEventListener(`click`,e,{capture:!0}),document.addEventListener(`keydown`,t,{capture:!0}),i&&(c.current?.querySelector(`li:first-child > :is(a, button)`))?.focus({preventScroll:!0}),()=>{document.removeEventListener(`click`,e,{capture:!0}),document.removeEventListener(`keydown`,t,{capture:!0})}},[r,i]);let l=(0,H.useCallback)(t=>{let n=Number(t.currentTarget.getAttribute(`data-index`)),i=e?.[n],a=!!(i&&typeof i==`object`&&`disabled`in i&&i.disabled);i&&!a&&(r(),typeof s==`function`?(t.preventDefault(),s(i,n)):Q(i)&&(t.preventDefault(),i.action(t)))},[r,s,e]),u=a??((e,t)=>{if(!Z(e))return null;if(e===null)return(0,B.jsx)(`li`,{className:`dropdown-menu__separator`},`sep-${t}`);let{text:n,highlighted:r,disabled:i,dangerous:a}=e,o;return o=Q(e)?(0,B.jsx)(`button`,{onClick:l,"data-index":t,"aria-disabled":i,type:`button`,children:(0,B.jsx)($,{item:e})}):yt(e)?(0,B.jsx)(`a`,{href:e.href,target:e.target??`_target`,"data-method":e.method,rel:`noopener`,onClick:l,"data-index":t,children:(0,B.jsx)($,{item:e})}):(0,B.jsx)(Ae,{to:e.to,onClick:l,"data-index":t,children:(0,B.jsx)($,{item:e})}),(0,B.jsx)(`li`,{className:(0,z.default)(`dropdown-menu__item`,{"dropdown-menu__item--highlighted":r,"dropdown-menu__item--dangerous":a}),children:o},`${n}-${t}`)});return(0,B.jsxs)(`div`,{className:(0,z.default)(`dropdown-menu__container`,{"dropdown-menu__container--loading":t}),ref:c,children:[(t||!e)&&(0,B.jsx)(V,{size:30,strokeWidth:3.5}),!t&&o&&e&&(0,B.jsx)(`div`,{className:`dropdown-menu__container__header`,children:o(e)}),!t&&e&&(0,B.jsx)(`ul`,{className:(0,z.default)(`dropdown-menu__container__list`,{"dropdown-menu__container__list--scrollable":n}),children:e.map((e,t)=>u(e,t,l))})]})},St=({children:e,icon:t,iconComponent:n,iconClassName:r,items:i,loading:a,title:o=`Menu`,disabled:s,scrollable:c,placement:l=`bottom`,offset:u=5,status:d,needsStatusRefresh:f,forceDropdown:p=!1,className:m,renderItem:h,renderHeader:g,onOpen:_,onItemClick:v,scrollKey:y})=>{let b=I(),x=L(e=>e.dropdownMenu.openId),S=L(e=>e.dropdownMenu.keyboard),[C]=(0,H.useState)(bt++),w=C===x,[T,E]=(0,H.useState)(null),D=(0,H.useId)(),O=d?d.getIn([`account`,`id`]):void 0,k=d?.get(`id`),A=(0,H.useCallback)(()=>{T&&T.focus({preventScroll:!0}),b(Me({modalType:`ACTIONS`,ignoreFocus:!1})),b(te({id:C}))},[T,b,C]),j=(0,H.useCallback)(e=>{let t=Number(e.currentTarget.getAttribute(`data-index`)),n=i?.[t];A(),n&&(typeof v==`function`?(e.preventDefault(),v(n,t)):Q(n)&&(e.preventDefault(),n.action(e)))},[A,v,i]),M=(0,H.useRef)(!1),ee=(0,H.useCallback)(e=>{(e.key===` `||e.key===`Enter`)&&(M.current=!0)},[]),N=(0,H.useCallback)(()=>{M.current=!1},[]),re=(0,H.useCallback)(e=>{if(w)A();else{if(_?.(e)===!1)return;O&&b(ue([O])),f&&k&&b(be(k,{forceFetch:!0,alsoFetchContext:!1})),he()&&!p?b(je({modalType:`ACTIONS`,modalProps:{actions:i,onClick:j,className:m}})):(b(ne({id:C,keyboard:M.current,scrollKey:y})),M.current=!1)}},[b,C,O,y,_,j,w,i,p,A,k,f,m]);(0,H.useEffect)(()=>()=>{C===x&&A()},[C,x,A]);let P,F={disabled:s,onClick:re,onKeyDown:ee,onKeyUp:N,onBlur:N,"aria-expanded":w,"aria-controls":D,ref:E};
1if(e)P=(0,H.cloneElement)(H.Children.only(e),F);else if(t&&n)P=(0,B.jsx)(G,{icon:w?`close`:t,iconComponent:n,title:o,active:w,className:r,...F});else return null;return(0,B.jsxs)(B.Fragment,{children:[P,(0,B.jsx)(ht,{isOpen:w,onClose:A,offset:u,placement:l,reference:T,children:({props:e,placement:t})=>(0,B.jsx)(`div`,{...e,className:m,id:D,children:(0,B.jsx)(`div`,{className:`dropdown-animation dropdown-menu ${t}`,children:(0,B.jsx)(xt,{items:i,loading:a,scrollable:c,onClose:A,openedViaKeyboard:S,renderItem:h,renderHeader:g,onItemClick:v})})})})]})},Ct=[(e,{id:t})=>e.getIn([`statuses`,t]),(e,{id:t})=>e.getIn([`statuses`,e.getIn([`statuses`,t,`reblog`])]),(e,{id:t})=>e.getIn([`accounts`,e.getIn([`statuses`,t,`account`])]),(e,{id:t})=>e.getIn([`accounts`,e.getIn([`statuses`,e.getIn([`statuses`,t,`reblog`]),`account`])]),fe,(e,{contextType:t})=>[`detailed`,`bookmarks`,`favourites`,`search`].includes(t)];function wt(e,t,n,r,i,a){if(!e)return{status:null,loadingState:`not-found`};if(e.get(`isLoading`)&&!e.get(`visibility`))return{status:null,loadingState:`loading`};let o=!1,s=!1;if((r||n).get(`id`)!==u&&i){let n=t?.get(`filtered`)||e.get(`filtered`)||M();if(!a&&n.some(e=>i.getIn([e.get(`filter`),`filter_action`])===`hide`))return{status:null,loadingState:`filtered`};let r=n.filter(e=>i.getIn([e.get(`filter`),`filter_action`])===`blur`);r.isEmpty()||(s=r.map(e=>i.getIn([e.get(`filter`),`title`]))),n=n.filter(e=>i.has(e.get(`filter`))&&i.getIn([e.get(`filter`),`filter_action`])!==`blur`),n.isEmpty()||(o=n.map(e=>i.getIn([e.get(`filter`),`title`])))}return t?(t=t.set(`account`,r),t=t.set(`matched_filters`,o)):t=null,{status:e.withMutations(e=>{e.set(`reblog`,t),e.set(`account`,n),e.set(`matched_filters`,o?o.toJS():!1),e.set(`matched_media_filters`,s?s.toJS():!1)}),loadingState:e.get(`isLoading`)?`loading`:`complete`}}var Tt=()=>j(Ct,(...e)=>{let{status:t}=wt(...e);return t}),Et=()=>j(Ct,wt),Dt=()=>j([(e,{id:t})=>e.picture_in_picture.statusId===t,e=>e.getIn([`meta`,`layout`])!==`mobile`],(e,t)=>A({inUse:e&&t,available:t})),Ot=()=>j([(e,t)=>t,(e,t,n)=>e.getIn([`accounts`,n])],(e,t)=>e.set(`account`,t)),kt=()=>j([(e,t)=>t,(e,t,n)=>e.getIn([`accounts`,n])],(e,t)=>e.set(`target_account`,t)),At={year:`numeric`,month:`short`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`},jt=({timestamp:e,long:t=!1,noTime:n=!1,hasFuture:r=!1})=>{let a=i(),[o,s]=(0,H.useState)(()=>Date.now()),c=(0,H.useMemo)(()=>{let t=new Date(e);return r?t:new Date(Math.min(t.getTime(),o))},[r,o,e]),l=c.getTime();(0,H.useEffect)(()=>{let e=0,t=()=>{let{unit:n,delta:r}=ve(l),i=ie(n),a=Math.abs(r%i),o=10*P,c=Math.min(Math.max(r<0?i-a:a,o),ge);e=window.setTimeout(()=>{s(Date.now()),t()},c)};return t(),()=>{e&&clearTimeout(e)}},[l]);let u=!e.includes(`T`)||n,d=(0,H.useMemo)(()=>pe({timestamp:l,intl:a,short:!t,noTime:u,now:o}),[l,a,t,u,o]);return(0,B.jsx)(`time`,{dateTime:e,title:a.formatDate(c,At),children:d})},Mt=({className:e,role:t=`img`,...n})=>(0,B.jsxs)(`svg`,{viewBox:`0 0 79 79`,className:(0,z.default)(`logo logo--icon`,e),role:t,...n,children:[t!==`presentation`&&(0,B.jsx)(`title`,{children:`Mastodon`}),(0,B.jsx)(`use`,{xlinkHref:`#logo-symbol-icon`})]}),Nt=()=>(0,B.jsx)(`img`,{src:C,alt:`Mastodon`,className:`logo logo--icon`}),Pt=e=>Ce(`v1/polls/${e}`),Ft=(e,t)=>we(`v1/polls/${e}/votes`,{choices:t}),It=ke(`poll/importFetched`,(e,{dispatch:t,getState:n})=>{let{poll:r}=e;t(Ee({polls:[Te(r,n().polls[r.id])]}))}),Lt=De(`poll/vote`,({pollId:e,choices:t})=>Ft(e,t),async(e,{dispatch:t,discardLoadData:n})=>(await t(It({poll:e})),n)),Rt=De(`poll/fetch`,({pollId:e})=>Pt(e),async(e,{dispatch:t})=>{await t(It({poll:e}))}),zt=a({closed:{id:`poll.closed`,defaultMessage:`Closed`},voted:{id:`poll.voted`,defaultMessage:`You voted for this answer`},votes:{id:`poll.votes`,defaultMessage:`{votes,plural,one{# vote} other{# votes}}`}}),Bt=e=>e!==null&&new Date(e).getTime()<Date.now(),Vt=({pollId:e,disabled:t,accountId:n,statusUrl:a})=>{let o=L(t=>t.polls[e]),s=Ke(),c=i(),l=I(),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)({}),m=(0,H.useMemo)(()=>o?o.expired||Bt(o.expires_at):!1,[o]),h=(0,H.useMemo)(()=>o?.expires_at?m?c.formatMessage(zt.closed):(0,B.jsx)(jt,{hasFuture:!0,timestamp:o.expires_at}):null,[m,c,o]),g=(0,H.useMemo)(()=>o?o.voters_count?(0,B.jsx)(r,{id:`poll.total_people`,defaultMessage:`{count, plural, one {# person} other {# people}}`,values:{count:o.voters_count}}):(0,B.jsx)(r,{id:`poll.total_votes`,defaultMessage:`{count, plural, one {# vote} other {# votes}}`,values:{count:o.votes_count}}):null,[o]),_=t||Object.values(f).every(e=>!e),v=(0,H.useCallback)(()=>{_||(s.signedIn?l(Lt({pollId:e,choices:Object.keys(f)})):l(je({modalType:`INTERACTION`,modalProps:{accountId:n,intent:`vote`,url:a}})))},[_,l,s,e,f,n,a]),y=(0,H.useCallback)(()=>{d(!0)},[]),b=(0,H.useCallback)(()=>{t||l(Rt({pollId:e}))},[t,l,e]),x=(0,H.useCallback)(e=>{o&&(o.multiple?p(t=>({...t,[e]:!t[e]})):p({[e]:!0}))}
1,[o]);if(!o)return null;let S=o.voted||u||m;return(0,B.jsxs)(`div`,{className:`poll`,children:[(0,B.jsx)(`ul`,{children:o.options.map((e,t)=>(0,B.jsx)(Ht,{index:t,poll:o,option:e,showResults:S,active:!!f[t],onChange:x},e.title||t))}),(0,B.jsxs)(`div`,{className:`poll__footer`,children:[!S&&(0,B.jsx)(`button`,{className:`button button-secondary`,disabled:_,onClick:v,type:`button`,children:(0,B.jsx)(r,{id:`poll.vote`,defaultMessage:`Vote`})}),!S&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`poll__link`,onClick:y,type:`button`,children:(0,B.jsx)(r,{id:`poll.reveal`,defaultMessage:`See results`})}),` `,`·`,` `]}),S&&!t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(`button`,{className:`poll__link`,onClick:b,type:`button`,children:(0,B.jsx)(r,{id:`poll.refresh`,defaultMessage:`Refresh`})}),` `,`·`,` `]}),g,o.expires_at&&(0,B.jsxs)(B.Fragment,{children:[` · `,h]})]})]})},Ht=e=>{let{active:t,lang:n,disabled:r,poll:a,option:o,index:s,showResults:c,onChange:l}=e,u=o.voted||a.own_votes?.includes(s),d=o.translation?.title??o.title,f=i(),p=(0,H.useMemo)(()=>{let e=a.voters_count??a.votes_count;return e===0?0:o.votes_count/e*100},[o,a]),m=(0,H.useMemo)(()=>a.options.filter(e=>e.title!==o.title).every(e=>o.votes_count>=e.votes_count),[a,o]),g=(0,H.useMemo)(()=>{let e=o.translation?.titleHtml??o.titleHtml;return e||=(0,He.default)(d),e},[o,d]),_=(0,H.useCallback)(()=>{l(s)},[s,l]),y=(0,H.useCallback)(e=>{(e.key===`Enter`||e.key===` `)&&(l(s),e.stopPropagation(),e.preventDefault())},[s,l]),b=v({from:{width:`0%`},to:{width:`${p}%`}});return(0,B.jsxs)(`li`,{children:[(0,B.jsxs)(`label`,{className:(0,z.default)(`poll__option`,{selectable:!c}),children:[(0,B.jsx)(`input`,{name:`vote-options`,type:a.multiple?`checkbox`:`radio`,value:s,checked:t,onChange:_,disabled:r}),!c&&(0,B.jsx)(`span`,{className:(0,z.default)(`poll__input`,{checkbox:a.multiple,active:t}),tabIndex:0,role:a.multiple?`checkbox`:`radio`,onKeyDown:y,"aria-checked":t,"aria-label":d,lang:n,"data-index":s}),c&&(0,B.jsxs)(`span`,{className:`poll__number`,title:f.formatMessage(zt.votes,{votes:o.votes_count}),children:[Math.round(p),`%`]}),(0,B.jsx)(X,{className:`poll__option__text translate`,lang:n,htmlString:g,extraEmojis:a.emojis}),!!u&&(0,B.jsx)(`span`,{className:`poll__voted`,children:(0,B.jsx)(W,{id:`check`,icon:h,className:`poll__voted__mark`,"aria-label":f.formatMessage(zt.voted)})})]}),c&&(0,B.jsx)(S.span,{className:(0,z.default)(`poll__chart`,{leading:m}),style:b})]})};export{$e as A,G as B,ct as C,rt as D,at as E,q as F,Le as G,ze as H,Ge as I,Ie as K,We as L,Ze as M,Qe as N,nt as O,Ye as P,Ke as R,ut as S,st as T,Be as U,W as V,Re as W,gt as _,Ot as a,ft as b,Tt as c,xt as d,$ as f,_t as g,vt as h,jt as i,Y as j,X as k,Et as l,yt as m,Mt as n,Dt as o,Q as p,V as q,Nt as r,kt as s,Vt as t,St as u,ht as v,ot as w,dt as x,pt as y,qe as z};
2//# sourceMappingURL=poll-CiSbVnkU.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.