@sesamy/sesamy-js 1.19.6 → 1.19.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
- "use strict";var ov=Object.defineProperty;var sv=(e,t,r)=>t in e?ov(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>sv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Lr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},X=function(e){try{return!!e()}catch{return!0}},cv=X,jn=!cv(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),fl=jn,dl=Function.prototype,yi=dl.call,uv=fl&&dl.bind.bind(yi,yi),H=fl?uv:function(e){return function(){return yi.apply(e,arguments)}},vl=H,lv=vl({}.toString),fv=vl("".slice),Ln=function(e){return fv(lv(e),8,-1)},dv=H,vv=X,hv=Ln,ia=Object,pv=dv("".split),hl=vv(function(){return!ia("z").propertyIsEnumerable(0)})?function(e){return hv(e)==="String"?pv(e,""):ia(e)}:ia,Nn=function(e){return e==null},mv=Nn,gv=TypeError,Un=function(e){if(mv(e))throw new gv("Can't call method on "+e);return e},yv=hl,wv=Un,Er=function(e){return yv(wv(e))},qt=function(e){return e&&e.Math===Math&&e},G=qt(typeof globalThis=="object"&&globalThis)||qt(typeof window=="object"&&window)||qt(typeof self=="object"&&self)||qt(typeof Lr=="object"&&Lr)||qt(typeof Lr=="object"&&Lr)||function(){return this}()||Function("return this")(),pl={exports:{}},bv=!1,ns=G,Sv=Object.defineProperty,no=function(e,t){try{Sv(ns,e,{value:t,configurable:!0,writable:!0})}catch{ns[e]=t}return t},$v=G,Iv=no,as="__core-js_shared__",is=pl.exports=$v[as]||Iv(as,{});(is.versions||(is.versions=[])).push({version:"3.37.1",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"});var ao=pl.exports,os=ao,ml=function(e,t){return os[e]||(os[e]=t||{})},Ev=Un,Tv=Object,xn=function(e){return Tv(Ev(e))},Pv=H,Ov=xn,kv=Pv({}.hasOwnProperty),me=Object.hasOwn||function(t,r){return kv(Ov(t),r)},_v=H,Rv=0,Cv=Math.random(),Av=_v(1 .toString),gl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+Av(++Rv+Cv,36)},Dn=typeof navigator<"u"&&String(navigator.userAgent)||"",yl=G,oa=Dn,ss=yl.process,cs=yl.Deno,us=ss&&ss.versions||cs&&cs.version,ls=us&&us.v8,$e,mn;ls&&($e=ls.split("."),mn=$e[0]>0&&$e[0]<4?1:+($e[0]+$e[1]));!mn&&oa&&($e=oa.match(/Edge\/(\d+)/),(!$e||$e[1]>=74)&&($e=oa.match(/Chrome\/(\d+)/),$e&&(mn=+$e[1])));var wl=mn,fs=wl,jv=X,Lv=G,Nv=Lv.String,bl=!!Object.getOwnPropertySymbols&&!jv(function(){var e=Symbol("symbol detection");return!Nv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&fs&&fs<41}),Uv=bl,Sl=Uv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",xv=G,Dv=ml,ds=me,Mv=gl,Fv=bl,zv=Sl,Ot=xv.Symbol,sa=Dv("wks"),Bv=zv?Ot.for||Ot:Ot&&Ot.withoutSetter||Mv,q=function(e){return ds(sa,e)||(sa[e]=Fv&&ds(Ot,e)?Ot[e]:Bv("Symbol."+e)),sa[e]},ca=typeof document=="object"&&document.all,W=typeof ca>"u"&&ca!==void 0?function(e){return typeof e=="function"||e===ca}:function(e){return typeof e=="function"},Hv=W,ge=function(e){return typeof e=="object"?e!==null:Hv(e)},Kv=ge,Gv=String,Wv=TypeError,Te=function(e){if(Kv(e))return e;throw new Wv(Gv(e)+" is not an object")},$l={},Vv=X,Q=!Vv(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Zv=Q,Jv=X,Il=Zv&&Jv(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ce={},Yv=G,vs=ge,wi=Yv.document,Xv=vs(wi)&&vs(wi.createElement),Mn=function(e){return Xv?wi.createElement(e):{}},qv=Q,Qv=X,eh=Mn,El=!qv&&!Qv(function(){return Object.defineProperty(eh("div"),"a",{get:function(){return 7}}).a!==7}),th=jn,Nr=Function.prototype.call,te=th?Nr.bind(Nr):function(){return Nr.apply(Nr,arguments)},ua=G,rh=W,nh=function(e){return rh(e)?e:void 0},Pe=function(e,t){return arguments.length<2?nh(ua[e]):ua[e]&&ua[e][t]},ah=H,Fn=ah({}.isPrototypeOf),ih=Pe,oh=W,sh=Fn,ch=Sl,uh=Object,Tl=ch?function(e){return typeof e=="symbol"}:function(e){var t=ih("Symbol");return oh(t)&&sh(t.prototype,uh(e))},lh=String,zn=function(e){try{return lh(e)}catch{return"Object"}},fh=W,dh=zn,vh=TypeError,Ae=function(e){if(fh(e))return e;throw new vh(dh(e)+" is not a function")},hh=Ae,ph=Nn,io=function(e,t){var r=e[t];return ph(r)?void 0:hh(r)},la=te,fa=W,da=ge,mh=TypeError,gh=function(e,t){var r,n;if(t==="string"&&fa(r=e.toString)&&!da(n=la(r,e))||fa(r=e.valueOf)&&!da(n=la(r,e))||t!=="string"&&fa(r=e.toString)&&!da(n=la(r,e)))return n;throw new mh("Can't convert object to primitive value")},yh=te,hs=ge,ps=Tl,wh=io,bh=gh,Sh=q,$h=TypeError,Ih=Sh("toPrimitive"),Eh=function(e,t){if(!hs(e)||ps(e))return e;var r=wh(e,Ih),n;if(r){if(t===void 0&&(t="default"),n=yh(r,e,t),!hs(n)||ps(n))return n;throw new $h("Can't convert object to primitive value")}return t===void 0&&(t="number"),bh(e,t)},Th=Eh,Ph=Tl,Pl=function(e){var t=Th(e,"string");return Ph(t)?t:t+""},Oh=Q,kh=El,_h=Il,Ur=Te,ms=Pl,Rh=TypeError,va=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,ha="enumerable",pa="configurable",ma="writable";Ce.f=Oh?_h?function(t,r,n){if(Ur(t),r=ms(r),Ur(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ma in n&&!n[ma]){var a=Ch(t,r);a&&a[ma]&&(t[r]=n.value,n={configurable:pa in n?n[pa]:a[pa],enumerable:ha in n?n[ha]:a[ha],writable:!1})}return va(t,r,n)}:va:function(t,r,n){if(Ur(t),r=ms(r),Ur(n),kh)try{return va(t,r,n)}catch{}if("get"in n||"set"in n)throw new Rh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Ah=Math.ceil,jh=Math.floor,Lh=Math.trunc||function(t){var r=+t;return(r>0?jh:Ah)(r)},Nh=Lh,oo=function(e){var t=+e;return t!==t||t===0?0:Nh(t)},Uh=oo,xh=Math.max,Dh=Math.min,Mh=function(e,t){var r=Uh(e);return r<0?xh(r+t,0):Dh(r,t)},Fh=oo,zh=Math.min,Bh=function(e){var t=Fh(e);return t>0?zh(t,9007199254740991):0},Hh=Bh,so=function(e){return Hh(e.length)},Kh=Er,Gh=Mh,Wh=so,gs=function(e){return function(t,r,n){var a=Kh(t),i=Wh(a);if(i===0)return!e&&-1;var o=Gh(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},Vh={includes:gs(!0),indexOf:gs(!1)},co={},Zh=H,ga=me,Jh=Er,Yh=Vh.indexOf,Xh=co,ys=Zh([].push),Ol=function(e,t){var r=Jh(e),n=0,a=[],i;for(i in r)!ga(Xh,i)&&ga(r,i)&&ys(a,i);for(;t.length>n;)ga(r,i=t[n++])&&(~Yh(a,i)||ys(a,i));return a},uo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],qh=Ol,Qh=uo,kl=Object.keys||function(t){return qh(t,Qh)},ep=Q,tp=Il,rp=Ce,np=Te,ap=Er,ip=kl;$l.f=ep&&!tp?Object.defineProperties:function(t,r){np(t);for(var n=ap(r),a=ip(r),i=a.length,o=0,s;i>o;)rp.f(t,s=a[o++],n[s]);return t};var op=Pe,_l=op("document","documentElement"),sp=ml,cp=gl,ws=sp("keys"),lo=function(e){return ws[e]||(ws[e]=cp(e))},up=Te,lp=$l,bs=uo,fp=co,dp=_l,vp=Mn,hp=lo,Ss=">",$s="<",bi="prototype",Si="script",Rl=hp("IE_PROTO"),ya=function(){},Cl=function(e){return $s+Si+Ss+e+$s+"/"+Si+Ss},Is=function(e){e.write(Cl("")),e.close();var t=e.parentWindow.Object;return e=null,t},pp=function(){var e=vp("iframe"),t="java"+Si+":",r;return e.style.display="none",dp.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Cl("document.F=Object")),r.close(),r.F},xr,cn=function(){try{xr=new ActiveXObject("htmlfile")}catch{}cn=typeof document<"u"?document.domain&&xr?Is(xr):pp():Is(xr);for(var e=bs.length;e--;)delete cn[bi][bs[e]];return cn()};fp[Rl]=!0;var Bn=Object.create||function(t,r){var n;return t!==null?(ya[bi]=up(t),n=new ya,ya[bi]=null,n[Rl]=t):n=cn(),r===void 0?n:lp.f(n,r)},mp=q,gp=Bn,yp=Ce.f,$i=mp("unscopables"),Ii=Array.prototype;Ii[$i]===void 0&&yp(Ii,$i,{configurable:!0,value:gp(null)});var wp=function(e){Ii[$i][e]=!0},Tr={},bp=G,Sp=W,Es=bp.WeakMap,$p=Sp(Es)&&/native code/.test(String(Es)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},Ip=Q,Ep=Ce,Tp=vt,ht=Ip?function(e,t,r){return Ep.f(e,t,Tp(1,r))}:function(e,t,r){return e[t]=r,e},Pp=$p,Al=G,Op=ge,kp=ht,wa=me,ba=ao,_p=lo,Rp=co,Ts="Object already initialized",Ei=Al.TypeError,Cp=Al.WeakMap,gn,Sr,yn,Ap=function(e){return yn(e)?Sr(e):gn(e,{})},jp=function(e){return function(t){var r;if(!Op(t)||(r=Sr(t)).type!==e)throw new Ei("Incompatible receiver, "+e+" required");return r}};if(Pp||ba.state){var Oe=ba.state||(ba.state=new Cp);Oe.get=Oe.get,Oe.has=Oe.has,Oe.set=Oe.set,gn=function(e,t){if(Oe.has(e))throw new Ei(Ts);return t.facade=e,Oe.set(e,t),t},Sr=function(e){return Oe.get(e)||{}},yn=function(e){return Oe.has(e)}}else{var gt=_p("state");Rp[gt]=!0,gn=function(e,t){if(wa(e,gt))throw new Ei(Ts);return t.facade=e,kp(e,gt,t),t},Sr=function(e){return wa(e,gt)?e[gt]:{}},yn=function(e){return wa(e,gt)}}var Wt={set:gn,get:Sr,has:yn,enforce:Ap,getterFor:jp},fo={},vo={},jl={}.propertyIsEnumerable,Ll=Object.getOwnPropertyDescriptor,Lp=Ll&&!jl.call({1:2},1);vo.f=Lp?function(t){var r=Ll(this,t);return!!r&&r.enumerable}:jl;var Np=Q,Up=te,xp=vo,Dp=vt,Mp=Er,Fp=Pl,zp=me,Bp=El,Ps=Object.getOwnPropertyDescriptor;fo.f=Np?Ps:function(t,r){if(t=Mp(t),r=Fp(r),Bp)try{return Ps(t,r)}catch{}if(zp(t,r))return Dp(!Up(xp.f,t,r),t[r])};var Nl={exports:{}},Ti=Q,Hp=me,Ul=Function.prototype,Kp=Ti&&Object.getOwnPropertyDescriptor,ho=Hp(Ul,"name"),Gp=ho&&(function(){}).name==="something",Wp=ho&&(!Ti||Ti&&Kp(Ul,"name").configurable),xl={EXISTS:ho,PROPER:Gp,CONFIGURABLE:Wp},Vp=H,Zp=W,Pi=ao,Jp=Vp(Function.toString);Zp(Pi.inspectSource)||(Pi.inspectSource=function(e){return Jp(e)});var po=Pi.inspectSource,mo=H,Yp=X,Xp=W,Dr=me,Oi=Q,qp=xl.CONFIGURABLE,Qp=po,Dl=Wt,em=Dl.enforce,tm=Dl.get,Os=String,un=Object.defineProperty,rm=mo("".slice),nm=mo("".replace),am=mo([].join),im=Oi&&!Yp(function(){return un(function(){},"length",{value:8}).length!==8}),om=String(String).split("String"),sm=Nl.exports=function(e,t,r){rm(Os(t),0,7)==="Symbol("&&(t="["+nm(Os(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Dr(e,"name")||qp&&e.name!==t)&&(Oi?un(e,"name",{value:t,configurable:!0}):e.name=t),im&&r&&Dr(r,"arity")&&e.length!==r.arity&&un(e,"length",{value:r.arity});try{r&&Dr(r,"constructor")&&r.constructor?Oi&&un(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=em(e);return Dr(n,"source")||(n.source=am(om,typeof t=="string"?t:"")),e};Function.prototype.toString=sm(function(){return Xp(this)&&tm(this).source||Qp(this)},"toString");var Ml=Nl.exports,cm=W,um=Ce,lm=Ml,fm=no,ye=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(cm(r)&&lm(r,i,n),n.global)a?e[t]=r:fm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:um.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Fl={},dm=Ol,vm=uo,hm=vm.concat("length","prototype");Fl.f=Object.getOwnPropertyNames||function(t){return dm(t,hm)};var go={};go.f=Object.getOwnPropertySymbols;var pm=Pe,mm=H,gm=Fl,ym=go,wm=Te,bm=mm([].concat),Sm=pm("Reflect","ownKeys")||function(t){var r=gm.f(wm(t)),n=ym.f;return n?bm(r,n(t)):r},ks=me,$m=Sm,Im=fo,Em=Ce,zl=function(e,t,r){for(var n=$m(t),a=Em.f,i=Im.f,o=0;o<n.length;o++){var s=n[o];!ks(e,s)&&!(r&&ks(r,s))&&a(e,s,i(t,s))}},Tm=X,Pm=W,Om=/#|\.prototype\./,Pr=function(e,t){var r=_m[km(e)];return r===Cm?!0:r===Rm?!1:Pm(t)?Tm(t):!!t},km=Pr.normalize=function(e){return String(e).replace(Om,".").toLowerCase()},_m=Pr.data={},Rm=Pr.NATIVE="N",Cm=Pr.POLYFILL="P",Bl=Pr,Mr=G,Am=fo.f,jm=ht,Lm=ye,Nm=no,Um=zl,xm=Bl,ee=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=Mr:a?o=Mr[r]||Nm(r,{}):o=Mr[r]&&Mr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Am(o,s),u=l&&l.value):u=o[s],i=xm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Um(f,u)}(e.sham||u&&u.sham)&&jm(f,"sham",!0),Lm(o,s,f,e)}},Dm=X,Mm=!Dm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Fm=me,zm=W,Bm=xn,Hm=lo,Km=Mm,_s=Hm("IE_PROTO"),ki=Object,Gm=ki.prototype,yo=Km?ki.getPrototypeOf:function(e){var t=Bm(e);if(Fm(t,_s))return t[_s];var r=t.constructor;return zm(r)&&t instanceof r?r.prototype:t instanceof ki?Gm:null},Wm=X,Vm=W,Zm=ge,Rs=yo,Jm=ye,Ym=q,_i=Ym("iterator"),Hl=!1,ut,Sa,$a;[].keys&&($a=[].keys(),"next"in $a?(Sa=Rs(Rs($a)),Sa!==Object.prototype&&(ut=Sa)):Hl=!0);var Xm=!Zm(ut)||Wm(function(){var e={};return ut[_i].call(e)!==e});Xm&&(ut={});Vm(ut[_i])||Jm(ut,_i,function(){return this});var Kl={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Hl},qm=Ce.f,Qm=me,eg=q,Cs=eg("toStringTag"),Vt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!Qm(e,Cs)&&qm(e,Cs,{configurable:!0,value:t})},tg=Kl.IteratorPrototype,rg=Bn,ng=vt,ag=Vt,ig=Tr,og=function(){return this},Gl=function(e,t,r,n){var a=t+" Iterator";return e.prototype=rg(tg,{next:ng(+!n,r)}),ag(e,a,!1),ig[a]=og,e},sg=H,cg=Ae,ug=function(e,t,r){try{return sg(cg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},lg=ge,fg=function(e){return lg(e)||e===null},dg=fg,vg=String,hg=TypeError,pg=function(e){if(dg(e))return e;throw new hg("Can't set "+vg(e)+" as a prototype")},mg=ug,gg=ge,yg=Un,wg=pg,wo=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=mg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return yg(a),wg(i),gg(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),bg=ee,Sg=te,Wl=xl,$g=W,Ig=Gl,As=yo,js=wo,Eg=Vt,Tg=ht,Ia=ye,Pg=q,Og=Tr,Vl=Kl,kg=Wl.PROPER,_g=Wl.CONFIGURABLE,Ls=Vl.IteratorPrototype,Fr=Vl.BUGGY_SAFARI_ITERATORS,Qt=Pg("iterator"),Ns="keys",er="values",Us="entries",Rg=function(){return this},Zl=function(e,t,r,n,a,i,o){Ig(r,t,n);var s=function(E){if(E===a&&d)return d;if(!Fr&&E&&E in l)return l[E];switch(E){case Ns:return function(){return new r(this,E)};case er:return function(){return new r(this,E)};case Us:return function(){return new r(this,E)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[Qt]||l["@@iterator"]||a&&l[a],d=!Fr&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=As(v.call(new e)),p!==Object.prototype&&p.next&&(As(p)!==Ls&&(js?js(p,Ls):$g(p[Qt])||Ia(p,Qt,Rg)),Eg(p,u,!0))),kg&&a===er&&c&&c.name!==er&&(_g?Tg(l,"name",er):(f=!0,d=function(){return Sg(c,this)})),a)if(S={values:s(er),keys:i?d:s(Ns),entries:s(Us)},o)for(g in S)(Fr||f||!(g in l))&&Ia(l,g,S[g]);else bg({target:t,proto:!0,forced:Fr||f},S);return l[Qt]!==d&&Ia(l,Qt,d,{name:a}),Og[t]=d,S},bo=function(e,t){return{value:e,done:t}},Cg=Er,So=wp,xs=Tr,Jl=Wt,Ag=Ce.f,jg=Zl,zr=bo,Lg=Q,Yl="Array Iterator",Ng=Jl.set,Ug=Jl.getterFor(Yl),xg=jg(Array,"Array",function(e,t){Ng(this,{type:Yl,target:Cg(e),index:0,kind:t})},function(){var e=Ug(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,zr(void 0,!0);switch(e.kind){case"keys":return zr(r,!1);case"values":return zr(t[r],!1)}return zr([r,t[r]],!1)},"values"),Ds=xs.Arguments=xs.Array;So("keys");So("values");So("entries");if(Lg&&Ds.name!=="values")try{Ag(Ds,"name",{value:"values"})}catch{}var Ms=G,Dg=Q,Mg=Object.getOwnPropertyDescriptor,Xl=function(e){if(!Dg)return Ms[e];var t=Mg(Ms,e);return t&&t.value},Fg=X,zg=q,Bg=Q,Fs=bv,Hg=zg("iterator"),Hn=!Fg(function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Fs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Fs||!Bg)||!t.sort||e.href!=="http://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Hg]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("http://тест").host!=="xn--e1aybc"||new URL("http://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("http://x",void 0).host!=="x"}),zs=Ml,Kg=Ce,Kn=function(e,t,r){return r.get&&zs(r.get,t,{getter:!0}),r.set&&zs(r.set,t,{setter:!0}),Kg.f(e,t,r)},Gg=ye,Wg=function(e,t,r){for(var n in t)Gg(e,n,t[n],r);return e},Vg=Fn,Zg=TypeError,$o=function(e,t){if(Vg(t,e))return e;throw new Zg("Incorrect invocation")},Jg=Ln,Yg=H,Xg=function(e){if(Jg(e)==="Function")return Yg(e)},Bs=Xg,qg=Ae,Qg=jn,ey=Bs(Bs.bind),Zt=function(e,t){return qg(e),t===void 0?e:Qg?ey(e,t):function(){return e.apply(t,arguments)}},ty=q,ry=ty("toStringTag"),ql={};ql[ry]="z";var Io=String(ql)==="[object z]",ny=Io,ay=W,ln=Ln,iy=q,oy=iy("toStringTag"),sy=Object,cy=ln(function(){return arguments}())==="Arguments",uy=function(e,t){try{return e[t]}catch{}},Or=ny?ln:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=uy(t=sy(e),oy))=="string"?r:cy?ln(t):(n=ln(t))==="Object"&&ay(t.callee)?"Arguments":n},ly=Or,fy=String,Me=function(e){if(ly(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return fy(e)},dy=Or,Hs=io,vy=Nn,hy=Tr,py=q,my=py("iterator"),Gn=function(e){if(!vy(e))return Hs(e,my)||Hs(e,"@@iterator")||hy[dy(e)]},gy=te,yy=Ae,wy=Te,by=zn,Sy=Gn,$y=TypeError,Eo=function(e,t){var r=arguments.length<2?Sy(e):t;if(yy(r))return wy(gy(r,e));throw new $y(by(e)+" is not iterable")},Iy=TypeError,pt=function(e,t){if(e<t)throw new Iy("Not enough arguments");return e},Ey=H,To=Ey([].slice),Ks=To,Ty=Math.floor,Ri=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Ty(r/2),s=Ri(Ks(e,0,o),t),u=Ri(Ks(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Py=Ri,Ci=ee,Wn=G,Po=Xl,Br=te,Re=H,fr=Q,Ql=Hn,ef=ye,Oy=Kn,ky=Wg,_y=Vt,Ry=Gl,Oo=Wt,tf=$o,Ea=W,Cy=me,Ay=Zt,jy=Or,Ly=Te,rf=ge,ne=Me,Ny=Bn,Gs=vt,Ws=Eo,Uy=Gn,Hr=bo,yt=pt,xy=q,Dy=Py,My=xy("iterator"),Jt="URLSearchParams",nf=Jt+"Iterator",af=Oo.set,he=Oo.getterFor(Jt),Fy=Oo.getterFor(nf),Vs=Po("fetch"),wn=Po("Request"),dr=Po("Headers"),Ta=wn&&wn.prototype,Zs=dr&&dr.prototype,zy=Wn.RegExp,By=Wn.TypeError,of=Wn.decodeURIComponent,Hy=Wn.encodeURIComponent,Ky=Re("".charAt),Js=Re([].join),at=Re([].push),Ai=Re("".replace),Gy=Re([].shift),Ys=Re([].splice),Xs=Re("".split),Wy=Re("".slice),Vy=/\+/g,qs=Array(4),Zy=function(e){return qs[e-1]||(qs[e-1]=zy("((?:%[\\da-f]{2}){"+e+"})","gi"))},Jy=function(e){try{return of(e)}catch{return e}},Qs=function(e){var t=Ai(e,Vy," "),r=4;try{return of(t)}catch{for(;r;)t=Ai(t,Zy(r--),Jy);return t}},Yy=/[!'()~]|%20/g,Xy={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},qy=function(e){return Xy[e]},ec=function(e){return Ai(Hy(e),Yy,qy)},Pa=Ry(function(t,r){af(this,{type:nf,target:he(t).entries,index:0,kind:r})},Jt,function(){var t=Fy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Hr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Hr(a.key,!1);case"values":return Hr(a.value,!1)}return Hr([a.key,a.value],!1)},!0),sf=function(e){this.entries=[],this.url=null,e!==void 0&&(rf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?Ky(e,0)==="?"?Wy(e,1):e:ne(e)))};sf.prototype={type:Jt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Uy(e),n,a,i,o,s,u,f;if(r)for(n=Ws(e,r),a=n.next;!(i=Br(a,n)).done;){if(o=Ws(Ly(i.value)),s=o.next,(u=Br(s,o)).done||(f=Br(s,o)).done||!Br(s,o).done)throw new By("Expected sequence with length 2");at(t,{key:ne(u.value),value:ne(f.value)})}else for(var l in e)Cy(e,l)&&at(t,{key:l,value:ne(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=Xs(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=Xs(a,"="),at(t,{key:Qs(Gy(i)),value:Qs(Js(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],at(t,ec(n.key)+"="+ec(n.value));return Js(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Vn=function(){tf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=af(this,new sf(t));fr||(this.size=r.entries.length)},Ut=Vn.prototype;ky(Ut,{append:function(t,r){var n=he(this);yt(arguments.length,2),at(n.entries,{key:ne(t),value:ne(r)}),fr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=yt(arguments.length,1),n=t.entries,a=ne(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(Ys(n,s,1),o!==void 0)break}else s++}fr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=[],i=0;i<r.length;i++)r[i].key===n&&at(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=yt(arguments.length,1),a=ne(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=he(this);yt(arguments.length,1);for(var a=n.entries,i=!1,o=ne(t),s=ne(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?Ys(a,u--,1):(i=!0,f.value=s));i||at(a,{key:o,value:s}),fr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Dy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=Ay(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new Pa(this,"keys")},values:function(){return new Pa(this,"values")},entries:function(){return new Pa(this,"entries")}},{enumerable:!0});ef(Ut,My,Ut.entries,{name:"entries"});ef(Ut,"toString",function(){return he(this).serialize()},{enumerable:!0});fr&&Oy(Ut,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0});_y(Vn,Jt);Ci({global:!0,constructor:!0,forced:!Ql},{URLSearchParams:Vn});if(!Ql&&Ea(dr)){var Qy=Re(Zs.has),ew=Re(Zs.set),tc=function(e){if(rf(e)){var t=e.body,r;if(jy(t)===Jt)return r=e.headers?new dr(e.headers):new dr,Qy(r,"content-type")||ew(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Ny(e,{body:Gs(0,ne(t)),headers:Gs(0,r)})}return e};if(Ea(Vs)&&Ci({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return Vs(t,arguments.length>1?tc(arguments[1]):{})}}),Ea(wn)){var Oa=function(t){return tf(this,Ta),new wn(t,arguments.length>1?tc(arguments[1]):{})};Ta.constructor=Oa,Oa.prototype=Ta,Ci({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Oa})}}var tw={URLSearchParams:Vn,getState:he},rw=ye,Zn=H,rc=Me,nw=pt,cf=URLSearchParams,Jn=cf.prototype,aw=Zn(Jn.append),nc=Zn(Jn.delete),iw=Zn(Jn.forEach),ow=Zn([].push),ko=new cf("a=1&a=2&b=3");ko.delete("a",1);ko.delete("b",void 0);ko+""!="a=2"&&rw(Jn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return nc(this,e);var n=[];iw(this,function(c,d){ow(n,{key:d,value:c})}),nw(t,1);for(var a=rc(e),i=rc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,nc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||aw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var sw=ye,uf=H,cw=Me,uw=pt,lf=URLSearchParams,_o=lf.prototype,lw=uf(_o.getAll),fw=uf(_o.has),ac=new lf("a=1");(ac.has("a",2)||!ac.has("a",void 0))&&sw(_o,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return fw(this,t);var a=lw(this,t);uw(r,1);for(var i=cw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var dw=Q,vw=H,hw=Kn,ji=URLSearchParams.prototype,pw=vw(ji.forEach);dw&&!("size"in ji)&&hw(ji,"size",{get:function(){var t=0;return pw(this,function(){t++}),t},configurable:!0,enumerable:!0});var mw=G,Ro=mw,gw=Ro;gw.URLSearchParams;var Co=H,yw=oo,ww=Me,bw=Un,Sw=Co("".charAt),ic=Co("".charCodeAt),$w=Co("".slice),oc=function(e){return function(t,r){var n=ww(bw(t)),a=yw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=ic(n,a),o<55296||o>56319||a+1===i||(s=ic(n,a+1))<56320||s>57343?e?Sw(n,a):o:e?$w(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},ff={codeAt:oc(!1),charAt:oc(!0)},Iw=ff.charAt,Ew=Me,df=Wt,Tw=Zl,sc=bo,vf="String Iterator",Pw=df.set,Ow=df.getterFor(vf);Tw(String,"String",function(e){Pw(this,{type:vf,string:Ew(e),index:0})},function(){var t=Ow(this),r=t.string,n=t.index,a;return n>=r.length?sc(void 0,!0):(a=Iw(r,n),t.index+=a.length,sc(a,!1))});var cc=Q,kw=H,_w=te,Rw=X,ka=kl,Cw=go,Aw=vo,jw=xn,Lw=hl,wt=Object.assign,uc=Object.defineProperty,Nw=kw([].concat),Uw=!wt||Rw(function(){if(cc&&wt({b:1},wt(uc({},"a",{enumerable:!0,get:function(){uc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),wt({},e)[r]!==7||ka(wt({},t)).join("")!==n})?function(t,r){for(var n=jw(t),a=arguments.length,i=1,o=Cw.f,s=Aw.f;a>i;)for(var u=Lw(arguments[i++]),f=o?Nw(ka(u),o(u)):ka(u),l=f.length,c=0,d;l>c;)d=f[c++],(!cc||_w(s,u,d))&&(n[d]=u[d]);return n}:wt,xw=te,lc=Te,Dw=io,hf=function(e,t,r){var n,a;lc(e);try{if(n=Dw(e,"return"),!n){if(t==="throw")throw r;return r}n=xw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return lc(n),r},Mw=Te,Fw=hf,zw=function(e,t,r,n){try{return n?t(Mw(r)[0],r[1]):t(r)}catch(a){Fw(e,"throw",a)}},Bw=q,Hw=Tr,Kw=Bw("iterator"),Gw=Array.prototype,pf=function(e){return e!==void 0&&(Hw.Array===e||Gw[Kw]===e)},Ww=H,Vw=X,mf=W,Zw=Or,Jw=Pe,Yw=po,gf=function(){},yf=Jw("Reflect","construct"),Ao=/^\s*(?:class|function)\b/,Xw=Ww(Ao.exec),qw=!Ao.test(gf),tr=function(t){if(!mf(t))return!1;try{return yf(gf,[],t),!0}catch{return!1}},wf=function(t){if(!mf(t))return!1;switch(Zw(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return qw||!!Xw(Ao,Yw(t))}catch{return!0}};wf.sham=!0;var bf=!yf||Vw(function(){var e;return tr(tr.call)||!tr(Object)||!tr(function(){e=!0})||e})?wf:tr,Qw=Q,eb=Ce,tb=vt,rb=function(e,t,r){Qw?eb.f(e,t,tb(0,r)):e[t]=r},nb=Zt,ab=te,ib=xn,ob=zw,sb=pf,cb=bf,ub=so,fc=rb,lb=Eo,fb=Gn,dc=Array,db=function(t){var r=ib(t),n=cb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=nb(i,a>2?arguments[2]:void 0));var s=fb(r),u=0,f,l,c,d,v,p;if(s&&!(this===dc&&sb(s)))for(l=n?new this:[],d=lb(r,s),v=d.next;!(c=ab(v,d)).done;u++)p=o?ob(d,i,[c.value,u],!0):c.value,fc(l,u,p);else for(f=ub(r),l=n?new this(f):dc(f);f>u;u++)p=o?i(r[u],u):r[u],fc(l,u,p);return l.length=u,l},mt=H,_a=2147483647,vr=36,Sf=1,Li=26,vb=38,hb=700,pb=72,mb=128,gb="-",yb=/[^\0-\u007E]/,$f=/[.\u3002\uFF0E\uFF61]/g,vc="Overflow: input needs wider integers to process",Ra=vr-Sf,hc=RangeError,wb=mt($f.exec),kt=Math.floor,Ca=String.fromCharCode,pc=mt("".charCodeAt),If=mt([].join),We=mt([].push),bb=mt("".replace),Sb=mt("".split),$b=mt("".toLowerCase),Ib=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=pc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=pc(e,r++);(i&64512)===56320?We(t,((a&1023)<<10)+(i&1023)+65536):(We(t,a),r--)}else We(t,a)}return t},mc=function(e){return e+22+75*(e<26)},Eb=function(e,t,r){var n=0;for(e=r?kt(e/hb):e>>1,e+=kt(e/t);e>Ra*Li>>1;)e=kt(e/Ra),n+=vr;return kt(n+(Ra+1)*e/(e+vb))},Tb=function(e){var t=[];e=Ib(e);var r=e.length,n=mb,a=0,i=pb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&We(t,Ca(s));var u=t.length,f=u;for(u&&We(t,gb);f<r;){var l=_a;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((_a-a)/c))throw new hc(vc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>_a)throw new hc(vc);if(s===n){for(var d=a,v=vr;;){var p=v<=i?Sf:v>=i+Li?Li:v-i;if(d<p)break;var S=d-p,g=vr-p;We(t,Ca(mc(p+S%g))),d=kt(S/g),v+=vr}We(t,Ca(mc(d))),i=Eb(a,c,f===u),a=0,f++}}a++,n++}return If(t,"")},Pb=function(e){var t=[],r=Sb(bb($b(e),$f,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],We(t,wb(yb,a)?"xn--"+Tb(a):a);return If(t,".")},Ob=ee,jo=Q,kb=Hn,Lo=G,gc=Zt,we=H,bn=ye,fe=Kn,_b=$o,Ni=me,No=Uw,bt=db,be=To,Rb=ff.codeAt,Cb=Pb,Ne=Me,Ab=Vt,jb=pt,Ef=tw,Tf=Wt,Lb=Tf.set,Sn=Tf.getterFor("URL"),Nb=Ef.URLSearchParams,Ub=Ef.getState,rr=Lo.URL,Ui=Lo.TypeError,$n=Lo.parseInt,xb=Math.floor,yc=Math.pow,pe=we("".charAt),Ie=we(/./.exec),sr=we([].join),Db=we(1 .toString),Mb=we([].pop),Et=we([].push),Aa=we("".replace),Fb=we([].shift),zb=we("".split),hr=we("".slice),In=we("".toLowerCase),Bb=we([].unshift),Hb="Invalid authority",ja="Invalid scheme",Xe="Invalid host",wc="Invalid port",Pf=/[a-z]/i,Kb=/[\d+-.a-z]/i,xi=/\d/,Gb=/^0x/i,Wb=/^[0-7]+$/,Vb=/^\d+$/,Of=/^[\da-f]+$/i,Zb=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Jb=/[\0\t\n\r #/:<>?@[\\\]^|]/,Yb=/^[\u0000-\u0020]+/,Xb=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,qb=/[\t\n\r]/g,de,Qb=function(e){var t=zb(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&pe(i,0)==="0"&&(o=Ie(Gb,i)?16:8,i=hr(i,o===8?1:2)),i==="")s=0;else{if(!Ie(o===10?Vb:o===8?Wb:Of,i))return e;s=$n(i,o)}Et(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=yc(256,5-r))return null}else if(s>255)return null;for(u=Mb(n),a=0;a<n.length;a++)u+=n[a]*yc(256,3-a);return u},eS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return pe(e,a)};if(d()===":"){if(pe(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ie(Of,d());)i=i*16+$n(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ie(xi,d()))return;for(;Ie(xi,d());){if(f=$n(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},tS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r&&(t=n,r=a),t},nr=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)Bb(t,e%256),e=xb(e/256);return sr(t,".")}else if(typeof e=="object"){for(t="",n=tS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Db(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},fn={},kf=No({},fn,{" ":1,'"':1,"<":1,">":1,"`":1}),_f=No({},kf,{"#":1,"?":1,"{":1,"}":1}),La=No({},_f,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Be=function(e,t){var r=Rb(e,0);return r>32&&r<127&&!Ni(t,e)?e:encodeURIComponent(e)},Kr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},cr=function(e,t){var r;return e.length===2&&Ie(Pf,pe(e,0))&&((r=pe(e,1))===":"||!t&&r==="|")},bc=function(e){var t;return e.length>1&&cr(hr(e,0,2))&&(e.length===2||(t=pe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},rS=function(e){return e==="."||In(e)==="%2e"},nS=function(e){return e=In(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},Na={},Sc={},Ua={},$c={},Ic={},xa={},Ec={},Tc={},Gr={},Wr={},Da={},Ma={},Fa={},za={},Pc={},Ba={},St={},ke={},Oc={},qe={},Le={},Uo=function(e,t,r){var n=Ne(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Ui(i);this.searchParams=null}else{if(r!==void 0&&(a=new Uo(r,!0)),i=this.parse(n,null,a),i)throw new Ui(i);o=Ub(new Nb),o.bindURL(this),this.searchParams=o}};Uo.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||Na,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ne(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=Aa(e,Yb,""),e=Aa(e,Xb,"$1")),e=Aa(e,qb,""),l=bt(e);i<=l.length;){switch(c=l[i],a){case Na:if(c&&Ie(Pf,c))o+=In(c),a=Sc;else{if(t)return ja;a=Ua;continue}break;case Sc:if(c&&(Ie(Kb,c)||c==="+"||c==="-"||c==="."))o+=In(c);else if(c===":"){if(t&&(n.isSpecial()!==Ni(Kr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Kr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=za:n.isSpecial()&&r&&r.scheme===n.scheme?a=$c:n.isSpecial()?a=Tc:l[i+1]==="/"?(a=Ic,i++):(n.cannotBeABaseURL=!0,Et(n.path,""),a=Oc)}else{if(t)return ja;o="",a=Ua,i=0;continue}break;case Ua:if(!r||r.cannotBeABaseURL&&c!=="#")return ja;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=be(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Le;break}a=r.scheme==="file"?za:xa;continue;case $c:if(c==="/"&&l[i+1]==="/")a=Gr,i++;else{a=xa;continue}break;case Ic:if(c==="/"){a=Wr;break}else{a=ke;continue}case xa:if(n.scheme=r.scheme,c===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=Ec;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query="",a=qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query,n.fragment="",a=Le;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.path.length--,a=ke;continue}break;case Ec:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Gr;else if(c==="/")a=Wr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=ke;continue}break;case Tc:if(a=Gr,c!=="/"||pe(o,i+1)!=="/")continue;i++;break;case Gr:if(c!=="/"&&c!=="\\"){a=Wr;continue}break;case Wr:if(c==="@"){s&&(o="%40"+o),s=!0,d=bt(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=Be(S,La);f?n.password+=g:n.username+=g}o=""}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return Hb;i-=bt(o).length+1,o="",a=Da}else o+=c;break;case Da:case Ma:if(t&&n.scheme==="file"){a=Ba;continue}else if(c===":"&&!u){if(o==="")return Xe;if(v=n.parseHost(o),v)return v;if(o="",a=Fa,t===Ma)return}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Xe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=St,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Fa:if(Ie(xi,c))o+=c;else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var E=$n(o,10);if(E>65535)return wc;n.port=n.isSpecial()&&E===Kr[n.scheme]?null:E,o=""}if(t)return;a=St;continue}else return wc;break;case za:if(n.scheme="file",c==="/"||c==="\\")a=Pc;else if(r&&r.scheme==="file")switch(c){case de:n.host=r.host,n.path=be(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=be(r.path),n.query="",a=qe;break;case"#":n.host=r.host,n.path=be(r.path),n.query=r.query,n.fragment="",a=Le;break;default:bc(sr(be(l,i),""))||(n.host=r.host,n.path=be(r.path),n.shortenPath()),a=ke;continue}else{a=ke;continue}break;case Pc:if(c==="/"||c==="\\"){a=Ba;break}r&&r.scheme==="file"&&!bc(sr(be(l,i),""))&&(cr(r.path[0],!0)?Et(n.path,r.path[0]):n.host=r.host),a=ke;continue;case Ba:if(c===de||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&cr(o))a=ke;else if(o===""){if(n.host="",t)return;a=St}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=St}continue}else o+=c;break;case St:if(n.isSpecial()){if(a=ke,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=qe;else if(!t&&c==="#")n.fragment="",a=Le;else if(c!==de&&(a=ke,c!=="/"))continue;break;case ke:if(c===de||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(nS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,"")):rS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Et(n.path,""):(n.scheme==="file"&&!n.path.length&&cr(o)&&(n.host&&(n.host=""),o=pe(o,0)+":"),Et(n.path,o)),o="",n.scheme==="file"&&(c===de||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Fb(n.path);c==="?"?(n.query="",a=qe):c==="#"&&(n.fragment="",a=Le)}else o+=Be(c,_f);break;case Oc:c==="?"?(n.query="",a=qe):c==="#"?(n.fragment="",a=Le):c!==de&&(n.path[0]+=Be(c,fn));break;case qe:!t&&c==="#"?(n.fragment="",a=Le):c!==de&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Be(c,fn));break;case Le:c!==de&&(n.fragment+=Be(c,kf));break}i++}},parseHost:function(e){var t,r,n;if(pe(e,0)==="["){if(pe(e,e.length-1)!=="]"||(t=eS(hr(e,1,-1)),!t))return Xe;this.host=t}else if(this.isSpecial()){if(e=Cb(e),Ie(Zb,e)||(t=Qb(e),t===null))return Xe;this.host=t}else{if(Ie(Jb,e))return Xe;for(t="",r=bt(e),n=0;n<r.length;n++)t+=Be(r[n],fn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Ni(Kr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!cr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=nr(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+sr(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Ui(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new xt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+nr(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ne(e)+":",Na)},getUsername:function(){return this.username},setUsername:function(e){var t=bt(Ne(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Be(t[r],La)}},getPassword:function(){return this.password},setPassword:function(e){var t=bt(Ne(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Be(t[r],La)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?nr(e):nr(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Da)},getHostname:function(){var e=this.host;return e===null?"":nr(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ma)},getPort:function(){var e=this.port;return e===null?"":Ne(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ne(e),e===""?this.port=null:this.parse(e,Fa))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+sr(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,St))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ne(e),e===""?this.query=null:(pe(e,0)==="?"&&(e=hr(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ne(e),e===""){this.fragment=null;return}pe(e,0)==="#"&&(e=hr(e,1)),this.fragment="",this.parse(e,Le)},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var r=_b(this,re),n=jb(arguments.length,1)>1?arguments[1]:void 0,a=Lb(r,new Uo(t,!1,n));jo||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},re=xt.prototype,ve=function(e,t){return{get:function(){return Sn(this)[e]()},set:t&&function(r){return Sn(this)[t](r)},configurable:!0,enumerable:!0}};jo&&(fe(re,"href",ve("serialize","setHref")),fe(re,"origin",ve("getOrigin")),fe(re,"protocol",ve("getProtocol","setProtocol")),fe(re,"username",ve("getUsername","setUsername")),fe(re,"password",ve("getPassword","setPassword")),fe(re,"host",ve("getHost","setHost")),fe(re,"hostname",ve("getHostname","setHostname")),fe(re,"port",ve("getPort","setPort")),fe(re,"pathname",ve("getPathname","setPathname")),fe(re,"search",ve("getSearch","setSearch")),fe(re,"searchParams",ve("getSearchParams")),fe(re,"hash",ve("getHash","setHash")));bn(re,"toJSON",function(){return Sn(this).serialize()},{enumerable:!0});bn(re,"toString",function(){return Sn(this).serialize()},{enumerable:!0});if(rr){var kc=rr.createObjectURL,_c=rr.revokeObjectURL;kc&&bn(xt,"createObjectURL",gc(kc,rr)),_c&&bn(xt,"revokeObjectURL",gc(_c,rr))}Ab(xt,"URL");Ob({global:!0,constructor:!0,forced:!kb,sham:!jo},{URL:xt});var aS=ee,iS=Pe,Rf=X,oS=pt,Rc=Me,sS=Hn,xo=iS("URL"),cS=sS&&Rf(function(){xo.canParse()}),uS=Rf(function(){return xo.canParse.length!==1});aS({target:"URL",stat:!0,forced:!cS||uS},{canParse:function(t){var r=oS(arguments.length,1),n=Rc(t),a=r<2||arguments[1]===void 0?void 0:Rc(arguments[1]);try{return!!new xo(n,a)}catch{return!1}}});var lS=ee,fS=Pe,dS=pt,Cc=Me,vS=Hn,hS=fS("URL");lS({target:"URL",stat:!0,forced:!vS},{parse:function(t){var r=dS(arguments.length,1),n=Cc(t),a=r<2||arguments[1]===void 0?void 0:Cc(arguments[1]);try{return new hS(n,a)}catch{return null}}});var pS=ee,mS=te;pS({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return mS(URL.prototype.toString,this)}});var gS=Ro;gS.URL;var yS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},wS=Mn,Ha=wS("span").classList,Ac=Ha&&Ha.constructor&&Ha.constructor.prototype,bS=Ac===Object.prototype?void 0:Ac,jc=G,Cf=yS,SS=bS,ur=xg,Lc=ht,$S=Vt,IS=q,Ka=IS("iterator"),Ga=ur.values,Af=function(e,t){if(e){if(e[Ka]!==Ga)try{Lc(e,Ka,Ga)}catch{e[Ka]=Ga}if($S(e,t,!0),Cf[t]){for(var r in ur)if(e[r]!==ur[r])try{Lc(e,r,ur[r])}catch{e[r]=ur[r]}}}};for(var Wa in Cf)Af(jc[Wa]&&jc[Wa].prototype,Wa);Af(SS,"DOMTokenList");var ES=ge,TS=ht,PS=function(e,t){ES(t)&&"cause"in t&&TS(e,"cause",t.cause)},OS=H,jf=Error,kS=OS("".replace),_S=function(e){return String(new jf(e).stack)}("zxcasd"),Lf=/\n\s*at [^:]*:[^\n]*/,RS=Lf.test(_S),CS=function(e,t){if(RS&&typeof e=="string"&&!jf.prepareStackTrace)for(;t--;)e=kS(e,Lf,"");return e},AS=X,jS=vt,LS=!AS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",jS(1,7)),e.stack!==7):!0}),NS=ht,US=CS,xS=LS,Nc=Error.captureStackTrace,DS=function(e,t,r,n){xS&&(Nc?Nc(e,t):NS(e,"stack",US(r,n)))},MS=Zt,FS=te,zS=Te,BS=zn,HS=pf,KS=so,Uc=Fn,GS=Eo,WS=Gn,xc=hf,VS=TypeError,dn=function(e,t){this.stopped=e,this.result=t},Dc=dn.prototype,kr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=MS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&xc(f,"normal",I),new dn(!0,I)},E=function(I){return a?(zS(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=WS(e),!l)throw new VS(BS(e)+" is not iterable");if(HS(l)){for(c=0,d=KS(e);d>c;c++)if(v=E(e[c]),v&&Uc(Dc,v))return v;return new dn(!1)}f=GS(e,l)}for(p=i?e.next:f.next;!(S=FS(p,f)).done;){try{v=E(S.value)}catch(I){xc(f,"throw",I)}if(typeof v=="object"&&v&&Uc(Dc,v))return v}return new dn(!1)},ZS=Me,JS=function(e,t){return e===void 0?arguments.length<2?"":t:ZS(e)},YS=ee,XS=Fn,qS=yo,En=wo,QS=zl,Nf=Bn,Va=ht,Za=vt,e$=PS,t$=DS,r$=kr,n$=JS,a$=q,i$=a$("toStringTag"),Tn=Error,o$=[].push,Dt=function(t,r){var n=XS(Ja,this),a;En?a=En(new Tn,n?qS(this):Ja):(a=n?this:Nf(Ja),Va(a,i$,"Error")),r!==void 0&&Va(a,"message",n$(r)),t$(a,Dt,a.stack,1),arguments.length>2&&e$(a,arguments[2]);var i=[];return r$(t,o$,{that:i}),Va(a,"errors",i),a};En?En(Dt,Tn):QS(Dt,Tn,{name:!0});var Ja=Dt.prototype=Nf(Tn.prototype,{constructor:Za(1,Dt),message:Za(1,""),name:Za(1,"AggregateError")});YS({global:!0,constructor:!0,arity:2},{AggregateError:Dt});var s$=Io,c$=Or,u$=s$?{}.toString:function(){return"[object "+c$(this)+"]"},l$=Io,f$=ye,d$=u$;l$||f$(Object.prototype,"toString",d$,{unsafe:!0});var v$=G,h$=Ln,Yn=h$(v$.process)==="process",p$=Pe,m$=Kn,g$=q,y$=Q,Mc=g$("species"),w$=function(e){var t=p$(e);y$&&t&&!t[Mc]&&m$(t,Mc,{configurable:!0,get:function(){return this}})},b$=bf,S$=zn,$$=TypeError,I$=function(e){if(b$(e))return e;throw new $$(S$(e)+" is not a constructor")},Fc=Te,E$=I$,T$=Nn,P$=q,O$=P$("species"),Uf=function(e,t){var r=Fc(e).constructor,n;return r===void 0||T$(n=Fc(r)[O$])?t:E$(n)},k$=jn,xf=Function.prototype,zc=xf.apply,Bc=xf.call,_$=typeof Reflect=="object"&&Reflect.apply||(k$?Bc.bind(zc):function(){return Bc.apply(zc,arguments)}),R$=Dn,Df=/(?:ipad|iphone|ipod).*applewebkit/i.test(R$),ce=G,C$=_$,A$=Zt,Hc=W,j$=me,Mf=X,Kc=_l,L$=To,Gc=Mn,N$=pt,U$=Df,x$=Yn,Di=ce.setImmediate,Mi=ce.clearImmediate,D$=ce.process,Ya=ce.Dispatch,M$=ce.Function,Wc=ce.MessageChannel,F$=ce.String,Xa=0,pr={},Vc="onreadystatechange",$r,Qe,qa,Qa;Mf(function(){$r=ce.location});var Do=function(e){if(j$(pr,e)){var t=pr[e];delete pr[e],t()}},ei=function(e){return function(){Do(e)}},Zc=function(e){Do(e.data)},Jc=function(e){ce.postMessage(F$(e),$r.protocol+"//"+$r.host)};(!Di||!Mi)&&(Di=function(t){N$(arguments.length,1);var r=Hc(t)?t:M$(t),n=L$(arguments,1);return pr[++Xa]=function(){C$(r,void 0,n)},Qe(Xa),Xa},Mi=function(t){delete pr[t]},x$?Qe=function(e){D$.nextTick(ei(e))}:Ya&&Ya.now?Qe=function(e){Ya.now(ei(e))}:Wc&&!U$?(qa=new Wc,Qa=qa.port2,qa.port1.onmessage=Zc,Qe=A$(Qa.postMessage,Qa)):ce.addEventListener&&Hc(ce.postMessage)&&!ce.importScripts&&$r&&$r.protocol!=="file:"&&!Mf(Jc)?(Qe=Jc,ce.addEventListener("message",Zc,!1)):Vc in Gc("script")?Qe=function(e){Kc.appendChild(Gc("script"))[Vc]=function(){Kc.removeChild(this),Do(e)}}:Qe=function(e){setTimeout(ei(e),0)});var Ff={set:Di,clear:Mi},zf=function(){this.head=null,this.tail=null};zf.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var Bf=zf,z$=Dn,B$=/ipad|iphone|ipod/i.test(z$)&&typeof Pebble<"u",H$=Dn,K$=/web0s(?!.*chrome)/i.test(H$),Mt=G,G$=Xl,Yc=Zt,ti=Ff.set,W$=Bf,V$=Df,Z$=B$,J$=K$,ri=Yn,Xc=Mt.MutationObserver||Mt.WebKitMutationObserver,qc=Mt.document,Qc=Mt.process,Vr=Mt.Promise,Fi=G$("queueMicrotask"),$t,ni,ai,Zr,eu;if(!Fi){var Jr=new W$,Yr=function(){var e,t;for(ri&&(e=Qc.domain)&&e.exit();t=Jr.get();)try{t()}catch(r){throw Jr.head&&$t(),r}e&&e.enter()};!V$&&!ri&&!J$&&Xc&&qc?(ni=!0,ai=qc.createTextNode(""),new Xc(Yr).observe(ai,{characterData:!0}),$t=function(){ai.data=ni=!ni}):!Z$&&Vr&&Vr.resolve?(Zr=Vr.resolve(void 0),Zr.constructor=Vr,eu=Yc(Zr.then,Zr),$t=function(){eu(Yr)}):ri?$t=function(){Qc.nextTick(Yr)}:(ti=Yc(ti,Mt),$t=function(){ti(Yr)}),Fi=function(e){Jr.head||$t(),Jr.add(e)}}var Y$=Fi,X$=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},_r=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},q$=G,Rr=q$.Promise,Hf=typeof Deno=="object"&&Deno&&typeof Deno.version=="object",Q$=Hf,eI=Yn,tI=!Q$&&!eI&&typeof window=="object"&&typeof document=="object",rI=G,mr=Rr,nI=W,aI=Bl,iI=po,oI=q,sI=tI,cI=Hf,ii=wl;mr&&mr.prototype;var uI=oI("species"),zi=!1,Kf=nI(rI.PromiseRejectionEvent),lI=aI("Promise",function(){var e=iI(mr),t=e!==String(mr);if(!t&&ii===66)return!0;if(!ii||ii<51||!/native code/.test(e)){var r=new mr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[uI]=n,zi=r.then(function(){})instanceof n,!zi)return!0}return!t&&(sI||cI)&&!Kf}),Cr={CONSTRUCTOR:lI,REJECTION_EVENT:Kf,SUBCLASSING:zi},Fe={},tu=Ae,fI=TypeError,dI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new fI("Bad Promise constructor");t=n,r=a}),this.resolve=tu(t),this.reject=tu(r)};Fe.f=function(e){return new dI(e)};var vI=ee,Pn=Yn,Je=G,Ft=te,ru=ye,nu=wo,hI=Vt,pI=w$,mI=Ae,vn=W,gI=ge,yI=$o,wI=Uf,Gf=Ff.set,Mo=Y$,bI=X$,SI=_r,$I=Bf,Wf=Wt,On=Rr,Fo=Cr,Vf=Fe,Xn="Promise",Zf=Fo.CONSTRUCTOR,II=Fo.REJECTION_EVENT,EI=Fo.SUBCLASSING,oi=Wf.getterFor(Xn),TI=Wf.set,Tt=On&&On.prototype,tt=On,Xr=Tt,Jf=Je.TypeError,Bi=Je.document,zo=Je.process,Hi=Vf.f,PI=Hi,OI=!!(Bi&&Bi.createEvent&&Je.dispatchEvent),Yf="unhandledrejection",kI="rejectionhandled",au=0,Xf=1,_I=2,Bo=1,qf=2,qr,iu,RI,ou,Qf=function(e){var t;return gI(e)&&vn(t=e.then)?t:!1},ed=function(e,t){var r=t.value,n=t.state===Xf,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===qf&&AI(t),t.rejection=Bo),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new Jf("Promise-chain cycle")):(f=Qf(u))?Ft(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},td=function(e,t){e.notified||(e.notified=!0,Mo(function(){for(var r=e.reactions,n;n=r.get();)ed(n,e);e.notified=!1,t&&!e.rejection&&CI(e)}))},rd=function(e,t,r){var n,a;OI?(n=Bi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Je.dispatchEvent(n)):n={promise:t,reason:r},!II&&(a=Je["on"+e])?a(n):e===Yf&&bI("Unhandled promise rejection",r)},CI=function(e){Ft(Gf,Je,function(){var t=e.facade,r=e.value,n=su(e),a;if(n&&(a=SI(function(){Pn?zo.emit("unhandledRejection",r,t):rd(Yf,t,r)}),e.rejection=Pn||su(e)?qf:Bo,a.error))throw a.value})},su=function(e){return e.rejection!==Bo&&!e.parent},AI=function(e){Ft(Gf,Je,function(){var t=e.facade;Pn?zo.emit("rejectionHandled",t):rd(kI,t,e.value)})},_t=function(e,t,r){return function(n){e(t,n,r)}},At=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=_I,td(e,!0))},Ki=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new Jf("Promise can't be resolved itself");var n=Qf(t);n?Mo(function(){var a={done:!1};try{Ft(n,t,_t(Ki,a,e),_t(At,a,e))}catch(i){At(a,i,e)}}):(e.value=t,e.state=Xf,td(e,!1))}catch(a){At({done:!1},a,e)}}};if(Zf&&(tt=function(t){yI(this,Xr),mI(t),Ft(qr,this);var r=oi(this);try{t(_t(Ki,r),_t(At,r))}catch(n){At(r,n)}},Xr=tt.prototype,qr=function(t){TI(this,{type:Xn,done:!1,notified:!1,parent:!1,reactions:new $I,rejection:!1,state:au,value:void 0})},qr.prototype=ru(Xr,"then",function(t,r){var n=oi(this),a=Hi(wI(this,tt));return n.parent=!0,a.ok=vn(t)?t:!0,a.fail=vn(r)&&r,a.domain=Pn?zo.domain:void 0,n.state===au?n.reactions.add(a):Mo(function(){ed(a,n)}),a.promise}),iu=function(){var e=new qr,t=oi(e);this.promise=e,this.resolve=_t(Ki,t),this.reject=_t(At,t)},Vf.f=Hi=function(e){return e===tt||e===RI?new iu(e):PI(e)},vn(On)&&Tt!==Object.prototype)){ou=Tt.then,EI||ru(Tt,"then",function(t,r){var n=this;return new tt(function(a,i){Ft(ou,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Tt.constructor}catch{}nu&&nu(Tt,Xr)}vI({global:!0,constructor:!0,wrap:!0,forced:Zf},{Promise:tt});hI(tt,Xn,!1);pI(Xn);var jI=q,nd=jI("iterator"),ad=!1;try{var LI=0,cu={next:function(){return{done:!!LI++}},return:function(){ad=!0}};cu[nd]=function(){return this},Array.from(cu,function(){throw 2})}catch{}var NI=function(e,t){try{if(!t&&!ad)return!1}catch{return!1}var r=!1;try{var n={};n[nd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},UI=Rr,xI=NI,DI=Cr.CONSTRUCTOR,qn=DI||!xI(function(e){UI.all(e).then(void 0,function(){})}),MI=ee,FI=te,zI=Ae,BI=Fe,HI=_r,KI=kr,GI=qn;MI({target:"Promise",stat:!0,forced:GI},{all:function(t){var r=this,n=BI.f(r),a=n.resolve,i=n.reject,o=HI(function(){var s=zI(r.resolve),u=[],f=0,l=1;KI(t,function(c){var d=f++,v=!1;l++,FI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var WI=ee,VI=Cr.CONSTRUCTOR,Gi=Rr,ZI=Pe,JI=W,YI=ye,uu=Gi&&Gi.prototype;WI({target:"Promise",proto:!0,forced:VI,real:!0},{catch:function(e){return this.then(void 0,e)}});if(JI(Gi)){var lu=ZI("Promise").prototype.catch;uu.catch!==lu&&YI(uu,"catch",lu,{unsafe:!0})}var XI=ee,qI=te,QI=Ae,e0=Fe,t0=_r,r0=kr,n0=qn;XI({target:"Promise",stat:!0,forced:n0},{race:function(t){var r=this,n=e0.f(r),a=n.reject,i=t0(function(){var o=QI(r.resolve);r0(t,function(s){qI(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var a0=ee,i0=Fe,o0=Cr.CONSTRUCTOR;a0({target:"Promise",stat:!0,forced:o0},{reject:function(t){var r=i0.f(this),n=r.reject;return n(t),r.promise}});var s0=Te,c0=ge,u0=Fe,id=function(e,t){if(s0(e),c0(t)&&t.constructor===e)return t;var r=u0.f(e),n=r.resolve;return n(t),r.promise},l0=ee,f0=Pe,d0=Cr.CONSTRUCTOR,v0=id;f0("Promise");l0({target:"Promise",stat:!0,forced:d0},{resolve:function(t){return v0(this,t)}});var h0=ee,p0=te,m0=Ae,g0=Fe,y0=_r,w0=kr,b0=qn;h0({target:"Promise",stat:!0,forced:b0},{allSettled:function(t){var r=this,n=g0.f(r),a=n.resolve,i=n.reject,o=y0(function(){var s=m0(r.resolve),u=[],f=0,l=1;w0(t,function(c){var d=f++,v=!1;l++,p0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var S0=ee,$0=te,I0=Ae,E0=Pe,T0=Fe,P0=_r,O0=kr,k0=qn,fu="No one promise resolved";S0({target:"Promise",stat:!0,forced:k0},{any:function(t){var r=this,n=E0("AggregateError"),a=T0.f(r),i=a.resolve,o=a.reject,s=P0(function(){var u=I0(r.resolve),f=[],l=0,c=1,d=!1;O0(t,function(v){var p=l++,S=!1;c++,$0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,fu)))})}),--c||o(new n(f,fu))});return s.error&&o(s.value),a.promise}});var _0=ee,R0=Fe;_0({target:"Promise",stat:!0},{withResolvers:function(){var t=R0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var C0=ee,kn=Rr,A0=X,od=Pe,sd=W,j0=Uf,du=id,L0=ye,Wi=kn&&kn.prototype,N0=!!kn&&A0(function(){Wi.finally.call({then:function(){}},function(){})});C0({target:"Promise",proto:!0,real:!0,forced:N0},{finally:function(e){var t=j0(this,od("Promise")),r=sd(e);return this.then(r?function(n){return du(t,e()).then(function(){return n})}:e,r?function(n){return du(t,e()).then(function(){throw n})}:e)}});if(sd(kn)){var vu=od("Promise").prototype.finally;Wi.finally!==vu&&L0(Wi,"finally",vu,{unsafe:!0})}var U0=Ro;U0.Promise;function Ye(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function _e(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ho(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ko(e,t){return e(t={exports:{}},t.exports),t.exports}var et=Ko(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Ho(et);var x0=Ho(Ko(function(e,t){var r=rt&&rt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function E(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,E)}I((v=v.apply(l,c||[])).next())})},n=rt&&rt.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return S={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function E(I){return function(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},a=rt;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,p,S,g,E,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(E=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:E,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,E;return n(this,function(I){switch(I.label){case 0:return[4,et.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(et.default().unlock(d),[2]):((E=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(E)),et.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(et.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var p=!1,S=Date.now(),g=!1;function E(){if(g||(window.removeEventListener("storage",E),l.removeFromWaiting(E),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(null)}}window.addEventListener("storage",E),l.addToWaiting(E);var I=setTimeout(E,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,et.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),et.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var E=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),E=!0)}}}E&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const D0={timeoutInSeconds:60},cd={name:"auth0-spa-js",version:"2.1.3"},ud=()=>Date.now();let se=class Vi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Vi.prototype)}static fromPayload({error:t,error_description:r}){return new Vi(t,r)}},M0=class ld extends se{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,ld.prototype)}},Zi=class fd extends se{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,fd.prototype)}},F0=class dd extends Zi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,dd.prototype)}},z0=class vd extends se{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,vd.prototype)}},B0=class hd extends se{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,hd.prototype)}},pd=class md extends se{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${hu(t,["default"])}', scope: '${hu(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,md.prototype)}};function hu(e,t=[]){return e&&!t.includes(e)?e:""}const hn=()=>window.crypto,si=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(hn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},pu=e=>btoa(e),Ji=e=>{var{clientId:t}=e,r=_e(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},mu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),H0=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},K0=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([H0(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},G0=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},W0=async(e,t,r,n,a,i,o=1e4)=>a?G0(e,t,r,n,o,a,i):K0(e,n,o);async function V0(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=_e(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?Ji(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let E,I=null;for(let C=0;C<3;C++)try{E=await W0(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=E.json,{error:h,error_description:$}=b,k=_e(b,["error","error_description"]),{ok:_}=E;if(!_){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new B0(h,C,k.mfa_token):h==="missing_refresh_token"?new pd(d,v):new se(h||"request_error",C)}return k}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||cd))}},t,s)}const Qr=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class Yi{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new Yi({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Yi({scope:r,audience:n,clientId:a})}},Z0=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},gd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},J0=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||ud}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new it({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},Y0=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const ar=e=>typeof e=="number",X0=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],q0=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(mu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],X0.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(mu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!ar(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!ar(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ar(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&ar(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&ar(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ot=Ko(function(e,t){var r=rt&&rt.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Ho(ot),ot.encode,ot.parse,ot.getAll;var Q0=ot.get,yd=ot.set,wd=ot.remove;const Pt={get(e){const t=Q0(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),yd(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wd(e,r)}},eE={get(e){return Pt.get(e)||Pt.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),yd(`_legacy_${e}`,JSON.stringify(t),n),Pt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),wd(e,r),Pt.remove(e,t),Pt.remove(`_legacy_${e}`,t)}},tE={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function rE(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
2
- `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var gu,yu,wu,ci,nE=(gu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",yu=null,wu=!1,function(e){return ci=ci||rE(gu,yu,wu),new Worker(ci,e)});const ui={};let aE=class{constructor(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(t),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(t){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(t),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}};const iE={memory:()=>new gd().enclosedCache,localstorage:()=>new Z0},bu=e=>iE[e],Su=e=>{const{openUrl:t,onRedirect:r}=e,n=_e(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},li=new x0;let oE=class{constructor(t){let r,n;if(this.userCache=new gd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await li.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!hn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(hn().subtle===void 0)throw new Error(`
1
+ "use strict";var pv=Object.defineProperty;var mv=(e,t,r)=>t in e?pv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>mv(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Ur=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},q=function(e){try{return!!e()}catch{return!0}},gv=q,Un=!gv(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),yl=Un,wl=Function.prototype,Si=wl.call,yv=yl&&wl.bind.bind(Si,Si),K=yl?yv:function(e){return function(){return Si.apply(e,arguments)}},bl=K,wv=bl({}.toString),bv=bl("".slice),xn=function(e){return bv(wv(e),8,-1)},Sv=K,$v=q,Iv=xn,sa=Object,Tv=Sv("".split),Sl=$v(function(){return!sa("z").propertyIsEnumerable(0)})?function(e){return Iv(e)==="String"?Tv(e,""):sa(e)}:sa,Dn=function(e){return e==null},Ev=Dn,Pv=TypeError,Mn=function(e){if(Ev(e))throw new Pv("Can't call method on "+e);return e},Ov=Sl,kv=Mn,Pr=function(e){return Ov(kv(e))},Qt=function(e){return e&&e.Math===Math&&e},H=Qt(typeof globalThis=="object"&&globalThis)||Qt(typeof window=="object"&&window)||Qt(typeof self=="object"&&self)||Qt(typeof Ur=="object"&&Ur)||Qt(typeof Ur=="object"&&Ur)||function(){return this}()||Function("return this")(),$l={exports:{}},_v=!1,os=H,Rv=Object.defineProperty,oo=function(e,t){try{Rv(os,e,{value:t,configurable:!0,writable:!0})}catch{os[e]=t}return t},Cv=H,Av=oo,ss="__core-js_shared__",cs=$l.exports=Cv[ss]||Av(ss,{});(cs.versions||(cs.versions=[])).push({version:"3.38.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.38.0/LICENSE",source:"https://github.com/zloirock/core-js"});var so=$l.exports,us=so,Il=function(e,t){return us[e]||(us[e]=t||{})},jv=Mn,Lv=Object,Fn=function(e){return Lv(jv(e))},Nv=K,Uv=Fn,xv=Nv({}.hasOwnProperty),me=Object.hasOwn||function(t,r){return xv(Uv(t),r)},Dv=K,Mv=0,Fv=Math.random(),zv=Dv(1 .toString),Tl=function(e){return"Symbol("+(e===void 0?"":e)+")_"+zv(++Mv+Fv,36)},Bv=H,ls=Bv.navigator,fs=ls&&ls.userAgent,Or=fs?String(fs):"",El=H,ca=Or,ds=El.process,vs=El.Deno,hs=ds&&ds.versions||vs&&vs.version,ps=hs&&hs.v8,$e,wn;ps&&($e=ps.split("."),wn=$e[0]>0&&$e[0]<4?1:+($e[0]+$e[1]));!wn&&ca&&($e=ca.match(/Edge\/(\d+)/),(!$e||$e[1]>=74)&&($e=ca.match(/Chrome\/(\d+)/),$e&&(wn=+$e[1])));var Pl=wn,ms=Pl,Hv=q,Kv=H,Gv=Kv.String,Ol=!!Object.getOwnPropertySymbols&&!Hv(function(){var e=Symbol("symbol detection");return!Gv(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ms&&ms<41}),Wv=Ol,kl=Wv&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Vv=H,Zv=Il,gs=me,Jv=Tl,Yv=Ol,Xv=kl,Ot=Vv.Symbol,ua=Zv("wks"),qv=Xv?Ot.for||Ot:Ot&&Ot.withoutSetter||Jv,Q=function(e){return gs(ua,e)||(ua[e]=Yv&&gs(Ot,e)?Ot[e]:qv("Symbol."+e)),ua[e]},la=typeof document=="object"&&document.all,W=typeof la>"u"&&la!==void 0?function(e){return typeof e=="function"||e===la}:function(e){return typeof e=="function"},Qv=W,ge=function(e){return typeof e=="object"?e!==null:Qv(e)},eh=ge,th=String,rh=TypeError,Ee=function(e){if(eh(e))return e;throw new rh(th(e)+" is not an object")},_l={},nh=q,ee=!nh(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ah=ee,ih=q,Rl=ah&&ih(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ae={},oh=H,ys=ge,$i=oh.document,sh=ys($i)&&ys($i.createElement),zn=function(e){return sh?$i.createElement(e):{}},ch=ee,uh=q,lh=zn,Cl=!ch&&!uh(function(){return Object.defineProperty(lh("div"),"a",{get:function(){return 7}}).a!==7}),fh=Un,xr=Function.prototype.call,te=fh?xr.bind(xr):function(){return xr.apply(xr,arguments)},fa=H,dh=W,vh=function(e){return dh(e)?e:void 0},Pe=function(e,t){return arguments.length<2?vh(fa[e]):fa[e]&&fa[e][t]},hh=K,Bn=hh({}.isPrototypeOf),ph=Pe,mh=W,gh=Bn,yh=kl,wh=Object,Al=yh?function(e){return typeof e=="symbol"}:function(e){var t=ph("Symbol");return mh(t)&&gh(t.prototype,wh(e))},bh=String,Hn=function(e){try{return bh(e)}catch{return"Object"}},Sh=W,$h=Hn,Ih=TypeError,Oe=function(e){if(Sh(e))return e;throw new Ih($h(e)+" is not a function")},Th=Oe,Eh=Dn,co=function(e,t){var r=e[t];return Eh(r)?void 0:Th(r)},da=te,va=W,ha=ge,Ph=TypeError,Oh=function(e,t){var r,n;if(t==="string"&&va(r=e.toString)&&!ha(n=da(r,e))||va(r=e.valueOf)&&!ha(n=da(r,e))||t!=="string"&&va(r=e.toString)&&!ha(n=da(r,e)))return n;throw new Ph("Can't convert object to primitive value")},kh=te,ws=ge,bs=Al,_h=co,Rh=Oh,Ch=Q,Ah=TypeError,jh=Ch("toPrimitive"),Lh=function(e,t){if(!ws(e)||bs(e))return e;var r=_h(e,jh),n;if(r){if(t===void 0&&(t="default"),n=kh(r,e,t),!ws(n)||bs(n))return n;throw new Ah("Can't convert object to primitive value")}return t===void 0&&(t="number"),Rh(e,t)},Nh=Lh,Uh=Al,jl=function(e){var t=Nh(e,"string");return Uh(t)?t:t+""},xh=ee,Dh=Cl,Mh=Rl,Dr=Ee,Ss=jl,Fh=TypeError,pa=Object.defineProperty,zh=Object.getOwnPropertyDescriptor,ma="enumerable",ga="configurable",ya="writable";Ae.f=xh?Mh?function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),typeof t=="function"&&r==="prototype"&&"value"in n&&ya in n&&!n[ya]){var a=zh(t,r);a&&a[ya]&&(t[r]=n.value,n={configurable:ga in n?n[ga]:a[ga],enumerable:ma in n?n[ma]:a[ma],writable:!1})}return pa(t,r,n)}:pa:function(t,r,n){if(Dr(t),r=Ss(r),Dr(n),Dh)try{return pa(t,r,n)}catch{}if("get"in n||"set"in n)throw new Fh("Accessors not supported");return"value"in n&&(t[r]=n.value),t};var Bh=Math.ceil,Hh=Math.floor,Kh=Math.trunc||function(t){var r=+t;return(r>0?Hh:Bh)(r)},Gh=Kh,uo=function(e){var t=+e;return t!==t||t===0?0:Gh(t)},Wh=uo,Vh=Math.max,Zh=Math.min,Jh=function(e,t){var r=Wh(e);return r<0?Vh(r+t,0):Zh(r,t)},Yh=uo,Xh=Math.min,qh=function(e){var t=Yh(e);return t>0?Xh(t,9007199254740991):0},Qh=qh,lo=function(e){return Qh(e.length)},ep=Pr,tp=Jh,rp=lo,$s=function(e){return function(t,r,n){var a=ep(t),i=rp(a);if(i===0)return!e&&-1;var o=tp(n,i),s;if(e&&r!==r){for(;i>o;)if(s=a[o++],s!==s)return!0}else for(;i>o;o++)if((e||o in a)&&a[o]===r)return e||o||0;return!e&&-1}},np={includes:$s(!0),indexOf:$s(!1)},fo={},ap=K,wa=me,ip=Pr,op=np.indexOf,sp=fo,Is=ap([].push),Ll=function(e,t){var r=ip(e),n=0,a=[],i;for(i in r)!wa(sp,i)&&wa(r,i)&&Is(a,i);for(;t.length>n;)wa(r,i=t[n++])&&(~op(a,i)||Is(a,i));return a},vo=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],cp=Ll,up=vo,Nl=Object.keys||function(t){return cp(t,up)},lp=ee,fp=Rl,dp=Ae,vp=Ee,hp=Pr,pp=Nl;_l.f=lp&&!fp?Object.defineProperties:function(t,r){vp(t);for(var n=hp(r),a=pp(r),i=a.length,o=0,s;i>o;)dp.f(t,s=a[o++],n[s]);return t};var mp=Pe,Ul=mp("document","documentElement"),gp=Il,yp=Tl,Ts=gp("keys"),ho=function(e){return Ts[e]||(Ts[e]=yp(e))},wp=Ee,bp=_l,Es=vo,Sp=fo,$p=Ul,Ip=zn,Tp=ho,Ps=">",Os="<",Ii="prototype",Ti="script",xl=Tp("IE_PROTO"),ba=function(){},Dl=function(e){return Os+Ti+Ps+e+Os+"/"+Ti+Ps},ks=function(e){e.write(Dl("")),e.close();var t=e.parentWindow.Object;return e=null,t},Ep=function(){var e=Ip("iframe"),t="java"+Ti+":",r;return e.style.display="none",$p.appendChild(e),e.src=String(t),r=e.contentWindow.document,r.open(),r.write(Dl("document.F=Object")),r.close(),r.F},Mr,fn=function(){try{Mr=new ActiveXObject("htmlfile")}catch{}fn=typeof document<"u"?document.domain&&Mr?ks(Mr):Ep():ks(Mr);for(var e=Es.length;e--;)delete fn[Ii][Es[e]];return fn()};Sp[xl]=!0;var Kn=Object.create||function(t,r){var n;return t!==null?(ba[Ii]=wp(t),n=new ba,ba[Ii]=null,n[xl]=t):n=fn(),r===void 0?n:bp.f(n,r)},Pp=Q,Op=Kn,kp=Ae.f,Ei=Pp("unscopables"),Pi=Array.prototype;Pi[Ei]===void 0&&kp(Pi,Ei,{configurable:!0,value:Op(null)});var _p=function(e){Pi[Ei][e]=!0},kr={},Rp=H,Cp=W,_s=Rp.WeakMap,Ap=Cp(_s)&&/native code/.test(String(_s)),vt=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},jp=ee,Lp=Ae,Np=vt,ht=jp?function(e,t,r){return Lp.f(e,t,Np(1,r))}:function(e,t,r){return e[t]=r,e},Up=Ap,Ml=H,xp=ge,Dp=ht,Sa=me,$a=so,Mp=ho,Fp=fo,Rs="Object already initialized",Oi=Ml.TypeError,zp=Ml.WeakMap,bn,Ir,Sn,Bp=function(e){return Sn(e)?Ir(e):bn(e,{})},Hp=function(e){return function(t){var r;if(!xp(t)||(r=Ir(t)).type!==e)throw new Oi("Incompatible receiver, "+e+" required");return r}};if(Up||$a.state){var ke=$a.state||($a.state=new zp);ke.get=ke.get,ke.has=ke.has,ke.set=ke.set,bn=function(e,t){if(ke.has(e))throw new Oi(Rs);return t.facade=e,ke.set(e,t),t},Ir=function(e){return ke.get(e)||{}},Sn=function(e){return ke.has(e)}}else{var gt=Mp("state");Fp[gt]=!0,bn=function(e,t){if(Sa(e,gt))throw new Oi(Rs);return t.facade=e,Dp(e,gt,t),t},Ir=function(e){return Sa(e,gt)?e[gt]:{}},Sn=function(e){return Sa(e,gt)}}var Wt={set:bn,get:Ir,has:Sn,enforce:Bp,getterFor:Hp},po={},mo={},Fl={}.propertyIsEnumerable,zl=Object.getOwnPropertyDescriptor,Kp=zl&&!Fl.call({1:2},1);mo.f=Kp?function(t){var r=zl(this,t);return!!r&&r.enumerable}:Fl;var Gp=ee,Wp=te,Vp=mo,Zp=vt,Jp=Pr,Yp=jl,Xp=me,qp=Cl,Cs=Object.getOwnPropertyDescriptor;po.f=Gp?Cs:function(t,r){if(t=Jp(t),r=Yp(r),qp)try{return Cs(t,r)}catch{}if(Xp(t,r))return Zp(!Wp(Vp.f,t,r),t[r])};var Bl={exports:{}},ki=ee,Qp=me,Hl=Function.prototype,em=ki&&Object.getOwnPropertyDescriptor,go=Qp(Hl,"name"),tm=go&&(function(){}).name==="something",rm=go&&(!ki||ki&&em(Hl,"name").configurable),Kl={EXISTS:go,PROPER:tm,CONFIGURABLE:rm},nm=K,am=W,_i=so,im=nm(Function.toString);am(_i.inspectSource)||(_i.inspectSource=function(e){return im(e)});var yo=_i.inspectSource,wo=K,om=q,sm=W,Fr=me,Ri=ee,cm=Kl.CONFIGURABLE,um=yo,Gl=Wt,lm=Gl.enforce,fm=Gl.get,As=String,dn=Object.defineProperty,dm=wo("".slice),vm=wo("".replace),hm=wo([].join),pm=Ri&&!om(function(){return dn(function(){},"length",{value:8}).length!==8}),mm=String(String).split("String"),gm=Bl.exports=function(e,t,r){dm(As(t),0,7)==="Symbol("&&(t="["+vm(As(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!Fr(e,"name")||cm&&e.name!==t)&&(Ri?dn(e,"name",{value:t,configurable:!0}):e.name=t),pm&&r&&Fr(r,"arity")&&e.length!==r.arity&&dn(e,"length",{value:r.arity});try{r&&Fr(r,"constructor")&&r.constructor?Ri&&dn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var n=lm(e);return Fr(n,"source")||(n.source=hm(mm,typeof t=="string"?t:"")),e};Function.prototype.toString=gm(function(){return sm(this)&&fm(this).source||um(this)},"toString");var Wl=Bl.exports,ym=W,wm=Ae,bm=Wl,Sm=oo,ye=function(e,t,r,n){n||(n={});var a=n.enumerable,i=n.name!==void 0?n.name:t;if(ym(r)&&bm(r,i,n),n.global)a?e[t]=r:Sm(t,r);else{try{n.unsafe?e[t]&&(a=!0):delete e[t]}catch{}a?e[t]=r:wm.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},Vl={},$m=Ll,Im=vo,Tm=Im.concat("length","prototype");Vl.f=Object.getOwnPropertyNames||function(t){return $m(t,Tm)};var bo={};bo.f=Object.getOwnPropertySymbols;var Em=Pe,Pm=K,Om=Vl,km=bo,_m=Ee,Rm=Pm([].concat),Cm=Em("Reflect","ownKeys")||function(t){var r=Om.f(_m(t)),n=km.f;return n?Rm(r,n(t)):r},js=me,Am=Cm,jm=po,Lm=Ae,Zl=function(e,t,r){for(var n=Am(t),a=Lm.f,i=jm.f,o=0;o<n.length;o++){var s=n[o];!js(e,s)&&!(r&&js(r,s))&&a(e,s,i(t,s))}},Nm=q,Um=W,xm=/#|\.prototype\./,_r=function(e,t){var r=Mm[Dm(e)];return r===zm?!0:r===Fm?!1:Um(t)?Nm(t):!!t},Dm=_r.normalize=function(e){return String(e).replace(xm,".").toLowerCase()},Mm=_r.data={},Fm=_r.NATIVE="N",zm=_r.POLYFILL="P",Jl=_r,zr=H,Bm=po.f,Hm=ht,Km=ye,Gm=oo,Wm=Zl,Vm=Jl,Y=function(e,t){var r=e.target,n=e.global,a=e.stat,i,o,s,u,f,l;if(n?o=zr:a?o=zr[r]||Gm(r,{}):o=zr[r]&&zr[r].prototype,o)for(s in t){if(f=t[s],e.dontCallGetSet?(l=Bm(o,s),u=l&&l.value):u=o[s],i=Vm(n?s:r+(a?".":"#")+s,e.forced),!i&&u!==void 0){if(typeof f==typeof u)continue;Wm(f,u)}(e.sham||u&&u.sham)&&Hm(f,"sham",!0),Km(o,s,f,e)}},Zm=q,Jm=!Zm(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ym=me,Xm=W,qm=Fn,Qm=ho,eg=Jm,Ls=Qm("IE_PROTO"),Ci=Object,tg=Ci.prototype,So=eg?Ci.getPrototypeOf:function(e){var t=qm(e);if(Ym(t,Ls))return t[Ls];var r=t.constructor;return Xm(r)&&t instanceof r?r.prototype:t instanceof Ci?tg:null},rg=q,ng=W,ag=ge,Ns=So,ig=ye,og=Q,Ai=og("iterator"),Yl=!1,ut,Ia,Ta;[].keys&&(Ta=[].keys(),"next"in Ta?(Ia=Ns(Ns(Ta)),Ia!==Object.prototype&&(ut=Ia)):Yl=!0);var sg=!ag(ut)||rg(function(){var e={};return ut[Ai].call(e)!==e});sg&&(ut={});ng(ut[Ai])||ig(ut,Ai,function(){return this});var Xl={IteratorPrototype:ut,BUGGY_SAFARI_ITERATORS:Yl},cg=Ae.f,ug=me,lg=Q,Us=lg("toStringTag"),Vt=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ug(e,Us)&&cg(e,Us,{configurable:!0,value:t})},fg=Xl.IteratorPrototype,dg=Kn,vg=vt,hg=Vt,pg=kr,mg=function(){return this},ql=function(e,t,r,n){var a=t+" Iterator";return e.prototype=dg(fg,{next:vg(+!n,r)}),hg(e,a,!1),pg[a]=mg,e},gg=K,yg=Oe,wg=function(e,t,r){try{return gg(yg(Object.getOwnPropertyDescriptor(e,t)[r]))}catch{}},bg=ge,Sg=function(e){return bg(e)||e===null},$g=Sg,Ig=String,Tg=TypeError,Eg=function(e){if($g(e))return e;throw new Tg("Can't set "+Ig(e)+" as a prototype")},Pg=wg,Og=ge,kg=Mn,_g=Eg,$o=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={},r;try{r=Pg(Object.prototype,"__proto__","set"),r(t,[]),e=t instanceof Array}catch{}return function(a,i){return kg(a),_g(i),Og(a)&&(e?r(a,i):a.__proto__=i),a}}():void 0),Rg=Y,Cg=te,Ql=Kl,Ag=W,jg=ql,xs=So,Ds=$o,Lg=Vt,Ng=ht,Ea=ye,Ug=Q,xg=kr,ef=Xl,Dg=Ql.PROPER,Mg=Ql.CONFIGURABLE,Ms=ef.IteratorPrototype,Br=ef.BUGGY_SAFARI_ITERATORS,er=Ug("iterator"),Fs="keys",tr="values",zs="entries",Fg=function(){return this},tf=function(e,t,r,n,a,i,o){jg(r,t,n);var s=function(T){if(T===a&&d)return d;if(!Br&&T&&T in l)return l[T];switch(T){case Fs:return function(){return new r(this,T)};case tr:return function(){return new r(this,T)};case zs:return function(){return new r(this,T)}}return function(){return new r(this)}},u=t+" Iterator",f=!1,l=e.prototype,c=l[er]||l["@@iterator"]||a&&l[a],d=!Br&&c||s(a),v=t==="Array"&&l.entries||c,p,S,g;if(v&&(p=xs(v.call(new e)),p!==Object.prototype&&p.next&&(xs(p)!==Ms&&(Ds?Ds(p,Ms):Ag(p[er])||Ea(p,er,Fg)),Lg(p,u,!0))),Dg&&a===tr&&c&&c.name!==tr&&(Mg?Ng(l,"name",tr):(f=!0,d=function(){return Cg(c,this)})),a)if(S={values:s(tr),keys:i?d:s(Fs),entries:s(zs)},o)for(g in S)(Br||f||!(g in l))&&Ea(l,g,S[g]);else Rg({target:t,proto:!0,forced:Br||f},S);return l[er]!==d&&Ea(l,er,d,{name:a}),xg[t]=d,S},Io=function(e,t){return{value:e,done:t}},zg=Pr,To=_p,Bs=kr,rf=Wt,Bg=Ae.f,Hg=tf,Hr=Io,Kg=ee,nf="Array Iterator",Gg=rf.set,Wg=rf.getterFor(nf),Vg=Hg(Array,"Array",function(e,t){Gg(this,{type:nf,target:zg(e),index:0,kind:t})},function(){var e=Wg(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=void 0,Hr(void 0,!0);switch(e.kind){case"keys":return Hr(r,!1);case"values":return Hr(t[r],!1)}return Hr([r,t[r]],!1)},"values"),Hs=Bs.Arguments=Bs.Array;To("keys");To("values");To("entries");if(Kg&&Hs.name!=="values")try{Bg(Hs,"name",{value:"values"})}catch{}var Ks=H,Zg=ee,Jg=Object.getOwnPropertyDescriptor,af=function(e){if(!Zg)return Ks[e];var t=Jg(Ks,e);return t&&t.value},Yg=q,Xg=Q,qg=ee,Gs=_v,Qg=Xg("iterator"),Gn=!Yg(function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach(function(a,i){t.delete("b"),n+=i+a}),r.delete("a",2),r.delete("b",void 0),Gs&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(Gs||!qg)||!t.sort||e.href!=="https://a/c%20d?a=1&c=3"||t.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!t[Qg]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||n!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Ws=Wl,ey=Ae,Wn=function(e,t,r){return r.get&&Ws(r.get,t,{getter:!0}),r.set&&Ws(r.set,t,{setter:!0}),ey.f(e,t,r)},ty=ye,ry=function(e,t,r){for(var n in t)ty(e,n,t[n],r);return e},ny=Bn,ay=TypeError,Eo=function(e,t){if(ny(t,e))return e;throw new ay("Incorrect invocation")},iy=xn,oy=K,sy=function(e){if(iy(e)==="Function")return oy(e)},Vs=sy,cy=Oe,uy=Un,ly=Vs(Vs.bind),Zt=function(e,t){return cy(e),t===void 0?e:uy?ly(e,t):function(){return e.apply(t,arguments)}},fy=Q,dy=fy("toStringTag"),of={};of[dy]="z";var Po=String(of)==="[object z]",vy=Po,hy=W,vn=xn,py=Q,my=py("toStringTag"),gy=Object,yy=vn(function(){return arguments}())==="Arguments",wy=function(e,t){try{return e[t]}catch{}},Rr=vy?vn:function(e){var t,r,n;return e===void 0?"Undefined":e===null?"Null":typeof(r=wy(t=gy(e),my))=="string"?r:yy?vn(t):(n=vn(t))==="Object"&&hy(t.callee)?"Arguments":n},by=Rr,Sy=String,Fe=function(e){if(by(e)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return Sy(e)},$y=Rr,Zs=co,Iy=Dn,Ty=kr,Ey=Q,Py=Ey("iterator"),Vn=function(e){if(!Iy(e))return Zs(e,Py)||Zs(e,"@@iterator")||Ty[$y(e)]},Oy=te,ky=Oe,_y=Ee,Ry=Hn,Cy=Vn,Ay=TypeError,Oo=function(e,t){var r=arguments.length<2?Cy(e):t;if(ky(r))return _y(Oy(r,e));throw new Ay(Ry(e)+" is not iterable")},jy=TypeError,pt=function(e,t){if(e<t)throw new jy("Not enough arguments");return e},Ly=K,Zn=Ly([].slice),Js=Zn,Ny=Math.floor,ji=function(e,t){var r=e.length;if(r<8)for(var n=1,a,i;n<r;){for(i=n,a=e[n];i&&t(e[i-1],a)>0;)e[i]=e[--i];i!==n++&&(e[i]=a)}else for(var o=Ny(r/2),s=ji(Js(e,0,o),t),u=ji(Js(e,o),t),f=s.length,l=u.length,c=0,d=0;c<f||d<l;)e[c+d]=c<f&&d<l?t(s[c],u[d])<=0?s[c++]:u[d++]:c<f?s[c++]:u[d++];return e},Uy=ji,Li=Y,Jn=H,ko=af,Kr=te,Ce=K,vr=ee,sf=Gn,cf=ye,xy=Wn,Dy=ry,My=Vt,Fy=ql,_o=Wt,uf=Eo,Pa=W,zy=me,By=Zt,Hy=Rr,Ky=Ee,lf=ge,ne=Fe,Gy=Kn,Ys=vt,Xs=Oo,Wy=Vn,Gr=Io,yt=pt,Vy=Q,Zy=Uy,Jy=Vy("iterator"),Jt="URLSearchParams",ff=Jt+"Iterator",df=_o.set,he=_o.getterFor(Jt),Yy=_o.getterFor(ff),qs=ko("fetch"),$n=ko("Request"),hr=ko("Headers"),Oa=$n&&$n.prototype,Qs=hr&&hr.prototype,Xy=Jn.RegExp,qy=Jn.TypeError,vf=Jn.decodeURIComponent,Qy=Jn.encodeURIComponent,ew=Ce("".charAt),ec=Ce([].join),at=Ce([].push),Ni=Ce("".replace),tw=Ce([].shift),tc=Ce([].splice),rc=Ce("".split),rw=Ce("".slice),nw=/\+/g,nc=Array(4),aw=function(e){return nc[e-1]||(nc[e-1]=Xy("((?:%[\\da-f]{2}){"+e+"})","gi"))},iw=function(e){try{return vf(e)}catch{return e}},ac=function(e){var t=Ni(e,nw," "),r=4;try{return vf(t)}catch{for(;r;)t=Ni(t,aw(r--),iw);return t}},ow=/[!'()~]|%20/g,sw={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},cw=function(e){return sw[e]},ic=function(e){return Ni(Qy(e),ow,cw)},ka=Fy(function(t,r){df(this,{type:ff,target:he(t).entries,index:0,kind:r})},Jt,function(){var t=Yy(this),r=t.target,n=t.index++;if(!r||n>=r.length)return t.target=void 0,Gr(void 0,!0);var a=r[n];switch(t.kind){case"keys":return Gr(a.key,!1);case"values":return Gr(a.value,!1)}return Gr([a.key,a.value],!1)},!0),hf=function(e){this.entries=[],this.url=null,e!==void 0&&(lf(e)?this.parseObject(e):this.parseQuery(typeof e=="string"?ew(e,0)==="?"?rw(e,1):e:ne(e)))};hf.prototype={type:Jt,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t=this.entries,r=Wy(e),n,a,i,o,s,u,f;if(r)for(n=Xs(e,r),a=n.next;!(i=Kr(a,n)).done;){if(o=Xs(Ky(i.value)),s=o.next,(u=Kr(s,o)).done||(f=Kr(s,o)).done||!Kr(s,o).done)throw new qy("Expected sequence with length 2");at(t,{key:ne(u.value),value:ne(f.value)})}else for(var l in e)zy(e,l)&&at(t,{key:l,value:ne(e[l])})},parseQuery:function(e){if(e)for(var t=this.entries,r=rc(e,"&"),n=0,a,i;n<r.length;)a=r[n++],a.length&&(i=rc(a,"="),at(t,{key:ac(tw(i)),value:ac(ec(i,"="))}))},serialize:function(){for(var e=this.entries,t=[],r=0,n;r<e.length;)n=e[r++],at(t,ic(n.key)+"="+ic(n.value));return ec(t,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Yn=function(){uf(this,Ut);var t=arguments.length>0?arguments[0]:void 0,r=df(this,new hf(t));vr||(this.size=r.entries.length)},Ut=Yn.prototype;Dy(Ut,{append:function(t,r){var n=he(this);yt(arguments.length,2),at(n.entries,{key:ne(t),value:ne(r)}),vr||this.length++,n.updateURL()},delete:function(e){for(var t=he(this),r=yt(arguments.length,1),n=t.entries,a=ne(e),i=r<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<n.length;){var u=n[s];if(u.key===a&&(o===void 0||u.value===o)){if(tc(n,s,1),o!==void 0)break}else s++}vr||(this.size=n.length),t.updateURL()},get:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=0;a<r.length;a++)if(r[a].key===n)return r[a].value;return null},getAll:function(t){var r=he(this).entries;yt(arguments.length,1);for(var n=ne(t),a=[],i=0;i<r.length;i++)r[i].key===n&&at(a,r[i].value);return a},has:function(t){for(var r=he(this).entries,n=yt(arguments.length,1),a=ne(t),i=n<2?void 0:arguments[1],o=i===void 0?i:ne(i),s=0;s<r.length;){var u=r[s++];if(u.key===a&&(o===void 0||u.value===o))return!0}return!1},set:function(t,r){var n=he(this);yt(arguments.length,1);for(var a=n.entries,i=!1,o=ne(t),s=ne(r),u=0,f;u<a.length;u++)f=a[u],f.key===o&&(i?tc(a,u--,1):(i=!0,f.value=s));i||at(a,{key:o,value:s}),vr||(this.size=a.length),n.updateURL()},sort:function(){var t=he(this);Zy(t.entries,function(r,n){return r.key>n.key?1:-1}),t.updateURL()},forEach:function(t){for(var r=he(this).entries,n=By(t,arguments.length>1?arguments[1]:void 0),a=0,i;a<r.length;)i=r[a++],n(i.value,i.key,this)},keys:function(){return new ka(this,"keys")},values:function(){return new ka(this,"values")},entries:function(){return new ka(this,"entries")}},{enumerable:!0});cf(Ut,Jy,Ut.entries,{name:"entries"});cf(Ut,"toString",function(){return he(this).serialize()},{enumerable:!0});vr&&xy(Ut,"size",{get:function(){return he(this).entries.length},configurable:!0,enumerable:!0});My(Yn,Jt);Li({global:!0,constructor:!0,forced:!sf},{URLSearchParams:Yn});if(!sf&&Pa(hr)){var uw=Ce(Qs.has),lw=Ce(Qs.set),oc=function(e){if(lf(e)){var t=e.body,r;if(Hy(t)===Jt)return r=e.headers?new hr(e.headers):new hr,uw(r,"content-type")||lw(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),Gy(e,{body:Ys(0,ne(t)),headers:Ys(0,r)})}return e};if(Pa(qs)&&Li({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(t){return qs(t,arguments.length>1?oc(arguments[1]):{})}}),Pa($n)){var _a=function(t){return uf(this,Oa),new $n(t,arguments.length>1?oc(arguments[1]):{})};Oa.constructor=_a,_a.prototype=Oa,Li({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:_a})}}var fw={URLSearchParams:Yn,getState:he},dw=ye,Xn=K,sc=Fe,vw=pt,pf=URLSearchParams,qn=pf.prototype,hw=Xn(qn.append),cc=Xn(qn.delete),pw=Xn(qn.forEach),mw=Xn([].push),Ro=new pf("a=1&a=2&b=3");Ro.delete("a",1);Ro.delete("b",void 0);Ro+""!="a=2"&&dw(qn,"delete",function(e){var t=arguments.length,r=t<2?void 0:arguments[1];if(t&&r===void 0)return cc(this,e);var n=[];pw(this,function(c,d){mw(n,{key:d,value:c})}),vw(t,1);for(var a=sc(e),i=sc(r),o=0,s=0,u=!1,f=n.length,l;o<f;)l=n[o++],u||l.key===a?(u=!0,cc(this,l.key)):s++;for(;s<f;)l=n[s++],l.key===a&&l.value===i||hw(this,l.key,l.value)},{enumerable:!0,unsafe:!0});var gw=ye,mf=K,yw=Fe,ww=pt,gf=URLSearchParams,Co=gf.prototype,bw=mf(Co.getAll),Sw=mf(Co.has),uc=new gf("a=1");(uc.has("a",2)||!uc.has("a",void 0))&&gw(Co,"has",function(t){var r=arguments.length,n=r<2?void 0:arguments[1];if(r&&n===void 0)return Sw(this,t);var a=bw(this,t);ww(r,1);for(var i=yw(n),o=0;o<a.length;)if(a[o++]===i)return!0;return!1},{enumerable:!0,unsafe:!0});var $w=ee,Iw=K,Tw=Wn,Ui=URLSearchParams.prototype,Ew=Iw(Ui.forEach);$w&&!("size"in Ui)&&Tw(Ui,"size",{get:function(){var t=0;return Ew(this,function(){t++}),t},configurable:!0,enumerable:!0});var Pw=H,Ao=Pw,Ow=Ao;Ow.URLSearchParams;var jo=K,kw=uo,_w=Fe,Rw=Mn,Cw=jo("".charAt),lc=jo("".charCodeAt),Aw=jo("".slice),fc=function(e){return function(t,r){var n=_w(Rw(t)),a=kw(r),i=n.length,o,s;return a<0||a>=i?e?"":void 0:(o=lc(n,a),o<55296||o>56319||a+1===i||(s=lc(n,a+1))<56320||s>57343?e?Cw(n,a):o:e?Aw(n,a,a+2):(o-55296<<10)+(s-56320)+65536)}},yf={codeAt:fc(!1),charAt:fc(!0)},jw=yf.charAt,Lw=Fe,wf=Wt,Nw=tf,dc=Io,bf="String Iterator",Uw=wf.set,xw=wf.getterFor(bf);Nw(String,"String",function(e){Uw(this,{type:bf,string:Lw(e),index:0})},function(){var t=xw(this),r=t.string,n=t.index,a;return n>=r.length?dc(void 0,!0):(a=jw(r,n),t.index+=a.length,dc(a,!1))});var vc=ee,Dw=K,Mw=te,Fw=q,Ra=Nl,zw=bo,Bw=mo,Hw=Fn,Kw=Sl,wt=Object.assign,hc=Object.defineProperty,Gw=Dw([].concat),Ww=!wt||Fw(function(){if(vc&&wt({b:1},wt(hc({},"a",{enumerable:!0,get:function(){hc(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(a){t[a]=a}),wt({},e)[r]!==7||Ra(wt({},t)).join("")!==n})?function(t,r){for(var n=Hw(t),a=arguments.length,i=1,o=zw.f,s=Bw.f;a>i;)for(var u=Kw(arguments[i++]),f=o?Gw(Ra(u),o(u)):Ra(u),l=f.length,c=0,d;l>c;)d=f[c++],(!vc||Mw(s,u,d))&&(n[d]=u[d]);return n}:wt,Vw=te,pc=Ee,Zw=co,Sf=function(e,t,r){var n,a;pc(e);try{if(n=Zw(e,"return"),!n){if(t==="throw")throw r;return r}n=Vw(n,e)}catch(i){a=!0,n=i}if(t==="throw")throw r;if(a)throw n;return pc(n),r},Jw=Ee,Yw=Sf,Xw=function(e,t,r,n){try{return n?t(Jw(r)[0],r[1]):t(r)}catch(a){Yw(e,"throw",a)}},qw=Q,Qw=kr,eb=qw("iterator"),tb=Array.prototype,$f=function(e){return e!==void 0&&(Qw.Array===e||tb[eb]===e)},rb=K,nb=q,If=W,ab=Rr,ib=Pe,ob=yo,Tf=function(){},Ef=ib("Reflect","construct"),Lo=/^\s*(?:class|function)\b/,sb=rb(Lo.exec),cb=!Lo.test(Tf),rr=function(t){if(!If(t))return!1;try{return Ef(Tf,[],t),!0}catch{return!1}},Pf=function(t){if(!If(t))return!1;switch(ab(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return cb||!!sb(Lo,ob(t))}catch{return!0}};Pf.sham=!0;var Of=!Ef||nb(function(){var e;return rr(rr.call)||!rr(Object)||!rr(function(){e=!0})||e})?Pf:rr,ub=ee,lb=Ae,fb=vt,db=function(e,t,r){ub?lb.f(e,t,fb(0,r)):e[t]=r},vb=Zt,hb=te,pb=Fn,mb=Xw,gb=$f,yb=Of,wb=lo,mc=db,bb=Oo,Sb=Vn,gc=Array,$b=function(t){var r=pb(t),n=yb(this),a=arguments.length,i=a>1?arguments[1]:void 0,o=i!==void 0;o&&(i=vb(i,a>2?arguments[2]:void 0));var s=Sb(r),u=0,f,l,c,d,v,p;if(s&&!(this===gc&&gb(s)))for(l=n?new this:[],d=bb(r,s),v=d.next;!(c=hb(v,d)).done;u++)p=o?mb(d,i,[c.value,u],!0):c.value,mc(l,u,p);else for(f=wb(r),l=n?new this(f):gc(f);f>u;u++)p=o?i(r[u],u):r[u],mc(l,u,p);return l.length=u,l},mt=K,Ca=2147483647,pr=36,kf=1,xi=26,Ib=38,Tb=700,Eb=72,Pb=128,Ob="-",kb=/[^\0-\u007E]/,_f=/[.\u3002\uFF0E\uFF61]/g,yc="Overflow: input needs wider integers to process",Aa=pr-kf,wc=RangeError,_b=mt(_f.exec),kt=Math.floor,ja=String.fromCharCode,bc=mt("".charCodeAt),Rf=mt([].join),We=mt([].push),Rb=mt("".replace),Cb=mt("".split),Ab=mt("".toLowerCase),jb=function(e){for(var t=[],r=0,n=e.length;r<n;){var a=bc(e,r++);if(a>=55296&&a<=56319&&r<n){var i=bc(e,r++);(i&64512)===56320?We(t,((a&1023)<<10)+(i&1023)+65536):(We(t,a),r--)}else We(t,a)}return t},Sc=function(e){return e+22+75*(e<26)},Lb=function(e,t,r){var n=0;for(e=r?kt(e/Tb):e>>1,e+=kt(e/t);e>Aa*xi>>1;)e=kt(e/Aa),n+=pr;return kt(n+(Aa+1)*e/(e+Ib))},Nb=function(e){var t=[];e=jb(e);var r=e.length,n=Pb,a=0,i=Eb,o,s;for(o=0;o<e.length;o++)s=e[o],s<128&&We(t,ja(s));var u=t.length,f=u;for(u&&We(t,Ob);f<r;){var l=Ca;for(o=0;o<e.length;o++)s=e[o],s>=n&&s<l&&(l=s);var c=f+1;if(l-n>kt((Ca-a)/c))throw new wc(yc);for(a+=(l-n)*c,n=l,o=0;o<e.length;o++){if(s=e[o],s<n&&++a>Ca)throw new wc(yc);if(s===n){for(var d=a,v=pr;;){var p=v<=i?kf:v>=i+xi?xi:v-i;if(d<p)break;var S=d-p,g=pr-p;We(t,ja(Sc(p+S%g))),d=kt(S/g),v+=pr}We(t,ja(Sc(d))),i=Lb(a,c,f===u),a=0,f++}}a++,n++}return Rf(t,"")},Ub=function(e){var t=[],r=Cb(Rb(Ab(e),_f,"."),"."),n,a;for(n=0;n<r.length;n++)a=r[n],We(t,_b(kb,a)?"xn--"+Nb(a):a);return Rf(t,".")},xb=Y,No=ee,Db=Gn,Uo=H,$c=Zt,we=K,In=ye,fe=Wn,Mb=Eo,Di=me,xo=Ww,bt=$b,be=Zn,Fb=yf.codeAt,zb=Ub,Ue=Fe,Bb=Vt,Hb=pt,Cf=fw,Af=Wt,Kb=Af.set,Tn=Af.getterFor("URL"),Gb=Cf.URLSearchParams,Wb=Cf.getState,nr=Uo.URL,Mi=Uo.TypeError,En=Uo.parseInt,Vb=Math.floor,Ic=Math.pow,pe=we("".charAt),Ie=we(/./.exec),ur=we([].join),Zb=we(1 .toString),Jb=we([].pop),Tt=we([].push),La=we("".replace),Yb=we([].shift),Xb=we("".split),mr=we("".slice),Pn=we("".toLowerCase),qb=we([].unshift),Qb="Invalid authority",Na="Invalid scheme",Xe="Invalid host",Tc="Invalid port",jf=/[a-z]/i,eS=/[\d+-.a-z]/i,Fi=/\d/,tS=/^0x/i,rS=/^[0-7]+$/,nS=/^\d+$/,Lf=/^[\da-f]+$/i,aS=/[\0\t\n\r #%/:<>?@[\\\]^|]/,iS=/[\0\t\n\r #/:<>?@[\\\]^|]/,oS=/^[\u0000-\u0020]+/,sS=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,cS=/[\t\n\r]/g,de,uS=function(e){var t=Xb(e,"."),r,n,a,i,o,s,u;if(t.length&&t[t.length-1]===""&&t.length--,r=t.length,r>4)return e;for(n=[],a=0;a<r;a++){if(i=t[a],i==="")return e;if(o=10,i.length>1&&pe(i,0)==="0"&&(o=Ie(tS,i)?16:8,i=mr(i,o===8?1:2)),i==="")s=0;else{if(!Ie(o===10?nS:o===8?rS:Lf,i))return e;s=En(i,o)}Tt(n,s)}for(a=0;a<r;a++)if(s=n[a],a===r-1){if(s>=Ic(256,5-r))return null}else if(s>255)return null;for(u=Jb(n),a=0;a<n.length;a++)u+=n[a]*Ic(256,3-a);return u},lS=function(e){var t=[0,0,0,0,0,0,0,0],r=0,n=null,a=0,i,o,s,u,f,l,c,d=function(){return pe(e,a)};if(d()===":"){if(pe(e,1)!==":")return;a+=2,r++,n=r}for(;d();){if(r===8)return;if(d()===":"){if(n!==null)return;a++,r++,n=r;continue}for(i=o=0;o<4&&Ie(Lf,d());)i=i*16+En(d(),16),a++,o++;if(d()==="."){if(o===0||(a-=o,r>6))return;for(s=0;d();){if(u=null,s>0)if(d()==="."&&s<4)a++;else return;if(!Ie(Fi,d()))return;for(;Ie(Fi,d());){if(f=En(d(),10),u===null)u=f;else{if(u===0)return;u=u*10+f}if(u>255)return;a++}t[r]=t[r]*256+u,s++,(s===2||s===4)&&r++}if(s!==4)return;break}else if(d()===":"){if(a++,!d())return}else if(d())return;t[r++]=i}if(n!==null)for(l=r-n,r=7;r!==0&&l>0;)c=t[r],t[r--]=t[n+l-1],t[n+--l]=c;else if(r!==8)return;return t},fS=function(e){for(var t=null,r=1,n=null,a=0,i=0;i<8;i++)e[i]!==0?(a>r&&(t=n,r=a),n=null,a=0):(n===null&&(n=i),++a);return a>r?n:t},ar=function(e){var t,r,n,a;if(typeof e=="number"){for(t=[],r=0;r<4;r++)qb(t,e%256),e=Vb(e/256);return ur(t,".")}if(typeof e=="object"){for(t="",n=fS(e),r=0;r<8;r++)a&&e[r]===0||(a&&(a=!1),n===r?(t+=r?":":"::",a=!0):(t+=Zb(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},hn={},Nf=xo({},hn,{" ":1,'"':1,"<":1,">":1,"`":1}),Uf=xo({},Nf,{"#":1,"?":1,"{":1,"}":1}),Ua=xo({},Uf,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Be=function(e,t){var r=Fb(e,0);return r>32&&r<127&&!Di(t,e)?e:encodeURIComponent(e)},Wr={ftp:21,file:null,http:80,https:443,ws:80,wss:443},lr=function(e,t){var r;return e.length===2&&Ie(jf,pe(e,0))&&((r=pe(e,1))===":"||!t&&r==="|")},Ec=function(e){var t;return e.length>1&&lr(mr(e,0,2))&&(e.length===2||(t=pe(e,2))==="/"||t==="\\"||t==="?"||t==="#")},dS=function(e){return e==="."||Pn(e)==="%2e"},vS=function(e){return e=Pn(e),e===".."||e==="%2e."||e===".%2e"||e==="%2e%2e"},xa={},Pc={},Da={},Oc={},kc={},Ma={},_c={},Rc={},Vr={},Zr={},Fa={},za={},Ba={},Ha={},Cc={},Ka={},St={},_e={},Ac={},qe={},Ne={},Do=function(e,t,r){var n=Ue(e),a,i,o;if(t){if(i=this.parse(n),i)throw new Mi(i);this.searchParams=null}else{if(r!==void 0&&(a=new Do(r,!0)),i=this.parse(n,null,a),i)throw new Mi(i);o=Wb(new Gb),o.bindURL(this),this.searchParams=o}};Do.prototype={type:"URL",parse:function(e,t,r){var n=this,a=t||xa,i=0,o="",s=!1,u=!1,f=!1,l,c,d,v;for(e=Ue(e),t||(n.scheme="",n.username="",n.password="",n.host=null,n.port=null,n.path=[],n.query=null,n.fragment=null,n.cannotBeABaseURL=!1,e=La(e,oS,""),e=La(e,sS,"$1")),e=La(e,cS,""),l=bt(e);i<=l.length;){switch(c=l[i],a){case xa:if(c&&Ie(jf,c))o+=Pn(c),a=Pc;else{if(t)return Na;a=Da;continue}break;case Pc:if(c&&(Ie(eS,c)||c==="+"||c==="-"||c==="."))o+=Pn(c);else if(c===":"){if(t&&(n.isSpecial()!==Di(Wr,o)||o==="file"&&(n.includesCredentials()||n.port!==null)||n.scheme==="file"&&!n.host))return;if(n.scheme=o,t){n.isSpecial()&&Wr[n.scheme]===n.port&&(n.port=null);return}o="",n.scheme==="file"?a=Ha:n.isSpecial()&&r&&r.scheme===n.scheme?a=Oc:n.isSpecial()?a=Rc:l[i+1]==="/"?(a=kc,i++):(n.cannotBeABaseURL=!0,Tt(n.path,""),a=Ac)}else{if(t)return Na;o="",a=Da,i=0;continue}break;case Da:if(!r||r.cannotBeABaseURL&&c!=="#")return Na;if(r.cannotBeABaseURL&&c==="#"){n.scheme=r.scheme,n.path=be(r.path),n.query=r.query,n.fragment="",n.cannotBeABaseURL=!0,a=Ne;break}a=r.scheme==="file"?Ha:Ma;continue;case Oc:if(c==="/"&&l[i+1]==="/")a=Vr,i++;else{a=Ma;continue}break;case kc:if(c==="/"){a=Zr;break}else{a=_e;continue}case Ma:if(n.scheme=r.scheme,c===de)n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query;else if(c==="/"||c==="\\"&&n.isSpecial())a=_c;else if(c==="?")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query="",a=qe;else if(c==="#")n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,n.path=be(r.path),n.path.length--,a=_e;continue}break;case _c:if(n.isSpecial()&&(c==="/"||c==="\\"))a=Vr;else if(c==="/")a=Zr;else{n.username=r.username,n.password=r.password,n.host=r.host,n.port=r.port,a=_e;continue}break;case Rc:if(a=Vr,c!=="/"||pe(o,i+1)!=="/")continue;i++;break;case Vr:if(c!=="/"&&c!=="\\"){a=Zr;continue}break;case Zr:if(c==="@"){s&&(o="%40"+o),s=!0,d=bt(o);for(var p=0;p<d.length;p++){var S=d[p];if(S===":"&&!f){f=!0;continue}var g=Be(S,Ua);f?n.password+=g:n.username+=g}o=""}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(s&&o==="")return Qb;i-=bt(o).length+1,o="",a=Fa}else o+=c;break;case Fa:case za:if(t&&n.scheme==="file"){a=Ka;continue}else if(c===":"&&!u){if(o==="")return Xe;if(v=n.parseHost(o),v)return v;if(o="",a=Ba,t===za)return}else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()){if(n.isSpecial()&&o==="")return Xe;if(t&&o===""&&(n.includesCredentials()||n.port!==null))return;if(v=n.parseHost(o),v)return v;if(o="",a=St,t)return;continue}else c==="["?u=!0:c==="]"&&(u=!1),o+=c;break;case Ba:if(Ie(Fi,c))o+=c;else if(c===de||c==="/"||c==="?"||c==="#"||c==="\\"&&n.isSpecial()||t){if(o!==""){var T=En(o,10);if(T>65535)return Tc;n.port=n.isSpecial()&&T===Wr[n.scheme]?null:T,o=""}if(t)return;a=St;continue}else return Tc;break;case Ha:if(n.scheme="file",c==="/"||c==="\\")a=Cc;else if(r&&r.scheme==="file")switch(c){case de:n.host=r.host,n.path=be(r.path),n.query=r.query;break;case"?":n.host=r.host,n.path=be(r.path),n.query="",a=qe;break;case"#":n.host=r.host,n.path=be(r.path),n.query=r.query,n.fragment="",a=Ne;break;default:Ec(ur(be(l,i),""))||(n.host=r.host,n.path=be(r.path),n.shortenPath()),a=_e;continue}else{a=_e;continue}break;case Cc:if(c==="/"||c==="\\"){a=Ka;break}r&&r.scheme==="file"&&!Ec(ur(be(l,i),""))&&(lr(r.path[0],!0)?Tt(n.path,r.path[0]):n.host=r.host),a=_e;continue;case Ka:if(c===de||c==="/"||c==="\\"||c==="?"||c==="#"){if(!t&&lr(o))a=_e;else if(o===""){if(n.host="",t)return;a=St}else{if(v=n.parseHost(o),v)return v;if(n.host==="localhost"&&(n.host=""),t)return;o="",a=St}continue}else o+=c;break;case St:if(n.isSpecial()){if(a=_e,c!=="/"&&c!=="\\")continue}else if(!t&&c==="?")n.query="",a=qe;else if(!t&&c==="#")n.fragment="",a=Ne;else if(c!==de&&(a=_e,c!=="/"))continue;break;case _e:if(c===de||c==="/"||c==="\\"&&n.isSpecial()||!t&&(c==="?"||c==="#")){if(vS(o)?(n.shortenPath(),c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,"")):dS(o)?c!=="/"&&!(c==="\\"&&n.isSpecial())&&Tt(n.path,""):(n.scheme==="file"&&!n.path.length&&lr(o)&&(n.host&&(n.host=""),o=pe(o,0)+":"),Tt(n.path,o)),o="",n.scheme==="file"&&(c===de||c==="?"||c==="#"))for(;n.path.length>1&&n.path[0]==="";)Yb(n.path);c==="?"?(n.query="",a=qe):c==="#"&&(n.fragment="",a=Ne)}else o+=Be(c,Uf);break;case Ac:c==="?"?(n.query="",a=qe):c==="#"?(n.fragment="",a=Ne):c!==de&&(n.path[0]+=Be(c,hn));break;case qe:!t&&c==="#"?(n.fragment="",a=Ne):c!==de&&(c==="'"&&n.isSpecial()?n.query+="%27":c==="#"?n.query+="%23":n.query+=Be(c,hn));break;case Ne:c!==de&&(n.fragment+=Be(c,Nf));break}i++}},parseHost:function(e){var t,r,n;if(pe(e,0)==="["){if(pe(e,e.length-1)!=="]"||(t=lS(mr(e,1,-1)),!t))return Xe;this.host=t}else if(this.isSpecial()){if(e=zb(e),Ie(aS,e)||(t=uS(e),t===null))return Xe;this.host=t}else{if(Ie(iS,e))return Xe;for(t="",r=bt(e),n=0;n<r.length;n++)t+=Be(r[n],hn);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return Di(Wr,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;t&&(this.scheme!=="file"||t!==1||!lr(e[0],!0))&&e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,a=e.host,i=e.port,o=e.path,s=e.query,u=e.fragment,f=t+":";return a!==null?(f+="//",e.includesCredentials()&&(f+=r+(n?":"+n:"")+"@"),f+=ar(a),i!==null&&(f+=":"+i)):t==="file"&&(f+="//"),f+=e.cannotBeABaseURL?o[0]:o.length?"/"+ur(o,"/"):"",s!==null&&(f+="?"+s),u!==null&&(f+="#"+u),f},setHref:function(e){var t=this.parse(e);if(t)throw new Mi(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if(e==="blob")try{return new xt(e.path[0]).origin}catch{return"null"}return e==="file"||!this.isSpecial()?"null":e+"://"+ar(this.host)+(t!==null?":"+t:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(Ue(e)+":",xa)},getUsername:function(){return this.username},setUsername:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=Be(t[r],Ua)}},getPassword:function(){return this.password},setPassword:function(e){var t=bt(Ue(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=Be(t[r],Ua)}},getHost:function(){var e=this.host,t=this.port;return e===null?"":t===null?ar(e):ar(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Fa)},getHostname:function(){var e=this.host;return e===null?"":ar(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,za)},getPort:function(){var e=this.port;return e===null?"":Ue(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=Ue(e),e===""?this.port=null:this.parse(e,Ba))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+ur(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,St))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=Ue(e),e===""?this.query=null:(pe(e,0)==="?"&&(e=mr(e,1)),this.query="",this.parse(e,qe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){if(e=Ue(e),e===""){this.fragment=null;return}pe(e,0)==="#"&&(e=mr(e,1)),this.fragment="",this.parse(e,Ne)},update:function(){this.query=this.searchParams.serialize()||null}};var xt=function(t){var r=Mb(this,re),n=Hb(arguments.length,1)>1?arguments[1]:void 0,a=Kb(r,new Do(t,!1,n));No||(r.href=a.serialize(),r.origin=a.getOrigin(),r.protocol=a.getProtocol(),r.username=a.getUsername(),r.password=a.getPassword(),r.host=a.getHost(),r.hostname=a.getHostname(),r.port=a.getPort(),r.pathname=a.getPathname(),r.search=a.getSearch(),r.searchParams=a.getSearchParams(),r.hash=a.getHash())},re=xt.prototype,ve=function(e,t){return{get:function(){return Tn(this)[e]()},set:t&&function(r){return Tn(this)[t](r)},configurable:!0,enumerable:!0}};No&&(fe(re,"href",ve("serialize","setHref")),fe(re,"origin",ve("getOrigin")),fe(re,"protocol",ve("getProtocol","setProtocol")),fe(re,"username",ve("getUsername","setUsername")),fe(re,"password",ve("getPassword","setPassword")),fe(re,"host",ve("getHost","setHost")),fe(re,"hostname",ve("getHostname","setHostname")),fe(re,"port",ve("getPort","setPort")),fe(re,"pathname",ve("getPathname","setPathname")),fe(re,"search",ve("getSearch","setSearch")),fe(re,"searchParams",ve("getSearchParams")),fe(re,"hash",ve("getHash","setHash")));In(re,"toJSON",function(){return Tn(this).serialize()},{enumerable:!0});In(re,"toString",function(){return Tn(this).serialize()},{enumerable:!0});if(nr){var jc=nr.createObjectURL,Lc=nr.revokeObjectURL;jc&&In(xt,"createObjectURL",$c(jc,nr)),Lc&&In(xt,"revokeObjectURL",$c(Lc,nr))}Bb(xt,"URL");xb({global:!0,constructor:!0,forced:!Db,sham:!No},{URL:xt});var hS=Y,pS=Pe,xf=q,mS=pt,Nc=Fe,gS=Gn,Mo=pS("URL"),yS=gS&&xf(function(){Mo.canParse()}),wS=xf(function(){return Mo.canParse.length!==1});hS({target:"URL",stat:!0,forced:!yS||wS},{canParse:function(t){var r=mS(arguments.length,1),n=Nc(t),a=r<2||arguments[1]===void 0?void 0:Nc(arguments[1]);try{return!!new Mo(n,a)}catch{return!1}}});var bS=Y,SS=Pe,$S=pt,Uc=Fe,IS=Gn,TS=SS("URL");bS({target:"URL",stat:!0,forced:!IS},{parse:function(t){var r=$S(arguments.length,1),n=Uc(t),a=r<2||arguments[1]===void 0?void 0:Uc(arguments[1]);try{return new TS(n,a)}catch{return null}}});var ES=Y,PS=te;ES({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return PS(URL.prototype.toString,this)}});var OS=Ao;OS.URL;var kS={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},_S=zn,Ga=_S("span").classList,xc=Ga&&Ga.constructor&&Ga.constructor.prototype,RS=xc===Object.prototype?void 0:xc,Dc=H,Df=kS,CS=RS,fr=Vg,Mc=ht,AS=Vt,jS=Q,Wa=jS("iterator"),Va=fr.values,Mf=function(e,t){if(e){if(e[Wa]!==Va)try{Mc(e,Wa,Va)}catch{e[Wa]=Va}if(AS(e,t,!0),Df[t]){for(var r in fr)if(e[r]!==fr[r])try{Mc(e,r,fr[r])}catch{e[r]=fr[r]}}}};for(var Za in Df)Mf(Dc[Za]&&Dc[Za].prototype,Za);Mf(CS,"DOMTokenList");var LS=ge,NS=ht,US=function(e,t){LS(t)&&"cause"in t&&NS(e,"cause",t.cause)},xS=K,Ff=Error,DS=xS("".replace),MS=function(e){return String(new Ff(e).stack)}("zxcasd"),zf=/\n\s*at [^:]*:[^\n]*/,FS=zf.test(MS),zS=function(e,t){if(FS&&typeof e=="string"&&!Ff.prepareStackTrace)for(;t--;)e=DS(e,zf,"");return e},BS=q,HS=vt,KS=!BS(function(){var e=new Error("a");return"stack"in e?(Object.defineProperty(e,"stack",HS(1,7)),e.stack!==7):!0}),GS=ht,WS=zS,VS=KS,Fc=Error.captureStackTrace,ZS=function(e,t,r,n){VS&&(Fc?Fc(e,t):GS(e,"stack",WS(r,n)))},JS=Zt,YS=te,XS=Ee,qS=Hn,QS=$f,e$=lo,zc=Bn,t$=Oo,r$=Vn,Bc=Sf,n$=TypeError,pn=function(e,t){this.stopped=e,this.result=t},Hc=pn.prototype,Cr=function(e,t,r){var n=r&&r.that,a=!!(r&&r.AS_ENTRIES),i=!!(r&&r.IS_RECORD),o=!!(r&&r.IS_ITERATOR),s=!!(r&&r.INTERRUPTED),u=JS(t,n),f,l,c,d,v,p,S,g=function(I){return f&&Bc(f,"normal",I),new pn(!0,I)},T=function(I){return a?(XS(I),s?u(I[0],I[1],g):u(I[0],I[1])):s?u(I,g):u(I)};if(i)f=e.iterator;else if(o)f=e;else{if(l=r$(e),!l)throw new n$(qS(e)+" is not iterable");if(QS(l)){for(c=0,d=e$(e);d>c;c++)if(v=T(e[c]),v&&zc(Hc,v))return v;return new pn(!1)}f=t$(e,l)}for(p=i?e.next:f.next;!(S=YS(p,f)).done;){try{v=T(S.value)}catch(I){Bc(f,"throw",I)}if(typeof v=="object"&&v&&zc(Hc,v))return v}return new pn(!1)},a$=Fe,i$=function(e,t){return e===void 0?arguments.length<2?"":t:a$(e)},o$=Y,s$=Bn,c$=So,On=$o,u$=Zl,Bf=Kn,Ja=ht,Ya=vt,l$=US,f$=ZS,d$=Cr,v$=i$,h$=Q,p$=h$("toStringTag"),kn=Error,m$=[].push,Dt=function(t,r){var n=s$(Xa,this),a;On?a=On(new kn,n?c$(this):Xa):(a=n?this:Bf(Xa),Ja(a,p$,"Error")),r!==void 0&&Ja(a,"message",v$(r)),f$(a,Dt,a.stack,1),arguments.length>2&&l$(a,arguments[2]);var i=[];return d$(t,m$,{that:i}),Ja(a,"errors",i),a};On?On(Dt,kn):u$(Dt,kn,{name:!0});var Xa=Dt.prototype=Bf(kn.prototype,{constructor:Ya(1,Dt),message:Ya(1,""),name:Ya(1,"AggregateError")});o$({global:!0,constructor:!0,arity:2},{AggregateError:Dt});var g$=Po,y$=Rr,w$=g$?{}.toString:function(){return"[object "+y$(this)+"]"},b$=Po,S$=ye,$$=w$;b$||S$(Object.prototype,"toString",$$,{unsafe:!0});var ir=H,I$=Or,T$=xn,Jr=function(e){return I$.slice(0,e.length)===e},Hf=function(){return Jr("Bun/")?"BUN":Jr("Cloudflare-Workers")?"CLOUDFLARE":Jr("Deno/")?"DENO":Jr("Node.js/")?"NODE":ir.Bun&&typeof Bun.version=="string"?"BUN":ir.Deno&&typeof Deno.version=="object"?"DENO":T$(ir.process)==="process"?"NODE":ir.window&&ir.document?"BROWSER":"REST"}(),E$=Hf,Fo=E$==="NODE",P$=Pe,O$=Wn,k$=Q,_$=ee,Kc=k$("species"),R$=function(e){var t=P$(e);_$&&t&&!t[Kc]&&O$(t,Kc,{configurable:!0,get:function(){return this}})},C$=Of,A$=Hn,j$=TypeError,L$=function(e){if(C$(e))return e;throw new j$(A$(e)+" is not a constructor")},Gc=Ee,N$=L$,U$=Dn,x$=Q,D$=x$("species"),Kf=function(e,t){var r=Gc(e).constructor,n;return r===void 0||U$(n=Gc(r)[D$])?t:N$(n)},M$=Un,Gf=Function.prototype,Wc=Gf.apply,Vc=Gf.call,Wf=typeof Reflect=="object"&&Reflect.apply||(M$?Vc.bind(Wc):function(){return Vc.apply(Wc,arguments)}),F$=Or,Vf=/(?:ipad|iphone|ipod).*applewebkit/i.test(F$),ce=H,z$=Wf,B$=Zt,Zc=W,H$=me,Zf=q,Jc=Ul,K$=Zn,Yc=zn,G$=pt,W$=Vf,V$=Fo,zi=ce.setImmediate,Bi=ce.clearImmediate,Z$=ce.process,qa=ce.Dispatch,J$=ce.Function,Xc=ce.MessageChannel,Y$=ce.String,Qa=0,gr={},qc="onreadystatechange",Tr,Qe,ei,ti;Zf(function(){Tr=ce.location});var zo=function(e){if(H$(gr,e)){var t=gr[e];delete gr[e],t()}},ri=function(e){return function(){zo(e)}},Qc=function(e){zo(e.data)},eu=function(e){ce.postMessage(Y$(e),Tr.protocol+"//"+Tr.host)};(!zi||!Bi)&&(zi=function(t){G$(arguments.length,1);var r=Zc(t)?t:J$(t),n=K$(arguments,1);return gr[++Qa]=function(){z$(r,void 0,n)},Qe(Qa),Qa},Bi=function(t){delete gr[t]},V$?Qe=function(e){Z$.nextTick(ri(e))}:qa&&qa.now?Qe=function(e){qa.now(ri(e))}:Xc&&!W$?(ei=new Xc,ti=ei.port2,ei.port1.onmessage=Qc,Qe=B$(ti.postMessage,ti)):ce.addEventListener&&Zc(ce.postMessage)&&!ce.importScripts&&Tr&&Tr.protocol!=="file:"&&!Zf(eu)?(Qe=eu,ce.addEventListener("message",Qc,!1)):qc in Yc("script")?Qe=function(e){Jc.appendChild(Yc("script"))[qc]=function(){Jc.removeChild(this),zo(e)}}:Qe=function(e){setTimeout(ri(e),0)});var Jf={set:zi,clear:Bi},Yf=function(){this.head=null,this.tail=null};Yf.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e){var t=this.head=e.next;return t===null&&(this.tail=null),e.item}}};var Xf=Yf,X$=Or,q$=/ipad|iphone|ipod/i.test(X$)&&typeof Pebble<"u",Q$=Or,eI=/web0s(?!.*chrome)/i.test(Q$),Mt=H,tI=af,tu=Zt,ni=Jf.set,rI=Xf,nI=Vf,aI=q$,iI=eI,ai=Fo,ru=Mt.MutationObserver||Mt.WebKitMutationObserver,nu=Mt.document,au=Mt.process,Yr=Mt.Promise,Hi=tI("queueMicrotask"),$t,ii,oi,Xr,iu;if(!Hi){var qr=new rI,Qr=function(){var e,t;for(ai&&(e=au.domain)&&e.exit();t=qr.get();)try{t()}catch(r){throw qr.head&&$t(),r}e&&e.enter()};!nI&&!ai&&!iI&&ru&&nu?(ii=!0,oi=nu.createTextNode(""),new ru(Qr).observe(oi,{characterData:!0}),$t=function(){oi.data=ii=!ii}):!aI&&Yr&&Yr.resolve?(Xr=Yr.resolve(void 0),Xr.constructor=Yr,iu=tu(Xr.then,Xr),$t=function(){iu(Qr)}):ai?$t=function(){au.nextTick(Qr)}:(ni=tu(ni,Mt),$t=function(){ni(Qr)}),Hi=function(e){qr.head||$t(),qr.add(e)}}var oI=Hi,sI=function(e,t){try{arguments.length===1?console.error(e):console.error(e,t)}catch{}},Yt=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}},cI=H,Ar=cI.Promise,uI=H,yr=Ar,lI=W,fI=Jl,dI=yo,vI=Q,ou=Hf,si=Pl;yr&&yr.prototype;var hI=vI("species"),Ki=!1,qf=lI(uI.PromiseRejectionEvent),pI=fI("Promise",function(){var e=dI(yr),t=e!==String(yr);if(!t&&si===66)return!0;if(!si||si<51||!/native code/.test(e)){var r=new yr(function(i){i(1)}),n=function(i){i(function(){},function(){})},a=r.constructor={};if(a[hI]=n,Ki=r.then(function(){})instanceof n,!Ki)return!0}return!t&&(ou==="BROWSER"||ou==="DENO")&&!qf}),jr={CONSTRUCTOR:pI,REJECTION_EVENT:qf,SUBCLASSING:Ki},je={},su=Oe,mI=TypeError,gI=function(e){var t,r;this.promise=new e(function(n,a){if(t!==void 0||r!==void 0)throw new mI("Bad Promise constructor");t=n,r=a}),this.resolve=su(t),this.reject=su(r)};je.f=function(e){return new gI(e)};var yI=Y,_n=Fo,Je=H,Ft=te,cu=ye,uu=$o,wI=Vt,bI=R$,SI=Oe,mn=W,$I=ge,II=Eo,TI=Kf,Qf=Jf.set,Bo=oI,EI=sI,PI=Yt,OI=Xf,ed=Wt,Rn=Ar,Ho=jr,td=je,Qn="Promise",rd=Ho.CONSTRUCTOR,kI=Ho.REJECTION_EVENT,_I=Ho.SUBCLASSING,ci=ed.getterFor(Qn),RI=ed.set,Et=Rn&&Rn.prototype,tt=Rn,en=Et,nd=Je.TypeError,Gi=Je.document,Ko=Je.process,Wi=td.f,CI=Wi,AI=!!(Gi&&Gi.createEvent&&Je.dispatchEvent),ad="unhandledrejection",jI="rejectionhandled",lu=0,id=1,LI=2,Go=1,od=2,tn,fu,NI,du,sd=function(e){var t;return $I(e)&&mn(t=e.then)?t:!1},cd=function(e,t){var r=t.value,n=t.state===id,a=n?e.ok:e.fail,i=e.resolve,o=e.reject,s=e.domain,u,f,l;try{a?(n||(t.rejection===od&&xI(t),t.rejection=Go),a===!0?u=r:(s&&s.enter(),u=a(r),s&&(s.exit(),l=!0)),u===e.promise?o(new nd("Promise-chain cycle")):(f=sd(u))?Ft(f,u,i,o):i(u)):o(r)}catch(c){s&&!l&&s.exit(),o(c)}},ud=function(e,t){e.notified||(e.notified=!0,Bo(function(){for(var r=e.reactions,n;n=r.get();)cd(n,e);e.notified=!1,t&&!e.rejection&&UI(e)}))},ld=function(e,t,r){var n,a;AI?(n=Gi.createEvent("Event"),n.promise=t,n.reason=r,n.initEvent(e,!1,!0),Je.dispatchEvent(n)):n={promise:t,reason:r},!kI&&(a=Je["on"+e])?a(n):e===ad&&EI("Unhandled promise rejection",r)},UI=function(e){Ft(Qf,Je,function(){var t=e.facade,r=e.value,n=vu(e),a;if(n&&(a=PI(function(){_n?Ko.emit("unhandledRejection",r,t):ld(ad,t,r)}),e.rejection=_n||vu(e)?od:Go,a.error))throw a.value})},vu=function(e){return e.rejection!==Go&&!e.parent},xI=function(e){Ft(Qf,Je,function(){var t=e.facade;_n?Ko.emit("rejectionHandled",t):ld(jI,t,e.value)})},_t=function(e,t,r){return function(n){e(t,n,r)}},At=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=LI,ud(e,!0))},Vi=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new nd("Promise can't be resolved itself");var n=sd(t);n?Bo(function(){var a={done:!1};try{Ft(n,t,_t(Vi,a,e),_t(At,a,e))}catch(i){At(a,i,e)}}):(e.value=t,e.state=id,ud(e,!1))}catch(a){At({done:!1},a,e)}}};if(rd&&(tt=function(t){II(this,en),SI(t),Ft(tn,this);var r=ci(this);try{t(_t(Vi,r),_t(At,r))}catch(n){At(r,n)}},en=tt.prototype,tn=function(t){RI(this,{type:Qn,done:!1,notified:!1,parent:!1,reactions:new OI,rejection:!1,state:lu,value:void 0})},tn.prototype=cu(en,"then",function(t,r){var n=ci(this),a=Wi(TI(this,tt));return n.parent=!0,a.ok=mn(t)?t:!0,a.fail=mn(r)&&r,a.domain=_n?Ko.domain:void 0,n.state===lu?n.reactions.add(a):Bo(function(){cd(a,n)}),a.promise}),fu=function(){var e=new tn,t=ci(e);this.promise=e,this.resolve=_t(Vi,t),this.reject=_t(At,t)},td.f=Wi=function(e){return e===tt||e===NI?new fu(e):CI(e)},mn(Rn)&&Et!==Object.prototype)){du=Et.then,_I||cu(Et,"then",function(t,r){var n=this;return new tt(function(a,i){Ft(du,n,a,i)}).then(t,r)},{unsafe:!0});try{delete Et.constructor}catch{}uu&&uu(Et,en)}yI({global:!0,constructor:!0,wrap:!0,forced:rd},{Promise:tt});wI(tt,Qn,!1);bI(Qn);var DI=Q,fd=DI("iterator"),dd=!1;try{var MI=0,hu={next:function(){return{done:!!MI++}},return:function(){dd=!0}};hu[fd]=function(){return this},Array.from(hu,function(){throw 2})}catch{}var FI=function(e,t){try{if(!t&&!dd)return!1}catch{return!1}var r=!1;try{var n={};n[fd]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch{}return r},zI=Ar,BI=FI,HI=jr.CONSTRUCTOR,ea=HI||!BI(function(e){zI.all(e).then(void 0,function(){})}),KI=Y,GI=te,WI=Oe,VI=je,ZI=Yt,JI=Cr,YI=ea;KI({target:"Promise",stat:!0,forced:YI},{all:function(t){var r=this,n=VI.f(r),a=n.resolve,i=n.reject,o=ZI(function(){var s=WI(r.resolve),u=[],f=0,l=1;JI(t,function(c){var d=f++,v=!1;l++,GI(s,r,c).then(function(p){v||(v=!0,u[d]=p,--l||a(u))},i)}),--l||a(u)});return o.error&&i(o.value),n.promise}});var XI=Y,qI=jr.CONSTRUCTOR,Zi=Ar,QI=Pe,e0=W,t0=ye,pu=Zi&&Zi.prototype;XI({target:"Promise",proto:!0,forced:qI,real:!0},{catch:function(e){return this.then(void 0,e)}});if(e0(Zi)){var mu=QI("Promise").prototype.catch;pu.catch!==mu&&t0(pu,"catch",mu,{unsafe:!0})}var r0=Y,n0=te,a0=Oe,i0=je,o0=Yt,s0=Cr,c0=ea;r0({target:"Promise",stat:!0,forced:c0},{race:function(t){var r=this,n=i0.f(r),a=n.reject,i=o0(function(){var o=a0(r.resolve);s0(t,function(s){n0(o,r,s).then(n.resolve,a)})});return i.error&&a(i.value),n.promise}});var u0=Y,l0=je,f0=jr.CONSTRUCTOR;u0({target:"Promise",stat:!0,forced:f0},{reject:function(t){var r=l0.f(this),n=r.reject;return n(t),r.promise}});var d0=Ee,v0=ge,h0=je,vd=function(e,t){if(d0(e),v0(t)&&t.constructor===e)return t;var r=h0.f(e),n=r.resolve;return n(t),r.promise},p0=Y,m0=Pe,g0=jr.CONSTRUCTOR,y0=vd;m0("Promise");p0({target:"Promise",stat:!0,forced:g0},{resolve:function(t){return y0(this,t)}});var w0=Y,b0=te,S0=Oe,$0=je,I0=Yt,T0=Cr,E0=ea;w0({target:"Promise",stat:!0,forced:E0},{allSettled:function(t){var r=this,n=$0.f(r),a=n.resolve,i=n.reject,o=I0(function(){var s=S0(r.resolve),u=[],f=0,l=1;T0(t,function(c){var d=f++,v=!1;l++,b0(s,r,c).then(function(p){v||(v=!0,u[d]={status:"fulfilled",value:p},--l||a(u))},function(p){v||(v=!0,u[d]={status:"rejected",reason:p},--l||a(u))})}),--l||a(u)});return o.error&&i(o.value),n.promise}});var P0=Y,O0=te,k0=Oe,_0=Pe,R0=je,C0=Yt,A0=Cr,j0=ea,gu="No one promise resolved";P0({target:"Promise",stat:!0,forced:j0},{any:function(t){var r=this,n=_0("AggregateError"),a=R0.f(r),i=a.resolve,o=a.reject,s=C0(function(){var u=k0(r.resolve),f=[],l=0,c=1,d=!1;A0(t,function(v){var p=l++,S=!1;c++,O0(u,r,v).then(function(g){S||d||(d=!0,i(g))},function(g){S||d||(S=!0,f[p]=g,--c||o(new n(f,gu)))})}),--c||o(new n(f,gu))});return s.error&&o(s.value),a.promise}});var L0=Y,N0=je;L0({target:"Promise",stat:!0},{withResolvers:function(){var t=N0.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}});var U0=Y,Cn=Ar,x0=q,hd=Pe,pd=W,D0=Kf,yu=vd,M0=ye,Ji=Cn&&Cn.prototype,F0=!!Cn&&x0(function(){Ji.finally.call({then:function(){}},function(){})});U0({target:"Promise",proto:!0,real:!0,forced:F0},{finally:function(e){var t=D0(this,hd("Promise")),r=pd(e);return this.then(r?function(n){return yu(t,e()).then(function(){return n})}:e,r?function(n){return yu(t,e()).then(function(){throw n})}:e)}});if(pd(Cn)){var wu=hd("Promise").prototype.finally;Ji.finally!==wu&&M0(Ji,"finally",wu,{unsafe:!0})}var z0=Ao;z0.Promise;var B0=Y,H0=H,K0=Wf,G0=Zn,W0=je,V0=Oe,md=Yt,ui=H0.Promise,bu=!1,Z0=!ui||!ui.try||md(function(){ui.try(function(e){bu=e===8},8)}).error||!bu;B0({target:"Promise",stat:!0,forced:Z0},{try:function(e){var t=arguments.length>1?G0(arguments,1):[],r=W0.f(this),n=md(function(){return K0(V0(e),void 0,t)});return(n.error?r.reject:r.resolve)(n.value),r.promise}});function Ye(e,t){if(typeof window>"u")return;const r=new CustomEvent(e,{detail:t,bubbles:!0,composed:!0});dispatchEvent(r)}function Re(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]])}return r}var rt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vo(e,t){return e(t={exports:{}},t.exports),t.exports}var et=Vo(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){var a=this;this.locked=new Map,this.addToLocked=function(i,o){var s=a.locked.get(i);s===void 0?o===void 0?a.locked.set(i,[]):a.locked.set(i,[o]):o!==void 0&&(s.unshift(o),a.locked.set(i,s))},this.isLocked=function(i){return a.locked.has(i)},this.lock=function(i){return new Promise(function(o,s){a.isLocked(i)?a.addToLocked(i,o):(a.addToLocked(i),o())})},this.unlock=function(i){var o=a.locked.get(i);if(o!==void 0&&o.length!==0){var s=o.pop();a.locked.set(i,o),s!==void 0&&setTimeout(s,0)}else a.locked.delete(i)}}return n.getInstance=function(){return n.instance===void 0&&(n.instance=new n),n.instance},n}();t.default=function(){return r.getInstance()}});Wo(et);var J0=Wo(Vo(function(e,t){var r=rt&&rt.__awaiter||function(l,c,d,v){return new(d||(d=Promise))(function(p,S){function g(b){try{I(v.next(b))}catch(h){S(h)}}function T(b){try{I(v.throw(b))}catch(h){S(h)}}function I(b){b.done?p(b.value):new d(function(h){h(b.value)}).then(g,T)}I((v=v.apply(l,c||[])).next())})},n=rt&&rt.__generator||function(l,c){var d,v,p,S,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return S={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(S[Symbol.iterator]=function(){return this}),S;function T(I){return function(b){return function(h){if(d)throw new TypeError("Generator is already executing.");for(;g;)try{if(d=1,v&&(p=2&h[0]?v.return:h[0]?v.throw||((p=v.return)&&p.call(v),0):v.next)&&!(p=p.call(v,h[1])).done)return p;switch(v=0,p&&(h=[2&h[0],p.value]),h[0]){case 0:case 1:p=h;break;case 4:return g.label++,{value:h[1],done:!1};case 5:g.label++,v=h[1],h=[0];continue;case 7:h=g.ops.pop(),g.trys.pop();continue;default:if(p=g.trys,!((p=p.length>0&&p[p.length-1])||h[0]!==6&&h[0]!==2)){g=0;continue}if(h[0]===3&&(!p||h[1]>p[0]&&h[1]<p[3])){g.label=h[1];break}if(h[0]===6&&g.label<p[1]){g.label=p[1],p=h;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(h);break}p[2]&&g.ops.pop(),g.trys.pop();continue}h=c.call(l,g)}catch($){h=[6,$],v=0}finally{d=p=0}if(5&h[0])throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}([I,b])}}},a=rt;Object.defineProperty(t,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},getItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},clear:function(){return r(a,void 0,void 0,function(){return n(this,function(l){return[2,window.localStorage.clear()]})})},removeItem:function(l){return r(a,void 0,void 0,function(){return n(this,function(c){throw new Error("Unsupported")})})},setItem:function(l,c){return r(a,void 0,void 0,function(){return n(this,function(d){throw new Error("Unsupported")})})},keySync:function(l){return window.localStorage.key(l)},getItemSync:function(l){return window.localStorage.getItem(l)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(l){return window.localStorage.removeItem(l)},setItemSync:function(l,c){return window.localStorage.setItem(l,c)}};function s(l){return new Promise(function(c){return setTimeout(c,l)})}function u(l){for(var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",d="",v=0;v<l;v++)d+=c[Math.floor(Math.random()*c.length)];return d}var f=function(){function l(c){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=c,l.waiters===void 0&&(l.waiters=[])}return l.prototype.acquireLock=function(c,d){return d===void 0&&(d=5e3),r(this,void 0,void 0,function(){var v,p,S,g,T,I,b;return n(this,function(h){switch(h.label){case 0:v=Date.now()+u(4),p=Date.now()+d,S=i+"-"+c,g=this.storageHandler===void 0?o:this.storageHandler,h.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return h.sent(),g.getItemSync(S)!==null?[3,5]:(T=this.id+"-"+c+"-"+v,[4,s(Math.floor(25*Math.random()))]);case 3:return h.sent(),g.setItemSync(S,JSON.stringify({id:this.id,iat:v,timeoutKey:T,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return h.sent(),(I=g.getItemSync(S))!==null&&(b=JSON.parse(I)).id===this.id&&b.iat===v?(this.acquiredIatSet.add(v),this.refreshLockWhileAcquired(S,v),[2,!0]):[3,7];case 5:return l.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:h.sent(),h.label=7;case 7:return v=Date.now()+u(4),[3,1];case 8:return[2,!1]}})})},l.prototype.refreshLockWhileAcquired=function(c,d){return r(this,void 0,void 0,function(){var v=this;return n(this,function(p){return setTimeout(function(){return r(v,void 0,void 0,function(){var S,g,T;return n(this,function(I){switch(I.label){case 0:return[4,et.default().lock(d)];case 1:return I.sent(),this.acquiredIatSet.has(d)?(S=this.storageHandler===void 0?o:this.storageHandler,(g=S.getItemSync(c))===null?(et.default().unlock(d),[2]):((T=JSON.parse(g)).timeRefreshed=Date.now(),S.setItemSync(c,JSON.stringify(T)),et.default().unlock(d),this.refreshLockWhileAcquired(c,d),[2])):(et.default().unlock(d),[2])}})})},1e3),[2]})})},l.prototype.waitForSomethingToChange=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,new Promise(function(v){var p=!1,S=Date.now(),g=!1;function T(){if(g||(window.removeEventListener("storage",T),l.removeFromWaiting(T),clearTimeout(I),g=!0),!p){p=!0;var b=50-(Date.now()-S);b>0?setTimeout(v,b):v(null)}}window.addEventListener("storage",T),l.addToWaiting(T);var I=setTimeout(T,Math.max(0,c-Date.now()))})];case 1:return d.sent(),[2]}})})},l.addToWaiting=function(c){this.removeFromWaiting(c),l.waiters!==void 0&&l.waiters.push(c)},l.removeFromWaiting=function(c){l.waiters!==void 0&&(l.waiters=l.waiters.filter(function(d){return d!==c}))},l.notifyWaiters=function(){l.waiters!==void 0&&l.waiters.slice().forEach(function(c){return c()})},l.prototype.releaseLock=function(c){return r(this,void 0,void 0,function(){return n(this,function(d){switch(d.label){case 0:return[4,this.releaseLock__private__(c)];case 1:return[2,d.sent()]}})})},l.prototype.releaseLock__private__=function(c){return r(this,void 0,void 0,function(){var d,v,p,S;return n(this,function(g){switch(g.label){case 0:return d=this.storageHandler===void 0?o:this.storageHandler,v=i+"-"+c,(p=d.getItemSync(v))===null?[2]:(S=JSON.parse(p)).id!==this.id?[3,2]:[4,et.default().lock(S.iat)];case 1:g.sent(),this.acquiredIatSet.delete(S.iat),d.removeItemSync(v),et.default().unlock(S.iat),l.notifyWaiters(),g.label=2;case 2:return[2]}})})},l.lockCorrector=function(c){for(var d=Date.now()-5e3,v=c,p=[],S=0;;){var g=v.keySync(S);if(g===null)break;p.push(g),S++}for(var T=!1,I=0;I<p.length;I++){var b=p[I];if(b.includes(i)){var h=v.getItemSync(b);if(h!==null){var $=JSON.parse(h);($.timeRefreshed===void 0&&$.timeAcquired<d||$.timeRefreshed!==void 0&&$.timeRefreshed<d)&&(v.removeItemSync(b),T=!0)}}}T&&l.notifyWaiters()},l.waiters=void 0,l}();t.default=f}));const Y0={timeoutInSeconds:60},gd={name:"auth0-spa-js",version:"2.1.3"},yd=()=>Date.now();let se=class Yi extends Error{constructor(t,r){super(r),this.error=t,this.error_description=r,Object.setPrototypeOf(this,Yi.prototype)}static fromPayload({error:t,error_description:r}){return new Yi(t,r)}},X0=class wd extends se{constructor(t,r,n,a=null){super(t,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,wd.prototype)}},Xi=class bd extends se{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,bd.prototype)}},q0=class Sd extends Xi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Sd.prototype)}},Q0=class $d extends se{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,$d.prototype)}},eT=class Id extends se{constructor(t,r,n){super(t,r),this.mfa_token=n,Object.setPrototypeOf(this,Id.prototype)}},Td=class Ed extends se{constructor(t,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Su(t,["default"])}', scope: '${Su(r)}')`),this.audience=t,this.scope=r,Object.setPrototypeOf(this,Ed.prototype)}};function Su(e,t=[]){return e&&!t.includes(e)?e:""}const gn=()=>window.crypto,li=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(gn().getRandomValues(new Uint8Array(43))).forEach(r=>t+=e[r%e.length]),t},$u=e=>btoa(e),qi=e=>{var{clientId:t}=e,r=Re(e,["clientId"]);return new URLSearchParams((n=>Object.keys(n).filter(a=>n[a]!==void 0).reduce((a,i)=>Object.assign(Object.assign({},a),{[i]:n[i]}),{}))(Object.assign({client_id:t},r))).toString()},Iu=e=>(t=>decodeURIComponent(atob(t).split("").map(r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),tT=async(e,t)=>{const r=await fetch(e,t);return{ok:r.ok,json:await r.json()}},rT=async(e,t,r)=>{const n=new AbortController;let a;return t.signal=n.signal,Promise.race([tT(e,t),new Promise((i,o)=>{a=setTimeout(()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))},r)})]).finally(()=>{clearTimeout(a)})},nT=async(e,t,r,n,a,i,o)=>{return s={auth:{audience:t,scope:r},timeout:a,fetchUrl:e,fetchOptions:n,useFormData:o},u=i,new Promise(function(f,l){const c=new MessageChannel;c.port1.onmessage=function(d){d.data.error?l(new Error(d.data.error)):f(d.data),c.port1.close()},u.postMessage(s,[c.port2])});var s,u},aT=async(e,t,r,n,a,i,o=1e4)=>a?nT(e,t,r,n,o,a,i):rT(e,n,o);async function iT(e,t){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s}=e,u=Re(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const f=s?qi(u):JSON.stringify(u);return await async function(l,c,d,v,p,S,g){let T,I=null;for(let C=0;C<3;C++)try{T=await aT(l,d,v,p,S,g,c),I=null;break}catch(M){I=M}if(I)throw I;const b=T.json,{error:h,error_description:$}=b,k=Re(b,["error","error_description"]),{ok:_}=T;if(!_){const C=$||`HTTP error. Unable to fetch ${l}`;throw h==="mfa_required"?new eT(h,C,k.mfa_token):h==="missing_refresh_token"?new Td(d,v):new se(h||"request_error",C)}return k}(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:f,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(o||gd))}},t,s)}const rn=(...e)=>{return(t=e.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(t))).join(" ");var t};let it=class Qi{constructor(t,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[r,n,a,i]=t.split("::");return new Qi({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(t){const{scope:r,audience:n,client_id:a}=t;return new Qi({scope:r,audience:n,clientId:a})}},oT=class{set(t,r){localStorage.setItem(t,JSON.stringify(r))}get(t){const r=window.localStorage.getItem(t);if(r)try{return JSON.parse(r)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}},Pd=class{constructor(){this.enclosedCache=function(){let t={};return{set(r,n){t[r]=n},get(r){const n=t[r];if(n)return n},remove(r){delete t[r]},allKeys:()=>Object.keys(t)}}()}},sT=class{constructor(t,r,n){this.cache=t,this.keyManifest=r,this.nowProvider=n||yd}async setIdToken(t,r,n){var a;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(t){const r=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!r&&t.scope&&t.audience){const n=await this.get(t);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(t,r=0){var n;let a=await this.cache.get(t.toKey());if(!a){const s=await this.getCacheKeys();if(!s)return;const u=this.matchExistingCacheKey(t,s);u&&(a=await this.cache.get(u))}if(!a)return;const i=await this.nowProvider(),o=Math.floor(i/1e3);return a.expiresAt-r<o?a.body.refresh_token?(a.body={refresh_token:a.body.refresh_token},await this.cache.set(t.toKey(),a),a.body):(await this.cache.remove(t.toKey()),void await((n=this.keyManifest)===null||n===void 0?void 0:n.remove(t.toKey()))):a.body}async set(t){var r;const n=new it({clientId:t.client_id,scope:t.scope,audience:t.audience}),a=await this.wrapCacheEntry(t);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async clear(t){var r;const n=await this.getCacheKeys();n&&(await n.filter(a=>!t||a.includes(t)).reduce(async(a,i)=>{await a,await this.cache.remove(i)},Promise.resolve()),await((r=this.keyManifest)===null||r===void 0?void 0:r.clear()))}async wrapCacheEntry(t){const r=await this.nowProvider();return{body:t,expiresAt:Math.floor(r/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new it({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,r){return r.filter(n=>{var a;const i=it.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=t.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce((f,l)=>f&&o.has(l),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&u})[0]}},cT=class{constructor(t,r,n){this.storage=t,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const or=e=>typeof e=="number",uT=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],lT=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const o=i.split("."),[s,u,f]=o;if(o.length!==3||!s||!u||!f)throw new Error("ID token could not be decoded");const l=JSON.parse(Iu(u)),c={__raw:i},d={};return Object.keys(l).forEach(v=>{c[v]=l[v],uT.includes(v)||(d[v]=l[v])}),{encoded:{header:s,payload:u,signature:f},header:JSON.parse(Iu(s)),claims:c,user:d}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${e.iss}", found "${t.claims.iss}"`);if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error(`Signature algorithm of "${t.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but was not one of "${t.claims.aud.join(", ")}"`);if(t.claims.aud.length>1){if(!t.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(t.claims.azp!==e.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${e.aud}", found "${t.claims.azp}"`)}}else if(t.claims.aud!==e.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${e.aud}" but found "${t.claims.aud}"`);if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${e.nonce}", found "${t.claims.nonce}"`)}if(e.max_age&&!or(t.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(t.claims.exp==null||!or(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!or(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=e.leeway||60,n=new Date(e.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(t.claims.exp+r),n>a)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${n}) is after expiration time (${a})`);if(t.claims.nbf!=null&&or(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-r),n<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${n}) is before ${i}`)}if(t.claims.auth_time!=null&&or(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const o=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==t.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_id}"`)}else{const o=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==t.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${t.claims.org_name}"`)}}return t};var ot=Vo(function(e,t){var r=rt&&rt.__assign||function(){return r=Object.assign||function(u){for(var f,l=1,c=arguments.length;l<c;l++)for(var d in f=arguments[l])Object.prototype.hasOwnProperty.call(f,d)&&(u[d]=f[d]);return u},r.apply(this,arguments)};function n(u,f){if(!f)return"";var l="; "+u;return f===!0?l:l+"="+f}function a(u,f,l){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(f).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(c){if(typeof c.expires=="number"){var d=new Date;d.setMilliseconds(d.getMilliseconds()+864e5*c.expires),c.expires=d}return n("Expires",c.expires?c.expires.toUTCString():"")+n("Domain",c.domain)+n("Path",c.path)+n("Secure",c.secure)+n("SameSite",c.sameSite)}(l)}function i(u){for(var f={},l=u?u.split("; "):[],c=/(%[\dA-F]{2})+/gi,d=0;d<l.length;d++){var v=l[d].split("="),p=v.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{f[v[0].replace(c,decodeURIComponent)]=p.replace(c,decodeURIComponent)}catch{}}return f}function o(){return i(document.cookie)}function s(u,f,l){document.cookie=a(u,f,r({path:"/"},l))}t.__esModule=!0,t.encode=a,t.parse=i,t.getAll=o,t.get=function(u){return o()[u]},t.set=s,t.remove=function(u,f){s(u,"",r(r({},f),{expires:-1}))}});Wo(ot),ot.encode,ot.parse,ot.getAll;var fT=ot.get,Od=ot.set,kd=ot.remove;const Pt={get(e){const t=fT(e);if(t!==void 0)return JSON.parse(t)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Od(e,JSON.stringify(t),n)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r)}},dT={get(e){return Pt.get(e)||Pt.get(`_legacy_${e}`)},save(e,t,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r!=null&&r.daysUntilExpire&&(n.expires=r.daysUntilExpire),r!=null&&r.cookieDomain&&(n.domain=r.cookieDomain),Od(`_legacy_${e}`,JSON.stringify(t),n),Pt.save(e,t,r)},remove(e,t){let r={};t!=null&&t.cookieDomain&&(r.domain=t.cookieDomain),kd(e,r),Pt.remove(e,t),Pt.remove(`_legacy_${e}`,t)}},vT={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};function hT(e,t,r){var n=t===void 0?null:t,a=function(u,f){var l=atob(u);if(f){for(var c=new Uint8Array(l.length),d=0,v=l.length;d<v;++d)c[d]=l.charCodeAt(d);return String.fromCharCode.apply(null,new Uint16Array(c.buffer))}return l}(e,r!==void 0&&r),i=a.indexOf(`
2
+ `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Tu,Eu,Pu,fi,pT=(Tu="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Eu=null,Pu=!1,function(e){return fi=fi||hT(Tu,Eu,Pu),new Worker(fi,e)});const di={};let mT=class{constructor(t,r){this.cache=t,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(t),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(t){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(t),n.size>0?await this.cache.set(this.manifestKey,{keys:[...n]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(t){return`@@auth0spajs@@::${t}`}};const gT={memory:()=>new Pd().enclosedCache,localstorage:()=>new oT},Ou=e=>gT[e],ku=e=>{const{openUrl:t,onRedirect:r}=e,n=Re(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:t===!1||t?t:r})},vi=new J0;let yT=class{constructor(t){let r,n;if(this.userCache=new Pd().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await vi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!gn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(gn().subtle===void 0)throw new Error(`
3
3
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
4
- `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!bu(r))throw new Error(`Invalid cache location "${r}"`);n=bu(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Pt:eE,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:tE;var i;this.scope=Qr("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Y0(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||ud,this.cacheManager=new J0(n,n.allKeys?void 0:new aE(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new nE)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||cd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${Ji(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return q0({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=pu(si()),i=pu(si()),o=si(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await hn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,E)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:Qr(c,d.scope),response_type:"code",response_mode:E||"query",state:v,nonce:p,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new z0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new F0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(se.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new se("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=Su(t),{openUrl:a,fragment:i,appState:o}=n,s=_e(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=_e(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new se("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new M0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new se("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:Qr(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=ui[o];return s||(s=i().finally(()=>{delete ui[o],s=null}),ui[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=_e(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>li.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Zi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await li.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:Qr(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},D0),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=_e(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Ji(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=Su(t),{openUrl:n}=r,a=_e(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new se("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((p,S,g=60)=>new Promise((E,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Zi),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.close(),_.data.response.error?I(se.fromPayload(_.data.response)):E(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new se("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new it({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new pd(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=_e(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new it({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new it({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await V0(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function sE(e){const t=new oE(e);return await t.checkSession(),t}var Ee=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Ee||{});const cE="sesamy.com",uE="sesamy.dev",lE="https://sesa.my",Xi="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?uE:cE}`}let ue,bd,Sd=!1;const zt="sesamyAccessToken",fi="sesamyRefreshToken";async function Ar(){return new Promise((r,n)=>{let a=0;const i=()=>{Sd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function fE(e){if(!e)return null;const t=localStorage.getItem(fi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(fi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(fi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{$d()}}async function Go(){const e=localStorage.getItem(zt);if(!e)return null;const t=Id(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await fE(t);if(r)return r;localStorage.removeItem(zt)}return e}function $u(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function dE(e){if(e.enabled===!1)return;bd=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if($u(window.location.href)!==$u(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await sE(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();Ye(Ee.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Sd=!0}async function Wo(){return await Ar(),await Go()?!0:ue?ue.isAuthenticated():!1}async function vE(){return await Ar(),await Go()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Vo(e){if(await Ar(),localStorage.removeItem(zt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:bd,redirect_uri:window.location.href,...t}})}async function ir(e=!0){await Ar();const t=await Go();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function $d(e={}){if(await Ar(),localStorage.removeItem(zt),Ye(Ee.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Id(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Ed(e){const t=Id(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Ye(Ee.AUTHENTICATED,t)}const hE=(e,t)=>t.skipDedupe||t.method!=="GET",pE=(e,t)=>t.method+"@"+e,mE=e=>e.clone(),Iu=({skip:e=hE,key:t=pE,resolver:r=mE}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([f,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},gE=(e,t)=>e*t,yE=e=>e&&e.ok,Eu=({delayTimer:e=500,delayRamp:t=gE,maxAttempts:r=10,until:n=yE,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const E=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},E)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},wE="application/json",Td="Content-Type",It=Symbol(),Pd=Symbol();function Tu(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Td.toLowerCase()))===null||t===void 0?void 0:t[1]}function Pu(e){return/^application\/.*json.*/.test(e)}const st=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=st(o,i,r):n[a]=i,n},{...e})},Bt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function bE(e,t=!1){Bt.options=t?e:st(Bt.options,e)}function SE(e,t=!1){Bt.polyfills=t?e:st(Bt.polyfills,e)}function $E(e){Bt.errorType=e}const IE=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Od extends Error{}const EE=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=IE(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[It]:b}}).then(b=>{if(!b.ok){const h=new Od;if(h.cause=v,h.stack=h.stack+`
5
- CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(It),k=$?h[It]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(It)&&f.get(It);if(_)return _(k,e);const C=f.get(Pd);if(C)return C(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),E={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(It,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),E);return o.reduce((b,h)=>h(b,e),I)},TE={_url:"",_options:{},_config:Bt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:st(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:st(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Td]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Pd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Tu(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Pu(a));return n=r?o?n.json(r,a):n.body(r):n,EE(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Tu(this._options.headers);return this.content(t||Pu(r)&&r||wE).body(JSON.stringify(e))}};function De(e="",t={}){return{...TE,_url:e,_options:t}}De.default=De;De.options=bE;De.errorType=$E;De.polyfills=SE;De.WretchError=Od;function Se(){sessionStorage.removeItem(Xi),Ye(Ee.CLEAR_CACHE,{})}function Ou(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function PE(e){const t=Ke("api2",e.environment),r=w=>async(T,P)=>{let B=sessionStorage.getItem(Xi);B||(B=Date.now().toString(),sessionStorage.setItem(Xi,B));const ae={...P,headers:{...P.headers,"Cache-Timestamp":B}};return w(T,ae)},n=(w=!0)=>T=>async(P,B)=>{let ae=null;if(ae=await ir(w),!ae){if(w)throw new Error("No access token available");return T(P,B)}const ze={...B,headers:{...B.headers,...ae?{Authorization:`Bearer ${ae}`}:{}}};return T(P,ze)},a=w=>(T,P)=>{if(P.headers.Authorization)return w(T,P);const B=localStorage.getItem("__anon_id"),ae=btoa(`${B}:`),ze={...P,headers:{...P.headers,Authorization:`Basic ${ae}`}};return w(T,ze)},i=De(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Iu(),Eu({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=De(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Iu(),Eu({delayTimer:1e3,delayRamp:(w,T)=>w*T,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const T=await i.get("/entitlements").json();return T==null?void 0:T.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const T=await i.get("/contracts").json();return T==null?void 0:T.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const T=await i.get("/bills").json();return T==null?void 0:T.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const T=await i.get("/transactions").json();return T==null?void 0:T.find(P=>P.id===w)}async function E(w,T){const P=await i.url(`/user-metadata/${w}`).put(T).json();return Ye(Ee.USER_ATTRIBUTE_CHANGED,{}),Se(),P}async function I(w){const T=await i.url(`/user-metadata/${w}`).delete().res();return Se(),T.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const T=await i.url(`/tags/${w}`).delete().res();return Se(),T.ok}async function _(w){const T=await i.url("/tags").post(w).res();return Ye(Ee.USER_ATTRIBUTE_CHANGED,{}),Se(),T.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const T=await o.url(`/tallies/${w}`).delete().res();return Se(),T.ok}async function V(w,T){return await o.url(`/tallies/${w}/push`).post(T).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await ir(!1)?await i.url("/profile").get().json():null}async function z(w){const T=await i.url("/profile").patch(w).res();return Se(),T.ok}async function R(){return await i.url("/payment-issues").get().json()}async function K(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function J(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function je(w){const T=await ir(!1);if(!T)throw new Error("No access token available");const P=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",T),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const T=await i.url(`/products/${w}/auto-onboard`).post().json();return T.length&&Se(),T}async function y(w,T=3600){const{shortlink:P}=await De(lE).post({url:w,ttl:T}).json();return P}async function O(w){const T=await ir(!1);let P;const B=w.language||Ou();switch(w.target){case"account":P=new URL(`${Ke("account",e.environment)}/${B}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ke("consume",e.environment)}/${B}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),T&&(P.hash=`#access_token=${T}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Ou(),...w,vendorId:e.clientId})).json()}async function U(w,T){return(await o.url(`/checkouts/${w}`).patch(T)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await ir(!1),T=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);w&&(T.hash=`#access_token=${w}`),window.location.href=T.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:z,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:E,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:C,getTallies:M,deleteTally:F,pushTally:V,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:K,unlinkSpotify:J,linkSpotify:je,generateLink:O,openHostedAccountPage:Z}}const kd="@sesamy/sesamy-js",Zo="1.19.1";function ku(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var en="undefined",_u="object",qi=function(){},_d="any",Rd="*",lt="__",_n=typeof process<"u"?process:{};_n.env&&_n.env.NODE_ENV;var Y=typeof document<"u";_n.versions!=null&&_n.versions.node!=null;typeof Deno<"u"&&Deno.core;Y&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Cd(e,t){return t.charAt(0)[e]()+t.slice(1)}var OE=Cd.bind(null,"toUpperCase"),kE=Cd.bind(null,"toLowerCase");function _E(e){return Ad(e)?OE("null"):typeof e=="object"?jE(e):Object.prototype.toString.call(e).slice(8,-1)}function Rn(e,t){t===void 0&&(t=!0);var r=_E(e);return t?kE(r):r}function jr(e,t){return typeof t===e}var oe=jr.bind(null,"function"),Ve=jr.bind(null,"string"),Rt=jr.bind(null,"undefined"),RE=jr.bind(null,"boolean");jr.bind(null,"symbol");function Ad(e){return e===null}function CE(e){return Rn(e)==="number"&&!isNaN(e)}function jd(e){return Rn(e)==="array"}function ie(e){if(!AE(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function AE(e){return e&&(typeof e=="object"||e!==null)}function jE(e){return oe(e.constructor)?e.constructor.name:null}function LE(e){return e instanceof Error||Ve(e.message)&&e.constructor&&CE(e.constructor.stackTraceLimit)}function Ld(e,t){if(typeof t!="object"||Ad(t))return!1;if(t instanceof e)return!0;var r=Rn(new e(""));if(LE(t))for(;t;){if(Rn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Ld.bind(null,TypeError);Ld.bind(null,SyntaxError);function Qn(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?NE(e,t):r}function NE(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ea(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ea(Qn,"form");ea(Qn,"button");ea(Qn,"input");ea(Qn,"select");function UE(e){return e?jd(e)?e:[e]:[]}function Ru(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function xE(){if(Y){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function DE(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ME(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=Ru(r[1]),o=Ru(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(FE(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return Y&&window.location.search.substring(1)}())}function FE(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function ta(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function zE(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var gr="global",Ht=lt+"global"+lt,Kt=typeof self===_u&&self.self===self&&self||typeof global===_u&&global.global===global&&global||void 0;function ft(e){return Kt[Ht][e]}function dt(e,t){return Kt[Ht][e]=t}function Yt(e){delete Kt[Ht][e]}function Xt(e,t,r){var n;try{if(Jo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Ht]||(Kt[Ht]={});var tn={};function Jo(e){if(typeof tn[e]!==en)return tn[e];try{var t=window[e];t.setItem(en,en),t.removeItem(en)}catch{return tn[e]=!1}return tn[e]=!0}function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var Ge="function",xe="undefined",BE="@@redux/"+Math.random().toString(36),Cu=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),rn=" != "+Ge;function Nd(e,t,r){var n;if(typeof t===Ge&&typeof r===xe&&(r=t,t=void 0),typeof r!==xe){if(typeof r!==Ge)throw new Error("enhancer"+rn);return r(Nd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+rn);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+rn);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===xe)throw new Error("ActType "+xe);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+rn);a=v,d({type:"@@redux/INIT"})}})[Cu]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Cu]=function(){return this},v},n}function HE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+xe}function Gt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function KE(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=Gt.apply(void 0,i)(o.dispatch)})}}}var Ze=lt+"anon_id",ct=lt+"user_id",jt=lt+"user_traits",He="userId",Ct="anonymousId",pn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],Qi=["name","EVENTS","config","loaded"],A=pn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Au=/^utm_/,ju=/^an_prop_/,Lu=/^an_trait_/;function GE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ze,o.anonymousId),f||t(ct,o.userId),u.traits&&t(jt,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(p,S){if(S.match(Au)||S.match(/^(d|g)clid/)){var g=S.replace(Au,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(ju)&&(p.props[S.replace(ju,"")]=i[S]),S.match(Lu)&&(p.traits[S.replace(Lu,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function WE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ze)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Ze,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Nu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Ze),traits:e.getItem(jt)}}var eo=function(e){return lt+"TEMP"+lt+e};function VE(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([ct,jt,Ze].forEach(function(v){n(v)}),[He,Ct,"traits"].forEach(function(v){Yt(eo(v))})),s.type===A.identify){a(Ze)||r(Ze,ta());var c=a(ct),d=a(jt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(jt,j({},d,f))}return o(s)}}}}var lr={};function Uu(e,t){lr[e]&&oe(lr[e])&&(lr[e](t),delete lr[e])}function Ud(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Ud(e,t,r-10).then(n,a)})})}function ZE(e){return{abort:e}}function xd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&oe(S)){var g,E=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[He,Ct].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[E.meta.rid];if(!I&&(g=S({payload:E,config:o[v].config,instance:r,abort:ZE}))&&ie(g)&&g.abort)return void(n[E.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(j({},E,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var di=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Lt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,E){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var C=I.type.match(Lt)?function(M,F,V,L,x){return function(z,R){var K=L?L.name:M,J=R&&Ir(R)?R:V;if(L&&(!(J=R&&Ir(R)?R:[M]).includes(M)||J.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(J)+" input valid");return j({},x,{abort:{reason:z,plugins:J,caller:F,_:K}})}}(k,_,E,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:JE(I),instance:g,config:$||{},abort:C}}}(n,v),S=t.exact.reduce(function(g,E){var I=E.pluginName,b=E.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,E,I){try{var b=E.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&oe(C.method)?(function(z,R){var K=Hu(z);if(K&&K.name===R){var J=Hu(K.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+K.method+" "+(J?"or "+J.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
- `))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(V=F,L=b,x=C.pluginName,function(z,R){return j({},V,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Mu(C.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(j({},F,R))})):F;var V,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(E,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(E).then(function(_){var C=g[$]?g[$]:{};if(d&&(C=_),hi(C,$))return vi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(hi(_,$))return h&&vi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:C,instance:n,config:Mu($,f,i),plugins:f})).then(function(F){var V=ie(F)?F:{},L=j({},_,V),x=g[$];if(hi(x,$))vi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(xu)&&!c.match(Du)&&n.dispatch(j({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(E){if(!(c.match(Lt)||c.match(/^registerPlugin/)||c.match(Du)||c.match(xu)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),E._&&E._.originalAction===c)return E;var I=j({},E,{_:{originalAction:E.type,called:E.type,from:"engineEnd"}});Dd(E,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:E.type+"Aborted"})),s.dispatch(I)}return E})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,xu=/^bootstrap/,Du=/^ready/;function vi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Mu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Fu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function zu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function hi(e,t){var r=e.abort;return!!r&&(r===!0||Bu(r,t)||r&&Bu(r.plugins,t))}function Dd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ve(r))return!0;var n=r.plugins;return Ir(r)&&r.length===t||Ir(n)&&n.length===t}function Ir(e){return Array.isArray(e)}function Bu(e,t){return!(!e||!Ir(e))&&e.includes(t)}function Hu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function JE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function YE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Uu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],E=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return Ud(h,function(){return $({config:_})},1e4).then(function(C){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!Qi.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:E};setTimeout(function(){v.length===I.length+E.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return xd(a,t,e)},0),Promise.resolve(function(h,$,k,_,C){try{var M=oe($)?$():$,F=h.type,V=F.replace(Lt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(K=M,(J=L.plugins)===void 0&&(J={}),(je=h.options)===void 0&&(je={}),Object.keys(K).filter(function(m){var y=je.plugins||{};return RE(y[m])?y[m]:y.all!==!1&&(!J[m]||J[m].enabled!==!1)}).map(function(m){return K[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,y,O){var N=zu(m).map(function(U){return Fu(U,y)});return y.reduce(function(U,D){var Z=D.name,w=zu(m,Z).map(function(ae){return Fu(ae,y)}),T=w[0],P=w[1],B=w[2];return T.length&&(U.beforeNS[Z]=T),P.length&&(U.duringNS[Z]=P),B.length&&(U.afterNS[Z]=B),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(di({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(m){function y(){var U=function(){if(F.match(Lt))return Promise.resolve(di({action:j({},O,{type:V+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Uu(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(Dd(m,z.length))return m;var O,N=function(){if(F!==V)return Promise.resolve(di({action:j({},m,{type:V}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var K,J,je}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function XE(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var qE=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Gt.apply(void 0,o)(n)(a)}}}}};function QE(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Ku(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Ku(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,Gu(r.plugins,!1,t));case A.enablePlugin:return j({},t,Gu(r.plugins,!0,t));default:return t}}}function Ku(e,t){return e.substring(t.length+1,e.length)}function Gu(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Md(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var eT={last:{},history:[]};function tT(e,t){e===void 0&&(e=eT);var r=t.options,n=t.meta;if(t.type===A.track){var a=Md(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var rT={actions:[]};function nT(e,t){e===void 0&&(e=rT);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Fd=/#.*$/;function aT(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Fd,""):"")}var zd,Bd,Hd,Kd,iT=function(e){if(e===void 0&&(e={}),!Y)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(Y){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(Fd,"")}(f),c={title:r,url:l,path:aT(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},oT={last:{},history:[]};function sT(e,t){e===void 0&&(e=oT);var r=t.options;if(t.type===A.page){var n=Md(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}zd=function(){if(!Y)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Bd=Y?document.referrer:null,Hd=xE(),Kd=DE();var Wu={initialized:!1,sessionId:ta(),app:null,version:null,debug:!1,offline:!!Y&&!navigator.onLine,os:{name:zd},userAgent:Y?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Kd,locale:Hd,campaign:{},referrer:Bd};function cT(e,t){e===void 0&&(e=Wu);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},Wu,e,{initialized:!0})}}var uT=["plugins","reducers","storage"];function lT(e,t,r){if(Y){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function fT(e){var t=lT.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function Gd(){return dt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Kt[Ht].analytics.push(o.action||o),i(o)}})}}}function Vu(e){return function(){return Gt(Gt.apply(null,arguments),Gd())}}function pi(e){return e?jd(e)?e:[e]:[]}function Zu(e,t,r){e===void 0&&(e={});var n,a,i=ta();return t&&(lr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function dT(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var T=Array.prototype.slice.call(arguments),P=new Array(w.length),B=0;B<T.length;B++)P[B]=T[B];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:Yt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Nu(m)[y]||ft(eo(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!Qi.includes(m)}).sort(),u=new Set(s.concat(pn).filter(function(m){return!Qi.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new qE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=ME(),E=Nu(a),I=j({},E,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=ta());var b=j({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:pi(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:pi(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ve(m)?m:null,D=ie(m)?m:y,Z=O||{},w=$.user();dt(eo(He),U);var T=U||D.userId||i(He,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(j({type:A.identifyStart,userId:T,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ve(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},Z=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:Z,userId:i(He,$,y),anonymousId:i(Ct,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:iT(N),options:U,userId:i(He,$,N),anonymousId:i(Ct,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===He||m==="id")return i(He,$);if(m===Ct||m==="anonId")return i(Ct,$);var y=$.getState("user");return m?ku(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(T){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),T(P)}}},U=function(w){return function(T){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),T(P)}}};return d(N,nn),d(U,an),function(){v(N,nn),v(U,an)}}var D=m.match(O)?nn:an,Z=function(w){return function(T){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),T(P)}}};return d(Z,D),function(){return v(Z,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?ku(y,m):Object.assign({},y)},dispatch:function(m){var y=Ve(m)?{type:m}:m;if(pn.includes(y.type))throw new Error("reserved action "+y.type);var O=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ze,m,y)},events:{core:pn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=Zu()),y(O)}}},p(nn),YE($,l,{all:f,plugins:s}),XE(a),GE($),VE($),p(an)]),_={context:cT,user:WE(a),page:sT,track:tT,plugins:QE(l),queue:nT},C=Gt,M=Gt;if(Y&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?Gd():ie(typeof arguments[0])?Vu():Vu().apply(null,arguments)}}var V,L=function(m){return Object.keys(m).reduce(function(y,O){return uT.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),z={context:L,user:I,plugins:x},R=Nd(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Ge&&(O[U]=m[U])}var D,Z=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(T){var P=w[T];if(typeof P(void 0,{type:"@@redux/INIT"})===xe||typeof P(void 0,{type:BE})===xe)throw new Error("reducer "+T+" "+xe)})})(O)}catch(w){D=w}return function(w,T){if(w===void 0&&(w={}),D)throw D;for(var P=!1,B={},ae=0;ae<Z.length;ae++){var ze=Z[ae],rs=w[ze],aa=(0,O[ze])(rs,T);if(typeof aa===xe){var iv=HE(ze,T);throw new Error(iv)}B[ze]=aa,P=P||aa!==rs}return P?B:w}}(j({},_,t)),z,M(C(KE.apply(void 0,k))));R.dispatch=(V=R.dispatch,function(m,y,O){var N=j({},m,{meta:Zu(m.meta,y,pi(O))});return V.apply(null,[N])});var K=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:K,config:L,params:g,user:I,initialUser:r,persistedUser:E});var J=K.filter(function(m){return n.pluginEnabled[m]}),je=K.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:K,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&oe(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:J,disabled:je})}),fT(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return xd(m,y,O)},3e3)}(R,l,$),$}var nn="before",an="after",yr="cookie",nt=Zd(),Wd=ra,vT=ra;function Vd(e){return nt?ra(e,"",-1):Yt(e)}function Zd(){if(nt!==void 0)return nt;var e="cookiecookie";try{ra(e,e),nt=document.cookie.indexOf(e)!==-1,Vd(e)}catch{nt=!1}return nt}function ra(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return nt===!1&&(o?dt(e,t):ft(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var wr="localStorage",hT=Jo.bind(null,"localStorage");Xt("localStorage","getItem",ft);Xt("localStorage","setItem",dt);Xt("localStorage","removeItem",Yt);var br="sessionStorage",pT=Jo.bind(null,"sessionStorage");Xt("sessionStorage","getItem",ft);Xt("sessionStorage","setItem",dt);Xt("sessionStorage","removeItem",Yt);function Nt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var mT=hT(),gT=pT(),yT=Zd();function Jd(e,t){if(e){var r=Yo(t),n=!es(r),a=Xo(r)?Nt(localStorage.getItem(e)):void 0;if(n&&!Rt(a))return a;var i=qo(r)?Nt(Wd(e)):void 0;if(n&&i)return i;var o=Qo(r)?Nt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function wT(e,t,r){if(e&&!Rt(t)){var n={},a=Yo(r),i=JSON.stringify(t),o=!es(a);return Xo(a)&&(n[wr]=on(wr,t,Nt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[wr]:qo(a)&&(n[yr]=on(yr,t,Nt(Wd(e))),vT(e,i),o)?n[yr]:Qo(a)&&(n[br]=on(br,t,Nt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[br]:(n[gr]=on(gr,t,ft(e)),dt(e,t),o?n[gr]:n)}}function bT(e,t){if(e){var r=Yo(t),n=Jd(e,Rd),a={};return!Rt(n.localStorage)&&Xo(r)&&(localStorage.removeItem(e),a[wr]=n.localStorage),!Rt(n.cookie)&&qo(r)&&(Vd(e),a[yr]=n.cookie),!Rt(n.sessionStorage)&&Qo(r)&&(sessionStorage.removeItem(e),a[br]=n.sessionStorage),!Rt(n.global)&&na(r,gr)&&(Yt(e),a[gr]=n.global),a}}function Yo(e){return e?Ve(e)?e:e.storage:_d}function Xo(e){return mT&&na(e,wr)}function qo(e){return yT&&na(e,yr)}function Qo(e){return gT&&na(e,br)}function es(e){return e===Rd||e==="all"}function na(e,t){return e===_d||e===t||es(e)}function on(e,t,r){return{location:e,current:t,previous:r}}var ST={setItem:wT,getItem:Jd,removeItem:bT};function $T(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ju(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Yu(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ju(Object(r),!0).forEach(function(n){$T(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ju(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IT(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:ST};return dT(Yu(Yu({},t),e))}function ET(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function TT(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=OT(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function PT(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function OT(e){return["#","?"].forEach(t=>e=PT(e,t)),e}function kT(){TT(()=>{Ue.page()})}function _T(e){if(e===void 0&&(e={}),!Y)return qi;var t=qu(),r=to(),n=Xu(),a=sn(n,t),i=sn(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return qi;var v=d.map(function(S){return Number(S)}),p=zE(function(){var S=qu(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,v),E=to(),I=Xu(),b=sn(I,S),h=sn(E,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,C=v;(k==="up"||$)&&(_=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(K){return K!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,V=M.direction;oe(e[F])&&e[F]({trigger:F,direction:V,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function to(){return Y?document.body.scrollTop||document.documentElement.scrollTop:0}function RT(){return Y?window.innerHeight||document.documentElement.clientHeight:0}function Xu(){return Math.round(to()+RT())}function qu(){if(!Y)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function sn(e,t){return Math.round(e/t*100)}var Qu="EventListener";function CT(e){return function(t,r,n,a){var i=n||qi,o=a||!1;if(!Y)return i;var s=Cn(r),u=Cn(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+Qu:"remove"+Qu,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?AT(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function Cn(e,t){if(Ve(e))return t?Cn(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=UE(e);return t?i.map(function(o){return Ve(o)?Cn(o,!0):o}).flat():i}function AT(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var mi=CT("Event");function Yd(e,t){return Y&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}Yd.bind(null,"onerror");Yd.bind(null,"onload");var Xd=typeof window>"u",el="hidden";function jT(e){if(Xd)return!1;var t=LT(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function LT(){var e=["webkit","moz","ms","o"];return Xd||el in document?el:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var NT=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function UT(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=jT(function(s){s||r({type:"tabVisible"})});return n=[o].concat(NT.map(function(s){return mi(document,s,r)})).concat(mi(window,"load",r)).concat(mi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function xT(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(or(d),g),a&&l&&(l=!1,a(or(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(or(d),g))},s)}var S=UT(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:or(d,c),idle:l?or(r,c):0}}}}function or(e,t){return t?0:Math.round((new Date-e)/1e3)}const tl=5e3;class DT{constructor(t){le(this,"element");le(this,"isInViewport",!1);le(this,"isAwake",!1);le(this,"isFlushing");le(this,"observer");le(this,"lastEventAt",Date.now());le(this,"registeredView",!1);le(this,"viewCallback");le(this,"activeDurationCallback");le(this,"idleDurationCallback");le(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),xT({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:tl}),_T({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*tl:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const rl="sesamy_session_id";function MT(){let e=sessionStorage.getItem(rl);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(rl,e)),e}let qd=!1,ro,nl,An;const Qd=new Map;function FT({clientId:e,enabled:t=!0,environment:r}){if(ro=e,nl=t,An=`${Ke("logs",r)}/events`,!nl)return;window.addEventListener("beforeunload",()=>{tv.forEach((a,i)=>{a.bind(i)()}),BT()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Qd.forEach((a,i)=>{a.bind(i)()})}),kT();const n=new DT({element:document.body,viewCallback:()=>{Ue.page()},activeDurationCallback:(a,i,o)=>{Ue.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{Ue.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{Ue.track("scroll",{scroll:a.scrollMax})}});HT(document.body,()=>{n.flush()}),KT(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Ee.AUTHENTICATED,async a=>{const i=a;await Ue.identify(i.detail.sub)}),window.addEventListener(Ee.LOGOUT,async()=>{await Ue.track("logout",{}),ts.flush(),await Ue.reset()})}function ev(e){return JSON.stringify(e.map(t=>({...t,clientId:ro,requestId:Math.random().toString(36).slice(2,9),sessionId:MT(),timestamp:new Date().toISOString(),version:Zo,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:kd,userAgent:navigator.userAgent,clientId:ro}})))}const ts=ET(async e=>{if(e.length>0){const t=ev(e);qd?navigator.sendBeacon(An,t):(await fetch(An,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function gi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(An,ev([r]))}else ts.push(e)}const Ue=IT({app:kd,version:Zo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;gi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;gi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;gi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function zT(e,t){Ue.track(e,t)}function BT(){return qd=!0,ts.flush()}const tv=new Map;function HT(e,t){tv.set(e,t)}function KT(e,t){Qd.set(e,t)}const rv="sesamySignedURLs";function nv(){const e=sessionStorage.getItem(rv);return e?JSON.parse(e):[]}function GT(e){const t=nv();t.push(e),sessionStorage.setItem(rv,JSON.stringify(t))}function WT(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:E,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:C,pushTally:M,deleteTally:F,getProduct:V,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:K,openHostedAccountPage:J,generateLink:je}=PE(e),m={auth:{getUser:p,isAuthenticated:Wo,loginWithRedirect:Vo,logout:$d,setToken:Ed},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:J,isSpotifyLinked:x,unlinkSpotify:z},analytics:{track:zT},tags:{list:g,set:I,delete:E},entitlements:{get:a,list:i,access:o,signedLinks:nv},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:V,autoOnboard:K,linkSpotify:R},getVersion:VT,getPaymentIssues:L,generateLink:je,clearCache:Se};return e.namespace&&(window[e.namespace]=m),m}function VT(){return Zo}async function ZT({enabled:e=!1,rules:t}){if(!e)return;const r=await Wo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await al(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await al(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function al(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function JT(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){Ed(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const il="sesamy-refresh",ol="force-refetch-entitlements";function YT(){const e=new URLSearchParams(window.location.search),t=e.get(ol),r=e.get(il);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(ol),e.delete(il),n.search=e.toString(),Se(),window.history.replaceState(null,"",n)}}function XT(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;GT({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const sl="sesamy-user";async function qT(){const t=new URLSearchParams(window.location.search).get(sl);if(!t)return;const r=await vE();(r==null?void 0:r.email)!==t&&(Se(),Vo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(sl),window.history.replaceState(null,"",n)}const cl="sesamy-purchase";function QT(){const e=new URLSearchParams(window.location.search),t=e.get(cl);if(t!==null){const r=new URL(window.location.href);e.delete(cl),r.search=e.toString(),Ye(Ee.PURCHASE,{itemSrc:t}),Se(),window.history.replaceState(null,"",r)}}const ul="sesamy-login";async function eP(){if(!new URLSearchParams(window.location.search).get(ul))return;await Wo()||Vo();const n=new URL(window.location.href);n.searchParams.delete(ul),window.history.replaceState(null,"",n)}const tP=typeof window<"u";async function ll(e){FT({clientId:e.clientId,environment:e.environment,...e.analytics}),await dE({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await ZT(e.transform),JT(),YT(),XT(),await eP(),await qT(),QT(),Ye(Ee.READY,{})}async function av(e){const t=WT({clientId:e.clientId,environment:e.environment,...e.api});return tP&&(e.awaitAllServices?await ll(e):ll(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);av(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=av;
4
+ `)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)n=t.cache;else{if(r=t.cacheLocation||"memory",!Ou(r))throw new Error(`Invalid cache location "${r}"`);n=Ou(r)()}this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Pt:dT,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(o=>`auth0.${o}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const a=t.useCookiesForTransactions?this.cookieStorage:vT;var i;this.scope=rn("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new cT(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||yd,this.cacheManager=new sT(n,n.allKeys?void 0:new mT(n,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((o,s)=>o?o.startsWith("https://")?o:`https://${o}/`:`${s}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new pT)}_url(t){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||gd)));return`${this.domainUrl}${t}&auth0Client=${r}`}_authorizeUrl(t){return this._url(`/authorize?${qi(t)}`)}async _verifyIdToken(t,r,n){const a=await this.nowProvider();return lT({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:r,organization:n,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:a});var i}_processOrgHint(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,r,n){const a=$u(li()),i=$u(li()),o=li(),s=(l=>{const c=new Uint8Array(l);return(d=>{const v={"+":"-","/":"_","=":""};return d.replace(/[+/=]/g,p=>v[p])})(window.btoa(String.fromCharCode(...Array.from(c))))})(await(async l=>await gn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(l)))(o)),u=((l,c,d,v,p,S,g,T)=>Object.assign(Object.assign(Object.assign({client_id:l.clientId},l.authorizationParams),d),{scope:rn(c,d.scope),response_type:"code",response_mode:T||"query",state:v,nonce:p,redirect_uri:g||l.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256"}))(this.options,this.scope,t,a,i,s,t.redirect_uri||this.options.authorizationParams.redirect_uri||n,r==null?void 0:r.response_mode),f=this._authorizeUrl(u);return{nonce:i,code_verifier:o,scope:u.scope,audience:u.audience||"default",redirect_uri:u.redirect_uri,state:a,url:f}}async loginWithPopup(t,r){var n;if(t=t||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,f=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${f},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise((u,f)=>{let l;const c=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(c),clearTimeout(d),window.removeEventListener("message",l,!1),f(new Q0(s.popup)))},1e3),d=setTimeout(()=>{clearInterval(c),f(new q0(s.popup)),window.removeEventListener("message",l,!1)},1e3*(s.timeoutInSeconds||60));l=function(v){if(v.data&&v.data.type==="authorization_response"){if(clearTimeout(d),clearInterval(c),window.removeEventListener("message",l,!1),s.popup.close(),v.data.response.error)return f(se.fromPayload(v.data.response));u(v.data.response)}},window.addEventListener("message",l)}))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new se("state_mismatch","Invalid state");const o=((n=t.authorizationParams)===null||n===void 0?void 0:n.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:a.audience,scope:a.scope,code_verifier:a.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:a.redirect_uri},{nonceIn:a.nonce,organization:o})}async getUser(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const r=await this._getIdTokenFromCache();return(t=r==null?void 0:r.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(t={}){var r;const n=ku(t),{openUrl:a,fragment:i,appState:o}=n,s=Re(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,f=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:l}=f,c=Re(f,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},c),{appState:o}),u&&{organization:u}));const d=i?`${l}#${i}`:l;a?await a(d):window.location.assign(d)}async handleRedirectCallback(t=window.location.href){const r=t.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const{state:n,code:a,error:i,error_description:o}=(c=>{c.indexOf("#")>-1&&(c=c.substring(0,c.indexOf("#")));const d=new URLSearchParams(c);return{state:d.get("state"),code:d.get("code")||void 0,error:d.get("error")||void 0,error_description:d.get("error_description")||void 0}})(r.join("")),s=this.transactionManager.get();if(!s)throw new se("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new X0(i,o||i,n,s.appState);if(!s.code_verifier||s.state&&s.state!==n)throw new se("state_mismatch","Invalid state");const u=s.organization,f=s.nonce,l=s.redirect_uri;return await this._requestToken(Object.assign({audience:s.audience,scope:s.scope,code_verifier:s.code_verifier,grant_type:"authorization_code",code:a},l?{redirect_uri:l}:{}),{nonceIn:f,organization:u}),{appState:s.appState}}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(t={}){var r;const n=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:rn(this.scope,(r=t.authorizationParams)===null||r===void 0?void 0:r.scope)})}),a=await((i,o)=>{let s=di[o];return s||(s=i().finally(()=>{delete di[o],s=null}),di[o]=s),s})(()=>this._getTokenSilently(n),`${this.options.clientId}::${n.authorizationParams.audience}::${n.authorizationParams.scope}`);return t.detailedResponse?a:a==null?void 0:a.access_token}async _getTokenSilently(t){const{cacheMode:r}=t,n=Re(t,["cacheMode"]);if(r!=="off"){const a=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(a)return a}if(r!=="cache-only"){if(!await(async(a,i=3)=>{for(let o=0;o<i;o++)if(await a())return!0;return!1})(()=>vi.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new Xi;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),r!=="off"){const f=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(f)return f}const a=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:i,access_token:o,oauthTokenScope:s,expires_in:u}=a;return Object.assign(Object.assign({id_token:i,access_token:o},s?{scope:s}:null),{expires_in:u})}finally{await vi.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(t={},r={}){var n;const a=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:rn(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope)})});return r=Object.assign(Object.assign({},Y0),r),await this.loginWithPopup(a,r),(await this.cacheManager.get(new it({scope:a.authorizationParams.scope,audience:a.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const r=t.logoutParams||{},{federated:n}=r,a=Re(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${qi(Object.assign({clientId:t.clientId},a))}`)+i}async logout(t={}){const r=ku(t),{openUrl:n}=r,a=Re(r,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(a);n?await n(i):n!==!1&&window.location.assign(i)}async _getTokenFromIFrame(t){const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:f,audience:l}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new se("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const c=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds,d=await((p,S,g=60)=>new Promise((T,I)=>{const b=window.document.createElement("iframe");b.setAttribute("width","0"),b.setAttribute("height","0"),b.style.display="none";const h=()=>{window.document.body.contains(b)&&(window.document.body.removeChild(b),window.removeEventListener("message",$,!1))};let $;const k=setTimeout(()=>{I(new Xi),h()},1e3*g);$=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const C=_.source;C&&C.close(),_.data.response.error?I(se.fromPayload(_.data.response)):T(_.data.response),clearTimeout(k),window.removeEventListener("message",$,!1),setTimeout(h,2e3)},window.addEventListener("message",$,!1),window.document.body.appendChild(b),b.setAttribute("src",p)}))(a,this.domainUrl,c);if(i!==d.state)throw new se("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:f,oauthTokenScope:v.scope,audience:l})}catch(c){throw c.error==="login_required"&&this.logout({openUrl:!1}),c}}async _getTokenUsingRefreshToken(t){const r=await this.cacheManager.get(new it({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new Td(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const n=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}));return Object.assign(Object.assign({},i),{scope:t.authorizationParams.scope,oauthTokenScope:i.scope,audience:t.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw i}}async _saveEntryInCache(t){const{id_token:r,decodedToken:n}=t,a=Re(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",r=await this.cacheManager.getIdToken(new it({clientId:this.options.clientId,audience:t,scope:this.scope})),n=this.userCache.get("@@user@@");return r&&r.id_token===(n==null?void 0:n.id_token)?n:(this.userCache.set("@@user@@",r),r)}async _getEntryFromCache({scope:t,audience:r,clientId:n}){const a=await this.cacheManager.get(new it({scope:t,audience:r,clientId:n}),60);if(a&&a.access_token){const{access_token:i,oauthTokenScope:o,expires_in:s}=a,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,access_token:i},o?{scope:o}:null),{expires_in:s})}}async _requestToken(t,r){const{nonceIn:n,organization:a}=r||{},i=await iT(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},t),this.worker),o=await this._verifyIdToken(i.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:o,scope:t.scope,audience:t.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||o.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:o})}};async function wT(e){const t=new yT(e);return await t.checkSession(),t}var Te=(e=>(e.READY="sesamyJsReady",e.AUTHENTICATED="sesamyJsAuthenticated",e.LOGOUT="sesamyJsLogout",e.CLEAR_CACHE="sesamyJsClearCache",e.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",e.PURCHASE="sesamyJsPurchase",e))(Te||{});const bT="sesamy.com",ST="sesamy.dev",$T="https://sesa.my",eo="sesamyCacheTimestamp";function Ke(e,t){return`https://${e}.${t==="dev"?ST:bT}`}let ue,_d,Rd=!1;const zt="sesamyAccessToken",hi="sesamyRefreshToken";async function Lr(){return new Promise((r,n)=>{let a=0;const i=()=>{Rd?r(!0):a>=5e3?n(new Error("Initialization failed: Timeout")):(a+=100,setTimeout(i,100))};i()})}async function IT(e){if(!e)return null;const t=localStorage.getItem(hi);if(!t)throw new Error("No refresh token available");const r=new URLSearchParams;r.set("client_id",e.iss),r.set("refresh_token",t),r.set("grant_type","refresh_token");const n=new URL(e.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",e.sub);try{const a=await fetch(n.href,{body:r.toString(),method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"}});if(!a.ok)throw localStorage.removeItem(hi),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(hi,i.refresh_token),localStorage.setItem(zt,i.access_token),i.access_token}catch{Cd()}}async function Zo(){const e=localStorage.getItem(zt);if(!e)return null;const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3){const r=await IT(t);if(r)return r;localStorage.removeItem(zt)}return e}function _u(e){try{const t=new URL(e).hostname,r=t.split(".");return r.length>1?r.slice(-2).join("."):t}catch{return null}}async function TT(e){if(e.enabled===!1)return;_d=e.organization;const t={domain:Ke("token",e.environment),clientId:e.clientId,useCookiesForTransactions:!0};if(_u(window.location.href)!==_u(Ke("auth",e.environment))&&(t.cacheLocation="localstorage",t.useRefreshTokens=!0),ue=await wT(t),window.location.search.includes("code="))try{await ue.handleRedirectCallback();const r=await ue.getUser();Ye(Te.AUTHENTICATED,r);const n=new URL(location.href),a=n.searchParams;a.delete("code"),a.delete("state"),n.search=a.toString(),window.history.replaceState({},document.title,n.toString())}catch(r){console.error(r)}Rd=!0}async function Jo(){return await Lr(),await Zo()?!0:ue?ue.isAuthenticated():!1}async function ET(){return await Lr(),await Zo()?{sub:"local",name:"Local User"}:ue?ue.getUser():null}async function Yo(e){if(await Lr(),localStorage.removeItem(zt),!ue)throw new Error("Auth0 client not initialized");const t=(e==null?void 0:e.authorizationParams)||{};return ue.loginWithRedirect({...e,authorizationParams:{organization:_d,redirect_uri:window.location.href,...t}})}async function sr(e=!0){await Lr();const t=await Zo();if(t)return t;try{return ue?await ue.getTokenSilently():null}catch(r){if(e)throw r;return null}}async function Cd(e={}){if(await Lr(),localStorage.removeItem(zt),Ye(Te.LOGOUT,{}),!!ue)return ue.logout({...e,logoutParams:{returnTo:window.location.href,...e.logoutParams}})}function Ad(e){const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function jd(e){const t=Ad(e);if(!t||!t.exp||t.exp<new Date().getTime()/1e3)throw new Error("Invalid token");localStorage.setItem(zt,e),Ye(Te.AUTHENTICATED,t)}const PT=(e,t)=>t.skipDedupe||t.method!=="GET",OT=(e,t)=>t.method+"@"+e,kT=e=>e.clone(),Ru=({skip:e=PT,key:t=OT,resolver:r=kT}={})=>{const n=new Map;return a=>(i,o)=>{if(e(i,o))return a(i,o);const s=t(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,f)=>{n.get(s).push([u,f])});try{return a(i,o).then(u=>(n.get(s).forEach(([f])=>f(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([f,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},_T=(e,t)=>e*t,RT=e=>e&&e.ok,Cu=({delayTimer:e=500,delayRamp:t=_T,maxAttempts:r=10,until:n=RT,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(f,l)=>{let c=0;if(s&&s(f,l))return u(f,l);const d=(v,p)=>Promise.resolve(n(v,p)).then(S=>S?v&&o?v:p?Promise.reject(p):v:(c++,!r||c<=r?new Promise(g=>{const T=t(e,c);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:v,error:p,url:f,options:l})).then((I={})=>{var b,h;g(u((b=I&&I.url)!==null&&b!==void 0?b:f,(h=I&&I.options)!==null&&h!==void 0?h:l))}):g(u(f,l))},T)}).then(d).catch(g=>{if(!i)throw g;return d(null,g)}):v&&o?v:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(f,l).then(d).catch(v=>{if(!i)throw v;return d(null,v)})},CT="application/json",Ld="Content-Type",It=Symbol(),Nd=Symbol();function Au(e={}){var t;return(t=Object.entries(e).find(([r])=>r.toLowerCase()===Ld.toLowerCase()))===null||t===void 0?void 0:t[1]}function ju(e){return/^application\/.*json.*/.test(e)}const st=function(e,t,r=!1){return Object.entries(t).reduce((n,[a,i])=>{const o=e[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=st(o,i,r):n[a]=i,n},{...e})},Bt={options:{},errorType:"text",polyfills:{},polyfill(e,t=!0,r=!1,...n){const a=this.polyfills[e]||(typeof self<"u"?self[e]:null)||(typeof global<"u"?global[e]:null);if(t&&!a)throw new Error(e+" is not defined");return r&&a?new a(...n):a}};function AT(e,t=!1){Bt.options=t?e:st(Bt.options,e)}function jT(e,t=!1){Bt.polyfills=t?e:st(Bt.polyfills,e)}function LT(e){Bt.errorType=e}const NT=e=>t=>e.reduceRight((r,n)=>n(r),t)||t;class Ud extends Error{}const UT=e=>{const t=Object.create(null);e=e._addons.reduce((b,h)=>h.beforeRequest&&h.beforeRequest(b,e._options,t)||b,e);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=e,f=new Map(i),l=st(a.options,n);let c=r;const d=NT(s)((b,h)=>(c=b,a.polyfill("fetch")(b,h)))(r,l),v=new Error,p=d.catch(b=>{throw{[It]:b}}).then(b=>{if(!b.ok){const h=new Ud;if(h.cause=v,h.stack=h.stack+`
5
+ CAUSE: `+v.stack,h.response=b,h.url=c,b.type==="opaque")throw h;return b.text().then($=>{var k;if(h.message=$,a.errorType==="json"||((k=b.headers.get("Content-Type"))===null||k===void 0?void 0:k.split(";")[0])==="application/json")try{h.json=JSON.parse($)}catch{}throw h.text=$,h.status=b.status,h})}return b}),S=b=>b.catch(h=>{const $=h.hasOwnProperty(It),k=$?h[It]:h,_=(k==null?void 0:k.status)&&f.get(k.status)||f.get(k==null?void 0:k.name)||$&&f.has(It)&&f.get(It);if(_)return _(k,e);const C=f.get(Nd);if(C)return C(k,e);throw k}),g=b=>h=>S(b?p.then($=>$&&$[b]()).then($=>h?h($):$):p.then($=>h?h($):$)),T={_wretchReq:e,_fetchReq:d,_sharedState:t,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(b,h){return f.set(b,h),this},badRequest(b){return this.error(400,b)},unauthorized(b){return this.error(401,b)},forbidden(b){return this.error(403,b)},notFound(b){return this.error(404,b)},timeout(b){return this.error(408,b)},internalError(b){return this.error(500,b)},fetchError(b){return this.error(It,b)}},I=u.reduce((b,h)=>({...b,...typeof h.resolver=="function"?h.resolver(b):h.resolver}),T);return o.reduce((b,h)=>h(b,e),I)},xT={_url:"",_options:{},_config:Bt,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(e){return{...this,_addons:[...this._addons,e],...e.wretch}},errorType(e){return{...this,_config:{...this._config,errorType:e}}},polyfills(e,t=!1){return{...this,_config:{...this._config,polyfills:t?e:st(this._config.polyfills,e)}}},url(e,t=!1){if(t)return{...this,_url:e};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+e+"?"+r[1]:this._url+e}},options(e,t=!1){return{...this,_options:t?e:st(this._options,e)}},headers(e){const t=e?Array.isArray(e)?Object.fromEntries(e):"entries"in e?Object.fromEntries(e.entries()):e:{};return{...this,_options:st(this._options,{headers:t})}},accept(e){return this.headers({Accept:e})},content(e){return this.headers({[Ld]:e})},auth(e){return this.headers({Authorization:e})},catcher(e,t){const r=new Map(this._catchers);return r.set(e,t),{...this,_catchers:r}},catcherFallback(e){return this.catcher(Nd,e)},resolve(e,t=!1){return{...this,_resolvers:t?[e]:[...this._resolvers,e]}},defer(e,t=!1){return{...this,_deferred:t?[e]:[...this._deferred,e]}},middlewares(e,t=!1){return{...this,_middlewares:t?e:[...this._middlewares,...e]}},fetch(e=this._options.method,t="",r=null){let n=this.url(t).options({method:e});const a=Au(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||ju(a));return n=r?o?n.json(r,a):n.body(r):n,UT(n._deferred.reduce((s,u)=>u(s,s._url,s._options),n))},get(e=""){return this.fetch("GET",e)},delete(e=""){return this.fetch("DELETE",e)},put(e,t=""){return this.fetch("PUT",t,e)},post(e,t=""){return this.fetch("POST",t,e)},patch(e,t=""){return this.fetch("PATCH",t,e)},head(e=""){return this.fetch("HEAD",e)},opts(e=""){return this.fetch("OPTIONS",e)},body(e){return{...this,_options:{...this._options,body:e}}},json(e,t){const r=Au(this._options.headers);return this.content(t||ju(r)&&r||CT).body(JSON.stringify(e))}};function Me(e="",t={}){return{...xT,_url:e,_options:t}}Me.default=Me;Me.options=AT;Me.errorType=LT;Me.polyfills=jT;Me.WretchError=Ud;function Se(){sessionStorage.removeItem(eo),Ye(Te.CLEAR_CACHE,{})}function Lu(){var r;return(r=(document.documentElement.getAttribute("lang")??"en").split("-")[0])==null?void 0:r.toLocaleLowerCase()}function DT(e){const t=Ke("api2",e.environment),r=w=>async(E,P)=>{let B=sessionStorage.getItem(eo);B||(B=Date.now().toString(),sessionStorage.setItem(eo,B));const ae={...P,headers:{...P.headers,"Cache-Timestamp":B}};return w(E,ae)},n=(w=!0)=>E=>async(P,B)=>{let ae=null;if(ae=await sr(w),!ae){if(w)throw new Error("No access token available");return E(P,B)}const ze={...B,headers:{...B.headers,...ae?{Authorization:`Bearer ${ae}`}:{}}};return E(P,ze)},a=w=>(E,P)=>{if(P.headers.Authorization)return w(E,P);const B=localStorage.getItem("__anon_id"),ae=btoa(`${B}:`),ze={...P,headers:{...P.headers,Authorization:`Basic ${ae}`}};return w(E,ze)},i=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(),Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]),o=Me(t).headers({"Content-Type":"application/json"}).middlewares([r,n(!1),a,Ru(),Cu({delayTimer:1e3,delayRamp:(w,E)=>w*E,maxAttempts:3,until:w=>!!(w&&(w.ok||w.status>=400&&w.status<500)),retryOnNetworkError:!1})]);async function s(){return i.get("/entitlements").json()}async function u(w){const E=await i.get("/entitlements").json();return E==null?void 0:E.find(P=>P.id===w)}async function f(w){return i.get(`/entitlements/${w}/access`).json()}async function l(){return i.get("/contracts").json()}async function c(w){const E=await i.get("/contracts").json();return E==null?void 0:E.find(P=>P.id===w)}async function d(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),i.get("/subscriptions").json()}async function v(){return i.get("/bills").json()}async function p(w){const E=await i.get("/bills").json();return E==null?void 0:E.find(P=>P.id===w)}async function S(){return i.get("/transactions").json()}async function g(w){const E=await i.get("/transactions").json();return E==null?void 0:E.find(P=>P.id===w)}async function T(w,E){const P=await i.url(`/user-metadata/${w}`).put(E).json();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),P}async function I(w){const E=await i.url(`/user-metadata/${w}`).delete().res();return Se(),E.ok}async function b(w){return(await i.url(`/user-metadata/${w}`).get().json())[w]}async function h(){return await i.url("/user-metadata").get().json()}async function $(){return await i.url("/tags").get().json()}async function k(w){const E=await i.url(`/tags/${w}`).delete().res();return Se(),E.ok}async function _(w){const E=await i.url("/tags").post(w).res();return Ye(Te.USER_ATTRIBUTE_CHANGED,{}),Se(),E.ok}async function C(w){return(await o.url("/tallies").get().json())[w]}async function M(){return await o.url("/tallies").get().json()}async function F(w){const E=await o.url(`/tallies/${w}`).delete().res();return Se(),E.ok}async function V(w,E){return await o.url(`/tallies/${w}/push`).post(E).json()}async function L(w){return await i.url(`/products/${w}`).get().json()}async function x(){return await sr(!1)?await i.url("/profile").get().json():null}async function z(w){const E=await i.url("/profile").patch(w).res();return Se(),E.ok}async function R(){return await i.url("/payment-issues").get().json()}async function G(){return(await i.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function J(){return(await i.url("/profile/unlink-spotify").post().res()).ok}async function Le(w){const E=await sr(!1);if(!E)throw new Error("No access token available");const P=new URL(`${Ke("spotify-oas",e.environment)}/sesamy-callback`);P.searchParams.set("access_token",E),P.searchParams.set("state",w),window.location.href=P.toString()}async function m(w){const E=await i.url(`/products/${w}/auto-onboard`).post().json();return E.length&&Se(),E}async function y(w,E=3600){const{shortlink:P}=await Me($T).post({url:w,ttl:E}).json();return P}async function O(w){const E=await sr(!1);let P;const B=w.language||Lu();switch(w.target){case"account":P=new URL(`${Ke("account",e.environment)}/${B}/subscriptions/${e.clientId}`);break;case"consume":P=new URL(`${Ke("consume",e.environment)}/${B}/@${e.clientId}/${w.sku}`),w.episodeId?P.href+=`/${w.episodeId}`:P.href+="/listen";break;default:throw new Error("Invalid target")}return P.searchParams.set("sesamy-redirect-url",w.redirectUrl||window.location.href),E&&(P.hash=`#access_token=${E}`),w.shorten?y(P.href,w.ttl):P.href}async function N(w){return(await o.url("/checkouts").post({language:Lu(),...w,vendorId:e.clientId})).json()}async function U(w,E){return(await o.url(`/checkouts/${w}`).patch(E)).json()}async function D(w){return(await o.url(`/checkouts/${w}`).get()).json()}async function Z(){const w=await sr(!1),E=new URL(`${Ke("account",e.environment)}/subscriptions/${e.clientId}`);w&&(E.hash=`#access_token=${w}`),window.location.href=E.toString()}return{createCheckout:N,updateCheckout:U,getCheckout:D,getEntitlements:s,getEntitlement:u,getEntitlementAccess:f,getContracts:l,getContract:c,getProfile:x,updateProfile:z,getSubscriptions:d,getBills:v,getBill:p,setUserMetadata:T,deleteUserMetadata:I,getUserMetadata:b,listUserMetadata:h,getTags:$,deleteTag:k,setTag:_,getTally:C,getTallies:M,deleteTally:F,pushTally:V,getTransactions:S,getTransaction:g,getProduct:L,getPaymentIssues:R,autoOnboardProduct:m,isSpotifyLinked:G,unlinkSpotify:J,linkSpotify:Le,generateLink:O,openHostedAccountPage:Z}}const xd="@sesamy/sesamy-js",Xo="1.19.1";function Nu(e,t,r,n,a){for(t=t.split?t.split("."):t,n=0;n<t.length;n++)e=e?e[t[n]]:a;return e===a?r:e}var nn="undefined",Uu="object",to=function(){},Dd="any",Md="*",lt="__",An=typeof process<"u"?process:{};An.env&&An.env.NODE_ENV;var X=typeof document<"u";An.versions!=null&&An.versions.node!=null;typeof Deno<"u"&&Deno.core;X&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent!==void 0&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Fd(e,t){return t.charAt(0)[e]()+t.slice(1)}var MT=Fd.bind(null,"toUpperCase"),FT=Fd.bind(null,"toLowerCase");function zT(e){return zd(e)?MT("null"):typeof e=="object"?GT(e):Object.prototype.toString.call(e).slice(8,-1)}function jn(e,t){t===void 0&&(t=!0);var r=zT(e);return t?FT(r):r}function Nr(e,t){return typeof t===e}var oe=Nr.bind(null,"function"),Ve=Nr.bind(null,"string"),Rt=Nr.bind(null,"undefined"),BT=Nr.bind(null,"boolean");Nr.bind(null,"symbol");function zd(e){return e===null}function HT(e){return jn(e)==="number"&&!isNaN(e)}function Bd(e){return jn(e)==="array"}function ie(e){if(!KT(e))return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function KT(e){return e&&(typeof e=="object"||e!==null)}function GT(e){return oe(e.constructor)?e.constructor.name:null}function WT(e){return e instanceof Error||Ve(e.message)&&e.constructor&&HT(e.constructor.stackTraceLimit)}function Hd(e,t){if(typeof t!="object"||zd(t))return!1;if(t instanceof e)return!0;var r=jn(new e(""));if(WT(t))for(;t;){if(jn(t)===r)return!0;t=Object.getPrototypeOf(t)}return!1}Hd.bind(null,TypeError);Hd.bind(null,SyntaxError);function ta(e,t){var r=e instanceof Element||e instanceof HTMLDocument;return r&&t?VT(e,t):r}function VT(e,t){return t===void 0&&(t=""),e&&e.nodeName===t.toUpperCase()}function ra(e){var t=[].slice.call(arguments,1);return function(){return e.apply(void 0,[].slice.call(arguments).concat(t))}}ra(ta,"form");ra(ta,"button");ra(ta,"input");ra(ta,"select");function ZT(e){return e?Bd(e)?e:[e]:[]}function xu(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch{return null}}function JT(){if(X){var e=navigator,t=e.languages;return e.userLanguage||(t&&t.length?t[0]:e.language)}}function YT(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function XT(e){return function(t){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(t);){var i=xu(r[1]),o=xu(r[2]);i.substring(i.length-2)==="[]"?(n[i=i.substring(0,i.length-2)]||(n[i]=[])).push(o):n[i]=o===""||o}for(var s in n){var u=s.split("[");u.length>1&&(qT(n,u.map(function(f){return f.replace(/[?[\]\\ ]/g,"")}),n[s]),delete n[s])}return n}(function(t){return X&&window.location.search.substring(1)}())}function qT(e,t,r){for(var n=t.length-1,a=0;a<n;++a){var i=t[a];if(i==="__proto__"||i==="constructor")break;i in e||(e[i]={}),e=e[i]}e[t[n]]=r}function na(){for(var e="",t=0,r=4294967295*Math.random()|0;t++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[t-1],a=15&r;e+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=t%8==0?4294967295*Math.random()|0:r>>4}return e}function QT(e,t){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=e.apply(r,n)};return function(){var u=new Date;o||(o=u);var f=t-(u-o);return r=this,n=arguments,f<=0?(clearTimeout(i),i=null,o=u,a=e.apply(r,n)):i||(i=setTimeout(s,f)),a}}var wr="global",Ht=lt+"global"+lt,Kt=typeof self===Uu&&self.self===self&&self||typeof global===Uu&&global.global===global&&global||void 0;function ft(e){return Kt[Ht][e]}function dt(e,t){return Kt[Ht][e]=t}function Xt(e){delete Kt[Ht][e]}function qt(e,t,r){var n;try{if(qo(e)){var a=window[e];n=a[t].bind(a)}}catch{}return n||r}Kt[Ht]||(Kt[Ht]={});var an={};function qo(e){if(typeof an[e]!==nn)return an[e];try{var t=window[e];t.setItem(nn,nn),t.removeItem(nn)}catch{return an[e]=!1}return an[e]=!0}function j(){return j=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},j.apply(this,arguments)}var Ge="function",De="undefined",eE="@@redux/"+Math.random().toString(36),Du=function(){return typeof Symbol===Ge&&Symbol.observable||"@@observable"}(),on=" != "+Ge;function Kd(e,t,r){var n;if(typeof t===Ge&&typeof r===De&&(r=t,t=void 0),typeof r!==De){if(typeof r!==Ge)throw new Error("enhancer"+on);return r(Kd)(e,t)}if(typeof e!==Ge)throw new Error("reducer"+on);var a=e,i=t,o=[],s=o,u=!1;function f(){s===o&&(s=o.slice())}function l(){return i}function c(v){if(typeof v!==Ge)throw new Error("Listener"+on);var p=!0;return f(),s.push(v),function(){if(p){p=!1,f();var S=s.indexOf(v);s.splice(S,1)}}}function d(v){if(!ie(v))throw new Error("Act != obj");if(typeof v.type===De)throw new Error("ActType "+De);if(u)throw new Error("Dispatch in reducer");try{u=!0,i=a(i,v)}finally{u=!1}for(var p=o=s,S=0;S<p.length;S++)(0,p[S])();return v}return d({type:"@@redux/INIT"}),(n={dispatch:d,subscribe:c,getState:l,replaceReducer:function(v){if(typeof v!==Ge)throw new Error("next reducer"+on);a=v,d({type:"@@redux/INIT"})}})[Du]=function(){var v,p=c;return(v={subscribe:function(S){if(typeof S!="object")throw new TypeError("Observer != obj");function g(){S.next&&S.next(l())}return g(),{unsubscribe:p(g)}}})[Du]=function(){return this},v},n}function tE(e,t){var r=t&&t.type;return"action "+(r&&r.toString()||"?")+"reducer "+e+" returns "+De}function Gt(){var e=[].slice.call(arguments);return e.length===0?function(t){return t}:e.length===1?e[0]:e.reduce(function(t,r){return function(){return t(r.apply(void 0,[].slice.call(arguments)))}})}function rE(){var e=arguments;return function(t){return function(r,n,a){var i,o=t(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(f){return s(f)}};return i=[].slice.call(e).map(function(f){return f(u)}),j({},o,{dispatch:s=Gt.apply(void 0,i)(o.dispatch)})}}}var Ze=lt+"anon_id",ct=lt+"user_id",jt=lt+"user_traits",He="userId",Ct="anonymousId",yn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ro=["name","EVENTS","config","loaded"],A=yn.reduce(function(e,t){return e[t]=t,e},{registerPluginType:function(e){return"registerPlugin:"+e},pluginReadyType:function(e){return"ready:"+e}}),Mu=/^utm_/,Fu=/^an_prop_/,zu=/^an_trait_/;function nE(e){var t=e.storage.setItem;return function(r){return function(n){return function(a){if(a.type===A.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,f=s.userId===o.userId;s.anonymousId!==o.anonymousId&&t(Ze,o.anonymousId),f||t(ct,o.userId),u.traits&&t(jt,j({},f&&s.traits?s.traits:{},u.traits));var l=Object.keys(a.params);if(l.length){var c=i.an_uid,d=i.an_event,v=l.reduce(function(p,S){if(S.match(Mu)||S.match(/^(d|g)clid/)){var g=S.replace(Mu,"");p.campaign[g==="campaign"?"name":g]=i[S]}return S.match(Fu)&&(p.props[S.replace(Fu,"")]=i[S]),S.match(zu)&&(p.traits[S.replace(zu,"")]=i[S]),p},{campaign:{},props:{},traits:{}});r.dispatch(j({type:A.params,raw:i},v,c?{userId:c}:{})),c&&setTimeout(function(){return e.identify(c,v.traits)},0),d&&setTimeout(function(){return e.track(d,v.props)},0),Object.keys(v.campaign).length&&r.dispatch({type:A.campaign,campaign:v.campaign})}}return n(a)}}}}function aE(e){return function(t,r){if(t===void 0&&(t={}),r===void 0&&(r={}),r.type===A.setItemEnd){if(r.key===Ze)return j({},t,{anonymousId:r.value});if(r.key===ct)return j({},t,{userId:r.value})}switch(r.type){case A.identify:return Object.assign({},t,{userId:r.userId,traits:j({},t.traits,r.traits)});case A.reset:return[ct,Ze,jt].forEach(function(n){e.removeItem(n)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}}function Bu(e){return{userId:e.getItem(ct),anonymousId:e.getItem(Ze),traits:e.getItem(jt)}}var no=function(e){return lt+"TEMP"+lt+e};function iE(e){var t=e.storage,r=t.setItem,n=t.removeItem,a=t.getItem;return function(i){return function(o){return function(s){var u=s.userId,f=s.traits,l=s.options;if(s.type===A.reset&&([ct,jt,Ze].forEach(function(v){n(v)}),[He,Ct,"traits"].forEach(function(v){Xt(no(v))})),s.type===A.identify){a(Ze)||r(Ze,na());var c=a(ct),d=a(jt)||{};c&&c!==u&&i.dispatch({type:A.userIdChanged,old:{userId:c,traits:d},new:{userId:u,traits:f},options:l}),u&&r(ct,u),f&&r(jt,j({},d,f))}return o(s)}}}}var dr={};function Hu(e,t){dr[e]&&oe(dr[e])&&(dr[e](t),delete dr[e])}function Gd(e,t,r){return new Promise(function(n,a){return t()?n(e):r<1?a(j({},e,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return Gd(e,t,r-10).then(n,a)})})}function oE(e){return{abort:e}}function Wd(e,t,r){var n={},a=t(),i=e.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var f=s.actions.reduce(function(c,d,v){return o[d.plugin].loaded?(c.process.push(d),c.processIndex.push(v)):(c.requeue.push(d),c.requeueIndex.push(v)),c},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(f.processIndex&&f.processIndex.length){f.processIndex.forEach(function(c){var d=s.actions[c],v=d.plugin,p=d.payload.type,S=a[v][p];if(S&&oe(S)){var g,T=function(h,$){return h===void 0&&(h={}),$===void 0&&($={}),[He,Ct].reduce(function(k,_){return h.hasOwnProperty(_)&&$[_]&&$[_]!==h[_]&&(k[_]=$[_]),k},h)}(d.payload,u),I=n[T.meta.rid];if(!I&&(g=S({payload:T,config:o[v].config,instance:r,abort:oE}))&&ie(g)&&g.abort)return void(n[T.meta.rid]=!0);if(!I){var b=p+":"+v;e.dispatch(j({},T,{type:b,_:{called:b,from:"queueDrain"}}))}}});var l=s.actions.filter(function(c,d){return!~f.processIndex.indexOf(d)});s.actions=l}}}var pi=function(e){var t=e.data,r=e.action,n=e.instance,a=e.state,i=e.allPlugins,o=e.allMatches,s=e.store,u=e.EVENTS;try{var f=a.plugins,l=a.context,c=r.type,d=c.match(Lt),v=t.exact.map(function(g){return g.pluginName});d&&(v=o.during.map(function(g){return g.pluginName}));var p=function(g,T){return function(I,b,h){var $=b.config,k=b.name,_=k+"."+I.type;h&&(_=h.event);var C=I.type.match(Lt)?function(M,F,V,L,x){return function(z,R){var G=L?L.name:M,J=R&&Er(R)?R:V;if(L&&(!(J=R&&Er(R)?R:[M]).includes(M)||J.length!==1))throw new Error("Method "+F+" can only abort "+M+" plugin. "+JSON.stringify(J)+" input valid");return j({},x,{abort:{reason:z,plugins:J,caller:F,_:G}})}}(k,_,T,h,I):function(M,F){return function(){throw new Error(M.type+" action not cancellable. Remove abort in "+F)}}(I,_);return{payload:sE(I),instance:g,config:$||{},abort:C}}}(n,v),S=t.exact.reduce(function(g,T){var I=T.pluginName,b=T.methodName,h=!1;return b.match(/^initialize/)||b.match(/^reset/)||(h=!f[I].loaded),l.offline&&b.match(/^(page|track|identify)/)&&(h=!0),g[""+I]=h,g},{});return Promise.resolve(t.exact.reduce(function(g,T,I){try{var b=T.pluginName;return Promise.resolve(g).then(function(h){function $(){return Promise.resolve(h)}var k=function(){if(t.namespaced&&t.namespaced[b])return Promise.resolve(t.namespaced[b].reduce(function(_,C,M){try{return Promise.resolve(_).then(function(F){return C.method&&oe(C.method)?(function(z,R){var G=Yu(z);if(G&&G.name===R){var J=Yu(G.method);throw new Error([R+" plugin is calling method "+z,"Plugins cant call self","Use "+G.method+" "+(J?"or "+J.method:"")+" in "+R+" plugin insteadof "+z].join(`
6
+ `))}}(C.methodName,C.pluginName),Promise.resolve(C.method({payload:F,instance:n,abort:(V=F,L=b,x=C.pluginName,function(z,R){return j({},V,{abort:{reason:z,plugins:R||[L],caller:c,from:x||L}})}),config:Wu(C.pluginName,f,i),plugins:f})).then(function(z){var R=ie(z)?z:{};return Promise.resolve(j({},F,R))})):F;var V,L,x})}catch(F){return Promise.reject(F)}},Promise.resolve(r))).then(function(_){h[b]=_});h[b]=r}();return k&&k.then?k.then($):$()})}catch(h){return Promise.reject(h)}},Promise.resolve({}))).then(function(g){return Promise.resolve(t.exact.reduce(function(T,I,b){try{var h=t.exact.length===b+1,$=I.pluginName,k=i[$];return Promise.resolve(T).then(function(_){var C=g[$]?g[$]:{};if(d&&(C=_),gi(C,$))return mi({data:C,method:c,instance:n,pluginName:$,store:s}),Promise.resolve(_);if(gi(_,$))return h&&mi({data:_,method:c,instance:n,store:s}),Promise.resolve(_);if(S.hasOwnProperty($)&&S[$]===!0)return s.dispatch({type:"queue",plugin:$,payload:C,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(_);var M=p(g[$],i[$]);return Promise.resolve(k[c]({abort:M.abort,payload:C,instance:n,config:Wu($,f,i),plugins:f})).then(function(F){var V=ie(F)?F:{},L=j({},_,V),x=g[$];if(gi(x,$))mi({data:x,method:c,instance:n,pluginName:$,store:s});else{var z=c+":"+$;(z.match(/:/g)||[]).length<2&&!c.match(Ku)&&!c.match(Gu)&&n.dispatch(j({},d?L:C,{type:z,_:{called:z,from:"submethod"}}))}return Promise.resolve(L)})})}catch(_){return Promise.reject(_)}},Promise.resolve(r))).then(function(T){if(!(c.match(Lt)||c.match(/^registerPlugin/)||c.match(Gu)||c.match(Ku)||c.match(/^params/)||c.match(/^userIdChanged/))){if(u.plugins.includes(c),T._&&T._.originalAction===c)return T;var I=j({},T,{_:{originalAction:T.type,called:T.type,from:"engineEnd"}});Vd(T,t.exact.length)&&!c.match(/End$/)&&(I=j({},I,{type:T.type+"Aborted"})),s.dispatch(I)}return T})})}catch(g){return Promise.reject(g)}},Lt=/Start$/,Ku=/^bootstrap/,Gu=/^ready/;function mi(e){var t=e.pluginName,r=e.method+"Aborted"+(t?":"+t:"");e.store.dispatch(j({},e.data,{type:r,_:{called:r,from:"abort"}}))}function Wu(e,t,r){var n=t[e]||r[e];return n&&n.config?n.config:{}}function Vu(e,t){return t.reduce(function(r,n){return n[e]?r.concat({methodName:e,pluginName:n.name,method:n[e]}):r},[])}function Zu(e,t){var r=e.replace(Lt,""),n=t?":"+t:"";return[""+e+n,""+r+n,r+"End"+n]}function gi(e,t){var r=e.abort;return!!r&&(r===!0||Ju(r,t)||r&&Ju(r.plugins,t))}function Vd(e,t){var r=e.abort;if(!r)return!1;if(r===!0||Ve(r))return!0;var n=r.plugins;return Er(r)&&r.length===t||Er(n)&&n.length===t}function Er(e){return Array.isArray(e)}function Ju(e,t){return!(!e||!Er(e))&&e.includes(t)}function Yu(e){var t=e.match(/(.*):(.*)/);return!!t&&{method:t[1],name:t[2]}}function sE(e){return Object.keys(e).reduce(function(t,r){return r==="type"||(t[r]=ie(e[r])?Object.assign({},e[r]):e[r]),t},{})}function cE(e,t,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(h){return s?h:i(c)},f=o.type,l=o.plugins,c=o;if(o.abort)return Promise.resolve(i(o));if(f===A.enablePlugin&&a.dispatch({type:A.initializeStart,plugins:l,disabled:[],fromEnable:!0,meta:o.meta}),f===A.disablePlugin&&setTimeout(function(){return Hu(o.meta.rid,{payload:o})},0),f===A.initializeEnd){var d=t(),v=Object.keys(d),p=v.filter(function(h){return l.includes(h)}).map(function(h){return d[h]}),S=[],g=[],T=o.disabled,I=p.map(function(h){var $=h.loaded,k=h.name,_=h.config;return Gd(h,function(){return $({config:_})},1e4).then(function(C){return n[k]||(a.dispatch({type:A.pluginReadyType(k),name:k,events:Object.keys(h).filter(function(M){return!ro.includes(M)})}),n[k]=!0),S=S.concat(k),h}).catch(function(C){if(C instanceof Error)throw new Error(C);return g=g.concat(C.name),C})});Promise.all(I).then(function(h){var $={plugins:S,failed:g,disabled:T};setTimeout(function(){v.length===I.length+T.length&&a.dispatch(j({},{type:A.ready},$))},0)})}var b=function(){if(f!==A.bootstrap)return/^ready:([^:]*)$/.test(f)&&setTimeout(function(){return Wd(a,t,e)},0),Promise.resolve(function(h,$,k,_,C){try{var M=oe($)?$():$,F=h.type,V=F.replace(Lt,"");if(h._&&h._.called)return Promise.resolve(h);var L=k.getState(),x=(G=M,(J=L.plugins)===void 0&&(J={}),(Le=h.options)===void 0&&(Le={}),Object.keys(G).filter(function(m){var y=Le.plugins||{};return BT(y[m])?y[m]:y.all!==!1&&(!J[m]||J[m].enabled!==!1)}).map(function(m){return G[m]}));F===A.initializeStart&&h.fromEnable&&(x=Object.keys(L.plugins).filter(function(m){var y=L.plugins[m];return h.plugins.includes(m)&&!y.initialized}).map(function(m){return M[m]}));var z=x.map(function(m){return m.name}),R=function(m,y,O){var N=Zu(m).map(function(U){return Vu(U,y)});return y.reduce(function(U,D){var Z=D.name,w=Zu(m,Z).map(function(ae){return Vu(ae,y)}),E=w[0],P=w[1],B=w[2];return E.length&&(U.beforeNS[Z]=E),P.length&&(U.duringNS[Z]=P),B.length&&(U.afterNS[Z]=B),U},{before:N[0],beforeNS:{},during:N[1],duringNS:{},after:N[2],afterNS:{}})}(F,x);return Promise.resolve(pi({action:h,data:{exact:R.before,namespaced:R.beforeNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(m){function y(){var U=function(){if(F.match(Lt))return Promise.resolve(pi({action:j({},O,{type:V+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(D){D.meta&&D.meta.hasCallback&&Hu(D.meta.rid,{payload:D})})}();return U&&U.then?U.then(function(){return m}):m}if(Vd(m,z.length))return m;var O,N=function(){if(F!==V)return Promise.resolve(pi({action:j({},m,{type:V}),data:{exact:R.during,namespaced:R.duringNS},state:L,allPlugins:M,allMatches:R,instance:k,store:_,EVENTS:C})).then(function(U){O=U});O=m}();return N&&N.then?N.then(y):y()})}catch(m){return Promise.reject(m)}var G,J,Le}(o,t,e,a,r)).then(function(h){return s=1,i(h)})}();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(h){return Promise.reject(h)}}}}}function uE(e){return function(t){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===A.setItem||a===A.removeItem){if(n.abort)return r(n);a===A.setItem?e.setItem(i,o,s):e.removeItem(i,s)}return r(n)}}}}var lE=function(){var e=this;this.before=[],this.after=[],this.addMiddleware=function(t,r){e[r]=e[r].concat(t)},this.removeMiddleware=function(t,r){var n=e[r].findIndex(function(a){return a===t});n!==-1&&(e[r]=[].concat(e[r].slice(0,n),e[r].slice(n+1)))},this.dynamicMiddlewares=function(t){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=e[t].map(function(s){return s(i)});return Gt.apply(void 0,o)(n)(a)}}}}};function fE(e){return function(t,r){t===void 0&&(t={});var n={};if(r.type==="initialize:aborted")return t;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Xu(r.type,"registerPlugin"),i=e()[a];if(!i||!a)return t;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},j({},t,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Xu(r.type,A.initialize),f=e()[u];return f&&u?(n[u]=j({},t[u],{initialized:!0,loaded:!!f.loaded({config:f.config})}),j({},t,n)):t}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=j({},t[r.name],{loaded:!0}),j({},t,n);switch(r.type){case A.disablePlugin:return j({},t,qu(r.plugins,!1,t));case A.enablePlugin:return j({},t,qu(r.plugins,!0,t));default:return t}}}function Xu(e,t){return e.substring(t.length+1,e.length)}function qu(e,t,r){return e.reduce(function(n,a){return n[a]=j({},r[a],{enabled:t}),n},r)}function Zd(e){try{return JSON.parse(JSON.stringify(e))}catch{}return e}var dE={last:{},history:[]};function vE(e,t){e===void 0&&(e=dE);var r=t.options,n=t.meta;if(t.type===A.track){var a=Zd(j({event:t.event,properties:t.properties},Object.keys(r).length&&{options:r},{meta:n}));return j({},e,{last:a,history:e.history.concat(a)})}return e}var hE={actions:[]};function pE(e,t){e===void 0&&(e=hE);var r=t.payload;switch(t.type){case"queue":var n;return n=r&&r.type&&r.type===A.identify?[t].concat(e.actions):e.actions.concat(t),j({},e,{actions:n});case"dequeue":return[];default:return e}}var Jd=/#.*$/;function mE(e){var t=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e);return"/"+(t&&t[3]?t[3].split("?")[0].replace(Jd,""):"")}var Yd,Xd,qd,Qd,gE=function(e){if(e===void 0&&(e={}),!X)return e;var t=document,r=t.title,n=t.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,f=i.search,l=function(d){var v=function(){if(X){for(var p,S=document.getElementsByTagName("link"),g=0;p=S[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}}();return v?v.match(/\?/)?v:v+d:window.location.href.replace(Jd,"")}(f),c={title:r,url:l,path:mE(l),hash:u,search:f,width:o,height:s};return n&&n!==""&&(c.referrer=n),j({},c,e)},yE={last:{},history:[]};function wE(e,t){e===void 0&&(e=yE);var r=t.options;if(t.type===A.page){var n=Zd(j({properties:t.properties,meta:t.meta},Object.keys(r).length&&{options:r}));return j({},e,{last:n,history:e.history.concat(n)})}return e}Yd=function(){if(!X)return!1;var e=navigator.appVersion;return~e.indexOf("Win")?"Windows":~e.indexOf("Mac")?"MacOS":~e.indexOf("X11")?"UNIX":~e.indexOf("Linux")?"Linux":"Unknown OS"}(),Xd=X?document.referrer:null,qd=JT(),Qd=YT();var Qu={initialized:!1,sessionId:na(),app:null,version:null,debug:!1,offline:!!X&&!navigator.onLine,os:{name:Yd},userAgent:X?navigator.userAgent:"node",library:{name:"analytics",version:"0.12.13"},timezone:Qd,locale:qd,campaign:{},referrer:Xd};function bE(e,t){e===void 0&&(e=Qu);var r=e.initialized,n=t.campaign;switch(t.type){case A.campaign:return j({},e,{campaign:n});case A.offline:return j({},e,{offline:!0});case A.online:return j({},e,{offline:!1});default:return r?e:j({},Qu,e,{initialized:!0})}}var SE=["plugins","reducers","storage"];function $E(e,t,r){if(X){var n=window[(r?"add":"remove")+"EventListener"];e.split(" ").forEach(function(a){n(a,t)})}}function IE(e){var t=$E.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(e)});return t(!0),function(r){return t(!1)}}function ev(){return dt("analytics",[]),function(e){return function(t,r,n){var a=e(t,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Kt[Ht].analytics.push(o.action||o),i(o)}})}}}function el(e){return function(){return Gt(Gt.apply(null,arguments),ev())}}function yi(e){return e?Bd(e)?e:[e]:[]}function tl(e,t,r){e===void 0&&(e={});var n,a,i=na();return t&&(dr[i]=(n=t,a=function(o){for(var s,u=o||Array.prototype.slice.call(arguments),f=0;f<u.length;f++)if(oe(u[f])){s=u[f];break}return s}(r),function(o){a&&a(o),n(o)})),j({},e,{rid:i,ts:new Date().getTime()},t?{hasCallback:!0}:{})}function TE(e){e===void 0&&(e={});var t=e.reducers||{},r=e.initialUser||{},n=(e.plugins||[]).reduce(function(m,y){if(oe(y))return m.middlewares=m.middlewares.concat(y),m;if(y.NAMESPACE&&(y.name=y.NAMESPACE),!y.name)throw new Error("https://lytics.dev/errors/1");y.config||(y.config={});var O=y.EVENTS?Object.keys(y.EVENTS).map(function(D){return y.EVENTS[D]}):[];m.pluginEnabled[y.name]=!(y.enabled===!1||y.config.enabled===!1),delete y.enabled,y.methods&&(m.methods[y.name]=Object.keys(y.methods).reduce(function(D,Z){var w;return D[Z]=(w=y.methods[Z],function(){for(var E=Array.prototype.slice.call(arguments),P=new Array(w.length),B=0;B<E.length;B++)P[B]=E[B];return P[P.length]=$,w.apply({instance:$},P)}),D},{}),delete y.methods);var N=Object.keys(y).concat(O),U=new Set(m.events.concat(N));if(m.events=Array.from(U),m.pluginsArray=m.pluginsArray.concat(y),m.plugins[y.name])throw new Error(y.name+"AlreadyLoaded");return m.plugins[y.name]=y,m.plugins[y.name].loaded||(m.plugins[y.name].loaded=function(){return!0}),m},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=e.storage?e.storage:{getItem:ft,setItem:dt,removeItem:Xt},i=function(m){return function(y,O,N){return O.getState("user")[y]||(N&&ie(N)&&N[y]?N[y]:Bu(m)[y]||ft(no(y))||null)}}(a),o=n.plugins,s=n.events.filter(function(m){return!ro.includes(m)}).sort(),u=new Set(s.concat(yn).filter(function(m){return!ro.includes(m)})),f=Array.from(u).sort(),l=function(){return o},c=new lE,d=c.addMiddleware,v=c.removeMiddleware,p=c.dynamicMiddlewares,S=function(){throw new Error("Abort disabled inListener")},g=XT(),T=Bu(a),I=j({},T,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});I.anonymousId||(I.anonymousId=na());var b=j({enable:function(m,y){return new Promise(function(O){R.dispatch({type:A.enablePlugin,plugins:yi(m),_:{originalAction:A.enablePlugin}},O,[y])})},disable:function(m,y){return new Promise(function(O){R.dispatch({type:A.disablePlugin,plugins:yi(m),_:{originalAction:A.disablePlugin}},O,[y])})}},n.methods),h=!1,$={identify:function(m,y,O,N){try{var U=Ve(m)?m:null,D=ie(m)?m:y,Z=O||{},w=$.user();dt(no(He),U);var E=U||D.userId||i(He,$,D);return Promise.resolve(new Promise(function(P){R.dispatch(j({type:A.identifyStart,userId:E,traits:D||{},options:Z,anonymousId:w.anonymousId},w.id&&w.id!==U&&{previousId:w.id}),P,[y,O,N])}))}catch(P){return Promise.reject(P)}},track:function(m,y,O,N){try{var U=ie(m)?m.event:m;if(!U||!Ve(U))throw new Error("EventMissing");var D=ie(m)?m:y||{},Z=ie(O)?O:{};return Promise.resolve(new Promise(function(w){R.dispatch({type:A.trackStart,event:U,properties:D,options:Z,userId:i(He,$,y),anonymousId:i(Ct,$,y)},w,[y,O,N])}))}catch(w){return Promise.reject(w)}},page:function(m,y,O){try{var N=ie(m)?m:{},U=ie(y)?y:{};return Promise.resolve(new Promise(function(D){R.dispatch({type:A.pageStart,properties:gE(N),options:U,userId:i(He,$,N),anonymousId:i(Ct,$,N)},D,[m,y,O])}))}catch(D){return Promise.reject(D)}},user:function(m){if(m===He||m==="id")return i(He,$);if(m===Ct||m==="anonId")return i(Ct,$);var y=$.getState("user");return m?Nu(y,m):y},reset:function(m){return new Promise(function(y){R.dispatch({type:A.resetStart},y,m)})},ready:function(m){return h&&m({plugins:b,instance:$}),$.on(A.ready,function(y){m(y),h=!0})},on:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".on disabled for "+m);var O=/Start$|Start:/;if(m==="*"){var N=function(w){return function(E){return function(P){return P.type.match(O)&&y({payload:P,instance:$,plugins:o}),E(P)}}},U=function(w){return function(E){return function(P){return P.type.match(O)||y({payload:P,instance:$,plugins:o}),E(P)}}};return d(N,sn),d(U,cn),function(){v(N,sn),v(U,cn)}}var D=m.match(O)?sn:cn,Z=function(w){return function(E){return function(P){return P.type===m&&y({payload:P,instance:$,plugins:o,abort:S}),E(P)}}};return d(Z,D),function(){return v(Z,D)}},once:function(m,y){if(!m||!oe(y))return!1;if(m===A.bootstrap)throw new Error(".once disabled for "+m);var O=$.on(m,function(N){y({payload:N.payload,instance:$,plugins:o,abort:S}),O()});return O},getState:function(m){var y=R.getState();return m?Nu(y,m):Object.assign({},y)},dispatch:function(m){var y=Ve(m)?{type:m}:m;if(yn.includes(y.type))throw new Error("reserved action "+y.type);var O=j({},y,{_:j({originalAction:y.type},m._||{})});R.dispatch(O)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(m,y,O){R.dispatch({type:A.setItemStart,key:m,value:y,options:O})},removeItem:function(m,y){R.dispatch({type:A.removeItemStart,key:m,options:y})}},setAnonymousId:function(m,y){$.storage.setItem(Ze,m,y)},events:{core:yn,plugins:s}},k=n.middlewares.concat([function(m){return function(y){return function(O){return O.meta||(O.meta=tl()),y(O)}}},p(sn),cE($,l,{all:f,plugins:s}),uE(a),nE($),iE($),p(cn)]),_={context:bE,user:aE(a),page:wE,track:vE,plugins:fE(l),queue:pE},C=Gt,M=Gt;if(X&&e.debug){var F=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;F&&(C=F({trace:!0,traceLimit:25})),M=function(){return arguments.length===0?ev():ie(typeof arguments[0])?el():el().apply(null,arguments)}}var V,L=function(m){return Object.keys(m).reduce(function(y,O){return SE.includes(O)||(y[O]=m[O]),y},{})}(e),x=n.pluginsArray.reduce(function(m,y){var O=y.name,N=y.config,U=y.loaded,D=n.pluginEnabled[O];return m[O]={enabled:D,initialized:!!D&&!y.initialize,loaded:!!U({config:N}),config:N},m},{}),z={context:L,user:I,plugins:x},R=Kd(function(m){for(var y=Object.keys(m),O={},N=0;N<y.length;N++){var U=y[N];typeof m[U]===Ge&&(O[U]=m[U])}var D,Z=Object.keys(O);try{(function(w){Object.keys(w).forEach(function(E){var P=w[E];if(typeof P(void 0,{type:"@@redux/INIT"})===De||typeof P(void 0,{type:eE})===De)throw new Error("reducer "+E+" "+De)})})(O)}catch(w){D=w}return function(w,E){if(w===void 0&&(w={}),D)throw D;for(var P=!1,B={},ae=0;ae<Z.length;ae++){var ze=Z[ae],is=w[ze],oa=(0,O[ze])(is,E);if(typeof oa===De){var hv=tE(ze,E);throw new Error(hv)}B[ze]=oa,P=P||oa!==is}return P?B:w}}(j({},_,t)),z,M(C(rE.apply(void 0,k))));R.dispatch=(V=R.dispatch,function(m,y,O){var N=j({},m,{meta:tl(m.meta,y,yi(O))});return V.apply(null,[N])});var G=Object.keys(o);R.dispatch({type:A.bootstrap,plugins:G,config:L,params:g,user:I,initialUser:r,persistedUser:T});var J=G.filter(function(m){return n.pluginEnabled[m]}),Le=G.filter(function(m){return!n.pluginEnabled[m]});return R.dispatch({type:A.registerPlugins,plugins:G,enabled:n.pluginEnabled}),n.pluginsArray.map(function(m,y){var O=m.bootstrap,N=m.config,U=m.name;O&&oe(O)&&O({instance:$,config:N,payload:m}),R.dispatch({type:A.registerPluginType(U),name:U,enabled:n.pluginEnabled[U],plugin:m}),n.pluginsArray.length===y+1&&R.dispatch({type:A.initializeStart,plugins:J,disabled:Le})}),IE(function(m){R.dispatch({type:m?A.offline:A.online})}),function(m,y,O){setInterval(function(){return Wd(m,y,O)},3e3)}(R,l,$),$}var sn="before",cn="after",br="cookie",nt=nv(),tv=aa,EE=aa;function rv(e){return nt?aa(e,"",-1):Xt(e)}function nv(){if(nt!==void 0)return nt;var e="cookiecookie";try{aa(e,e),nt=document.cookie.indexOf(e)!==-1,rv(e)}catch{nt=!1}return nt}function aa(e,t,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return nt===!1&&(o?dt(e,t):ft(e)),o?document.cookie=e+"="+encodeURIComponent(t)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+e+"=")[1]||"").split(";")[0])}}var Sr="localStorage",PE=qo.bind(null,"localStorage");qt("localStorage","getItem",ft);qt("localStorage","setItem",dt);qt("localStorage","removeItem",Xt);var $r="sessionStorage",OE=qo.bind(null,"sessionStorage");qt("sessionStorage","getItem",ft);qt("sessionStorage","setItem",dt);qt("sessionStorage","removeItem",Xt);function Nt(e){var t=e;try{if((t=JSON.parse(e))==="true")return!0;if(t==="false")return!1;if(ie(t))return t;parseFloat(t)===t&&(t=parseFloat(t))}catch{}if(t!==null&&t!=="")return t}var kE=PE(),_E=OE(),RE=nv();function av(e,t){if(e){var r=Qo(t),n=!ns(r),a=es(r)?Nt(localStorage.getItem(e)):void 0;if(n&&!Rt(a))return a;var i=ts(r)?Nt(tv(e)):void 0;if(n&&i)return i;var o=rs(r)?Nt(sessionStorage.getItem(e)):void 0;if(n&&o)return o;var s=ft(e);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function CE(e,t,r){if(e&&!Rt(t)){var n={},a=Qo(r),i=JSON.stringify(t),o=!ns(a);return es(a)&&(n[Sr]=un(Sr,t,Nt(localStorage.getItem(e))),localStorage.setItem(e,i),o)?n[Sr]:ts(a)&&(n[br]=un(br,t,Nt(tv(e))),EE(e,i),o)?n[br]:rs(a)&&(n[$r]=un($r,t,Nt(sessionStorage.getItem(e))),sessionStorage.setItem(e,i),o)?n[$r]:(n[wr]=un(wr,t,ft(e)),dt(e,t),o?n[wr]:n)}}function AE(e,t){if(e){var r=Qo(t),n=av(e,Md),a={};return!Rt(n.localStorage)&&es(r)&&(localStorage.removeItem(e),a[Sr]=n.localStorage),!Rt(n.cookie)&&ts(r)&&(rv(e),a[br]=n.cookie),!Rt(n.sessionStorage)&&rs(r)&&(sessionStorage.removeItem(e),a[$r]=n.sessionStorage),!Rt(n.global)&&ia(r,wr)&&(Xt(e),a[wr]=n.global),a}}function Qo(e){return e?Ve(e)?e:e.storage:Dd}function es(e){return kE&&ia(e,Sr)}function ts(e){return RE&&ia(e,br)}function rs(e){return _E&&ia(e,$r)}function ns(e){return e===Md||e==="all"}function ia(e,t){return e===Dd||e===t||ns(e)}function un(e,t,r){return{location:e,current:t,previous:r}}var jE={setItem:CE,getItem:av,removeItem:AE};function LE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function nl(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?rl(Object(r),!0).forEach(function(n){LE(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rl(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function NE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t={storage:jE};return TE(nl(nl({},t),e))}function UE(e,t){t=t||{};var r,n,a=[],i=t.max||1/0;function o(){clearInterval(r),e(a.splice(0,i)),s()}function s(){r=setInterval(o,t.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}function xE(e){if(typeof window>"u")return;const{addEventListener:t,history:r,location:n}=window;let a=n.pathname;t("popstate",()=>e(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){var c;const f=((c=u[2])==null?void 0:c.toString())||"",l=ME(f);return a!==l&&(a=l,setTimeout(()=>e(f),0)),s.apply(r,u)}})}function DE(e,t){const r=e.indexOf(t);return r>-1?e.slice(0,r):e}function ME(e){return["#","?"].forEach(t=>e=DE(e,t)),e}function FE(){xE(()=>{xe.page()})}function zE(e){if(e===void 0&&(e={}),!X)return to;var t=il(),r=ao(),n=al(),a=ln(n,t),i=ln(r,t),o=[],s=[],u=[],f=n,l=a,c=i,d=Object.keys(e);if(!d.length)return to;var v=d.map(function(S){return Number(S)}),p=QT(function(){var S=il(),g=function(L,x){return x.map(function(z){return z===100?L-5:L*(z/100)})}(S,v),T=ao(),I=al(),b=ln(I,S),h=ln(T,S);if(l=b>l?b:l,c=h<c?h:c,!(o.length>=v.length)){var $=f===I,k="up";$?k="initial":f<=I&&(k="down");var _=g,C=v;(k==="up"||$)&&(_=g.slice().reverse(),C=v.slice().reverse());var M=C.reduce(function(L,x,z){var R=_[z];return u.includes(x)&&I<=R&&(u=u.filter(function(G){return G!==x}),L.singleFunction=x),k==="down"&&!o.includes(x)&&I>=R&&x>i?(s.push(x),L.callbacks=L.callbacks.concat(x),L):k==="up"&&!o.includes(x)&&I<=R&&x<=b?(L.foundFunc=[x],L):($&&I>=R&&L.foundFunc.length===0&&(L.foundFunc=[x]),!s.includes(x)&&I>=R&&(s.push(x),L.singleFunction?u.push(x):L.singleFunction=x),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:k});if(f=I,k==="down"&&M.callbacks&&M.callbacks.forEach(function(L){oe(e[L])&&(e[L]({trigger:L,direction:k,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(L))}),M.singleFunction){var F=M.singleFunction,V=M.direction;oe(e[F])&&e[F]({trigger:F,direction:V,scrollMin:c,scrollMax:l,range:[c,l]}),o.push(F)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function ao(){return X?document.body.scrollTop||document.documentElement.scrollTop:0}function BE(){return X?window.innerHeight||document.documentElement.clientHeight:0}function al(){return Math.round(ao()+BE())}function il(){if(!X)return 0;var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)}function ln(e,t){return Math.round(e/t*100)}var ol="EventListener";function HE(e){return function(t,r,n,a){var i=n||to,o=a||!1;if(!X)return i;var s=Ln(r),u=Ln(t,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("noEvent");var f=[];return function l(c){c&&(f=[]);for(var d=c?"add"+ol:"remove"+ol,v=0;v<u.length;v++){var p=u[v];f[v]=c?o&&o.once?KE(i):i:f[v]||i;for(var S=0;S<s.length;S++)p[d]?p["on"+s[S]]=c?f[v]:null:p[d](s[S],f[v],o)}return l.bind(null,!c)}(e)}}function Ln(e,t){if(Ve(e))return t?Ln(document.querySelectorAll(e)):(r=e).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(e)){for(var n=[],a=e.length>>>0;a--;)n[a]=e[a];return n}var i=ZT(e);return t?i.map(function(o){return Ve(o)?Ln(o,!0):o}).flat():i}function KE(e,t){var r;return function(){return e&&(r=e.apply(this,arguments),e=null),r}}var wi=HE("Event");function iv(e,t){return X&&oe(window[e])?(r=window[e],n=t,(a=window)===void 0&&(a=null),oe(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[e]=t;var r,n,a}iv.bind(null,"onerror");iv.bind(null,"onload");var ov=typeof window>"u",sl="hidden";function GE(e){if(ov)return!1;var t=WE(),r="".concat(t.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return e(!!document[t])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function WE(){var e=["webkit","moz","ms","o"];return ov||sl in document?sl:e.reduce(function(t,r){var n=r+"Hidden";return!t&&n in document?n:t},null)}var VE=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function ZE(e,t){t===void 0&&(t={});var r=function(o,s){var u=this,f=!1;return function(l){f||(o.call(u,l),f=!0,setTimeout(function(){return f=!1},s))}}(e,t.throttle||1e4),n=[];function a(){var o=GE(function(s){s||r({type:"tabVisible"})});return n=[o].concat(VE.map(function(s){return wi(document,s,r)})).concat(wi(window,"load",r)).concat(wi(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function JE(e){var t,r,n=e.onIdle,a=e.onWakeUp,i=e.onHeartbeat,o=e.timeout,s=o===void 0?1e4:o,u=e.throttle,f=u===void 0?2e3:u,l=!1,c=!1,d=new Date,v=function(){return clearTimeout(t)};function p(g){v(),i&&!l&&i(cr(d),g),a&&l&&(l=!1,a(cr(r),g),d=new Date),t=setTimeout(function(){l=!0,n&&(r=new Date,n(cr(d),g))},s)}var S=ZE(p,{throttle:f});return{disable:function(){c=!0,l=!1,v();var g=S();return function(){return c=!1,d=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:l,isDisabled:c,active:l?0:cr(d,c),idle:l?cr(r,c):0}}}}function cr(e,t){return t?0:Math.round((new Date-e)/1e3)}const cl=5e3;class YE{constructor(t){le(this,"element");le(this,"isInViewport",!1);le(this,"isAwake",!1);le(this,"isFlushing");le(this,"observer");le(this,"lastEventAt",Date.now());le(this,"registeredView",!1);le(this,"viewCallback");le(this,"activeDurationCallback");le(this,"idleDurationCallback");le(this,"scrollCallback");this.element=t.element,this.viewCallback=t.viewCallback,this.activeDurationCallback=t.activeDurationCallback,this.idleDurationCallback=t.idleDurationCallback,this.scrollCallback=t.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),JE({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:cl}),zE({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(t){t?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=t}handleAwake(t,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=t,this.lastEventAt=t?Date.now()-r*cl:Date.now(),this.isInViewport&&this.trackAwake(t,r)}handleScroll(t){this.scrollCallback&&this.scrollCallback(t)}handleVisibilityChange(){this.isAwake=!1;const t=Math.round((Date.now()-this.lastEventAt)/1e3);t>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,t))}trackAwake(t,r){!t&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),t&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}const ul="sesamy_session_id";function XE(){let e=sessionStorage.getItem(ul);return e||(e=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ul,e)),e}let sv=!1,io,ll,Nn;const cv=new Map;function qE({clientId:e,enabled:t=!0,environment:r}){if(io=e,ll=t,Nn=`${Ke("logs",r)}/events`,!ll)return;window.addEventListener("beforeunload",()=>{lv.forEach((a,i)=>{a.bind(i)()}),eP()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&cv.forEach((a,i)=>{a.bind(i)()})}),FE();const n=new YE({element:document.body,viewCallback:()=>{xe.page()},activeDurationCallback:(a,i,o)=>{xe.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{xe.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{xe.track("scroll",{scroll:a.scrollMax})}});tP(document.body,()=>{n.flush()}),rP(document.body,()=>{n.handleVisibilityChange()}),window.addEventListener(Te.AUTHENTICATED,async a=>{const i=a;await xe.identify(i.detail.sub)}),window.addEventListener(Te.LOGOUT,async()=>{await xe.track("logout",{}),as.flush(),await xe.reset()})}function uv(e){return JSON.stringify(e.map(t=>({...t,clientId:io,requestId:Math.random().toString(36).slice(2,9),sessionId:XE(),timestamp:new Date().toISOString(),version:Xo,event:t.event,context:{page:{url:window.location.hostname,path:window.location.pathname,title:document.title,search:window.location.search,referrer:document.referrer},locale:navigator.language,library:xd,userAgent:navigator.userAgent,clientId:io}})))}const as=UE(async e=>{if(e.length>0){const t=uv(e);sv?navigator.sendBeacon(Nn,t):(await fetch(Nn,{method:"POST",body:t,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function bi(e){var t;if(e.anonymousId)if((t=e.properties)!=null&&t.flushing){const r={...e};delete r.properties.flushing,navigator.sendBeacon(Nn,uv([r]))}else as.push(e)}const xe=NE({app:xd,version:Xo,plugins:[{name:"custom-analytics-plugin",page:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"page"})},track:({payload:e})=>{const{properties:t,anonymousId:r,userId:n,event:a}=e;bi({anonymousId:r,userId:n,properties:t,event:a,type:"track"})},identify:({payload:e})=>{const{properties:t,anonymousId:r,userId:n}=e;bi({anonymousId:r,userId:n,properties:t,type:"identify"})}}]});function QE(e,t){xe.track(e,t)}function eP(){return sv=!0,as.flush()}const lv=new Map;function tP(e,t){lv.set(e,t)}function rP(e,t){cv.set(e,t)}const fv="sesamySignedURLs";function dv(){const e=sessionStorage.getItem(fv);return e?JSON.parse(e):[]}function nP(e){const t=dv();t.push(e),sessionStorage.setItem(fv,JSON.stringify(t))}function aP(e){const{createCheckout:t,getCheckout:r,updateCheckout:n,getEntitlement:a,getEntitlements:i,getEntitlementAccess:o,getSubscriptions:s,getContract:u,getContracts:f,getBill:l,getBills:c,getTransaction:d,getTransactions:v,getProfile:p,updateProfile:S,getTags:g,deleteTag:T,setTag:I,getUserMetadata:b,listUserMetadata:h,setUserMetadata:$,deleteUserMetadata:k,getTally:_,getTallies:C,pushTally:M,deleteTally:F,getProduct:V,getPaymentIssues:L,isSpotifyLinked:x,unlinkSpotify:z,linkSpotify:R,autoOnboardProduct:G,openHostedAccountPage:J,generateLink:Le}=DT(e),m={auth:{getUser:p,isAuthenticated:Jo,loginWithRedirect:Yo,logout:Cd,setToken:jd},checkouts:{get:r,create:t,update:n},profile:{get:p,update:S,openHostedAccountPage:J,isSpotifyLinked:x,unlinkSpotify:z},analytics:{track:QE},tags:{list:g,set:I,delete:T},entitlements:{get:a,list:i,access:o,signedLinks:dv},contracts:{get:u,list:f},bills:{get:l,list:c},userMetadata:{get:b,list:h,set:$,delete:k},tallies:{get:_,list:C,push:M,delete:F},subscriptions:{list:s},transactions:{get:d,list:v},products:{get:V,autoOnboard:G,linkSpotify:R},getVersion:iP,getPaymentIssues:L,generateLink:Le,clearCache:Se};return e.namespace&&(window[e.namespace]=m),m}function iP(){return Xo}async function oP({enabled:e=!1,rules:t}){if(!e)return;const r=await Jo(),n=window.location.href;for(const a of t){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n))){for(const o of i)if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML+=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML+=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML+=a.content);break;case"replace":if(a.contentType==="selector"&&a.content){const s=document.querySelector(a.content);s?o.innerHTML=s.innerHTML:console.warn(`Source element for selector '${a.content}' not found`)}else if(a.contentType==="url"&&a.content){const s=await fl(a.content);s?o.innerHTML=s:console.warn(`Failed to fetch content from URL '${a.content}'`)}else a.content&&(o.innerHTML=a.content);break;case"remove":o.remove();break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}}async function fl(e){try{const t=await fetch(e);return t.ok?await t.text():(console.error(`Failed to fetch content from ${e}: ${t.statusText}`),null)}catch(t){return console.error(`Error fetching content from ${e}:`,t),null}}function sP(){const e=new URLSearchParams(window.location.hash.substring(1)),t=e.get("access_token");if(t){jd(t);const r=new URL(window.location.href);e.delete("access_token"),r.hash=e.toString(),window.history.replaceState(null,"",r)}}const dl="sesamy-refresh",vl="force-refetch-entitlements";function cP(){const e=new URLSearchParams(window.location.search),t=e.get(vl),r=e.get(dl);if(t!==null||r!==null){const n=new URL(window.location.href);e.delete(vl),e.delete(dl),n.search=e.toString(),Se(),window.history.replaceState(null,"",n)}}function uP(){const e=new URLSearchParams(window.location.search),t=e.get("token"),r=e.get("se");if(!r||!t)return;const n=parseInt(r,10);if(Number.isNaN(n)||n<Date.now())return;nP({url:window.location.href.split("?")[0],token:t,expiresAt:n,publisherContentId:e.get("sp")??void 0});const a=new URL(window.location.href);a.searchParams.delete("ss"),a.searchParams.delete("se"),a.searchParams.delete("sp"),a.searchParams.delete("so"),a.searchParams.delete("token"),window.history.replaceState(null,"",a)}const hl="sesamy-user";async function lP(){const t=new URLSearchParams(window.location.search).get(hl);if(!t)return;const r=await ET();(r==null?void 0:r.email)!==t&&(Se(),Yo({authorizationParams:{email_hint:t,login_hint:t}}));const n=new URL(window.location.href);n.searchParams.delete(hl),window.history.replaceState(null,"",n)}const pl="sesamy-purchase";function fP(){const e=new URLSearchParams(window.location.search),t=e.get(pl);if(t!==null){const r=new URL(window.location.href);e.delete(pl),r.search=e.toString(),Ye(Te.PURCHASE,{itemSrc:t}),Se(),window.history.replaceState(null,"",r)}}const ml="sesamy-login";async function dP(){if(!new URLSearchParams(window.location.search).get(ml))return;await Jo()||Yo();const n=new URL(window.location.href);n.searchParams.delete(ml),window.history.replaceState(null,"",n)}const vP=typeof window<"u";async function gl(e){qE({clientId:e.clientId,environment:e.environment,...e.analytics}),await TT({clientId:e.clientId,organization:e.organization,environment:e.environment,...e.auth}),e.transform&&await oP(e.transform),sP(),cP(),uP(),await dP(),await lP(),fP(),Ye(Te.READY,{})}async function vv(e){const t=aP({clientId:e.clientId,environment:e.environment,...e.api});return vP&&(e.awaitAllServices?await gl(e):gl(e)),t}if(typeof document<"u"){const e=document.getElementById("sesamy-js");if(e!=null&&e.textContent)try{const t=JSON.parse(e.textContent);vv(t)}catch(t){console.error("Failed to parse config",t)}}exports.init=vv;