@devvit/public-api 0.10.20-next-2024-05-01-2bed81878.0 → 0.10.20-next-2024-05-02-a6994b8e7.0

Sign up to get free protection for your applications and to get access to all the features.
package/public-api.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var vP=Object.create;var Tm=Object.defineProperty;var bP=Object.getOwnPropertyDescriptor;var PP=Object.getOwnPropertyNames;var kP=Object.getPrototypeOf,SP=Object.prototype.hasOwnProperty;var b=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var wP=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of PP(e))!SP.call(r,n)&&n!==t&&Tm(r,n,{get:()=>e[n],enumerable:!(i=bP(e,n))||i.enumerable});return r};var An=(r,e,t)=>(t=r!=null?vP(kP(r)):{},wP(e||!r||!r.__esModule?Tm(t,"default",{value:r,enumerable:!0}):t,r));var fl=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var s=(r,e,t)=>(fl(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},d=(r,e,t,i)=>(fl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);var k=(r,e,t)=>(fl(r,e,"access private method"),t);var ae=b((yB,Rm)=>{Rm.exports=function(r){try{return!!r()}catch{return!0}}});var ua=b((vB,Fm)=>{var IP=ae();Fm.exports=!IP(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var J=b((bB,Um)=>{var Bm=ua(),Om=Function.prototype,gl=Om.call,xP=Bm&&Om.bind.bind(gl,gl);Um.exports=Bm?xP:function(r){return function(){return gl.apply(r,arguments)}}});var Lm=b((PB,Mm)=>{var CP=Math.ceil,AP=Math.floor;Mm.exports=Math.trunc||function(e){var t=+e;return(t>0?AP:CP)(t)}});var ca=b((kB,Dm)=>{var EP=Lm();Dm.exports=function(r){var e=+r;return e!==e||e===0?0:EP(e)}});var pe=b((SB,_m)=>{var ma=function(r){return r&&r.Math==Math&&r};_m.exports=ma(typeof globalThis=="object"&&globalThis)||ma(typeof window=="object"&&window)||ma(typeof self=="object"&&self)||ma(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var Tr=b((wB,Nm)=>{Nm.exports=!1});var pa=b((IB,Hm)=>{var qm=pe(),TP=Object.defineProperty;Hm.exports=function(r,e){try{TP(qm,r,{value:e,configurable:!0,writable:!0})}catch{qm[r]=e}return e}});var fa=b((xB,Wm)=>{var RP=pe(),FP=pa(),jm="__core-js_shared__",BP=RP[jm]||FP(jm,{});Wm.exports=BP});var hl=b((CB,Vm)=>{var OP=Tr(),Gm=fa();(Vm.exports=function(r,e){return Gm[r]||(Gm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:OP?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var ga=b((AB,zm)=>{zm.exports=function(r){return r==null}});var ha=b((EB,$m)=>{var UP=ga(),MP=TypeError;$m.exports=function(r){if(UP(r))throw MP("Can't call method on "+r);return r}});var En=b((TB,Jm)=>{var LP=ha(),DP=Object;Jm.exports=function(r){return DP(LP(r))}});var Ie=b((RB,Km)=>{var _P=J(),NP=En(),qP=_P({}.hasOwnProperty);Km.exports=Object.hasOwn||function(e,t){return qP(NP(e),t)}});var yl=b((FB,Xm)=>{var HP=J(),jP=0,WP=Math.random(),GP=HP(1 .toString);Xm.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+GP(++jP+WP,36)}});var Ym=b((BB,Zm)=>{Zm.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var sp=b((OB,np)=>{var ip=pe(),vl=Ym(),Qm=ip.process,ep=ip.Deno,tp=Qm&&Qm.versions||ep&&ep.version,rp=tp&&tp.v8,He,ya;rp&&(He=rp.split("."),ya=He[0]>0&&He[0]<4?1:+(He[0]+He[1]));!ya&&vl&&(He=vl.match(/Edge\/(\d+)/),(!He||He[1]>=74)&&(He=vl.match(/Chrome\/(\d+)/),He&&(ya=+He[1])));np.exports=ya});var bl=b((UB,ap)=>{var op=sp(),VP=ae();ap.exports=!!Object.getOwnPropertySymbols&&!VP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&op&&op<41})});var Pl=b((MB,dp)=>{var zP=bl();dp.exports=zP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var xe=b((LB,up)=>{var $P=pe(),JP=hl(),lp=Ie(),KP=yl(),XP=bl(),ZP=Pl(),Rr=$P.Symbol,kl=JP("wks"),YP=ZP?Rr.for||Rr:Rr&&Rr.withoutSetter||KP;up.exports=function(r){return lp(kl,r)||(kl[r]=XP&&lp(Rr,r)?Rr[r]:YP("Symbol."+r)),kl[r]}});var pp=b((DB,mp)=>{var QP=xe(),ek=QP("toStringTag"),cp={};cp[ek]="z";mp.exports=String(cp)==="[object z]"});var wl=b((_B,fp)=>{var Sl=typeof document=="object"&&document.all,tk=typeof Sl>"u"&&Sl!==void 0;fp.exports={all:Sl,IS_HTMLDDA:tk}});var K=b((NB,hp)=>{var gp=wl(),rk=gp.all;hp.exports=gp.IS_HTMLDDA?function(r){return typeof r=="function"||r===rk}:function(r){return typeof r=="function"}});var va=b((qB,vp)=>{var yp=J(),ik=yp({}.toString),nk=yp("".slice);vp.exports=function(r){return nk(ik(r),8,-1)}});var Tn=b((HB,bp)=>{var sk=pp(),ok=K(),ba=va(),ak=xe(),dk=ak("toStringTag"),lk=Object,uk=ba(function(){return arguments}())=="Arguments",ck=function(r,e){try{return r[e]}catch{}};bp.exports=sk?ba:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=ck(e=lk(r),dk))=="string"?t:uk?ba(e):(i=ba(e))=="Object"&&ok(e.callee)?"Arguments":i}});var Rn=b((jB,Pp)=>{var mk=Tn(),pk=String;Pp.exports=function(r){if(mk(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return pk(r)}});var xl=b((WB,wp)=>{var Il=J(),fk=ca(),gk=Rn(),hk=ha(),yk=Il("".charAt),kp=Il("".charCodeAt),vk=Il("".slice),Sp=function(r){return function(e,t){var i=gk(hk(e)),n=fk(t),o=i.length,a,u;return n<0||n>=o?r?"":void 0:(a=kp(i,n),a<55296||a>56319||n+1===o||(u=kp(i,n+1))<56320||u>57343?r?yk(i,n):a:r?vk(i,n,n+2):(a-55296<<10)+(u-56320)+65536)}};wp.exports={codeAt:Sp(!1),charAt:Sp(!0)}});var Cp=b((GB,xp)=>{var bk=pe(),Pk=K(),Ip=bk.WeakMap;xp.exports=Pk(Ip)&&/native code/.test(String(Ip))});var vt=b((VB,Tp)=>{var Ap=K(),Ep=wl(),kk=Ep.all;Tp.exports=Ep.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Ap(r)||r===kk}:function(r){return typeof r=="object"?r!==null:Ap(r)}});var fe=b((zB,Rp)=>{var Sk=ae();Rp.exports=!Sk(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Al=b(($B,Bp)=>{var wk=pe(),Fp=vt(),Cl=wk.document,Ik=Fp(Cl)&&Fp(Cl.createElement);Bp.exports=function(r){return Ik?Cl.createElement(r):{}}});var El=b((JB,Op)=>{var xk=fe(),Ck=ae(),Ak=Al();Op.exports=!xk&&!Ck(function(){return Object.defineProperty(Ak("div"),"a",{get:function(){return 7}}).a!=7})});var Tl=b((KB,Up)=>{var Ek=fe(),Tk=ae();Up.exports=Ek&&Tk(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Xe=b((XB,Mp)=>{var Rk=vt(),Fk=String,Bk=TypeError;Mp.exports=function(r){if(Rk(r))return r;throw Bk(Fk(r)+" is not an object")}});var je=b((ZB,Lp)=>{var Ok=ua(),Pa=Function.prototype.call;Lp.exports=Ok?Pa.bind(Pa):function(){return Pa.apply(Pa,arguments)}});var Fn=b((YB,Dp)=>{var Rl=pe(),Uk=K(),Mk=function(r){return Uk(r)?r:void 0};Dp.exports=function(r,e){return arguments.length<2?Mk(Rl[r]):Rl[r]&&Rl[r][e]}});var Fl=b((QB,_p)=>{var Lk=J();_p.exports=Lk({}.isPrototypeOf)});var Bl=b((eO,Np)=>{var Dk=Fn(),_k=K(),Nk=Fl(),qk=Pl(),Hk=Object;Np.exports=qk?function(r){return typeof r=="symbol"}:function(r){var e=Dk("Symbol");return _k(e)&&Nk(e.prototype,Hk(r))}});var Ol=b((tO,qp)=>{var jk=String;qp.exports=function(r){try{return jk(r)}catch{return"Object"}}});var ka=b((rO,Hp)=>{var Wk=K(),Gk=Ol(),Vk=TypeError;Hp.exports=function(r){if(Wk(r))return r;throw Vk(Gk(r)+" is not a function")}});var Sa=b((iO,jp)=>{var zk=ka(),$k=ga();jp.exports=function(r,e){var t=r[e];return $k(t)?void 0:zk(t)}});var Gp=b((nO,Wp)=>{var Ul=je(),Ml=K(),Ll=vt(),Jk=TypeError;Wp.exports=function(r,e){var t,i;if(e==="string"&&Ml(t=r.toString)&&!Ll(i=Ul(t,r))||Ml(t=r.valueOf)&&!Ll(i=Ul(t,r))||e!=="string"&&Ml(t=r.toString)&&!Ll(i=Ul(t,r)))return i;throw Jk("Can't convert object to primitive value")}});var Jp=b((sO,$p)=>{var Kk=je(),Vp=vt(),zp=Bl(),Xk=Sa(),Zk=Gp(),Yk=xe(),Qk=TypeError,eS=Yk("toPrimitive");$p.exports=function(r,e){if(!Vp(r)||zp(r))return r;var t=Xk(r,eS),i;if(t){if(e===void 0&&(e="default"),i=Kk(t,r,e),!Vp(i)||zp(i))return i;throw Qk("Can't convert object to primitive value")}return e===void 0&&(e="number"),Zk(r,e)}});var wa=b((oO,Kp)=>{var tS=Jp(),rS=Bl();Kp.exports=function(r){var e=tS(r,"string");return rS(e)?e:e+""}});var Ze=b(Zp=>{var iS=fe(),nS=El(),sS=Tl(),Ia=Xe(),Xp=wa(),oS=TypeError,Dl=Object.defineProperty,aS=Object.getOwnPropertyDescriptor,_l="enumerable",Nl="configurable",ql="writable";Zp.f=iS?sS?function(e,t,i){if(Ia(e),t=Xp(t),Ia(i),typeof e=="function"&&t==="prototype"&&"value"in i&&ql in i&&!i[ql]){var n=aS(e,t);n&&n[ql]&&(e[t]=i.value,i={configurable:Nl in i?i[Nl]:n[Nl],enumerable:_l in i?i[_l]:n[_l],writable:!1})}return Dl(e,t,i)}:Dl:function(e,t,i){if(Ia(e),t=Xp(t),Ia(i),nS)try{return Dl(e,t,i)}catch{}if("get"in i||"set"in i)throw oS("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Fr=b((dO,Yp)=>{Yp.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var xa=b((lO,Qp)=>{var dS=fe(),lS=Ze(),uS=Fr();Qp.exports=dS?function(r,e,t){return lS.f(r,e,uS(1,t))}:function(r,e,t){return r[e]=t,r}});var Ca=b((uO,tf)=>{var cS=hl(),mS=yl(),ef=cS("keys");tf.exports=function(r){return ef[r]||(ef[r]=mS(r))}});var Aa=b((cO,rf)=>{rf.exports={}});var Br=b((mO,of)=>{var pS=Cp(),sf=pe(),fS=vt(),gS=xa(),Hl=Ie(),jl=fa(),hS=Ca(),yS=Aa(),nf="Object already initialized",Wl=sf.TypeError,vS=sf.WeakMap,Ea,Bn,Ta,bS=function(r){return Ta(r)?Bn(r):Ea(r,{})},PS=function(r){return function(e){var t;if(!fS(e)||(t=Bn(e)).type!==r)throw Wl("Incompatible receiver, "+r+" required");return t}};pS||jl.state?(We=jl.state||(jl.state=new vS),We.get=We.get,We.has=We.has,We.set=We.set,Ea=function(r,e){if(We.has(r))throw Wl(nf);return e.facade=r,We.set(r,e),e},Bn=function(r){return We.get(r)||{}},Ta=function(r){return We.has(r)}):(Kt=hS("state"),yS[Kt]=!0,Ea=function(r,e){if(Hl(r,Kt))throw Wl(nf);return e.facade=r,gS(r,Kt,e),e},Bn=function(r){return Hl(r,Kt)?r[Kt]:{}},Ta=function(r){return Hl(r,Kt)});var We,Kt;of.exports={set:Ea,get:Bn,has:Ta,enforce:bS,getterFor:PS}});var Gl=b(lf=>{"use strict";var af={}.propertyIsEnumerable,df=Object.getOwnPropertyDescriptor,kS=df&&!af.call({1:2},1);lf.f=kS?function(e){var t=df(this,e);return!!t&&t.enumerable}:af});var zl=b((fO,uf)=>{var SS=J(),wS=ae(),IS=va(),Vl=Object,xS=SS("".split);uf.exports=wS(function(){return!Vl("z").propertyIsEnumerable(0)})?function(r){return IS(r)=="String"?xS(r,""):Vl(r)}:Vl});var Or=b((gO,cf)=>{var CS=zl(),AS=ha();cf.exports=function(r){return CS(AS(r))}});var $l=b(pf=>{var ES=fe(),TS=je(),RS=Gl(),FS=Fr(),BS=Or(),OS=wa(),US=Ie(),MS=El(),mf=Object.getOwnPropertyDescriptor;pf.f=ES?mf:function(e,t){if(e=BS(e),t=OS(t),MS)try{return mf(e,t)}catch{}if(US(e,t))return FS(!TS(RS.f,e,t),e[t])}});var Xl=b((yO,gf)=>{var Jl=fe(),LS=Ie(),ff=Function.prototype,DS=Jl&&Object.getOwnPropertyDescriptor,Kl=LS(ff,"name"),_S=Kl&&function(){}.name==="something",NS=Kl&&(!Jl||Jl&&DS(ff,"name").configurable);gf.exports={EXISTS:Kl,PROPER:_S,CONFIGURABLE:NS}});var Yl=b((vO,hf)=>{var qS=J(),HS=K(),Zl=fa(),jS=qS(Function.toString);HS(Zl.inspectSource)||(Zl.inspectSource=function(r){return jS(r)});hf.exports=Zl.inspectSource});var tu=b((bO,bf)=>{var eu=J(),WS=ae(),GS=K(),Ra=Ie(),Ql=fe(),VS=Xl().CONFIGURABLE,zS=Yl(),vf=Br(),$S=vf.enforce,JS=vf.get,yf=String,Fa=Object.defineProperty,KS=eu("".slice),XS=eu("".replace),ZS=eu([].join),YS=Ql&&!WS(function(){return Fa(function(){},"length",{value:8}).length!==8}),QS=String(String).split("String"),ew=bf.exports=function(r,e,t){KS(yf(e),0,7)==="Symbol("&&(e="["+XS(yf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Ra(r,"name")||VS&&r.name!==e)&&(Ql?Fa(r,"name",{value:e,configurable:!0}):r.name=e),YS&&t&&Ra(t,"arity")&&r.length!==t.arity&&Fa(r,"length",{value:t.arity});try{t&&Ra(t,"constructor")&&t.constructor?Ql&&Fa(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=$S(r);return Ra(i,"source")||(i.source=ZS(QS,typeof e=="string"?e:"")),r};Function.prototype.toString=ew(function(){return GS(this)&&JS(this).source||zS(this)},"toString")});var Xt=b((PO,Pf)=>{var tw=K(),rw=Ze(),iw=tu(),nw=pa();Pf.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(tw(t)&&iw(t,o,i),i.global)n?r[e]=t:nw(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:rw.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var ru=b((kO,kf)=>{var sw=ca(),ow=Math.max,aw=Math.min;kf.exports=function(r,e){var t=sw(r);return t<0?ow(t+e,0):aw(t,e)}});var wf=b((SO,Sf)=>{var dw=ca(),lw=Math.min;Sf.exports=function(r){return r>0?lw(dw(r),9007199254740991):0}});var Ba=b((wO,If)=>{var uw=wf();If.exports=function(r){return uw(r.length)}});var Af=b((IO,Cf)=>{var cw=Or(),mw=ru(),pw=Ba(),xf=function(r){return function(e,t,i){var n=cw(e),o=pw(n),a=mw(i,o),u;if(r&&t!=t){for(;o>a;)if(u=n[a++],u!=u)return!0}else for(;o>a;a++)if((r||a in n)&&n[a]===t)return r||a||0;return!r&&-1}};Cf.exports={includes:xf(!0),indexOf:xf(!1)}});var nu=b((xO,Tf)=>{var fw=J(),iu=Ie(),gw=Or(),hw=Af().indexOf,yw=Aa(),Ef=fw([].push);Tf.exports=function(r,e){var t=gw(r),i=0,n=[],o;for(o in t)!iu(yw,o)&&iu(t,o)&&Ef(n,o);for(;e.length>i;)iu(t,o=e[i++])&&(~hw(n,o)||Ef(n,o));return n}});var Oa=b((CO,Rf)=>{Rf.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Bf=b(Ff=>{var vw=nu(),bw=Oa(),Pw=bw.concat("length","prototype");Ff.f=Object.getOwnPropertyNames||function(e){return vw(e,Pw)}});var su=b(Of=>{Of.f=Object.getOwnPropertySymbols});var Mf=b((TO,Uf)=>{var kw=Fn(),Sw=J(),ww=Bf(),Iw=su(),xw=Xe(),Cw=Sw([].concat);Uf.exports=kw("Reflect","ownKeys")||function(e){var t=ww.f(xw(e)),i=Iw.f;return i?Cw(t,i(e)):t}});var _f=b((RO,Df)=>{var Lf=Ie(),Aw=Mf(),Ew=$l(),Tw=Ze();Df.exports=function(r,e,t){for(var i=Aw(e),n=Tw.f,o=Ew.f,a=0;a<i.length;a++){var u=i[a];!Lf(r,u)&&!(t&&Lf(t,u))&&n(r,u,o(e,u))}}});var qf=b((FO,Nf)=>{var Rw=ae(),Fw=K(),Bw=/#|\.prototype\./,On=function(r,e){var t=Uw[Ow(r)];return t==Lw?!0:t==Mw?!1:Fw(e)?Rw(e):!!e},Ow=On.normalize=function(r){return String(r).replace(Bw,".").toLowerCase()},Uw=On.data={},Mw=On.NATIVE="N",Lw=On.POLYFILL="P";Nf.exports=On});var Un=b((BO,Hf)=>{var ou=pe(),Dw=$l().f,_w=xa(),Nw=Xt(),qw=pa(),Hw=_f(),jw=qf();Hf.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,u,p,f,g;if(i?a=ou:n?a=ou[t]||qw(t,{}):a=(ou[t]||{}).prototype,a)for(u in e){if(f=e[u],r.dontCallGetSet?(g=Dw(a,u),p=g&&g.value):p=a[u],o=jw(i?u:t+(n?".":"#")+u,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;Hw(f,p)}(r.sham||p&&p.sham)&&_w(f,"sham",!0),Nw(a,u,f,r)}}});var au=b((OO,jf)=>{var Ww=nu(),Gw=Oa();jf.exports=Object.keys||function(e){return Ww(e,Gw)}});var Gf=b(Wf=>{var Vw=fe(),zw=Tl(),$w=Ze(),Jw=Xe(),Kw=Or(),Xw=au();Wf.f=Vw&&!zw?Object.defineProperties:function(e,t){Jw(e);for(var i=Kw(t),n=Xw(t),o=n.length,a=0,u;o>a;)$w.f(e,u=n[a++],i[u]);return e}});var zf=b((MO,Vf)=>{var Zw=Fn();Vf.exports=Zw("document","documentElement")});var Mn=b((LO,Qf)=>{var Yw=Xe(),Qw=Gf(),$f=Oa(),eI=Aa(),tI=zf(),rI=Al(),iI=Ca(),Jf=">",Kf="<",lu="prototype",uu="script",Zf=iI("IE_PROTO"),du=function(){},Yf=function(r){return Kf+uu+Jf+r+Kf+"/"+uu+Jf},Xf=function(r){r.write(Yf("")),r.close();var e=r.parentWindow.Object;return r=null,e},nI=function(){var r=rI("iframe"),e="java"+uu+":",t;return r.style.display="none",tI.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Yf("document.F=Object")),t.close(),t.F},Ua,Ma=function(){try{Ua=new ActiveXObject("htmlfile")}catch{}Ma=typeof document<"u"?document.domain&&Ua?Xf(Ua):nI():Xf(Ua);for(var r=$f.length;r--;)delete Ma[lu][$f[r]];return Ma()};eI[Zf]=!0;Qf.exports=Object.create||function(e,t){var i;return e!==null?(du[lu]=Yw(e),i=new du,du[lu]=null,i[Zf]=e):i=Ma(),t===void 0?i:Qw.f(i,t)}});var tg=b((DO,eg)=>{var sI=ae();eg.exports=!sI(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var mu=b((_O,ig)=>{var oI=Ie(),aI=K(),dI=En(),lI=Ca(),uI=tg(),rg=lI("IE_PROTO"),cu=Object,cI=cu.prototype;ig.exports=uI?cu.getPrototypeOf:function(r){var e=dI(r);if(oI(e,rg))return e[rg];var t=e.constructor;return aI(t)&&e instanceof t?t.prototype:e instanceof cu?cI:null}});var hu=b((NO,og)=>{"use strict";var mI=ae(),pI=K(),fI=vt(),gI=Mn(),ng=mu(),hI=Xt(),yI=xe(),vI=Tr(),gu=yI("iterator"),sg=!1,nt,pu,fu;[].keys&&(fu=[].keys(),"next"in fu?(pu=ng(ng(fu)),pu!==Object.prototype&&(nt=pu)):sg=!0);var bI=!fI(nt)||mI(function(){var r={};return nt[gu].call(r)!==r});bI?nt={}:vI&&(nt=gI(nt));pI(nt[gu])||hI(nt,gu,function(){return this});og.exports={IteratorPrototype:nt,BUGGY_SAFARI_ITERATORS:sg}});var Ln=b((qO,dg)=>{var PI=Ze().f,kI=Ie(),SI=xe(),ag=SI("toStringTag");dg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!kI(r,ag)&&PI(r,ag,{configurable:!0,value:e})}});var Ur=b((HO,lg)=>{lg.exports={}});var yu=b((jO,ug)=>{"use strict";var wI=hu().IteratorPrototype,II=Mn(),xI=Fr(),CI=Ln(),AI=Ur(),EI=function(){return this};ug.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=II(wI,{next:xI(+!i,t)}),CI(r,n,!1,!0),AI[n]=EI,r}});var mg=b((WO,cg)=>{var TI=K(),RI=String,FI=TypeError;cg.exports=function(r){if(typeof r=="object"||TI(r))return r;throw FI("Can't set "+RI(r)+" as a prototype")}});var fg=b((GO,pg)=>{var BI=J(),OI=Xe(),UI=mg();pg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=BI(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return OI(n),UI(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var bu=b((VO,Ig)=>{"use strict";var MI=Un(),LI=je(),La=Tr(),Sg=Xl(),DI=K(),_I=yu(),gg=mu(),hg=fg(),NI=Ln(),qI=xa(),vu=Xt(),HI=xe(),yg=Ur(),wg=hu(),jI=Sg.PROPER,WI=Sg.CONFIGURABLE,vg=wg.IteratorPrototype,Da=wg.BUGGY_SAFARI_ITERATORS,Dn=HI("iterator"),bg="keys",_n="values",Pg="entries",kg=function(){return this};Ig.exports=function(r,e,t,i,n,o,a){_I(t,e,i);var u=function(D){if(D===n&&h)return h;if(!Da&&D in g)return g[D];switch(D){case bg:return function(){return new t(this,D)};case _n:return function(){return new t(this,D)};case Pg:return function(){return new t(this,D)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,g=r.prototype,c=g[Dn]||g["@@iterator"]||n&&g[n],h=!Da&&c||u(n),P=e=="Array"&&g.entries||c,w,C,E;if(P&&(w=gg(P.call(new r)),w!==Object.prototype&&w.next&&(!La&&gg(w)!==vg&&(hg?hg(w,vg):DI(w[Dn])||vu(w,Dn,kg)),NI(w,p,!0,!0),La&&(yg[p]=kg))),jI&&n==_n&&c&&c.name!==_n&&(!La&&WI?qI(g,"name",_n):(f=!0,h=function(){return LI(c,this)})),n)if(C={values:u(_n),keys:o?h:u(bg),entries:u(Pg)},a)for(E in C)(Da||f||!(E in g))&&vu(g,E,C[E]);else MI({target:e,proto:!0,forced:Da||f},C);return(!La||a)&&g[Dn]!==h&&vu(g,Dn,h,{name:n}),yg[e]=h,C}});var Pu=b((zO,xg)=>{xg.exports=function(r,e){return{value:r,done:e}}});var Tg=b(()=>{"use strict";var GI=xl().charAt,VI=Rn(),Ag=Br(),zI=bu(),Cg=Pu(),Eg="String Iterator",$I=Ag.set,JI=Ag.getterFor(Eg);zI(String,"String",function(r){$I(this,{type:Eg,string:VI(r),index:0})},function(){var e=JI(this),t=e.string,i=e.index,n;return i>=t.length?Cg(void 0,!0):(n=GI(t,i),e.index+=n.length,Cg(n,!1))})});var ku=b((KO,Rg)=>{var KI=ae(),XI=xe(),ZI=Tr(),YI=XI("iterator");Rg.exports=!KI(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,n){e.delete("b"),t+=n+i}),ZI&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[YI]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var Bg=b((XO,Fg)=>{var QI=va(),ex=J();Fg.exports=function(r){if(QI(r)==="Function")return ex(r)}});var _a=b((ZO,Ug)=>{var Og=Bg(),tx=ka(),rx=ua(),ix=Og(Og.bind);Ug.exports=function(r,e){return tx(r),e===void 0?r:rx?ix(r,e):function(){return r.apply(e,arguments)}}});var Dg=b((YO,Lg)=>{var Mg=tu(),nx=Ze();Lg.exports=function(r,e,t){return t.get&&Mg(t.get,e,{getter:!0}),t.set&&Mg(t.set,e,{setter:!0}),nx.f(r,e,t)}});var Su=b((QO,_g)=>{var sx=Fl(),ox=TypeError;_g.exports=function(r,e){if(sx(e,r))return r;throw ox("Incorrect invocation")}});var jg=b((eU,Hg)=>{"use strict";var Ng=fe(),ax=J(),dx=je(),lx=ae(),wu=au(),ux=su(),cx=Gl(),mx=En(),px=zl(),Mr=Object.assign,qg=Object.defineProperty,fx=ax([].concat);Hg.exports=!Mr||lx(function(){if(Ng&&Mr({b:1},Mr(qg({},"a",{enumerable:!0,get:function(){qg(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(n){e[n]=n}),Mr({},r)[t]!=7||wu(Mr({},e)).join("")!=i})?function(e,t){for(var i=mx(e),n=arguments.length,o=1,a=ux.f,u=cx.f;n>o;)for(var p=px(arguments[o++]),f=a?fx(wu(p),a(p)):wu(p),g=f.length,c=0,h;g>c;)h=f[c++],(!Ng||dx(u,p,h))&&(i[h]=p[h]);return i}:Mr});var Vg=b((tU,Gg)=>{var gx=je(),Wg=Xe(),hx=Sa();Gg.exports=function(r,e,t){var i,n;Wg(r);try{if(i=hx(r,"return"),!i){if(e==="throw")throw t;return t}i=gx(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Wg(i),t}});var $g=b((rU,zg)=>{var yx=Xe(),vx=Vg();zg.exports=function(r,e,t,i){try{return i?e(yx(t)[0],t[1]):e(t)}catch(n){vx(r,"throw",n)}}});var Kg=b((iU,Jg)=>{var bx=xe(),Px=Ur(),kx=bx("iterator"),Sx=Array.prototype;Jg.exports=function(r){return r!==void 0&&(Px.Array===r||Sx[kx]===r)}});var th=b((nU,eh)=>{var wx=J(),Ix=ae(),Xg=K(),xx=Tn(),Cx=Fn(),Ax=Yl(),Zg=function(){},Ex=[],Yg=Cx("Reflect","construct"),Iu=/^\s*(?:class|function)\b/,Tx=wx(Iu.exec),Rx=!Iu.exec(Zg),Nn=function(e){if(!Xg(e))return!1;try{return Yg(Zg,Ex,e),!0}catch{return!1}},Qg=function(e){if(!Xg(e))return!1;switch(xx(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Rx||!!Tx(Iu,Ax(e))}catch{return!0}};Qg.sham=!0;eh.exports=!Yg||Ix(function(){var r;return Nn(Nn.call)||!Nn(Object)||!Nn(function(){r=!0})||r})?Qg:Nn});var xu=b((sU,rh)=>{"use strict";var Fx=wa(),Bx=Ze(),Ox=Fr();rh.exports=function(r,e,t){var i=Fx(e);i in r?Bx.f(r,i,Ox(0,t)):r[i]=t}});var Na=b((oU,nh)=>{var Ux=Tn(),ih=Sa(),Mx=ga(),Lx=Ur(),Dx=xe(),_x=Dx("iterator");nh.exports=function(r){if(!Mx(r))return ih(r,_x)||ih(r,"@@iterator")||Lx[Ux(r)]}});var Cu=b((aU,sh)=>{var Nx=je(),qx=ka(),Hx=Xe(),jx=Ol(),Wx=Na(),Gx=TypeError;sh.exports=function(r,e){var t=arguments.length<2?Wx(r):e;if(qx(t))return Hx(Nx(t,r));throw Gx(jx(r)+" is not iterable")}});var lh=b((dU,dh)=>{"use strict";var Vx=_a(),zx=je(),$x=En(),Jx=$g(),Kx=Kg(),Xx=th(),Zx=Ba(),oh=xu(),Yx=Cu(),Qx=Na(),ah=Array;dh.exports=function(e){var t=$x(e),i=Xx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=Vx(o,n>2?arguments[2]:void 0));var u=Qx(t),p=0,f,g,c,h,P,w;if(u&&!(this===ah&&Kx(u)))for(h=Yx(t,u),P=h.next,g=i?new this:[];!(c=zx(P,h)).done;p++)w=a?Jx(h,o,[c.value,p],!0):c.value,oh(g,p,w);else for(f=Zx(t),g=i?new this(f):ah(f);f>p;p++)w=a?o(t[p],p):t[p],oh(g,p,w);return g.length=p,g}});var Au=b((lU,ch)=>{var uh=ru(),eC=Ba(),tC=xu(),rC=Array,iC=Math.max;ch.exports=function(r,e,t){for(var i=eC(r),n=uh(e,i),o=uh(t===void 0?i:t,i),a=rC(iC(o-n,0)),u=0;n<o;n++,u++)tC(a,u,r[n]);return a.length=u,a}});var Ph=b((uU,bh)=>{var Zt=J(),Eu=2147483647,qn=36,hh=1,Fu=26,nC=38,sC=700,oC=72,aC=128,dC="-",lC=/[^\0-\u007E]/,yh=/[.\u3002\uFF0E\uFF61]/g,mh="Overflow: input needs wider integers to process",Tu=qn-hh,ph=RangeError,uC=Zt(yh.exec),Lr=Math.floor,Ru=String.fromCharCode,fh=Zt("".charCodeAt),vh=Zt([].join),bt=Zt([].push),cC=Zt("".replace),mC=Zt("".split),pC=Zt("".toLowerCase),fC=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=fh(r,t++);if(n>=55296&&n<=56319&&t<i){var o=fh(r,t++);(o&64512)==56320?bt(e,((n&1023)<<10)+(o&1023)+65536):(bt(e,n),t--)}else bt(e,n)}return e},gh=function(r){return r+22+75*(r<26)},gC=function(r,e,t){var i=0;for(r=t?Lr(r/sC):r>>1,r+=Lr(r/e);r>Tu*Fu>>1;)r=Lr(r/Tu),i+=qn;return Lr(i+(Tu+1)*r/(r+nC))},hC=function(r){var e=[];r=fC(r);var t=r.length,i=aC,n=0,o=oC,a,u;for(a=0;a<r.length;a++)u=r[a],u<128&&bt(e,Ru(u));var p=e.length,f=p;for(p&&bt(e,dC);f<t;){var g=Eu;for(a=0;a<r.length;a++)u=r[a],u>=i&&u<g&&(g=u);var c=f+1;if(g-i>Lr((Eu-n)/c))throw ph(mh);for(n+=(g-i)*c,i=g,a=0;a<r.length;a++){if(u=r[a],u<i&&++n>Eu)throw ph(mh);if(u==i){for(var h=n,P=qn;;){var w=P<=o?hh:P>=o+Fu?Fu:P-o;if(h<w)break;var C=h-w,E=qn-w;bt(e,Ru(gh(w+C%E))),h=Lr(C/E),P+=qn}bt(e,Ru(gh(h))),o=gC(n,c,f==p),n=0,f++}}n++,i++}return vh(e,"")};bh.exports=function(r){var e=[],t=mC(cC(pC(r),yh,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],bt(e,uC(lC,n)?"xn--"+hC(n):n);return vh(e,".")}});var Bu=b((cU,kh)=>{var yC=TypeError;kh.exports=function(r,e){if(r<e)throw yC("Not enough arguments");return r}});var wh=b((mU,Sh)=>{var vC=xe(),bC=Mn(),PC=Ze().f,Ou=vC("unscopables"),Uu=Array.prototype;Uu[Ou]==null&&PC(Uu,Ou,{configurable:!0,value:bC(null)});Sh.exports=function(r){Uu[Ou][r]=!0}});var Th=b((pU,Eh)=>{"use strict";var kC=Or(),Mu=wh(),Ih=Ur(),Ch=Br(),SC=Ze().f,wC=bu(),qa=Pu(),IC=Tr(),xC=fe(),Ah="Array Iterator",CC=Ch.set,AC=Ch.getterFor(Ah);Eh.exports=wC(Array,"Array",function(r,e){CC(this,{type:Ah,target:kC(r),index:0,kind:e})},function(){var r=AC(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,qa(void 0,!0)):t=="keys"?qa(i,!1):t=="values"?qa(e[i],!1):qa([i,e[i]],!1)},"values");var xh=Ih.Arguments=Ih.Array;Mu("keys");Mu("values");Mu("entries");if(!IC&&xC&&xh.name!=="values")try{SC(xh,"name",{value:"values"})}catch{}});var Fh=b((fU,Rh)=>{var EC=Xt();Rh.exports=function(r,e,t){for(var i in e)EC(r,i,e[i],t);return r}});var Uh=b((gU,Oh)=>{var Bh=Au(),TC=Math.floor,Lu=function(r,e){var t=r.length,i=TC(t/2);return t<8?RC(r,e):FC(r,Lu(Bh(r,0,i),e),Lu(Bh(r,i),e),e)},RC=function(r,e){for(var t=r.length,i=1,n,o;i<t;){for(o=i,n=r[i];o&&e(r[o-1],n)>0;)r[o]=r[--o];o!==i++&&(r[o]=n)}return r},FC=function(r,e,t,i){for(var n=e.length,o=t.length,a=0,u=0;a<n||u<o;)r[a+u]=a<n&&u<o?i(e[a],t[u])<=0?e[a++]:t[u++]:a<n?e[a++]:t[u++];return r};Oh.exports=Lu});var zu=b((hU,ey)=>{"use strict";Th();var Hu=Un(),_r=pe(),Ha=je(),Ye=J(),BC=fe(),zh=ku(),$h=Xt(),OC=Fh(),UC=Ln(),MC=yu(),Gu=Br(),Jh=Su(),Du=K(),LC=Ie(),DC=_a(),_C=Tn(),NC=Xe(),Kh=vt(),ge=Rn(),qC=Mn(),Mh=Fr(),ju=Cu(),HC=Na(),Dr=Bu(),jC=xe(),WC=Uh(),GC=jC("iterator"),Wn="URLSearchParams",Xh=Wn+"Iterator",Zh=Gu.set,Ge=Gu.getterFor(Wn),VC=Gu.getterFor(Xh),zC=Object.getOwnPropertyDescriptor,Vu=function(r){if(!BC)return _r[r];var e=zC(_r,r);return e&&e.value},Lh=Vu("fetch"),Wa=Vu("Request"),Hn=Vu("Headers"),_u=Wa&&Wa.prototype,Dh=Hn&&Hn.prototype,$C=_r.RegExp,JC=_r.TypeError,Yh=_r.decodeURIComponent,KC=_r.encodeURIComponent,XC=Ye("".charAt),_h=Ye([].join),Yt=Ye([].push),Wu=Ye("".replace),ZC=Ye([].shift),Nh=Ye([].splice),qh=Ye("".split),YC=Ye("".slice),QC=/\+/g,Hh=Array(4),eA=function(r){return Hh[r-1]||(Hh[r-1]=$C("((?:%[\\da-f]{2}){"+r+"})","gi"))},tA=function(r){try{return Yh(r)}catch{return r}},jh=function(r){var e=Wu(r,QC," "),t=4;try{return Yh(e)}catch{for(;t;)e=Wu(e,eA(t--),tA);return e}},rA=/[!'()~]|%20/g,iA={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},nA=function(r){return iA[r]},Wh=function(r){return Wu(KC(r),rA,nA)},Nu=MC(function(e,t){Zh(this,{type:Xh,iterator:ju(Ge(e).entries),kind:t})},"Iterator",function(){var e=VC(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value=t==="keys"?n.key:t==="values"?n.value:[n.key,n.value]),i},!0),Qh=function(r){this.entries=[],this.url=null,r!==void 0&&(Kh(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?XC(r,0)==="?"?YC(r,1):r:ge(r)))};Qh.prototype={type:Wn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=HC(r),t,i,n,o,a,u,p;if(e)for(t=ju(r,e),i=t.next;!(n=Ha(i,t)).done;){if(o=ju(NC(n.value)),a=o.next,(u=Ha(a,o)).done||(p=Ha(a,o)).done||!Ha(a,o).done)throw JC("Expected sequence with length 2");Yt(this.entries,{key:ge(u.value),value:ge(p.value)})}else for(var f in r)LC(r,f)&&Yt(this.entries,{key:f,value:ge(r[f])})},parseQuery:function(r){if(r)for(var e=qh(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=qh(i,"="),Yt(this.entries,{key:jh(ZC(n)),value:jh(_h(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],Yt(e,Wh(i.key)+"="+Wh(i.value));return _h(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ga=function(){Jh(this,jn);var e=arguments.length>0?arguments[0]:void 0;Zh(this,new Qh(e))},jn=Ga.prototype;OC(jn,{append:function(e,t){Dr(arguments.length,2);var i=Ge(this);Yt(i.entries,{key:ge(e),value:ge(t)}),i.updateURL()},delete:function(r){Dr(arguments.length,1);for(var e=Ge(this),t=e.entries,i=ge(r),n=0;n<t.length;)t[n].key===i?Nh(t,n,1):n++;e.updateURL()},get:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=[],o=0;o<t.length;o++)t[o].key===i&&Yt(n,t[o].value);return n},has:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Dr(arguments.length,1);for(var i=Ge(this),n=i.entries,o=!1,a=ge(e),u=ge(t),p=0,f;p<n.length;p++)f=n[p],f.key===a&&(o?Nh(n,p--,1):(o=!0,f.value=u));o||Yt(n,{key:a,value:u}),i.updateURL()},sort:function(){var e=Ge(this);WC(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ge(this).entries,i=DC(e,arguments.length>1?arguments[1]:void 0),n=0,o;n<t.length;)o=t[n++],i(o.value,o.key,this)},keys:function(){return new Nu(this,"keys")},values:function(){return new Nu(this,"values")},entries:function(){return new Nu(this,"entries")}},{enumerable:!0});$h(jn,GC,jn.entries,{name:"entries"});$h(jn,"toString",function(){return Ge(this).serialize()},{enumerable:!0});UC(Ga,Wn);Hu({global:!0,constructor:!0,forced:!zh},{URLSearchParams:Ga});!zh&&Du(Hn)&&(Gh=Ye(Dh.has),Vh=Ye(Dh.set),qu=function(r){if(Kh(r)){var e=r.body,t;if(_C(e)===Wn)return t=r.headers?new Hn(r.headers):new Hn,Gh(t,"content-type")||Vh(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),qC(r,{body:Mh(0,ge(e)),headers:Mh(0,t)})}return r},Du(Lh)&&Hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Lh(e,arguments.length>1?qu(arguments[1]):{})}}),Du(Wa)&&(ja=function(e){return Jh(this,_u),new Wa(e,arguments.length>1?qu(arguments[1]):{})},_u.constructor=ja,ja.prototype=_u,Hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ja})));var Gh,Vh,qu,ja;ey.exports={URLSearchParams:Ga,getState:Ge}});var by=b(()=>{"use strict";Tg();var sA=Un(),dc=fe(),oA=ku(),lc=pe(),ty=_a(),Re=J(),Ka=Xt(),Ce=Dg(),aA=Su(),sc=Ie(),uc=jg(),Nr=lh(),Ve=Au(),dA=xl().codeAt,lA=Ph(),ot=Rn(),uA=Ln(),cA=Bu(),py=zu(),fy=Br(),mA=fy.set,Xa=fy.getterFor("URL"),pA=py.URLSearchParams,fA=py.getState,Gn=lc.URL,oc=lc.TypeError,Za=lc.parseInt,gA=Math.floor,ry=Math.pow,Te=Re("".charAt),ze=Re(/./.exec),zn=Re([].join),hA=Re(1 .toString),yA=Re([].pop),Hr=Re([].push),iy=Re("".replace),vA=Re([].shift),bA=Re("".split),Jn=Re("".slice),Ya=Re("".toLowerCase),PA=Re([].unshift),kA="Invalid authority",$u="Invalid scheme",Qt="Invalid host",ny="Invalid port",gy=/[a-z]/i,SA=/[\d+-.a-z]/i,ac=/\d/,wA=/^0x/i,IA=/^[0-7]+$/,xA=/^\d+$/,hy=/^[\da-f]+$/i,CA=/[\0\t\n\r #%/:<>?@[\\\]^|]/,AA=/[\0\t\n\r #/:<>?@[\\\]^|]/,EA=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TA=/[\t\n\r]/g,Ae,RA=function(r){var e=bA(r,"."),t,i,n,o,a,u,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],n=0;n<t;n++){if(o=e[n],o=="")return r;if(a=10,o.length>1&&Te(o,0)=="0"&&(a=ze(wA,o)?16:8,o=Jn(o,a==8?1:2)),o==="")u=0;else{if(!ze(a==10?xA:a==8?IA:hy,o))return r;u=Za(o,a)}Hr(i,u)}for(n=0;n<t;n++)if(u=i[n],n==t-1){if(u>=ry(256,5-t))return null}else if(u>255)return null;for(p=yA(i),n=0;n<i.length;n++)p+=i[n]*ry(256,3-n);return p},FA=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,u,p,f,g,c,h=function(){return Te(r,n)};if(h()==":"){if(Te(r,1)!=":")return;n+=2,t++,i=t}for(;h();){if(t==8)return;if(h()==":"){if(i!==null)return;n++,t++,i=t;continue}for(o=a=0;a<4&&ze(hy,h());)o=o*16+Za(h(),16),n++,a++;if(h()=="."){if(a==0||(n-=a,t>6))return;for(u=0;h();){if(p=null,u>0)if(h()=="."&&u<4)n++;else return;if(!ze(ac,h()))return;for(;ze(ac,h());){if(f=Za(h(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}if(p>255)return;n++}e[t]=e[t]*256+p,u++,(u==2||u==4)&&t++}if(u!=4)return;break}else if(h()==":"){if(n++,!h())return}else if(h())return;e[t++]=o}if(i!==null)for(g=t-i,t=7;t!=0&&g>0;)c=e[t],e[t--]=e[i+g-1],e[i+--g]=c;else if(t!=8)return;return e},BA=function(r){for(var e=null,t=1,i=null,n=0,o=0;o<8;o++)r[o]!==0?(n>t&&(e=i,t=n),i=null,n=0):(i===null&&(i=o),++n);return n>t&&(e=i,t=n),e},Vn=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)PA(e,r%256),r=gA(r/256);return zn(e,".")}else if(typeof r=="object"){for(e="",i=BA(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=hA(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},Ja={},yy=uc({},Ja,{" ":1,'"':1,"<":1,">":1,"`":1}),vy=uc({},yy,{"#":1,"?":1,"{":1,"}":1}),Ju=uc({},vy,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Pt=function(r,e){var t=dA(r,0);return t>32&&t<127&&!sc(e,r)?r:encodeURIComponent(r)},Va={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$n=function(r,e){var t;return r.length==2&&ze(gy,Te(r,0))&&((t=Te(r,1))==":"||!e&&t=="|")},sy=function(r){var e;return r.length>1&&$n(Jn(r,0,2))&&(r.length==2||(e=Te(r,2))==="/"||e==="\\"||e==="?"||e==="#")},OA=function(r){return r==="."||Ya(r)==="%2e"},UA=function(r){return r=Ya(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ku={},oy={},Xu={},ay={},dy={},Zu={},ly={},uy={},za={},$a={},Yu={},Qu={},ec={},tc={},cy={},rc={},qr={},Qe={},my={},er={},st={},cc=function(r,e,t){var i=ot(r),n,o,a;if(e){if(o=this.parse(i),o)throw oc(o);this.searchParams=null}else{if(t!==void 0&&(n=new cc(t,!0)),o=this.parse(i,null,n),o)throw oc(o);a=fA(new pA),a.bindURL(this),this.searchParams=a}};cc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Ku,o=0,a="",u=!1,p=!1,f=!1,g,c,h,P;for(r=ot(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=iy(r,EA,"")),r=iy(r,TA,""),g=Nr(r);o<=g.length;){switch(c=g[o],n){case Ku:if(c&&ze(gy,c))a+=Ya(c),n=oy;else{if(e)return $u;n=Xu;continue}break;case oy:if(c&&(ze(SA,c)||c=="+"||c=="-"||c=="."))a+=Ya(c);else if(c==":"){if(e&&(i.isSpecial()!=sc(Va,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&Va[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=tc:i.isSpecial()&&t&&t.scheme==i.scheme?n=ay:i.isSpecial()?n=uy:g[o+1]=="/"?(n=dy,o++):(i.cannotBeABaseURL=!0,Hr(i.path,""),n=my)}else{if(e)return $u;a="",n=Xu,o=0;continue}break;case Xu:if(!t||t.cannotBeABaseURL&&c!="#")return $u;if(t.cannotBeABaseURL&&c=="#"){i.scheme=t.scheme,i.path=Ve(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=st;break}n=t.scheme=="file"?tc:Zu;continue;case ay:if(c=="/"&&g[o+1]=="/")n=za,o++;else{n=Zu;continue}break;case dy:if(c=="/"){n=$a;break}else{n=Qe;continue}case Zu:if(i.scheme=t.scheme,c==Ae)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query;else if(c=="/"||c=="\\"&&i.isSpecial())n=ly;else if(c=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query="",n=er;else if(c=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=st;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.path.length--,n=Qe;continue}break;case ly:if(i.isSpecial()&&(c=="/"||c=="\\"))n=za;else if(c=="/")n=$a;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=Qe;continue}break;case uy:if(n=za,c!="/"||Te(a,o+1)!="/")continue;o++;break;case za:if(c!="/"&&c!="\\"){n=$a;continue}break;case $a:if(c=="@"){u&&(a="%40"+a),u=!0,h=Nr(a);for(var w=0;w<h.length;w++){var C=h[w];if(C==":"&&!f){f=!0;continue}var E=Pt(C,Ju);f?i.password+=E:i.username+=E}a=""}else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()){if(u&&a=="")return kA;o-=Nr(a).length+1,a="",n=Yu}else a+=c;break;case Yu:case Qu:if(e&&i.scheme=="file"){n=rc;continue}else if(c==":"&&!p){if(a=="")return Qt;if(P=i.parseHost(a),P)return P;if(a="",n=ec,e==Qu)return}else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return Qt;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(P=i.parseHost(a),P)return P;if(a="",n=qr,e)return;continue}else c=="["?p=!0:c=="]"&&(p=!1),a+=c;break;case ec:if(ze(ac,c))a+=c;else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()||e){if(a!=""){var D=Za(a,10);if(D>65535)return ny;i.port=i.isSpecial()&&D===Va[i.scheme]?null:D,a=""}if(e)return;n=qr;continue}else return ny;break;case tc:if(i.scheme="file",c=="/"||c=="\\")n=cy;else if(t&&t.scheme=="file")if(c==Ae)i.host=t.host,i.path=Ve(t.path),i.query=t.query;else if(c=="?")i.host=t.host,i.path=Ve(t.path),i.query="",n=er;else if(c=="#")i.host=t.host,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=st;else{sy(zn(Ve(g,o),""))||(i.host=t.host,i.path=Ve(t.path),i.shortenPath()),n=Qe;continue}else{n=Qe;continue}break;case cy:if(c=="/"||c=="\\"){n=rc;break}t&&t.scheme=="file"&&!sy(zn(Ve(g,o),""))&&($n(t.path[0],!0)?Hr(i.path,t.path[0]):i.host=t.host),n=Qe;continue;case rc:if(c==Ae||c=="/"||c=="\\"||c=="?"||c=="#"){if(!e&&$n(a))n=Qe;else if(a==""){if(i.host="",e)return;n=qr}else{if(P=i.parseHost(a),P)return P;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=qr}continue}else a+=c;break;case qr:if(i.isSpecial()){if(n=Qe,c!="/"&&c!="\\")continue}else if(!e&&c=="?")i.query="",n=er;else if(!e&&c=="#")i.fragment="",n=st;else if(c!=Ae&&(n=Qe,c!="/"))continue;break;case Qe:if(c==Ae||c=="/"||c=="\\"&&i.isSpecial()||!e&&(c=="?"||c=="#")){if(UA(a)?(i.shortenPath(),c!="/"&&!(c=="\\"&&i.isSpecial())&&Hr(i.path,"")):OA(a)?c!="/"&&!(c=="\\"&&i.isSpecial())&&Hr(i.path,""):(i.scheme=="file"&&!i.path.length&&$n(a)&&(i.host&&(i.host=""),a=Te(a,0)+":"),Hr(i.path,a)),a="",i.scheme=="file"&&(c==Ae||c=="?"||c=="#"))for(;i.path.length>1&&i.path[0]==="";)vA(i.path);c=="?"?(i.query="",n=er):c=="#"&&(i.fragment="",n=st)}else a+=Pt(c,vy);break;case my:c=="?"?(i.query="",n=er):c=="#"?(i.fragment="",n=st):c!=Ae&&(i.path[0]+=Pt(c,Ja));break;case er:!e&&c=="#"?(i.fragment="",n=st):c!=Ae&&(c=="'"&&i.isSpecial()?i.query+="%27":c=="#"?i.query+="%23":i.query+=Pt(c,Ja));break;case st:c!=Ae&&(i.fragment+=Pt(c,yy));break}o++}},parseHost:function(r){var e,t,i;if(Te(r,0)=="["){if(Te(r,r.length-1)!="]"||(e=FA(Jn(r,1,-1)),!e))return Qt;this.host=e}else if(this.isSpecial()){if(r=lA(r),ze(CA,r)||(e=RA(r),e===null))return Qt;this.host=e}else{if(ze(AA,r))return Qt;for(e="",t=Nr(r),i=0;i<t.length;i++)e+=Pt(t[i],Ja);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return sc(Va,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!$n(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,n=r.host,o=r.port,a=r.path,u=r.query,p=r.fragment,f=e+":";return n!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=Vn(n),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+zn(a,"/"):"",u!==null&&(f+="?"+u),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw oc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new jr(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+Vn(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(ot(r)+":",Ku)},getUsername:function(){return this.username},setUsername:function(r){var e=Nr(ot(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=Pt(e[t],Ju)}},getPassword:function(){return this.password},setPassword:function(r){var e=Nr(ot(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=Pt(e[t],Ju)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?Vn(r):Vn(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Yu)},getHostname:function(){var r=this.host;return r===null?"":Vn(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Qu)},getPort:function(){var r=this.port;return r===null?"":ot(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=ot(r),r==""?this.port=null:this.parse(r,ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+zn(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,qr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=ot(r),r==""?this.query=null:(Te(r,0)=="?"&&(r=Jn(r,1)),this.query="",this.parse(r,er)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=ot(r),r==""){this.fragment=null;return}Te(r,0)=="#"&&(r=Jn(r,1)),this.fragment="",this.parse(r,st)},update:function(){this.query=this.searchParams.serialize()||null}};var jr=function(e){var t=aA(this,ee),i=cA(arguments.length,1)>1?arguments[1]:void 0,n=mA(t,new cc(e,!1,i));dc||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ee=jr.prototype,Ee=function(r,e){return{get:function(){return Xa(this)[r]()},set:e&&function(t){return Xa(this)[e](t)},configurable:!0,enumerable:!0}};dc&&(Ce(ee,"href",Ee("serialize","setHref")),Ce(ee,"origin",Ee("getOrigin")),Ce(ee,"protocol",Ee("getProtocol","setProtocol")),Ce(ee,"username",Ee("getUsername","setUsername")),Ce(ee,"password",Ee("getPassword","setPassword")),Ce(ee,"host",Ee("getHost","setHost")),Ce(ee,"hostname",Ee("getHostname","setHostname")),Ce(ee,"port",Ee("getPort","setPort")),Ce(ee,"pathname",Ee("getPathname","setPathname")),Ce(ee,"search",Ee("getSearch","setSearch")),Ce(ee,"searchParams",Ee("getSearchParams")),Ce(ee,"hash",Ee("getHash","setHash")));Ka(ee,"toJSON",function(){return Xa(this).serialize()},{enumerable:!0});Ka(ee,"toString",function(){return Xa(this).serialize()},{enumerable:!0});Gn&&(ic=Gn.createObjectURL,nc=Gn.revokeObjectURL,ic&&Ka(jr,"createObjectURL",ty(ic,Gn)),nc&&Ka(jr,"revokeObjectURL",ty(nc,Gn)));var ic,nc;uA(jr,"URL");sA({global:!0,constructor:!0,forced:!oA,sham:!dc},{URL:jr})});var Py=b(()=>{by()});var ky=b(()=>{"use strict";var MA=Un(),LA=je();MA({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return LA(URL.prototype.toString,this)}})});var Sy=b(()=>{zu()});var Iy=b((xU,wy)=>{var DA=pe();wy.exports=DA});var Cy=b((CU,xy)=>{Py();ky();Sy();var _A=Iy();xy.exports=_A.URL});var hc=b(td=>{"use strict";td.byteLength=rE;td.toByteArray=nE;td.fromByteArray=aE;var et=[],Oe=[],tE=typeof Uint8Array<"u"?Uint8Array:Array,gc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sr=0,Fy=gc.length;sr<Fy;++sr)et[sr]=gc[sr],Oe[gc.charCodeAt(sr)]=sr;var sr,Fy;Oe["-".charCodeAt(0)]=62;Oe["_".charCodeAt(0)]=63;function By(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function rE(r){var e=By(r),t=e[0],i=e[1];return(t+i)*3/4-i}function iE(r,e,t){return(e+t)*3/4-t}function nE(r){var e,t=By(r),i=t[0],n=t[1],o=new tE(iE(r,i,n)),a=0,u=n>0?i-4:i,p;for(p=0;p<u;p+=4)e=Oe[r.charCodeAt(p)]<<18|Oe[r.charCodeAt(p+1)]<<12|Oe[r.charCodeAt(p+2)]<<6|Oe[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Oe[r.charCodeAt(p)]<<2|Oe[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=Oe[r.charCodeAt(p)]<<10|Oe[r.charCodeAt(p+1)]<<4|Oe[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function sE(r){return et[r>>18&63]+et[r>>12&63]+et[r>>6&63]+et[r&63]}function oE(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(sE(i));return n.join("")}function aE(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,u=t-i;a<u;a+=o)n.push(oE(r,a,a+o>u?u:a+o));return i===1?(e=r[t-1],n.push(et[e>>2]+et[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"=")),n.join("")}});var Oy=b(yc=>{yc.read=function(r,e,t,i,n){var o,a,u=n*8-i-1,p=(1<<u)-1,f=p>>1,g=-7,c=t?n-1:0,h=t?-1:1,P=r[e+c];for(c+=h,o=P&(1<<-g)-1,P>>=-g,g+=u;g>0;o=o*256+r[e+c],c+=h,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=i;g>0;a=a*256+r[e+c],c+=h,g-=8);if(o===0)o=1-f;else{if(o===p)return a?NaN:(P?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-f}return(P?-1:1)*a*Math.pow(2,o-i)};yc.write=function(r,e,t,i,n,o){var a,u,p,f=o*8-n-1,g=(1<<f)-1,c=g>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=i?0:o-1,w=i?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+c>=1?e+=h/p:e+=h*Math.pow(2,1-c),e*p>=2&&(a++,p/=2),a+c>=g?(u=0,a=g):a+c>=1?(u=(e*p-1)*Math.pow(2,n),a=a+c):(u=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;r[t+P]=u&255,P+=w,u/=256,n-=8);for(a=a<<n|u,f+=n;f>0;r[t+P]=a&255,P+=w,a/=256,f-=8);r[t+P-w]|=C*128}});var Xy=b(Jr=>{"use strict";var vc=hc(),zr=Oy(),Uy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jr.Buffer=y;Jr.SlowBuffer=pE;Jr.INSPECT_MAX_BYTES=50;var rd=2147483647;Jr.kMaxLength=rd;y.TYPED_ARRAY_SUPPORT=dE();!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function dE(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function dt(r){if(r>rd)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,y.prototype),e}function y(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Sc(r)}return _y(r,e,t)}y.poolSize=8192;function _y(r,e,t){if(typeof r=="string")return uE(r,e);if(ArrayBuffer.isView(r))return cE(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(tt(r,ArrayBuffer)||r&&tt(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(r,SharedArrayBuffer)||r&&tt(r.buffer,SharedArrayBuffer)))return Pc(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return y.from(i,e,t);let n=mE(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return y.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}y.from=function(r,e,t){return _y(r,e,t)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function Ny(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function lE(r,e,t){return Ny(r),r<=0?dt(r):e!==void 0?typeof t=="string"?dt(r).fill(e,t):dt(r).fill(e):dt(r)}y.alloc=function(r,e,t){return lE(r,e,t)};function Sc(r){return Ny(r),dt(r<0?0:wc(r)|0)}y.allocUnsafe=function(r){return Sc(r)};y.allocUnsafeSlow=function(r){return Sc(r)};function uE(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=qy(r,e)|0,i=dt(t),n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}function bc(r){let e=r.length<0?0:wc(r.length)|0,t=dt(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function cE(r){if(tt(r,Uint8Array)){let e=new Uint8Array(r);return Pc(e.buffer,e.byteOffset,e.byteLength)}return bc(r)}function Pc(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,y.prototype),i}function mE(r){if(y.isBuffer(r)){let e=wc(r.length)|0,t=dt(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||xc(r.length)?dt(0):bc(r);if(r.type==="Buffer"&&Array.isArray(r.data))return bc(r.data)}function wc(r){if(r>=rd)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rd.toString(16)+" bytes");return r|0}function pE(r){return+r!=r&&(r=0),y.alloc(+r)}y.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype};y.compare=function(e,t){if(tt(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),tt(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),!y.isBuffer(e)||!y.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0};y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};y.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;let n=y.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){let a=e[i];if(tt(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n};function qy(r,e){if(y.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||tt(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return kc(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ky(r).length;default:if(n)return i?-1:kc(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=qy;function fE(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return IE(this,e,t);case"utf8":case"utf-8":return jy(this,e,t);case"ascii":return SE(this,e,t);case"latin1":case"binary":return wE(this,e,t);case"base64":return PE(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xE(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}y.prototype._isBuffer=!0;function or(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}y.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)or(this,t,t+1);return this};y.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)or(this,t,t+3),or(this,t+1,t+2);return this};y.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)or(this,t,t+7),or(this,t+1,t+6),or(this,t+2,t+5),or(this,t+3,t+4);return this};y.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?jy(this,0,e):fE.apply(this,arguments)};y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0};y.prototype.inspect=function(){let e="",t=Jr.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};Uy&&(y.prototype[Uy]=y.prototype.inspect);y.prototype.compare=function(e,t,i,n,o){if(tt(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,u=i-t,p=Math.min(a,u),f=this.slice(n,o),g=e.slice(t,i);for(let c=0;c<p;++c)if(f[c]!==g[c]){a=f[c],u=g[c];break}return a<u?-1:u<a?1:0};function Hy(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,xc(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=y.from(e,i)),y.isBuffer(e))return e.length===0?-1:My(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):My(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function My(r,e,t,i,n){let o=1,a=r.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,u/=2,t/=2}function p(g,c){return o===1?g[c]:g.readUInt16BE(c*o)}let f;if(n){let g=-1;for(f=t;f<a;f++)if(p(r,f)===p(e,g===-1?0:f-g)){if(g===-1&&(g=f),f-g+1===u)return g*o}else g!==-1&&(f-=f-g),g=-1}else for(t+u>a&&(t=a-u),f=t;f>=0;f--){let g=!0;for(let c=0;c<u;c++)if(p(r,f+c)!==p(e,c)){g=!1;break}if(g)return f}return-1}y.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1};y.prototype.indexOf=function(e,t,i){return Hy(this,e,t,i,!0)};y.prototype.lastIndexOf=function(e,t,i){return Hy(this,e,t,i,!1)};function gE(r,e,t,i){t=Number(t)||0;let n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let u=parseInt(e.substr(a*2,2),16);if(xc(u))return a;r[t+a]=u}return a}function hE(r,e,t,i){return id(kc(e,r.length-t),r,t,i)}function yE(r,e,t,i){return id(TE(e),r,t,i)}function vE(r,e,t,i){return id(Ky(e),r,t,i)}function bE(r,e,t,i){return id(RE(e,r.length-t),r,t,i)}y.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return gE(this,e,t,i);case"utf8":case"utf-8":return hE(this,e,t,i);case"ascii":case"latin1":case"binary":return yE(this,e,t,i);case"base64":return vE(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bE(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function PE(r,e,t){return e===0&&t===r.length?vc.fromByteArray(r):vc.fromByteArray(r.slice(e,t))}function jy(r,e,t){t=Math.min(r.length,t);let i=[],n=e;for(;n<t;){let o=r[n],a=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u<=t){let p,f,g,c;switch(u){case 1:o<128&&(a=o);break;case 2:p=r[n+1],(p&192)===128&&(c=(o&31)<<6|p&63,c>127&&(a=c));break;case 3:p=r[n+1],f=r[n+2],(p&192)===128&&(f&192)===128&&(c=(o&15)<<12|(p&63)<<6|f&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:p=r[n+1],f=r[n+2],g=r[n+3],(p&192)===128&&(f&192)===128&&(g&192)===128&&(c=(o&15)<<18|(p&63)<<12|(f&63)<<6|g&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=u}return kE(i)}var Ly=4096;function kE(r){let e=r.length;if(e<=Ly)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Ly));return t}function SE(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function wE(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function IE(r,e,t){let i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let o=e;o<t;++o)n+=FE[r[o]];return n}function xE(r,e,t){let i=r.slice(e,t),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}y.prototype.slice=function(e,t){let i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,y.prototype),n};function X(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return n};y.prototype.readUintBE=y.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n};y.prototype.readUint8=y.prototype.readUInt8=function(e,t){return e=e>>>0,t||X(e,1,this.length),this[e]};y.prototype.readUint16LE=y.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||X(e,2,this.length),this[e]|this[e+1]<<8};y.prototype.readUint16BE=y.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||X(e,2,this.length),this[e]<<8|this[e+1]};y.prototype.readUint32LE=y.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};y.prototype.readUint32BE=y.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};y.prototype.readBigUInt64LE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});y.prototype.readBigUInt64BE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)});y.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};y.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=t,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};y.prototype.readInt8=function(e,t){return e=e>>>0,t||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};y.prototype.readInt16LE=function(e,t){e=e>>>0,t||X(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};y.prototype.readInt16BE=function(e,t){e=e>>>0,t||X(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};y.prototype.readInt32LE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};y.prototype.readInt32BE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};y.prototype.readBigInt64LE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});y.prototype.readBigInt64BE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});y.prototype.readFloatLE=function(e,t){return e=e>>>0,t||X(e,4,this.length),zr.read(this,e,!0,23,4)};y.prototype.readFloatBE=function(e,t){return e=e>>>0,t||X(e,4,this.length),zr.read(this,e,!1,23,4)};y.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||X(e,8,this.length),zr.read(this,e,!0,52,8)};y.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||X(e,8,this.length),zr.read(this,e,!1,52,8)};function de(r,e,t,i,n,o){if(!y.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;de(this,e,t,i,u,0)}let o=1,a=0;for(this[t]=e&255;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i};y.prototype.writeUintBE=y.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;de(this,e,t,i,u,0)}let o=i-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i};y.prototype.writeUint8=y.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,1,255,0),this[t]=e&255,t+1};y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Wy(r,e,t,i,n){Jy(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,t}function Gy(r,e,t,i,n){Jy(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=a,a=a>>8,r[t+2]=a,a=a>>8,r[t+1]=a,a=a>>8,r[t]=a,t+8}y.prototype.writeBigUInt64LE=wt(function(e,t=0){return Wy(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});y.prototype.writeBigUInt64BE=wt(function(e,t=0){return Gy(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});y.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){let p=Math.pow(2,8*i-1);de(this,e,t,i,p-1,-p)}let o=0,a=1,u=0;for(this[t]=e&255;++o<i&&(a*=256);)e<0&&u===0&&this[t+o-1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+i};y.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){let p=Math.pow(2,8*i-1);de(this,e,t,i,p-1,-p)}let o=i-1,a=1,u=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+i};y.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};y.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};y.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};y.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};y.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};y.prototype.writeBigInt64LE=wt(function(e,t=0){return Wy(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});y.prototype.writeBigInt64BE=wt(function(e,t=0){return Gy(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Vy(r,e,t,i,n,o){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function zy(r,e,t,i,n){return e=+e,t=t>>>0,n||Vy(r,e,t,4,34028234663852886e22,-34028234663852886e22),zr.write(r,e,t,i,23,4),t+4}y.prototype.writeFloatLE=function(e,t,i){return zy(this,e,t,!0,i)};y.prototype.writeFloatBE=function(e,t,i){return zy(this,e,t,!1,i)};function $y(r,e,t,i,n){return e=+e,t=t>>>0,n||Vy(r,e,t,8,17976931348623157e292,-17976931348623157e292),zr.write(r,e,t,i,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,i){return $y(this,e,t,!0,i)};y.prototype.writeDoubleBE=function(e,t,i){return $y(this,e,t,!1,i)};y.prototype.copy=function(e,t,i,n){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),o};y.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<i;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,n),u=a.length;if(u===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=a[o%u]}return this};var Vr={};function Ic(r,e,t){Vr[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Ic("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ic("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);Ic("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=Dy(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=Dy(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Dy(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function CE(r,e,t){$r(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&Kn(e,r.length-(t+1))}function Jy(r,e,t,i,n,o){if(r>t||r<e){let a=typeof e=="bigint"?"n":"",u;throw o>3?e===0||e===BigInt(0)?u=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:u=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:u=`>= ${e}${a} and <= ${t}${a}`,new Vr.ERR_OUT_OF_RANGE("value",u,r)}CE(i,n,o)}function $r(r,e){if(typeof r!="number")throw new Vr.ERR_INVALID_ARG_TYPE(e,"number",r)}function Kn(r,e,t){throw Math.floor(r)!==r?($r(r,t),new Vr.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Vr.ERR_BUFFER_OUT_OF_BOUNDS:new Vr.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}var AE=/[^+/0-9A-Za-z-_]/g;function EE(r){if(r=r.split("=")[0],r=r.trim().replace(AE,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function kc(r,e){e=e||1/0;let t,i=r.length,n=null,o=[];for(let a=0;a<i;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function TE(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function RE(r,e){let t,i,n,o=[];for(let a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ky(r){return vc.toByteArray(EE(r))}function id(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function tt(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function xc(r){return r!==r}var FE=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e}();function wt(r){return typeof BigInt>"u"?BE:r}function BE(){throw new Error("BigInt not supported")}});var Kc=b((u_,Qv)=>{var BT=Object.prototype.toString;Qv.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return DT(e)?"generatorfunction":"function";if(OT(e))return"array";if(qT(e))return"buffer";if(NT(e))return"arguments";if(MT(e))return"date";if(UT(e))return"error";if(LT(e))return"regexp";switch(Yv(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(_T(e))return"generator";switch(t=BT.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Yv(r){return typeof r.constructor=="function"?r.constructor.name:null}function OT(r){return Array.isArray?Array.isArray(r):r instanceof Array}function UT(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function MT(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function LT(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function DT(r,e){return Yv(r)==="GeneratorFunction"}function _T(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function NT(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function qT(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var rb=b((c_,tb)=>{"use strict";var eb=Symbol.prototype.valueOf,HT=Kc();function jT(r,e){switch(HT(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return zT(r);case"symbol":return $T(r);case"arraybuffer":return GT(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return VT(r);case"regexp":return WT(r);case"error":return Object.create(r);default:return r}}function WT(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function GT(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function VT(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function zT(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function $T(r){return eb?Object(eb.call(r)):{}}tb.exports=jT});var nb=b((m_,ib)=>{"use strict";ib.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var ab=b((p_,ob)=>{"use strict";var JT=nb();function sb(r){return JT(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}ob.exports=function(e){var t,i;return!(sb(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,sb(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var lb=b((f_,db)=>{"use strict";var KT=rb(),XT=Kc(),ZT=ab();function Xc(r,e){switch(XT(r)){case"object":return YT(r,e);case"array":return QT(r,e);default:return KT(r)}}function YT(r,e){if(typeof e=="function")return e(r);if(e||ZT(r)){let t=new r.constructor;for(let i in r)t[i]=Xc(r[i],e);return t}return r}function QT(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=Xc(r[i],e);return t}db.exports=Xc});var Gb=b((ls,hi)=>{var eR=200,am="__lodash_hash_undefined__",Fd=1,kb=2,Sb=9007199254740991,Id="[object Arguments]",em="[object Array]",tR="[object AsyncFunction]",wb="[object Boolean]",Ib="[object Date]",xb="[object Error]",Cb="[object Function]",rR="[object GeneratorFunction]",xd="[object Map]",Ab="[object Number]",iR="[object Null]",gi="[object Object]",ub="[object Promise]",nR="[object Proxy]",Eb="[object RegExp]",Cd="[object Set]",Tb="[object String]",sR="[object Symbol]",oR="[object Undefined]",tm="[object WeakMap]",Rb="[object ArrayBuffer]",Ad="[object DataView]",aR="[object Float32Array]",dR="[object Float64Array]",lR="[object Int8Array]",uR="[object Int16Array]",cR="[object Int32Array]",mR="[object Uint8Array]",pR="[object Uint8ClampedArray]",fR="[object Uint16Array]",gR="[object Uint32Array]",hR=/[\\^$.*+?()[\]{}|]/g,yR=/^\[object .+?Constructor\]$/,vR=/^(?:0|[1-9]\d*)$/,H={};H[aR]=H[dR]=H[lR]=H[uR]=H[cR]=H[mR]=H[pR]=H[fR]=H[gR]=!0;H[Id]=H[em]=H[Rb]=H[wb]=H[Ad]=H[Ib]=H[xb]=H[Cb]=H[xd]=H[Ab]=H[gi]=H[Eb]=H[Cd]=H[Tb]=H[tm]=!1;var Fb=typeof global=="object"&&global&&global.Object===Object&&global,bR=typeof self=="object"&&self&&self.Object===Object&&self,ct=Fb||bR||Function("return this")(),Bb=typeof ls=="object"&&ls&&!ls.nodeType&&ls,cb=Bb&&typeof hi=="object"&&hi&&!hi.nodeType&&hi,Ob=cb&&cb.exports===Bb,Zc=Ob&&Fb.process,mb=function(){try{return Zc&&Zc.binding&&Zc.binding("util")}catch{}}(),pb=mb&&mb.isTypedArray;function PR(r,e){for(var t=-1,i=r==null?0:r.length,n=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[n++]=a)}return o}function kR(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function SR(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function wR(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function IR(r){return function(e){return r(e)}}function xR(r,e){return r.has(e)}function CR(r,e){return r?.[e]}function AR(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function ER(r,e){return function(t){return r(e(t))}}function TR(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var RR=Array.prototype,FR=Function.prototype,Bd=Object.prototype,Yc=ct["__core-js_shared__"],Ub=FR.toString,rt=Bd.hasOwnProperty,fb=function(){var r=/[^.]+$/.exec(Yc&&Yc.keys&&Yc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Mb=Bd.toString,BR=RegExp("^"+Ub.call(rt).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gb=Ob?ct.Buffer:void 0,Ed=ct.Symbol,hb=ct.Uint8Array,Lb=Bd.propertyIsEnumerable,OR=RR.splice,cr=Ed?Ed.toStringTag:void 0,yb=Object.getOwnPropertySymbols,UR=gb?gb.isBuffer:void 0,MR=ER(Object.keys,Object),rm=yi(ct,"DataView"),us=yi(ct,"Map"),im=yi(ct,"Promise"),nm=yi(ct,"Set"),sm=yi(ct,"WeakMap"),cs=yi(Object,"create"),LR=fr(rm),DR=fr(us),_R=fr(im),NR=fr(nm),qR=fr(sm),vb=Ed?Ed.prototype:void 0,Qc=vb?vb.valueOf:void 0;function mr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function HR(){this.__data__=cs?cs(null):{},this.size=0}function jR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function WR(r){var e=this.__data__;if(cs){var t=e[r];return t===am?void 0:t}return rt.call(e,r)?e[r]:void 0}function GR(r){var e=this.__data__;return cs?e[r]!==void 0:rt.call(e,r)}function VR(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=cs&&e===void 0?am:e,this}mr.prototype.clear=HR;mr.prototype.delete=jR;mr.prototype.get=WR;mr.prototype.has=GR;mr.prototype.set=VR;function mt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function zR(){this.__data__=[],this.size=0}function $R(r){var e=this.__data__,t=Od(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():OR.call(e,t,1),--this.size,!0}function JR(r){var e=this.__data__,t=Od(e,r);return t<0?void 0:e[t][1]}function KR(r){return Od(this.__data__,r)>-1}function XR(r,e){var t=this.__data__,i=Od(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}mt.prototype.clear=zR;mt.prototype.delete=$R;mt.prototype.get=JR;mt.prototype.has=KR;mt.prototype.set=XR;function pr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function ZR(){this.size=0,this.__data__={hash:new mr,map:new(us||mt),string:new mr}}function YR(r){var e=Ud(this,r).delete(r);return this.size-=e?1:0,e}function QR(r){return Ud(this,r).get(r)}function eF(r){return Ud(this,r).has(r)}function tF(r,e){var t=Ud(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}pr.prototype.clear=ZR;pr.prototype.delete=YR;pr.prototype.get=QR;pr.prototype.has=eF;pr.prototype.set=tF;function Td(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new pr;++e<t;)this.add(r[e])}function rF(r){return this.__data__.set(r,am),this}function iF(r){return this.__data__.has(r)}Td.prototype.add=Td.prototype.push=rF;Td.prototype.has=iF;function Ft(r){var e=this.__data__=new mt(r);this.size=e.size}function nF(){this.__data__=new mt,this.size=0}function sF(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function oF(r){return this.__data__.get(r)}function aF(r){return this.__data__.has(r)}function dF(r,e){var t=this.__data__;if(t instanceof mt){var i=t.__data__;if(!us||i.length<eR-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new pr(i)}return t.set(r,e),this.size=t.size,this}Ft.prototype.clear=nF;Ft.prototype.delete=sF;Ft.prototype.get=oF;Ft.prototype.has=aF;Ft.prototype.set=dF;function lF(r,e){var t=Rd(r),i=!t&&IF(r),n=!t&&!i&&om(r),o=!t&&!i&&!n&&Wb(r),a=t||i||n||o,u=a?wR(r.length,String):[],p=u.length;for(var f in r)(e||rt.call(r,f))&&!(a&&(f=="length"||n&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||bF(f,p)))&&u.push(f);return u}function Od(r,e){for(var t=r.length;t--;)if(Nb(r[t][0],e))return t;return-1}function uF(r,e,t){var i=e(r);return Rd(r)?i:kR(i,t(r))}function ps(r){return r==null?r===void 0?oR:iR:cr&&cr in Object(r)?yF(r):wF(r)}function bb(r){return ms(r)&&ps(r)==Id}function Db(r,e,t,i,n){return r===e?!0:r==null||e==null||!ms(r)&&!ms(e)?r!==r&&e!==e:cF(r,e,t,i,Db,n)}function cF(r,e,t,i,n,o){var a=Rd(r),u=Rd(e),p=a?em:Rt(r),f=u?em:Rt(e);p=p==Id?gi:p,f=f==Id?gi:f;var g=p==gi,c=f==gi,h=p==f;if(h&&om(r)){if(!om(e))return!1;a=!0,g=!1}if(h&&!g)return o||(o=new Ft),a||Wb(r)?_b(r,e,t,i,n,o):gF(r,e,p,t,i,n,o);if(!(t&Fd)){var P=g&&rt.call(r,"__wrapped__"),w=c&&rt.call(e,"__wrapped__");if(P||w){var C=P?r.value():r,E=w?e.value():e;return o||(o=new Ft),n(C,E,t,i,o)}}return h?(o||(o=new Ft),hF(r,e,t,i,n,o)):!1}function mF(r){if(!jb(r)||kF(r))return!1;var e=qb(r)?BR:yR;return e.test(fr(r))}function pF(r){return ms(r)&&Hb(r.length)&&!!H[ps(r)]}function fF(r){if(!SF(r))return MR(r);var e=[];for(var t in Object(r))rt.call(r,t)&&t!="constructor"&&e.push(t);return e}function _b(r,e,t,i,n,o){var a=t&Fd,u=r.length,p=e.length;if(u!=p&&!(a&&p>u))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var g=-1,c=!0,h=t&kb?new Td:void 0;for(o.set(r,e),o.set(e,r);++g<u;){var P=r[g],w=e[g];if(i)var C=a?i(w,P,g,e,r,o):i(P,w,g,r,e,o);if(C!==void 0){if(C)continue;c=!1;break}if(h){if(!SR(e,function(E,D){if(!xR(h,D)&&(P===E||n(P,E,t,i,o)))return h.push(D)})){c=!1;break}}else if(!(P===w||n(P,w,t,i,o))){c=!1;break}}return o.delete(r),o.delete(e),c}function gF(r,e,t,i,n,o,a){switch(t){case Ad:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Rb:return!(r.byteLength!=e.byteLength||!o(new hb(r),new hb(e)));case wb:case Ib:case Ab:return Nb(+r,+e);case xb:return r.name==e.name&&r.message==e.message;case Eb:case Tb:return r==e+"";case xd:var u=AR;case Cd:var p=i&Fd;if(u||(u=TR),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=kb,a.set(r,e);var g=_b(u(r),u(e),i,n,o,a);return a.delete(r),g;case sR:if(Qc)return Qc.call(r)==Qc.call(e)}return!1}function hF(r,e,t,i,n,o){var a=t&Fd,u=Pb(r),p=u.length,f=Pb(e),g=f.length;if(p!=g&&!a)return!1;for(var c=p;c--;){var h=u[c];if(!(a?h in e:rt.call(e,h)))return!1}var P=o.get(r);if(P&&o.get(e))return P==e;var w=!0;o.set(r,e),o.set(e,r);for(var C=a;++c<p;){h=u[c];var E=r[h],D=e[h];if(i)var Ke=a?i(D,E,h,e,r,o):i(E,D,h,r,e,o);if(!(Ke===void 0?E===D||n(E,D,t,i,o):Ke)){w=!1;break}C||(C=h=="constructor")}if(w&&!C){var Cn=r.constructor,la=e.constructor;Cn!=la&&"constructor"in r&&"constructor"in e&&!(typeof Cn=="function"&&Cn instanceof Cn&&typeof la=="function"&&la instanceof la)&&(w=!1)}return o.delete(r),o.delete(e),w}function Pb(r){return uF(r,AF,vF)}function Ud(r,e){var t=r.__data__;return PF(e)?t[typeof e=="string"?"string":"hash"]:t.map}function yi(r,e){var t=CR(r,e);return mF(t)?t:void 0}function yF(r){var e=rt.call(r,cr),t=r[cr];try{r[cr]=void 0;var i=!0}catch{}var n=Mb.call(r);return i&&(e?r[cr]=t:delete r[cr]),n}var vF=yb?function(r){return r==null?[]:(r=Object(r),PR(yb(r),function(e){return Lb.call(r,e)}))}:EF,Rt=ps;(rm&&Rt(new rm(new ArrayBuffer(1)))!=Ad||us&&Rt(new us)!=xd||im&&Rt(im.resolve())!=ub||nm&&Rt(new nm)!=Cd||sm&&Rt(new sm)!=tm)&&(Rt=function(r){var e=ps(r),t=e==gi?r.constructor:void 0,i=t?fr(t):"";if(i)switch(i){case LR:return Ad;case DR:return xd;case _R:return ub;case NR:return Cd;case qR:return tm}return e});function bF(r,e){return e=e??Sb,!!e&&(typeof r=="number"||vR.test(r))&&r>-1&&r%1==0&&r<e}function PF(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function kF(r){return!!fb&&fb in r}function SF(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Bd;return r===t}function wF(r){return Mb.call(r)}function fr(r){if(r!=null){try{return Ub.call(r)}catch{}try{return r+""}catch{}}return""}function Nb(r,e){return r===e||r!==r&&e!==e}var IF=bb(function(){return arguments}())?bb:function(r){return ms(r)&&rt.call(r,"callee")&&!Lb.call(r,"callee")},Rd=Array.isArray;function xF(r){return r!=null&&Hb(r.length)&&!qb(r)}var om=UR||TF;function CF(r,e){return Db(r,e)}function qb(r){if(!jb(r))return!1;var e=ps(r);return e==Cb||e==rR||e==tR||e==nR}function Hb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Sb}function jb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ms(r){return r!=null&&typeof r=="object"}var Wb=pb?IR(pb):pF;function AF(r){return xF(r)?lF(r):fF(r)}function EF(){return[]}function TF(){return!1}hi.exports=CF});var d2=An(Cy(),1);function v(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function Ay(r,e){return v(r,e),r}function tr(r,e){if(!r)throw Error(e)}var te;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(te||(te={}));function kt(r){return r.startsWith(te.COMMENT)}function Qa(r){return r.startsWith(te.ACCOUNT)}function rr(r){return r.startsWith(te.LINK)}function Ey(r){return r.startsWith(te.MESSAGE)}function Ty(r){return r.startsWith(te.SUBREDDIT)}function Ry(r){return r.startsWith(te.AWARD)}function NA(r){tr(kt(r),`Expected comment id to start with ${te.COMMENT}, got ${r}}`)}function qA(r){tr(Qa(r),`Expected account id to start with ${te.ACCOUNT}, got ${r}}`)}function HA(r){tr(rr(r),`Expected link id to start with ${te.LINK}, got ${r}}`)}function jA(r){tr(Ey(r),`Expected message id to start with ${te.MESSAGE}, got ${r}}`)}function WA(r){tr(Ty(r),`Expected subreddit id to start with ${te.SUBREDDIT}, got ${r}}`)}function GA(r){tr(Ry(r),`Expected award id to start with ${te.AWARD}, got ${r}}`)}function Wr(r){return NA(r),r}function re(r){return qA(r),r}function he(r){return HA(r),r}function VA(r){return jA(r),r}function Fe(r){return WA(r),r}function zA(r){return GA(r),r}function ye(r){if(kt(r))return Wr(r);if(Qa(r))return re(r);if(rr(r))return he(r);if(Ey(r))return VA(r);if(Ty(r))return Fe(r);if(Ry(r))return zA(r);throw new Error(`Expected thing id to start with ${Object.values(te).join(", ")} got ${r}}`)}function mc(r){return kt(r)}import*as I from"@devvit/protos";var ed=class{constructor(e){}};var pc=(t=>(t.Installation="installation",t.App="app",t))(pc||{});function ir(r,e=new Set){for(let t of r){if(t.type==="group"){ir(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}$A(r)}function $A(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var St=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var LU=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as NE,GetFieldsResponse as qE}from"@devvit/protos";import{FormField as nr,FormFieldType as Be}from"@devvit/protos";function at(r){return r.map(e=>{switch(e.type){case"string":return JA(e);case"image":return KA(e);case"paragraph":return XA(e);case"number":return ZA(e);case"select":return YA(e);case"boolean":return QA(e);case"group":return eE(e);default:throw new Error("Unknown field type.")}})}function JA(r){return nr.fromPartial({defaultValue:{fieldType:Be.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Be.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret})}function KA(r){return nr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Be.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function XA(r){return nr.fromPartial({defaultValue:{fieldType:Be.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Be.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required})}function ZA(r){return nr.fromPartial({defaultValue:{fieldType:Be.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Be.NUMBER,helpText:r.helpText,label:r.label,required:r.required})}function YA(r){return nr.fromPartial({defaultValue:{fieldType:Be.SELECTION,selectionValue:{values:r.defaultValue}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Be.SELECTION,helpText:r.helpText,label:r.label,required:r.required})}function QA(r){return nr.fromPartial({defaultValue:{fieldType:Be.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Be.BOOLEAN,helpText:r.helpText,label:r.label})}function eE(r){return nr.fromPartial({fieldType:Be.GROUP,fieldConfig:{groupConfig:{fields:at(r.fields)}},label:r.label,helpText:r.helpText})}function U(r,e){m.prototype[r]=e}import{ValidateFormResponse as _E}from"@devvit/protos";import{RealtimeSubscriptionStatus as Qy}from"@devvit/protos";var Gr;(function(r){function e(o,a){return o.length<=a?o:`${o.slice(0,a-1)}\u2026`}r.ellipsize=e;function t(o){return o[0]==null?o:`${o[0].toLocaleUpperCase()}${o.slice(1)}`}r.capitalize=t;function i(o){return o==null||/^\s*$/.test(o)}r.isBlank=i;function n(o){return o instanceof Error?`${o.stack||o.message||o.name}`:String(o)}r.caughtToString=n})(Gr||(Gr={}));function fc(r){if(r==null||typeof r!="object")return r;for(let e of Object.values(r))fc(e);return Object.freeze(r)}var dM=fc(new Set([Boolean,String,Date,ArrayBuffer,DataView,Array,Object,Map,Set,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError].map(r=>r.prototype)));var ie=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",DebugRenderXML:"devvit-debug-render-xml",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",TraceID:"devvit-trace-id",User:"devvit-user",Version:"devvit-version"});var Zy=An(Xy(),1),gM=globalThis.Buffer??Zy.Buffer;function ve(r,e){return e?.[r]?.values[0]}function OE(r){let e=Ay(r.method.split("/").at(-1));return e[0].toLocaleLowerCase()+e.slice(1)}var Yy;(function(r){function e(t){let i=t.request?`${t.src} \u2192 ${t.dst}`:`${t.dst} \u2190 ${t.src}`,n=t.streamId.split("-")[0],o=Gr.capitalize(OE(t));return`${i}@${n}/${o}`}r.toLogString=e})(Yy||(Yy={}));function ev(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState(),a=ve(ie.App,r.metadata);v(a,"useChannel - app is missing from Context");let u=ve(ie.Installation,r.metadata);v(u,"useChannel - installation is missing from Context");async function p(C){let E=n[i].channel;if(n[i].active)if(n[i].connected)await r.realtime.send(E,C);else throw Error(`Failed to send to channel '${E}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${E}`)}function f(){if(!n[i].active){let C=n[i].channel;n[i].active=!0,r.addRealtimeChannel(C)}}function g(){if(n[i].active){let C=n[i].channel;n[i].active=!1,r.removeRealtimeChannel(C)}}function c(C){return async()=>{let E;switch(C.status){case Qy.REALTIME_SUBSCRIBED:n[i].connected=!0,E=t.onSubscribed?.();break;case Qy.REALTIME_UNSUBSCRIBED:n[i].connected=!1,E=t.onUnsubscribed?.();break;default:E=t.onMessage(C.event?.data??{});break}await E}}let h={channel:`${a}:${u}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:St.CHANNEL};i in n?h=n[i]:i in o&&(h=o[i]);let P=r.realtimeEvent;r.isInitialRender?h.active=!1:P&&h.active&&P.event.channel===h.channel&&(h.preventCallback||r.runHook(c(P)),r.rerenderIn(0)),n[i]=h,r.currentHookIndex++;let w=0;return h.active&&h.connected?w=2:h.active&&!h.connected?w=1:!h.active&&h.connected?w=3:!h.active&&!h.connected&&(w=4),{subscribe:f,unsubscribe:g,send:p,status:w}}return e}import{FormFieldType as Kr}from"@devvit/protos";function Cc(r){switch(r.fieldType){case Kr.STRING:return r.stringValue;case Kr.IMAGE:return r.stringValue;case Kr.PARAGRAPH:return r.stringValue;case Kr.NUMBER:return r.numberValue;case Kr.BOOLEAN:return r.boolValue;case Kr.SELECTION:return r.selectionValue?.values??[];default:return}}function It(r){return Object.keys(r).reduce((e,t)=>(e[t]=Cc(r[t]),e),{})}function tv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),u=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,f={formKey:p,preventSubmit:!1,type:St.FORM};n in a?f=a[n]:n in u&&(f=u[n]),a[n]=f,r.forms.set(p,t);let g=r.formSubmittedEvent;return g&&!f.preventSubmit&&g.formId===p&&r.runHook(async()=>{let c=i(It(g.results));c&&c instanceof Promise&&await c,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function rv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),u=100,p=Math.max(u,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:St.INTERVAL};n in o?f=o[n]:n in a&&(f=a[n]);function g(){i<u&&console.error(`useInterval delay must be at least ${u}ms. Your interval of ${i}ms was automatically extended.`);for(let[h,P]of Object.entries(o))if(h!==n.toString()&&P?.type===St.INTERVAL&&P?.running)throw new Error("Only one useInterval hook may be running at a time");o[n]={running:!0,lastRun:Date.now(),preventCallback:!1,type:St.INTERVAL},r.rerenderIn(p)}function c(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let h=t();h&&h instanceof Promise&&await h,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[n]=f,r.currentHookIndex++,{start:g,stop:c}}return e}function iv(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in n)return r.currentHookIndex++,[n[i],a];if(r.isInitialRender||!(i in o)){let u=t instanceof Function?t():t;if(u instanceof Promise)throw(async()=>{n[i]=await u,r.currentHookIndex=0})();n[i]=u}else n[i]=o[i];function a(u){if(r.isRendering)throw new Error("Cannot call setState while rendering.");n[i]=u instanceof Function?u(n[i]):u}return r.currentHookIndex++,[n[i],a]}return e}var Xr,Zr,nd,nv,sd,sv,Yr=class{constructor(e,t){l(this,nd);l(this,sd);l(this,Xr,void 0);l(this,Zr,void 0);d(this,Xr,e),d(this,Zr,t)}async getURL(e){return typeof e=="string"?k(this,nd,nv).call(this,e):k(this,sd,sv).call(this,e)}};Xr=new WeakMap,Zr=new WeakMap,nd=new WeakSet,nv=async function(e){let t=globalThis?.devvit?.config?.assets?.[e];if(t)return t;let i=await s(this,Zr).call(this).GetAssetURL({path:e},s(this,Xr));if(!i.found)throw new Error(`Could not load the URL for asset ${e}`);return i.url},sd=new WeakSet,sv=async function(e){let t={},i=[],n=globalThis?.devvit?.config?.assets;if(n)for(let a of e)n[a]?t[a]=n[a]:i.push(a);else i=e;if(i.length===0)return t;let o=await s(this,Zr).call(this).GetAssetURLs({paths:i},s(this,Xr));i=[];for(let[a,u]of Object.entries(o.urls))u.found?t[a]=u.paths[0]:i.push(a);if(i.length>0)throw new Error(`The following assets were missing from the assets list: ${i.join(", ")}`);return t};var xt,Qr=class{constructor(e){l(this,xt,void 0);d(this,xt,e)}async get(e){let{messages:t}=await m.kvStorePlugin.Get({keys:[e]},s(this,xt));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await m.kvStorePlugin.Put({messages:i},s(this,xt))}async delete(e){await m.kvStorePlugin.Del({keys:[e]},s(this,xt))}async list(){let{keys:e}=await m.kvStorePlugin.List({filter:"*"},s(this,xt));return e}};xt=new WeakMap;var Xn,ei=class{constructor(e){l(this,Xn,void 0);d(this,Xn,e)}async upload(e){let t=await m.mediaPlugin.Upload(e,s(this,Xn));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};Xn=new WeakMap;var Zn,ti=class{constructor(e){l(this,Zn,void 0);d(this,Zn,e)}async add(e){await m.modLogPlugin.Add(e,s(this,Zn))}};Zn=new WeakMap;var S,Yn,ii=class{constructor(e){l(this,S,void 0);l(this,Yn,void 0);d(this,S,e),d(this,Yn,new ad(e))}get modMail(){return s(this,Yn)}getSubredditById(e){return be.getById(ye(e),s(this,S))}getSubredditByName(e){return be.getByName(e,s(this,S))}addSubredditRemovalReason(e,t){return be.addRemovalReason(e,t.title,t.message,s(this,S))}getSubredditRemovalReasons(e){return be.getRemovalReasons(e,s(this,S))}getCurrentSubreddit(){return be.getFromMetadata(s(this,S))}getPostById(e){return z.getById(ye(e),s(this,S))}submitPost(e){return z.submit(e,s(this,S))}crosspost(e){return z.crosspost(e,s(this,S))}getUserById(e){return x.getById(ye(e),s(this,S))}getCollectionById(e){return ri.getCollectionById({collectionId:e},s(this,S))}createCollection(e){return ri.create(e,s(this,S))}getCollectionsForSubreddit(e){return ri.getCollectionsForSubreddit({subredditId:e},s(this,S))}getUserByUsername(e){return x.getByUsername(e,s(this,S))}getCurrentUser(){return x.getFromMetadata(ie.User,s(this,S))}getAppUser(){return x.getFromMetadata(ie.AppUser,s(this,S))}getSnoovatarUrl(e){return x.getSnoovatarUrl(e,s(this,S))}getCommentById(e){return Z.getById(ye(e),s(this,S))}getComments(e){return Z.getComments(e,s(this,S))}getCommentsByUser(e){return Z.getCommentsByUser(e,s(this,S))}submitComment(e){return Z.submit({...e,id:ye(e.id)},s(this,S))}getControversialPosts(e){return z.getControversialPosts(e,s(this,S))}getTopPosts(e){return z.getTopPosts(e,s(this,S))}getHotPosts(e){return z.getHotPosts(e,s(this,S))}getNewPosts(e){return z.getNewPosts(e,s(this,S))}getRisingPosts(e){return z.getRisingPosts(e,s(this,S))}getPostsByUser(e){return z.getPostsByUser(e,s(this,S))}getCommentsAndPostsByUser(e){return x.getOverview(e,s(this,S))}getModerationLog(e){return od(e,s(this,S))}getApprovedUsers(e){return x.getSubredditUsersByType({type:"contributors",...e},s(this,S))}approveUser(e,t){return x.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,S))}removeUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,S))}getWikiContributors(e){return x.getSubredditUsersByType({type:"wikicontributors",...e},s(this,S))}addWikiContributor(e,t){return x.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,S))}removeWikiContributor(e,t){return x.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,S))}getBannedUsers(e){return x.getSubredditUsersByType({type:"banned",...e},s(this,S))}banUser(e){return x.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},s(this,S))}unbanUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,S))}getBannedWikiContributors(e){return x.getSubredditUsersByType({type:"wikibanned",...e},s(this,S))}banWikiContributor(e){return x.createRelationship({...e,type:"wikibanned"},s(this,S))}unbanWikiContributor(e,t){return x.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,S))}getModerators(e){return x.getSubredditUsersByType({type:"moderators",...e},s(this,S))}inviteModerator(e){return x.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},s(this,S))}revokeModeratorInvite(e,t){return x.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,S))}removeModerator(e,t){return x.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,S))}setModeratorPermissions(e,t,i){return x.setModeratorPermissions(e,t,i,s(this,S))}getMutedUsers(e){return x.getSubredditUsersByType({type:"muted",...e},s(this,S))}muteUser(e){return x.createRelationship({...e,type:"muted"},s(this,S))}unmuteUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"muted"},s(this,S))}getModNotes(e){return Ue.get(e,s(this,S))}deleteModNote(e){return Ue.delete(e,s(this,S))}addModNote(e){let t={...e,redditId:ye(e.redditId)};return Ue.add(t,s(this,S))}addRemovalNote(e){return Ue.addRemovalNote(e,s(this,S))}async sendPrivateMessage(e){return ar.send(e,s(this,S))}async sendPrivateMessageAsSubreddit(e){return ar.sendAsSubreddit(e,s(this,S))}async approve(e){if(kt(e))return Z.approve(e,s(this,S));if(rr(e))return z.approve(e,s(this,S));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(kt(e))return Z.remove(e,t,s(this,S));if(rr(e))return z.remove(e,t,s(this,S));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return le.getPostFlairTemplates(e,s(this,S))}async getUserFlairTemplates(e){return le.getUserFlairTemplates(e,s(this,S))}async createPostFlairTemplate(e){return le.createPostFlairTemplate(e,s(this,S))}async createUserFlairTemplate(e){return le.createUserFlairTemplate(e,s(this,S))}async editFlairTemplate(e){return le.editFlairTemplate(e,s(this,S))}async deleteFlairTemplate(e,t){return le.deleteFlairTemplate(e,t,s(this,S))}async setUserFlair(e){return Me.setUserFlair(e,s(this,S))}async removeUserFlair(e,t){return Me.removeUserFlair(e,t,s(this,S))}async setPostFlair(e){return Me.setPostFlair(e,s(this,S))}async removePostFlair(e,t){return Me.removePostFlair(e,he(t),s(this,S))}async getWidgets(e){return ne.getWidgets(e,s(this,S))}async deleteWidget(e,t){return ne.delete(e,t,s(this,S))}async addWidget(e){return ne.add(e,s(this,S))}async reorderWidgets(e,t){return ne.reorder(e,t,s(this,S))}async getWikiPage(e,t){return Pe.getPage(e,t,s(this,S))}async getWikiPages(e){return Pe.getPages(e,s(this,S))}async createWikiPage(e){return Pe.createPage(e,s(this,S))}async updateWikiPage(e){return Pe.updatePage(e,s(this,S))}getWikiPageRevisions(e){return Pe.getPageRevisions(e,s(this,S))}async revertWikiPage(e,t,i){return Pe.revertPage(e,t,i,s(this,S))}async getWikiPageSettings(e,t){return Pe.getPageSettings(e,t,s(this,S))}async updateWikiPageSettings(e){return Pe.updatePageSettings(e,s(this,S))}async addEditorToWikiPage(e,t,i){return Pe.addEditor(e,t,i,s(this,S))}async removeEditorFromWikiPage(e,t,i){return Pe.removeEditor(e,t,i,s(this,S))}getMessages(e){return ar.getMessages(e,s(this,S))}markAllMessagesAsRead(){return ar.markAllAsRead(s(this,S))}report(e,t){return m.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},s(this,S))}getModQueue(e){return be.aboutLocation({...e,location:"modqueue"},s(this,S))}getReports(e){return be.aboutLocation({...e,location:"reports"},s(this,S))}getSpam(e){return be.aboutLocation({...e,location:"spam"},s(this,S))}getUnmoderated(e){return be.aboutLocation({...e,location:"unmoderated"},s(this,S))}getEdited(e){return be.aboutLocation({...e,location:"edited"},s(this,S))}getVaultByAddress(e){return av(e,s(this,S))}getVaultByUserId(e){return dv(ye(e),s(this,S))}};S=new WeakMap,Yn=new WeakMap;import{RedisKeyScope as Ac}from"@devvit/protos";var R,F,B,Ec=class{constructor(e,t,i){l(this,R,void 0);l(this,F,void 0);l(this,B,void 0);d(this,R,e),d(this,F,t),d(this,B,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,F)},s(this,B)),this}async multi(){await s(this,R).Multi(s(this,F),s(this,B))}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),await s(this,R).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:n||0,transactionId:s(this,F)},s(this,B)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,F)},s(this,B)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,F)},s(this,B)),this}async exec(){let e=await s(this,R).Exec(s(this,F),s(this,B)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await s(this,R).Discard(s(this,F),s(this,B))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,F)},s(this,B)),this}async unwatch(){return await s(this,R).Unwatch(s(this,F),s(this,B)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,F)},s(this,B)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,F)},s(this,B)),this}async strlen(e){return await s(this,R).Strlen({key:e,transactionId:s(this,F)},s(this,B)),this}async mget(e){return await s(this,R).MGet({keys:e,transactionId:s(this,F)},s(this,B)),this}async mset(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));return await s(this,R).MSet({kv:t,transactionId:s(this,F)},s(this,B)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,F)},s(this,B)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,F)},s(this,B)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,F)},s(this,B)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,F)},s(this,B)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,F)},member:t},s(this,B)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,F)},member:t},s(this,B)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,F)},s(this,B)),this}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,F)};return await s(this,R).ZScan(o,s(this,B)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,F)},s(this,B)),this}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"&&(o.byScore=!0),await s(this,R).ZRange({key:{key:e,transactionId:s(this,F)},start:t+"",stop:i+"",...o},s(this,B)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,F)},members:t},s(this,B)),this}async zRemRangeByLex(e,t,i){return await s(this,R).ZRemRangeByLex({key:{key:e,transactionId:s(this,F)},min:t,max:i},s(this,B)),this}async zRemRangeByRank(e,t,i){return await s(this,R).ZRemRangeByRank({key:{key:e,transactionId:s(this,F)},start:t,stop:i},s(this,B)),this}async zRemRangeByScore(e,t,i){return await s(this,R).ZRemRangeByScore({key:{key:e,transactionId:s(this,F)},min:t,max:i},s(this,B)),this}async hgetall(e){return await s(this,R).HGetAll({key:e,transactionId:s(this,F)},s(this,B)),this}async hget(e,t){return await s(this,R).HGet({key:e,field:t,transactionId:s(this,F)},s(this,B)),this}async hset(e,t){let i=Object.entries(t).map(([n,o])=>({field:n,value:o}));return await s(this,R).HSet({key:e,fv:i,transactionId:s(this,F)},s(this,B)),this}async hincrby(e,t,i){return await s(this,R).HIncrBy({key:e,field:t,value:i,transactionId:s(this,F)},s(this,B)),this}async hdel(e,t){return await s(this,R).HDel({key:e,fields:t,transactionId:s(this,F)},s(this,B)),this}async hscan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,F)};return await s(this,R).HScan(o,s(this,B)),this}async hkeys(e){return await s(this,R).HKeys({key:e,transactionId:s(this,F)},s(this,B)),this}async hlen(e){return await s(this,R).HLen({key:e,transactionId:s(this,F)},s(this,B)),this}};R=new WeakMap,F=new WeakMap,B=new WeakMap;var O,ni,Tc=class Tc{constructor(e,t=void 0,i=Ac.INSTALLATION){l(this,O,void 0);l(this,ni,void 0);d(this,O,e),d(this,ni,t),this.scope=i,this.global=i===Ac.INSTALLATION?new Tc(s(this,O),s(this,ni),Ac.GLOBAL):this}get storage(){return s(this,ni)||m.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,O));return new Ec(this.storage,t,s(this,O))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},s(this,O));return t!==null?t.value??void 0:t}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:n||0,scope:this.scope},s(this,O))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,O))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,O))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,O));return n!==null?n.value:n}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},s(this,O))).value}async strlen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,O))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,O))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,O))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,O))).value}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},s(this,O))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,O))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,O))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,O))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,O))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},s(this,O));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},s(this,O));return i!==null?i.value:i}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,O));return n!==null?n.value:n}async mget(e){let t=await this.storage.MGet({keys:e,scope:this.scope},s(this,O));return t!==null?t.values.map(i=>i||null):t}async mset(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));await this.storage.MSet({kv:t,scope:this.scope},s(this,O))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,O));return t!==null?t.value:t}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.ZScan(o,s(this,O))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,O));return t!==null?t.value:t}async hget(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},s(this,O));return i!==null?i.value??void 0:i}async hset(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},s(this,O))).value}async hgetall(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,O));return t!==null?t.fieldValues:t}async hdel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},s(this,O))).value}async hscan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.HScan(o,s(this,O))}async hkeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,O));return t!==null?t.keys:t}async hincrby(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},s(this,O))).value}async hlen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};O=new WeakMap,ni=new WeakMap;var si=Tc;var dr,oi=class{constructor(e){l(this,dr,void 0);d(this,dr,e)}async runJob(e){return(await m.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},s(this,dr))).id}async cancelJob(e){await m.schedulerPlugin.Cancel({id:e},s(this,dr))}async listJobs(){return(await m.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,dr))).actions.map(t=>(v(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};dr=new WeakMap;var Qn,ai=class{constructor(e){l(this,Qn,void 0);d(this,Qn,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await m.settingsPlugin.GetSettings({},s(this,Qn));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...lv(t.installationSettings.settings,m.installationSettings),...lv(t.appSettings.settings,m.appSettings)}}};Qn=new WeakMap;function lv(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=Cc(r[n]),i),{});return e&&uv(t,e),t}function uv(r,e){for(let t of e)t.type==="group"?uv(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as Rc,Form as UE,ToastAppearance as cv}from"@devvit/protos";var lr,di,dd=class{constructor(e){l(this,lr,[]);l(this,di,void 0);d(this,di,e)}showForm(e,t){let i=m.formDefinitions.get(e);if(!i&&s(this,di)){let a=s(this,di).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let n=i.form instanceof Function?i.form(t??{}):i.form,o=UE.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});ir(n.fields),o.fields=at(n.fields),s(this,lr).push({type:Rc.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?cv.SUCCESS:cv.NEUTRAL}:t={text:e},s(this,lr).push({type:Rc.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,lr).push({type:Rc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,lr)}};lr=new WeakMap,di=new WeakMap;var Uc={now(){return new Date}};function mv(r){return`__autocache__${r}`}function pv(r){return`__lock__${r}`}var ME=300,LE=1e3,ld=5e3,Fc=3,fv=.1,gv=1e3,DE=3e4;function hv(r){if(r.error)throw new Error(r.error);return r.value}var Ct,At,Le,li,cd,yv,md,vv,pd,bv,es,Bc,fd,Pv,gd,kv,ts,Oc,hd,Sv,ud=class{constructor(e,t,i=Uc){l(this,cd);l(this,md);l(this,pd);l(this,es);l(this,fd);l(this,gd);l(this,ts);l(this,hd);l(this,Ct,void 0);l(this,At,{});l(this,Le,void 0);l(this,li,void 0);d(this,Ct,e),d(this,li,t),d(this,Le,i)}async cache(e,t){d(this,At,s(this,li).__cache=s(this,li).__cache??{}),k(this,hd,Sv).call(this,t);let i=k(this,cd,yv).call(this,t.key);if(i!==void 0)return i;let n=await k(this,ts,Oc).call(this,t.key),o=await k(this,md,vv).call(this,t,n,e);return hv(o)}};Ct=new WeakMap,At=new WeakMap,Le=new WeakMap,li=new WeakMap,cd=new WeakSet,yv=function(e){let t=s(this,At)[e];if(t){let i=s(this,Le).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<Fc&&Math.random()<fv&&t.errorTime+gv<i;if(t?.expires&&t.expires<i&&t.checkedAt+gv<i||n){delete s(this,At)[e];return}else return hv(t)}},md=new WeakSet,vv=async function(e,t,i){let n=t?.expires,o=n?k(this,gd,kv).call(this,n):1;return!t||t?.error&&t.errorCount<Fc&&fv>Math.random()||o>Math.random()?k(this,pd,bv).call(this,e,t,i):t},pd=new WeakSet,bv=async function(e,t,i){let n=pv(e.key),o=s(this,Le).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,Ct).set(n,"1",{expiration:a,nx:!0}))return k(this,fd,Pv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Le).now();return k(this,es,Bc).call(this,p,e.key,e.ttl)}},es=new WeakSet,Bc=async function(e,t,i){let n=Math.min(i,LE),o=await k(this,ts,Oc).call(this,t);if(o)return o;if(s(this,Le).now().getTime()-e.getTime()>=n)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,ME)),k(this,es,Bc).call(this,e,t,i)},fd=new WeakSet,Pv=async function(e,t,i,n){let o=s(this,Le).now().getTime()+n;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=s(this,Le).now().getTime(),t.errorCount++}return s(this,At)[e]=t,await s(this,Ct).set(mv(e),JSON.stringify(t),{expiration:new Date(o+DE)}),t.error&&t.errorCount<Fc&&await s(this,Ct).del(pv(e)),t},gd=new WeakSet,kv=function(e){let t=s(this,Le).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},ts=new WeakSet,Oc=async function(e){let t=await s(this,Ct).get(mv(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Le).now().getTime(),s(this,At)[e]=i,i}},hd=new WeakSet,Sv=function(e){e.ttl<ld&&(console.warn(`Cache TTL cannot be less than ${ld} milliseconds! Updating ttl value of ${e.ttl} to ${ld}.`),e.ttl=ld)};function wv(r,e,t=Uc){let i=new ud(r,e,t);return i.cache.bind(i)}var rs,ui=class{constructor(e){l(this,rs,void 0);d(this,rs,e)}async send(e,t){await m.realtimePlugin.Send({channel:e,data:t},s(this,rs))}};rs=new WeakMap;function De({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new ti(r),o=new Qr(r),a=new si(r),u=wv(a,i?i.state:{}),p=new ii(r),f=new oi(r),g=new ai(r),c=e?new dd(i):void 0,h=new ei(r),P=new Yr(r,()=>m.assetsPlugin),w=new ui(r),C=t&&i?iv(i):void 0,E=t&&i?rv(i):void 0,D=t&&i?tv(i):void 0,Ke=t&&i?ev(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:f,settings:g,media:h,assets:P,realtime:w,get useForm(){return D??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return u??(()=>{throw new Error("cache() is unavailable")})},get useState(){return C??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return E??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return Ke??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!c)throw new Error("ui client is not available");return c}}}function ue(r,e,t){let i=ve(ie.Subreddit,r);v(i,"subreddit is missing from Context");let n=ve(ie.AppUser,r);v(n,"appAccountId is missing from Context");let o=ve(ie.User,r),a={metadata:r};return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}async function yd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=_E.fromPartial({success:!0,errors:{}}),n=It(r.fieldValues),o=e.flatMap(a=>a.type==="group"?a.fields:a);return await Promise.all(o.map(async a=>{let u=a.name;if(u&&a.type!=="group"&&a.onValidate){let p=n[u],f=a.onValidate,g=Object.assign(De({metadata:t}),ue(t)),c=await f({value:p,isEditing:r.editing},g);c&&(i.success=!1,i.errors[u]=c)}})),i}async function HE(){if(!m.appSettings)throw new Error("App settings were not defined.");return qE.fromPartial({fields:{fields:at(m.appSettings)}})}async function jE(r,e){return yd(r,m.appSettings,e)}function Iv(r){r.provides(NE),U("GetAppSettingsFields",HE),U("ValidateAppForm",jE)}import{CustomPostDefinition as rT}from"@devvit/protos";import{BlockRenderEventType as zc,BlockType as QE,EffectType as jv}from"@devvit/protos";var xv="redd.it",WE="redditstatic.com",GE="redditmedia.com",VE="snoo.dev";var zE=[VE,xv,WE,GE],$E=/^data:([a-zA-Z]+\/[a-zA-Z0-9.+_-]+)?(;charset=[a-zA-Z0-9._+-]+)?(;base64)?,(.*)/;function JE(r){return r.trim().replace(/[\r\n]+/g,"")}function KE(r){let e=$E.exec(JE(r));if(e)return{mimeType:e[1],charset:e[2]?.split("=")[1],isBase64:!!e[3],data:e[4].trim()}}function XE(r){return["image/svg+xml"].includes(r)}function ZE(r){let e=KE(r);return e?.mimeType?XE(e.mimeType):!1}function Cv(r){try{if(ZE(r))return!0;let t=(new URL(r,`https://i.${xv}`)?.hostname).split(".").slice(-2).join(".");return!!t&&zE.includes(t)}catch{return!1}}function ci(r){return r.__effects}function Av(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as YE,BlockAnimationDirection as Mv,BlockAnimationLoopMode as Lv,BlockAnimationType as Dv,BlockAvatarBackground as _v,BlockAvatarFacing as Nv,BlockAvatarSize as Et,BlockBorderWidth as bd,BlockButtonAppearance as Tt,BlockButtonSize as Dc,BlockFullSnooSize as mi,BlockGap as Pd,BlockHorizontalAlignment as _c,BlockIconSize as kd,BlockImageResizeMode as is,BlockPadding as ns,BlockRadius as ss,BlockSizeUnit as Nc,BlockSpacerShape as qc,BlockSpacerSize as Sd,BlockStackDirection as Hc,BlockTextOutline as jc,BlockTextOverflow as Wc,BlockTextSize as pi,BlockTextStyle as Gc,BlockTextWeight as qv,BlockType as _e,BlockVerticalAlignment as Vc}from"@devvit/protos";var Mc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var Ev={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Tv=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),Rv=r=>r in Mc,Lc=r=>r in Ev,Fv=r=>!!r.match(/^rgba?\(.*/),Bv=r=>!!r.match(/^hsla?\(.*/),Ov=(r,e="light")=>{if(Lc(r))return vd(r);let i=Mc[r];return typeof i=="string"?i:i[e]},vd=r=>Ev[r]??r,Uv=r=>{let[e,t,i,n]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(n){let p=parseFloat(n),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};var Hv="data-",fi=class{async createBlocksElementOrThrow({type:e,props:t,children:i}){let n=await this.createBlocksElement({type:e,props:t,children:i});if(!n)throw new Error(`Could not create block of type ${e}`);return n}async createBlocksElement({type:e,props:t,children:i}){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,...i);case"vstack":return this.makeVStack(t,...i);case"zstack":return this.makeZStack(t,...i);case"text":return this.makeText(t,...i);case"button":return this.makeButton(t,...i);case"image":return await this.makeImage(t);case"spacer":return this.makeSpacer(t);case"icon":return this.makeIcon(t);case"avatar":return this.makeAvatar(t);case"fullsnoo":return this.makeFullSnoo(t);case"animation":return await this.makeAnimation(t);case"webview":return this.makeWebView(t);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ns.PADDING_NONE;case"xsmall":return ns.PADDING_XSMALL;case"small":return ns.PADDING_SMALL;case"medium":return ns.PADDING_MEDIUM;case"large":return ns.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ss.RADIUS_NONE;case"small":return ss.RADIUS_SMALL;case"medium":return ss.RADIUS_MEDIUM;case"large":return ss.RADIUS_LARGE;case"full":return ss.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return Pd.GAP_NONE;case"small":return Pd.GAP_SMALL;case"medium":return Pd.GAP_MEDIUM;case"large":return Pd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Vc.ALIGN_TOP:e.includes("middle")?t=Vc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Vc.ALIGN_BOTTOM),e.includes("start")?i=_c.ALIGN_START:e.includes("center")?i=_c.ALIGN_CENTER:e.includes("end")&&(i=_c.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,n){if(!e&&!t)return;let o;switch(e){case"none":o=bd.BORDER_WIDTH_NONE;break;case"thin":o=bd.BORDER_WIDTH_THIN;break;case"thick":o=bd.BORDER_WIDTH_THICK;break;default:o=bd.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",u=this.getThemedColors(a,i,n);return{width:o,color:u?.light,colors:u}}makeBlockTextSize(e){switch(e){case"xsmall":return pi.TEXT_SIZE_XSMALL;case"small":return pi.TEXT_SIZE_SMALL;case"medium":return pi.TEXT_SIZE_MEDIUM;case"large":return pi.TEXT_SIZE_LARGE;case"xlarge":return pi.TEXT_SIZE_XLARGE;case"xxlarge":return pi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Gc.TEXT_STYLE_BODY;case"metadata":return Gc.TEXT_STYLE_METADATA;case"heading":return Gc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return jc.TEXT_OUTLINE_NONE;case"thin":return jc.TEXT_OUTLINE_THIN;case"thick":return jc.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return qv.TEXT_WEIGHT_REGULAR;case"bold":return qv.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return Wc.TEXT_OVERFLOW_CLIP;case"ellipsis":return Wc.TEXT_OVERFLOW_ELLIPSE}return Wc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Tt.BUTTON_APPEARANCE_SECONDARY;case"primary":return Tt.BUTTON_APPEARANCE_PRIMARY;case"plain":return Tt.BUTTON_APPEARANCE_PLAIN;case"bordered":return Tt.BUTTON_APPEARANCE_BORDERED;case"media":return Tt.BUTTON_APPEARANCE_MEDIA;case"destructive":return Tt.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Tt.BUTTON_APPEARANCE_CAUTION;case"success":return Tt.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Dc.BUTTON_SIZE_SMALL;case"medium":return Dc.BUTTON_SIZE_MEDIUM;case"large":return Dc.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return is.IMAGE_RESIZE_NONE;case"fit":return is.IMAGE_RESIZE_FIT;case"fill":return is.IMAGE_RESIZE_FILL;case"cover":return is.IMAGE_RESIZE_COVER;case"scale-down":return is.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return Sd.SPACER_XSMALL;case"small":return Sd.SPACER_SMALL;case"medium":return Sd.SPACER_MEDIUM;case"large":return Sd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return qc.SPACER_INVISIBLE;case"thin":return qc.SPACER_THIN;case"square":return qc.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return kd.ICON_SIZE_XSMALL;case"small":return kd.ICON_SIZE_SMALL;case"medium":return kd.ICON_SIZE_MEDIUM;case"large":return kd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Et.AVATAR_SIZE_XXSMALL;case"xsmall":return Et.AVATAR_SIZE_XSMALL;case"small":return Et.AVATAR_SIZE_SMALL;case"medium":return Et.AVATAR_SIZE_MEDIUM;case"large":return Et.AVATAR_SIZE_LARGE;case"xlarge":return Et.AVATAR_SIZE_XXLARGE;case"xxlarge":return Et.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Et.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Nv.AVATAR_FACING_LEFT;case"right":return Nv.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return mi.FULLSNOO_XSMALL;case"small":return mi.FULLSNOO_SMALL;case"medium":return mi.FULLSNOO_MEDIUM;case"large":return mi.FULLSNOO_LARGE;case"xlarge":return mi.FULLSNOO_XLARGE;case"xxlarge":return mi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return _v.AVATAR_BG_DARK;case"light":return _v.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?Dv.ANIM_LOTTIE:Dv.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return Mv.ANIM_DIR_BACKWARD;case"forward":return Mv.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Lv.ANIM_LOOP_REPEAT;case"bounce":return Lv.ANIM_LOOP_BOUNCE}}makeBlockSize(e){if(e&&(e.width!=null||e.height!=null||e.grow)){let{value:t,unit:i}=this.parseSize(e.width)??{},{value:n,unit:o}=this.parseSize(e.height)??{};return{width:t,widthUnit:i,height:n,heightUnit:o,grow:e.grow}}}makeBlockSizes(e){if(e){let t=e.width!=null||e.minWidth!=null||e.maxWidth!=null,i=e.height!=null||e.minHeight!=null||e.maxHeight!=null;if(t||i||e.grow!=null)return{width:t?{value:this.parseSize(e.width),min:this.parseSize(e.minWidth),max:this.parseSize(e.maxWidth)}:void 0,height:i?{value:this.parseSize(e.height),min:this.parseSize(e.minHeight),max:this.parseSize(e.maxHeight)}:void 0,grow:e.grow}}}parseSize(e){if(e==null)return;if(typeof e=="number")return{value:e,unit:Nc.SIZE_UNIT_PERCENT};let t=e.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(t==null)return;let i=Nc.SIZE_UNIT_PERCENT;return t?.at(2)==="px"&&(i=Nc.SIZE_UNIT_PIXELS),{value:Number.parseFloat(t[1]),unit:i}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(Hv)).reduce((t,i)=>(t[i.substring(Hv.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);if(t.onPress){let o=t.onPress;i.push({type:YE.ACTION_CLICK,id:o.toString(),data:n})}return i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),Tv(e)?e:Rv(e)?Ov(e,t):Lc(e)?vd(e):Fv(e)?Uv(e):Bv(e)?e:(console.warn(`Could not parse color: ${e}.`),vd("red"))}async childrenToBlocks(e){let t=e.map(n=>{if(typeof n!="string")return this.createBlocksElement(n)});return(await Promise.all(t)).filter(n=>n!==void 0)}getThemedColors(e,t,i){let n=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!n||!o)){let u=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...u.map(p=>p[0]))}return n||(n=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),n||o?{light:n,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}childrenToString(e){return e.map(t=>t.toString()).join("")}async makeRoot(e,...t){return this.wrapRoot(e,await this.childrenToBlocks(t))}async wrapRoot(e,t){return this.makeBlock(_e.BLOCK_ROOT,{},{rootConfig:{children:t,height:this.makeRootHeight(m.customPostType?.height??e?.height??"regular")}})}async makeStackBlock(e,t,i){let n=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor);return this.makeBlock(_e.BLOCK_STACK,t,{stackConfig:{alignment:this.makeBlockAlignment(t?.alignment),backgroundColor:n?.light,backgroundColors:n,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:await this.childrenToBlocks(i),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}async makeHStack(e,...t){return this.makeStackBlock(Hc.STACK_HORIZONTAL,e,t)}async makeVStack(e,...t){return this.makeStackBlock(Hc.STACK_VERTICAL,e,t)}async makeZStack(e,...t){return this.makeStackBlock(Hc.STACK_DEPTH,e,t)}makeText(e,...t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(_e.BLOCK_TEXT,e,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:i?.light,colors:i,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(t),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,...t){let i=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(_e.BLOCK_BUTTON,e,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(t),textColor:i?.light,textColors:i,disabled:e?.disabled}})}async makeImage(e){return e&&this.makeBlock(_e.BLOCK_IMAGE,e,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:e.url,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e){return this.makeBlock(_e.BLOCK_SPACER,e,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e){let t=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(_e.BLOCK_ICON,e,{iconConfig:{icon:e.name,color:t?.light,colors:t,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e){return e&&this.makeBlock(_e.BLOCK_AVATAR,e,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e){return e&&this.makeBlock(_e.BLOCK_FULLSNOO,e,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}async makeAnimation(e){return e&&this.makeBlock(_e.BLOCK_ANIMATION,e,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:e.url,loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e){return e&&this.makeBlock(_e.BLOCK_WEBVIEW,e,{webviewConfig:{url:e.url}})}makeBlock(e,t,i){return{type:e,size:this.makeBlockSize(t),sizes:this.makeBlockSizes(t),config:i,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}async ensureRootBlock(e){let t=e;if(t.type===_e.BLOCK_ROOT)return t.config?.rootConfig&&m.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(m.customPostType?.height)),t;let i=await this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};function Wv(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Gv=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=Gv(i);return e+=`</${r.type}>`,e};function eT(r){return" ".repeat(r)}function tT(r){let e="",t=0,i=r.split(/>\s*</);for(let n=0;n<i.length;n++){let o=i[n];n===0&&(o=o.trim()),n===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=eT(t),n!==0&&(e+="<"),e+=o,n!==i.length-1&&(e+=`>
1
+ var vP=Object.create;var Tm=Object.defineProperty;var bP=Object.getOwnPropertyDescriptor;var PP=Object.getOwnPropertyNames;var kP=Object.getPrototypeOf,SP=Object.prototype.hasOwnProperty;var b=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var wP=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of PP(e))!SP.call(r,n)&&n!==t&&Tm(r,n,{get:()=>e[n],enumerable:!(i=bP(e,n))||i.enumerable});return r};var An=(r,e,t)=>(t=r!=null?vP(kP(r)):{},wP(e||!r||!r.__esModule?Tm(t,"default",{value:r,enumerable:!0}):t,r));var fl=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)};var s=(r,e,t)=>(fl(r,e,"read from private field"),t?t.call(r):e.get(r)),l=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},d=(r,e,t,i)=>(fl(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);var k=(r,e,t)=>(fl(r,e,"access private method"),t);var ae=b((yB,Rm)=>{Rm.exports=function(r){try{return!!r()}catch{return!0}}});var ua=b((vB,Fm)=>{var IP=ae();Fm.exports=!IP(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")})});var J=b((bB,Um)=>{var Bm=ua(),Om=Function.prototype,gl=Om.call,xP=Bm&&Om.bind.bind(gl,gl);Um.exports=Bm?xP:function(r){return function(){return gl.apply(r,arguments)}}});var Lm=b((PB,Mm)=>{var CP=Math.ceil,AP=Math.floor;Mm.exports=Math.trunc||function(e){var t=+e;return(t>0?AP:CP)(t)}});var ca=b((kB,Dm)=>{var EP=Lm();Dm.exports=function(r){var e=+r;return e!==e||e===0?0:EP(e)}});var pe=b((SB,_m)=>{var ma=function(r){return r&&r.Math==Math&&r};_m.exports=ma(typeof globalThis=="object"&&globalThis)||ma(typeof window=="object"&&window)||ma(typeof self=="object"&&self)||ma(typeof global=="object"&&global)||function(){return this}()||Function("return this")()});var Tr=b((wB,Nm)=>{Nm.exports=!1});var pa=b((IB,Hm)=>{var qm=pe(),TP=Object.defineProperty;Hm.exports=function(r,e){try{TP(qm,r,{value:e,configurable:!0,writable:!0})}catch{qm[r]=e}return e}});var fa=b((xB,Wm)=>{var RP=pe(),FP=pa(),jm="__core-js_shared__",BP=RP[jm]||FP(jm,{});Wm.exports=BP});var hl=b((CB,Vm)=>{var OP=Tr(),Gm=fa();(Vm.exports=function(r,e){return Gm[r]||(Gm[r]=e!==void 0?e:{})})("versions",[]).push({version:"3.27.2",mode:OP?"pure":"global",copyright:"\xA9 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"})});var ga=b((AB,zm)=>{zm.exports=function(r){return r==null}});var ha=b((EB,$m)=>{var UP=ga(),MP=TypeError;$m.exports=function(r){if(UP(r))throw MP("Can't call method on "+r);return r}});var En=b((TB,Jm)=>{var LP=ha(),DP=Object;Jm.exports=function(r){return DP(LP(r))}});var Ie=b((RB,Km)=>{var _P=J(),NP=En(),qP=_P({}.hasOwnProperty);Km.exports=Object.hasOwn||function(e,t){return qP(NP(e),t)}});var yl=b((FB,Xm)=>{var HP=J(),jP=0,WP=Math.random(),GP=HP(1 .toString);Xm.exports=function(r){return"Symbol("+(r===void 0?"":r)+")_"+GP(++jP+WP,36)}});var Ym=b((BB,Zm)=>{Zm.exports=typeof navigator<"u"&&String(navigator.userAgent)||""});var sp=b((OB,np)=>{var ip=pe(),vl=Ym(),Qm=ip.process,ep=ip.Deno,tp=Qm&&Qm.versions||ep&&ep.version,rp=tp&&tp.v8,He,ya;rp&&(He=rp.split("."),ya=He[0]>0&&He[0]<4?1:+(He[0]+He[1]));!ya&&vl&&(He=vl.match(/Edge\/(\d+)/),(!He||He[1]>=74)&&(He=vl.match(/Chrome\/(\d+)/),He&&(ya=+He[1])));np.exports=ya});var bl=b((UB,ap)=>{var op=sp(),VP=ae();ap.exports=!!Object.getOwnPropertySymbols&&!VP(function(){var r=Symbol();return!String(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&op&&op<41})});var Pl=b((MB,dp)=>{var zP=bl();dp.exports=zP&&!Symbol.sham&&typeof Symbol.iterator=="symbol"});var xe=b((LB,up)=>{var $P=pe(),JP=hl(),lp=Ie(),KP=yl(),XP=bl(),ZP=Pl(),Rr=$P.Symbol,kl=JP("wks"),YP=ZP?Rr.for||Rr:Rr&&Rr.withoutSetter||KP;up.exports=function(r){return lp(kl,r)||(kl[r]=XP&&lp(Rr,r)?Rr[r]:YP("Symbol."+r)),kl[r]}});var pp=b((DB,mp)=>{var QP=xe(),ek=QP("toStringTag"),cp={};cp[ek]="z";mp.exports=String(cp)==="[object z]"});var wl=b((_B,fp)=>{var Sl=typeof document=="object"&&document.all,tk=typeof Sl>"u"&&Sl!==void 0;fp.exports={all:Sl,IS_HTMLDDA:tk}});var K=b((NB,hp)=>{var gp=wl(),rk=gp.all;hp.exports=gp.IS_HTMLDDA?function(r){return typeof r=="function"||r===rk}:function(r){return typeof r=="function"}});var va=b((qB,vp)=>{var yp=J(),ik=yp({}.toString),nk=yp("".slice);vp.exports=function(r){return nk(ik(r),8,-1)}});var Tn=b((HB,bp)=>{var sk=pp(),ok=K(),ba=va(),ak=xe(),dk=ak("toStringTag"),lk=Object,uk=ba(function(){return arguments}())=="Arguments",ck=function(r,e){try{return r[e]}catch{}};bp.exports=sk?ba:function(r){var e,t,i;return r===void 0?"Undefined":r===null?"Null":typeof(t=ck(e=lk(r),dk))=="string"?t:uk?ba(e):(i=ba(e))=="Object"&&ok(e.callee)?"Arguments":i}});var Rn=b((jB,Pp)=>{var mk=Tn(),pk=String;Pp.exports=function(r){if(mk(r)==="Symbol")throw TypeError("Cannot convert a Symbol value to a string");return pk(r)}});var xl=b((WB,wp)=>{var Il=J(),fk=ca(),gk=Rn(),hk=ha(),yk=Il("".charAt),kp=Il("".charCodeAt),vk=Il("".slice),Sp=function(r){return function(e,t){var i=gk(hk(e)),n=fk(t),o=i.length,a,u;return n<0||n>=o?r?"":void 0:(a=kp(i,n),a<55296||a>56319||n+1===o||(u=kp(i,n+1))<56320||u>57343?r?yk(i,n):a:r?vk(i,n,n+2):(a-55296<<10)+(u-56320)+65536)}};wp.exports={codeAt:Sp(!1),charAt:Sp(!0)}});var Cp=b((GB,xp)=>{var bk=pe(),Pk=K(),Ip=bk.WeakMap;xp.exports=Pk(Ip)&&/native code/.test(String(Ip))});var vt=b((VB,Tp)=>{var Ap=K(),Ep=wl(),kk=Ep.all;Tp.exports=Ep.IS_HTMLDDA?function(r){return typeof r=="object"?r!==null:Ap(r)||r===kk}:function(r){return typeof r=="object"?r!==null:Ap(r)}});var fe=b((zB,Rp)=>{var Sk=ae();Rp.exports=!Sk(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!=7})});var Al=b(($B,Bp)=>{var wk=pe(),Fp=vt(),Cl=wk.document,Ik=Fp(Cl)&&Fp(Cl.createElement);Bp.exports=function(r){return Ik?Cl.createElement(r):{}}});var El=b((JB,Op)=>{var xk=fe(),Ck=ae(),Ak=Al();Op.exports=!xk&&!Ck(function(){return Object.defineProperty(Ak("div"),"a",{get:function(){return 7}}).a!=7})});var Tl=b((KB,Up)=>{var Ek=fe(),Tk=ae();Up.exports=Ek&&Tk(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!=42})});var Xe=b((XB,Mp)=>{var Rk=vt(),Fk=String,Bk=TypeError;Mp.exports=function(r){if(Rk(r))return r;throw Bk(Fk(r)+" is not an object")}});var je=b((ZB,Lp)=>{var Ok=ua(),Pa=Function.prototype.call;Lp.exports=Ok?Pa.bind(Pa):function(){return Pa.apply(Pa,arguments)}});var Fn=b((YB,Dp)=>{var Rl=pe(),Uk=K(),Mk=function(r){return Uk(r)?r:void 0};Dp.exports=function(r,e){return arguments.length<2?Mk(Rl[r]):Rl[r]&&Rl[r][e]}});var Fl=b((QB,_p)=>{var Lk=J();_p.exports=Lk({}.isPrototypeOf)});var Bl=b((eO,Np)=>{var Dk=Fn(),_k=K(),Nk=Fl(),qk=Pl(),Hk=Object;Np.exports=qk?function(r){return typeof r=="symbol"}:function(r){var e=Dk("Symbol");return _k(e)&&Nk(e.prototype,Hk(r))}});var Ol=b((tO,qp)=>{var jk=String;qp.exports=function(r){try{return jk(r)}catch{return"Object"}}});var ka=b((rO,Hp)=>{var Wk=K(),Gk=Ol(),Vk=TypeError;Hp.exports=function(r){if(Wk(r))return r;throw Vk(Gk(r)+" is not a function")}});var Sa=b((iO,jp)=>{var zk=ka(),$k=ga();jp.exports=function(r,e){var t=r[e];return $k(t)?void 0:zk(t)}});var Gp=b((nO,Wp)=>{var Ul=je(),Ml=K(),Ll=vt(),Jk=TypeError;Wp.exports=function(r,e){var t,i;if(e==="string"&&Ml(t=r.toString)&&!Ll(i=Ul(t,r))||Ml(t=r.valueOf)&&!Ll(i=Ul(t,r))||e!=="string"&&Ml(t=r.toString)&&!Ll(i=Ul(t,r)))return i;throw Jk("Can't convert object to primitive value")}});var Jp=b((sO,$p)=>{var Kk=je(),Vp=vt(),zp=Bl(),Xk=Sa(),Zk=Gp(),Yk=xe(),Qk=TypeError,eS=Yk("toPrimitive");$p.exports=function(r,e){if(!Vp(r)||zp(r))return r;var t=Xk(r,eS),i;if(t){if(e===void 0&&(e="default"),i=Kk(t,r,e),!Vp(i)||zp(i))return i;throw Qk("Can't convert object to primitive value")}return e===void 0&&(e="number"),Zk(r,e)}});var wa=b((oO,Kp)=>{var tS=Jp(),rS=Bl();Kp.exports=function(r){var e=tS(r,"string");return rS(e)?e:e+""}});var Ze=b(Zp=>{var iS=fe(),nS=El(),sS=Tl(),Ia=Xe(),Xp=wa(),oS=TypeError,Dl=Object.defineProperty,aS=Object.getOwnPropertyDescriptor,_l="enumerable",Nl="configurable",ql="writable";Zp.f=iS?sS?function(e,t,i){if(Ia(e),t=Xp(t),Ia(i),typeof e=="function"&&t==="prototype"&&"value"in i&&ql in i&&!i[ql]){var n=aS(e,t);n&&n[ql]&&(e[t]=i.value,i={configurable:Nl in i?i[Nl]:n[Nl],enumerable:_l in i?i[_l]:n[_l],writable:!1})}return Dl(e,t,i)}:Dl:function(e,t,i){if(Ia(e),t=Xp(t),Ia(i),nS)try{return Dl(e,t,i)}catch{}if("get"in i||"set"in i)throw oS("Accessors not supported");return"value"in i&&(e[t]=i.value),e}});var Fr=b((dO,Yp)=>{Yp.exports=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}}});var xa=b((lO,Qp)=>{var dS=fe(),lS=Ze(),uS=Fr();Qp.exports=dS?function(r,e,t){return lS.f(r,e,uS(1,t))}:function(r,e,t){return r[e]=t,r}});var Ca=b((uO,tf)=>{var cS=hl(),mS=yl(),ef=cS("keys");tf.exports=function(r){return ef[r]||(ef[r]=mS(r))}});var Aa=b((cO,rf)=>{rf.exports={}});var Br=b((mO,of)=>{var pS=Cp(),sf=pe(),fS=vt(),gS=xa(),Hl=Ie(),jl=fa(),hS=Ca(),yS=Aa(),nf="Object already initialized",Wl=sf.TypeError,vS=sf.WeakMap,Ea,Bn,Ta,bS=function(r){return Ta(r)?Bn(r):Ea(r,{})},PS=function(r){return function(e){var t;if(!fS(e)||(t=Bn(e)).type!==r)throw Wl("Incompatible receiver, "+r+" required");return t}};pS||jl.state?(We=jl.state||(jl.state=new vS),We.get=We.get,We.has=We.has,We.set=We.set,Ea=function(r,e){if(We.has(r))throw Wl(nf);return e.facade=r,We.set(r,e),e},Bn=function(r){return We.get(r)||{}},Ta=function(r){return We.has(r)}):(Kt=hS("state"),yS[Kt]=!0,Ea=function(r,e){if(Hl(r,Kt))throw Wl(nf);return e.facade=r,gS(r,Kt,e),e},Bn=function(r){return Hl(r,Kt)?r[Kt]:{}},Ta=function(r){return Hl(r,Kt)});var We,Kt;of.exports={set:Ea,get:Bn,has:Ta,enforce:bS,getterFor:PS}});var Gl=b(lf=>{"use strict";var af={}.propertyIsEnumerable,df=Object.getOwnPropertyDescriptor,kS=df&&!af.call({1:2},1);lf.f=kS?function(e){var t=df(this,e);return!!t&&t.enumerable}:af});var zl=b((fO,uf)=>{var SS=J(),wS=ae(),IS=va(),Vl=Object,xS=SS("".split);uf.exports=wS(function(){return!Vl("z").propertyIsEnumerable(0)})?function(r){return IS(r)=="String"?xS(r,""):Vl(r)}:Vl});var Or=b((gO,cf)=>{var CS=zl(),AS=ha();cf.exports=function(r){return CS(AS(r))}});var $l=b(pf=>{var ES=fe(),TS=je(),RS=Gl(),FS=Fr(),BS=Or(),OS=wa(),US=Ie(),MS=El(),mf=Object.getOwnPropertyDescriptor;pf.f=ES?mf:function(e,t){if(e=BS(e),t=OS(t),MS)try{return mf(e,t)}catch{}if(US(e,t))return FS(!TS(RS.f,e,t),e[t])}});var Xl=b((yO,gf)=>{var Jl=fe(),LS=Ie(),ff=Function.prototype,DS=Jl&&Object.getOwnPropertyDescriptor,Kl=LS(ff,"name"),_S=Kl&&function(){}.name==="something",NS=Kl&&(!Jl||Jl&&DS(ff,"name").configurable);gf.exports={EXISTS:Kl,PROPER:_S,CONFIGURABLE:NS}});var Yl=b((vO,hf)=>{var qS=J(),HS=K(),Zl=fa(),jS=qS(Function.toString);HS(Zl.inspectSource)||(Zl.inspectSource=function(r){return jS(r)});hf.exports=Zl.inspectSource});var tu=b((bO,bf)=>{var eu=J(),WS=ae(),GS=K(),Ra=Ie(),Ql=fe(),VS=Xl().CONFIGURABLE,zS=Yl(),vf=Br(),$S=vf.enforce,JS=vf.get,yf=String,Fa=Object.defineProperty,KS=eu("".slice),XS=eu("".replace),ZS=eu([].join),YS=Ql&&!WS(function(){return Fa(function(){},"length",{value:8}).length!==8}),QS=String(String).split("String"),ew=bf.exports=function(r,e,t){KS(yf(e),0,7)==="Symbol("&&(e="["+XS(yf(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!Ra(r,"name")||VS&&r.name!==e)&&(Ql?Fa(r,"name",{value:e,configurable:!0}):r.name=e),YS&&t&&Ra(t,"arity")&&r.length!==t.arity&&Fa(r,"length",{value:t.arity});try{t&&Ra(t,"constructor")&&t.constructor?Ql&&Fa(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var i=$S(r);return Ra(i,"source")||(i.source=ZS(QS,typeof e=="string"?e:"")),r};Function.prototype.toString=ew(function(){return GS(this)&&JS(this).source||zS(this)},"toString")});var Xt=b((PO,Pf)=>{var tw=K(),rw=Ze(),iw=tu(),nw=pa();Pf.exports=function(r,e,t,i){i||(i={});var n=i.enumerable,o=i.name!==void 0?i.name:e;if(tw(t)&&iw(t,o,i),i.global)n?r[e]=t:nw(e,t);else{try{i.unsafe?r[e]&&(n=!0):delete r[e]}catch{}n?r[e]=t:rw.f(r,e,{value:t,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return r}});var ru=b((kO,kf)=>{var sw=ca(),ow=Math.max,aw=Math.min;kf.exports=function(r,e){var t=sw(r);return t<0?ow(t+e,0):aw(t,e)}});var wf=b((SO,Sf)=>{var dw=ca(),lw=Math.min;Sf.exports=function(r){return r>0?lw(dw(r),9007199254740991):0}});var Ba=b((wO,If)=>{var uw=wf();If.exports=function(r){return uw(r.length)}});var Af=b((IO,Cf)=>{var cw=Or(),mw=ru(),pw=Ba(),xf=function(r){return function(e,t,i){var n=cw(e),o=pw(n),a=mw(i,o),u;if(r&&t!=t){for(;o>a;)if(u=n[a++],u!=u)return!0}else for(;o>a;a++)if((r||a in n)&&n[a]===t)return r||a||0;return!r&&-1}};Cf.exports={includes:xf(!0),indexOf:xf(!1)}});var nu=b((xO,Tf)=>{var fw=J(),iu=Ie(),gw=Or(),hw=Af().indexOf,yw=Aa(),Ef=fw([].push);Tf.exports=function(r,e){var t=gw(r),i=0,n=[],o;for(o in t)!iu(yw,o)&&iu(t,o)&&Ef(n,o);for(;e.length>i;)iu(t,o=e[i++])&&(~hw(n,o)||Ef(n,o));return n}});var Oa=b((CO,Rf)=>{Rf.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]});var Bf=b(Ff=>{var vw=nu(),bw=Oa(),Pw=bw.concat("length","prototype");Ff.f=Object.getOwnPropertyNames||function(e){return vw(e,Pw)}});var su=b(Of=>{Of.f=Object.getOwnPropertySymbols});var Mf=b((TO,Uf)=>{var kw=Fn(),Sw=J(),ww=Bf(),Iw=su(),xw=Xe(),Cw=Sw([].concat);Uf.exports=kw("Reflect","ownKeys")||function(e){var t=ww.f(xw(e)),i=Iw.f;return i?Cw(t,i(e)):t}});var _f=b((RO,Df)=>{var Lf=Ie(),Aw=Mf(),Ew=$l(),Tw=Ze();Df.exports=function(r,e,t){for(var i=Aw(e),n=Tw.f,o=Ew.f,a=0;a<i.length;a++){var u=i[a];!Lf(r,u)&&!(t&&Lf(t,u))&&n(r,u,o(e,u))}}});var qf=b((FO,Nf)=>{var Rw=ae(),Fw=K(),Bw=/#|\.prototype\./,On=function(r,e){var t=Uw[Ow(r)];return t==Lw?!0:t==Mw?!1:Fw(e)?Rw(e):!!e},Ow=On.normalize=function(r){return String(r).replace(Bw,".").toLowerCase()},Uw=On.data={},Mw=On.NATIVE="N",Lw=On.POLYFILL="P";Nf.exports=On});var Un=b((BO,Hf)=>{var ou=pe(),Dw=$l().f,_w=xa(),Nw=Xt(),qw=pa(),Hw=_f(),jw=qf();Hf.exports=function(r,e){var t=r.target,i=r.global,n=r.stat,o,a,u,p,f,g;if(i?a=ou:n?a=ou[t]||qw(t,{}):a=(ou[t]||{}).prototype,a)for(u in e){if(f=e[u],r.dontCallGetSet?(g=Dw(a,u),p=g&&g.value):p=a[u],o=jw(i?u:t+(n?".":"#")+u,r.forced),!o&&p!==void 0){if(typeof f==typeof p)continue;Hw(f,p)}(r.sham||p&&p.sham)&&_w(f,"sham",!0),Nw(a,u,f,r)}}});var au=b((OO,jf)=>{var Ww=nu(),Gw=Oa();jf.exports=Object.keys||function(e){return Ww(e,Gw)}});var Gf=b(Wf=>{var Vw=fe(),zw=Tl(),$w=Ze(),Jw=Xe(),Kw=Or(),Xw=au();Wf.f=Vw&&!zw?Object.defineProperties:function(e,t){Jw(e);for(var i=Kw(t),n=Xw(t),o=n.length,a=0,u;o>a;)$w.f(e,u=n[a++],i[u]);return e}});var zf=b((MO,Vf)=>{var Zw=Fn();Vf.exports=Zw("document","documentElement")});var Mn=b((LO,Qf)=>{var Yw=Xe(),Qw=Gf(),$f=Oa(),eI=Aa(),tI=zf(),rI=Al(),iI=Ca(),Jf=">",Kf="<",lu="prototype",uu="script",Zf=iI("IE_PROTO"),du=function(){},Yf=function(r){return Kf+uu+Jf+r+Kf+"/"+uu+Jf},Xf=function(r){r.write(Yf("")),r.close();var e=r.parentWindow.Object;return r=null,e},nI=function(){var r=rI("iframe"),e="java"+uu+":",t;return r.style.display="none",tI.appendChild(r),r.src=String(e),t=r.contentWindow.document,t.open(),t.write(Yf("document.F=Object")),t.close(),t.F},Ua,Ma=function(){try{Ua=new ActiveXObject("htmlfile")}catch{}Ma=typeof document<"u"?document.domain&&Ua?Xf(Ua):nI():Xf(Ua);for(var r=$f.length;r--;)delete Ma[lu][$f[r]];return Ma()};eI[Zf]=!0;Qf.exports=Object.create||function(e,t){var i;return e!==null?(du[lu]=Yw(e),i=new du,du[lu]=null,i[Zf]=e):i=Ma(),t===void 0?i:Qw.f(i,t)}});var tg=b((DO,eg)=>{var sI=ae();eg.exports=!sI(function(){function r(){}return r.prototype.constructor=null,Object.getPrototypeOf(new r)!==r.prototype})});var mu=b((_O,ig)=>{var oI=Ie(),aI=K(),dI=En(),lI=Ca(),uI=tg(),rg=lI("IE_PROTO"),cu=Object,cI=cu.prototype;ig.exports=uI?cu.getPrototypeOf:function(r){var e=dI(r);if(oI(e,rg))return e[rg];var t=e.constructor;return aI(t)&&e instanceof t?t.prototype:e instanceof cu?cI:null}});var hu=b((NO,og)=>{"use strict";var mI=ae(),pI=K(),fI=vt(),gI=Mn(),ng=mu(),hI=Xt(),yI=xe(),vI=Tr(),gu=yI("iterator"),sg=!1,nt,pu,fu;[].keys&&(fu=[].keys(),"next"in fu?(pu=ng(ng(fu)),pu!==Object.prototype&&(nt=pu)):sg=!0);var bI=!fI(nt)||mI(function(){var r={};return nt[gu].call(r)!==r});bI?nt={}:vI&&(nt=gI(nt));pI(nt[gu])||hI(nt,gu,function(){return this});og.exports={IteratorPrototype:nt,BUGGY_SAFARI_ITERATORS:sg}});var Ln=b((qO,dg)=>{var PI=Ze().f,kI=Ie(),SI=xe(),ag=SI("toStringTag");dg.exports=function(r,e,t){r&&!t&&(r=r.prototype),r&&!kI(r,ag)&&PI(r,ag,{configurable:!0,value:e})}});var Ur=b((HO,lg)=>{lg.exports={}});var yu=b((jO,ug)=>{"use strict";var wI=hu().IteratorPrototype,II=Mn(),xI=Fr(),CI=Ln(),AI=Ur(),EI=function(){return this};ug.exports=function(r,e,t,i){var n=e+" Iterator";return r.prototype=II(wI,{next:xI(+!i,t)}),CI(r,n,!1,!0),AI[n]=EI,r}});var mg=b((WO,cg)=>{var TI=K(),RI=String,FI=TypeError;cg.exports=function(r){if(typeof r=="object"||TI(r))return r;throw FI("Can't set "+RI(r)+" as a prototype")}});var fg=b((GO,pg)=>{var BI=J(),OI=Xe(),UI=mg();pg.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var r=!1,e={},t;try{t=BI(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(e,[]),r=e instanceof Array}catch{}return function(n,o){return OI(n),UI(o),r?t(n,o):n.__proto__=o,n}}():void 0)});var bu=b((VO,Ig)=>{"use strict";var MI=Un(),LI=je(),La=Tr(),Sg=Xl(),DI=K(),_I=yu(),gg=mu(),hg=fg(),NI=Ln(),qI=xa(),vu=Xt(),HI=xe(),yg=Ur(),wg=hu(),jI=Sg.PROPER,WI=Sg.CONFIGURABLE,vg=wg.IteratorPrototype,Da=wg.BUGGY_SAFARI_ITERATORS,Dn=HI("iterator"),bg="keys",_n="values",Pg="entries",kg=function(){return this};Ig.exports=function(r,e,t,i,n,o,a){_I(t,e,i);var u=function(D){if(D===n&&h)return h;if(!Da&&D in g)return g[D];switch(D){case bg:return function(){return new t(this,D)};case _n:return function(){return new t(this,D)};case Pg:return function(){return new t(this,D)}}return function(){return new t(this)}},p=e+" Iterator",f=!1,g=r.prototype,c=g[Dn]||g["@@iterator"]||n&&g[n],h=!Da&&c||u(n),P=e=="Array"&&g.entries||c,w,C,E;if(P&&(w=gg(P.call(new r)),w!==Object.prototype&&w.next&&(!La&&gg(w)!==vg&&(hg?hg(w,vg):DI(w[Dn])||vu(w,Dn,kg)),NI(w,p,!0,!0),La&&(yg[p]=kg))),jI&&n==_n&&c&&c.name!==_n&&(!La&&WI?qI(g,"name",_n):(f=!0,h=function(){return LI(c,this)})),n)if(C={values:u(_n),keys:o?h:u(bg),entries:u(Pg)},a)for(E in C)(Da||f||!(E in g))&&vu(g,E,C[E]);else MI({target:e,proto:!0,forced:Da||f},C);return(!La||a)&&g[Dn]!==h&&vu(g,Dn,h,{name:n}),yg[e]=h,C}});var Pu=b((zO,xg)=>{xg.exports=function(r,e){return{value:r,done:e}}});var Tg=b(()=>{"use strict";var GI=xl().charAt,VI=Rn(),Ag=Br(),zI=bu(),Cg=Pu(),Eg="String Iterator",$I=Ag.set,JI=Ag.getterFor(Eg);zI(String,"String",function(r){$I(this,{type:Eg,string:VI(r),index:0})},function(){var e=JI(this),t=e.string,i=e.index,n;return i>=t.length?Cg(void 0,!0):(n=GI(t,i),e.index+=n.length,Cg(n,!1))})});var ku=b((KO,Rg)=>{var KI=ae(),XI=xe(),ZI=Tr(),YI=XI("iterator");Rg.exports=!KI(function(){var r=new URL("b?a=1&b=2&c=3","http://a"),e=r.searchParams,t="";return r.pathname="c%20d",e.forEach(function(i,n){e.delete("b"),t+=n+i}),ZI&&!r.toJSON||!e.sort||r.href!=="http://a/c%20d?a=1&c=3"||e.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!e[YI]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://\u0442\u0435\u0441\u0442").host!=="xn--e1aybc"||new URL("http://a#\u0431").hash!=="#%D0%B1"||t!=="a1c3"||new URL("http://x",void 0).host!=="x"})});var Bg=b((XO,Fg)=>{var QI=va(),ex=J();Fg.exports=function(r){if(QI(r)==="Function")return ex(r)}});var _a=b((ZO,Ug)=>{var Og=Bg(),tx=ka(),rx=ua(),ix=Og(Og.bind);Ug.exports=function(r,e){return tx(r),e===void 0?r:rx?ix(r,e):function(){return r.apply(e,arguments)}}});var Dg=b((YO,Lg)=>{var Mg=tu(),nx=Ze();Lg.exports=function(r,e,t){return t.get&&Mg(t.get,e,{getter:!0}),t.set&&Mg(t.set,e,{setter:!0}),nx.f(r,e,t)}});var Su=b((QO,_g)=>{var sx=Fl(),ox=TypeError;_g.exports=function(r,e){if(sx(e,r))return r;throw ox("Incorrect invocation")}});var jg=b((eU,Hg)=>{"use strict";var Ng=fe(),ax=J(),dx=je(),lx=ae(),wu=au(),ux=su(),cx=Gl(),mx=En(),px=zl(),Mr=Object.assign,qg=Object.defineProperty,fx=ax([].concat);Hg.exports=!Mr||lx(function(){if(Ng&&Mr({b:1},Mr(qg({},"a",{enumerable:!0,get:function(){qg(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var r={},e={},t=Symbol(),i="abcdefghijklmnopqrst";return r[t]=7,i.split("").forEach(function(n){e[n]=n}),Mr({},r)[t]!=7||wu(Mr({},e)).join("")!=i})?function(e,t){for(var i=mx(e),n=arguments.length,o=1,a=ux.f,u=cx.f;n>o;)for(var p=px(arguments[o++]),f=a?fx(wu(p),a(p)):wu(p),g=f.length,c=0,h;g>c;)h=f[c++],(!Ng||dx(u,p,h))&&(i[h]=p[h]);return i}:Mr});var Vg=b((tU,Gg)=>{var gx=je(),Wg=Xe(),hx=Sa();Gg.exports=function(r,e,t){var i,n;Wg(r);try{if(i=hx(r,"return"),!i){if(e==="throw")throw t;return t}i=gx(i,r)}catch(o){n=!0,i=o}if(e==="throw")throw t;if(n)throw i;return Wg(i),t}});var $g=b((rU,zg)=>{var yx=Xe(),vx=Vg();zg.exports=function(r,e,t,i){try{return i?e(yx(t)[0],t[1]):e(t)}catch(n){vx(r,"throw",n)}}});var Kg=b((iU,Jg)=>{var bx=xe(),Px=Ur(),kx=bx("iterator"),Sx=Array.prototype;Jg.exports=function(r){return r!==void 0&&(Px.Array===r||Sx[kx]===r)}});var th=b((nU,eh)=>{var wx=J(),Ix=ae(),Xg=K(),xx=Tn(),Cx=Fn(),Ax=Yl(),Zg=function(){},Ex=[],Yg=Cx("Reflect","construct"),Iu=/^\s*(?:class|function)\b/,Tx=wx(Iu.exec),Rx=!Iu.exec(Zg),Nn=function(e){if(!Xg(e))return!1;try{return Yg(Zg,Ex,e),!0}catch{return!1}},Qg=function(e){if(!Xg(e))return!1;switch(xx(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Rx||!!Tx(Iu,Ax(e))}catch{return!0}};Qg.sham=!0;eh.exports=!Yg||Ix(function(){var r;return Nn(Nn.call)||!Nn(Object)||!Nn(function(){r=!0})||r})?Qg:Nn});var xu=b((sU,rh)=>{"use strict";var Fx=wa(),Bx=Ze(),Ox=Fr();rh.exports=function(r,e,t){var i=Fx(e);i in r?Bx.f(r,i,Ox(0,t)):r[i]=t}});var Na=b((oU,nh)=>{var Ux=Tn(),ih=Sa(),Mx=ga(),Lx=Ur(),Dx=xe(),_x=Dx("iterator");nh.exports=function(r){if(!Mx(r))return ih(r,_x)||ih(r,"@@iterator")||Lx[Ux(r)]}});var Cu=b((aU,sh)=>{var Nx=je(),qx=ka(),Hx=Xe(),jx=Ol(),Wx=Na(),Gx=TypeError;sh.exports=function(r,e){var t=arguments.length<2?Wx(r):e;if(qx(t))return Hx(Nx(t,r));throw Gx(jx(r)+" is not iterable")}});var lh=b((dU,dh)=>{"use strict";var Vx=_a(),zx=je(),$x=En(),Jx=$g(),Kx=Kg(),Xx=th(),Zx=Ba(),oh=xu(),Yx=Cu(),Qx=Na(),ah=Array;dh.exports=function(e){var t=$x(e),i=Xx(this),n=arguments.length,o=n>1?arguments[1]:void 0,a=o!==void 0;a&&(o=Vx(o,n>2?arguments[2]:void 0));var u=Qx(t),p=0,f,g,c,h,P,w;if(u&&!(this===ah&&Kx(u)))for(h=Yx(t,u),P=h.next,g=i?new this:[];!(c=zx(P,h)).done;p++)w=a?Jx(h,o,[c.value,p],!0):c.value,oh(g,p,w);else for(f=Zx(t),g=i?new this(f):ah(f);f>p;p++)w=a?o(t[p],p):t[p],oh(g,p,w);return g.length=p,g}});var Au=b((lU,ch)=>{var uh=ru(),eC=Ba(),tC=xu(),rC=Array,iC=Math.max;ch.exports=function(r,e,t){for(var i=eC(r),n=uh(e,i),o=uh(t===void 0?i:t,i),a=rC(iC(o-n,0)),u=0;n<o;n++,u++)tC(a,u,r[n]);return a.length=u,a}});var Ph=b((uU,bh)=>{var Zt=J(),Eu=2147483647,qn=36,hh=1,Fu=26,nC=38,sC=700,oC=72,aC=128,dC="-",lC=/[^\0-\u007E]/,yh=/[.\u3002\uFF0E\uFF61]/g,mh="Overflow: input needs wider integers to process",Tu=qn-hh,ph=RangeError,uC=Zt(yh.exec),Lr=Math.floor,Ru=String.fromCharCode,fh=Zt("".charCodeAt),vh=Zt([].join),bt=Zt([].push),cC=Zt("".replace),mC=Zt("".split),pC=Zt("".toLowerCase),fC=function(r){for(var e=[],t=0,i=r.length;t<i;){var n=fh(r,t++);if(n>=55296&&n<=56319&&t<i){var o=fh(r,t++);(o&64512)==56320?bt(e,((n&1023)<<10)+(o&1023)+65536):(bt(e,n),t--)}else bt(e,n)}return e},gh=function(r){return r+22+75*(r<26)},gC=function(r,e,t){var i=0;for(r=t?Lr(r/sC):r>>1,r+=Lr(r/e);r>Tu*Fu>>1;)r=Lr(r/Tu),i+=qn;return Lr(i+(Tu+1)*r/(r+nC))},hC=function(r){var e=[];r=fC(r);var t=r.length,i=aC,n=0,o=oC,a,u;for(a=0;a<r.length;a++)u=r[a],u<128&&bt(e,Ru(u));var p=e.length,f=p;for(p&&bt(e,dC);f<t;){var g=Eu;for(a=0;a<r.length;a++)u=r[a],u>=i&&u<g&&(g=u);var c=f+1;if(g-i>Lr((Eu-n)/c))throw ph(mh);for(n+=(g-i)*c,i=g,a=0;a<r.length;a++){if(u=r[a],u<i&&++n>Eu)throw ph(mh);if(u==i){for(var h=n,P=qn;;){var w=P<=o?hh:P>=o+Fu?Fu:P-o;if(h<w)break;var C=h-w,E=qn-w;bt(e,Ru(gh(w+C%E))),h=Lr(C/E),P+=qn}bt(e,Ru(gh(h))),o=gC(n,c,f==p),n=0,f++}}n++,i++}return vh(e,"")};bh.exports=function(r){var e=[],t=mC(cC(pC(r),yh,"."),"."),i,n;for(i=0;i<t.length;i++)n=t[i],bt(e,uC(lC,n)?"xn--"+hC(n):n);return vh(e,".")}});var Bu=b((cU,kh)=>{var yC=TypeError;kh.exports=function(r,e){if(r<e)throw yC("Not enough arguments");return r}});var wh=b((mU,Sh)=>{var vC=xe(),bC=Mn(),PC=Ze().f,Ou=vC("unscopables"),Uu=Array.prototype;Uu[Ou]==null&&PC(Uu,Ou,{configurable:!0,value:bC(null)});Sh.exports=function(r){Uu[Ou][r]=!0}});var Th=b((pU,Eh)=>{"use strict";var kC=Or(),Mu=wh(),Ih=Ur(),Ch=Br(),SC=Ze().f,wC=bu(),qa=Pu(),IC=Tr(),xC=fe(),Ah="Array Iterator",CC=Ch.set,AC=Ch.getterFor(Ah);Eh.exports=wC(Array,"Array",function(r,e){CC(this,{type:Ah,target:kC(r),index:0,kind:e})},function(){var r=AC(this),e=r.target,t=r.kind,i=r.index++;return!e||i>=e.length?(r.target=void 0,qa(void 0,!0)):t=="keys"?qa(i,!1):t=="values"?qa(e[i],!1):qa([i,e[i]],!1)},"values");var xh=Ih.Arguments=Ih.Array;Mu("keys");Mu("values");Mu("entries");if(!IC&&xC&&xh.name!=="values")try{SC(xh,"name",{value:"values"})}catch{}});var Fh=b((fU,Rh)=>{var EC=Xt();Rh.exports=function(r,e,t){for(var i in e)EC(r,i,e[i],t);return r}});var Uh=b((gU,Oh)=>{var Bh=Au(),TC=Math.floor,Lu=function(r,e){var t=r.length,i=TC(t/2);return t<8?RC(r,e):FC(r,Lu(Bh(r,0,i),e),Lu(Bh(r,i),e),e)},RC=function(r,e){for(var t=r.length,i=1,n,o;i<t;){for(o=i,n=r[i];o&&e(r[o-1],n)>0;)r[o]=r[--o];o!==i++&&(r[o]=n)}return r},FC=function(r,e,t,i){for(var n=e.length,o=t.length,a=0,u=0;a<n||u<o;)r[a+u]=a<n&&u<o?i(e[a],t[u])<=0?e[a++]:t[u++]:a<n?e[a++]:t[u++];return r};Oh.exports=Lu});var zu=b((hU,ey)=>{"use strict";Th();var Hu=Un(),_r=pe(),Ha=je(),Ye=J(),BC=fe(),zh=ku(),$h=Xt(),OC=Fh(),UC=Ln(),MC=yu(),Gu=Br(),Jh=Su(),Du=K(),LC=Ie(),DC=_a(),_C=Tn(),NC=Xe(),Kh=vt(),ge=Rn(),qC=Mn(),Mh=Fr(),ju=Cu(),HC=Na(),Dr=Bu(),jC=xe(),WC=Uh(),GC=jC("iterator"),Wn="URLSearchParams",Xh=Wn+"Iterator",Zh=Gu.set,Ge=Gu.getterFor(Wn),VC=Gu.getterFor(Xh),zC=Object.getOwnPropertyDescriptor,Vu=function(r){if(!BC)return _r[r];var e=zC(_r,r);return e&&e.value},Lh=Vu("fetch"),Wa=Vu("Request"),Hn=Vu("Headers"),_u=Wa&&Wa.prototype,Dh=Hn&&Hn.prototype,$C=_r.RegExp,JC=_r.TypeError,Yh=_r.decodeURIComponent,KC=_r.encodeURIComponent,XC=Ye("".charAt),_h=Ye([].join),Yt=Ye([].push),Wu=Ye("".replace),ZC=Ye([].shift),Nh=Ye([].splice),qh=Ye("".split),YC=Ye("".slice),QC=/\+/g,Hh=Array(4),eA=function(r){return Hh[r-1]||(Hh[r-1]=$C("((?:%[\\da-f]{2}){"+r+"})","gi"))},tA=function(r){try{return Yh(r)}catch{return r}},jh=function(r){var e=Wu(r,QC," "),t=4;try{return Yh(e)}catch{for(;t;)e=Wu(e,eA(t--),tA);return e}},rA=/[!'()~]|%20/g,iA={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},nA=function(r){return iA[r]},Wh=function(r){return Wu(KC(r),rA,nA)},Nu=MC(function(e,t){Zh(this,{type:Xh,iterator:ju(Ge(e).entries),kind:t})},"Iterator",function(){var e=VC(this),t=e.kind,i=e.iterator.next(),n=i.value;return i.done||(i.value=t==="keys"?n.key:t==="values"?n.value:[n.key,n.value]),i},!0),Qh=function(r){this.entries=[],this.url=null,r!==void 0&&(Kh(r)?this.parseObject(r):this.parseQuery(typeof r=="string"?XC(r,0)==="?"?YC(r,1):r:ge(r)))};Qh.prototype={type:Wn,bindURL:function(r){this.url=r,this.update()},parseObject:function(r){var e=HC(r),t,i,n,o,a,u,p;if(e)for(t=ju(r,e),i=t.next;!(n=Ha(i,t)).done;){if(o=ju(NC(n.value)),a=o.next,(u=Ha(a,o)).done||(p=Ha(a,o)).done||!Ha(a,o).done)throw JC("Expected sequence with length 2");Yt(this.entries,{key:ge(u.value),value:ge(p.value)})}else for(var f in r)LC(r,f)&&Yt(this.entries,{key:f,value:ge(r[f])})},parseQuery:function(r){if(r)for(var e=qh(r,"&"),t=0,i,n;t<e.length;)i=e[t++],i.length&&(n=qh(i,"="),Yt(this.entries,{key:jh(ZC(n)),value:jh(_h(n,"="))}))},serialize:function(){for(var r=this.entries,e=[],t=0,i;t<r.length;)i=r[t++],Yt(e,Wh(i.key)+"="+Wh(i.value));return _h(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ga=function(){Jh(this,jn);var e=arguments.length>0?arguments[0]:void 0;Zh(this,new Qh(e))},jn=Ga.prototype;OC(jn,{append:function(e,t){Dr(arguments.length,2);var i=Ge(this);Yt(i.entries,{key:ge(e),value:ge(t)}),i.updateURL()},delete:function(r){Dr(arguments.length,1);for(var e=Ge(this),t=e.entries,i=ge(r),n=0;n<t.length;)t[n].key===i?Nh(t,n,1):n++;e.updateURL()},get:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=0;n<t.length;n++)if(t[n].key===i)return t[n].value;return null},getAll:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=[],o=0;o<t.length;o++)t[o].key===i&&Yt(n,t[o].value);return n},has:function(e){Dr(arguments.length,1);for(var t=Ge(this).entries,i=ge(e),n=0;n<t.length;)if(t[n++].key===i)return!0;return!1},set:function(e,t){Dr(arguments.length,1);for(var i=Ge(this),n=i.entries,o=!1,a=ge(e),u=ge(t),p=0,f;p<n.length;p++)f=n[p],f.key===a&&(o?Nh(n,p--,1):(o=!0,f.value=u));o||Yt(n,{key:a,value:u}),i.updateURL()},sort:function(){var e=Ge(this);WC(e.entries,function(t,i){return t.key>i.key?1:-1}),e.updateURL()},forEach:function(e){for(var t=Ge(this).entries,i=DC(e,arguments.length>1?arguments[1]:void 0),n=0,o;n<t.length;)o=t[n++],i(o.value,o.key,this)},keys:function(){return new Nu(this,"keys")},values:function(){return new Nu(this,"values")},entries:function(){return new Nu(this,"entries")}},{enumerable:!0});$h(jn,GC,jn.entries,{name:"entries"});$h(jn,"toString",function(){return Ge(this).serialize()},{enumerable:!0});UC(Ga,Wn);Hu({global:!0,constructor:!0,forced:!zh},{URLSearchParams:Ga});!zh&&Du(Hn)&&(Gh=Ye(Dh.has),Vh=Ye(Dh.set),qu=function(r){if(Kh(r)){var e=r.body,t;if(_C(e)===Wn)return t=r.headers?new Hn(r.headers):new Hn,Gh(t,"content-type")||Vh(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),qC(r,{body:Mh(0,ge(e)),headers:Mh(0,t)})}return r},Du(Lh)&&Hu({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return Lh(e,arguments.length>1?qu(arguments[1]):{})}}),Du(Wa)&&(ja=function(e){return Jh(this,_u),new Wa(e,arguments.length>1?qu(arguments[1]):{})},_u.constructor=ja,ja.prototype=_u,Hu({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ja})));var Gh,Vh,qu,ja;ey.exports={URLSearchParams:Ga,getState:Ge}});var by=b(()=>{"use strict";Tg();var sA=Un(),dc=fe(),oA=ku(),lc=pe(),ty=_a(),Re=J(),Ka=Xt(),Ce=Dg(),aA=Su(),sc=Ie(),uc=jg(),Nr=lh(),Ve=Au(),dA=xl().codeAt,lA=Ph(),ot=Rn(),uA=Ln(),cA=Bu(),py=zu(),fy=Br(),mA=fy.set,Xa=fy.getterFor("URL"),pA=py.URLSearchParams,fA=py.getState,Gn=lc.URL,oc=lc.TypeError,Za=lc.parseInt,gA=Math.floor,ry=Math.pow,Te=Re("".charAt),ze=Re(/./.exec),zn=Re([].join),hA=Re(1 .toString),yA=Re([].pop),Hr=Re([].push),iy=Re("".replace),vA=Re([].shift),bA=Re("".split),Jn=Re("".slice),Ya=Re("".toLowerCase),PA=Re([].unshift),kA="Invalid authority",$u="Invalid scheme",Qt="Invalid host",ny="Invalid port",gy=/[a-z]/i,SA=/[\d+-.a-z]/i,ac=/\d/,wA=/^0x/i,IA=/^[0-7]+$/,xA=/^\d+$/,hy=/^[\da-f]+$/i,CA=/[\0\t\n\r #%/:<>?@[\\\]^|]/,AA=/[\0\t\n\r #/:<>?@[\\\]^|]/,EA=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,TA=/[\t\n\r]/g,Ae,RA=function(r){var e=bA(r,"."),t,i,n,o,a,u,p;if(e.length&&e[e.length-1]==""&&e.length--,t=e.length,t>4)return r;for(i=[],n=0;n<t;n++){if(o=e[n],o=="")return r;if(a=10,o.length>1&&Te(o,0)=="0"&&(a=ze(wA,o)?16:8,o=Jn(o,a==8?1:2)),o==="")u=0;else{if(!ze(a==10?xA:a==8?IA:hy,o))return r;u=Za(o,a)}Hr(i,u)}for(n=0;n<t;n++)if(u=i[n],n==t-1){if(u>=ry(256,5-t))return null}else if(u>255)return null;for(p=yA(i),n=0;n<i.length;n++)p+=i[n]*ry(256,3-n);return p},FA=function(r){var e=[0,0,0,0,0,0,0,0],t=0,i=null,n=0,o,a,u,p,f,g,c,h=function(){return Te(r,n)};if(h()==":"){if(Te(r,1)!=":")return;n+=2,t++,i=t}for(;h();){if(t==8)return;if(h()==":"){if(i!==null)return;n++,t++,i=t;continue}for(o=a=0;a<4&&ze(hy,h());)o=o*16+Za(h(),16),n++,a++;if(h()=="."){if(a==0||(n-=a,t>6))return;for(u=0;h();){if(p=null,u>0)if(h()=="."&&u<4)n++;else return;if(!ze(ac,h()))return;for(;ze(ac,h());){if(f=Za(h(),10),p===null)p=f;else{if(p==0)return;p=p*10+f}if(p>255)return;n++}e[t]=e[t]*256+p,u++,(u==2||u==4)&&t++}if(u!=4)return;break}else if(h()==":"){if(n++,!h())return}else if(h())return;e[t++]=o}if(i!==null)for(g=t-i,t=7;t!=0&&g>0;)c=e[t],e[t--]=e[i+g-1],e[i+--g]=c;else if(t!=8)return;return e},BA=function(r){for(var e=null,t=1,i=null,n=0,o=0;o<8;o++)r[o]!==0?(n>t&&(e=i,t=n),i=null,n=0):(i===null&&(i=o),++n);return n>t&&(e=i,t=n),e},Vn=function(r){var e,t,i,n;if(typeof r=="number"){for(e=[],t=0;t<4;t++)PA(e,r%256),r=gA(r/256);return zn(e,".")}else if(typeof r=="object"){for(e="",i=BA(r),t=0;t<8;t++)n&&r[t]===0||(n&&(n=!1),i===t?(e+=t?":":"::",n=!0):(e+=hA(r[t],16),t<7&&(e+=":")));return"["+e+"]"}return r},Ja={},yy=uc({},Ja,{" ":1,'"':1,"<":1,">":1,"`":1}),vy=uc({},yy,{"#":1,"?":1,"{":1,"}":1}),Ju=uc({},vy,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Pt=function(r,e){var t=dA(r,0);return t>32&&t<127&&!sc(e,r)?r:encodeURIComponent(r)},Va={ftp:21,file:null,http:80,https:443,ws:80,wss:443},$n=function(r,e){var t;return r.length==2&&ze(gy,Te(r,0))&&((t=Te(r,1))==":"||!e&&t=="|")},sy=function(r){var e;return r.length>1&&$n(Jn(r,0,2))&&(r.length==2||(e=Te(r,2))==="/"||e==="\\"||e==="?"||e==="#")},OA=function(r){return r==="."||Ya(r)==="%2e"},UA=function(r){return r=Ya(r),r===".."||r==="%2e."||r===".%2e"||r==="%2e%2e"},Ku={},oy={},Xu={},ay={},dy={},Zu={},ly={},uy={},za={},$a={},Yu={},Qu={},ec={},tc={},cy={},rc={},qr={},Qe={},my={},er={},st={},cc=function(r,e,t){var i=ot(r),n,o,a;if(e){if(o=this.parse(i),o)throw oc(o);this.searchParams=null}else{if(t!==void 0&&(n=new cc(t,!0)),o=this.parse(i,null,n),o)throw oc(o);a=fA(new pA),a.bindURL(this),this.searchParams=a}};cc.prototype={type:"URL",parse:function(r,e,t){var i=this,n=e||Ku,o=0,a="",u=!1,p=!1,f=!1,g,c,h,P;for(r=ot(r),e||(i.scheme="",i.username="",i.password="",i.host=null,i.port=null,i.path=[],i.query=null,i.fragment=null,i.cannotBeABaseURL=!1,r=iy(r,EA,"")),r=iy(r,TA,""),g=Nr(r);o<=g.length;){switch(c=g[o],n){case Ku:if(c&&ze(gy,c))a+=Ya(c),n=oy;else{if(e)return $u;n=Xu;continue}break;case oy:if(c&&(ze(SA,c)||c=="+"||c=="-"||c=="."))a+=Ya(c);else if(c==":"){if(e&&(i.isSpecial()!=sc(Va,a)||a=="file"&&(i.includesCredentials()||i.port!==null)||i.scheme=="file"&&!i.host))return;if(i.scheme=a,e){i.isSpecial()&&Va[i.scheme]==i.port&&(i.port=null);return}a="",i.scheme=="file"?n=tc:i.isSpecial()&&t&&t.scheme==i.scheme?n=ay:i.isSpecial()?n=uy:g[o+1]=="/"?(n=dy,o++):(i.cannotBeABaseURL=!0,Hr(i.path,""),n=my)}else{if(e)return $u;a="",n=Xu,o=0;continue}break;case Xu:if(!t||t.cannotBeABaseURL&&c!="#")return $u;if(t.cannotBeABaseURL&&c=="#"){i.scheme=t.scheme,i.path=Ve(t.path),i.query=t.query,i.fragment="",i.cannotBeABaseURL=!0,n=st;break}n=t.scheme=="file"?tc:Zu;continue;case ay:if(c=="/"&&g[o+1]=="/")n=za,o++;else{n=Zu;continue}break;case dy:if(c=="/"){n=$a;break}else{n=Qe;continue}case Zu:if(i.scheme=t.scheme,c==Ae)i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query;else if(c=="/"||c=="\\"&&i.isSpecial())n=ly;else if(c=="?")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query="",n=er;else if(c=="#")i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=st;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,i.path=Ve(t.path),i.path.length--,n=Qe;continue}break;case ly:if(i.isSpecial()&&(c=="/"||c=="\\"))n=za;else if(c=="/")n=$a;else{i.username=t.username,i.password=t.password,i.host=t.host,i.port=t.port,n=Qe;continue}break;case uy:if(n=za,c!="/"||Te(a,o+1)!="/")continue;o++;break;case za:if(c!="/"&&c!="\\"){n=$a;continue}break;case $a:if(c=="@"){u&&(a="%40"+a),u=!0,h=Nr(a);for(var w=0;w<h.length;w++){var C=h[w];if(C==":"&&!f){f=!0;continue}var E=Pt(C,Ju);f?i.password+=E:i.username+=E}a=""}else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()){if(u&&a=="")return kA;o-=Nr(a).length+1,a="",n=Yu}else a+=c;break;case Yu:case Qu:if(e&&i.scheme=="file"){n=rc;continue}else if(c==":"&&!p){if(a=="")return Qt;if(P=i.parseHost(a),P)return P;if(a="",n=ec,e==Qu)return}else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()){if(i.isSpecial()&&a=="")return Qt;if(e&&a==""&&(i.includesCredentials()||i.port!==null))return;if(P=i.parseHost(a),P)return P;if(a="",n=qr,e)return;continue}else c=="["?p=!0:c=="]"&&(p=!1),a+=c;break;case ec:if(ze(ac,c))a+=c;else if(c==Ae||c=="/"||c=="?"||c=="#"||c=="\\"&&i.isSpecial()||e){if(a!=""){var D=Za(a,10);if(D>65535)return ny;i.port=i.isSpecial()&&D===Va[i.scheme]?null:D,a=""}if(e)return;n=qr;continue}else return ny;break;case tc:if(i.scheme="file",c=="/"||c=="\\")n=cy;else if(t&&t.scheme=="file")if(c==Ae)i.host=t.host,i.path=Ve(t.path),i.query=t.query;else if(c=="?")i.host=t.host,i.path=Ve(t.path),i.query="",n=er;else if(c=="#")i.host=t.host,i.path=Ve(t.path),i.query=t.query,i.fragment="",n=st;else{sy(zn(Ve(g,o),""))||(i.host=t.host,i.path=Ve(t.path),i.shortenPath()),n=Qe;continue}else{n=Qe;continue}break;case cy:if(c=="/"||c=="\\"){n=rc;break}t&&t.scheme=="file"&&!sy(zn(Ve(g,o),""))&&($n(t.path[0],!0)?Hr(i.path,t.path[0]):i.host=t.host),n=Qe;continue;case rc:if(c==Ae||c=="/"||c=="\\"||c=="?"||c=="#"){if(!e&&$n(a))n=Qe;else if(a==""){if(i.host="",e)return;n=qr}else{if(P=i.parseHost(a),P)return P;if(i.host=="localhost"&&(i.host=""),e)return;a="",n=qr}continue}else a+=c;break;case qr:if(i.isSpecial()){if(n=Qe,c!="/"&&c!="\\")continue}else if(!e&&c=="?")i.query="",n=er;else if(!e&&c=="#")i.fragment="",n=st;else if(c!=Ae&&(n=Qe,c!="/"))continue;break;case Qe:if(c==Ae||c=="/"||c=="\\"&&i.isSpecial()||!e&&(c=="?"||c=="#")){if(UA(a)?(i.shortenPath(),c!="/"&&!(c=="\\"&&i.isSpecial())&&Hr(i.path,"")):OA(a)?c!="/"&&!(c=="\\"&&i.isSpecial())&&Hr(i.path,""):(i.scheme=="file"&&!i.path.length&&$n(a)&&(i.host&&(i.host=""),a=Te(a,0)+":"),Hr(i.path,a)),a="",i.scheme=="file"&&(c==Ae||c=="?"||c=="#"))for(;i.path.length>1&&i.path[0]==="";)vA(i.path);c=="?"?(i.query="",n=er):c=="#"&&(i.fragment="",n=st)}else a+=Pt(c,vy);break;case my:c=="?"?(i.query="",n=er):c=="#"?(i.fragment="",n=st):c!=Ae&&(i.path[0]+=Pt(c,Ja));break;case er:!e&&c=="#"?(i.fragment="",n=st):c!=Ae&&(c=="'"&&i.isSpecial()?i.query+="%27":c=="#"?i.query+="%23":i.query+=Pt(c,Ja));break;case st:c!=Ae&&(i.fragment+=Pt(c,yy));break}o++}},parseHost:function(r){var e,t,i;if(Te(r,0)=="["){if(Te(r,r.length-1)!="]"||(e=FA(Jn(r,1,-1)),!e))return Qt;this.host=e}else if(this.isSpecial()){if(r=lA(r),ze(CA,r)||(e=RA(r),e===null))return Qt;this.host=e}else{if(ze(AA,r))return Qt;for(e="",t=Nr(r),i=0;i<t.length;i++)e+=Pt(t[i],Ja);this.host=e}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme=="file"},includesCredentials:function(){return this.username!=""||this.password!=""},isSpecial:function(){return sc(Va,this.scheme)},shortenPath:function(){var r=this.path,e=r.length;e&&(this.scheme!="file"||e!=1||!$n(r[0],!0))&&r.length--},serialize:function(){var r=this,e=r.scheme,t=r.username,i=r.password,n=r.host,o=r.port,a=r.path,u=r.query,p=r.fragment,f=e+":";return n!==null?(f+="//",r.includesCredentials()&&(f+=t+(i?":"+i:"")+"@"),f+=Vn(n),o!==null&&(f+=":"+o)):e=="file"&&(f+="//"),f+=r.cannotBeABaseURL?a[0]:a.length?"/"+zn(a,"/"):"",u!==null&&(f+="?"+u),p!==null&&(f+="#"+p),f},setHref:function(r){var e=this.parse(r);if(e)throw oc(e);this.searchParams.update()},getOrigin:function(){var r=this.scheme,e=this.port;if(r=="blob")try{return new jr(r.path[0]).origin}catch{return"null"}return r=="file"||!this.isSpecial()?"null":r+"://"+Vn(this.host)+(e!==null?":"+e:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(r){this.parse(ot(r)+":",Ku)},getUsername:function(){return this.username},setUsername:function(r){var e=Nr(ot(r));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var t=0;t<e.length;t++)this.username+=Pt(e[t],Ju)}},getPassword:function(){return this.password},setPassword:function(r){var e=Nr(ot(r));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var t=0;t<e.length;t++)this.password+=Pt(e[t],Ju)}},getHost:function(){var r=this.host,e=this.port;return r===null?"":e===null?Vn(r):Vn(r)+":"+e},setHost:function(r){this.cannotBeABaseURL||this.parse(r,Yu)},getHostname:function(){var r=this.host;return r===null?"":Vn(r)},setHostname:function(r){this.cannotBeABaseURL||this.parse(r,Qu)},getPort:function(){var r=this.port;return r===null?"":ot(r)},setPort:function(r){this.cannotHaveUsernamePasswordPort()||(r=ot(r),r==""?this.port=null:this.parse(r,ec))},getPathname:function(){var r=this.path;return this.cannotBeABaseURL?r[0]:r.length?"/"+zn(r,"/"):""},setPathname:function(r){this.cannotBeABaseURL||(this.path=[],this.parse(r,qr))},getSearch:function(){var r=this.query;return r?"?"+r:""},setSearch:function(r){r=ot(r),r==""?this.query=null:(Te(r,0)=="?"&&(r=Jn(r,1)),this.query="",this.parse(r,er)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var r=this.fragment;return r?"#"+r:""},setHash:function(r){if(r=ot(r),r==""){this.fragment=null;return}Te(r,0)=="#"&&(r=Jn(r,1)),this.fragment="",this.parse(r,st)},update:function(){this.query=this.searchParams.serialize()||null}};var jr=function(e){var t=aA(this,ee),i=cA(arguments.length,1)>1?arguments[1]:void 0,n=mA(t,new cc(e,!1,i));dc||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},ee=jr.prototype,Ee=function(r,e){return{get:function(){return Xa(this)[r]()},set:e&&function(t){return Xa(this)[e](t)},configurable:!0,enumerable:!0}};dc&&(Ce(ee,"href",Ee("serialize","setHref")),Ce(ee,"origin",Ee("getOrigin")),Ce(ee,"protocol",Ee("getProtocol","setProtocol")),Ce(ee,"username",Ee("getUsername","setUsername")),Ce(ee,"password",Ee("getPassword","setPassword")),Ce(ee,"host",Ee("getHost","setHost")),Ce(ee,"hostname",Ee("getHostname","setHostname")),Ce(ee,"port",Ee("getPort","setPort")),Ce(ee,"pathname",Ee("getPathname","setPathname")),Ce(ee,"search",Ee("getSearch","setSearch")),Ce(ee,"searchParams",Ee("getSearchParams")),Ce(ee,"hash",Ee("getHash","setHash")));Ka(ee,"toJSON",function(){return Xa(this).serialize()},{enumerable:!0});Ka(ee,"toString",function(){return Xa(this).serialize()},{enumerable:!0});Gn&&(ic=Gn.createObjectURL,nc=Gn.revokeObjectURL,ic&&Ka(jr,"createObjectURL",ty(ic,Gn)),nc&&Ka(jr,"revokeObjectURL",ty(nc,Gn)));var ic,nc;uA(jr,"URL");sA({global:!0,constructor:!0,forced:!oA,sham:!dc},{URL:jr})});var Py=b(()=>{by()});var ky=b(()=>{"use strict";var MA=Un(),LA=je();MA({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return LA(URL.prototype.toString,this)}})});var Sy=b(()=>{zu()});var Iy=b((xU,wy)=>{var DA=pe();wy.exports=DA});var Cy=b((CU,xy)=>{Py();ky();Sy();var _A=Iy();xy.exports=_A.URL});var hc=b(td=>{"use strict";td.byteLength=rE;td.toByteArray=nE;td.fromByteArray=aE;var et=[],Oe=[],tE=typeof Uint8Array<"u"?Uint8Array:Array,gc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(sr=0,Fy=gc.length;sr<Fy;++sr)et[sr]=gc[sr],Oe[gc.charCodeAt(sr)]=sr;var sr,Fy;Oe["-".charCodeAt(0)]=62;Oe["_".charCodeAt(0)]=63;function By(r){var e=r.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=r.indexOf("=");t===-1&&(t=e);var i=t===e?0:4-t%4;return[t,i]}function rE(r){var e=By(r),t=e[0],i=e[1];return(t+i)*3/4-i}function iE(r,e,t){return(e+t)*3/4-t}function nE(r){var e,t=By(r),i=t[0],n=t[1],o=new tE(iE(r,i,n)),a=0,u=n>0?i-4:i,p;for(p=0;p<u;p+=4)e=Oe[r.charCodeAt(p)]<<18|Oe[r.charCodeAt(p+1)]<<12|Oe[r.charCodeAt(p+2)]<<6|Oe[r.charCodeAt(p+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return n===2&&(e=Oe[r.charCodeAt(p)]<<2|Oe[r.charCodeAt(p+1)]>>4,o[a++]=e&255),n===1&&(e=Oe[r.charCodeAt(p)]<<10|Oe[r.charCodeAt(p+1)]<<4|Oe[r.charCodeAt(p+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function sE(r){return et[r>>18&63]+et[r>>12&63]+et[r>>6&63]+et[r&63]}function oE(r,e,t){for(var i,n=[],o=e;o<t;o+=3)i=(r[o]<<16&16711680)+(r[o+1]<<8&65280)+(r[o+2]&255),n.push(sE(i));return n.join("")}function aE(r){for(var e,t=r.length,i=t%3,n=[],o=16383,a=0,u=t-i;a<u;a+=o)n.push(oE(r,a,a+o>u?u:a+o));return i===1?(e=r[t-1],n.push(et[e>>2]+et[e<<4&63]+"==")):i===2&&(e=(r[t-2]<<8)+r[t-1],n.push(et[e>>10]+et[e>>4&63]+et[e<<2&63]+"=")),n.join("")}});var Oy=b(yc=>{yc.read=function(r,e,t,i,n){var o,a,u=n*8-i-1,p=(1<<u)-1,f=p>>1,g=-7,c=t?n-1:0,h=t?-1:1,P=r[e+c];for(c+=h,o=P&(1<<-g)-1,P>>=-g,g+=u;g>0;o=o*256+r[e+c],c+=h,g-=8);for(a=o&(1<<-g)-1,o>>=-g,g+=i;g>0;a=a*256+r[e+c],c+=h,g-=8);if(o===0)o=1-f;else{if(o===p)return a?NaN:(P?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-f}return(P?-1:1)*a*Math.pow(2,o-i)};yc.write=function(r,e,t,i,n,o){var a,u,p,f=o*8-n-1,g=(1<<f)-1,c=g>>1,h=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=i?0:o-1,w=i?1:-1,C=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,a=g):(a=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-a))<1&&(a--,p*=2),a+c>=1?e+=h/p:e+=h*Math.pow(2,1-c),e*p>=2&&(a++,p/=2),a+c>=g?(u=0,a=g):a+c>=1?(u=(e*p-1)*Math.pow(2,n),a=a+c):(u=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;r[t+P]=u&255,P+=w,u/=256,n-=8);for(a=a<<n|u,f+=n;f>0;r[t+P]=a&255,P+=w,a/=256,f-=8);r[t+P-w]|=C*128}});var Xy=b(Jr=>{"use strict";var vc=hc(),zr=Oy(),Uy=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Jr.Buffer=y;Jr.SlowBuffer=pE;Jr.INSPECT_MAX_BYTES=50;var rd=2147483647;Jr.kMaxLength=rd;y.TYPED_ARRAY_SUPPORT=dE();!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function dE(){try{let r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function dt(r){if(r>rd)throw new RangeError('The value "'+r+'" is invalid for option "size"');let e=new Uint8Array(r);return Object.setPrototypeOf(e,y.prototype),e}function y(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Sc(r)}return _y(r,e,t)}y.poolSize=8192;function _y(r,e,t){if(typeof r=="string")return uE(r,e);if(ArrayBuffer.isView(r))return cE(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(tt(r,ArrayBuffer)||r&&tt(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(r,SharedArrayBuffer)||r&&tt(r.buffer,SharedArrayBuffer)))return Pc(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return y.from(i,e,t);let n=mE(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return y.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}y.from=function(r,e,t){return _y(r,e,t)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function Ny(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function lE(r,e,t){return Ny(r),r<=0?dt(r):e!==void 0?typeof t=="string"?dt(r).fill(e,t):dt(r).fill(e):dt(r)}y.alloc=function(r,e,t){return lE(r,e,t)};function Sc(r){return Ny(r),dt(r<0?0:wc(r)|0)}y.allocUnsafe=function(r){return Sc(r)};y.allocUnsafeSlow=function(r){return Sc(r)};function uE(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let t=qy(r,e)|0,i=dt(t),n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}function bc(r){let e=r.length<0?0:wc(r.length)|0,t=dt(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function cE(r){if(tt(r,Uint8Array)){let e=new Uint8Array(r);return Pc(e.buffer,e.byteOffset,e.byteLength)}return bc(r)}function Pc(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,y.prototype),i}function mE(r){if(y.isBuffer(r)){let e=wc(r.length)|0,t=dt(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||xc(r.length)?dt(0):bc(r);if(r.type==="Buffer"&&Array.isArray(r.data))return bc(r.data)}function wc(r){if(r>=rd)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rd.toString(16)+" bytes");return r|0}function pE(r){return+r!=r&&(r=0),y.alloc(+r)}y.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype};y.compare=function(e,t){if(tt(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),tt(t,Uint8Array)&&(t=y.from(t,t.offset,t.byteLength)),!y.isBuffer(e)||!y.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let o=0,a=Math.min(i,n);o<a;++o)if(e[o]!==t[o]){i=e[o],n=t[o];break}return i<n?-1:n<i?1:0};y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};y.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;let n=y.allocUnsafe(t),o=0;for(i=0;i<e.length;++i){let a=e[i];if(tt(a,Uint8Array))o+a.length>n.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(n,o)):Uint8Array.prototype.set.call(n,a,o);else if(y.isBuffer(a))a.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return n};function qy(r,e){if(y.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||tt(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return kc(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ky(r).length;default:if(n)return i?-1:kc(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=qy;function fE(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return IE(this,e,t);case"utf8":case"utf-8":return jy(this,e,t);case"ascii":return SE(this,e,t);case"latin1":case"binary":return wE(this,e,t);case"base64":return PE(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xE(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}y.prototype._isBuffer=!0;function or(r,e,t){let i=r[e];r[e]=r[t],r[t]=i}y.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)or(this,t,t+1);return this};y.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)or(this,t,t+3),or(this,t+1,t+2);return this};y.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)or(this,t,t+7),or(this,t+1,t+6),or(this,t+2,t+5),or(this,t+3,t+4);return this};y.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?jy(this,0,e):fE.apply(this,arguments)};y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0};y.prototype.inspect=function(){let e="",t=Jr.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"};Uy&&(y.prototype[Uy]=y.prototype.inspect);y.prototype.compare=function(e,t,i,n,o){if(tt(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),t<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=i)return 0;if(n>=o)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let a=o-n,u=i-t,p=Math.min(a,u),f=this.slice(n,o),g=e.slice(t,i);for(let c=0;c<p;++c)if(f[c]!==g[c]){a=f[c],u=g[c];break}return a<u?-1:u<a?1:0};function Hy(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,xc(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=y.from(e,i)),y.isBuffer(e))return e.length===0?-1:My(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):My(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function My(r,e,t,i,n){let o=1,a=r.length,u=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;o=2,a/=2,u/=2,t/=2}function p(g,c){return o===1?g[c]:g.readUInt16BE(c*o)}let f;if(n){let g=-1;for(f=t;f<a;f++)if(p(r,f)===p(e,g===-1?0:f-g)){if(g===-1&&(g=f),f-g+1===u)return g*o}else g!==-1&&(f-=f-g),g=-1}else for(t+u>a&&(t=a-u),f=t;f>=0;f--){let g=!0;for(let c=0;c<u;c++)if(p(r,f+c)!==p(e,c)){g=!1;break}if(g)return f}return-1}y.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1};y.prototype.indexOf=function(e,t,i){return Hy(this,e,t,i,!0)};y.prototype.lastIndexOf=function(e,t,i){return Hy(this,e,t,i,!1)};function gE(r,e,t,i){t=Number(t)||0;let n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let a;for(a=0;a<i;++a){let u=parseInt(e.substr(a*2,2),16);if(xc(u))return a;r[t+a]=u}return a}function hE(r,e,t,i){return id(kc(e,r.length-t),r,t,i)}function yE(r,e,t,i){return id(TE(e),r,t,i)}function vE(r,e,t,i){return id(Ky(e),r,t,i)}function bE(r,e,t,i){return id(RE(e,r.length-t),r,t,i)}y.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-t;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let a=!1;for(;;)switch(n){case"hex":return gE(this,e,t,i);case"utf8":case"utf-8":return hE(this,e,t,i);case"ascii":case"latin1":case"binary":return yE(this,e,t,i);case"base64":return vE(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return bE(this,e,t,i);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}};y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function PE(r,e,t){return e===0&&t===r.length?vc.fromByteArray(r):vc.fromByteArray(r.slice(e,t))}function jy(r,e,t){t=Math.min(r.length,t);let i=[],n=e;for(;n<t;){let o=r[n],a=null,u=o>239?4:o>223?3:o>191?2:1;if(n+u<=t){let p,f,g,c;switch(u){case 1:o<128&&(a=o);break;case 2:p=r[n+1],(p&192)===128&&(c=(o&31)<<6|p&63,c>127&&(a=c));break;case 3:p=r[n+1],f=r[n+2],(p&192)===128&&(f&192)===128&&(c=(o&15)<<12|(p&63)<<6|f&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:p=r[n+1],f=r[n+2],g=r[n+3],(p&192)===128&&(f&192)===128&&(g&192)===128&&(c=(o&15)<<18|(p&63)<<12|(f&63)<<6|g&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|a&1023),i.push(a),n+=u}return kE(i)}var Ly=4096;function kE(r){let e=r.length;if(e<=Ly)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Ly));return t}function SE(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function wE(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function IE(r,e,t){let i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let o=e;o<t;++o)n+=FE[r[o]];return n}function xE(r,e,t){let i=r.slice(e,t),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}y.prototype.slice=function(e,t){let i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,y.prototype),n};function X(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return n};y.prototype.readUintBE=y.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n};y.prototype.readUint8=y.prototype.readUInt8=function(e,t){return e=e>>>0,t||X(e,1,this.length),this[e]};y.prototype.readUint16LE=y.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||X(e,2,this.length),this[e]|this[e+1]<<8};y.prototype.readUint16BE=y.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||X(e,2,this.length),this[e]<<8|this[e+1]};y.prototype.readUint32LE=y.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};y.prototype.readUint32BE=y.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};y.prototype.readBigUInt64LE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))});y.prototype.readBigUInt64BE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)});y.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=this[e],o=1,a=0;for(;++a<t&&(o*=256);)n+=this[e+a]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n};y.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||X(e,t,this.length);let n=t,o=1,a=this[e+--n];for(;n>0&&(o*=256);)a+=this[e+--n]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*t)),a};y.prototype.readInt8=function(e,t){return e=e>>>0,t||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};y.prototype.readInt16LE=function(e,t){e=e>>>0,t||X(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};y.prototype.readInt16BE=function(e,t){e=e>>>0,t||X(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};y.prototype.readInt32LE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};y.prototype.readInt32BE=function(e,t){return e=e>>>0,t||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};y.prototype.readBigInt64LE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});y.prototype.readBigInt64BE=wt(function(e){e=e>>>0,$r(e,"offset");let t=this[e],i=this[e+7];(t===void 0||i===void 0)&&Kn(e,this.length-8);let n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});y.prototype.readFloatLE=function(e,t){return e=e>>>0,t||X(e,4,this.length),zr.read(this,e,!0,23,4)};y.prototype.readFloatBE=function(e,t){return e=e>>>0,t||X(e,4,this.length),zr.read(this,e,!1,23,4)};y.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||X(e,8,this.length),zr.read(this,e,!0,52,8)};y.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||X(e,8,this.length),zr.read(this,e,!1,52,8)};function de(r,e,t,i,n,o){if(!y.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;de(this,e,t,i,u,0)}let o=1,a=0;for(this[t]=e&255;++a<i&&(o*=256);)this[t+a]=e/o&255;return t+i};y.prototype.writeUintBE=y.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){let u=Math.pow(2,8*i)-1;de(this,e,t,i,u,0)}let o=i-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+i};y.prototype.writeUint8=y.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,1,255,0),this[t]=e&255,t+1};y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2};y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2};y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4};y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function Wy(r,e,t,i,n){Jy(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o,o=o>>8,r[t++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,a=a>>8,r[t++]=a,t}function Gy(r,e,t,i,n){Jy(e,i,n,r,t,7);let o=Number(e&BigInt(4294967295));r[t+7]=o,o=o>>8,r[t+6]=o,o=o>>8,r[t+5]=o,o=o>>8,r[t+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=a,a=a>>8,r[t+2]=a,a=a>>8,r[t+1]=a,a=a>>8,r[t]=a,t+8}y.prototype.writeBigUInt64LE=wt(function(e,t=0){return Wy(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});y.prototype.writeBigUInt64BE=wt(function(e,t=0){return Gy(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))});y.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){let p=Math.pow(2,8*i-1);de(this,e,t,i,p-1,-p)}let o=0,a=1,u=0;for(this[t]=e&255;++o<i&&(a*=256);)e<0&&u===0&&this[t+o-1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+i};y.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){let p=Math.pow(2,8*i-1);de(this,e,t,i,p-1,-p)}let o=i-1,a=1,u=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+i};y.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1};y.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2};y.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2};y.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4};y.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||de(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};y.prototype.writeBigInt64LE=wt(function(e,t=0){return Wy(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});y.prototype.writeBigInt64BE=wt(function(e,t=0){return Gy(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Vy(r,e,t,i,n,o){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function zy(r,e,t,i,n){return e=+e,t=t>>>0,n||Vy(r,e,t,4,34028234663852886e22,-34028234663852886e22),zr.write(r,e,t,i,23,4),t+4}y.prototype.writeFloatLE=function(e,t,i){return zy(this,e,t,!0,i)};y.prototype.writeFloatBE=function(e,t,i){return zy(this,e,t,!1,i)};function $y(r,e,t,i,n){return e=+e,t=t>>>0,n||Vy(r,e,t,8,17976931348623157e292,-17976931348623157e292),zr.write(r,e,t,i,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,i){return $y(this,e,t,!0,i)};y.prototype.writeDoubleBE=function(e,t,i){return $y(this,e,t,!1,i)};y.prototype.copy=function(e,t,i,n){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),o};y.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let a=e.charCodeAt(0);(n==="utf8"&&a<128||n==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=t;o<i;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,n),u=a.length;if(u===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=a[o%u]}return this};var Vr={};function Ic(r,e,t){Vr[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Ic("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ic("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError);Ic("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=Dy(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=Dy(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Dy(r){let e="",t=r.length,i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function CE(r,e,t){$r(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&Kn(e,r.length-(t+1))}function Jy(r,e,t,i,n,o){if(r>t||r<e){let a=typeof e=="bigint"?"n":"",u;throw o>3?e===0||e===BigInt(0)?u=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:u=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:u=`>= ${e}${a} and <= ${t}${a}`,new Vr.ERR_OUT_OF_RANGE("value",u,r)}CE(i,n,o)}function $r(r,e){if(typeof r!="number")throw new Vr.ERR_INVALID_ARG_TYPE(e,"number",r)}function Kn(r,e,t){throw Math.floor(r)!==r?($r(r,t),new Vr.ERR_OUT_OF_RANGE(t||"offset","an integer",r)):e<0?new Vr.ERR_BUFFER_OUT_OF_BOUNDS:new Vr.ERR_OUT_OF_RANGE(t||"offset",`>= ${t?1:0} and <= ${e}`,r)}var AE=/[^+/0-9A-Za-z-_]/g;function EE(r){if(r=r.split("=")[0],r=r.trim().replace(AE,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function kc(r,e){e=e||1/0;let t,i=r.length,n=null,o=[];for(let a=0;a<i;++a){if(t=r.charCodeAt(a),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&o.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;o.push(t)}else if(t<2048){if((e-=2)<0)break;o.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;o.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;o.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return o}function TE(r){let e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function RE(r,e){let t,i,n,o=[];for(let a=0;a<r.length&&!((e-=2)<0);++a)t=r.charCodeAt(a),i=t>>8,n=t%256,o.push(n),o.push(i);return o}function Ky(r){return vc.toByteArray(EE(r))}function id(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function tt(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function xc(r){return r!==r}var FE=function(){let r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){let i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e}();function wt(r){return typeof BigInt>"u"?BE:r}function BE(){throw new Error("BigInt not supported")}});var Kc=b((u_,Qv)=>{var BT=Object.prototype.toString;Qv.exports=function(e){if(e===void 0)return"undefined";if(e===null)return"null";var t=typeof e;if(t==="boolean")return"boolean";if(t==="string")return"string";if(t==="number")return"number";if(t==="symbol")return"symbol";if(t==="function")return DT(e)?"generatorfunction":"function";if(OT(e))return"array";if(qT(e))return"buffer";if(NT(e))return"arguments";if(MT(e))return"date";if(UT(e))return"error";if(LT(e))return"regexp";switch(Yv(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(_T(e))return"generator";switch(t=BT.call(e),t){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function Yv(r){return typeof r.constructor=="function"?r.constructor.name:null}function OT(r){return Array.isArray?Array.isArray(r):r instanceof Array}function UT(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function MT(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function LT(r){return r instanceof RegExp?!0:typeof r.flags=="string"&&typeof r.ignoreCase=="boolean"&&typeof r.multiline=="boolean"&&typeof r.global=="boolean"}function DT(r,e){return Yv(r)==="GeneratorFunction"}function _T(r){return typeof r.throw=="function"&&typeof r.return=="function"&&typeof r.next=="function"}function NT(r){try{if(typeof r.length=="number"&&typeof r.callee=="function")return!0}catch(e){if(e.message.indexOf("callee")!==-1)return!0}return!1}function qT(r){return r.constructor&&typeof r.constructor.isBuffer=="function"?r.constructor.isBuffer(r):!1}});var rb=b((c_,tb)=>{"use strict";var eb=Symbol.prototype.valueOf,HT=Kc();function jT(r,e){switch(HT(r)){case"array":return r.slice();case"object":return Object.assign({},r);case"date":return new r.constructor(Number(r));case"map":return new Map(r);case"set":return new Set(r);case"buffer":return zT(r);case"symbol":return $T(r);case"arraybuffer":return GT(r);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return VT(r);case"regexp":return WT(r);case"error":return Object.create(r);default:return r}}function WT(r){let e=r.flags!==void 0?r.flags:/\w+$/.exec(r)||void 0,t=new r.constructor(r.source,e);return t.lastIndex=r.lastIndex,t}function GT(r){let e=new r.constructor(r.byteLength);return new Uint8Array(e).set(new Uint8Array(r)),e}function VT(r,e){return new r.constructor(r.buffer,r.byteOffset,r.length)}function zT(r){let e=r.length,t=Buffer.allocUnsafe?Buffer.allocUnsafe(e):Buffer.from(e);return r.copy(t),t}function $T(r){return eb?Object(eb.call(r)):{}}tb.exports=jT});var nb=b((m_,ib)=>{"use strict";ib.exports=function(e){return e!=null&&typeof e=="object"&&Array.isArray(e)===!1}});var ab=b((p_,ob)=>{"use strict";var JT=nb();function sb(r){return JT(r)===!0&&Object.prototype.toString.call(r)==="[object Object]"}ob.exports=function(e){var t,i;return!(sb(e)===!1||(t=e.constructor,typeof t!="function")||(i=t.prototype,sb(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)}});var lb=b((f_,db)=>{"use strict";var KT=rb(),XT=Kc(),ZT=ab();function Xc(r,e){switch(XT(r)){case"object":return YT(r,e);case"array":return QT(r,e);default:return KT(r)}}function YT(r,e){if(typeof e=="function")return e(r);if(e||ZT(r)){let t=new r.constructor;for(let i in r)t[i]=Xc(r[i],e);return t}return r}function QT(r,e){let t=new r.constructor(r.length);for(let i=0;i<r.length;i++)t[i]=Xc(r[i],e);return t}db.exports=Xc});var Gb=b((ls,hi)=>{var eR=200,am="__lodash_hash_undefined__",Fd=1,kb=2,Sb=9007199254740991,Id="[object Arguments]",em="[object Array]",tR="[object AsyncFunction]",wb="[object Boolean]",Ib="[object Date]",xb="[object Error]",Cb="[object Function]",rR="[object GeneratorFunction]",xd="[object Map]",Ab="[object Number]",iR="[object Null]",gi="[object Object]",ub="[object Promise]",nR="[object Proxy]",Eb="[object RegExp]",Cd="[object Set]",Tb="[object String]",sR="[object Symbol]",oR="[object Undefined]",tm="[object WeakMap]",Rb="[object ArrayBuffer]",Ad="[object DataView]",aR="[object Float32Array]",dR="[object Float64Array]",lR="[object Int8Array]",uR="[object Int16Array]",cR="[object Int32Array]",mR="[object Uint8Array]",pR="[object Uint8ClampedArray]",fR="[object Uint16Array]",gR="[object Uint32Array]",hR=/[\\^$.*+?()[\]{}|]/g,yR=/^\[object .+?Constructor\]$/,vR=/^(?:0|[1-9]\d*)$/,H={};H[aR]=H[dR]=H[lR]=H[uR]=H[cR]=H[mR]=H[pR]=H[fR]=H[gR]=!0;H[Id]=H[em]=H[Rb]=H[wb]=H[Ad]=H[Ib]=H[xb]=H[Cb]=H[xd]=H[Ab]=H[gi]=H[Eb]=H[Cd]=H[Tb]=H[tm]=!1;var Fb=typeof global=="object"&&global&&global.Object===Object&&global,bR=typeof self=="object"&&self&&self.Object===Object&&self,ct=Fb||bR||Function("return this")(),Bb=typeof ls=="object"&&ls&&!ls.nodeType&&ls,cb=Bb&&typeof hi=="object"&&hi&&!hi.nodeType&&hi,Ob=cb&&cb.exports===Bb,Zc=Ob&&Fb.process,mb=function(){try{return Zc&&Zc.binding&&Zc.binding("util")}catch{}}(),pb=mb&&mb.isTypedArray;function PR(r,e){for(var t=-1,i=r==null?0:r.length,n=0,o=[];++t<i;){var a=r[t];e(a,t,r)&&(o[n++]=a)}return o}function kR(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}function SR(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}function wR(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}function IR(r){return function(e){return r(e)}}function xR(r,e){return r.has(e)}function CR(r,e){return r?.[e]}function AR(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}function ER(r,e){return function(t){return r(e(t))}}function TR(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var RR=Array.prototype,FR=Function.prototype,Bd=Object.prototype,Yc=ct["__core-js_shared__"],Ub=FR.toString,rt=Bd.hasOwnProperty,fb=function(){var r=/[^.]+$/.exec(Yc&&Yc.keys&&Yc.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Mb=Bd.toString,BR=RegExp("^"+Ub.call(rt).replace(hR,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gb=Ob?ct.Buffer:void 0,Ed=ct.Symbol,hb=ct.Uint8Array,Lb=Bd.propertyIsEnumerable,OR=RR.splice,cr=Ed?Ed.toStringTag:void 0,yb=Object.getOwnPropertySymbols,UR=gb?gb.isBuffer:void 0,MR=ER(Object.keys,Object),rm=yi(ct,"DataView"),us=yi(ct,"Map"),im=yi(ct,"Promise"),nm=yi(ct,"Set"),sm=yi(ct,"WeakMap"),cs=yi(Object,"create"),LR=fr(rm),DR=fr(us),_R=fr(im),NR=fr(nm),qR=fr(sm),vb=Ed?Ed.prototype:void 0,Qc=vb?vb.valueOf:void 0;function mr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function HR(){this.__data__=cs?cs(null):{},this.size=0}function jR(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}function WR(r){var e=this.__data__;if(cs){var t=e[r];return t===am?void 0:t}return rt.call(e,r)?e[r]:void 0}function GR(r){var e=this.__data__;return cs?e[r]!==void 0:rt.call(e,r)}function VR(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=cs&&e===void 0?am:e,this}mr.prototype.clear=HR;mr.prototype.delete=jR;mr.prototype.get=WR;mr.prototype.has=GR;mr.prototype.set=VR;function mt(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function zR(){this.__data__=[],this.size=0}function $R(r){var e=this.__data__,t=Od(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():OR.call(e,t,1),--this.size,!0}function JR(r){var e=this.__data__,t=Od(e,r);return t<0?void 0:e[t][1]}function KR(r){return Od(this.__data__,r)>-1}function XR(r,e){var t=this.__data__,i=Od(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}mt.prototype.clear=zR;mt.prototype.delete=$R;mt.prototype.get=JR;mt.prototype.has=KR;mt.prototype.set=XR;function pr(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}function ZR(){this.size=0,this.__data__={hash:new mr,map:new(us||mt),string:new mr}}function YR(r){var e=Ud(this,r).delete(r);return this.size-=e?1:0,e}function QR(r){return Ud(this,r).get(r)}function eF(r){return Ud(this,r).has(r)}function tF(r,e){var t=Ud(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}pr.prototype.clear=ZR;pr.prototype.delete=YR;pr.prototype.get=QR;pr.prototype.has=eF;pr.prototype.set=tF;function Td(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new pr;++e<t;)this.add(r[e])}function rF(r){return this.__data__.set(r,am),this}function iF(r){return this.__data__.has(r)}Td.prototype.add=Td.prototype.push=rF;Td.prototype.has=iF;function Ft(r){var e=this.__data__=new mt(r);this.size=e.size}function nF(){this.__data__=new mt,this.size=0}function sF(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}function oF(r){return this.__data__.get(r)}function aF(r){return this.__data__.has(r)}function dF(r,e){var t=this.__data__;if(t instanceof mt){var i=t.__data__;if(!us||i.length<eR-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new pr(i)}return t.set(r,e),this.size=t.size,this}Ft.prototype.clear=nF;Ft.prototype.delete=sF;Ft.prototype.get=oF;Ft.prototype.has=aF;Ft.prototype.set=dF;function lF(r,e){var t=Rd(r),i=!t&&IF(r),n=!t&&!i&&om(r),o=!t&&!i&&!n&&Wb(r),a=t||i||n||o,u=a?wR(r.length,String):[],p=u.length;for(var f in r)(e||rt.call(r,f))&&!(a&&(f=="length"||n&&(f=="offset"||f=="parent")||o&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||bF(f,p)))&&u.push(f);return u}function Od(r,e){for(var t=r.length;t--;)if(Nb(r[t][0],e))return t;return-1}function uF(r,e,t){var i=e(r);return Rd(r)?i:kR(i,t(r))}function ps(r){return r==null?r===void 0?oR:iR:cr&&cr in Object(r)?yF(r):wF(r)}function bb(r){return ms(r)&&ps(r)==Id}function Db(r,e,t,i,n){return r===e?!0:r==null||e==null||!ms(r)&&!ms(e)?r!==r&&e!==e:cF(r,e,t,i,Db,n)}function cF(r,e,t,i,n,o){var a=Rd(r),u=Rd(e),p=a?em:Rt(r),f=u?em:Rt(e);p=p==Id?gi:p,f=f==Id?gi:f;var g=p==gi,c=f==gi,h=p==f;if(h&&om(r)){if(!om(e))return!1;a=!0,g=!1}if(h&&!g)return o||(o=new Ft),a||Wb(r)?_b(r,e,t,i,n,o):gF(r,e,p,t,i,n,o);if(!(t&Fd)){var P=g&&rt.call(r,"__wrapped__"),w=c&&rt.call(e,"__wrapped__");if(P||w){var C=P?r.value():r,E=w?e.value():e;return o||(o=new Ft),n(C,E,t,i,o)}}return h?(o||(o=new Ft),hF(r,e,t,i,n,o)):!1}function mF(r){if(!jb(r)||kF(r))return!1;var e=qb(r)?BR:yR;return e.test(fr(r))}function pF(r){return ms(r)&&Hb(r.length)&&!!H[ps(r)]}function fF(r){if(!SF(r))return MR(r);var e=[];for(var t in Object(r))rt.call(r,t)&&t!="constructor"&&e.push(t);return e}function _b(r,e,t,i,n,o){var a=t&Fd,u=r.length,p=e.length;if(u!=p&&!(a&&p>u))return!1;var f=o.get(r);if(f&&o.get(e))return f==e;var g=-1,c=!0,h=t&kb?new Td:void 0;for(o.set(r,e),o.set(e,r);++g<u;){var P=r[g],w=e[g];if(i)var C=a?i(w,P,g,e,r,o):i(P,w,g,r,e,o);if(C!==void 0){if(C)continue;c=!1;break}if(h){if(!SR(e,function(E,D){if(!xR(h,D)&&(P===E||n(P,E,t,i,o)))return h.push(D)})){c=!1;break}}else if(!(P===w||n(P,w,t,i,o))){c=!1;break}}return o.delete(r),o.delete(e),c}function gF(r,e,t,i,n,o,a){switch(t){case Ad:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Rb:return!(r.byteLength!=e.byteLength||!o(new hb(r),new hb(e)));case wb:case Ib:case Ab:return Nb(+r,+e);case xb:return r.name==e.name&&r.message==e.message;case Eb:case Tb:return r==e+"";case xd:var u=AR;case Cd:var p=i&Fd;if(u||(u=TR),r.size!=e.size&&!p)return!1;var f=a.get(r);if(f)return f==e;i|=kb,a.set(r,e);var g=_b(u(r),u(e),i,n,o,a);return a.delete(r),g;case sR:if(Qc)return Qc.call(r)==Qc.call(e)}return!1}function hF(r,e,t,i,n,o){var a=t&Fd,u=Pb(r),p=u.length,f=Pb(e),g=f.length;if(p!=g&&!a)return!1;for(var c=p;c--;){var h=u[c];if(!(a?h in e:rt.call(e,h)))return!1}var P=o.get(r);if(P&&o.get(e))return P==e;var w=!0;o.set(r,e),o.set(e,r);for(var C=a;++c<p;){h=u[c];var E=r[h],D=e[h];if(i)var Ke=a?i(D,E,h,e,r,o):i(E,D,h,r,e,o);if(!(Ke===void 0?E===D||n(E,D,t,i,o):Ke)){w=!1;break}C||(C=h=="constructor")}if(w&&!C){var Cn=r.constructor,la=e.constructor;Cn!=la&&"constructor"in r&&"constructor"in e&&!(typeof Cn=="function"&&Cn instanceof Cn&&typeof la=="function"&&la instanceof la)&&(w=!1)}return o.delete(r),o.delete(e),w}function Pb(r){return uF(r,AF,vF)}function Ud(r,e){var t=r.__data__;return PF(e)?t[typeof e=="string"?"string":"hash"]:t.map}function yi(r,e){var t=CR(r,e);return mF(t)?t:void 0}function yF(r){var e=rt.call(r,cr),t=r[cr];try{r[cr]=void 0;var i=!0}catch{}var n=Mb.call(r);return i&&(e?r[cr]=t:delete r[cr]),n}var vF=yb?function(r){return r==null?[]:(r=Object(r),PR(yb(r),function(e){return Lb.call(r,e)}))}:EF,Rt=ps;(rm&&Rt(new rm(new ArrayBuffer(1)))!=Ad||us&&Rt(new us)!=xd||im&&Rt(im.resolve())!=ub||nm&&Rt(new nm)!=Cd||sm&&Rt(new sm)!=tm)&&(Rt=function(r){var e=ps(r),t=e==gi?r.constructor:void 0,i=t?fr(t):"";if(i)switch(i){case LR:return Ad;case DR:return xd;case _R:return ub;case NR:return Cd;case qR:return tm}return e});function bF(r,e){return e=e??Sb,!!e&&(typeof r=="number"||vR.test(r))&&r>-1&&r%1==0&&r<e}function PF(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function kF(r){return!!fb&&fb in r}function SF(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Bd;return r===t}function wF(r){return Mb.call(r)}function fr(r){if(r!=null){try{return Ub.call(r)}catch{}try{return r+""}catch{}}return""}function Nb(r,e){return r===e||r!==r&&e!==e}var IF=bb(function(){return arguments}())?bb:function(r){return ms(r)&&rt.call(r,"callee")&&!Lb.call(r,"callee")},Rd=Array.isArray;function xF(r){return r!=null&&Hb(r.length)&&!qb(r)}var om=UR||TF;function CF(r,e){return Db(r,e)}function qb(r){if(!jb(r))return!1;var e=ps(r);return e==Cb||e==rR||e==tR||e==nR}function Hb(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Sb}function jb(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}function ms(r){return r!=null&&typeof r=="object"}var Wb=pb?IR(pb):pF;function AF(r){return xF(r)?lF(r):fF(r)}function EF(){return[]}function TF(){return!1}hi.exports=CF});var d2=An(Cy(),1);function v(r,e){if(r==null)throw Error(e??"Expected nonnullish value.")}function Ay(r,e){return v(r,e),r}function tr(r,e){if(!r)throw Error(e)}var te;(function(r){r.COMMENT="t1_",r.ACCOUNT="t2_",r.LINK="t3_",r.MESSAGE="t4_",r.SUBREDDIT="t5_",r.AWARD="t6_"})(te||(te={}));function kt(r){return r.startsWith(te.COMMENT)}function Qa(r){return r.startsWith(te.ACCOUNT)}function rr(r){return r.startsWith(te.LINK)}function Ey(r){return r.startsWith(te.MESSAGE)}function Ty(r){return r.startsWith(te.SUBREDDIT)}function Ry(r){return r.startsWith(te.AWARD)}function NA(r){tr(kt(r),`Expected comment id to start with ${te.COMMENT}, got ${r}}`)}function qA(r){tr(Qa(r),`Expected account id to start with ${te.ACCOUNT}, got ${r}}`)}function HA(r){tr(rr(r),`Expected link id to start with ${te.LINK}, got ${r}}`)}function jA(r){tr(Ey(r),`Expected message id to start with ${te.MESSAGE}, got ${r}}`)}function WA(r){tr(Ty(r),`Expected subreddit id to start with ${te.SUBREDDIT}, got ${r}}`)}function GA(r){tr(Ry(r),`Expected award id to start with ${te.AWARD}, got ${r}}`)}function Wr(r){return NA(r),r}function re(r){return qA(r),r}function he(r){return HA(r),r}function VA(r){return jA(r),r}function Fe(r){return WA(r),r}function zA(r){return GA(r),r}function ye(r){if(kt(r))return Wr(r);if(Qa(r))return re(r);if(rr(r))return he(r);if(Ey(r))return VA(r);if(Ty(r))return Fe(r);if(Ry(r))return zA(r);throw new Error(`Expected thing id to start with ${Object.values(te).join(", ")} got ${r}}`)}function mc(r){return kt(r)}import*as I from"@devvit/protos";var ed=class{constructor(e){}};var pc=(t=>(t.Installation="installation",t.App="app",t))(pc||{});function ir(r,e=new Set){for(let t of r){if(t.type==="group"){ir(t.fields,e);continue}let i=t.name;if(e.has(i))throw new Error(`Duplicate field name: ${i}`);e.add(i)}$A(r)}function $A(r){for(let e of r)if(e.type==="string"&&e.isSecret&&e.scope!=="app")throw`Invalid setting: only app settings can be secrets. Add "scope: SettingScope.App" to field "${e.name}"`}var St=Object.freeze({INTERVAL:0,FORM:1,STATE:2,CHANNEL:3});var LU=["activity","add-emoji","add","add-media","add-to-feed","admin","align-center","align-left","align-right","all","appearance","approve","archived","aspect-ratio","aspect-rectangle","attach","audio","author","avatar-style","award","back","ban","best","binoculars","block","blockchain","bold","bot","boost","bounce","browse","browser","cake","calendar","camera","caret-down","caret-left","caret-right","caret-up","chat","chat-group","chat-new","checkbox-dismiss","checkbox","checkmark","chrome","clear","close","closed-captioning","code-block","code-inline","coins-color-old","coins-color","coins","collapse-left","collapse-right","collection","comment","comments","community","contest","controversial","crop","crosspost","crowd-control","custom-feed","customize","day","delete","discover","dismiss-all","distinguish","down-arrow","down","download","downvote","downvotes","drag","drugs","duplicate","edit","effect","embed","emoji","end-live-chat","error","expand-left","expand-right","external","feed-video","filter","format","forward","gif-post","heart","help","hide","history","home","hot","ignore-reports","image-post","inbox","info","invite","italic","join","joined","jump-down","jump-up","karma","keyboard","kick","language","leave","left","link","link-post","list-bulleted","list-numbered","live-chat","live","load","location","lock","logout","loop","mark-read","mask","media-gallery","meme","menu","message","mic","mic-mute","mod","mod-mail","mod-mode","mod-mute","mod-overflow","mod-queue","mod-unmute","music","new","night","notification","notification-frequent","notification-off","nsfw","nsfw-language","nsfw-violence","original","overflow-caret","overflow-horizontal","overflow-vertical","pause","payment","peace","pending-posts","phone","pin","planet","play","poll-post","popular","posts","powerup-color-outline","powerup-fill-color","powerup","predictions","premium","privacy","profile","qa","qr-code","quarantined","quote","r-slash","radio-button","raise-hand","random","ratings-everyone","ratings-mature","ratings-nsfw","ratings-violence","refresh","remove","reply","report","reverse","right","rising","rotate","rotate-image","rpan","rules","safari","save","saved","search","self","send","settings","share-android","share","share-ios","show","side-menu","skipback10","skipforward10","sort-az","sort","sort-price","sort-za","spam","spoiler","sponsored","star","statistics","status-live","sticker","strikethrough","subtract","superscript","swap-camera","swipe-back","swipe-down","swipe","swipe-up","table","tag","tap","telescope","text","text-post","text-size","toggle","tools","top","topic-activism","topic-addictionsupport","topic-advice","topic-animals","topic-anime","topic-art","topic-beauty","topic-business","topic-careers","topic-cars","topic-celebrity","topic-craftsdiy","topic-crypto","topic-culture","topic-diy","topic-entertainment","topic-ethics","topic-family","topic-fashion","topic","topic-fitness","topic-food","topic-funny","topic-gender","topic-health","topic-help","topic-history","topic-hobbies","topic-homegarden","topic-internet","topic-law","topic-learning","topic-lifestyle","topic-marketplace","topic-mature","topic-mensfashion","topic-menshealth","topic-meta","topic-military","topic-movies","topic-music","topic-news","topic-other","topic-outdoors","topic-pets","topic-photography","topic-places","topic-podcasts","topic-politics","topic-programming","topic-reading","topic-religion","topic-science","topic-sexorientation","topic-sports","topic-style","topic-tabletop","topic-technology","topic-television","topic-traumasupport","topic-travel","topic-videogaming","topic-womensfashion","topic-womenshealth","translate","trim","u-slash","unban","undo","unheart","unlock","unmod","unpin","unverified","up-arrow","up","upload","upvote","upvotes","user","user-note","users","vault","verified","video-camera","video-feed","video-live-1","video-live-fill-1","video-live","video-post","video-thread","video-transcription","view-card","view-classic","view-compact","view-grid","views","volume","volume-mute","wallet","warning","wiki-ban","wiki","wiki-unban","world"];import{AppSettingsDefinition as NE,GetFieldsResponse as qE}from"@devvit/protos";import{FormField as nr,FormFieldType as Be}from"@devvit/protos";function at(r){return r.map(e=>{switch(e.type){case"string":return JA(e);case"image":return KA(e);case"paragraph":return XA(e);case"number":return ZA(e);case"select":return YA(e);case"boolean":return QA(e);case"group":return eE(e);default:throw new Error("Unknown field type.")}})}function JA(r){return nr.fromPartial({defaultValue:{fieldType:Be.STRING,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{stringConfig:{placeholder:r.placeholder}},fieldId:r.name,fieldType:Be.STRING,helpText:r.helpText,label:r.label,required:r.required,isSecret:r.isSecret})}function KA(r){return nr.fromPartial({disabled:r.disabled,fieldId:r.name,fieldType:Be.IMAGE,helpText:r.helpText,label:r.label,required:r.required})}function XA(r){return nr.fromPartial({defaultValue:{fieldType:Be.PARAGRAPH,stringValue:r.defaultValue},disabled:r.disabled,fieldConfig:{paragraphConfig:{lineHeight:r.lineHeight,placeholder:r.placeholder}},fieldId:r.name,fieldType:Be.PARAGRAPH,helpText:r.helpText,label:r.label,required:r.required})}function ZA(r){return nr.fromPartial({defaultValue:{fieldType:Be.NUMBER,numberValue:r.defaultValue},disabled:r.disabled,fieldConfig:{numberConfig:{}},fieldId:r.name,fieldType:Be.NUMBER,helpText:r.helpText,label:r.label,required:r.required})}function YA(r){return nr.fromPartial({defaultValue:{fieldType:Be.SELECTION,selectionValue:{values:r.defaultValue}},disabled:r.disabled,fieldConfig:{selectionConfig:{choices:r.options,multiSelect:r.multiSelect}},fieldId:r.name,fieldType:Be.SELECTION,helpText:r.helpText,label:r.label,required:r.required})}function QA(r){return nr.fromPartial({defaultValue:{fieldType:Be.BOOLEAN,boolValue:r.defaultValue},disabled:r.disabled,fieldId:r.name,fieldType:Be.BOOLEAN,helpText:r.helpText,label:r.label})}function eE(r){return nr.fromPartial({fieldType:Be.GROUP,fieldConfig:{groupConfig:{fields:at(r.fields)}},label:r.label,helpText:r.helpText})}function U(r,e){m.prototype[r]=e}import{ValidateFormResponse as _E}from"@devvit/protos";import{RealtimeSubscriptionStatus as Qy}from"@devvit/protos";var Gr;(function(r){function e(o,a){return o.length<=a?o:`${o.slice(0,a-1)}\u2026`}r.ellipsize=e;function t(o){return o[0]==null?o:`${o[0].toLocaleUpperCase()}${o.slice(1)}`}r.capitalize=t;function i(o){return o==null||/^\s*$/.test(o)}r.isBlank=i;function n(o){return o instanceof Error?`${o.stack||o.message||o.name}`:String(o)}r.caughtToString=n})(Gr||(Gr={}));function fc(r){if(r==null||typeof r!="object")return r;for(let e of Object.values(r))fc(e);return Object.freeze(r)}var dM=fc(new Set([Boolean,String,Date,ArrayBuffer,DataView,Array,Object,Map,Set,Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array,Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError].map(r=>r.prototype)));var ie=Object.freeze({Actor:"devvit-actor",App:"devvit-app",AppUser:"devvit-app-user",AppViewerAuthToken:"devvit-app-viewer-authorization",Caller:"devvit-caller",CallerPortID:"devvit-caller-port-id",Canary:"devvit-canary",DebugRenderXML:"devvit-debug-render-xml",GQLHost:"devvit-gql-host",Installation:"devvit-installation",ModPermissions:"devvit-mod-permissions",R2Auth:"devvit-sec-authorization",R2Host:"devvit-r2-host",RemoteHostname:"devvit-remote-hostname",SettingsUri:"devvit-sec-settings-uri",StreamID:"devvit-stream-id",Subreddit:"devvit-subreddit",TraceID:"devvit-trace-id",User:"devvit-user",Version:"devvit-version"});var Zy=An(Xy(),1),gM=globalThis.Buffer??Zy.Buffer;function ve(r,e){return e?.[r]?.values[0]}function OE(r){let e=Ay(r.method.split("/").at(-1));return e[0].toLocaleLowerCase()+e.slice(1)}var Yy;(function(r){function e(t){let i=t.request?`${t.src} \u2192 ${t.dst}`:`${t.dst} \u2190 ${t.src}`,n=t.streamId.split("-")[0],o=Gr.capitalize(OE(t));return`${i}@${n}/${o}`}r.toLogString=e})(Yy||(Yy={}));function ev(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState(),a=ve(ie.App,r.metadata);v(a,"useChannel - app is missing from Context");let u=ve(ie.Installation,r.metadata);v(u,"useChannel - installation is missing from Context");async function p(C){let E=n[i].channel;if(n[i].active)if(n[i].connected)await r.realtime.send(E,C);else throw Error(`Failed to send to channel '${E}'; it is active but not yet connected`);else throw Error(`Cannot send a message over inactive channel: ${E}`)}function f(){if(!n[i].active){let C=n[i].channel;n[i].active=!0,r.addRealtimeChannel(C)}}function g(){if(n[i].active){let C=n[i].channel;n[i].active=!1,r.removeRealtimeChannel(C)}}function c(C){return async()=>{let E;switch(C.status){case Qy.REALTIME_SUBSCRIBED:n[i].connected=!0,E=t.onSubscribed?.();break;case Qy.REALTIME_UNSUBSCRIBED:n[i].connected=!1,E=t.onUnsubscribed?.();break;default:E=t.onMessage(C.event?.data??{});break}await E}}let h={channel:`${a}:${u}:${t.name}`,active:!1,connected:!1,preventCallback:!1,type:St.CHANNEL};i in n?h=n[i]:i in o&&(h=o[i]);let P=r.realtimeEvent;r.isInitialRender?h.active=!1:P&&h.active&&P.event.channel===h.channel&&(h.preventCallback||r.runHook(c(P)),r.rerenderIn(0)),n[i]=h,r.currentHookIndex++;let w=0;return h.active&&h.connected?w=2:h.active&&!h.connected?w=1:!h.active&&h.connected?w=3:!h.active&&!h.connected&&(w=4),{subscribe:f,unsubscribe:g,send:p,status:w}}return e}import{FormFieldType as Kr}from"@devvit/protos";function Cc(r){switch(r.fieldType){case Kr.STRING:return r.stringValue;case Kr.IMAGE:return r.stringValue;case Kr.PARAGRAPH:return r.stringValue;case Kr.NUMBER:return r.numberValue;case Kr.BOOLEAN:return r.boolValue;case Kr.SELECTION:return r.selectionValue?.values??[];default:return}}function It(r){return Object.keys(r).reduce((e,t)=>(e[t]=Cc(r[t]),e),{})}function tv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentKey(),a=r.getCurrentComponentState(),u=r.getPreviousComponentState(),p=`form.hook.${o}.${n}`,f={formKey:p,preventSubmit:!1,type:St.FORM};n in a?f=a[n]:n in u&&(f=u[n]),a[n]=f,r.forms.set(p,t);let g=r.formSubmittedEvent;return g&&!f.preventSubmit&&g.formId===p&&r.runHook(async()=>{let c=i(It(g.results));c&&c instanceof Promise&&await c,r.rerenderIn(0)}),a[n].preventSubmit=!1,r.currentHookIndex++,p}return e}function rv(r){function e(t,i){let n=r.currentHookIndex,o=r.getCurrentComponentState(),a=r.getPreviousComponentState(),u=100,p=Math.max(u,i),f={lastRun:void 0,running:!1,preventCallback:!1,type:St.INTERVAL};n in o?f=o[n]:n in a&&(f=a[n]);function g(){i<u&&console.error(`useInterval delay must be at least ${u}ms. Your interval of ${i}ms was automatically extended.`);for(let[h,P]of Object.entries(o))if(h!==n.toString()&&P?.type===St.INTERVAL&&P?.running)throw new Error("Only one useInterval hook may be running at a time");o[n]={running:!0,lastRun:o[n]?.lastRun??Date.now(),preventCallback:!1,type:St.INTERVAL},r.rerenderIn(p)}function c(){o[n].running=!1,o[n].lastRun=void 0,o[n].preventCallback=!1}return r.isEffectRender&&f.running&&(f.preventCallback||(f.lastRun===void 0||f.lastRun+p<Date.now())&&r.runHook(async()=>{let h=t();h&&h instanceof Promise&&await h,f.lastRun=Date.now()}),r.rerenderIn(p)),f.preventCallback=!1,o[n]=f,r.currentHookIndex++,{start:g,stop:c}}return e}function iv(r){function e(t){let i=r.currentHookIndex,n=r.getCurrentComponentState(),o=r.getPreviousComponentState();if(i in n)return r.currentHookIndex++,[n[i],a];if(r.isInitialRender||!(i in o)){let u=t instanceof Function?t():t;if(u instanceof Promise)throw(async()=>{n[i]=await u,r.currentHookIndex=0})();n[i]=u}else n[i]=o[i];function a(u){if(r.isRendering)throw new Error("Cannot call setState while rendering.");n[i]=u instanceof Function?u(n[i]):u}return r.currentHookIndex++,[n[i],a]}return e}var Xr,Zr,nd,nv,sd,sv,Yr=class{constructor(e,t){l(this,nd);l(this,sd);l(this,Xr,void 0);l(this,Zr,void 0);d(this,Xr,e),d(this,Zr,t)}async getURL(e){return typeof e=="string"?k(this,nd,nv).call(this,e):k(this,sd,sv).call(this,e)}};Xr=new WeakMap,Zr=new WeakMap,nd=new WeakSet,nv=async function(e){let t=globalThis?.devvit?.config?.assets?.[e];if(t)return t;let i=await s(this,Zr).call(this).GetAssetURL({path:e},s(this,Xr));if(!i.found)throw new Error(`Could not load the URL for asset ${e}`);return i.url},sd=new WeakSet,sv=async function(e){let t={},i=[],n=globalThis?.devvit?.config?.assets;if(n)for(let a of e)n[a]?t[a]=n[a]:i.push(a);else i=e;if(i.length===0)return t;let o=await s(this,Zr).call(this).GetAssetURLs({paths:i},s(this,Xr));i=[];for(let[a,u]of Object.entries(o.urls))u.found?t[a]=u.paths[0]:i.push(a);if(i.length>0)throw new Error(`The following assets were missing from the assets list: ${i.join(", ")}`);return t};var xt,Qr=class{constructor(e){l(this,xt,void 0);d(this,xt,e)}async get(e){let{messages:t}=await m.kvStorePlugin.Get({keys:[e]},s(this,xt));try{if(t[e])return JSON.parse(t[e])}catch{return}}async put(e,t){let i={};i[e]=JSON.stringify(t),await m.kvStorePlugin.Put({messages:i},s(this,xt))}async delete(e){await m.kvStorePlugin.Del({keys:[e]},s(this,xt))}async list(){let{keys:e}=await m.kvStorePlugin.List({filter:"*"},s(this,xt));return e}};xt=new WeakMap;var Xn,ei=class{constructor(e){l(this,Xn,void 0);d(this,Xn,e)}async upload(e){let t=await m.mediaPlugin.Upload(e,s(this,Xn));if(!t.mediaId)throw new Error("unable to get mediaId via uploads");return Promise.resolve({mediaId:t.mediaId,mediaUrl:t.mediaUrl})}};Xn=new WeakMap;var Zn,ti=class{constructor(e){l(this,Zn,void 0);d(this,Zn,e)}async add(e){await m.modLogPlugin.Add(e,s(this,Zn))}};Zn=new WeakMap;var S,Yn,ii=class{constructor(e){l(this,S,void 0);l(this,Yn,void 0);d(this,S,e),d(this,Yn,new ad(e))}get modMail(){return s(this,Yn)}getSubredditById(e){return be.getById(ye(e),s(this,S))}getSubredditByName(e){return be.getByName(e,s(this,S))}addSubredditRemovalReason(e,t){return be.addRemovalReason(e,t.title,t.message,s(this,S))}getSubredditRemovalReasons(e){return be.getRemovalReasons(e,s(this,S))}getCurrentSubreddit(){return be.getFromMetadata(s(this,S))}getPostById(e){return z.getById(ye(e),s(this,S))}submitPost(e){return z.submit(e,s(this,S))}crosspost(e){return z.crosspost(e,s(this,S))}getUserById(e){return x.getById(ye(e),s(this,S))}getCollectionById(e){return ri.getCollectionById({collectionId:e},s(this,S))}createCollection(e){return ri.create(e,s(this,S))}getCollectionsForSubreddit(e){return ri.getCollectionsForSubreddit({subredditId:e},s(this,S))}getUserByUsername(e){return x.getByUsername(e,s(this,S))}getCurrentUser(){return x.getFromMetadata(ie.User,s(this,S))}getAppUser(){return x.getFromMetadata(ie.AppUser,s(this,S))}getSnoovatarUrl(e){return x.getSnoovatarUrl(e,s(this,S))}getCommentById(e){return Z.getById(ye(e),s(this,S))}getComments(e){return Z.getComments(e,s(this,S))}getCommentsByUser(e){return Z.getCommentsByUser(e,s(this,S))}submitComment(e){return Z.submit({...e,id:ye(e.id)},s(this,S))}getControversialPosts(e){return z.getControversialPosts(e,s(this,S))}getTopPosts(e){return z.getTopPosts(e,s(this,S))}getHotPosts(e){return z.getHotPosts(e,s(this,S))}getNewPosts(e){return z.getNewPosts(e,s(this,S))}getRisingPosts(e){return z.getRisingPosts(e,s(this,S))}getPostsByUser(e){return z.getPostsByUser(e,s(this,S))}getCommentsAndPostsByUser(e){return x.getOverview(e,s(this,S))}getModerationLog(e){return od(e,s(this,S))}getApprovedUsers(e){return x.getSubredditUsersByType({type:"contributors",...e},s(this,S))}approveUser(e,t){return x.createRelationship({username:e,subredditName:t,type:"contributor"},s(this,S))}removeUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"contributor"},s(this,S))}getWikiContributors(e){return x.getSubredditUsersByType({type:"wikicontributors",...e},s(this,S))}addWikiContributor(e,t){return x.createRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,S))}removeWikiContributor(e,t){return x.removeRelationship({username:e,subredditName:t,type:"wikicontributor"},s(this,S))}getBannedUsers(e){return x.getSubredditUsersByType({type:"banned",...e},s(this,S))}banUser(e){return x.createRelationship({username:e.username,subredditName:e.subredditName,type:"banned",banReason:e.reason,banMessage:e.message,note:e.note,duration:e.duration},s(this,S))}unbanUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"banned"},s(this,S))}getBannedWikiContributors(e){return x.getSubredditUsersByType({type:"wikibanned",...e},s(this,S))}banWikiContributor(e){return x.createRelationship({...e,type:"wikibanned"},s(this,S))}unbanWikiContributor(e,t){return x.removeRelationship({username:e,subredditName:t,type:"wikibanned"},s(this,S))}getModerators(e){return x.getSubredditUsersByType({type:"moderators",...e},s(this,S))}inviteModerator(e){return x.createRelationship({type:"moderator_invite",subredditName:e.subredditName,username:e.subredditName,permissions:e.permissions??[]},s(this,S))}revokeModeratorInvite(e,t){return x.removeRelationship({username:e,subredditName:t,type:"moderator_invite"},s(this,S))}removeModerator(e,t){return x.removeRelationship({type:"moderator",subredditName:t,username:e},s(this,S))}setModeratorPermissions(e,t,i){return x.setModeratorPermissions(e,t,i,s(this,S))}getMutedUsers(e){return x.getSubredditUsersByType({type:"muted",...e},s(this,S))}muteUser(e){return x.createRelationship({...e,type:"muted"},s(this,S))}unmuteUser(e,t){return x.removeRelationship({username:e,subredditName:t,type:"muted"},s(this,S))}getModNotes(e){return Ue.get(e,s(this,S))}deleteModNote(e){return Ue.delete(e,s(this,S))}addModNote(e){let t={...e,redditId:ye(e.redditId)};return Ue.add(t,s(this,S))}addRemovalNote(e){return Ue.addRemovalNote(e,s(this,S))}async sendPrivateMessage(e){return ar.send(e,s(this,S))}async sendPrivateMessageAsSubreddit(e){return ar.sendAsSubreddit(e,s(this,S))}async approve(e){if(kt(e))return Z.approve(e,s(this,S));if(rr(e))return z.approve(e,s(this,S));throw new Error("id must start with either t1_ or t3_")}async remove(e,t){if(kt(e))return Z.remove(e,t,s(this,S));if(rr(e))return z.remove(e,t,s(this,S));throw new Error("id must start with either t1_ or t3_")}async getPostFlairTemplates(e){return le.getPostFlairTemplates(e,s(this,S))}async getUserFlairTemplates(e){return le.getUserFlairTemplates(e,s(this,S))}async createPostFlairTemplate(e){return le.createPostFlairTemplate(e,s(this,S))}async createUserFlairTemplate(e){return le.createUserFlairTemplate(e,s(this,S))}async editFlairTemplate(e){return le.editFlairTemplate(e,s(this,S))}async deleteFlairTemplate(e,t){return le.deleteFlairTemplate(e,t,s(this,S))}async setUserFlair(e){return Me.setUserFlair(e,s(this,S))}async removeUserFlair(e,t){return Me.removeUserFlair(e,t,s(this,S))}async setPostFlair(e){return Me.setPostFlair(e,s(this,S))}async removePostFlair(e,t){return Me.removePostFlair(e,he(t),s(this,S))}async getWidgets(e){return ne.getWidgets(e,s(this,S))}async deleteWidget(e,t){return ne.delete(e,t,s(this,S))}async addWidget(e){return ne.add(e,s(this,S))}async reorderWidgets(e,t){return ne.reorder(e,t,s(this,S))}async getWikiPage(e,t){return Pe.getPage(e,t,s(this,S))}async getWikiPages(e){return Pe.getPages(e,s(this,S))}async createWikiPage(e){return Pe.createPage(e,s(this,S))}async updateWikiPage(e){return Pe.updatePage(e,s(this,S))}getWikiPageRevisions(e){return Pe.getPageRevisions(e,s(this,S))}async revertWikiPage(e,t,i){return Pe.revertPage(e,t,i,s(this,S))}async getWikiPageSettings(e,t){return Pe.getPageSettings(e,t,s(this,S))}async updateWikiPageSettings(e){return Pe.updatePageSettings(e,s(this,S))}async addEditorToWikiPage(e,t,i){return Pe.addEditor(e,t,i,s(this,S))}async removeEditorFromWikiPage(e,t,i){return Pe.removeEditor(e,t,i,s(this,S))}getMessages(e){return ar.getMessages(e,s(this,S))}markAllMessagesAsRead(){return ar.markAllAsRead(s(this,S))}report(e,t){return m.redditAPIPlugins.LinksAndComments.Report({reason:t.reason,thingId:e.id,srName:e.subredditName,usernames:e.authorName},s(this,S))}getModQueue(e){return be.aboutLocation({...e,location:"modqueue"},s(this,S))}getReports(e){return be.aboutLocation({...e,location:"reports"},s(this,S))}getSpam(e){return be.aboutLocation({...e,location:"spam"},s(this,S))}getUnmoderated(e){return be.aboutLocation({...e,location:"unmoderated"},s(this,S))}getEdited(e){return be.aboutLocation({...e,location:"edited"},s(this,S))}getVaultByAddress(e){return av(e,s(this,S))}getVaultByUserId(e){return dv(ye(e),s(this,S))}};S=new WeakMap,Yn=new WeakMap;import{RedisKeyScope as Ac}from"@devvit/protos";var R,F,B,Ec=class{constructor(e,t,i){l(this,R,void 0);l(this,F,void 0);l(this,B,void 0);d(this,R,e),d(this,F,t),d(this,B,i)}async get(e){return await s(this,R).Get({key:e,transactionId:s(this,F)},s(this,B)),this}async multi(){await s(this,R).Multi(s(this,F),s(this,B))}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),await s(this,R).Set({key:e,value:t,nx:i?.nx===!0,xx:i?.xx===!0,expiration:n||0,transactionId:s(this,F)},s(this,B)),this}async del(...e){return await s(this,R).Del({keys:e,transactionId:s(this,F)},s(this,B)),this}async type(e){return await s(this,R).Type({key:e,transactionId:s(this,F)},s(this,B)),this}async exec(){let e=await s(this,R).Exec(s(this,F),s(this,B)),t=[];for(let i of e.response)i.members?t.push(i.members):i.nil!==void 0?t.push(null):i.num!==void 0?t.push(i.num):i.values!==void 0?t.push(i.values.values):i.str!==void 0&&t.push(i.str);return t}async discard(){await s(this,R).Discard(s(this,F),s(this,B))}async watch(...e){return await s(this,R).Watch({keys:e,transactionId:s(this,F)},s(this,B)),this}async unwatch(){return await s(this,R).Unwatch(s(this,F),s(this,B)),this}async getRange(e,t,i){return await s(this,R).GetRange({key:e,start:t,end:i,transactionId:s(this,F)},s(this,B)),this}async setRange(e,t,i){return await s(this,R).SetRange({key:e,offset:t,value:i,transactionId:s(this,F)},s(this,B)),this}async strlen(e){return await s(this,R).Strlen({key:e,transactionId:s(this,F)},s(this,B)),this}async mget(e){return await s(this,R).MGet({keys:e,transactionId:s(this,F)},s(this,B)),this}async mset(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));return await s(this,R).MSet({kv:t,transactionId:s(this,F)},s(this,B)),this}async incrBy(e,t){return await s(this,R).IncrBy({key:e,value:t,transactionId:s(this,F)},s(this,B)),this}async expire(e,t){return await s(this,R).Expire({key:e,seconds:t,transactionId:s(this,F)},s(this,B)),this}async expireTime(e){return await s(this,R).ExpireTime({key:e,transactionId:s(this,F)},s(this,B)),this}async zAdd(e,...t){return await s(this,R).ZAdd({key:e,members:t,transactionId:s(this,F)},s(this,B)),this}async zScore(e,t){return await s(this,R).ZScore({key:{key:e,transactionId:s(this,F)},member:t},s(this,B)),this}async zRank(e,t){return await s(this,R).ZRank({key:{key:e,transactionId:s(this,F)},member:t},s(this,B)),this}async zIncrBy(e,t,i){return await s(this,R).ZIncrBy({key:e,member:t,value:i,transactionId:s(this,F)},s(this,B)),this}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,F)};return await s(this,R).ZScan(o,s(this,B)),this}async zCard(e){return await s(this,R).ZCard({key:e,transactionId:s(this,F)},s(this,B)),this}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"&&(o.byScore=!0),await s(this,R).ZRange({key:{key:e,transactionId:s(this,F)},start:t+"",stop:i+"",...o},s(this,B)),this}async zRem(e,t){return await s(this,R).ZRem({key:{key:e,transactionId:s(this,F)},members:t},s(this,B)),this}async zRemRangeByLex(e,t,i){return await s(this,R).ZRemRangeByLex({key:{key:e,transactionId:s(this,F)},min:t,max:i},s(this,B)),this}async zRemRangeByRank(e,t,i){return await s(this,R).ZRemRangeByRank({key:{key:e,transactionId:s(this,F)},start:t,stop:i},s(this,B)),this}async zRemRangeByScore(e,t,i){return await s(this,R).ZRemRangeByScore({key:{key:e,transactionId:s(this,F)},min:t,max:i},s(this,B)),this}async hgetall(e){return await s(this,R).HGetAll({key:e,transactionId:s(this,F)},s(this,B)),this}async hget(e,t){return await s(this,R).HGet({key:e,field:t,transactionId:s(this,F)},s(this,B)),this}async hset(e,t){let i=Object.entries(t).map(([n,o])=>({field:n,value:o}));return await s(this,R).HSet({key:e,fv:i,transactionId:s(this,F)},s(this,B)),this}async hincrby(e,t,i){return await s(this,R).HIncrBy({key:e,field:t,value:i,transactionId:s(this,F)},s(this,B)),this}async hdel(e,t){return await s(this,R).HDel({key:e,fields:t,transactionId:s(this,F)},s(this,B)),this}async hscan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,transactionId:s(this,F)};return await s(this,R).HScan(o,s(this,B)),this}async hkeys(e){return await s(this,R).HKeys({key:e,transactionId:s(this,F)},s(this,B)),this}async hlen(e){return await s(this,R).HLen({key:e,transactionId:s(this,F)},s(this,B)),this}};R=new WeakMap,F=new WeakMap,B=new WeakMap;var O,ni,Tc=class Tc{constructor(e,t=void 0,i=Ac.INSTALLATION){l(this,O,void 0);l(this,ni,void 0);d(this,O,e),d(this,ni,t),this.scope=i,this.global=i===Ac.INSTALLATION?new Tc(s(this,O),s(this,ni),Ac.GLOBAL):this}get storage(){return s(this,ni)||m.redisPlugin}async watch(...e){let t=await this.storage.Watch({keys:e},s(this,O));return new Ec(this.storage,t,s(this,O))}async get(e){let t=await this.storage.Get({key:e,scope:this.scope},s(this,O));return t!==null?t.value??void 0:t}async set(e,t,i){let n;return i?.expiration&&(n=Math.floor((i.expiration.getTime()-Date.now())/1e3),n<1&&(n=1)),(await this.storage.Set({key:e,value:t,nx:i?.nx===!0&&!i.xx,xx:i?.xx===!0&&!i.nx,expiration:n||0,scope:this.scope},s(this,O))).value}async del(...e){await this.storage.Del({keys:e,scope:this.scope},s(this,O))}async incrBy(e,t){return(await this.storage.IncrBy({key:e,value:t,scope:this.scope},s(this,O))).value}async getRange(e,t,i){let n=await this.storage.GetRange({key:e,start:t,end:i,scope:this.scope},s(this,O));return n!==null?n.value:n}async setRange(e,t,i){return(await this.storage.SetRange({key:e,offset:t,value:i,scope:this.scope},s(this,O))).value}async strlen(e){return(await this.storage.Strlen({key:e,scope:this.scope},s(this,O))).value}async expire(e,t){await this.storage.Expire({key:e,seconds:t,scope:this.scope},s(this,O))}async expireTime(e){return(await this.storage.ExpireTime({key:e,scope:this.scope},s(this,O))).value}async zAdd(e,...t){return(await this.storage.ZAdd({key:e,members:t,scope:this.scope},s(this,O))).value}async zRange(e,t,i,n){let o={rev:!1,byLex:!1,byScore:!1,offset:0,count:1e3};return n?.reverse&&(o.rev=n.reverse),n?.by==="lex"?o.byLex=!0:n?.by==="score"?o.byScore=!0:(o.offset=0,o.count=0),(await this.storage.ZRange({key:{key:e},start:t+"",stop:i+"",...o,scope:this.scope},s(this,O))).members}async zRem(e,t){return(await this.storage.ZRem({key:{key:e},members:t,scope:this.scope},s(this,O))).value}async zRemRangeByLex(e,t,i){return(await this.storage.ZRemRangeByLex({key:{key:e},min:t,max:i,scope:this.scope},s(this,O))).value}async zRemRangeByRank(e,t,i){return(await this.storage.ZRemRangeByRank({key:{key:e},start:t,stop:i,scope:this.scope},s(this,O))).value}async zRemRangeByScore(e,t,i){return(await this.storage.ZRemRangeByScore({key:{key:e},min:t,max:i,scope:this.scope},s(this,O))).value}async zScore(e,t){let i=await this.storage.ZScore({key:{key:e},member:t,scope:this.scope},s(this,O));return i!==null?i.value:i}async zRank(e,t){let i=await this.storage.ZRank({key:{key:e},member:t,scope:this.scope},s(this,O));return i!==null?i.value:i}async zIncrBy(e,t,i){let n=await this.storage.ZIncrBy({key:e,member:t,value:i,scope:this.scope},s(this,O));return n!==null?n.value:n}async mget(e){let t=await this.storage.MGet({keys:e,scope:this.scope},s(this,O));return t!==null?t.values.map(i=>i||null):t}async mset(e){let t=Object.entries(e).map(([i,n])=>({key:i,value:n}));await this.storage.MSet({kv:t,scope:this.scope},s(this,O))}async zCard(e){let t=await this.storage.ZCard({key:e,scope:this.scope},s(this,O));return t!==null?t.value:t}async zScan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.ZScan(o,s(this,O))}async type(e){let t=await this.storage.Type({key:e,scope:this.scope},s(this,O));return t!==null?t.value:t}async hget(e,t){let i=await this.storage.HGet({key:e,field:t,scope:this.scope},s(this,O));return i!==null?i.value??void 0:i}async hset(e,t){let i=Object.entries(t).map(([o,a])=>({field:o,value:a}));return(await this.storage.HSet({key:e,fv:i,scope:this.scope},s(this,O))).value}async hgetall(e){let t=await this.storage.HGetAll({key:e,scope:this.scope},s(this,O));return t!==null?t.fieldValues:t}async hdel(e,t){return(await this.storage.HDel({key:e,fields:t,scope:this.scope},s(this,O))).value}async hscan(e,t,i,n){let o={key:e,cursor:t,pattern:i,count:n,scope:this.scope};return await this.storage.HScan(o,s(this,O))}async hkeys(e){let t=await this.storage.HKeys({key:e,scope:this.scope},s(this,O));return t!==null?t.keys:t}async hincrby(e,t,i){return(await this.storage.HIncrBy({key:e,field:t,value:i,scope:this.scope},s(this,O))).value}async hlen(e){return(await this.storage.HLen({key:e,scope:this.scope})).value}};O=new WeakMap,ni=new WeakMap;var si=Tc;var dr,oi=class{constructor(e){l(this,dr,void 0);d(this,dr,e)}async runJob(e){return(await m.schedulerPlugin.Schedule({action:{type:e.name,data:e.data},cron:"cron"in e?e.cron:void 0,when:"runAt"in e?e.runAt:void 0},s(this,dr))).id}async cancelJob(e){await m.schedulerPlugin.Cancel({id:e},s(this,dr))}async listJobs(){return(await m.schedulerPlugin.List({after:new Date(0),before:new Date(Date.now()+31536e7)},s(this,dr))).actions.map(t=>(v(t.request?.action,"Scheduled job is malformed"),"when"in t.request&&t.request.when!=null?{id:t.id,name:t.request.action.type,runAt:t.request.when,data:t.request.action.data}:{id:t.id,name:t.request.action.type,cron:t.request.cron??"",data:t.request.action}))}};dr=new WeakMap;var Qn,ai=class{constructor(e){l(this,Qn,void 0);d(this,Qn,e)}async get(e){return(await this.getAll())[e]}async getAll(){let t=await m.settingsPlugin.GetSettings({},s(this,Qn));if(!t.installationSettings)throw new Error("Could not get installation settings");if(!t.appSettings)throw new Error("Could not get app settings");return{...lv(t.installationSettings.settings,m.installationSettings),...lv(t.appSettings.settings,m.appSettings)}}};Qn=new WeakMap;function lv(r,e){let t=Object.keys(r).reduce((i,n)=>(i[n]=Cc(r[n]),i),{});return e&&uv(t,e),t}function uv(r,e){for(let t of e)t.type==="group"?uv(r,t.fields):!(t.name in r)&&"defaultValue"in t&&(r[t.name]=t.defaultValue)}import{EffectType as Rc,Form as UE,ToastAppearance as cv}from"@devvit/protos";var lr,di,dd=class{constructor(e){l(this,lr,[]);l(this,di,void 0);d(this,di,e)}showForm(e,t){let i=m.formDefinitions.get(e);if(!i&&s(this,di)){let a=s(this,di).forms.get(e);a&&(i={form:a,onSubmit:()=>{}})}if(!i)throw new Error("Form does not exist. Make sure you have added it using Devvit.createForm at the root of your app.");let n=i.form instanceof Function?i.form(t??{}):i.form,o=UE.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});ir(n.fields),o.fields=at(n.fields),s(this,lr).push({type:Rc.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?cv.SUCCESS:cv.NEUTRAL}:t={text:e},s(this,lr).push({type:Rc.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,lr).push({type:Rc.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}get __effects(){return s(this,lr)}};lr=new WeakMap,di=new WeakMap;var Uc={now(){return new Date}};function mv(r){return`__autocache__${r}`}function pv(r){return`__lock__${r}`}var ME=300,LE=1e3,ld=5e3,Fc=3,fv=.1,gv=1e3,DE=3e4;function hv(r){if(r.error)throw new Error(r.error);return r.value}var Ct,At,Le,li,cd,yv,md,vv,pd,bv,es,Bc,fd,Pv,gd,kv,ts,Oc,hd,Sv,ud=class{constructor(e,t,i=Uc){l(this,cd);l(this,md);l(this,pd);l(this,es);l(this,fd);l(this,gd);l(this,ts);l(this,hd);l(this,Ct,void 0);l(this,At,{});l(this,Le,void 0);l(this,li,void 0);d(this,Ct,e),d(this,li,t),d(this,Le,i)}async cache(e,t){d(this,At,s(this,li).__cache=s(this,li).__cache??{}),k(this,hd,Sv).call(this,t);let i=k(this,cd,yv).call(this,t.key);if(i!==void 0)return i;let n=await k(this,ts,Oc).call(this,t.key),o=await k(this,md,vv).call(this,t,n,e);return hv(o)}};Ct=new WeakMap,At=new WeakMap,Le=new WeakMap,li=new WeakMap,cd=new WeakSet,yv=function(e){let t=s(this,At)[e];if(t){let i=s(this,Le).now().getTime(),n=t?.error&&t?.errorTime&&t.errorCount<Fc&&Math.random()<fv&&t.errorTime+gv<i;if(t?.expires&&t.expires<i&&t.checkedAt+gv<i||n){delete s(this,At)[e];return}else return hv(t)}},md=new WeakSet,vv=async function(e,t,i){let n=t?.expires,o=n?k(this,gd,kv).call(this,n):1;return!t||t?.error&&t.errorCount<Fc&&fv>Math.random()||o>Math.random()?k(this,pd,bv).call(this,e,t,i):t},pd=new WeakSet,bv=async function(e,t,i){let n=pv(e.key),o=s(this,Le).now().getTime(),a=new Date(o+e.ttl/2);if(await s(this,Ct).set(n,"1",{expiration:a,nx:!0}))return k(this,fd,Pv).call(this,e.key,t,i,e.ttl);if(t)return t;{let p=s(this,Le).now();return k(this,es,Bc).call(this,p,e.key,e.ttl)}},es=new WeakSet,Bc=async function(e,t,i){let n=Math.min(i,LE),o=await k(this,ts,Oc).call(this,t);if(o)return o;if(s(this,Le).now().getTime()-e.getTime()>=n)throw new Error(`Cache request timed out trying to get data at key: ${t}`);return await new Promise(a=>setTimeout(a,ME)),k(this,es,Bc).call(this,e,t,i)},fd=new WeakSet,Pv=async function(e,t,i,n){let o=s(this,Le).now().getTime()+n;t=t??{value:null,expires:o,errorCount:0,error:null,errorTime:null,checkedAt:0};try{t.value=await i(),t.error=null,t.errorCount=0,t.errorTime=null}catch(a){t.value=null,t.error=a.message??"Unknown error",t.errorTime=s(this,Le).now().getTime(),t.errorCount++}return s(this,At)[e]=t,await s(this,Ct).set(mv(e),JSON.stringify(t),{expiration:new Date(o+DE)}),t.error&&t.errorCount<Fc&&await s(this,Ct).del(pv(e)),t},gd=new WeakSet,kv=function(e){let t=s(this,Le).now().getTime(),i=e-t;return i<0?1:i<1e3?.1:i<2e3?.01:i<3e3?.001:0},ts=new WeakSet,Oc=async function(e){let t=await s(this,Ct).get(mv(e));if(t){let i=JSON.parse(t);return i.checkedAt=s(this,Le).now().getTime(),s(this,At)[e]=i,i}},hd=new WeakSet,Sv=function(e){e.ttl<ld&&(console.warn(`Cache TTL cannot be less than ${ld} milliseconds! Updating ttl value of ${e.ttl} to ${ld}.`),e.ttl=ld)};function wv(r,e,t=Uc){let i=new ud(r,e,t);return i.cache.bind(i)}var rs,ui=class{constructor(e){l(this,rs,void 0);d(this,rs,e)}async send(e,t){await m.realtimePlugin.Send({channel:e,data:t},s(this,rs))}};rs=new WeakMap;function De({metadata:r,ui:e,hooks:t,reconciler:i}){let n=new ti(r),o=new Qr(r),a=new si(r),u=wv(a,i?i.state:{}),p=new ii(r),f=new oi(r),g=new ai(r),c=e?new dd(i):void 0,h=new ei(r),P=new Yr(r,()=>m.assetsPlugin),w=new ui(r),C=t&&i?iv(i):void 0,E=t&&i?rv(i):void 0,D=t&&i?tv(i):void 0,Ke=t&&i?ev(i):void 0;return{modLog:n,kvStore:o,redis:a,reddit:p,scheduler:f,settings:g,media:h,assets:P,realtime:w,get useForm(){return D??(()=>{throw new Error("useForm() is unavailable")})},get cache(){return u??(()=>{throw new Error("cache() is unavailable")})},get useState(){return C??(()=>{throw new Error("useState() is unavailable")})},get useInterval(){return E??(()=>{throw new Error("useInterval() is unavailable")})},get useChannel(){return Ke??(()=>{throw new Error("useChannel() is unavailable")})},get ui(){if(!c)throw new Error("ui client is not available");return c}}}function ue(r,e,t){let i=ve(ie.Subreddit,r);v(i,"subreddit is missing from Context");let n=ve(ie.AppUser,r);v(n,"appAccountId is missing from Context");let o=ve(ie.User,r),a={metadata:r};return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a,toJSON(){return{appAccountId:n,subredditId:i,userId:o,postId:e,commentId:t,debug:a}}}}async function yd(r,e,t){if(!e)throw new Error("Settings were not defined.");let i=_E.fromPartial({success:!0,errors:{}}),n=It(r.fieldValues),o=e.flatMap(a=>a.type==="group"?a.fields:a);return await Promise.all(o.map(async a=>{let u=a.name;if(u&&a.type!=="group"&&a.onValidate){let p=n[u],f=a.onValidate,g=Object.assign(De({metadata:t}),ue(t)),c=await f({value:p,isEditing:r.editing},g);c&&(i.success=!1,i.errors[u]=c)}})),i}async function HE(){if(!m.appSettings)throw new Error("App settings were not defined.");return qE.fromPartial({fields:{fields:at(m.appSettings)}})}async function jE(r,e){return yd(r,m.appSettings,e)}function Iv(r){r.provides(NE),U("GetAppSettingsFields",HE),U("ValidateAppForm",jE)}import{CustomPostDefinition as rT}from"@devvit/protos";import{BlockRenderEventType as zc,BlockType as QE,EffectType as jv}from"@devvit/protos";var xv="redd.it",WE="redditstatic.com",GE="redditmedia.com",VE="snoo.dev";var zE=[VE,xv,WE,GE],$E=/^data:([a-zA-Z]+\/[a-zA-Z0-9.+_-]+)?(;charset=[a-zA-Z0-9._+-]+)?(;base64)?,(.*)/;function JE(r){return r.trim().replace(/[\r\n]+/g,"")}function KE(r){let e=$E.exec(JE(r));if(e)return{mimeType:e[1],charset:e[2]?.split("=")[1],isBase64:!!e[3],data:e[4].trim()}}function XE(r){return["image/svg+xml"].includes(r)}function ZE(r){let e=KE(r);return e?.mimeType?XE(e.mimeType):!1}function Cv(r){try{if(ZE(r))return!0;let t=(new URL(r,`https://i.${xv}`)?.hostname).split(".").slice(-2).join(".");return!!t&&zE.includes(t)}catch{return!1}}function ci(r){return r.__effects}function Av(){let r=new Set;return e=>{let t=e,i=1;for(;r.has(t);)t=`${e}.${i++}`;return r.add(t),t}}import{BlockActionType as YE,BlockAnimationDirection as Mv,BlockAnimationLoopMode as Lv,BlockAnimationType as Dv,BlockAvatarBackground as _v,BlockAvatarFacing as Nv,BlockAvatarSize as Et,BlockBorderWidth as bd,BlockButtonAppearance as Tt,BlockButtonSize as Dc,BlockFullSnooSize as mi,BlockGap as Pd,BlockHorizontalAlignment as _c,BlockIconSize as kd,BlockImageResizeMode as is,BlockPadding as ns,BlockRadius as ss,BlockSizeUnit as Nc,BlockSpacerShape as qc,BlockSpacerSize as Sd,BlockStackDirection as Hc,BlockTextOutline as jc,BlockTextOverflow as Wc,BlockTextSize as pi,BlockTextStyle as Gc,BlockTextWeight as qv,BlockType as _e,BlockVerticalAlignment as Vc}from"@devvit/protos";var Mc={transparent:"transparent",black:"#000000",white:"#ffffff","coolgray-950":"#04090A","coolgray-900":"#0B1416","coolgray-850":"#0F1A1C","coolgray-800":"#131F23","coolgray-750":"#1A282D","coolgray-700":"#223237","coolgray-650":"#2A3C42","coolgray-600":"#33464C","coolgray-550":"#4B6066","coolgray-525":"#576F76","coolgray-500":"#667A80","coolgray-450":"#82959B","coolgray-400":"#A0B0B5","coolgray-350":"#B8C5C9","coolgray-300":"#D2DADD","coolgray-250":"#DAE0E3","coolgray-200":"#E2E7E9","coolgray-150":"#EAEDEF","coolgray-100":"#F2F4F5","coolgray-50":"#F9FAFA","puregray-950":"#080808","puregray-900":"#131313","puregray-850":"#181818","puregray-800":"#1E1E1E","puregray-750":"#272727","puregray-700":"#303030","puregray-650":"#393939","puregray-600":"#434343","puregray-550":"#5C5C5C","puregray-500":"#767676","puregray-450":"#919191","puregray-400":"#ACACAC","puregray-350":"#C3C3C3","puregray-300":"#D6D6D6","puregray-250":"#DDDDDD","puregray-200":"#E4E4E4","puregray-150":"#EBEBEB","puregray-100":"#F2F2F2","puregray-50":"#F8F8F8","orangered-950":"#190600","orangered-900":"#340E00","orangered-800":"#4F1500","orangered-700":"#721F00","orangered-600":"#962900","orangered-500":"#D93A00","orangered-400":"#FE7C53","orangered-300":"#FFBEA6","orangered-200":"#FFD5C6","orangered-100":"#FFEDE5","orangered-50":"#FFF6F3","red-950":"#1C0004","red-900":"#3A0008","red-800":"#58000C","red-700":"#7E0011","red-600":"#A50016","red-500":"#EB001F","red-400":"#FF6E80","red-300":"#FFADB8","red-200":"#FFCCD2","red-100":"#FFEAED","red-50":"#FFF6F7","sakurapink-950":"#1A0011","sakurapink-900":"#360024","sakurapink-800":"#530037","sakurapink-700":"#770051","sakurapink-600":"#9B006A","sakurapink-500":"#E00096","sakurapink-400":"#FF55BD","sakurapink-300":"#FFA5E3","sakurapink-200":"#FFC5EC","sakurapink-100":"#FFE5F9","sakurapink-50":"#FFF3FB","berrypurple-950":"#16001F","berrypurple-900":"#2E0041","berrypurple-800":"#470062","berrypurple-700":"#66008C","berrypurple-600":"#8700B5","berrypurple-500":"#BC0EFF","berrypurple-400":"#D55EFF","berrypurple-300":"#EEA7FF","berrypurple-200":"#F2C8FF","berrypurple-100":"#FBE6FF","berrypurple-50":"#FCF4FF","periwinkle-950":"#0D0B1F","periwinkle-900":"#1A1741","periwinkle-800":"#272262","periwinkle-700":"#372F8C","periwinkle-600":"#453BB5","periwinkle-500":"#6A5CFF","periwinkle-400":"#988EFF","periwinkle-300":"#C3BDFF","periwinkle-200":"#D8D4FF","periwinkle-100":"#ECEAFF","periwinkle-50":"#F7F6FF","alienblue-950":"#000C1D","alienblue-900":"#00183D","alienblue-800":"#00255D","alienblue-700":"#003584","alienblue-600":"#0045AC","alienblue-500":"#1870F4","alienblue-400":"#629FFF","alienblue-300":"#A7CCFF","alienblue-200":"#C6DCFF","alienblue-100":"#E4EFFF","alienblue-50":"#F3F7FF","lightblue-950":"#000D12","lightblue-900":"#001C26","lightblue-800":"#002A3A","lightblue-700":"#003F56","lightblue-600":"#005472","lightblue-500":"#007FAE","lightblue-400":"#47B0DB","lightblue-300":"#95DCFB","lightblue-200":"#B6E9FF","lightblue-100":"#D9F6FF","lightblue-50":"#ECFAFF","mintgreen-950":"#00100E","mintgreen-900":"#001E1B","mintgreen-800":"#002E28","mintgreen-700":"#00443C","mintgreen-600":"#005A4F","mintgreen-500":"#008675","mintgreen-400":"#45B9AB","mintgreen-300":"#96E1D8","mintgreen-200":"#B7ECE5","mintgreen-100":"#DAF7F4","mintgreen-50":"#ECFBF9","kiwigreen-950":"#021000","kiwigreen-900":"#032200","kiwigreen-800":"#053200","kiwigreen-700":"#084A00","kiwigreen-600":"#0A6000","kiwigreen-500":"#0E8A00","kiwigreen-400":"#55BD46","kiwigreen-300":"#A3E398","kiwigreen-200":"#BFEEB8","kiwigreen-100":"#DFF8DB","kiwigreen-50":"#EEFCED","lime-950":"#0C0E00","lime-900":"#1A1F00","lime-800":"#282F00","lime-700":"#3A4501","lime-600":"#4D5A01","lime-500":"#6B7E01","lime-400":"#A1B33B","lime-300":"#CFDB83","lime-200":"#DFE8A6","lime-100":"#EFF4CC","lime-50":"#F7FAE5","yellow-950":"#100D01","yellow-900":"#251E02","yellow-800":"#382D03","yellow-700":"#504104","yellow-600":"#665505","yellow-500":"#8F7407","yellow-400":"#DBAF00","yellow-300":"#FADB61","yellow-200":"#FFE88F","yellow-100":"#FFF2BD","yellow-50":"#FFFAE5","yelloworange-950":"#150C00","yelloworange-900":"#2C1A00","yelloworange-800":"#432700","yelloworange-700":"#623A00","yelloworange-600":"#814C00","yelloworange-500":"#B06400","yelloworange-400":"#FF9C1A","yelloworange-300":"#FFCD7C","yelloworange-200":"#FFDDA8","yelloworange-100":"#FFF0D3","yelloworange-50":"#FFF7EA","poopbrown-950":"#110B04","poopbrown-900":"#29190A","poopbrown-800":"#3B2510","poopbrown-700":"#54371A","poopbrown-600":"#6E4924","poopbrown-500":"#9A6D3F","poopbrown-400":"#CAA075","poopbrown-300":"#EECCAA","poopbrown-200":"#F6DDC3","poopbrown-100":"#FEEEDD","poopbrown-50":"#FEF7EE",pizzaRed:{light:"#ef5350",dark:"#c62828"},"global-brand-orangered":{light:"#FF4500",dark:"#FF4500"},"global-focus":{light:"#47B0DB",dark:"#007FAE"},"interactive-content-disabled":{light:"#0000003f",dark:"#ffffff3f"},"interactive-background-disabled":{light:"#0000000c",dark:"#ffffff0c"},"interactive-pressed":{light:"#00000028",dark:"#ffffff28"},"neutral-content":{light:"#2A3C42",dark:"#B8C5C9"},"neutral-content-disabled":{light:"#D6D6D6",dark:"#303030"},"neutral-content-weak":{light:"#576F76",dark:"#82959B"},"neutral-content-strong":{light:"#0F1A1C",dark:"#F2F4F5"},"neutral-background":{light:"#ffffff",dark:"#0B1416"},"neutral-background-selected":{light:"#EAEDEF",dark:"#1A282D"},"neutral-background-weak":{light:"#F9FAFA",dark:"#04090A"},"neutral-background-medium":{light:"#F8F8F8",dark:"#131313"},"neutral-background-strong":{light:"#ffffff",dark:"#0F1A1C"},"neutral-background-hover":{light:"#F2F4F5",dark:"#131F23"},"neutral-border":{light:"#00000033",dark:"#ffffff33"},"neutral-border-medium":{light:"#0000007f",dark:"#ffffff7f"},"neutral-border-weak":{light:"#00000019",dark:"#ffffff19"},"neutral-border-strong":{light:"#0F1A1C",dark:"#F2F4F5"},primary:{light:"#0045AC",dark:"#629FFF"},"primary-hover":{light:"#003584",dark:"#A7CCFF"},"primary-visited":{light:"#8700B5",dark:"#D55EFF"},"primary-onBackground":{light:"#ffffff",dark:"#ffffff"},"primary-onBackground-selected":{light:"#ffffff",dark:"#000000"},"primary-background":{light:"#0045AC",dark:"#0045AC"},"primary-background-hover":{light:"#003584",dark:"#1870F4"},"primary-background-selected":{light:"#00255D",dark:"#629FFF"},secondary:{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-hover":{light:"#000000",dark:"#ffffff"},"secondary-weak":{light:"#576F76",dark:"#82959B"},"secondary-onBackground":{light:"#000000",dark:"#ffffff"},"secondary-background":{light:"#EAEDEF",dark:"#1A282D"},"secondary-background-hover":{light:"#E2E7E9",dark:"#223237"},"secondary-background-selected":{light:"#D2DADD",dark:"#33464C"},"secondary-plain":{light:"#0F1A1C",dark:"#F2F4F5"},"secondary-plain-hover":{light:"#000000",dark:"#ffffff"},"danger-background":{light:"#EB001F",dark:"#A50016"},"danger-background-disabled":{light:"#FFCCD2",dark:"#3A0008"},"danger-background-hover":{light:"#A50016",dark:"#EB001F"},"danger-onBackground":{light:"#ffffff",dark:"#ffffff"},"danger-content":{light:"#A50016",dark:"#FF6E80"},"danger-content-hover":{light:"#7E0011",dark:"#FFADB8"},"danger-content-default":{light:"#ffffff",dark:"#ffffff"},"brand-background":{light:"#D93A00",dark:"#D93A00"},"brand-onBackground":{light:"#ffffff",dark:"#ffffff"},"brand-background-hover":{light:"#962900",dark:"#962900"},"media-background":{light:"#00000099",dark:"#00000099"},"media-onbackground":{light:"#ffffff",dark:"#ffffff"},"media-onbackground-weak":{light:"#E2E7E9",dark:"#E2E7E9"},"media-background-hover":{light:"#000000cc",dark:"#000000cc"},"media-onbackground-disabled":{light:"#ffffff3f",dark:"#ffffff3f"},"media-border-selected":{light:"#ffffff",dark:"#ffffff"},"media-background-selected":{light:"#000000cc",dark:"#000000cc"},"success-content":{light:"#0A6000",dark:"#55BD46"},"success-hover":{light:"#084A00",dark:"#A3E398"},"success-onBackground":{light:"#ffffff",dark:"#ffffff"},"success-background":{light:"#0E8A00",dark:"#0A6000"},"success-background-hover":{light:"#0A6000",dark:"#0E8A00"},"warning-content":{light:"#665505",dark:"#DBAF00"},"warning-content-hover":{light:"#504104",dark:"#FADB61"},"warning-onBackground":{light:"#000000",dark:"#000000"},"warning-background":{light:"#DBAF00",dark:"#DBAF00"},"warning-background-hover":{light:"#8F7407",dark:"#FADB61"},"upvote-content":{light:"#962900",dark:"#FE7C53"},"upvote-content-weak":{light:"#FF4500",dark:"#FF4500"},"upvote-disabled":{light:"#9629004c",dark:"#FE7C534c"},"upvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"upvote-background":{light:"#D93A00",dark:"#D93A00"},"upvote-background-hover":{light:"#962900",dark:"#962900"},"upvote-background-disabled":{light:"#D93A004c",dark:"#D93A004c"},"downvote-content":{light:"#453BB5",dark:"#988EFF"},"downvote-content-weak":{light:"#6A5CFF",dark:"#6A5CFF"},"downvote-disabled":{light:"#453BB54c",dark:"#988EFF4c"},"downvote-onBackground":{light:"#ffffff",dark:"#ffffff"},"downvote-background":{light:"#6A5CFF",dark:"#453BB5"},"downvote-background-hover":{light:"#453BB5",dark:"#453BB5"},"downvote-background-disabled":{light:"#6A5CFF4c",dark:"#6A5CFF4c"},"brand-gradient-default":{light:"",dark:""},"brand-gradient-default-highlight":{light:"",dark:""},"brand-gradient-hover":{light:"",dark:""},"brand-gradient-hover-highlight":{light:"",dark:""},"brand-gradient-active":{light:"",dark:""},"brand-gradient-active-highlight":{light:"",dark:""},"gradient-media":{light:"",dark:""},"gradient-media-strong":{light:"",dark:""},"transparent-background-hover":{light:"#82959B19",dark:"#667A8019"},"global-black":{light:"#000000",dark:"#000000"},"global-white":{light:"#ffffff",dark:"#ffffff"},"global-orangered":{light:"#D93A00",dark:"#D93A00"},"global-alienblue":{light:"#1870F4",dark:"#1870F4"},"global-darkblue":{light:"#131F23",dark:"#131F23"},"tone-1":{light:"#131313",dark:"#F2F2F2"},"tone-2":{light:"#434343",dark:"#ACACAC"},"tone-3":{light:"#ACACAC",dark:"#434343"},"tone-4":{light:"#E4E4E4",dark:"#303030"},"tone-5":{light:"#F2F2F2",dark:"#1E1E1E"},"tone-6":{light:"#F8F8F8",dark:"#131313"},"tone-7":{light:"#ffffff",dark:"#080808"},"action-upvote":{light:"#D93A00",dark:"#D93A00"},"action-downvote":{light:"#6A5CFF",dark:"#6A5CFF"},"alert-caution":{light:"#8F7407",dark:"#8F7407"},"identity-admin":{light:"#D93A00",dark:"#D93A00"},"identity-moderator":{light:"#0E8A00",dark:"#0E8A00"},"identity-self":{light:"#008675",dark:"#008675"},"identity-coins":{light:"#DBAF00",dark:"#DBAF00"},"category-live":{light:"#D93A00",dark:"#D93A00"},"category-nsfw":{light:"#E00096",dark:"#E00096"},"category-spoiler":{light:"#131313",dark:"#F2F2F2"},"ui-canvas":{light:"#F2F2F2",dark:"#080808"},"ui-modalbackground":{light:"#ffffff",dark:"#0F1A1C"},"avatar-gradient":{light:"",dark:""},"opacity-highlight":{light:"",dark:""},"opacity-08":{light:"#13131314",dark:"#13131314"},"opacity-50":{light:"#0000007f",dark:"#F2F2F27f"},scrim:{light:"#00000099",dark:"#00000099"},"scrim-strong":{light:"#000000cc",dark:"#000000cc"},"scrim-gradient":{light:"",dark:""},online:{light:"#55BD46",dark:"#55BD46"},favorite:{light:"#8F7407",dark:"#DBAF00"}};var Ev={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",transparent:"#FFFFFF00",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},Tv=r=>!!r.match(/^(#[0-9a-fA-F]{3,8}).*/),Rv=r=>r in Mc,Lc=r=>r in Ev,Fv=r=>!!r.match(/^rgba?\(.*/),Bv=r=>!!r.match(/^hsla?\(.*/),Ov=(r,e="light")=>{if(Lc(r))return vd(r);let i=Mc[r];return typeof i=="string"?i:i[e]},vd=r=>Ev[r]??r,Uv=r=>{let[e,t,i,n]=r.replace(/^rgba?\(|\s+|\)$/g,"").split(",");if(!e||!t||!i)return r;let a=[...[e,t,i].map(p=>parseFloat(p))];if(n){let p=parseFloat(n),f=Math.round(p*255);a.push(f)}return`#${a.map(p=>p.toString(16).padStart(2,"0")).join("")}`};var Hv="data-",fi=class{async createBlocksElementOrThrow({type:e,props:t,children:i}){let n=await this.createBlocksElement({type:e,props:t,children:i});if(!n)throw new Error(`Could not create block of type ${e}`);return n}async createBlocksElement({type:e,props:t,children:i}){switch(e){case"blocks":return this.makeRoot(t,...i);case"hstack":return this.makeHStack(t,...i);case"vstack":return this.makeVStack(t,...i);case"zstack":return this.makeZStack(t,...i);case"text":return this.makeText(t,...i);case"button":return this.makeButton(t,...i);case"image":return await this.makeImage(t);case"spacer":return this.makeSpacer(t);case"icon":return this.makeIcon(t);case"avatar":return this.makeAvatar(t);case"fullsnoo":return this.makeFullSnoo(t);case"animation":return await this.makeAnimation(t);case"webview":return this.makeWebView(t);case"__fragment":throw new Error("root fragment is not supported - use 'blocks' instead")}}makeRootHeight(e){switch(e){case"regular":return 320;case"tall":return 512}}makeBlockPadding(e){switch(e){case"none":return ns.PADDING_NONE;case"xsmall":return ns.PADDING_XSMALL;case"small":return ns.PADDING_SMALL;case"medium":return ns.PADDING_MEDIUM;case"large":return ns.PADDING_LARGE}}makeBlockRadius(e){switch(e){case"none":return ss.RADIUS_NONE;case"small":return ss.RADIUS_SMALL;case"medium":return ss.RADIUS_MEDIUM;case"large":return ss.RADIUS_LARGE;case"full":return ss.RADIUS_FULL}}makeBlockGap(e){switch(e){case"none":return Pd.GAP_NONE;case"small":return Pd.GAP_SMALL;case"medium":return Pd.GAP_MEDIUM;case"large":return Pd.GAP_LARGE}}makeBlockAlignment(e){if(e===void 0)return;let t,i;if(e.includes("top")?t=Vc.ALIGN_TOP:e.includes("middle")?t=Vc.ALIGN_MIDDLE:e.includes("bottom")&&(t=Vc.ALIGN_BOTTOM),e.includes("start")?i=_c.ALIGN_START:e.includes("center")?i=_c.ALIGN_CENTER:e.includes("end")&&(i=_c.ALIGN_END),t!==void 0||i!==void 0)return{vertical:t,horizontal:i}}makeBlockBorder(e,t,i,n){if(!e&&!t)return;let o;switch(e){case"none":o=bd.BORDER_WIDTH_NONE;break;case"thin":o=bd.BORDER_WIDTH_THIN;break;case"thick":o=bd.BORDER_WIDTH_THICK;break;default:o=bd.BORDER_WIDTH_THIN;break}let a=t??"neutral-border-weak",u=this.getThemedColors(a,i,n);return{width:o,color:u?.light,colors:u}}makeBlockTextSize(e){switch(e){case"xsmall":return pi.TEXT_SIZE_XSMALL;case"small":return pi.TEXT_SIZE_SMALL;case"medium":return pi.TEXT_SIZE_MEDIUM;case"large":return pi.TEXT_SIZE_LARGE;case"xlarge":return pi.TEXT_SIZE_XLARGE;case"xxlarge":return pi.TEXT_SIZE_XXLARGE}}makeBlockTextStyle(e){switch(e){case"body":return Gc.TEXT_STYLE_BODY;case"metadata":return Gc.TEXT_STYLE_METADATA;case"heading":return Gc.TEXT_STYLE_HEADING}}makeBlockTextOutline(e){switch(e){case"none":return jc.TEXT_OUTLINE_NONE;case"thin":return jc.TEXT_OUTLINE_THIN;case"thick":return jc.TEXT_OUTLINE_THICK}}makeBlockTextWeight(e){switch(e){case"regular":return qv.TEXT_WEIGHT_REGULAR;case"bold":return qv.TEXT_WEIGHT_BOLD}}makeBlockTextOverflow(e){switch(e){case"clip":return Wc.TEXT_OVERFLOW_CLIP;case"ellipsis":return Wc.TEXT_OVERFLOW_ELLIPSE}return Wc.TEXT_OVERFLOW_ELLIPSE}makeBlockButtonAppearance(e){switch(e){case"secondary":return Tt.BUTTON_APPEARANCE_SECONDARY;case"primary":return Tt.BUTTON_APPEARANCE_PRIMARY;case"plain":return Tt.BUTTON_APPEARANCE_PLAIN;case"bordered":return Tt.BUTTON_APPEARANCE_BORDERED;case"media":return Tt.BUTTON_APPEARANCE_MEDIA;case"destructive":return Tt.BUTTON_APPEARANCE_DESTRUCTIVE;case"caution":return Tt.BUTTON_APPEARANCE_CAUTION;case"success":return Tt.BUTTON_APPEARANCE_SUCCESS}}makeBlockButtonSize(e){switch(e){case"small":return Dc.BUTTON_SIZE_SMALL;case"medium":return Dc.BUTTON_SIZE_MEDIUM;case"large":return Dc.BUTTON_SIZE_LARGE}}makeBlockImageResizeMode(e){switch(e){case"none":return is.IMAGE_RESIZE_NONE;case"fit":return is.IMAGE_RESIZE_FIT;case"fill":return is.IMAGE_RESIZE_FILL;case"cover":return is.IMAGE_RESIZE_COVER;case"scale-down":return is.IMAGE_RESIZE_SCALE_DOWN}}makeBlockSpacerSize(e){switch(e){case"xsmall":return Sd.SPACER_XSMALL;case"small":return Sd.SPACER_SMALL;case"medium":return Sd.SPACER_MEDIUM;case"large":return Sd.SPACER_LARGE}}makeBlockSpacerShape(e){switch(e){case"invisible":return qc.SPACER_INVISIBLE;case"thin":return qc.SPACER_THIN;case"square":return qc.SPACER_SQUARE}}makeBlockIconSize(e){switch(e){case"xsmall":return kd.ICON_SIZE_XSMALL;case"small":return kd.ICON_SIZE_SMALL;case"medium":return kd.ICON_SIZE_MEDIUM;case"large":return kd.ICON_SIZE_LARGE}}makeBlockAvatarSize(e){switch(e){case"xxsmall":return Et.AVATAR_SIZE_XXSMALL;case"xsmall":return Et.AVATAR_SIZE_XSMALL;case"small":return Et.AVATAR_SIZE_SMALL;case"medium":return Et.AVATAR_SIZE_MEDIUM;case"large":return Et.AVATAR_SIZE_LARGE;case"xlarge":return Et.AVATAR_SIZE_XXLARGE;case"xxlarge":return Et.AVATAR_SIZE_XXLARGE;case"xxxlarge":return Et.AVATAR_SIZE_XXXLARGE}}makeBlockAvatarFacing(e){switch(e){case"left":return Nv.AVATAR_FACING_LEFT;case"right":return Nv.AVATAR_FACING_RIGHT}}makeBlockFullSnooSize(e){switch(e){case"xsmall":return mi.FULLSNOO_XSMALL;case"small":return mi.FULLSNOO_SMALL;case"medium":return mi.FULLSNOO_MEDIUM;case"large":return mi.FULLSNOO_LARGE;case"xlarge":return mi.FULLSNOO_XLARGE;case"xxlarge":return mi.FULLSNOO_XXLARGE}}makeBlockAvatarBackground(e){switch(e){case"dark":return _v.AVATAR_BG_DARK;case"light":return _v.AVATAR_BG_LIGHT}}makeBlockAnimationType(e){return e==="lottie"||e===void 0?Dv.ANIM_LOTTIE:Dv.UNRECOGNIZED}makeBlockAnimationDirection(e){switch(e){case"backward":return Mv.ANIM_DIR_BACKWARD;case"forward":return Mv.ANIM_DIR_FORWARD}}makeBlockLoopMode(e){switch(e){case"repeat":return Lv.ANIM_LOOP_REPEAT;case"bounce":return Lv.ANIM_LOOP_BOUNCE}}makeBlockSize(e){if(e&&(e.width!=null||e.height!=null||e.grow)){let{value:t,unit:i}=this.parseSize(e.width)??{},{value:n,unit:o}=this.parseSize(e.height)??{};return{width:t,widthUnit:i,height:n,heightUnit:o,grow:e.grow}}}makeBlockSizes(e){if(e){let t=e.width!=null||e.minWidth!=null||e.maxWidth!=null,i=e.height!=null||e.minHeight!=null||e.maxHeight!=null;if(t||i||e.grow!=null)return{width:t?{value:this.parseSize(e.width),min:this.parseSize(e.minWidth),max:this.parseSize(e.maxWidth)}:void 0,height:i?{value:this.parseSize(e.height),min:this.parseSize(e.minHeight),max:this.parseSize(e.maxHeight)}:void 0,grow:e.grow}}}parseSize(e){if(e==null)return;if(typeof e=="number")return{value:e,unit:Nc.SIZE_UNIT_PERCENT};let t=e.match(/^(\d+(?:\.\d+)?)(px|%)?$/);if(t==null)return;let i=Nc.SIZE_UNIT_PERCENT;return t?.at(2)==="px"&&(i=Nc.SIZE_UNIT_PIXELS),{value:Number.parseFloat(t[1]),unit:i}}getDataSet(e){return Object.keys(e).filter(t=>t.startsWith(Hv)).reduce((t,i)=>(t[i.substring(Hv.length)]=e[i],t),{})}makeActions(e,t){let i=[],n=this.getDataSet(t);if(t.onPress){let o=t.onPress;i.push({type:YE.ACTION_CLICK,id:o.toString(),data:n})}return i}blockColorToHex(e,t="light"){if(e)return e=e.toLowerCase(),Tv(e)?e:Rv(e)?Ov(e,t):Lc(e)?vd(e):Fv(e)?Uv(e):Bv(e)?e:(console.warn(`Could not parse color: ${e}.`),vd("red"))}async childrenToBlocks(e){let t=e.map(n=>{if(typeof n!="string")return this.createBlocksElement(n)});return(await Promise.all(t)).filter(n=>n!==void 0)}getThemedColors(e,t,i){let n=this.blockColorToHex(t,"light"),o=this.blockColorToHex(i,"dark"),a=[];if(e&&(!n||!o)){let u=Array.from(e?.matchAll(/[\w#-]+(?:\([\w\t ,.#-]+\))?/g)??[]);a.push(...u.map(p=>p[0]))}return n||(n=this.blockColorToHex(a?.at(0),"light")),o||(o=this.blockColorToHex(a?.at(1)??a?.at(0),"dark")),n||o?{light:n,dark:o}:void 0}parsePixels(e){return typeof e=="string"?Number(e.slice(0,-2)):e}childrenToString(e){return e.map(t=>t.toString()).join("")}async makeRoot(e,...t){return this.wrapRoot(e,await this.childrenToBlocks(t))}async wrapRoot(e,t){return this.makeBlock(_e.BLOCK_ROOT,{},{rootConfig:{children:t,height:this.makeRootHeight(m.customPostType?.height??e?.height??"regular")}})}async makeStackBlock(e,t,i){let n=this.getThemedColors(t?.backgroundColor,t?.lightBackgroundColor,t?.darkBackgroundColor);return this.makeBlock(_e.BLOCK_STACK,t,{stackConfig:{alignment:this.makeBlockAlignment(t?.alignment),backgroundColor:n?.light,backgroundColors:n,border:this.makeBlockBorder(t?.border,t?.borderColor,t?.lightBorderColor,t?.darkBorderColor),children:await this.childrenToBlocks(i),cornerRadius:this.makeBlockRadius(t?.cornerRadius),direction:e,gap:this.makeBlockGap(t?.gap),padding:this.makeBlockPadding(t?.padding),reverse:t?.reverse}})}async makeHStack(e,...t){return this.makeStackBlock(Hc.STACK_HORIZONTAL,e,t)}async makeVStack(e,...t){return this.makeStackBlock(Hc.STACK_VERTICAL,e,t)}async makeZStack(e,...t){return this.makeStackBlock(Hc.STACK_DEPTH,e,t)}makeText(e,...t){let i=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return this.makeBlock(_e.BLOCK_TEXT,e,{textConfig:{alignment:this.makeBlockAlignment(e?.alignment),color:i?.light,colors:i,outline:this.makeBlockTextOutline(e?.outline),size:this.makeBlockTextSize(e?.size),style:this.makeBlockTextStyle(e?.style),text:this.childrenToString(t),weight:this.makeBlockTextWeight(e?.weight),selectable:e?.selectable,wrap:e?.wrap,overflow:this.makeBlockTextOverflow(e?.overflow)}})}makeButton(e,...t){let i=this.getThemedColors(e?.textColor,e?.lightTextColor,e?.darkTextColor);return this.makeBlock(_e.BLOCK_BUTTON,e,{buttonConfig:{buttonAppearance:this.makeBlockButtonAppearance(e?.appearance),icon:e?.icon,buttonSize:this.makeBlockButtonSize(e?.size),text:this.childrenToString(t),textColor:i?.light,textColors:i,disabled:e?.disabled}})}async makeImage(e){return e&&this.makeBlock(_e.BLOCK_IMAGE,e,{imageConfig:{description:e?.description,resizeMode:this.makeBlockImageResizeMode(e.resizeMode),url:e.url,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight)}})}makeSpacer(e){return this.makeBlock(_e.BLOCK_SPACER,e,{spacerConfig:{size:this.makeBlockSpacerSize(e?.size),shape:this.makeBlockSpacerShape(e?.shape)}})}makeIcon(e){let t=this.getThemedColors(e?.color,e?.lightColor,e?.darkColor);return e&&this.makeBlock(_e.BLOCK_ICON,e,{iconConfig:{icon:e.name,color:t?.light,colors:t,size:this.makeBlockIconSize(e.size)}})}makeAvatar(e){return e&&this.makeBlock(_e.BLOCK_AVATAR,e,{avatarConfig:{thingId:e.thingId,size:this.makeBlockAvatarSize(e.size),facing:this.makeBlockAvatarFacing(e.facing),background:this.makeBlockAvatarBackground(e.background)}})}makeFullSnoo(e){return e&&this.makeBlock(_e.BLOCK_FULLSNOO,e,{fullsnooConfig:{userId:e.userId,facing:this.makeBlockAvatarFacing(e.facing),size:this.makeBlockFullSnooSize(e.size)}})}async makeAnimation(e){return e&&this.makeBlock(_e.BLOCK_ANIMATION,e,{animationConfig:{type:this.makeBlockAnimationType(e.type),url:e.url,loop:e.loop,loopMode:this.makeBlockLoopMode(e.loopMode),autoplay:e.autoplay,width:this.parsePixels(e.imageWidth),height:this.parsePixels(e.imageHeight),direction:this.makeBlockAnimationDirection(e.direction),speed:e.speed}})}makeWebView(e){return e&&this.makeBlock(_e.BLOCK_WEBVIEW,e,{webviewConfig:{url:e.url}})}makeBlock(e,t,i){return{type:e,size:this.makeBlockSize(t),sizes:this.makeBlockSizes(t),config:i,actions:(t&&this.makeActions(e,t))??[],id:t?.id,key:t?.key}}async ensureRootBlock(e){let t=e;if(t.type===_e.BLOCK_ROOT)return t.config?.rootConfig&&m.customPostType?.height&&(t.config.rootConfig.height=this.makeRootHeight(m.customPostType?.height)),t;let i=await this.wrapRoot(void 0,[t]);if(!i)throw new Error("Could not create root block");return i}};function Wv(r){if(typeof r=="string")throw new Error("Root element cannot be a string")}var Gv=r=>{let e="",t=r.props?Object.keys(r.props).map(i=>i==="onPress"?"":`${i}="${r.props[i]}"`).join(" "):"";e+=`<${r.type}${t?" "+t:""}>`;for(let i of r.children)typeof i=="string"?e+=i:e+=Gv(i);return e+=`</${r.type}>`,e};function eT(r){return" ".repeat(r)}function tT(r){let e="",t=0,i=r.split(/>\s*</);for(let n=0;n<i.length;n++){let o=i[n];n===0&&(o=o.trim()),n===i.length-1&&(o=o.trim());let a=o.charAt(0)==="/";a&&t--,e+=eT(t),n!==0&&(e+="<"),e+=o,n!==i.length-1&&(e+=`>
2
2
  `),!a&&o.indexOf("</")===-1&&o.charAt(o.length-1)!=="/"&&t++}return e}var wd,Vv,ur,os,as,$c,ds,lt=class{constructor(e,t,i,n,o){l(this,wd);l(this,ur);l(this,as);this.renderState={};this.currentComponentKey=[];this.currentHookIndex=0;this.actions=new Map;this.forms=new Map;this.realtimeChannels=[];this.realtimeUpdated=!1;this.pendingHooks=[];this.isRendering=!1;this.transformer=new fi;this.effects=[];l(this,ds,!1);this.component=e,this.event=t,this.state={__renderState:{},...i},this.metadata=n,this.state.__realtimeChannels&&(this.realtimeChannels=this.state.__realtimeChannels);let a=De({reconciler:this,hooks:!0,ui:!0,metadata:n});this.cache=a.cache,this.modLog=a.modLog,this.reddit=a.reddit,this.kvStore=a.kvStore,this.redis=a.redis,this.settings=a.settings,this.scheduler=a.scheduler,this.media=a.media,this.assets=a.assets,this.realtime=a.realtime,this.dimensions=o,this.ui=a.ui,this.hooks={useState:a.useState,useInterval:a.useInterval,useForm:a.useForm,useChannel:a.useChannel}}emitEffect(e,t){this.effects.push(t)}async render(){await this.reconcile(),this.isRendering=!0;let e=await this.buildBlocksUI();return this.isRendering=!1,e}makeUniqueActionID(e){let t=e,i=1;for(;this.actions.has(t);)t=`${e}.${i++}`;return t}async reconcile(){let e={type:this.component,props:k(this,ur,os).call(this),children:[]},t=await this.processBlock(e);if(Wv(t),await this.transformer.createBlocksElementOrThrow(t),this.isUserActionRender&&this.blockRenderEventId){let i=this.actions.get(this.blockRenderEventId);i&&await i({})}for(let i of this.pendingHooks)await i();this.buildNextState(),k(this,wd,Vv).call(this)}async buildBlocksUI(){let e={type:this.component,props:k(this,ur,os).call(this),children:[]},t=await this.renderElement(e);return this.transformer.ensureRootBlock(t)}async renderElement(e){let t=await this.processBlock(e);return Wv(t),(m.debug.emitSnapshots||ve(ie.DebugRenderXML,this.metadata))&&console.log(tT(Gv(t))),m.debug.emitState&&console.log(JSON.stringify(this.state,null,2)),await this.transformer.createBlocksElementOrThrow(t)}async processProps(e){if(e.onPress){let t=e.onPress,i=t.name,n=this.makeUniqueActionID(`${QE.BLOCK_BUTTON}.${i??"onPress"}`);this.actions.set(n,t),e.onPress=n}e.url&&(e.url=await this.getAssetUrl(e.url))}async getAssetUrl(e){let t,i=globalThis?.devvit?.config?.assets;if(i&&(t=i[e]),!t&&!Cv(e)){console.log("No assets loaded on the config - falling back to plugin");try{t=await this.assets.getURL(e),i&&t&&(i[e]=t)}catch{}}return t??e}async processBlock(e,t=Av(),i=[]){let n=e;if(typeof n.type=="string"){let p=(await Promise.all(n.children.flatMap(async(c,h)=>c==null?[]:await this.processBlock(c,t,[...i,`${n.type}.${h}`])))).flat(),f=k(this,as,$c).call(this,p);return await this.processProps(n.props||{}),{type:n.type,props:n.props,children:f}}if(typeof n.type=="function"){let u=t(`${i.length?i.join("."):"root"}.${n.type.name.length?n.type.name:"anonymous"}`);this.currentComponentKey.push(u),this.renderState[u]||(this.renderState[u]={});let p=n.children.flatMap(c=>c),f={...k(this,ur,os).call(this),...n.props,children:p},g;for(;g===void 0;)try{g=await n.type(f,k(this,ur,os).call(this))}catch(c){if(c instanceof Promise)g=await c;else throw c}if(!this.isInitialRender){let c=this.getPreviousComponentState();if(Object.keys(c).length!==this.currentHookIndex)throw new Error("Invalid hook call. Hooks can only be called at the top-level of a function component. Make sure that you are not calling hooks inside loops, conditions, or nested functions.")}if(this.currentComponentKey.pop(),this.currentHookIndex=0,typeof g=="object")return this.processBlock(g,t,[...i,n.type.name])}if(typeof n=="string")return n;if(typeof n=="number")return`${n}`;let o=[],a="";return Array.isArray(n)?o=n:typeof n.type>"u"&&n.children&&(o=n.children,a="fragmentChild."),{type:"__fragment",props:void 0,children:await Promise.all(o.flatMap(async(u,p)=>await this.processBlock(u,t,[...i,`${a}${p}`])))}}getCurrentComponentKey(){if(!this.currentComponentKey.at(-1))throw new Error("Current component key is missing");return this.currentComponentKey}getCurrentComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.renderState[e]}getPreviousComponentState(){let e=this.currentComponentKey.at(-1);if(!e)throw new Error("Current component key is missing");return this.state.__renderState[e]||(this.state.__renderState[e]={}),this.state.__renderState[e]}get isInitialRender(){return this.event?this.event.type===zc.RENDER_INITIAL:!1}get isUserActionRender(){return this.event?this.event.type===zc.RENDER_USER_ACTION:!1}get isEffectRender(){return this.event?this.event.type===zc.RENDER_EFFECT_EVENT:!1}get formSubmittedEvent(){return this.event?this.event.formSubmitted:!1}get blockRenderEventId(){return this.event?this.event.id:!1}get realtimeEvent(){if(!this.event)return!1;let e=this.event.realtimeEvent;return e?.event?.channel?e:!1}runHook(e){this.pendingHooks.push(e)}rerenderIn(e){s(this,ds)||(d(this,ds,!0),this.effects.push({type:jv.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:e/1e3}}))}addRealtimeChannel(e){this.realtimeChannels.push(e),this.realtimeUpdated=!0}removeRealtimeChannel(e){this.realtimeChannels=this.realtimeChannels.filter(t=>t!==e),this.realtimeUpdated=!0}get realtimeEffect(){return this.realtimeUpdated&&this.realtimeChannels.length>0?[{type:jv.EFFECT_REALTIME_SUB,realtimeSubscriptions:{subscriptionIds:this.realtimeChannels}}]:[]}getEffects(){return[...ci(this.ui),...this.effects,...this.realtimeEffect]}buildNextState(){for(let e of Object.keys(this.renderState))this.renderState[e]=Object.values(this.renderState[e]);this.state={__postData:this.state.__postData,__renderState:this.renderState,__cache:this.state.__cache,...this.realtimeChannels.length>0?{__realtimeChannels:this.realtimeChannels}:{}}}};wd=new WeakSet,Vv=function(){this.actions.clear(),this.currentComponentKey=[],this.currentHookIndex=0,this.pendingHooks=[],this.realtimeChannels=[],this.realtimeUpdated=!1},ur=new WeakSet,os=function(){let e={...ue(this.metadata,this.state.__postData?.thingId),modLog:this.modLog,reddit:this.reddit,cache:this.cache,kvStore:this.kvStore,redis:this.redis,settings:this.settings,scheduler:this.scheduler,media:this.media,assets:this.assets,realtime:this.realtime,ui:this.ui,dimensions:this.dimensions,...this.hooks};return e.debug.effects=this,e},as=new WeakSet,$c=function(e){let t=[];for(let i of e)typeof i=="string"?t.push(i):i.type==="__fragment"?t.push(...k(this,as,$c).call(this,i.children)):t.push(i);return t},ds=new WeakMap;async function iT(r,e){let t=m.customPostType;if(!t)throw new Error("Custom post type not registered");let i=new lt((o,a)=>t.render(a),r.blocks,r.state,e,r.dimensions),n=await i.render();return{state:i.state,blocks:{ui:n},effects:i.getEffects()}}function zv(r){r.provides(rT),U("RenderPost",iT)}import{GetFieldsResponse as nT,InstallationSettingsDefinition as sT}from"@devvit/protos";async function oT(){if(!m.installationSettings)throw new Error("Installation settings were not defined.");return nT.fromPartial({fields:{fields:at(m.installationSettings)}})}async function aT(r,e){return yd(r,m.installationSettings,e)}function $v(r){r.provides(sT),U("GetSettingsFields",oT),U("ValidateForm",aT)}import{ContextActionDefinition as dT,ContextActionDescription as lT,ContextActionResponse as uT}from"@devvit/protos";var Jv=r=>`menuItem.${r}`;function Jc(r){return m.menuItems.find((e,t)=>Jv(t)===r)}async function cT(r,e){let t=m.menuItems;if(!t.length)throw new Error("No menu items registered.");return{actions:t.map((n,o)=>lT.fromPartial({actionId:Jv(o),name:n.label,description:n.description,contexts:{subreddit:n.location.includes("subreddit"),post:n.location.includes("post"),comment:n.location.includes("comment")},users:{loggedOut:n.forUserType?.includes("loggedOut"),member:n.forUserType?.includes("member"),moderator:n.forUserType?.includes("moderator")},postFilters:n.postFilter==="currentApp"?{currentApp:!0}:void 0}))}}async function mT(r,e){let t=Jc(r.actionId);if(!t)throw new Error(`MenuItem ${r.actionId} not found`);let i=r.comment?.id&&`t1_${r.comment.id}`,n=r.post?.id&&`t3_${r.post.id}`,o=r.subreddit?.id&&`t5_${r.subreddit.id}`,a=i||n||o;v(a,"targetId is missing from ContextActionRequest");let u={targetId:a,location:r.comment?"comment":r.post?"post":"subreddit"},p=Object.assign(De({ui:!0,metadata:e}),ue(e,n,i));return await t.onPress(u,p),uT.fromPartial({effects:ci(p.ui)})}function Kv(r){r.provides(dT),U("GetActions",cT),U("OnAction",mT)}function ut(r){return r?r===!0?!0:r.enabled:!1}import{SchedulerHandlerDefinition as pT}from"@devvit/protos";async function fT(r,e){let t=r.type,i=m.scheduledJobHandlers.get(t);if(!i)throw new Error(`Job ${t} not found`);let n={name:t,data:r.data},o=Object.assign(De({metadata:e}),ue(e));await i(n,o)}function Xv(r){r.provides(pT),U("HandleScheduledAction",fT)}import{HandlerResult as gT,OnAppInstallDefinition as hT,OnAppUpgradeDefinition as yT,OnCommentCreateDefinition as vT,OnCommentDeleteDefinition as bT,OnCommentReportDefinition as PT,OnCommentSubmitDefinition as kT,OnCommentUpdateDefinition as ST,OnModActionDefinition as wT,OnModMailDefinition as IT,OnPostCreateDefinition as xT,OnPostDeleteDefinition as CT,OnPostFlairUpdateDefinition as AT,OnPostReportDefinition as ET,OnPostSubmitDefinition as TT,OnPostUpdateDefinition as RT}from"@devvit/protos";function se(r,e){return v(e),async(t,i)=>{let n={...t,type:r},o=Object.assign(De({metadata:i}),ue(i)),a=await Promise.allSettled(e.map(p=>p(n,o))),u=FT(a);if(u)throw u.err;return gT.fromPartial({})}}function Zv(r){for(let e of m.triggerOnEventHandlers.keys())switch(e){case"PostSubmit":r.provides(TT),U("OnPostSubmit",se("PostSubmit",m.triggerOnEventHandlers.get(e)));break;case"PostCreate":r.provides(xT),U("OnPostCreate",se("PostCreate",m.triggerOnEventHandlers.get(e)));break;case"PostUpdate":r.provides(RT),U("OnPostUpdate",se("PostUpdate",m.triggerOnEventHandlers.get(e)));break;case"PostReport":r.provides(ET),U("OnPostReport",se("PostReport",m.triggerOnEventHandlers.get(e)));break;case"PostDelete":r.provides(CT),U("OnPostDelete",se("PostDelete",m.triggerOnEventHandlers.get(e)));break;case"PostFlairUpdate":r.provides(AT),U("OnPostFlairUpdate",se("PostFlairUpdate",m.triggerOnEventHandlers.get(e)));break;case"CommentSubmit":r.provides(kT),U("OnCommentSubmit",se("CommentSubmit",m.triggerOnEventHandlers.get(e)));break;case"CommentCreate":r.provides(vT),U("OnCommentCreate",se("CommentCreate",m.triggerOnEventHandlers.get(e)));break;case"CommentUpdate":r.provides(ST),U("OnCommentUpdate",se("CommentUpdate",m.triggerOnEventHandlers.get(e)));break;case"CommentReport":r.provides(PT),U("OnCommentReport",se("CommentReport",m.triggerOnEventHandlers.get(e)));break;case"CommentDelete":r.provides(bT),U("OnCommentDelete",se("CommentDelete",m.triggerOnEventHandlers.get(e)));break;case"AppInstall":r.provides(hT),U("OnAppInstall",se("AppInstall",m.triggerOnEventHandlers.get(e)));break;case"AppUpgrade":r.provides(yT),U("OnAppUpgrade",se("AppUpgrade",m.triggerOnEventHandlers.get(e)));break;case"ModAction":r.provides(wT),U("OnModAction",se("ModAction",m.triggerOnEventHandlers.get(e)));break;case"ModMail":r.provides(IT),U("OnModMail",se("ModMail",m.triggerOnEventHandlers.get(e)));break;default:throw new Error(`Unknown trigger event: ${e}`)}}function FT(r){let e=r.reduce((t,i)=>i.status==="rejected"?[...t,i.reason]:t,[]);if(e.length!==0)return e.length===1?{err:e[0]}:{err:new Error(e.map(t=>Gr.caughtToString(t)).join(`
3
3
  `))}}var Vb=An(lb(),1),zb=An(Gb(),1);import{EffectType as RF,UIEventHandlerDefinition as FF}from"@devvit/protos";async function BF(r,e){let t=r.state??{},i=(0,Vb.default)(t),n=De({ui:!0,metadata:e});if(r.event?.formSubmitted&&r.event.formSubmitted.formId){let p=r.event.formSubmitted.formId;if(p.includes("form.hook.")&&m.customPostType){let P=new lt((w,C)=>m.customPostType?.render(C)??null,r.event,r.state,e,void 0);return await P.reconcile(),{state:P.state,effects:P.getEffects()}}let f=m.formDefinitions.get(p);if(!f)throw new Error(`Form with key ${p} not found`);let g,c;if(i.__contextAction){let{actionId:P,thingId:w}=i.__contextAction,C=Jc(P);C?.location==="post"?g=w:C?.location==="comment"&&(c=w)}let h=Object.assign(n,ue(e,g,c));await f.onSubmit({values:It(r.event.formSubmitted.results)},h)}else if(r.event?.realtimeEvent){if(m.customPostType){let p=new lt((f,g)=>m.customPostType?.render(g)??null,r.event,r.state,e,void 0);return await p.reconcile(),{state:p.state,effects:p.getEffects()}}}else if(r.event?.toastAction)throw new Error("Toast actions not yet implemented");let o=!(0,zb.default)(t,i),a=ci(n.ui),u=o?[...a,{type:RF.EFFECT_RERENDER_UI,rerenderUi:{delaySeconds:0}}]:a;return{state:i,effects:u}}function $b(r){r.provides(FF),U("HandleUIEvent",BF)}import{CustomPostDefinition as n0}from"@devvit/protos";import{EffectType as LF}from"@devvit/protos";import{EffectType as A_}from"@devvit/protos";var fs=class extends Error{};function Jb(r){let e=gr({namespace:"useState"},({changed:t})=>{let i=r instanceof Function?r():r;if(i instanceof Promise)throw new Error("Cannot use async initializer with useState, use useAsyncState instead.");return{state:i,setter:o=>{e.state=o instanceof Function?o(e.state):o,t()}}});return[e.state,e.setter]}import{EffectType as dm}from"@devvit/protos";var vi=class vi{constructor(e){this.request=e;this._segments=[];this._hooks={};this._prevHookId="";this._effects={};this._changed={};this._rootProps={};this._generated={};this._undeliveredHandlers={};this._state=e.state??{},this._rootProps=e.props??{}}get devvitContext(){if(!this._devvitContext)throw new Error("Devvit context not available");return this._devvitContext}set devvitContext(e){this._devvitContext=e}push(e){this._segments.push({...e,next:0})}pop(){this._segments.pop()}addUndeliveredEventHandler(e,t){this._undeliveredHandlers[e]=t}addGlobalUndeliveredEventHandler(e,t){vi.addGlobalUndeliveredEventHandler(e,t)}getHook(e){return this._hooks[e.id]}static addGlobalUndeliveredEventHandler(e,t){vi._staticUndeliveredHandlers[e]=t}async handleUndeliveredEvent(e){let t={...vi._staticUndeliveredHandlers,...this._undeliveredHandlers};for(let[i,n]of Object.entries(t))await n(e,this)}emitEffect(e,t){this._effects[e]=t}get effects(){return Object.values(this._effects)}nextHookId(e){e.key===void 0&&(e.key=this._segments[this._segments.length-1].next+++""),this.push(e);try{let t=[];for(let n=this._segments.length-1;n>=0;n--){let o=this._segments[n];if(o.id){t.unshift(o.id);break}let a=[];o.namespace&&a.push(o.namespace),o.key!==void 0&&o.key!==!1&&a.push(o.key),t.unshift(a.join("-"))}let i=t.join(".");if(this._generated[i]&&!e.shared)throw new Error(`Hook id ${i} already used, cannot register another hook with the same id`);return this._generated[i]=!0,this._prevHookId=i,i}finally{this.pop()}}};vi._staticUndeliveredHandlers={};var bi=vi;var Bt={};bi.addGlobalUndeliveredEventHandler("intervals",async(r,e)=>{r.timer&&r.hook&&(delete Bt[r.hook],e.emitEffect("timers",{type:dm.EFFECT_SET_INTERVALS,interval:{intervals:Bt}}))});var Ot,Pi,gs,ki,lm=class{constructor(e,t,i){l(this,Ot,void 0);l(this,Pi,void 0);l(this,gs,void 0);l(this,ki,void 0);this.state={duration:{seconds:0,nanos:0},running:!1};d(this,Pi,i.changed),d(this,Ot,i.hookId),d(this,gs,e),d(this,ki,i.context);let n=Math.floor(t/1e3),o=t%1e3*1e6;this.state.duration={seconds:n,nanos:o}}onLoad(){this.state.running?Bt[s(this,Ot)]={duration:this.state.duration}:delete Bt[s(this,Ot)]}async onUIEvent(e){await s(this,gs).call(this)}start(){Bt[s(this,Ot)]={duration:this.state.duration},this.state.running=!0,s(this,Pi).call(this),s(this,ki).emitEffect("timers",{type:dm.EFFECT_SET_INTERVALS,interval:{intervals:Bt}})}stop(){delete Bt[s(this,Ot)],this.state.running=!1,s(this,Pi).call(this),s(this,ki).emitEffect("timers",{type:dm.EFFECT_SET_INTERVALS,interval:{intervals:Bt}})}};Ot=new WeakMap,Pi=new WeakMap,gs=new WeakMap,ki=new WeakMap;function Kb(r,e){return gr({namespace:"useInterval"},t=>new lm(r,e,t))}import{EffectType as cm,Form as MF,ToastAppearance as Yb}from"@devvit/protos";var um=class{constructor(e,t,i){this.state=null;this.hookId=e.hookId,this.form=t,this.onSubmit=i,this.onUIEvent=async n=>{n.formSubmitted&&await i(It(n.formSubmitted.results))}}};function Xb(r,e){let t=gr({namespace:"useForm"},i=>new um(i,r,e));return OF({id:t.hookId})}function OF(r){return`form.hook.${r.id}.0`}function UF(r){return{id:r.match(/form\.hook\.(.+)\.0/)[1]}}function Zb(r,e){let t=UF(e);return r.getHook(t)}var Ut,Md=class{constructor(e){l(this,Ut,void 0);d(this,Ut,e)}showForm(e,t){let i=Zb(s(this,Ut),e);if(!i)throw new Error("Form does not exist. Make sure you have added it using useForm.");let n=i.form instanceof Function?i.form(t??{}):i.form,o=MF.fromPartial({id:e,title:n.title,acceptLabel:n.acceptLabel,cancelLabel:n.cancelLabel,shortDescription:n.description});ir(n.fields),o.fields=at(n.fields),s(this,Ut).emitEffect(e,{type:cm.EFFECT_SHOW_FORM,showForm:{form:o}})}showToast(e){let t;e instanceof Object?t={text:e.text,appearance:e.appearance==="success"?Yb.SUCCESS:Yb.NEUTRAL}:t={text:e},s(this,Ut).emitEffect(e.toString(),{type:cm.EFFECT_SHOW_TOAST,showToast:{toast:t}})}navigateTo(e){let t;typeof e=="string"?t=new URL(e).toString():t=new URL(e.permalink,"https://www.reddit.com").toString(),s(this,Ut).emitEffect(t,{type:cm.EFFECT_NAVIGATE_TO_URL,navigateToUrl:{url:t}})}};Ut=new WeakMap;var Qb=new Proxy({},{get:function(r,e,t){throw new Error(`Unimplemented API: ${String(e)}`)}}),Ld=class{buildContext(e,t){let i=new ti(t),n=new Qr(t),o=new si(t),a=new ii(t),u=new oi(t),p=new ai(t),f=new Md(e),g=new ei(t),c=new Yr(t,()=>m.assetsPlugin),h=new ui(t),C={modLog:i,kvStore:n,redis:o,reddit:a,scheduler:u,settings:p,media:g,assets:c,realtime:h,ui:f,useState:Jb,useChannel:Qb,useInterval:Kb,useForm:Xb,cache:Qb},E=ue(t);return E.debug.effects=e,{...E,...C}}};var ce=null;function e0(r){return JSON.parse(JSON.stringify(r))}function gr(r,e){if(!ce)throw new Error("Hooks can only be declared at the top of a component. You cannot declare hooks outside of components or inside of event handlers. It's almost always a mistake to declare hooks inside of loops or conditionals.");let t=ce.nextHookId(r),i=ce,n={hookId:t,changed:()=>{i._changed[t]=!0,i._state[t]=i?._hooks[t]?.state},context:ce},o=ce._state[t]===void 0;ce._hooks[t]=ce._hooks[t]??e(n);let a=ce._hooks[t];return ce._state[t]!==void 0&&(a.state=ce._state[t]),a.onLoad&&a.onLoad(ce),o&&a.state!==void 0&&a.state!==null&&n.changed(),a}var DF=null,Si,Nd,hs,ys,mm,qd,t0,vs,pm,Hd,r0,bs,fm,Ps,gm,wi,Dd,ks,hm,jd,i0,_d=class{constructor(e){l(this,ys);l(this,qd);l(this,vs);l(this,Hd);l(this,bs);l(this,Ps);l(this,wi);l(this,ks);l(this,jd);l(this,Si,void 0);l(this,Nd,new Ld);l(this,hs,new fi);this._latestRenderContext=null;d(this,Si,e),DF=this}async handle(e,t){let i=new bi(e),n=s(this,Nd).buildContext(i,t);i.devvitContext=n;let o,a=e.events,p=!e.events?.length||a.some(h=>!h.async),f=a.some(h=>h.blocking),g,c=[...a];for(;a.length>0;){let h=[];if(!a[0].async)h.push(a.shift());else for(;a[0]?.async;)h.push(a.shift());if(!h.length)throw Error("batch must have at least one event");try{if(h[0].async){let P=e0(i._state);await k(this,qd,t0).call(this,i,...h),i._state=P}else await k(this,Hd,r0).call(this,i,...h)}catch(P){if(g){i._state=g._state,i._effects=g._effects,c.forEach((w,C)=>{let E={type:LF.EFFECT_SEND_EVENT,sendEvent:{event:w,jumpsQueue:!0}};i.emitEffect(`remaining-${C}`,E)});break}else throw P}for(let[P,w]of Object.entries(i._effects))if(w.sendEvent?.event){if(!p&&!w.sendEvent?.event?.async||p&&w.sendEvent?.event?.async&&!f)break;let C=w.sendEvent.event;a.push(C),delete i._effects[P]}a.length>0&&(g={_state:e0(i._state),_effects:{...i._effects}},c=[...a])}if(p){let h=k(this,bs,fm).call(this,s(this,Si),i._rootProps??{},i);h&&(o=await s(this,hs).createBlocksElementOrThrow(h),o=await s(this,hs).ensureRootBlock(o))}return{state:i._state,effects:i.effects,blocks:o}}};Si=new WeakMap,Nd=new WeakMap,hs=new WeakMap,ys=new WeakSet,mm=function(e,...t){k(this,bs,fm).call(this,s(this,Si),e.request.props??{},e)},qd=new WeakSet,t0=async function(e,...t){k(this,ys,mm).call(this,e,...t),await Promise.all(t.map(async i=>{if(!i.async)throw new Error("You can't mix main and other queues in one batch. This is likely a platform bug. Please file an issue in the Discord for someone to help! https://discord.com/channels/1050224141732687912/1115441897079574620");await k(this,vs,pm).call(this,e,i)}))},vs=new WeakSet,pm=async function(e,t){let i=e._hooks[t.hook];if(i&&i.onUIEvent)try{await i.onUIEvent(t,e)}catch(n){throw console.error("Error in event handler",n),n}else await e.handleUndeliveredEvent(t)},Hd=new WeakSet,r0=async function(e,...t){for(let i of t)k(this,ys,mm).call(this,e,i),e._state.__generation=Number(e._state.__generation??0)+1,await k(this,vs,pm).call(this,e,i)},bs=new WeakSet,fm=function(e,t,i){i._generated={},ce=i,this._latestRenderContext=i;try{let n=k(this,Ps,gm).call(this,e,t,i);if(n.length!==1)throw new Error("only one root");let o=n[0];if(typeof o=="string")throw new Error("There must be a root tag. Try wrapping your app in a <text></text>, <vstack> or other tag.");return o}catch(n){if(n instanceof fs)return;throw n}finally{ce=null}},Ps=new WeakSet,gm=function(e,t,i){i.push({namespace:e.name,...t});try{let n=e(t,i.devvitContext);return k(this,ks,hm).call(this,n,i)}finally{i.pop()}},wi=new WeakSet,Dd=function(e,t){return e=e.flat(1/0),e.flatMap((i,n)=>(i&&typeof i=="object"&&"props"in i&&(i.props?.key||(i.props=i.props??{},i.props.key=n)),k(this,ks,hm).call(this,i,t)))},ks=new WeakSet,hm=function(e,t){if(Array.isArray(e))return k(this,wi,Dd).call(this,e,t);if(_F(e)){if(e.type===void 0)return k(this,wi,Dd).call(this,e.children,t);if(typeof e.type=="function"){let i={...e.props,children:e.children};return k(this,Ps,gm).call(this,e.type,i,t)}else{t.push({namespace:e.type,...e.props});let i=k(this,wi,Dd).call(this,e.children,t),n=k(this,jd,i0).call(this,e.props??{});return t.pop(),[{type:e.type,children:i,props:n}]}}else return[(e??"").toString()]},jd=new WeakSet,i0=function(e){let t={};for(let i in e)if(typeof e[i]=="function"){let n=gr({namespace:i,key:!1},({hookId:o})=>({hookId:o,state:null,onUIEvent:e[i]}));t[i]=n.hookId,"captureHookRef"in e[i]&&e[i].captureHookRef()}else{let n=e[i];n!=null&&(t[i]=n.toString())}return t};function _F(r){return typeof r=="object"&&r!=null&&"type"in r}var NF=[[n0,n0.methods.renderPostContent,(r,e)=>m.customPostType?.render(e)??null]];function qF(r){return async(e,t)=>new _d(r).handle(e,t)}function s0(r){for(let[e,t,i]of NF)r.provides(e),U(t.name,qF(i))}var Ss,Ii,hr,yr,vr,xi,Ci,Mt,br,M,N,G,_=class _ extends ed{static configure(e){d(this,Ss,e),ut(e.http)&&k(this,N,G).call(this,I.HTTPDefinition),(ut(e.kvStore)||ut(e.redis))&&(k(this,N,G).call(this,I.KVStoreDefinition),k(this,N,G).call(this,I.RedisAPIDefinition)),ut(e.media)&&k(this,N,G).call(this,I.MediaServiceDefinition),ut(e.modLog)&&k(this,N,G).call(this,I.ModlogDefinition),ut(e.redditAPI)&&(k(this,N,G).call(this,I.FlairDefinition),k(this,N,G).call(this,I.GraphQLDefinition),k(this,N,G).call(this,I.LinksAndCommentsDefinition),k(this,N,G).call(this,I.ListingsDefinition),k(this,N,G).call(this,I.ModerationDefinition),k(this,N,G).call(this,I.ModNoteDefinition),k(this,N,G).call(this,I.NewModmailDefinition),k(this,N,G).call(this,I.PrivateMessagesDefinition),k(this,N,G).call(this,I.SubredditsDefinition),k(this,N,G).call(this,I.PostCollectionsDefinition),k(this,N,G).call(this,I.UsersDefinition),k(this,N,G).call(this,I.WidgetsDefinition),k(this,N,G).call(this,I.WikiDefinition),k(this,N,G).call(this,I.RedditAPIV2Definition)),ut(e.realtime)&&k(this,N,G).call(this,I.RealtimeDefinition)}static addMenuItem(e){s(this,Ii).push(e)}static addCustomPostType(e){d(this,hr,e)}static createForm(e,t){let i=`form.${s(this,yr).size}`;return s(this,yr).set(i,{form:e,onSubmit:t}),i}static addSchedulerJob(e){if(s(this,M)[I.SchedulerDefinition.fullName]||k(this,N,G).call(this,I.SchedulerDefinition),s(this,vr).has(e.name))throw new Error(`Job ${e.name} is already defined`);s(this,vr).set(e.name,e.onRun)}static addSettings(e){ir(e);let t=e.filter(n=>n.type==="group"||!n.scope||n.scope==="installation"),i=e.filter(n=>n.type!=="group"&&n.scope==="app");t.length>0&&d(this,xi,t),i.length>0&&d(this,Ci,i),s(this,M)[I.SettingsDefinition.fullName]||k(this,N,G).call(this,I.SettingsDefinition)}static addTrigger(e){if("events"in e){for(let t of e.events)this.addTrigger({event:t,onEvent:(i,n)=>e.onEvent(i,n)});return this}return s(this,Mt).has(e.event)?s(this,Mt).get(e.event)?.push(e.onEvent):s(this,Mt).set(e.event,[e.onEvent]),_}static get redditAPIPlugins(){if(!ut(s(this,Ss).redditAPI))throw new Error("Reddit API is not enabled. You can enable it by passing `redditAPI: true` to `Devvit.configure`.");return{Flair:s(this,M)[I.FlairDefinition.fullName],GraphQL:s(this,M)[I.GraphQLDefinition.fullName],LinksAndComments:s(this,M)[I.LinksAndCommentsDefinition.fullName],Listings:s(this,M)[I.ListingsDefinition.fullName],Moderation:s(this,M)[I.ModerationDefinition.fullName],ModNote:s(this,M)[I.ModNoteDefinition.fullName],NewModmail:s(this,M)[I.NewModmailDefinition.fullName],PrivateMessages:s(this,M)[I.PrivateMessagesDefinition.fullName],Subreddits:s(this,M)[I.SubredditsDefinition.fullName],PostCollections:s(this,M)[I.PostCollectionsDefinition.fullName],Users:s(this,M)[I.UsersDefinition.fullName],Widgets:s(this,M)[I.WidgetsDefinition.fullName],Wiki:s(this,M)[I.WikiDefinition.fullName]}}static get modLogPlugin(){let e=s(this,M)[I.ModlogDefinition.fullName];if(!e)throw new Error("ModLog is not enabled. You can enable it by passing `modLog: true` to `Devvit.configure`");return e}static get schedulerPlugin(){let e=s(this,M)[I.SchedulerDefinition.fullName];if(!e)throw new Error("Scheduler is not enabled. You can enable it by calling `Devvit.addSchedulerJob` at the top level of your app.");return e}static get kvStorePlugin(){let e=s(this,M)[I.KVStoreDefinition.fullName];if(!e)throw new Error("Key Value Store is not enabled. You can enable it by passing `kvStore: true` to `Devvit.configure`");return e}static get redisPlugin(){let e=s(this,M)[I.RedisAPIDefinition.fullName];if(!e)throw new Error("Redis is not enabled. You can enable it by passing `redis: true` to `Devvit.configure`");return e}static get mediaPlugin(){let e=s(this,M)[I.MediaServiceDefinition.fullName];if(!e)throw new Error("MediaService is not enabled. You can enable it by passing `media: true` to `Devvit.configure`");return e}static get redditapiv2Plugin(){let e=s(this,M)[I.RedditAPIV2Definition.fullName];if(!e)throw new Error("RedditAPIV2 is not enabled. You can enable it by passing `apiV2: true` to `Devvit.configure`");return e}static get assetsPlugin(){let e=s(this,M)[I.AssetResolverDefinition.fullName];if(!e)throw new Error("AssetsService is not available. This should not happen, and indicates a setup problem with the runtime.");return e}static get settingsPlugin(){let e=s(this,M)[I.SettingsDefinition.fullName];if(!e)throw new Error("Settings is not enabled. You can enable it by passing `settings: true` to `Devvit.configure`");return e}static get realtimePlugin(){let e=s(this,M)[I.RealtimeDefinition.fullName];if(!e)throw new Error("Realtime is not enabled. You can enable it by passing `realtime: true` to `Devvit.configure`");return e}static get menuItems(){return s(this,Ii)}static get customPostType(){return s(this,hr)}static get formDefinitions(){return s(this,yr)}static get scheduledJobHandlers(){return s(this,vr)}static get installationSettings(){return s(this,xi)}static get appSettings(){return s(this,Ci)}static get triggerOnEventHandlers(){return s(this,Mt)}constructor(e){var t;super(e),k(t=_,N,G).call(t,I.AssetResolverDefinition);for(let i in s(_,br)){let n=s(_,br)[i];n.handler=e.use(n.def,n.options)}s(_,Ii).length>0&&Kv(e),s(_,vr).size>0&&Xv(e),s(_,hr)&&(zv(e),s0(e)),(s(_,hr)||s(_,yr).size>0)&&$b(e),s(_,xi)&&$v(e),s(_,Ci)&&Iv(e),s(_,Mt).size>0&&Zv(e)}};Ss=new WeakMap,Ii=new WeakMap,hr=new WeakMap,yr=new WeakMap,vr=new WeakMap,xi=new WeakMap,Ci=new WeakMap,Mt=new WeakMap,br=new WeakMap,M=new WeakMap,N=new WeakSet,G=function(e,t){s(this,br)[e.fullName]={def:e,options:t??{},handler:void 0};let i={};for(let n of Object.values(e.methods))i[n.name]=(o,a)=>s(this,br)[e.fullName].handler?.[n.name]?.(n.requestType?.fromPartial(o??{}),a);return s(this,M)[e.fullName]=i,i},l(_,N),_.debug={emitSnapshots:!1,emitState:!1},l(_,Ss,{}),l(_,Ii,[]),l(_,hr,void 0),l(_,yr,new Map),l(_,vr,new Map),l(_,xi,void 0),l(_,Ci,void 0),l(_,Mt,new Map),l(_,br,{}),l(_,M,{});var m=_;(e=>{function r(t,i,...n){return{type:t,props:i,children:n}}e.createElement=r})(m||(m={}));function $(r){let e=Object.getOwnPropertyDescriptors(r.constructor.prototype);for(let[t,i]of Object.entries(e))i.get&&Object.defineProperty(r,t,{...i,enumerable:!0})}var ym;(function(r){r[r.bold=1]="bold",r[r.italic=2]="italic",r[r.underline=4]="underline",r[r.strikethrough=8]="strikethrough",r[r.subscript=16]="subscript",r[r.superscript=32]="superscript",r[r.monospace=64]="monospace"})(ym||(ym={}));var o0="text",a0="raw",d0="br",l0="link",u0="c/",c0="p/",m0="r/",p0="u/",f0="@",g0="spoilertext",h0="par",y0="h",v0="hr",b0="blockquote",P0="code",k0="li",S0="list",w0="L",I0="R",x0="C",C0="table",A0="embed",E0="img",T0="gif",R0="video";function F0(r){return{e:T0,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function B0(r,e){let t={},i=[];return Object.assign(t,ws(t,i),Is(t,i),xs(t,i),Es(t,i),Ts(t,i),Rs(t,i)),e(t),{e:b0,c:i,...r.author&&{a:r.author}}}function O0(r,e){let t={},i=[];return Object.assign(t,bm(t,i)),e(t),{e:P0,c:i,...r.language&&{l:r.language}}}function U0(r){return{e:u0,t:r.permalink}}function M0(r,e){let t={},i=[];return Object.assign(t,bm(t,i),As(t,i)),e(t),{e:y0,l:r.level,c:i}}function L0(r){return{e:A0,u:r.sourceUrl,c:r.contentUrl,x:r.width,y:r.height}}function D0(){return{e:v0}}function _0(r){return{e:E0,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur}}}function N0(){return{e:d0}}function q0(r){return{e:l0,t:r.text,u:r.url,...r.formatting&&{f:r.formatting},...r.tooltip&&{a:r.tooltip}}}function H0(r,e){let t={},i=[];return Object.assign(t,iP(t,i)),e(t),{e:S0,o:r.ordered,c:i}}function j0(r){let e={},t=[];return Object.assign(e,ws(e,t),Is(e,t),xs(e,t),Wd(e,t),Es(e,t),Ts(e,t),Rs(e,t)),r(e),{e:k0,c:t}}function W0(r){let e={},t=[];return Object.assign(e,Gd(e,t),As(e,t),vm(e,t),Pm(e,t),Cs(e,t)),r(e),{e:h0,c:t}}function G0(r){return{e:c0,t:r.permalink}}function V0(r){return{e:a0,t:r}}function z0(r){let e={},t=[];return Object.assign(e,Gd(e,t),As(e,t),vm(e,t)),r(e),{e:g0,c:t}}function $0(r){return{e:m0,t:r.subredditName,l:r.showPrefix}}function J0(r){let e={},t=[],i=[];return Object.assign(e,nP(e,t,i)),r(e),{e:C0,h:t,c:i}}function K0(r){let[e,t]=rP();return r(e),{c:t}}function X0(r,e){let[t,i]=rP();e(t);let n;switch(r.columnAlignment){case"left":n=w0;break;case"right":n=I0;break;case"center":n=x0;break}return{...n&&{a:n},...i&&{c:i}}}function Z0(r){let e={},t=[];return Object.assign(e,sP(e,t)),r(e),t}function Y0(r){return{e:o0,t:r.text,...r.formatting&&{f:r.formatting}}}function Q0(r){return{e:p0,t:r.username,l:r.showPrefix}}function eP(r){return{e:f0,t:r.username,l:r.showPrefix}}function tP(r){return{e:R0,id:r.mediaId,...r.caption&&{c:r.caption},...r.blur&&{o:r.blur},...r.thumbnail&&{p:r.thumbnail},...r.convertToGif&&{gifify:r.convertToGif}}}function rP(){let r={},e=[];return Object.assign(r,Gd(r,e),As(r,e),Pm(r,e),Cs(r,e)),[r,e]}function ws(r,e){return{blockQuote(t,i){return e.push(B0(t,i)),r}}}function Is(r,e){return{codeBlock(t,i){return e.push(O0(t,i)),r}}}function oP(r,e){return{embed(t){return e.push(L0(t)),r}}}function xs(r,e){return{heading(t,i){return e.push(M0(t,i)),r}}}function Wd(r,e){return{horizontalRule(){return e.push(D0()),r}}}function Cs(r,e){return{image(t){return e.push(_0(t)),r},animatedImage(t){return e.push(F0(t)),r}}}function vm(r,e){return{linebreak(){return e.push(N0()),r}}}function As(r,e){return{link(t){return e.push(q0(t)),r},commentLink(t){return e.push(U0(t)),r},postLink(t){return e.push(G0(t)),r},subredditLink(t){return e.push($0(t)),r},userLink(t){return e.push(Q0(t)),r},userMention(t){return e.push(eP(t)),r}}}function Es(r,e){return{list(t,i){return e.push(H0(t,i)),r}}}function iP(r,e){return{item(t){return e.push(j0(t)),r}}}function Ts(r,e){return{paragraph(t){return e.push(W0(t)),r}}}function bm(r,e){return{rawText(t){return e.push(V0(t)),r}}}function Pm(r,e){return{spoiler(t){return e.push(z0(t)),r}}}function nP(r,e,t){return{headerCell(i,n){return e.push(X0(i,n)),r},row(i){return t.push(Z0(i)),r}}}function Rs(r,e){return{table(t){return e.push(J0(t)),r}}}function sP(r,e){return{cell(t){return e.push(K0(t)),r}}}function Gd(r,e){return{text(t){return e.push(Y0(t)),r}}}function aP(r,e){return{video(t){return e.push(tP(t)),r}}}var HF=function(r,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?r!==e||!n:!e.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(r,t):n?n.value=t:e.set(r,t),t},jF=function(r,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?r!==e||!i:!e.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(r):i?i.value:e.get(r)},Vd,Fs=class{constructor(){Vd.set(this,void 0);let e=[];Object.assign(this,Ts(this,e),xs(this,e),Wd(this,e),ws(this,e),Is(this,e),oP(this,e),Es(this,e),Rs(this,e),Cs(this,e),aP(this,e)),HF(this,Vd,{document:e},"f")}build(){return JSON.stringify(jF(this,Vd,"f"))}paragraph(e){return this}heading(e,t){return this}horizontalRule(){return this}blockQuote(e,t){return this}codeBlock(e,t){return this}embed(e){return this}list(e,t){return this}table(e){return this}image(e){return this}animatedImage(e){return this}video(e){return this}};Vd=new WeakMap;function Ai(r){let e;return r instanceof Fs?e=r.build():typeof r=="object"?e=JSON.stringify(r):e=r,e}var dP=100,lP=1/0,Pr,kr,Lt,Ei,Ti,zd,j=class{constructor(e){l(this,Ti);l(this,Pr,void 0);l(this,kr,void 0);l(this,Lt,void 0);l(this,Ei,!1);this.pageSize=dP;this.limit=lP;this.children=[];$(this),this._fetch=e.fetch,this.pageSize=e.pageSize??dP,this.limit=e.limit??lP,d(this,kr,e.after),d(this,Pr,e.before),d(this,Lt,e.more),e.children&&(this.children=e.children)}get hasMore(){return!s(this,Ei)||!!(s(this,kr)||s(this,Pr)||s(this,Lt))}async*[Symbol.asyncIterator](){let e=0;for(;;){if(e===this.children.length)if(this.hasMore){if((await k(this,Ti,zd).call(this)).length===0)break}else break;if(yield this.children[e],e++,e===this.limit)break}}setMore(e){d(this,Lt,e)}preventInitialFetch(){d(this,Ei,!0)}async all(){for(;this.hasMore&&this.children.length<this.limit;)await k(this,Ti,zd).call(this);return this.children.slice(0,this.limit)}async get(e){let t=e<=this.limit?e:this.limit;for(;this.hasMore&&this.children.length<t;)await k(this,Ti,zd).call(this);return this.children.slice(0,t)}};Pr=new WeakMap,kr=new WeakMap,Lt=new WeakMap,Ei=new WeakMap,Ti=new WeakSet,zd=async function(){if(!this.hasMore)throw new Error("This listing does not have any more items to load.");let{children:e,before:t,after:i,more:n}=await this._fetch({before:s(this,Pr),after:s(this,kr),limit:this.pageSize,more:s(this,Lt)});return this.children.push(...e),d(this,Pr,t),d(this,kr,i),d(this,Lt,n),d(this,Ei,!0),e};function WF(r){try{return!0}catch{return!1}}function GF(r){try{return!0}catch{return!1}}var Bs,km,Ue=class{constructor(){}static get(e,t){let i=m.redditAPIPlugins.ModNote;return new j({hasMore:!0,before:e.before,limit:e.limit,pageSize:e.limit,fetch:async n=>{let o=await i.GetNotes({subreddit:e.subreddit,user:e.user,filter:e.filter,before:n.before,limit:n.limit},t);return{children:o.modNotes?.map(a=>k(this,Bs,km).call(this,a))||[],before:o.hasNextPage?o.endCursor:void 0,hasMore:o.hasNextPage}}})}static async delete(e,t){let i=m.redditAPIPlugins.ModNote,{deleted:n}=await i.DeleteNotes(e,t);return!!n}static async add(e,t){let n=await m.redditAPIPlugins.ModNote.PostNotes(e,t);if(!n?.created)throw new Error("Failed to create mod note");return k(this,Bs,km).call(this,n.created)}static async addRemovalNote(e,t){await m.redditAPIPlugins.ModNote.PostRemovalNote(e,t)}};Bs=new WeakSet,km=function(e){if(v(e.id,"Mod note ID is null or undefined"),v(e.createdAt,"Mod note createdAt is null or undefined"),v(e.type,"Mod note type is null or undefined"),v(e.subreddit,"Mod note subreddit is null or undefined"),v(e.subredditId,"Mod note subredditId is null or undefined"),v(e.operator,"Mod note operator is null or undefined"),v(e.operatorId,"Mod note operatorId is null or undefined"),v(e.user,"Mod note user is null or undefined"),v(e.userId,"Mod note userId is null or undefined"),v(e.userNoteData,"Mod note userNote is null or undefined"),v(e.modActionData,"Mod note modAction is null or undefined"),!WF(e.userNoteData?.label??""))throw new Error(`Invalid user note label: ${e.userNoteData?.label}`);if(!GF(e.type))throw new Error(`Invalid mod note type: ${e.type}`);return{id:e.id,user:{id:re(e.userId??""),name:e.user},subreddit:{id:Fe(e.subredditId??""),name:e.subreddit},operator:{id:re(e.operatorId??""),name:e.operator},createdAt:new Date(e.createdAt*1e3),userNote:{note:e.userNoteData?.note,redditId:ye(e.userNoteData?.redditId??""),label:e.userNoteData?.label},type:e.type}},l(Ue,Bs);var Ri=class{static queryWithQueryString(e,t){return m.redditAPIPlugins.GraphQL.Query({query:e},t)}static query(e,t,i,n){return m.redditAPIPlugins.GraphQL.PersistedQuery({operationName:e,id:t,variables:i},n)}};var uP=["all","wiki","posts","access","mail","config","flair","chat_operator","chat_config"];function VF(r,e,t=!1){let i=t?"%2b":"+";return e.map(n=>(r.includes(n)?i:"-")+n).join(",")}function Sm(r){return VF(r,uP,!0)}function cP(r){if(uP.includes(r))return r;throw new Error(`Invalid moderator permission: ${r}`)}var zF=(t=>(t.User="USER_FLAIR",t.Post="LINK_FLAIR",t))(zF||{}),Sr,Fi,Bi,Oi,Ui,Mi,Li,Di,_i,Ni,qi,$d,$e=class $e{constructor(e,t,i){l(this,Sr,void 0);l(this,Fi,void 0);l(this,Bi,void 0);l(this,Oi,void 0);l(this,Ui,void 0);l(this,Mi,void 0);l(this,Li,void 0);l(this,Di,void 0);l(this,_i,void 0);l(this,Ni,void 0);$(this),v(e.id),v(e.text),d(this,Sr,e.id),d(this,Fi,t),d(this,Bi,e.text),d(this,Oi,$F(e.textColor)),d(this,Ui,JF(e.backgroundColor)),d(this,Mi,KF(e.allowableContent)),d(this,Li,e.modOnly),d(this,Di,e.maxEmojis),d(this,_i,e.textEditable),d(this,Ni,i)}get id(){return s(this,Sr)}get text(){return s(this,Bi)}get textColor(){return s(this,Oi)}get backgroundColor(){return s(this,Ui)}get allowableContent(){return s(this,Mi)}get modOnly(){return s(this,Li)}get maxEmojis(){return s(this,Di)}get allowUserEdits(){return s(this,_i)}async delete(){return $e.deleteFlairTemplate(s(this,Sr),s(this,Fi),s(this,Ni))}async edit(e){return $e.editFlairTemplate({id:s(this,Sr),subredditName:s(this,Fi),text:e.text??s(this,Bi),allowableContent:e.allowableContent??s(this,Mi),backgroundColor:e.backgroundColor??s(this,Ui),maxEmojis:e.maxEmojis??s(this,Di),modOnly:e.modOnly??s(this,Li),textColor:e.textColor??s(this,Oi),allowUserEdits:e.allowUserEdits??s(this,_i)},s(this,Ni))}static async createPostFlairTemplate(e,t){var i;return k(i=$e,qi,$d).call(i,{...e,flairType:"LINK_FLAIR"},t)}static async createUserFlairTemplate(e,t){var i;return k(i=$e,qi,$d).call(i,{...e,flairType:"USER_FLAIR"},t)}static async editFlairTemplate(e,t){var i;return k(i=$e,qi,$d).call(i,e,t)}static async getPostFlairTemplates(e,t){return(await m.redditAPIPlugins.Flair.LinkFlair({subreddit:e},t)).flair?.map(o=>new $e(o,e,t))||[]}static async getUserFlairTemplates(e,t){return(await m.redditAPIPlugins.Flair.UserFlair({subreddit:e},t)).flair?.map(o=>new $e(o,e,t))||[]}static async deleteFlairTemplate(e,t,i){await m.redditAPIPlugins.Flair.DeleteFlairTemplate({subreddit:e,flairTemplateId:t},i)}};Sr=new WeakMap,Fi=new WeakMap,Bi=new WeakMap,Oi=new WeakMap,Ui=new WeakMap,Mi=new WeakMap,Li=new WeakMap,Di=new WeakMap,_i=new WeakMap,Ni=new WeakMap,qi=new WeakSet,$d=async function(e,t){let{subredditName:i,allowableContent:n="all",backgroundColor:o="transparent",flairType:a="",maxEmojis:u=10,modOnly:p=!1,text:f,textColor:g="dark",allowUserEdits:c=!1,id:h=""}=e;if(p&&c)throw new Error("Cannot have a mod only flair that is editable by users");let w=await m.redditAPIPlugins.Flair.FlairTemplate({subreddit:i,allowableContent:n,backgroundColor:o,flairType:a,maxEmojis:u,modOnly:p,text:f,textColor:g,textEditable:c,flairTemplateId:h,cssClass:"",overrideCss:!1},t);return new $e(w,i,t)},l($e,qi);var le=$e;function Ms(r){return{flairCssClass:r.flairCssClass,user:r.user,flairText:r.flairText}}var Os,wm,Us,Im,Dt=class Dt{static async getUserFlairBySubreddit(e,t){return m.redditAPIPlugins.Flair.FlairList(e,t)}static setUserFlair(e,t){var i;return k(i=Dt,Os,wm).call(i,e,t)}static setPostFlair(e,t){var i;return k(i=Dt,Os,wm).call(i,{...e,postId:he(e.postId)},t)}static async removePostFlair(e,t,i){var n;return k(n=Dt,Us,Im).call(n,e,t,void 0,i)}static async removeUserFlair(e,t,i){var n;return k(n=Dt,Us,Im).call(n,e,void 0,t,i)}};Os=new WeakSet,wm=async function(e,t){await m.redditAPIPlugins.Flair.SelectFlair({subreddit:e.subredditName,flairTemplateId:e.flairTemplateId??"",text:e.text??"",name:e.username,link:e.postId,backgroundColor:e.backgroundColor??"",textColor:e.textColor??"dark",cssClass:e.cssClass??"",returnRtjson:"none"},t)},Us=new WeakSet,Im=async function(e,t,i,n){await m.redditAPIPlugins.Flair.SelectFlair({subreddit:e,name:i??"",link:t??"",flairTemplateId:"",backgroundColor:"",text:"",textColor:"",cssClass:"",returnRtjson:"none"},n)},l(Dt,Os),l(Dt,Us);var Me=Dt;function $F(r){if(v(r,"Flair text color is required"),r==="light"||r==="dark")return r;throw new Error(`Invalid flair text color: ${r}`)}function JF(r){if(v(r,"Flair background color is required"),r==="transparent"||/^#([A-Fa-f0-9]{6})$/.test(r))return r;throw new Error(`Invalid flair background color: ${r}`)}function KF(r){if(r==="all"||r==="text"||r==="emoji")return r;throw new Error(`Invalid allowable content: ${r}`)}import{Block as XF}from"@devvit/protos";var mP=An(hc(),1);var Hi,Ds,ji,_s,Ns,qs,Hs,js,Wi,Ws,Gs,Vs,zs,$s,Js,_t,wr,Gi,Nt,Vi,zi,$i,Ir,qt,Ht,Ji,jt,Wt,Gt,pt,Ks,Xs,Ki,Xi,L,q=class q{constructor(e,t){l(this,Hi,void 0);l(this,Ds,void 0);l(this,ji,void 0);l(this,_s,void 0);l(this,Ns,void 0);l(this,qs,void 0);l(this,Hs,void 0);l(this,js,void 0);l(this,Wi,void 0);l(this,Ws,void 0);l(this,Gs,void 0);l(this,Vs,void 0);l(this,zs,void 0);l(this,$s,void 0);l(this,Js,void 0);l(this,_t,void 0);l(this,wr,void 0);l(this,Gi,void 0);l(this,Nt,void 0);l(this,Vi,void 0);l(this,zi,void 0);l(this,$i,void 0);l(this,Ir,void 0);l(this,qt,void 0);l(this,Ht,void 0);l(this,Ji,void 0);l(this,jt,void 0);l(this,Wt,void 0);l(this,Gt,void 0);l(this,pt,void 0);l(this,Ks,void 0);l(this,Xs,void 0);l(this,Ki,void 0);l(this,Xi,void 0);l(this,L,void 0);$(this),v(e.id,"Post is missing id"),v(e.title,"Post is missing title"),v(e.createdUtc,"Post is missing created date"),v(e.author,"Post is missing author name"),v(e.subreddit,"Post is missing subreddit name"),v(e.subredditId,"Post is missing subreddit id"),v(e.url,"Post is missing url"),v(e.permalink,"Post is missing permalink"),d(this,Hi,he(`t3_${e.id}`)),d(this,ji,e.author),d(this,Ds,e.authorFullname?re(e.authorFullname):void 0),d(this,Ns,Fe(e.subredditId)),d(this,qs,e.subreddit),d(this,Vs,e.score??0),d(this,zs,e.numComments??0),d(this,$s,e.numReports??0);let i=new Date(0);i.setUTCSeconds(e.createdUtc),d(this,_s,i),d(this,js,e.title),d(this,Wi,e.selftext),d(this,Ws,e.selftextHtml),d(this,Gs,e.url),d(this,Hs,e.permalink),e.thumbnail&&e.thumbnail!=="self"&&e.thumbnail!=="nsfw"&&e.thumbnailHeight!=null&&e.thumbnailWidth!=null&&d(this,Js,{url:e.thumbnail,height:e.thumbnailHeight,width:e.thumbnailWidth}),d(this,_t,e.approved??!1),d(this,Nt,e.removed??!1),d(this,Vi,e.removedBy),d(this,zi,e.removedByCategory),d(this,wr,e.spam??!1),d(this,Gi,e.stickied??!1),d(this,$i,e.archived??!1),d(this,Ir,e.edited??!1),d(this,qt,e.locked??!1),d(this,Ht,e.over18??!1),d(this,Ji,e.quarantine??!1),d(this,jt,e.spoiler),d(this,Wt,e.hidden??!1),d(this,Gt,e.ignoreReports??!1),d(this,pt,e.distinguished),d(this,Xs,e.secureMedia),d(this,Ki,(e.modReports??[]).map(([n])=>n)),d(this,Xi,(e.userReports??[]).map(([n])=>n)),d(this,L,t),(e.linkFlairBackgroundColor||e.linkFlairCssClass||e.linkFlairText||e.linkFlairType||e.linkFlairTemplateId||e.linkFlairRichtext||e.linkFlairTextColor)&&d(this,Ks,{backgroundColor:e.linkFlairBackgroundColor,cssClass:e.linkFlairCssClass,text:e.linkFlairText,type:e.linkFlairType,templateId:e.linkFlairTemplateId,richtext:(e.linkFlairRichtext??[]).map(({e:n,t:o,a,u})=>({elementType:n,text:o,emojiRef:a,url:u})),textColor:e.linkFlairTextColor})}get id(){return s(this,Hi)}get authorId(){return s(this,Ds)}get authorName(){return s(this,ji)}get subredditId(){return s(this,Ns)}get subredditName(){return s(this,qs)}get permalink(){return s(this,Hs)}get title(){return s(this,js)}get body(){return s(this,Wi)}get bodyHtml(){return s(this,Ws)}get url(){return s(this,Gs)}get thumbnail(){return s(this,Js)}get createdAt(){return s(this,_s)}get score(){return s(this,Vs)}get numberOfComments(){return s(this,zs)}get numberOfReports(){return s(this,$s)}get approved(){return s(this,_t)}get spam(){return s(this,wr)}get stickied(){return s(this,Gi)}get removed(){return s(this,Nt)}get removedBy(){return s(this,Vi)}get removedByCategory(){return s(this,zi)}get archived(){return s(this,$i)}get edited(){return s(this,Ir)}get locked(){return s(this,qt)}get nsfw(){return s(this,Ht)}get quarantined(){return s(this,Ji)}get spoiler(){return s(this,jt)}get hidden(){return s(this,Wt)}get ignoringReports(){return s(this,Gt)}get distinguishedBy(){return s(this,pt)}get comments(){return Z.getComments({postId:this.id},s(this,L))}get flair(){return s(this,Ks)}get secureMedia(){return s(this,Xs)}get userReportReasons(){return s(this,Xi)}get modReportReasons(){return s(this,Ki)}toJSON(){return{id:this.id,authorId:this.authorId,authorName:this.authorName,subredditId:this.subredditId,subredditName:this.subredditName,permalink:this.permalink,title:this.title,body:this.body,bodyHtml:this.bodyHtml,url:this.url,thumbnail:this.thumbnail,score:this.score,numberOfComments:this.numberOfComments,numberOfReports:this.numberOfReports,createdAt:this.createdAt,approved:this.approved,spam:this.spam,stickied:this.stickied,removed:this.removed,removedBy:s(this,Vi),removedByCategory:s(this,zi),archived:this.archived,edited:this.edited,locked:this.locked,nsfw:this.nsfw,quarantined:this.quarantined,spoiler:this.spoiler,hidden:this.hidden,ignoringReports:this.ignoringReports,distinguishedBy:this.distinguishedBy,flair:this.flair,secureMedia:this.secureMedia,modReportReasons:s(this,Ki),userReportReasons:s(this,Xi)}}isApproved(){return s(this,_t)}isSpam(){return s(this,wr)}isStickied(){return s(this,Gi)}isRemoved(){return s(this,Nt)}isArchived(){return s(this,$i)}isEdited(){return s(this,Ir)}isLocked(){return s(this,qt)}isNsfw(){return s(this,Ht)}isQuarantined(){return s(this,Ji)}isSpoiler(){return s(this,jt)}isHidden(){return s(this,Wt)}isIgnoringReports(){return s(this,Gt)}isDistinguishedBy(){return s(this,pt)}async edit(e){let t=await q.edit({id:this.id,...e},s(this,L));d(this,Wi,t.body),d(this,Ir,t.edited)}async addComment(e){return Z.submit({id:this.id,...e},s(this,L))}async delete(){return q.delete(this.id,s(this,L))}async approve(){await q.approve(this.id,s(this,L)),d(this,_t,!0),d(this,Nt,!1)}async remove(e=!1){await q.remove(this.id,e,s(this,L)),d(this,Nt,!0),d(this,wr,e),d(this,_t,!1)}async lock(){await q.lock(this.id,s(this,L)),d(this,qt,!0)}async unlock(){await q.unlock(this.id,s(this,L)),d(this,qt,!1)}async hide(){await q.hide(this.id,s(this,L)),d(this,Wt,!0)}async unhide(){await q.unhide(this.id,s(this,L)),d(this,Wt,!1)}async markAsNsfw(){await q.markAsNsfw(this.id,s(this,L)),d(this,Ht,!0)}async unmarkAsNsfw(){await q.unmarkAsNsfw(this.id,s(this,L)),d(this,Ht,!1)}async markAsSpoiler(){await q.markAsSpoiler(this.id,s(this,L)),d(this,jt,!0)}async unmarkAsSpoiler(){await q.unmarkAsSpoiler(this.id,s(this,L)),d(this,jt,!1)}async sticky(e){await q.sticky(this.id,e,s(this,L))}async unsticky(){await q.unsticky(this.id,s(this,L))}async distinguish(){let{distinguishedBy:e}=await q.distinguish(this.id,!1,s(this,L));d(this,pt,e)}async distinguishAsAdmin(){let{distinguishedBy:e}=await q.distinguish(this.id,!0,s(this,L));d(this,pt,e)}async undistinguish(){let{distinguishedBy:e}=await q.undistinguish(this.id,s(this,L));d(this,pt,e)}async ignoreReports(){await q.ignoreReports(this.id,s(this,L)),d(this,Gt,!0)}async unignoreReports(){await q.unignoreReports(this.id,s(this,L)),d(this,Gt,!1)}async getAuthor(){return x.getByUsername(s(this,ji),s(this,L))}async crosspost(e){return q.crosspost({...e,postId:this.id},s(this,L))}addRemovalNote(e){return Ue.addRemovalNote({itemIds:[s(this,Hi)],...e},s(this,L))}static async getById(e,t){let i=m.redditAPIPlugins.LinksAndComments,n=rr(e)?e:`t3_${e}`,o=await i.Info({subreddits:[],thingIds:[n]},t);if(!o.data?.children?.length)throw new Error("could not find post");let a=o.data.children[0];if(!a?.data)throw new Error("could not find post");return new q(a.data,t)}static async submit(e,t){let i=m.redditAPIPlugins.LinksAndComments,n;if("preview"in e){v(t,"Missing metadata in `SubmitPostOptions`");let u=await new lt(()=>e.preview,void 0,{},t,void 0).buildBlocksUI(),p=XF.encode(u).finish();n=await i.Submit({kind:"custom",sr:e.subredditName,richtextJson:(0,mP.fromByteArray)(p),...e},t)}else n=await i.Submit({kind:"kind"in e?e.kind:"url"in e?"link":"self",sr:e.subredditName,richtextJson:"richtext"in e?Ai(e.richtext):void 0,...e},t);if("kind"in e&&["image","video","videogif"].includes(e.kind)&&!n.json?.data?.id&&"url"in e)throw new Error(`Post of ${e.kind} type with ${e.url} is being created asynchronously and should be updated in the subreddit soon.`);if(!n.json?.data?.id||n.json?.errors?.length)throw new Error(`failed to submit post - either post ID is empty or request failed with errors: ${n.json?.errors}`);return q.getById(`t3_${n.json.data.id}`,t)}static async crosspost(e,t){let i=m.redditAPIPlugins.LinksAndComments,{postId:n,subredditName:o,...a}=e,u=await i.Submit({kind:"crosspost",sr:o,crosspostFullname:he(n),...a},t);if(!u.json?.data?.id||u.json?.errors?.length)throw new Error("failed to crosspost post");return q.getById(`t3_${u.json.data.id}`,t)}static async edit(e,t){let i=m.redditAPIPlugins.LinksAndComments,{id:n}=e,o;if("richtext"in e&&(o=Ai(e.richtext)),(await i.EditUserText({thingId:n,text:"text"in e?e.text:"",richtextJson:o},t)).json?.errors?.length)throw new Error("Failed to edit post");return q.getById(n,t)}static async delete(e,t){await m.redditAPIPlugins.LinksAndComments.Del({id:e},t)}static async approve(e,t){await m.redditAPIPlugins.Moderation.Approve({id:e},t)}static async remove(e,t=!1,i){await m.redditAPIPlugins.Moderation.Remove({id:e,spam:t},i)}static async hide(e,t){await m.redditAPIPlugins.LinksAndComments.Hide({id:e},t)}static async unhide(e,t){await m.redditAPIPlugins.LinksAndComments.Unhide({id:e},t)}static async markAsNsfw(e,t){await m.redditAPIPlugins.LinksAndComments.MarkNSFW({id:e},t)}static async unmarkAsNsfw(e,t){await m.redditAPIPlugins.LinksAndComments.UnmarkNSFW({id:e},t)}static async markAsSpoiler(e,t){await m.redditAPIPlugins.LinksAndComments.Spoiler({id:e},t)}static async unmarkAsSpoiler(e,t){await m.redditAPIPlugins.LinksAndComments.Unspoiler({id:e},t)}static async sticky(e,t,i){await m.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!0,num:t},i)}static async unsticky(e,t){await m.redditAPIPlugins.LinksAndComments.SetSubredditSticky({id:e,state:!1},t)}static async lock(e,t){await m.redditAPIPlugins.LinksAndComments.Lock({id:e},t)}static async unlock(e,t){await m.redditAPIPlugins.LinksAndComments.Unlock({id:e},t)}static async distinguish(e,t,i){let a=(await m.redditAPIPlugins.Moderation.Distinguish({id:e,how:t?"admin":"yes",sticky:!1},i)).json?.data?.things?.[0]?.data;return v(a),{distinguishedBy:a.distinguished}}static async undistinguish(e,t){let o=(await m.redditAPIPlugins.Moderation.Distinguish({id:e,how:"no",sticky:!1},t)).json?.data?.things?.[0]?.data;return v(o),{distinguishedBy:o.distinguished}}static async ignoreReports(e,t){await m.redditAPIPlugins.Moderation.IgnoreReports({id:e},t)}static async unignoreReports(e,t){await m.redditAPIPlugins.Moderation.UnignoreReports({id:e},t)}static getControversialPosts(e={},t){return this.getSortedPosts({...e,sort:"controversial"},t)}static getTopPosts(e={},t){return this.getSortedPosts({...e,sort:"top"},t)}static getSortedPosts(e,t){let i=m.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Sort({show:"all",sort:e.sort,t:e.timeframe,subreddit:e.subredditName,...n},t);return Ls(o,t)}})}static getHotPosts(e={location:"GLOBAL"},t){let i=m.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Hot({g:e.location,show:"all",subreddit:e.subredditName,...n},t);return Ls(o,t)}})}static getNewPosts(e,t){let i=m.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.New({show:"all",subreddit:e.subredditName,...n},t);return Ls(o,t)}})}static getRisingPosts(e,t){let i=m.redditAPIPlugins.Listings;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,fetch:async n=>{let o=await i.Rising({show:"all",subreddit:e.subredditName,...n},t);return Ls(o,t)}})}static getPostsByUser(e,t){let i=m.redditAPIPlugins.Users;return new j({hasMore:!0,before:e.before,after:e.after,pageSize:e.pageSize,limit:e.limit,async fetch(n){let o=await i.UserWhere({username:e.username,where:"submitted",...n},t);return Ls(o,t)}})}};Hi=new WeakMap,Ds=new WeakMap,ji=new WeakMap,_s=new WeakMap,Ns=new WeakMap,qs=new WeakMap,Hs=new WeakMap,js=new WeakMap,Wi=new WeakMap,Ws=new WeakMap,Gs=new WeakMap,Vs=new WeakMap,zs=new WeakMap,$s=new WeakMap,Js=new WeakMap,_t=new WeakMap,wr=new WeakMap,Gi=new WeakMap,Nt=new WeakMap,Vi=new WeakMap,zi=new WeakMap,$i=new WeakMap,Ir=new WeakMap,qt=new WeakMap,Ht=new WeakMap,Ji=new WeakMap,jt=new WeakMap,Wt=new WeakMap,Gt=new WeakMap,pt=new WeakMap,Ks=new WeakMap,Xs=new WeakMap,Ki=new WeakMap,Xi=new WeakMap,L=new WeakMap;var z=q;function Ls(r,e){if(!r.data?.children)throw new Error("Listing response is missing children");return{children:r.data.children.map(i=>new z(i.data,e)),before:r.data.before,after:r.data.after}}var Zs,Zi,Ys,Qs,eo,to,ro,Vt,io,no,ft,xr=class xr{constructor(e,t){l(this,Zs,void 0);l(this,Zi,void 0);l(this,Ys,void 0);l(this,Qs,void 0);l(this,eo,void 0);l(this,to,void 0);l(this,ro,void 0);l(this,Vt,new Map);l(this,io,void 0);l(this,no,void 0);l(this,ft,void 0);$(this),v(e.id,"User ID is missing or undefined"),v(e.name,"Username is missing or undefined"),v(e.createdUtc,"User is missing created date"),d(this,Zs,re(Qa(e.id)?e.id:`t2_${e.id}`)),d(this,Zi,e.name),d(this,to,e.over18??!1),d(this,ro,e.isEmployee??!1);let i=new Date(0);if(i.setUTCSeconds(e.createdUtc),d(this,Ys,i),d(this,Qs,e.linkKarma??0),d(this,eo,e.commentKarma??0),e.modPermissions)for(let[n,o]of Object.entries(e.modPermissions))s(this,Vt).set(n,o.map(cP));d(this,io,new URL(e.subreddit?.url??"","https://www.reddit.com").toString()),d(this,no,e.subreddit?.url??""),d(this,ft,t)}get id(){return s(this,Zs)}get username(){return s(this,Zi)}get createdAt(){return s(this,Ys)}get linkKarma(){return s(this,Qs)}get commentKarma(){return s(this,eo)}get nsfw(){return s(this,to)}get isAdmin(){return s(this,ro)}get modPermissions(){return s(this,Vt)}get url(){return s(this,io)}get permalink(){return s(this,no)}toJSON(){return{id:this.id,username:this.username,createdAt:this.createdAt,linkKarma:this.linkKarma,commentKarma:this.commentKarma,nsfw:this.nsfw,modPermissionsBySubreddit:Object.fromEntries(this.modPermissions)}}async getModPermissionsForSubreddit(e){if(s(this,Vt).has(e))return s(this,Vt).get(e);let t=await xr.getSubredditUsersByType({subredditName:e,type:"moderators",username:this.username},s(this,ft)).all();if(t.length===0)return[];let i=t[0].modPermissions.get(e)??[];return i.length>0&&s(this,Vt).set(e,i),i}getComments(e){return Z.getCommentsByUser({username:this.username,...e},s(this,ft))}getPosts(e){return z.getPostsByUser({username:this.username,...e},s(this,ft))}async getUserFlairBySubreddit(e){let t=await Me.getUserFlairBySubreddit({subreddit:e,name:s(this,Zi)},s(this,ft));return t.users[0]?Ms(t.users[0]):void 0}getSnoovatarUrl(){return xr.getSnoovatarUrl(this.username,s(this,ft))}static async getById(e,t){let o=(await m.redditAPIPlugins.Users.UserDataByAccountIds({ids:e},t))?.users?.[e]?.name;return v(o,"Expected the username in response to be not null"),xr.getByUsername(o,t)}static async getByUsername(e,t){let n=await m.redditAPIPlugins.Users.UserAbout({username:e},t);if(!n.data?.id)throw new Error("failed to get user");return new xr(n.data,t)}static async getFromMetadata(e,t){v(t);let i=ve(e,t);return i?xr.getById(re(i),t):Promise.resolve(void 0)}static getSubredditUsersByType(e,t){let i=m.redditAPIPlugins.Subreddits;return new j({hasMore:!0,pageSize:e.pageSize,limit:e.limit,after:e.after,before:e.before,fetch:async n=>{let o=await i.AboutWhere({where:e.type,user:e.username,subreddit:e.subredditName,show:"all",...n},t);return YF(o,e.subredditName,t)}})}static async createRelationship(e,t){let i=m.redditAPIPlugins.Users,{type:n,subredditName:o,username:a,permissions:u,...p}=e,f=await i.Friend({type:n,subreddit:o,name:a,permissions:u?Sm(u):void 0,...p},t);if(f.json?.errors?.length)throw new Error(f.json.errors.join(`
4
4
  `))}static async removeRelationship(e,t){await m.redditAPIPlugins.Users.Unfriend({type:e.type,subreddit:e.subredditName,name:e.username},t)}static async setModeratorPermissions(e,t,i,n){let a=await m.redditAPIPlugins.Users.SetPermissions({subreddit:t,name:e,type:"moderator",permissions:Sm(i)},n);if(a.json?.errors?.length)throw new Error(a.json.errors.join(`