@sesamy/sesamy-js 1.53.0 → 1.54.0
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.
- package/dist/sesamy-js.cjs +5 -5
- package/dist/sesamy-js.d.ts +2 -0
- package/dist/sesamy-js.iife.js +2 -2
- package/dist/sesamy-js.mjs +62 -61
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce=require("@sesamy/sdk");var Xs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qs={},Wn,ec;function $e(){return ec||(ec=1,Wn=function(t){try{return!!t()}catch{return!0}}),Wn}var Vn,tc;function wn(){if(tc)return Vn;tc=1;var t=$e();return Vn=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Vn}var Jn,rc;function be(){if(rc)return Jn;rc=1;var t=wn(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return Jn=t?n:function(a){return function(){return r.apply(a,arguments)}},Jn}var Zn,nc;function bn(){if(nc)return Zn;nc=1;var t=be(),e=t({}.toString),r=t("".slice);return Zn=function(n){return r(e(n),8,-1)},Zn}var Yn,ac;function Gd(){if(ac)return Yn;ac=1;var t=be(),e=$e(),r=bn(),n=Object,a=t("".split);return Yn=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,Yn}var Xn,ic;function Sn(){return ic||(ic=1,Xn=function(t){return t==null}),Xn}var Qn,oc;function In(){if(oc)return Qn;oc=1;var t=Sn(),e=TypeError;return Qn=function(r){if(t(r))throw new e("Can't call method on "+r);return r},Qn}var ea,sc;function Dr(){if(sc)return ea;sc=1;var t=Gd(),e=In();return ea=function(r){return t(e(r))},ea}var Rr,cc;function Se(){if(cc)return Rr;cc=1;var t=function(e){return e&&e.Math===Math&&e};return Rr=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof Xs=="object"&&Xs)||t(typeof Rr=="object"&&Rr)||(function(){return this})()||Function("return this")(),Rr}var ta={exports:{}},ra,uc;function pt(){return uc||(uc=1,ra=!1),ra}var na,lc;function cs(){if(lc)return na;lc=1;var t=Se(),e=Object.defineProperty;return na=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},na}var fc;function us(){if(fc)return ta.exports;fc=1;var t=pt(),e=Se(),r=cs(),n="__core-js_shared__",a=ta.exports=e[n]||r(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),ta.exports}var aa,dc;function Wd(){if(dc)return aa;dc=1;var t=us();return aa=function(e,r){return t[e]||(t[e]=r||{})},aa}var ia,hc;function Pn(){if(hc)return ia;hc=1;var t=In(),e=Object;return ia=function(r){return e(t(r))},ia}var oa,vc;function rt(){if(vc)return oa;vc=1;var t=be(),e=Pn(),r=t({}.hasOwnProperty);return oa=Object.hasOwn||function(a,i){return r(e(a),i)},oa}var sa,pc;function Vd(){if(pc)return sa;pc=1;var t=be(),e=0,r=Math.random(),n=t(1.1.toString);return sa=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},sa}var ca,mc;function Mr(){if(mc)return ca;mc=1;var t=Se(),e=t.navigator,r=e&&e.userAgent;return ca=r?String(r):"",ca}var ua,gc;function Jd(){if(gc)return ua;gc=1;var t=Se(),e=Mr(),r=t.process,n=t.Deno,a=r&&r.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&e&&(o=e.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=e.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ua=s,ua}var la,yc;function Zd(){if(yc)return la;yc=1;var t=Jd(),e=$e(),r=Se(),n=r.String;return la=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),la}var fa,wc;function Yd(){if(wc)return fa;wc=1;var t=Zd();return fa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",fa}var da,bc;function De(){if(bc)return da;bc=1;var t=Se(),e=Wd(),r=rt(),n=Vd(),a=Zd(),i=Yd(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return da=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},da}var ha,Sc;function Pe(){if(Sc)return ha;Sc=1;var t=typeof document=="object"&&document.all;return ha=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},ha}var va,Ic;function nt(){if(Ic)return va;Ic=1;var t=Pe();return va=function(e){return typeof e=="object"?e!==null:t(e)},va}var pa,Pc;function st(){if(Pc)return pa;Pc=1;var t=nt(),e=String,r=TypeError;return pa=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},pa}var ma={},ga,Ec;function Me(){if(Ec)return ga;Ec=1;var t=$e();return ga=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ga}var ya,Rc;function Xd(){if(Rc)return ya;Rc=1;var t=Me(),e=$e();return ya=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ya}var wa={},ba,_c;function En(){if(_c)return ba;_c=1;var t=Se(),e=nt(),r=t.document,n=e(r)&&e(r.createElement);return ba=function(a){return n?r.createElement(a):{}},ba}var Sa,Tc;function Qd(){if(Tc)return Sa;Tc=1;var t=Me(),e=$e(),r=En();return Sa=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Sa}var Ia,kc;function He(){if(kc)return Ia;kc=1;var t=wn(),e=Function.prototype.call;return Ia=t?e.bind(e):function(){return e.apply(e,arguments)},Ia}var Pa,Oc;function at(){if(Oc)return Pa;Oc=1;var t=Se(),e=Pe(),r=function(n){return e(n)?n:void 0};return Pa=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},Pa}var Ea,Cc;function Rn(){if(Cc)return Ea;Cc=1;var t=be();return Ea=t({}.isPrototypeOf),Ea}var Ra,Ac;function eh(){if(Ac)return Ra;Ac=1;var t=at(),e=Pe(),r=Rn(),n=Yd(),a=Object;return Ra=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},Ra}var _a,Uc;function _n(){if(Uc)return _a;Uc=1;var t=String;return _a=function(e){try{return t(e)}catch{return"Object"}},_a}var Ta,jc;function ct(){if(jc)return Ta;jc=1;var t=Pe(),e=_n(),r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Ta}var ka,Lc;function ls(){if(Lc)return ka;Lc=1;var t=ct(),e=Sn();return ka=function(r,n){var a=r[n];return e(a)?void 0:t(a)},ka}var Oa,Nc;function Gv(){if(Nc)return Oa;Nc=1;var t=He(),e=Pe(),r=nt(),n=TypeError;return Oa=function(a,i){var o,s;if(i==="string"&&e(o=a.toString)&&!r(s=t(o,a))||e(o=a.valueOf)&&!r(s=t(o,a))||i!=="string"&&e(o=a.toString)&&!r(s=t(o,a)))return s;throw new n("Can't convert object to primitive value")},Oa}var Ca,qc;function Wv(){if(qc)return Ca;qc=1;var t=He(),e=nt(),r=eh(),n=ls(),a=Gv(),i=De(),o=TypeError,s=i("toPrimitive");return Ca=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Ca}var Aa,xc;function th(){if(xc)return Aa;xc=1;var t=Wv(),e=eh();return Aa=function(r){var n=t(r,"string");return e(n)?n:n+""},Aa}var $c;function Rt(){if($c)return wa;$c=1;var t=Me(),e=Qd(),r=Xd(),n=st(),a=th(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return wa.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},wa}var Ua,Dc;function Vv(){if(Dc)return Ua;Dc=1;var t=Math.ceil,e=Math.floor;return Ua=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ua}var ja,Mc;function fs(){if(Mc)return ja;Mc=1;var t=Vv();return ja=function(e){var r=+e;return r!==r||r===0?0:t(r)},ja}var La,Fc;function rh(){if(Fc)return La;Fc=1;var t=fs(),e=Math.max,r=Math.min;return La=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},La}var Na,Kc;function Jv(){if(Kc)return Na;Kc=1;var t=fs(),e=Math.min;return Na=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Na}var qa,zc;function ds(){if(zc)return qa;zc=1;var t=Jv();return qa=function(e){return t(e.length)},qa}var xa,Hc;function Zv(){if(Hc)return xa;Hc=1;var t=Dr(),e=rh(),r=ds(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return xa={includes:n(!0),indexOf:n(!1)},xa}var $a,Bc;function hs(){return Bc||(Bc=1,$a={}),$a}var Da,Gc;function nh(){if(Gc)return Da;Gc=1;var t=be(),e=rt(),r=Dr(),n=Zv().indexOf,a=hs(),i=t([].push);return Da=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Da}var Ma,Wc;function vs(){return Wc||(Wc=1,Ma=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ma}var Fa,Vc;function ah(){if(Vc)return Fa;Vc=1;var t=nh(),e=vs();return Fa=Object.keys||function(n){return t(n,e)},Fa}var Jc;function Yv(){if(Jc)return ma;Jc=1;var t=Me(),e=Xd(),r=Rt(),n=st(),a=Dr(),i=ah();return ma.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},ma}var Ka,Zc;function ih(){if(Zc)return Ka;Zc=1;var t=at();return Ka=t("document","documentElement"),Ka}var za,Yc;function ps(){if(Yc)return za;Yc=1;var t=Wd(),e=Vd(),r=t("keys");return za=function(n){return r[n]||(r[n]=e(n))},za}var Ha,Xc;function Fr(){if(Xc)return Ha;Xc=1;var t=st(),e=Yv(),r=vs(),n=hs(),a=ih(),i=En(),o=ps(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(y){return u+c+s+y+u+"/"+c+s},v=function(y){y.write(d("")),y.close();var b=y.parentWindow.Object;return y=null,b},p=function(){var y=i("iframe"),b="java"+c+":",g;return y.style.display="none",a.appendChild(y),y.src=String(b),g=y.contentWindow.document,g.open(),g.write(d("document.F=Object")),g.close(),g.F},m,P=function(){try{m=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&m?v(m):p():v(m);for(var y=r.length;y--;)delete P[l][r[y]];return P()};return n[f]=!0,Ha=Object.create||function(b,g){var w;return b!==null?(h[l]=t(b),w=new h,h[l]=null,w[f]=b):w=P(),g===void 0?w:e.f(w,g)},Ha}var Ba,Qc;function Xv(){if(Qc)return Ba;Qc=1;var t=De(),e=Fr(),r=Rt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),Ba=function(i){a[n][i]=!0},Ba}var Ga,eu;function Kr(){return eu||(eu=1,Ga={}),Ga}var Wa,tu;function Qv(){if(tu)return Wa;tu=1;var t=Se(),e=Pe(),r=t.WeakMap;return Wa=e(r)&&/native code/.test(String(r)),Wa}var Va,ru;function Zt(){return ru||(ru=1,Va=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),Va}var Ja,nu;function Yt(){if(nu)return Ja;nu=1;var t=Me(),e=Rt(),r=Zt();return Ja=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},Ja}var Za,au;function gr(){if(au)return Za;au=1;var t=Qv(),e=Se(),r=nt(),n=Yt(),a=rt(),i=us(),o=ps(),s=hs(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(y){return d(y)?h(y):f(y,{})},p=function(y){return function(b){var g;if(!r(b)||(g=h(b)).type!==y)throw new l("Incompatible receiver, "+y+" required");return g}};if(t||i.state){var m=i.state||(i.state=new c);m.get=m.get,m.has=m.has,m.set=m.set,f=function(y,b){if(m.has(y))throw new l(u);return b.facade=y,m.set(y,b),b},h=function(y){return m.get(y)||{}},d=function(y){return m.has(y)}}else{var P=o("state");s[P]=!0,f=function(y,b){if(a(y,P))throw new l(u);return b.facade=y,n(y,P,b),b},h=function(y){return a(y,P)?y[P]:{}},d=function(y){return a(y,P)}}return Za={set:f,get:h,has:d,enforce:v,getterFor:p},Za}var Ya={},Xa={},iu;function oh(){if(iu)return Xa;iu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return Xa.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,Xa}var ou;function sh(){if(ou)return Ya;ou=1;var t=Me(),e=He(),r=oh(),n=Zt(),a=Dr(),i=th(),o=rt(),s=Qd(),u=Object.getOwnPropertyDescriptor;return Ya.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},Ya}var Qa={exports:{}},ei,su;function ch(){if(su)return ei;su=1;var t=Me(),e=rt(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,a=e(r,"name"),i=a&&(function(){}).name==="something",o=a&&(!t||t&&n(r,"name").configurable);return ei={EXISTS:a,PROPER:i,CONFIGURABLE:o},ei}var ti,cu;function ms(){if(cu)return ti;cu=1;var t=be(),e=Pe(),r=us(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),ti=r.inspectSource,ti}var uu;function uh(){if(uu)return Qa.exports;uu=1;var t=be(),e=$e(),r=Pe(),n=rt(),a=Me(),i=ch().CONFIGURABLE,o=ms(),s=gr(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),m=String(String).split("String"),P=Qa.exports=function(y,b,g){h(c(b),0,7)==="Symbol("&&(b="["+d(c(b),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),g&&g.getter&&(b="get "+b),g&&g.setter&&(b="set "+b),(!n(y,"name")||i&&y.name!==b)&&(a?f(y,"name",{value:b,configurable:!0}):y.name=b),p&&g&&n(g,"arity")&&y.length!==g.arity&&f(y,"length",{value:g.arity});try{g&&n(g,"constructor")&&g.constructor?a&&f(y,"prototype",{writable:!1}):y.prototype&&(y.prototype=void 0)}catch{}var w=u(y);return n(w,"source")||(w.source=v(m,typeof b=="string"?b:"")),y};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),Qa.exports}var ri,lu;function it(){if(lu)return ri;lu=1;var t=Pe(),e=Rt(),r=uh(),n=cs();return ri=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},ri}var ni={},fu;function ep(){if(fu)return ni;fu=1;var t=nh(),e=vs(),r=e.concat("length","prototype");return ni.f=Object.getOwnPropertyNames||function(a){return t(a,r)},ni}var ai={},du;function lh(){return du||(du=1,ai.f=Object.getOwnPropertySymbols),ai}var ii,hu;function tp(){if(hu)return ii;hu=1;var t=at(),e=be(),r=ep(),n=lh(),a=st(),i=e([].concat);return ii=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},ii}var oi,vu;function fh(){if(vu)return oi;vu=1;var t=rt(),e=tp(),r=sh(),n=Rt();return oi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},oi}var si,pu;function dh(){if(pu)return si;pu=1;var t=$e(),e=Pe(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return si=n,si}var ci,mu;function Te(){if(mu)return ci;mu=1;var t=Se(),e=sh().f,r=Yt(),n=it(),a=cs(),i=fh(),o=dh();return ci=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,m,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(m=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof m==typeof p)continue;i(m,p)}(s.sham||p&&p.sham)&&r(m,"sham",!0),n(d,v,m,s)}},ci}var ui,gu;function rp(){if(gu)return ui;gu=1;var t=$e();return ui=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ui}var li,yu;function gs(){if(yu)return li;yu=1;var t=rt(),e=Pe(),r=Pn(),n=ps(),a=rp(),i=n("IE_PROTO"),o=Object,s=o.prototype;return li=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},li}var fi,wu;function hh(){if(wu)return fi;wu=1;var t=$e(),e=Pe(),r=nt(),n=Fr(),a=gs(),i=it(),o=De(),s=pt(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var v={};return c[u].call(v)!==v});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),fi={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},fi}var di,bu;function yr(){if(bu)return di;bu=1;var t=Rt().f,e=rt(),r=De(),n=r("toStringTag");return di=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},di}var hi,Su;function vh(){if(Su)return hi;Su=1;var t=hh().IteratorPrototype,e=Fr(),r=Zt(),n=yr(),a=Kr(),i=function(){return this};return hi=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},hi}var vi,Iu;function np(){if(Iu)return vi;Iu=1;var t=be(),e=ct();return vi=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},vi}var pi,Pu;function ap(){if(Pu)return pi;Pu=1;var t=nt();return pi=function(e){return t(e)||e===null},pi}var mi,Eu;function ip(){if(Eu)return mi;Eu=1;var t=ap(),e=String,r=TypeError;return mi=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},mi}var gi,Ru;function ys(){if(Ru)return gi;Ru=1;var t=np(),e=nt(),r=In(),n=ip();return gi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),gi}var yi,_u;function ph(){if(_u)return yi;_u=1;var t=Te(),e=He(),r=pt(),n=ch(),a=Pe(),i=vh(),o=gs(),s=ys(),u=yr(),l=Yt(),c=it(),f=De(),h=Kr(),d=hh(),v=n.PROPER,p=n.CONFIGURABLE,m=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",g="values",w="entries",A=function(){return this};return yi=function(x,N,z,B,ie,j,D){i(z,N,B);var L=function(V){if(V===ie&&S)return S;if(!P&&V&&V in te)return te[V];switch(V){case b:return function(){return new z(this,V)};case g:return function(){return new z(this,V)};case w:return function(){return new z(this,V)}}return function(){return new z(this)}},k=N+" Iterator",Y=!1,te=x.prototype,Q=te[y]||te["@@iterator"]||ie&&te[ie],S=!P&&Q||L(ie),_=N==="Array"&&te.entries||Q,q,F,Z;if(_&&(q=o(_.call(new x)),q!==Object.prototype&&q.next&&(!r&&o(q)!==m&&(s?s(q,m):a(q[y])||c(q,y,A)),u(q,k,!0,!0),r&&(h[k]=A))),v&&ie===g&&Q&&Q.name!==g&&(!r&&p?l(te,"name",g):(Y=!0,S=function(){return e(Q,this)})),ie)if(F={values:L(g),keys:j?S:L(b),entries:L(w)},D)for(Z in F)(P||Y||!(Z in te))&&c(te,Z,F[Z]);else t({target:N,proto:!0,forced:P||Y},F);return(!r||D)&&te[y]!==S&&c(te,y,S,{name:ie}),h[N]=S,F},yi}var wi,Tu;function ws(){return Tu||(Tu=1,wi=function(t,e){return{value:t,done:e}}),wi}var bi,ku;function bs(){if(ku)return bi;ku=1;var t=Dr(),e=Xv(),r=Kr(),n=gr(),a=Rt().f,i=ph(),o=ws(),s=pt(),u=Me(),l="Array Iterator",c=n.set,f=n.getterFor(l);bi=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return bi}var Ou={},Cu;function op(){if(Cu)return Ou;Cu=1;var t=Te(),e=be(),r=rh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Ou}var Si,Au;function mh(){if(Au)return Si;Au=1;var t=Se(),e=Me(),r=Object.getOwnPropertyDescriptor;return Si=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Si}var Ii,Uu;function Tn(){if(Uu)return Ii;Uu=1;var t=$e(),e=De(),r=Me(),n=pt(),a=e("iterator");return Ii=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||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"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Ii}var Pi,ju;function kn(){if(ju)return Pi;ju=1;var t=uh(),e=Rt();return Pi=function(r,n,a){return a.get&&t(a.get,n,{getter:!0}),a.set&&t(a.set,n,{setter:!0}),e.f(r,n,a)},Pi}var Ei,Lu;function sp(){if(Lu)return Ei;Lu=1;var t=it();return Ei=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},Ei}var Ri,Nu;function Ss(){if(Nu)return Ri;Nu=1;var t=Rn(),e=TypeError;return Ri=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ri}var _i,qu;function cp(){if(qu)return _i;qu=1;var t=bn(),e=be();return _i=function(r){if(t(r)==="Function")return e(r)},_i}var Ti,xu;function wr(){if(xu)return Ti;xu=1;var t=cp(),e=ct(),r=wn(),n=t(t.bind);return Ti=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Ti}var ki,$u;function Is(){if($u)return ki;$u=1;var t=De(),e=t("toStringTag"),r={};return r[e]="z",ki=String(r)==="[object z]",ki}var Oi,Du;function zr(){if(Du)return Oi;Du=1;var t=Is(),e=Pe(),r=bn(),n=De(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Oi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Oi}var Ci,Mu;function _t(){if(Mu)return Ci;Mu=1;var t=zr(),e=String;return Ci=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ci}var Ai,Fu;function On(){if(Fu)return Ai;Fu=1;var t=zr(),e=ls(),r=Sn(),n=Kr(),a=De(),i=a("iterator");return Ai=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Ai}var Ui,Ku;function Ps(){if(Ku)return Ui;Ku=1;var t=He(),e=ct(),r=st(),n=_n(),a=On(),i=TypeError;return Ui=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},Ui}var ji,zu;function Xt(){if(zu)return ji;zu=1;var t=TypeError;return ji=function(e,r){if(e<r)throw new t("Not enough arguments");return e},ji}var Li,Hu;function Cn(){if(Hu)return Li;Hu=1;var t=be();return Li=t([].slice),Li}var Ni,Bu;function up(){if(Bu)return Ni;Bu=1;var t=Cn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Ni=r,Ni}var qi,Gu;function gh(){if(Gu)return qi;Gu=1,bs(),op();var t=Te(),e=Se(),r=mh(),n=at(),a=He(),i=be(),o=Me(),s=Tn(),u=it(),l=kn(),c=sp(),f=yr(),h=vh(),d=gr(),v=Ss(),p=Pe(),m=rt(),P=wr(),y=zr(),b=st(),g=nt(),w=_t(),A=Fr(),x=Zt(),N=Ps(),z=On(),B=ws(),ie=Xt(),j=De(),D=up(),L=j("iterator"),k="URLSearchParams",Y=k+"Iterator",te=d.set,Q=d.getterFor(k),S=d.getterFor(Y),_=r("fetch"),q=r("Request"),F=r("Headers"),Z=q&&q.prototype,V=F&&F.prototype,he=e.TypeError,oe=e.encodeURIComponent,le=String.fromCharCode,se=n("String","fromCodePoint"),Re=parseInt,Ue=i("".charAt),Fe=i([].join),ke=i([].push),Ze=i("".replace),ut=i([].shift),lt=i([].splice),mt=i("".split),gt=i("".slice),T=i(/./.exec),K=/\+/g,J="�",re=/^[0-9a-f]+$/i,me=function($,G){var W=gt($,G,G+2);return T(re,W)?Re(W,16):NaN},Ke=function($){for(var G=0,W=128;W>0&&($&W)!==0;W>>=1)G++;return G},M=function($){var G=null;switch($.length){case 1:G=$[0];break;case 2:G=($[0]&31)<<6|$[1]&63;break;case 3:G=($[0]&15)<<12|($[1]&63)<<6|$[2]&63;break;case 4:G=($[0]&7)<<18|($[1]&63)<<12|($[2]&63)<<6|$[3]&63;break}return G>1114111?null:G},ee=function($){$=Ze($,K," ");for(var G=$.length,W="",X=0;X<G;){var ue=Ue($,X);if(ue==="%"){if(Ue($,X+1)==="%"||X+3>G){W+="%",X++;continue}var de=me($,X+1);if(de!==de){W+=ue,X++;continue}X+=2;var ye=Ke(de);if(ye===0)ue=le(de);else{if(ye===1||ye>4){W+=J,X++;continue}for(var we=[de],Ee=1;Ee<ye&&(X++,!(X+3>G||Ue($,X)!=="%"));){var ze=me($,X+1);if(ze!==ze){X+=3;break}if(ze>191||ze<128)break;ke(we,ze),X+=2,Ee++}if(we.length!==ye){W+=J;continue}var ft=M(we);ft===null?W+=J:ue=se(ft)}}W+=ue,X++}return W},fe=/[!'()~]|%20/g,ve={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ge=function($){return ve[$]},Ye=function($){return Ze(oe($),fe,ge)},je=h(function(G,W){te(this,{type:Y,target:Q(G).entries,index:0,kind:W})},k,function(){var G=S(this),W=G.target,X=G.index++;if(!W||X>=W.length)return G.target=null,B(void 0,!0);var ue=W[X];switch(G.kind){case"keys":return B(ue.key,!1);case"values":return B(ue.value,!1)}return B([ue.key,ue.value],!1)},!0),Ge=function($){this.entries=[],this.url=null,$!==void 0&&(g($)?this.parseObject($):this.parseQuery(typeof $=="string"?Ue($,0)==="?"?gt($,1):$:w($)))};Ge.prototype={type:k,bindURL:function($){this.url=$,this.update()},parseObject:function($){var G=this.entries,W=z($),X,ue,de,ye,we,Ee,ze;if(W)for(X=N($,W),ue=X.next;!(de=a(ue,X)).done;){if(ye=N(b(de.value)),we=ye.next,(Ee=a(we,ye)).done||(ze=a(we,ye)).done||!a(we,ye).done)throw new he("Expected sequence with length 2");ke(G,{key:w(Ee.value),value:w(ze.value)})}else for(var ft in $)m($,ft)&&ke(G,{key:ft,value:w($[ft])})},parseQuery:function($){if($)for(var G=this.entries,W=mt($,"&"),X=0,ue,de;X<W.length;)ue=W[X++],ue.length&&(de=mt(ue,"="),ke(G,{key:ee(ut(de)),value:ee(Fe(de,"="))}))},serialize:function(){for(var $=this.entries,G=[],W=0,X;W<$.length;)X=$[W++],ke(G,Ye(X.key)+"="+Ye(X.value));return Fe(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Le=function(){v(this,Qe);var G=arguments.length>0?arguments[0]:void 0,W=te(this,new Ge(G));o||(this.size=W.entries.length)},Qe=Le.prototype;if(c(Qe,{append:function(G,W){var X=Q(this);ie(arguments.length,2),ke(X.entries,{key:w(G),value:w(W)}),o||this.length++,X.updateURL()},delete:function($){for(var G=Q(this),W=ie(arguments.length,1),X=G.entries,ue=w($),de=W<2?void 0:arguments[1],ye=de===void 0?de:w(de),we=0;we<X.length;){var Ee=X[we];if(Ee.key===ue&&(ye===void 0||Ee.value===ye)){if(lt(X,we,1),ye!==void 0)break}else we++}o||(this.size=X.length),G.updateURL()},get:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=w(G),ue=0;ue<W.length;ue++)if(W[ue].key===X)return W[ue].value;return null},getAll:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=w(G),ue=[],de=0;de<W.length;de++)W[de].key===X&&ke(ue,W[de].value);return ue},has:function(G){for(var W=Q(this).entries,X=ie(arguments.length,1),ue=w(G),de=X<2?void 0:arguments[1],ye=de===void 0?de:w(de),we=0;we<W.length;){var Ee=W[we++];if(Ee.key===ue&&(ye===void 0||Ee.value===ye))return!0}return!1},set:function(G,W){var X=Q(this);ie(arguments.length,1);for(var ue=X.entries,de=!1,ye=w(G),we=w(W),Ee=0,ze;Ee<ue.length;Ee++)ze=ue[Ee],ze.key===ye&&(de?lt(ue,Ee--,1):(de=!0,ze.value=we));de||ke(ue,{key:ye,value:we}),o||(this.size=ue.length),X.updateURL()},sort:function(){var G=Q(this);D(G.entries,function(W,X){return W.key>X.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=Q(this).entries,X=P(G,arguments.length>1?arguments[1]:void 0),ue=0,de;ue<W.length;)de=W[ue++],X(de.value,de.key,this)},keys:function(){return new je(this,"keys")},values:function(){return new je(this,"values")},entries:function(){return new je(this,"entries")}},{enumerable:!0}),u(Qe,L,Qe.entries,{name:"entries"}),u(Qe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Qe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Le,k),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Le}),!s&&p(F)){var Qt=i(V.has),Er=i(V.set),er=function($){if(g($)){var G=$.body,W;if(y(G)===k)return W=$.headers?new F($.headers):new F,Qt(W,"content-type")||Er(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A($,{body:x(0,w(G)),headers:x(0,W)})}return $};if(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?er(arguments[1]):{})}}),p(q)){var tr=function(G){return v(this,Z),new q(G,arguments.length>1?er(arguments[1]):{})};Z.constructor=tr,tr.prototype=Z,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:tr})}}return qi={URLSearchParams:Le,getState:Q},qi}var Wu;function lp(){return Wu||(Wu=1,gh()),Qs}var Vu={},Ju;function fp(){if(Ju)return Vu;Ju=1;var t=it(),e=be(),r=_t(),n=Xt(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(A,x){l(v,{key:x,value:A})}),n(h,1);for(var p=r(f),m=r(d),P=0,y=0,b=!1,g=v.length,w;P<g;)w=v[P++],b||w.key===p?(b=!0,s(this,w.key)):y++;for(;y<g;)w=v[y++],w.key===p&&w.value===m||o(this,w.key,w.value)},{enumerable:!0,unsafe:!0}),Vu}var Zu={},Yu;function dp(){if(Yu)return Zu;Yu=1;var t=it(),e=be(),r=_t(),n=Xt(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),Zu}var Xu={},Qu;function hp(){if(Qu)return Xu;Qu=1;var t=Me(),e=be(),r=kn(),n=URLSearchParams.prototype,a=e(n.forEach);return t&&!("size"in n)&&r(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Xu}var xi,el;function An(){if(el)return xi;el=1;var t=Se();return xi=t,xi}var $i,tl;function yh(){if(tl)return $i;tl=1,lp(),fp(),dp(),hp();var t=An();return $i=t.URLSearchParams,$i}var rl={},nl={},al={},Di,il;function wh(){if(il)return Di;il=1;var t=be(),e=fs(),r=_t(),n=In(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Di={codeAt:s(!1),charAt:s(!0)},Di}var ol;function bh(){if(ol)return al;ol=1;var t=wh().charAt,e=_t(),r=gr(),n=ph(),a=ws(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),al}var Mi,sl;function vp(){if(sl)return Mi;sl=1;var t=Me(),e=be(),r=He(),n=$e(),a=ah(),i=lh(),o=oh(),s=Pn(),u=Gd(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Mi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(m){d[m]=m}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),m=arguments.length,P=1,y=i.f,b=o.f;m>P;)for(var g=u(arguments[P++]),w=y?f(a(g),y(g)):a(g),A=w.length,x=0,N;A>x;)N=w[x++],(!t||r(b,g,N))&&(p[N]=g[N]);return p}:l,Mi}var Fi,cl;function Sh(){if(cl)return Fi;cl=1;var t=He(),e=st(),r=ls();return Fi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Fi}var Ki,ul;function pp(){if(ul)return Ki;ul=1;var t=st(),e=Sh();return Ki=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Ki}var zi,ll;function Ih(){if(ll)return zi;ll=1;var t=De(),e=Kr(),r=t("iterator"),n=Array.prototype;return zi=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},zi}var Hi,fl;function Ph(){if(fl)return Hi;fl=1;var t=be(),e=$e(),r=Pe(),n=zr(),a=at(),i=ms(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,Hi=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,Hi}var Bi,dl;function mp(){if(dl)return Bi;dl=1;var t=Me(),e=Rt(),r=Zt();return Bi=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},Bi}var Gi,hl;function gp(){if(hl)return Gi;hl=1;var t=wr(),e=He(),r=Pn(),n=pp(),a=Ih(),i=Ph(),o=ds(),s=mp(),u=Ps(),l=On(),c=Array;return Gi=function(h){var d=r(h),v=i(this),p=arguments.length,m=p>1?arguments[1]:void 0,P=m!==void 0;P&&(m=t(m,p>2?arguments[2]:void 0));var y=l(d),b=0,g,w,A,x,N,z;if(y&&!(this===c&&a(y)))for(w=v?new this:[],x=u(d,y),N=x.next;!(A=e(N,x)).done;b++)z=P?n(x,m,[A.value,b],!0):A.value,s(w,b,z);else for(g=o(d),w=v?new this(g):c(g);g>b;b++)z=P?m(d[b],b):d[b],s(w,b,z);return w.length=b,w},Gi}var Wi,vl;function yp(){if(vl)return Wi;vl=1;var t=be(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),m=Math.floor,P=String.fromCharCode,y=t("".charCodeAt),b=t([].join),g=t([].push),w=t("".replace),A=t("".split),x=t("".toLowerCase),N=function(j){for(var D=[],L=0,k=j.length;L<k;){var Y=y(j,L++);if(Y>=55296&&Y<=56319&&L<k){var te=y(j,L++);(te&64512)===56320?g(D,((Y&1023)<<10)+(te&1023)+65536):(g(D,Y),L--)}else g(D,Y)}return D},z=function(j){return j+22+75*(j<26)},B=function(j,D,L){var k=0;for(j=L?m(j/o):j>>1,j+=m(j/D);j>d*a>>1;)j=m(j/d),k+=r;return m(k+(d+1)*j/(j+i))},ie=function(j){var D=[];j=N(j);var L=j.length,k=u,Y=0,te=s,Q,S;for(Q=0;Q<j.length;Q++)S=j[Q],S<128&&g(D,P(S));var _=D.length,q=_;for(_&&g(D,l);q<L;){var F=e;for(Q=0;Q<j.length;Q++)S=j[Q],S>=k&&S<F&&(F=S);var Z=q+1;if(F-k>m((e-Y)/Z))throw new v(h);for(Y+=(F-k)*Z,k=F,Q=0;Q<j.length;Q++){if(S=j[Q],S<k&&++Y>e)throw new v(h);if(S===k){for(var V=Y,he=r;;){var oe=he<=te?n:he>=te+a?a:he-te;if(V<oe)break;var le=V-oe,se=r-oe;g(D,P(z(oe+le%se))),V=m(le/se),he+=r}g(D,P(z(V))),te=B(Y,Z,q===_),Y=0,q++}}Y++,k++}return b(D,"")};return Wi=function(j){var D=[],L=A(w(x(j),f,"."),"."),k,Y;for(k=0;k<L.length;k++)Y=L[k],g(D,p(c,Y)?"xn--"+ie(Y):Y);return b(D,".")},Wi}var pl;function wp(){if(pl)return nl;pl=1,bh();var t=Te(),e=Me(),r=Tn(),n=Se(),a=wr(),i=be(),o=it(),s=kn(),u=Ss(),l=rt(),c=vp(),f=gp(),h=Cn(),d=wh().codeAt,v=yp(),p=_t(),m=yr(),P=Xt(),y=gh(),b=gr(),g=b.set,w=b.getterFor("URL"),A=y.URLSearchParams,x=y.getState,N=n.URL,z=n.TypeError,B=n.parseInt,ie=Math.floor,j=Math.pow,D=i("".charAt),L=i(/./.exec),k=i([].join),Y=i(1.1.toString),te=i([].pop),Q=i([].push),S=i("".replace),_=i([].shift),q=i("".split),F=i("".slice),Z=i("".toLowerCase),V=i([].unshift),he="Invalid authority",oe="Invalid scheme",le="Invalid host",se="Invalid port",Re=/[a-z]/i,Ue=/[\d+-.a-z]/i,Fe=/\d/,ke=/^0x/i,Ze=/^[0-7]+$/,ut=/^\d+$/,lt=/^[\da-f]+$/i,mt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,gt=/[\0\t\n\r #/:<>?@[\\\]^|]/,T=/^[\u0000-\u0020]+/,K=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,J=/[\t\n\r]/g,re,me=function(E){var U=q(E,"."),R,I,O,ce,H,Ie,_e;if(U.length&&U[U.length-1]===""&&U.length--,R=U.length,R>4)return E;for(I=[],O=0;O<R;O++){if(ce=U[O],ce==="")return E;if(H=10,ce.length>1&&D(ce,0)==="0"&&(H=L(ke,ce)?16:8,ce=F(ce,H===8?1:2)),ce==="")Ie=0;else{if(!L(H===10?ut:H===8?Ze:lt,ce))return E;Ie=B(ce,H)}Q(I,Ie)}for(O=0;O<R;O++)if(Ie=I[O],O===R-1){if(Ie>=j(256,5-R))return null}else if(Ie>255)return null;for(_e=te(I),O=0;O<I.length;O++)_e+=I[O]*j(256,3-O);return _e},Ke=function(E){var U=[0,0,0,0,0,0,0,0],R=0,I=null,O=0,ce,H,Ie,_e,Ne,tt,C,Oe=function(){return D(E,O)};if(Oe()===":"){if(D(E,1)!==":")return;O+=2,R++,I=R}for(;Oe();){if(R===8)return;if(Oe()===":"){if(I!==null)return;O++,R++,I=R;continue}for(ce=H=0;H<4&&L(lt,Oe());)ce=ce*16+B(Oe(),16),O++,H++;if(Oe()==="."){if(H===0||(O-=H,R>6))return;for(Ie=0;Oe();){if(_e=null,Ie>0)if(Oe()==="."&&Ie<4)O++;else return;if(!L(Fe,Oe()))return;for(;L(Fe,Oe());){if(Ne=B(Oe(),10),_e===null)_e=Ne;else{if(_e===0)return;_e=_e*10+Ne}if(_e>255)return;O++}U[R]=U[R]*256+_e,Ie++,(Ie===2||Ie===4)&&R++}if(Ie!==4)return;break}else if(Oe()===":"){if(O++,!Oe())return}else if(Oe())return;U[R++]=ce}if(I!==null)for(tt=R-I,R=7;R!==0&&tt>0;)C=U[R],U[R--]=U[I+tt-1],U[I+--tt]=C;else if(R!==8)return;return U},M=function(E){for(var U=null,R=1,I=null,O=0,ce=0;ce<8;ce++)E[ce]!==0?(O>R&&(U=I,R=O),I=null,O=0):(I===null&&(I=ce),++O);return O>R?I:U},ee=function(E){var U,R,I,O;if(typeof E=="number"){for(U=[],R=0;R<4;R++)V(U,E%256),E=ie(E/256);return k(U,".")}if(typeof E=="object"){for(U="",I=M(E),R=0;R<8;R++)O&&E[R]===0||(O&&(O=!1),I===R?(U+=R?":":"::",O=!0):(U+=Y(E[R],16),R<7&&(U+=":")));return"["+U+"]"}return E},fe={},ve=c({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),ge=c({},ve,{"#":1,"?":1,"{":1,"}":1}),Ye=c({},ge,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),je=function(E,U){var R=d(E,0);return R>32&&R<127&&!l(U,E)?E:encodeURIComponent(E)},Ge={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Le=function(E,U){var R;return E.length===2&&L(Re,D(E,0))&&((R=D(E,1))===":"||!U&&R==="|")},Qe=function(E){var U;return E.length>1&&Le(F(E,0,2))&&(E.length===2||(U=D(E,2))==="/"||U==="\\"||U==="?"||U==="#")},Qt=function(E){return E==="."||Z(E)==="%2e"},Er=function(E){return E=Z(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},er={},tr={},$={},G={},W={},X={},ue={},de={},ye={},we={},Ee={},ze={},ft={},Kn={},Gs={},zn={},rr={},dt={},Ws={},Lt={},yt={},Hn=function(E,U,R){var I=p(E),O,ce,H;if(U){if(ce=this.parse(I),ce)throw new z(ce);this.searchParams=null}else{if(R!==void 0&&(O=new Hn(R,!0)),ce=this.parse(I,null,O),ce)throw new z(ce);H=x(new A),H.bindURL(this),this.searchParams=H}};Hn.prototype={type:"URL",parse:function(E,U,R){var I=this,O=U||er,ce=0,H="",Ie=!1,_e=!1,Ne=!1,tt,C,Oe,wt;for(E=p(E),U||(I.scheme="",I.username="",I.password="",I.host=null,I.port=null,I.path=[],I.query=null,I.fragment=null,I.cannotBeABaseURL=!1,E=S(E,T,""),E=S(E,K,"$1")),E=S(E,J,""),tt=f(E);ce<=tt.length;){switch(C=tt[ce],O){case er:if(C&&L(Re,C))H+=Z(C),O=tr;else{if(U)return oe;O=$;continue}break;case tr:if(C&&(L(Ue,C)||C==="+"||C==="-"||C==="."))H+=Z(C);else if(C===":"){if(U&&(I.isSpecial()!==l(Ge,H)||H==="file"&&(I.includesCredentials()||I.port!==null)||I.scheme==="file"&&!I.host))return;if(I.scheme=H,U){I.isSpecial()&&Ge[I.scheme]===I.port&&(I.port=null);return}H="",I.scheme==="file"?O=Kn:I.isSpecial()&&R&&R.scheme===I.scheme?O=G:I.isSpecial()?O=de:tt[ce+1]==="/"?(O=W,ce++):(I.cannotBeABaseURL=!0,Q(I.path,""),O=Ws)}else{if(U)return oe;H="",O=$,ce=0;continue}break;case $:if(!R||R.cannotBeABaseURL&&C!=="#")return oe;if(R.cannotBeABaseURL&&C==="#"){I.scheme=R.scheme,I.path=h(R.path),I.query=R.query,I.fragment="",I.cannotBeABaseURL=!0,O=yt;break}O=R.scheme==="file"?Kn:X;continue;case G:if(C==="/"&&tt[ce+1]==="/")O=ye,ce++;else{O=X;continue}break;case W:if(C==="/"){O=we;break}else{O=dt;continue}case X:if(I.scheme=R.scheme,C===re)I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query;else if(C==="/"||C==="\\"&&I.isSpecial())O=ue;else if(C==="?")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query="",O=Lt;else if(C==="#")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query,I.fragment="",O=yt;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.path.length--,O=dt;continue}break;case ue:if(I.isSpecial()&&(C==="/"||C==="\\"))O=ye;else if(C==="/")O=we;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,O=dt;continue}break;case de:if(O=ye,C!=="/"||D(H,ce+1)!=="/")continue;ce++;break;case ye:if(C!=="/"&&C!=="\\"){O=we;continue}break;case we:if(C==="@"){Ie&&(H="%40"+H),Ie=!0,Oe=f(H);for(var Bn=0;Bn<Oe.length;Bn++){var Zs=Oe[Bn];if(Zs===":"&&!Ne){Ne=!0;continue}var Ys=je(Zs,Ye);Ne?I.password+=Ys:I.username+=Ys}H=""}else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()){if(Ie&&H==="")return he;ce-=f(H).length+1,H="",O=Ee}else H+=C;break;case Ee:case ze:if(U&&I.scheme==="file"){O=zn;continue}else if(C===":"&&!_e){if(H==="")return le;if(wt=I.parseHost(H),wt)return wt;if(H="",O=ft,U===ze)return}else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()){if(I.isSpecial()&&H==="")return le;if(U&&H===""&&(I.includesCredentials()||I.port!==null))return;if(wt=I.parseHost(H),wt)return wt;if(H="",O=rr,U)return;continue}else C==="["?_e=!0:C==="]"&&(_e=!1),H+=C;break;case ft:if(L(Fe,C))H+=C;else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()||U){if(H!==""){var Gn=B(H,10);if(Gn>65535)return se;I.port=I.isSpecial()&&Gn===Ge[I.scheme]?null:Gn,H=""}if(U)return;O=rr;continue}else return se;break;case Kn:if(I.scheme="file",C==="/"||C==="\\")O=Gs;else if(R&&R.scheme==="file")switch(C){case re:I.host=R.host,I.path=h(R.path),I.query=R.query;break;case"?":I.host=R.host,I.path=h(R.path),I.query="",O=Lt;break;case"#":I.host=R.host,I.path=h(R.path),I.query=R.query,I.fragment="",O=yt;break;default:Qe(k(h(tt,ce),""))||(I.host=R.host,I.path=h(R.path),I.shortenPath()),O=dt;continue}else{O=dt;continue}break;case Gs:if(C==="/"||C==="\\"){O=zn;break}R&&R.scheme==="file"&&!Qe(k(h(tt,ce),""))&&(Le(R.path[0],!0)?Q(I.path,R.path[0]):I.host=R.host),O=dt;continue;case zn:if(C===re||C==="/"||C==="\\"||C==="?"||C==="#"){if(!U&&Le(H))O=dt;else if(H===""){if(I.host="",U)return;O=rr}else{if(wt=I.parseHost(H),wt)return wt;if(I.host==="localhost"&&(I.host=""),U)return;H="",O=rr}continue}else H+=C;break;case rr:if(I.isSpecial()){if(O=dt,C!=="/"&&C!=="\\")continue}else if(!U&&C==="?")I.query="",O=Lt;else if(!U&&C==="#")I.fragment="",O=yt;else if(C!==re&&(O=dt,C!=="/"))continue;break;case dt:if(C===re||C==="/"||C==="\\"&&I.isSpecial()||!U&&(C==="?"||C==="#")){if(Er(H)?(I.shortenPath(),C!=="/"&&!(C==="\\"&&I.isSpecial())&&Q(I.path,"")):Qt(H)?C!=="/"&&!(C==="\\"&&I.isSpecial())&&Q(I.path,""):(I.scheme==="file"&&!I.path.length&&Le(H)&&(I.host&&(I.host=""),H=D(H,0)+":"),Q(I.path,H)),H="",I.scheme==="file"&&(C===re||C==="?"||C==="#"))for(;I.path.length>1&&I.path[0]==="";)_(I.path);C==="?"?(I.query="",O=Lt):C==="#"&&(I.fragment="",O=yt)}else H+=je(C,ge);break;case Ws:C==="?"?(I.query="",O=Lt):C==="#"?(I.fragment="",O=yt):C!==re&&(I.path[0]+=je(C,fe));break;case Lt:!U&&C==="#"?(I.fragment="",O=yt):C!==re&&(C==="'"&&I.isSpecial()?I.query+="%27":C==="#"?I.query+="%23":I.query+=je(C,fe));break;case yt:C!==re&&(I.fragment+=je(C,ve));break}ce++}},parseHost:function(E){var U,R,I;if(D(E,0)==="["){if(D(E,E.length-1)!=="]"||(U=Ke(F(E,1,-1)),!U))return le;this.host=U}else if(this.isSpecial()){if(E=v(E),L(mt,E)||(U=me(E),U===null))return le;this.host=U}else{if(L(gt,E))return le;for(U="",R=f(E),I=0;I<R.length;I++)U+=je(R[I],fe);this.host=U}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Ge,this.scheme)},shortenPath:function(){var E=this.path,U=E.length;U&&(this.scheme!=="file"||U!==1||!Le(E[0],!0))&&E.length--},serialize:function(){var E=this,U=E.scheme,R=E.username,I=E.password,O=E.host,ce=E.port,H=E.path,Ie=E.query,_e=E.fragment,Ne=U+":";return O!==null?(Ne+="//",E.includesCredentials()&&(Ne+=R+(I?":"+I:"")+"@"),Ne+=ee(O),ce!==null&&(Ne+=":"+ce)):U==="file"&&(Ne+="//"),Ne+=E.cannotBeABaseURL?H[0]:H.length?"/"+k(H,"/"):"",Ie!==null&&(Ne+="?"+Ie),_e!==null&&(Ne+="#"+_e),Ne},setHref:function(E){var U=this.parse(E);if(U)throw new z(U);this.searchParams.update()},getOrigin:function(){var E=this.scheme,U=this.port;if(E==="blob")try{return new nr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+ee(this.host)+(U!==null?":"+U:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",er)},getUsername:function(){return this.username},setUsername:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var R=0;R<U.length;R++)this.username+=je(U[R],Ye)}},getPassword:function(){return this.password},setPassword:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var R=0;R<U.length;R++)this.password+=je(U[R],Ye)}},getHost:function(){var E=this.host,U=this.port;return E===null?"":U===null?ee(E):ee(E)+":"+U},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Ee)},getHostname:function(){var E=this.host;return E===null?"":ee(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,ze)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,ft))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+k(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,rr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(D(E,0)==="?"&&(E=F(E,1)),this.query="",this.parse(E,Lt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}D(E,0)==="#"&&(E=F(E,1)),this.fragment="",this.parse(E,yt)},update:function(){this.query=this.searchParams.serialize()||null}};var nr=function(U){var R=u(this,Be),I=P(arguments.length,1)>1?arguments[1]:void 0,O=g(R,new Hn(U,!1,I));e||(R.href=O.serialize(),R.origin=O.getOrigin(),R.protocol=O.getProtocol(),R.username=O.getUsername(),R.password=O.getPassword(),R.host=O.getHost(),R.hostname=O.getHostname(),R.port=O.getPort(),R.pathname=O.getPathname(),R.search=O.getSearch(),R.searchParams=O.getSearchParams(),R.hash=O.getHash())},Be=nr.prototype,et=function(E,U){return{get:function(){return w(this)[E]()},set:U&&function(R){return w(this)[U](R)},configurable:!0,enumerable:!0}};if(e&&(s(Be,"href",et("serialize","setHref")),s(Be,"origin",et("getOrigin")),s(Be,"protocol",et("getProtocol","setProtocol")),s(Be,"username",et("getUsername","setUsername")),s(Be,"password",et("getPassword","setPassword")),s(Be,"host",et("getHost","setHost")),s(Be,"hostname",et("getHostname","setHostname")),s(Be,"port",et("getPort","setPort")),s(Be,"pathname",et("getPathname","setPathname")),s(Be,"search",et("getSearch","setSearch")),s(Be,"searchParams",et("getSearchParams")),s(Be,"hash",et("getHash","setHash"))),o(Be,"toJSON",function(){return w(this).serialize()},{enumerable:!0}),o(Be,"toString",function(){return w(this).serialize()},{enumerable:!0}),N){var Vs=N.createObjectURL,Js=N.revokeObjectURL;Vs&&o(nr,"createObjectURL",a(Vs,N)),Js&&o(nr,"revokeObjectURL",a(Js,N))}return m(nr,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:nr}),nl}var ml;function bp(){return ml||(ml=1,wp()),rl}var gl={},yl;function Sp(){if(yl)return gl;yl=1;var t=Te(),e=at(),r=$e(),n=Xt(),a=_t(),i=Tn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),gl}var wl={},bl;function Ip(){if(bl)return wl;bl=1;var t=Te(),e=at(),r=Xt(),n=_t(),a=Tn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),wl}var Sl={},Il;function Pp(){if(Il)return Sl;Il=1;var t=Te(),e=He();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Sl}var Vi,Pl;function Ep(){if(Pl)return Vi;Pl=1,yh(),bp(),Sp(),Ip(),Pp();var t=An();return Vi=t.URL,Vi}var Ji,El;function Rp(){if(El)return Ji;El=1;var t=Ep();return Ji=t,Ji}var Zi,Rl;function _p(){if(Rl)return Zi;Rl=1;var t=Rp();return Zi=t,Zi}_p();var _l={},Yi,Tl;function Tp(){return Tl||(Tl=1,Yi={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}),Yi}var Xi,kl;function kp(){if(kl)return Xi;kl=1;var t=En(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return Xi=r===Object.prototype?void 0:r,Xi}var Ol;function Eh(){if(Ol)return _l;Ol=1;var t=Se(),e=Tp(),r=kp(),n=bs(),a=Yt(),i=yr(),o=De(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),_l}var Qi,Cl;function Op(){if(Cl)return Qi;Cl=1;var t=yh();return Eh(),Qi=t,Qi}var eo,Al;function Cp(){if(Al)return eo;Al=1;var t=Op();return eo=t,eo}Cp();var Ul={},jl={},to,Ll;function Ap(){if(Ll)return to;Ll=1;var t=nt(),e=Yt();return to=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},to}var ro,Nl;function Up(){if(Nl)return ro;Nl=1;var t=be(),e=Error,r=t("".replace),n=(function(o){return String(new e(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return ro=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},ro}var no,ql;function jp(){if(ql)return no;ql=1;var t=$e(),e=Zt();return no=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),no}var ao,xl;function Lp(){if(xl)return ao;xl=1;var t=Yt(),e=Up(),r=jp(),n=Error.captureStackTrace;return ao=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},ao}var io,$l;function Hr(){if($l)return io;$l=1;var t=wr(),e=He(),r=st(),n=_n(),a=Ih(),i=ds(),o=Rn(),s=Ps(),u=On(),l=Sh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return io=function(d,v,p){var m=p&&p.that,P=!!(p&&p.AS_ENTRIES),y=!!(p&&p.IS_RECORD),b=!!(p&&p.IS_ITERATOR),g=!!(p&&p.INTERRUPTED),w=t(v,m),A,x,N,z,B,ie,j,D=function(k){return A&&l(A,"normal"),new f(!0,k)},L=function(k){return P?(r(k),g?w(k[0],k[1],D):w(k[0],k[1])):g?w(k,D):w(k)};if(y)A=d.iterator;else if(b)A=d;else{if(x=u(d),!x)throw new c(n(d)+" is not iterable");if(a(x)){for(N=0,z=i(d);z>N;N++)if(B=L(d[N]),B&&o(h,B))return B;return new f(!1)}A=s(d,x)}for(ie=y?d.next:A.next;!(j=e(ie,A)).done;){try{B=L(j.value)}catch(k){l(A,"throw",k)}if(typeof B=="object"&&B&&o(h,B))return B}return new f(!1)},io}var oo,Dl;function Np(){if(Dl)return oo;Dl=1;var t=_t();return oo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},oo}var Ml;function qp(){if(Ml)return jl;Ml=1;var t=Te(),e=Rn(),r=gs(),n=ys(),a=fh(),i=Fr(),o=Yt(),s=Zt(),u=Ap(),l=Lp(),c=Hr(),f=Np(),h=De(),d=h("toStringTag"),v=Error,p=[].push,m=function(b,g){var w=e(P,this),A;n?A=n(new v,w?r(this):P):(A=w?this:i(P),o(A,d,"Error")),g!==void 0&&o(A,"message",f(g)),l(A,m,A.stack,1),arguments.length>2&&u(A,arguments[2]);var x=[];return c(b,p,{that:x}),o(A,"errors",x),A};n?n(m,v):a(m,v,{name:!0});var P=m.prototype=i(v.prototype,{constructor:s(1,m),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:m}),jl}var Fl;function xp(){return Fl||(Fl=1,qp()),Ul}var Kl={},so,zl;function $p(){if(zl)return so;zl=1;var t=Is(),e=zr();return so=t?{}.toString:function(){return"[object "+e(this)+"]"},so}var Hl;function Dp(){if(Hl)return Kl;Hl=1;var t=Is(),e=it(),r=$p();return t||e(Object.prototype,"toString",r,{unsafe:!0}),Kl}var Bl={},Gl={},co,Wl;function Rh(){if(Wl)return co;Wl=1;var t=Se(),e=Mr(),r=bn(),n=function(a){return e.slice(0,a.length)===a};return co=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),co}var uo,Vl;function Es(){if(Vl)return uo;Vl=1;var t=Rh();return uo=t==="NODE",uo}var lo,Jl;function Mp(){if(Jl)return lo;Jl=1;var t=at(),e=kn(),r=De(),n=Me(),a=r("species");return lo=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},lo}var fo,Zl;function Fp(){if(Zl)return fo;Zl=1;var t=Ph(),e=_n(),r=TypeError;return fo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},fo}var ho,Yl;function _h(){if(Yl)return ho;Yl=1;var t=st(),e=Fp(),r=Sn(),n=De(),a=n("species");return ho=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},ho}var vo,Xl;function Th(){if(Xl)return vo;Xl=1;var t=wn(),e=Function.prototype,r=e.apply,n=e.call;return vo=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),vo}var po,Ql;function kh(){if(Ql)return po;Ql=1;var t=Mr();return po=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),po}var mo,ef;function Oh(){if(ef)return mo;ef=1;var t=Se(),e=Th(),r=wr(),n=Pe(),a=rt(),i=$e(),o=ih(),s=Cn(),u=En(),l=Xt(),c=kh(),f=Es(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,m=t.Function,P=t.MessageChannel,y=t.String,b=0,g={},w="onreadystatechange",A,x,N,z;i(function(){A=t.location});var B=function(L){if(a(g,L)){var k=g[L];delete g[L],k()}},ie=function(L){return function(){B(L)}},j=function(L){B(L.data)},D=function(L){t.postMessage(y(L),A.protocol+"//"+A.host)};return(!h||!d)&&(h=function(k){l(arguments.length,1);var Y=n(k)?k:m(k),te=s(arguments,1);return g[++b]=function(){e(Y,void 0,te)},x(b),b},d=function(k){delete g[k]},f?x=function(L){v.nextTick(ie(L))}:p&&p.now?x=function(L){p.now(ie(L))}:P&&!c?(N=new P,z=N.port2,N.port1.onmessage=j,x=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&A&&A.protocol!=="file:"&&!i(D)?(x=D,t.addEventListener("message",j,!1)):w in u("script")?x=function(L){o.appendChild(u("script"))[w]=function(){o.removeChild(this),B(L)}}:x=function(L){setTimeout(ie(L),0)}),mo={set:h,clear:d},mo}var go,tf;function Ch(){if(tf)return go;tf=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(e){var r={item:e,next:null},n=this.tail;n?n.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},go=t,go}var yo,rf;function Kp(){if(rf)return yo;rf=1;var t=Mr();return yo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",yo}var wo,nf;function zp(){if(nf)return wo;nf=1;var t=Mr();return wo=/web0s(?!.*chrome)/i.test(t),wo}var bo,af;function Hp(){if(af)return bo;af=1;var t=Se(),e=mh(),r=wr(),n=Oh().set,a=Ch(),i=kh(),o=Kp(),s=zp(),u=Es(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,m,P,y;if(!d){var b=new a,g=function(){var w,A;for(u&&(w=f.domain)&&w.exit();A=b.get();)try{A()}catch(x){throw b.head&&v(),x}w&&w.enter()};!i&&!u&&!s&&l&&c?(p=!0,m=c.createTextNode(""),new l(g).observe(m,{characterData:!0}),v=function(){m.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,y=r(P.then,P),v=function(){y(g)}):u?v=function(){f.nextTick(g)}:(n=r(n,t),v=function(){n(g)}),d=function(w){b.head||v(),b.add(w)}}return bo=d,bo}var So,of;function Bp(){return of||(of=1,So=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),So}var Io,sf;function br(){return sf||(sf=1,Io=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Io}var Po,cf;function Sr(){if(cf)return Po;cf=1;var t=Se();return Po=t.Promise,Po}var Eo,uf;function Br(){if(uf)return Eo;uf=1;var t=Se(),e=Sr(),r=Pe(),n=dh(),a=ms(),i=De(),o=Rh(),s=pt(),u=Jd(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var m=new e(function(b){b(1)}),P=function(b){b(function(){},function(){})},y=m.constructor={};if(y[c]=P,f=m.then(function(){})instanceof P,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return Eo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},Eo}var Ro={},lf;function Tt(){if(lf)return Ro;lf=1;var t=ct(),e=TypeError,r=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new e("Bad Promise constructor");a=o,i=s}),this.resolve=t(a),this.reject=t(i)};return Ro.f=function(n){return new r(n)},Ro}var ff;function Gp(){if(ff)return Gl;ff=1;var t=Te(),e=pt(),r=Es(),n=Se(),a=An(),i=He(),o=it(),s=ys(),u=yr(),l=Mp(),c=ct(),f=Pe(),h=nt(),d=Ss(),v=_h(),p=Oh().set,m=Hp(),P=Bp(),y=br(),b=Ch(),g=gr(),w=Sr(),A=Br(),x=Tt(),N="Promise",z=A.CONSTRUCTOR,B=A.REJECTION_EVENT,ie=A.SUBCLASSING,j=g.getterFor(N),D=g.set,L=w&&w.prototype,k=w,Y=L,te=n.TypeError,Q=n.document,S=n.process,_=x.f,q=_,F=!!(Q&&Q.createEvent&&n.dispatchEvent),Z="unhandledrejection",V="rejectionhandled",he=0,oe=1,le=2,se=1,Re=2,Ue,Fe,ke,Ze,ut=function(M){var ee;return h(M)&&f(ee=M.then)?ee:!1},lt=function(M,ee){var fe=ee.value,ve=ee.state===oe,ge=ve?M.ok:M.fail,Ye=M.resolve,je=M.reject,Ge=M.domain,Le,Qe,Qt;try{ge?(ve||(ee.rejection===Re&&J(ee),ee.rejection=se),ge===!0?Le=fe:(Ge&&Ge.enter(),Le=ge(fe),Ge&&(Ge.exit(),Qt=!0)),Le===M.promise?je(new te("Promise-chain cycle")):(Qe=ut(Le))?i(Qe,Le,Ye,je):Ye(Le)):je(fe)}catch(Er){Ge&&!Qt&&Ge.exit(),je(Er)}},mt=function(M,ee){M.notified||(M.notified=!0,m(function(){for(var fe=M.reactions,ve;ve=fe.get();)lt(ve,M);M.notified=!1,ee&&!M.rejection&&T(M)}))},gt=function(M,ee,fe){var ve,ge;F?(ve=Q.createEvent("Event"),ve.promise=ee,ve.reason=fe,ve.initEvent(M,!1,!0),n.dispatchEvent(ve)):ve={promise:ee,reason:fe},!B&&(ge=n["on"+M])?ge(ve):M===Z&&P("Unhandled promise rejection",fe)},T=function(M){i(p,n,function(){var ee=M.facade,fe=M.value,ve=K(M),ge;if(ve&&(ge=y(function(){r?S.emit("unhandledRejection",fe,ee):gt(Z,ee,fe)}),M.rejection=r||K(M)?Re:se,ge.error))throw ge.value})},K=function(M){return M.rejection!==se&&!M.parent},J=function(M){i(p,n,function(){var ee=M.facade;r?S.emit("rejectionHandled",ee):gt(V,ee,M.value)})},re=function(M,ee,fe){return function(ve){M(ee,ve,fe)}},me=function(M,ee,fe){M.done||(M.done=!0,fe&&(M=fe),M.value=ee,M.state=le,mt(M,!0))},Ke=function(M,ee,fe){if(!M.done){M.done=!0,fe&&(M=fe);try{if(M.facade===ee)throw new te("Promise can't be resolved itself");var ve=ut(ee);ve?m(function(){var ge={done:!1};try{i(ve,ee,re(Ke,ge,M),re(me,ge,M))}catch(Ye){me(ge,Ye,M)}}):(M.value=ee,M.state=oe,mt(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(z&&(k=function(ee){d(this,Y),c(ee),i(Ue,this);var fe=j(this);try{ee(re(Ke,fe),re(me,fe))}catch(ve){me(fe,ve)}},Y=k.prototype,Ue=function(ee){D(this,{type:N,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:he,value:null})},Ue.prototype=o(Y,"then",function(ee,fe){var ve=j(this),ge=_(v(this,k));return ve.parent=!0,ge.ok=f(ee)?ee:!0,ge.fail=f(fe)&&fe,ge.domain=r?S.domain:void 0,ve.state===he?ve.reactions.add(ge):m(function(){lt(ge,ve)}),ge.promise}),Fe=function(){var M=new Ue,ee=j(M);this.promise=M,this.resolve=re(Ke,ee),this.reject=re(me,ee)},x.f=_=function(M){return M===k||M===ke?new Fe(M):q(M)},!e&&f(w)&&L!==Object.prototype)){Ze=L.then,ie||o(L,"then",function(ee,fe){var ve=this;return new k(function(ge,Ye){i(Ze,ve,ge,Ye)}).then(ee,fe)},{unsafe:!0});try{delete L.constructor}catch{}s&&s(L,Y)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:k}),ke=a.Promise,u(k,N,!1,!0),l(N),Gl}var df={},_o,hf;function Wp(){if(hf)return _o;hf=1;var t=De(),e=t("iterator"),r=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){r=!0}};a[e]=function(){return this},Array.from(a,function(){throw 2})}catch{}return _o=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},_o}var To,vf;function Un(){if(vf)return To;vf=1;var t=Sr(),e=Wp(),r=Br().CONSTRUCTOR;return To=r||!e(function(n){t.all(n).then(void 0,function(){})}),To}var pf;function Vp(){if(pf)return df;pf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],m=0,P=1;i(u,function(y){var b=m++,g=!1;P++,e(v,l,y).then(function(w){g||(g=!0,p[b]=w,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),df}var mf={},gf;function Jp(){if(gf)return mf;gf=1;var t=Te(),e=pt(),r=Br().CONSTRUCTOR,n=Sr(),a=at(),i=Pe(),o=it(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return mf}var yf={},wf;function Zp(){if(wf)return yf;wf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),yf}var bf={},Sf;function Yp(){if(Sf)return bf;Sf=1;var t=Te(),e=Tt(),r=Br().CONSTRUCTOR;return t({target:"Promise",stat:!0,forced:r},{reject:function(a){var i=e.f(this),o=i.reject;return o(a),i.promise}}),bf}var If={},ko,Pf;function Ah(){if(Pf)return ko;Pf=1;var t=st(),e=nt(),r=Tt();return ko=function(n,a){if(t(n),e(a)&&a.constructor===n)return a;var i=r.f(n),o=i.resolve;return o(a),i.promise},ko}var Ef;function Xp(){if(Ef)return If;Ef=1;var t=Te(),e=at(),r=pt(),n=Sr(),a=Br().CONSTRUCTOR,i=Ah(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),If}var Rf;function Qp(){return Rf||(Rf=1,Gp(),Vp(),Jp(),Zp(),Yp(),Xp()),Bl}var _f={},Tf;function em(){if(Tf)return _f;Tf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],m=0,P=1;i(u,function(y){var b=m++,g=!1;P++,e(v,l,y).then(function(w){g||(g=!0,p[b]={status:"fulfilled",value:w},--P||f(p))},function(w){g||(g=!0,p[b]={status:"rejected",reason:w},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),_f}var kf={},Of;function tm(){if(Of)return kf;Of=1;var t=Te(),e=He(),r=ct(),n=at(),a=Tt(),i=br(),o=Hr(),s=Un(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,m=i(function(){var P=r(f.resolve),y=[],b=0,g=1,w=!1;o(c,function(A){var x=b++,N=!1;g++,e(P,f,A).then(function(z){N||w||(w=!0,v(z))},function(z){N||w||(N=!0,y[x]=z,--g||p(new h(y,u)))})}),--g||p(new h(y,u))});return m.error&&p(m.value),d.promise}}),kf}var Cf={},Af;function Uh(){if(Af)return Cf;Af=1;var t=Te(),e=Se(),r=Th(),n=Cn(),a=Tt(),i=ct(),o=br(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Cf}var Uf={},jf;function jh(){if(jf)return Uf;jf=1;var t=Te(),e=Tt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Uf}var Lf={},Nf;function rm(){if(Nf)return Lf;Nf=1;var t=Te(),e=pt(),r=Sr(),n=$e(),a=at(),i=Pe(),o=_h(),s=Ah(),u=it(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Lf}var Oo,qf;function nm(){if(qf)return Oo;qf=1,xp(),bs(),Dp(),Qp(),em(),tm(),Uh(),jh(),rm(),bh();var t=An();return Oo=t.Promise,Oo}var Co,xf;function am(){if(xf)return Co;xf=1;var t=nm();return Eh(),Co=t,Co}var $f={},Df;function im(){return Df||(Df=1,Uh()),$f}var Mf={},Ff;function om(){return Ff||(Ff=1,jh()),Mf}var Ao,Kf;function sm(){if(Kf)return Ao;Kf=1;var t=am();return im(),om(),Ao=t,Ao}sm();const Lh="sesamy-debug";function cm(t,e,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${t}=${e}; ${a}; path=/`}function um(t){if(typeof document>"u")return null;const e=t+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null}function lm(t){cm(Lh,t.toString(),1)}function fm(){return um(Lh)==="true"}function pe(t){fm()&&console.log(t)}function jt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});pe(`Triggering event: ${t}`),dispatchEvent(r)}function vt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r}var $t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _s(t,e){return t(e={exports:{}},e.exports),e.exports}var qt=_s((function(t,e){Object.defineProperty(e,"__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})();e.default=function(){return r.getInstance()}}));Rs(qt);var dm=Rs(_s((function(t,e){var r=$t&&$t.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function m(b){try{y(d.next(b))}catch(g){p(g)}}function P(b){try{y(d.throw(b))}catch(g){p(g)}}function y(b){b.done?v(b.value):new h((function(g){g(b.value)})).then(m,P)}y((d=d.apply(c,f||[])).next())}))},n=$t&&$t.__generator||function(c,f){var h,d,v,p,m={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function P(y){return function(b){return(function(g){if(h)throw new TypeError("Generator is already executing.");for(;m;)try{if(h=1,d&&(v=2&g[0]?d.return:g[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,g[1])).done)return v;switch(d=0,v&&(g=[2&g[0],v.value]),g[0]){case 0:case 1:v=g;break;case 4:return m.label++,{value:g[1],done:!1};case 5:m.label++,d=g[1],g=[0];continue;case 7:g=m.ops.pop(),m.trys.pop();continue;default:if(v=m.trys,!((v=v.length>0&&v[v.length-1])||g[0]!==6&&g[0]!==2)){m=0;continue}if(g[0]===3&&(!v||g[1]>v[0]&&g[1]<v[3])){m.label=g[1];break}if(g[0]===6&&m.label<v[1]){m.label=v[1],v=g;break}if(v&&m.label<v[2]){m.label=v[2],m.ops.push(g);break}v[2]&&m.ops.pop(),m.trys.pop();continue}g=f.call(c,m)}catch(w){g=[6,w],d=0}finally{h=v=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}})([y,b])}}},a=$t;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){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=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,p,m,P,y,b;return n(this,(function(g){switch(g.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,m=this.storageHandler===void 0?o:this.storageHandler,g.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return g.sent(),m.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return g.sent(),m.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return g.sent(),(y=m.getItemSync(p))!==null&&(b=JSON.parse(y)).id===this.id&&b.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:g.sent(),g.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,m,P;return n(this,(function(y){switch(y.label){case 0:return[4,qt.default().lock(h)];case 1:return y.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(m=p.getItemSync(f))===null?(qt.default().unlock(h),[2]):((P=JSON.parse(m)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),qt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(qt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),m=!1;function P(){if(m||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(y),m=!0),!v){v=!0;var b=50-(Date.now()-p);b>0?setTimeout(d,b):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var y=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,p;return n(this,(function(m){switch(m.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,qt.default().lock(p.iat)];case 1:m.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),qt.default().unlock(p.iat),c.notifyWaiters(),m.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var m=d.keySync(p);if(m===null)break;v.push(m),p++}for(var P=!1,y=0;y<v.length;y++){var b=v[y];if(b.includes(i)){var g=d.getItemSync(b);if(g!==null){var w=JSON.parse(g);(w.timeRefreshed===void 0&&w.timeAcquired<h||w.timeRefreshed!==void 0&&w.timeRefreshed<h)&&(d.removeItemSync(b),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const hm={timeoutInSeconds:60},Nh={name:"auth0-spa-js",version:"2.8.0"},qh=()=>Date.now();let Ae=class Bo extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,Bo.prototype)}static fromPayload({error:e,error_description:r}){return new Bo(e,r)}},vm=class xh extends Ae{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,xh.prototype)}},pm=class $h extends Ae{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,$h.prototype)}},Go=class Dh extends Ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Dh.prototype)}};class Ts extends Go{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Ts.prototype)}}let mm=class Mh extends Ae{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,Mh.prototype)}},gm=class Fh extends Ae{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,Fh.prototype)}},Kh=class zh extends Ae{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${cn(e,["default"])}', scope: '${cn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,zh.prototype)}},ym=class Hh extends Ae{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${cn(e,["default"])}', missing scope: '${cn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,Hh.prototype)}},Bh=class Gh extends Ae{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,Gh.prototype)}};function cn(t,e=[]){return t&&!e.includes(t)?t:""}const un=()=>window.crypto,_r=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(un().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Uo=t=>btoa(t),wm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],bm=t=>Object.keys(t).reduce(((e,r)=>{const n=wm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),Wo=t=>{var{clientId:e}=t,r=vt(t,["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:e},r))).toString()},zf=async t=>await un().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),Hf=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),Bf=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Sm=new TextEncoder,Im=new TextDecoder;function Ur(t){return typeof t=="string"?Sm.encode(t):Im.decode(t)}function Gf(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Em(`${t.name} modulusLength must be at least 2048 bits`)}async function Pm(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${jr(Ur(JSON.stringify(t)))}.${jr(Ur(JSON.stringify(e)))}`;return`${n}.${jr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Gf(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Gf(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Ft})(r),r,Ur(n)))}`}let Vo;Uint8Array.prototype.toBase64?Vo=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):Vo=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function jr(t){return Vo(t)}let Ft=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},Em=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function Rm(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Ft("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Ft("unsupported CryptoKey algorithm name")}}function Wh(t){return t instanceof CryptoKey}function Vh(t){return Wh(t)&&t.type==="public"}async function _m(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!Wh(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!Vh(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Pm({alg:Rm(o),typ:"dpop+jwt",jwk:await Jh(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?jr(await crypto.subtle.digest("SHA-256",Ur(a))):void 0}),o)}async function Jh(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const Tm=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function km(){return(async function(t,e){var r;let n;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new Ft}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function Om(t){return(async function(e){if(!Vh(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await Jh(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Ft("unsupported JWK kty")}return jr(await crypto.subtle.digest({name:"SHA-256"},Ur(JSON.stringify(n))))})(t.publicKey)}function Cm({keyPair:t,url:e,method:r,nonce:n,accessToken:a}){const i=(function(o){const s=new URL(o);return s.search="",s.hash="",s.href})(e);return _m(t,i,r,n,a)}const Am=async(t,e)=>{const r=await fetch(t,e);return{ok:r.ok,json:await r.json(),headers:(n=r.headers,[...n].reduce(((a,[i,o])=>(a[i]=o,a)),{}))};var n},Um=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([Am(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},jm=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},Lm=async(t,e,r,n,a,i,o=1e4,s)=>a?jm(t,e,r,n,o,a,i,s):Um(t,n,o);async function Zh(t,e,r,n,a,i,o,s,u,l){if(u){const b=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:b})}let c,f=null;for(let b=0;b<3;b++)try{c=await Lm(t,r,n,a,i,o,e,s),f=null;break}catch(g){f=g}if(f)throw f;const h=c.json,{error:d,error_description:v}=h,p=vt(h,["error","error_description"]),{headers:m,ok:P}=c;let y;if(u&&(y=m["dpop-nonce"],y&&await u.setNonce(y)),!P){const b=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new gm(d,b,p.mfa_token);if(d==="missing_refresh_token")throw new Kh(r,n);if(d==="use_dpop_nonce"){if(!u||!y||l)throw new Bh(y);return Zh(t,e,r,n,a,i,o,s,u,!0)}throw new Ae(d||"request_error",b)}return p}async function Nm(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=vt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?Wo(d):JSON.stringify(d),p=(m=c.grant_type,Tm.includes(m));var m;return await Zh(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(bm(o||Nh)))}},e,s,u,p?l:void 0)}const tn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},Wr=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),tn(n,e)};let St=class Jo{constructor(e,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[r,n,a,i]=e.split("::");return new Jo({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new Jo({scope:r,audience:n,clientId:a})}},qm=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},Yh=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},xm=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||qh}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);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(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);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(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new St({clientId:e.client_id,scope:e.scope,audience:e.audience}),a=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async remove(e,r,n){const a=new St({clientId:e,scope:n,audience:r});await this.cache.remove(a.toKey())}async clear(e){var r;const n=await this.getCacheKeys();n&&(await n.filter((a=>!e||a.includes(e))).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(e){const r=await this.nowProvider();return{body:e,expiresAt:Math.floor(r/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new St({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=St.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=St.fromKey(a);if(i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId){const o=await this.cache.get(a);if(!((n=o?.body)===null||n===void 0)&&n.refresh_token)return this.modifiedCachedEntry(o,e)}}}async updateEntry(e,r){var n;const a=await this.getCacheKeys();if(a)for(const i of a){const o=await this.cache.get(i);if(((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e){const s=Object.assign(Object.assign({},o.body),{refresh_token:r});await this.set(s)}}}},$m=class{constructor(e,r,n){this.storage=e,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const Tr=t=>typeof t=="number",Dm=["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"],Mm=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(Hf(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],Dm.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(Hf(s)),claims:f,user:h}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.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(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!Tr(e.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(e.claims.exp==null||!Tr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Tr(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=t.leeway||60,n=new Date(t.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(e.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(e.claims.nbf!=null&&Tr(e.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(e.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(e.claims.auth_time!=null&&Tr(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.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(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const o=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_id}"`)}else{const o=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_name}"`)}}return e};var Kt=_s((function(t,e){var r=$t&&$t.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Rs(Kt),Kt.encode,Kt.parse,Kt.getAll;var Fm=Kt.get,Xh=Kt.set,Qh=Kt.remove;const ar={get(t){const e=Fm(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Xh(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Qh(t,r)}},Km={get(t){return ar.get(t)||ar.get(`_legacy_${t}`)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Xh(`_legacy_${t}`,JSON.stringify(e),n),ar.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Qh(t,r),ar.remove(t,e),ar.remove(`_legacy_${t}`,e)}},zm={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Dt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Dt||(Dt={}));function Hm(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,r!==void 0&&r),i=a.indexOf(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Ce=require("@sesamy/sdk");var Xs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Qs={},Wn,ec;function $e(){return ec||(ec=1,Wn=function(t){try{return!!t()}catch{return!0}}),Wn}var Vn,tc;function wn(){if(tc)return Vn;tc=1;var t=$e();return Vn=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),Vn}var Jn,rc;function be(){if(rc)return Jn;rc=1;var t=wn(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return Jn=t?n:function(a){return function(){return r.apply(a,arguments)}},Jn}var Zn,nc;function bn(){if(nc)return Zn;nc=1;var t=be(),e=t({}.toString),r=t("".slice);return Zn=function(n){return r(e(n),8,-1)},Zn}var Yn,ac;function Gd(){if(ac)return Yn;ac=1;var t=be(),e=$e(),r=bn(),n=Object,a=t("".split);return Yn=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,Yn}var Xn,ic;function Sn(){return ic||(ic=1,Xn=function(t){return t==null}),Xn}var Qn,oc;function In(){if(oc)return Qn;oc=1;var t=Sn(),e=TypeError;return Qn=function(r){if(t(r))throw new e("Can't call method on "+r);return r},Qn}var ea,sc;function Dr(){if(sc)return ea;sc=1;var t=Gd(),e=In();return ea=function(r){return t(e(r))},ea}var Rr,cc;function Se(){if(cc)return Rr;cc=1;var t=function(e){return e&&e.Math===Math&&e};return Rr=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof Xs=="object"&&Xs)||t(typeof Rr=="object"&&Rr)||(function(){return this})()||Function("return this")(),Rr}var ta={exports:{}},ra,uc;function pt(){return uc||(uc=1,ra=!1),ra}var na,lc;function cs(){if(lc)return na;lc=1;var t=Se(),e=Object.defineProperty;return na=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},na}var fc;function us(){if(fc)return ta.exports;fc=1;var t=pt(),e=Se(),r=cs(),n="__core-js_shared__",a=ta.exports=e[n]||r(n,{});return(a.versions||(a.versions=[])).push({version:"3.46.0",mode:t?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"}),ta.exports}var aa,dc;function Wd(){if(dc)return aa;dc=1;var t=us();return aa=function(e,r){return t[e]||(t[e]=r||{})},aa}var ia,hc;function Pn(){if(hc)return ia;hc=1;var t=In(),e=Object;return ia=function(r){return e(t(r))},ia}var oa,vc;function rt(){if(vc)return oa;vc=1;var t=be(),e=Pn(),r=t({}.hasOwnProperty);return oa=Object.hasOwn||function(a,i){return r(e(a),i)},oa}var sa,pc;function Vd(){if(pc)return sa;pc=1;var t=be(),e=0,r=Math.random(),n=t(1.1.toString);return sa=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},sa}var ca,mc;function Mr(){if(mc)return ca;mc=1;var t=Se(),e=t.navigator,r=e&&e.userAgent;return ca=r?String(r):"",ca}var ua,gc;function Jd(){if(gc)return ua;gc=1;var t=Se(),e=Mr(),r=t.process,n=t.Deno,a=r&&r.versions||n&&n.version,i=a&&a.v8,o,s;return i&&(o=i.split("."),s=o[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&e&&(o=e.match(/Edge\/(\d+)/),(!o||o[1]>=74)&&(o=e.match(/Chrome\/(\d+)/),o&&(s=+o[1]))),ua=s,ua}var la,yc;function Zd(){if(yc)return la;yc=1;var t=Jd(),e=$e(),r=Se(),n=r.String;return la=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),la}var fa,wc;function Yd(){if(wc)return fa;wc=1;var t=Zd();return fa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",fa}var da,bc;function De(){if(bc)return da;bc=1;var t=Se(),e=Wd(),r=rt(),n=Vd(),a=Zd(),i=Yd(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return da=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},da}var ha,Sc;function Pe(){if(Sc)return ha;Sc=1;var t=typeof document=="object"&&document.all;return ha=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},ha}var va,Ic;function nt(){if(Ic)return va;Ic=1;var t=Pe();return va=function(e){return typeof e=="object"?e!==null:t(e)},va}var pa,Pc;function st(){if(Pc)return pa;Pc=1;var t=nt(),e=String,r=TypeError;return pa=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},pa}var ma={},ga,Ec;function Me(){if(Ec)return ga;Ec=1;var t=$e();return ga=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ga}var ya,Rc;function Xd(){if(Rc)return ya;Rc=1;var t=Me(),e=$e();return ya=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),ya}var wa={},ba,_c;function En(){if(_c)return ba;_c=1;var t=Se(),e=nt(),r=t.document,n=e(r)&&e(r.createElement);return ba=function(a){return n?r.createElement(a):{}},ba}var Sa,Tc;function Qd(){if(Tc)return Sa;Tc=1;var t=Me(),e=$e(),r=En();return Sa=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Sa}var Ia,kc;function He(){if(kc)return Ia;kc=1;var t=wn(),e=Function.prototype.call;return Ia=t?e.bind(e):function(){return e.apply(e,arguments)},Ia}var Pa,Oc;function at(){if(Oc)return Pa;Oc=1;var t=Se(),e=Pe(),r=function(n){return e(n)?n:void 0};return Pa=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},Pa}var Ea,Cc;function Rn(){if(Cc)return Ea;Cc=1;var t=be();return Ea=t({}.isPrototypeOf),Ea}var Ra,Ac;function eh(){if(Ac)return Ra;Ac=1;var t=at(),e=Pe(),r=Rn(),n=Yd(),a=Object;return Ra=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},Ra}var _a,Uc;function _n(){if(Uc)return _a;Uc=1;var t=String;return _a=function(e){try{return t(e)}catch{return"Object"}},_a}var Ta,jc;function ct(){if(jc)return Ta;jc=1;var t=Pe(),e=_n(),r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Ta}var ka,Lc;function ls(){if(Lc)return ka;Lc=1;var t=ct(),e=Sn();return ka=function(r,n){var a=r[n];return e(a)?void 0:t(a)},ka}var Oa,Nc;function Gv(){if(Nc)return Oa;Nc=1;var t=He(),e=Pe(),r=nt(),n=TypeError;return Oa=function(a,i){var o,s;if(i==="string"&&e(o=a.toString)&&!r(s=t(o,a))||e(o=a.valueOf)&&!r(s=t(o,a))||i!=="string"&&e(o=a.toString)&&!r(s=t(o,a)))return s;throw new n("Can't convert object to primitive value")},Oa}var Ca,qc;function Wv(){if(qc)return Ca;qc=1;var t=He(),e=nt(),r=eh(),n=ls(),a=Gv(),i=De(),o=TypeError,s=i("toPrimitive");return Ca=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Ca}var Aa,xc;function th(){if(xc)return Aa;xc=1;var t=Wv(),e=eh();return Aa=function(r){var n=t(r,"string");return e(n)?n:n+""},Aa}var $c;function Rt(){if($c)return wa;$c=1;var t=Me(),e=Qd(),r=Xd(),n=st(),a=th(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return wa.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},wa}var Ua,Dc;function Vv(){if(Dc)return Ua;Dc=1;var t=Math.ceil,e=Math.floor;return Ua=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ua}var ja,Mc;function fs(){if(Mc)return ja;Mc=1;var t=Vv();return ja=function(e){var r=+e;return r!==r||r===0?0:t(r)},ja}var La,Fc;function rh(){if(Fc)return La;Fc=1;var t=fs(),e=Math.max,r=Math.min;return La=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},La}var Na,Kc;function Jv(){if(Kc)return Na;Kc=1;var t=fs(),e=Math.min;return Na=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Na}var qa,zc;function ds(){if(zc)return qa;zc=1;var t=Jv();return qa=function(e){return t(e.length)},qa}var xa,Hc;function Zv(){if(Hc)return xa;Hc=1;var t=Dr(),e=rh(),r=ds(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return xa={includes:n(!0),indexOf:n(!1)},xa}var $a,Bc;function hs(){return Bc||(Bc=1,$a={}),$a}var Da,Gc;function nh(){if(Gc)return Da;Gc=1;var t=be(),e=rt(),r=Dr(),n=Zv().indexOf,a=hs(),i=t([].push);return Da=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Da}var Ma,Wc;function vs(){return Wc||(Wc=1,Ma=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ma}var Fa,Vc;function ah(){if(Vc)return Fa;Vc=1;var t=nh(),e=vs();return Fa=Object.keys||function(n){return t(n,e)},Fa}var Jc;function Yv(){if(Jc)return ma;Jc=1;var t=Me(),e=Xd(),r=Rt(),n=st(),a=Dr(),i=ah();return ma.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},ma}var Ka,Zc;function ih(){if(Zc)return Ka;Zc=1;var t=at();return Ka=t("document","documentElement"),Ka}var za,Yc;function ps(){if(Yc)return za;Yc=1;var t=Wd(),e=Vd(),r=t("keys");return za=function(n){return r[n]||(r[n]=e(n))},za}var Ha,Xc;function Fr(){if(Xc)return Ha;Xc=1;var t=st(),e=Yv(),r=vs(),n=hs(),a=ih(),i=En(),o=ps(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(y){return u+c+s+y+u+"/"+c+s},v=function(y){y.write(d("")),y.close();var b=y.parentWindow.Object;return y=null,b},p=function(){var y=i("iframe"),b="java"+c+":",g;return y.style.display="none",a.appendChild(y),y.src=String(b),g=y.contentWindow.document,g.open(),g.write(d("document.F=Object")),g.close(),g.F},m,P=function(){try{m=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&m?v(m):p():v(m);for(var y=r.length;y--;)delete P[l][r[y]];return P()};return n[f]=!0,Ha=Object.create||function(b,g){var w;return b!==null?(h[l]=t(b),w=new h,h[l]=null,w[f]=b):w=P(),g===void 0?w:e.f(w,g)},Ha}var Ba,Qc;function Xv(){if(Qc)return Ba;Qc=1;var t=De(),e=Fr(),r=Rt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),Ba=function(i){a[n][i]=!0},Ba}var Ga,eu;function Kr(){return eu||(eu=1,Ga={}),Ga}var Wa,tu;function Qv(){if(tu)return Wa;tu=1;var t=Se(),e=Pe(),r=t.WeakMap;return Wa=e(r)&&/native code/.test(String(r)),Wa}var Va,ru;function Zt(){return ru||(ru=1,Va=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),Va}var Ja,nu;function Yt(){if(nu)return Ja;nu=1;var t=Me(),e=Rt(),r=Zt();return Ja=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},Ja}var Za,au;function gr(){if(au)return Za;au=1;var t=Qv(),e=Se(),r=nt(),n=Yt(),a=rt(),i=us(),o=ps(),s=hs(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(y){return d(y)?h(y):f(y,{})},p=function(y){return function(b){var g;if(!r(b)||(g=h(b)).type!==y)throw new l("Incompatible receiver, "+y+" required");return g}};if(t||i.state){var m=i.state||(i.state=new c);m.get=m.get,m.has=m.has,m.set=m.set,f=function(y,b){if(m.has(y))throw new l(u);return b.facade=y,m.set(y,b),b},h=function(y){return m.get(y)||{}},d=function(y){return m.has(y)}}else{var P=o("state");s[P]=!0,f=function(y,b){if(a(y,P))throw new l(u);return b.facade=y,n(y,P,b),b},h=function(y){return a(y,P)?y[P]:{}},d=function(y){return a(y,P)}}return Za={set:f,get:h,has:d,enforce:v,getterFor:p},Za}var Ya={},Xa={},iu;function oh(){if(iu)return Xa;iu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return Xa.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,Xa}var ou;function sh(){if(ou)return Ya;ou=1;var t=Me(),e=He(),r=oh(),n=Zt(),a=Dr(),i=th(),o=rt(),s=Qd(),u=Object.getOwnPropertyDescriptor;return Ya.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},Ya}var Qa={exports:{}},ei,su;function ch(){if(su)return ei;su=1;var t=Me(),e=rt(),r=Function.prototype,n=t&&Object.getOwnPropertyDescriptor,a=e(r,"name"),i=a&&(function(){}).name==="something",o=a&&(!t||t&&n(r,"name").configurable);return ei={EXISTS:a,PROPER:i,CONFIGURABLE:o},ei}var ti,cu;function ms(){if(cu)return ti;cu=1;var t=be(),e=Pe(),r=us(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),ti=r.inspectSource,ti}var uu;function uh(){if(uu)return Qa.exports;uu=1;var t=be(),e=$e(),r=Pe(),n=rt(),a=Me(),i=ch().CONFIGURABLE,o=ms(),s=gr(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),m=String(String).split("String"),P=Qa.exports=function(y,b,g){h(c(b),0,7)==="Symbol("&&(b="["+d(c(b),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),g&&g.getter&&(b="get "+b),g&&g.setter&&(b="set "+b),(!n(y,"name")||i&&y.name!==b)&&(a?f(y,"name",{value:b,configurable:!0}):y.name=b),p&&g&&n(g,"arity")&&y.length!==g.arity&&f(y,"length",{value:g.arity});try{g&&n(g,"constructor")&&g.constructor?a&&f(y,"prototype",{writable:!1}):y.prototype&&(y.prototype=void 0)}catch{}var w=u(y);return n(w,"source")||(w.source=v(m,typeof b=="string"?b:"")),y};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),Qa.exports}var ri,lu;function it(){if(lu)return ri;lu=1;var t=Pe(),e=Rt(),r=uh(),n=cs();return ri=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},ri}var ni={},fu;function ep(){if(fu)return ni;fu=1;var t=nh(),e=vs(),r=e.concat("length","prototype");return ni.f=Object.getOwnPropertyNames||function(a){return t(a,r)},ni}var ai={},du;function lh(){return du||(du=1,ai.f=Object.getOwnPropertySymbols),ai}var ii,hu;function tp(){if(hu)return ii;hu=1;var t=at(),e=be(),r=ep(),n=lh(),a=st(),i=e([].concat);return ii=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},ii}var oi,vu;function fh(){if(vu)return oi;vu=1;var t=rt(),e=tp(),r=sh(),n=Rt();return oi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},oi}var si,pu;function dh(){if(pu)return si;pu=1;var t=$e(),e=Pe(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return si=n,si}var ci,mu;function Te(){if(mu)return ci;mu=1;var t=Se(),e=sh().f,r=Yt(),n=it(),a=cs(),i=fh(),o=dh();return ci=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,m,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(m=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof m==typeof p)continue;i(m,p)}(s.sham||p&&p.sham)&&r(m,"sham",!0),n(d,v,m,s)}},ci}var ui,gu;function rp(){if(gu)return ui;gu=1;var t=$e();return ui=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ui}var li,yu;function gs(){if(yu)return li;yu=1;var t=rt(),e=Pe(),r=Pn(),n=ps(),a=rp(),i=n("IE_PROTO"),o=Object,s=o.prototype;return li=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},li}var fi,wu;function hh(){if(wu)return fi;wu=1;var t=$e(),e=Pe(),r=nt(),n=Fr(),a=gs(),i=it(),o=De(),s=pt(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var v={};return c[u].call(v)!==v});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),fi={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},fi}var di,bu;function yr(){if(bu)return di;bu=1;var t=Rt().f,e=rt(),r=De(),n=r("toStringTag");return di=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},di}var hi,Su;function vh(){if(Su)return hi;Su=1;var t=hh().IteratorPrototype,e=Fr(),r=Zt(),n=yr(),a=Kr(),i=function(){return this};return hi=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},hi}var vi,Iu;function np(){if(Iu)return vi;Iu=1;var t=be(),e=ct();return vi=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},vi}var pi,Pu;function ap(){if(Pu)return pi;Pu=1;var t=nt();return pi=function(e){return t(e)||e===null},pi}var mi,Eu;function ip(){if(Eu)return mi;Eu=1;var t=ap(),e=String,r=TypeError;return mi=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},mi}var gi,Ru;function ys(){if(Ru)return gi;Ru=1;var t=np(),e=nt(),r=In(),n=ip();return gi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),gi}var yi,_u;function ph(){if(_u)return yi;_u=1;var t=Te(),e=He(),r=pt(),n=ch(),a=Pe(),i=vh(),o=gs(),s=ys(),u=yr(),l=Yt(),c=it(),f=De(),h=Kr(),d=hh(),v=n.PROPER,p=n.CONFIGURABLE,m=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,y=f("iterator"),b="keys",g="values",w="entries",A=function(){return this};return yi=function(x,N,z,B,ie,j,D){i(z,N,B);var L=function(V){if(V===ie&&S)return S;if(!P&&V&&V in te)return te[V];switch(V){case b:return function(){return new z(this,V)};case g:return function(){return new z(this,V)};case w:return function(){return new z(this,V)}}return function(){return new z(this)}},k=N+" Iterator",Y=!1,te=x.prototype,Q=te[y]||te["@@iterator"]||ie&&te[ie],S=!P&&Q||L(ie),_=N==="Array"&&te.entries||Q,q,F,Z;if(_&&(q=o(_.call(new x)),q!==Object.prototype&&q.next&&(!r&&o(q)!==m&&(s?s(q,m):a(q[y])||c(q,y,A)),u(q,k,!0,!0),r&&(h[k]=A))),v&&ie===g&&Q&&Q.name!==g&&(!r&&p?l(te,"name",g):(Y=!0,S=function(){return e(Q,this)})),ie)if(F={values:L(g),keys:j?S:L(b),entries:L(w)},D)for(Z in F)(P||Y||!(Z in te))&&c(te,Z,F[Z]);else t({target:N,proto:!0,forced:P||Y},F);return(!r||D)&&te[y]!==S&&c(te,y,S,{name:ie}),h[N]=S,F},yi}var wi,Tu;function ws(){return Tu||(Tu=1,wi=function(t,e){return{value:t,done:e}}),wi}var bi,ku;function bs(){if(ku)return bi;ku=1;var t=Dr(),e=Xv(),r=Kr(),n=gr(),a=Rt().f,i=ph(),o=ws(),s=pt(),u=Me(),l="Array Iterator",c=n.set,f=n.getterFor(l);bi=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return bi}var Ou={},Cu;function op(){if(Cu)return Ou;Cu=1;var t=Te(),e=be(),r=rh(),n=RangeError,a=String.fromCharCode,i=String.fromCodePoint,o=e([].join),s=!!i&&i.length!==1;return t({target:"String",stat:!0,arity:1,forced:s},{fromCodePoint:function(l){for(var c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Ou}var Si,Au;function mh(){if(Au)return Si;Au=1;var t=Se(),e=Me(),r=Object.getOwnPropertyDescriptor;return Si=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Si}var Ii,Uu;function Tn(){if(Uu)return Ii;Uu=1;var t=$e(),e=De(),r=Me(),n=pt(),a=e("iterator");return Ii=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||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"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Ii}var Pi,ju;function kn(){if(ju)return Pi;ju=1;var t=uh(),e=Rt();return Pi=function(r,n,a){return a.get&&t(a.get,n,{getter:!0}),a.set&&t(a.set,n,{setter:!0}),e.f(r,n,a)},Pi}var Ei,Lu;function sp(){if(Lu)return Ei;Lu=1;var t=it();return Ei=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},Ei}var Ri,Nu;function Ss(){if(Nu)return Ri;Nu=1;var t=Rn(),e=TypeError;return Ri=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ri}var _i,qu;function cp(){if(qu)return _i;qu=1;var t=bn(),e=be();return _i=function(r){if(t(r)==="Function")return e(r)},_i}var Ti,xu;function wr(){if(xu)return Ti;xu=1;var t=cp(),e=ct(),r=wn(),n=t(t.bind);return Ti=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Ti}var ki,$u;function Is(){if($u)return ki;$u=1;var t=De(),e=t("toStringTag"),r={};return r[e]="z",ki=String(r)==="[object z]",ki}var Oi,Du;function zr(){if(Du)return Oi;Du=1;var t=Is(),e=Pe(),r=bn(),n=De(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Oi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Oi}var Ci,Mu;function _t(){if(Mu)return Ci;Mu=1;var t=zr(),e=String;return Ci=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ci}var Ai,Fu;function On(){if(Fu)return Ai;Fu=1;var t=zr(),e=ls(),r=Sn(),n=Kr(),a=De(),i=a("iterator");return Ai=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Ai}var Ui,Ku;function Ps(){if(Ku)return Ui;Ku=1;var t=He(),e=ct(),r=st(),n=_n(),a=On(),i=TypeError;return Ui=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},Ui}var ji,zu;function Xt(){if(zu)return ji;zu=1;var t=TypeError;return ji=function(e,r){if(e<r)throw new t("Not enough arguments");return e},ji}var Li,Hu;function Cn(){if(Hu)return Li;Hu=1;var t=be();return Li=t([].slice),Li}var Ni,Bu;function up(){if(Bu)return Ni;Bu=1;var t=Cn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Ni=r,Ni}var qi,Gu;function gh(){if(Gu)return qi;Gu=1,bs(),op();var t=Te(),e=Se(),r=mh(),n=at(),a=He(),i=be(),o=Me(),s=Tn(),u=it(),l=kn(),c=sp(),f=yr(),h=vh(),d=gr(),v=Ss(),p=Pe(),m=rt(),P=wr(),y=zr(),b=st(),g=nt(),w=_t(),A=Fr(),x=Zt(),N=Ps(),z=On(),B=ws(),ie=Xt(),j=De(),D=up(),L=j("iterator"),k="URLSearchParams",Y=k+"Iterator",te=d.set,Q=d.getterFor(k),S=d.getterFor(Y),_=r("fetch"),q=r("Request"),F=r("Headers"),Z=q&&q.prototype,V=F&&F.prototype,he=e.TypeError,oe=e.encodeURIComponent,le=String.fromCharCode,se=n("String","fromCodePoint"),Re=parseInt,Ue=i("".charAt),Fe=i([].join),ke=i([].push),Ye=i("".replace),ut=i([].shift),lt=i([].splice),mt=i("".split),gt=i("".slice),T=i(/./.exec),K=/\+/g,J="�",re=/^[0-9a-f]+$/i,me=function($,G){var W=gt($,G,G+2);return T(re,W)?Re(W,16):NaN},Ke=function($){for(var G=0,W=128;W>0&&($&W)!==0;W>>=1)G++;return G},M=function($){var G=null;switch($.length){case 1:G=$[0];break;case 2:G=($[0]&31)<<6|$[1]&63;break;case 3:G=($[0]&15)<<12|($[1]&63)<<6|$[2]&63;break;case 4:G=($[0]&7)<<18|($[1]&63)<<12|($[2]&63)<<6|$[3]&63;break}return G>1114111?null:G},ee=function($){$=Ye($,K," ");for(var G=$.length,W="",X=0;X<G;){var ue=Ue($,X);if(ue==="%"){if(Ue($,X+1)==="%"||X+3>G){W+="%",X++;continue}var de=me($,X+1);if(de!==de){W+=ue,X++;continue}X+=2;var ye=Ke(de);if(ye===0)ue=le(de);else{if(ye===1||ye>4){W+=J,X++;continue}for(var we=[de],Ee=1;Ee<ye&&(X++,!(X+3>G||Ue($,X)!=="%"));){var ze=me($,X+1);if(ze!==ze){X+=3;break}if(ze>191||ze<128)break;ke(we,ze),X+=2,Ee++}if(we.length!==ye){W+=J;continue}var ft=M(we);ft===null?W+=J:ue=se(ft)}}W+=ue,X++}return W},fe=/[!'()~]|%20/g,ve={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ge=function($){return ve[$]},Xe=function($){return Ye(oe($),fe,ge)},je=h(function(G,W){te(this,{type:Y,target:Q(G).entries,index:0,kind:W})},k,function(){var G=S(this),W=G.target,X=G.index++;if(!W||X>=W.length)return G.target=null,B(void 0,!0);var ue=W[X];switch(G.kind){case"keys":return B(ue.key,!1);case"values":return B(ue.value,!1)}return B([ue.key,ue.value],!1)},!0),Ge=function($){this.entries=[],this.url=null,$!==void 0&&(g($)?this.parseObject($):this.parseQuery(typeof $=="string"?Ue($,0)==="?"?gt($,1):$:w($)))};Ge.prototype={type:k,bindURL:function($){this.url=$,this.update()},parseObject:function($){var G=this.entries,W=z($),X,ue,de,ye,we,Ee,ze;if(W)for(X=N($,W),ue=X.next;!(de=a(ue,X)).done;){if(ye=N(b(de.value)),we=ye.next,(Ee=a(we,ye)).done||(ze=a(we,ye)).done||!a(we,ye).done)throw new he("Expected sequence with length 2");ke(G,{key:w(Ee.value),value:w(ze.value)})}else for(var ft in $)m($,ft)&&ke(G,{key:ft,value:w($[ft])})},parseQuery:function($){if($)for(var G=this.entries,W=mt($,"&"),X=0,ue,de;X<W.length;)ue=W[X++],ue.length&&(de=mt(ue,"="),ke(G,{key:ee(ut(de)),value:ee(Fe(de,"="))}))},serialize:function(){for(var $=this.entries,G=[],W=0,X;W<$.length;)X=$[W++],ke(G,Xe(X.key)+"="+Xe(X.value));return Fe(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Le=function(){v(this,Qe);var G=arguments.length>0?arguments[0]:void 0,W=te(this,new Ge(G));o||(this.size=W.entries.length)},Qe=Le.prototype;if(c(Qe,{append:function(G,W){var X=Q(this);ie(arguments.length,2),ke(X.entries,{key:w(G),value:w(W)}),o||this.length++,X.updateURL()},delete:function($){for(var G=Q(this),W=ie(arguments.length,1),X=G.entries,ue=w($),de=W<2?void 0:arguments[1],ye=de===void 0?de:w(de),we=0;we<X.length;){var Ee=X[we];if(Ee.key===ue&&(ye===void 0||Ee.value===ye)){if(lt(X,we,1),ye!==void 0)break}else we++}o||(this.size=X.length),G.updateURL()},get:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=w(G),ue=0;ue<W.length;ue++)if(W[ue].key===X)return W[ue].value;return null},getAll:function(G){var W=Q(this).entries;ie(arguments.length,1);for(var X=w(G),ue=[],de=0;de<W.length;de++)W[de].key===X&&ke(ue,W[de].value);return ue},has:function(G){for(var W=Q(this).entries,X=ie(arguments.length,1),ue=w(G),de=X<2?void 0:arguments[1],ye=de===void 0?de:w(de),we=0;we<W.length;){var Ee=W[we++];if(Ee.key===ue&&(ye===void 0||Ee.value===ye))return!0}return!1},set:function(G,W){var X=Q(this);ie(arguments.length,1);for(var ue=X.entries,de=!1,ye=w(G),we=w(W),Ee=0,ze;Ee<ue.length;Ee++)ze=ue[Ee],ze.key===ye&&(de?lt(ue,Ee--,1):(de=!0,ze.value=we));de||ke(ue,{key:ye,value:we}),o||(this.size=ue.length),X.updateURL()},sort:function(){var G=Q(this);D(G.entries,function(W,X){return W.key>X.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=Q(this).entries,X=P(G,arguments.length>1?arguments[1]:void 0),ue=0,de;ue<W.length;)de=W[ue++],X(de.value,de.key,this)},keys:function(){return new je(this,"keys")},values:function(){return new je(this,"values")},entries:function(){return new je(this,"entries")}},{enumerable:!0}),u(Qe,L,Qe.entries,{name:"entries"}),u(Qe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Qe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Le,k),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Le}),!s&&p(F)){var Qt=i(V.has),Er=i(V.set),er=function($){if(g($)){var G=$.body,W;if(y(G)===k)return W=$.headers?new F($.headers):new F,Qt(W,"content-type")||Er(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),A($,{body:x(0,w(G)),headers:x(0,W)})}return $};if(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?er(arguments[1]):{})}}),p(q)){var tr=function(G){return v(this,Z),new q(G,arguments.length>1?er(arguments[1]):{})};Z.constructor=tr,tr.prototype=Z,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:tr})}}return qi={URLSearchParams:Le,getState:Q},qi}var Wu;function lp(){return Wu||(Wu=1,gh()),Qs}var Vu={},Ju;function fp(){if(Ju)return Vu;Ju=1;var t=it(),e=be(),r=_t(),n=Xt(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(A,x){l(v,{key:x,value:A})}),n(h,1);for(var p=r(f),m=r(d),P=0,y=0,b=!1,g=v.length,w;P<g;)w=v[P++],b||w.key===p?(b=!0,s(this,w.key)):y++;for(;y<g;)w=v[y++],w.key===p&&w.value===m||o(this,w.key,w.value)},{enumerable:!0,unsafe:!0}),Vu}var Zu={},Yu;function dp(){if(Yu)return Zu;Yu=1;var t=it(),e=be(),r=_t(),n=Xt(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),Zu}var Xu={},Qu;function hp(){if(Qu)return Xu;Qu=1;var t=Me(),e=be(),r=kn(),n=URLSearchParams.prototype,a=e(n.forEach);return t&&!("size"in n)&&r(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),Xu}var xi,el;function An(){if(el)return xi;el=1;var t=Se();return xi=t,xi}var $i,tl;function yh(){if(tl)return $i;tl=1,lp(),fp(),dp(),hp();var t=An();return $i=t.URLSearchParams,$i}var rl={},nl={},al={},Di,il;function wh(){if(il)return Di;il=1;var t=be(),e=fs(),r=_t(),n=In(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Di={codeAt:s(!1),charAt:s(!0)},Di}var ol;function bh(){if(ol)return al;ol=1;var t=wh().charAt,e=_t(),r=gr(),n=ph(),a=ws(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),al}var Mi,sl;function vp(){if(sl)return Mi;sl=1;var t=Me(),e=be(),r=He(),n=$e(),a=ah(),i=lh(),o=oh(),s=Pn(),u=Gd(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Mi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(m){d[m]=m}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),m=arguments.length,P=1,y=i.f,b=o.f;m>P;)for(var g=u(arguments[P++]),w=y?f(a(g),y(g)):a(g),A=w.length,x=0,N;A>x;)N=w[x++],(!t||r(b,g,N))&&(p[N]=g[N]);return p}:l,Mi}var Fi,cl;function Sh(){if(cl)return Fi;cl=1;var t=He(),e=st(),r=ls();return Fi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Fi}var Ki,ul;function pp(){if(ul)return Ki;ul=1;var t=st(),e=Sh();return Ki=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Ki}var zi,ll;function Ih(){if(ll)return zi;ll=1;var t=De(),e=Kr(),r=t("iterator"),n=Array.prototype;return zi=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},zi}var Hi,fl;function Ph(){if(fl)return Hi;fl=1;var t=be(),e=$e(),r=Pe(),n=zr(),a=at(),i=ms(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,Hi=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,Hi}var Bi,dl;function mp(){if(dl)return Bi;dl=1;var t=Me(),e=Rt(),r=Zt();return Bi=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},Bi}var Gi,hl;function gp(){if(hl)return Gi;hl=1;var t=wr(),e=He(),r=Pn(),n=pp(),a=Ih(),i=Ph(),o=ds(),s=mp(),u=Ps(),l=On(),c=Array;return Gi=function(h){var d=r(h),v=i(this),p=arguments.length,m=p>1?arguments[1]:void 0,P=m!==void 0;P&&(m=t(m,p>2?arguments[2]:void 0));var y=l(d),b=0,g,w,A,x,N,z;if(y&&!(this===c&&a(y)))for(w=v?new this:[],x=u(d,y),N=x.next;!(A=e(N,x)).done;b++)z=P?n(x,m,[A.value,b],!0):A.value,s(w,b,z);else for(g=o(d),w=v?new this(g):c(g);g>b;b++)z=P?m(d[b],b):d[b],s(w,b,z);return w.length=b,w},Gi}var Wi,vl;function yp(){if(vl)return Wi;vl=1;var t=be(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),m=Math.floor,P=String.fromCharCode,y=t("".charCodeAt),b=t([].join),g=t([].push),w=t("".replace),A=t("".split),x=t("".toLowerCase),N=function(j){for(var D=[],L=0,k=j.length;L<k;){var Y=y(j,L++);if(Y>=55296&&Y<=56319&&L<k){var te=y(j,L++);(te&64512)===56320?g(D,((Y&1023)<<10)+(te&1023)+65536):(g(D,Y),L--)}else g(D,Y)}return D},z=function(j){return j+22+75*(j<26)},B=function(j,D,L){var k=0;for(j=L?m(j/o):j>>1,j+=m(j/D);j>d*a>>1;)j=m(j/d),k+=r;return m(k+(d+1)*j/(j+i))},ie=function(j){var D=[];j=N(j);var L=j.length,k=u,Y=0,te=s,Q,S;for(Q=0;Q<j.length;Q++)S=j[Q],S<128&&g(D,P(S));var _=D.length,q=_;for(_&&g(D,l);q<L;){var F=e;for(Q=0;Q<j.length;Q++)S=j[Q],S>=k&&S<F&&(F=S);var Z=q+1;if(F-k>m((e-Y)/Z))throw new v(h);for(Y+=(F-k)*Z,k=F,Q=0;Q<j.length;Q++){if(S=j[Q],S<k&&++Y>e)throw new v(h);if(S===k){for(var V=Y,he=r;;){var oe=he<=te?n:he>=te+a?a:he-te;if(V<oe)break;var le=V-oe,se=r-oe;g(D,P(z(oe+le%se))),V=m(le/se),he+=r}g(D,P(z(V))),te=B(Y,Z,q===_),Y=0,q++}}Y++,k++}return b(D,"")};return Wi=function(j){var D=[],L=A(w(x(j),f,"."),"."),k,Y;for(k=0;k<L.length;k++)Y=L[k],g(D,p(c,Y)?"xn--"+ie(Y):Y);return b(D,".")},Wi}var pl;function wp(){if(pl)return nl;pl=1,bh();var t=Te(),e=Me(),r=Tn(),n=Se(),a=wr(),i=be(),o=it(),s=kn(),u=Ss(),l=rt(),c=vp(),f=gp(),h=Cn(),d=wh().codeAt,v=yp(),p=_t(),m=yr(),P=Xt(),y=gh(),b=gr(),g=b.set,w=b.getterFor("URL"),A=y.URLSearchParams,x=y.getState,N=n.URL,z=n.TypeError,B=n.parseInt,ie=Math.floor,j=Math.pow,D=i("".charAt),L=i(/./.exec),k=i([].join),Y=i(1.1.toString),te=i([].pop),Q=i([].push),S=i("".replace),_=i([].shift),q=i("".split),F=i("".slice),Z=i("".toLowerCase),V=i([].unshift),he="Invalid authority",oe="Invalid scheme",le="Invalid host",se="Invalid port",Re=/[a-z]/i,Ue=/[\d+-.a-z]/i,Fe=/\d/,ke=/^0x/i,Ye=/^[0-7]+$/,ut=/^\d+$/,lt=/^[\da-f]+$/i,mt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,gt=/[\0\t\n\r #/:<>?@[\\\]^|]/,T=/^[\u0000-\u0020]+/,K=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,J=/[\t\n\r]/g,re,me=function(E){var U=q(E,"."),R,I,O,ce,H,Ie,_e;if(U.length&&U[U.length-1]===""&&U.length--,R=U.length,R>4)return E;for(I=[],O=0;O<R;O++){if(ce=U[O],ce==="")return E;if(H=10,ce.length>1&&D(ce,0)==="0"&&(H=L(ke,ce)?16:8,ce=F(ce,H===8?1:2)),ce==="")Ie=0;else{if(!L(H===10?ut:H===8?Ye:lt,ce))return E;Ie=B(ce,H)}Q(I,Ie)}for(O=0;O<R;O++)if(Ie=I[O],O===R-1){if(Ie>=j(256,5-R))return null}else if(Ie>255)return null;for(_e=te(I),O=0;O<I.length;O++)_e+=I[O]*j(256,3-O);return _e},Ke=function(E){var U=[0,0,0,0,0,0,0,0],R=0,I=null,O=0,ce,H,Ie,_e,Ne,tt,C,Oe=function(){return D(E,O)};if(Oe()===":"){if(D(E,1)!==":")return;O+=2,R++,I=R}for(;Oe();){if(R===8)return;if(Oe()===":"){if(I!==null)return;O++,R++,I=R;continue}for(ce=H=0;H<4&&L(lt,Oe());)ce=ce*16+B(Oe(),16),O++,H++;if(Oe()==="."){if(H===0||(O-=H,R>6))return;for(Ie=0;Oe();){if(_e=null,Ie>0)if(Oe()==="."&&Ie<4)O++;else return;if(!L(Fe,Oe()))return;for(;L(Fe,Oe());){if(Ne=B(Oe(),10),_e===null)_e=Ne;else{if(_e===0)return;_e=_e*10+Ne}if(_e>255)return;O++}U[R]=U[R]*256+_e,Ie++,(Ie===2||Ie===4)&&R++}if(Ie!==4)return;break}else if(Oe()===":"){if(O++,!Oe())return}else if(Oe())return;U[R++]=ce}if(I!==null)for(tt=R-I,R=7;R!==0&&tt>0;)C=U[R],U[R--]=U[I+tt-1],U[I+--tt]=C;else if(R!==8)return;return U},M=function(E){for(var U=null,R=1,I=null,O=0,ce=0;ce<8;ce++)E[ce]!==0?(O>R&&(U=I,R=O),I=null,O=0):(I===null&&(I=ce),++O);return O>R?I:U},ee=function(E){var U,R,I,O;if(typeof E=="number"){for(U=[],R=0;R<4;R++)V(U,E%256),E=ie(E/256);return k(U,".")}if(typeof E=="object"){for(U="",I=M(E),R=0;R<8;R++)O&&E[R]===0||(O&&(O=!1),I===R?(U+=R?":":"::",O=!0):(U+=Y(E[R],16),R<7&&(U+=":")));return"["+U+"]"}return E},fe={},ve=c({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),ge=c({},ve,{"#":1,"?":1,"{":1,"}":1}),Xe=c({},ge,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),je=function(E,U){var R=d(E,0);return R>32&&R<127&&!l(U,E)?E:encodeURIComponent(E)},Ge={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Le=function(E,U){var R;return E.length===2&&L(Re,D(E,0))&&((R=D(E,1))===":"||!U&&R==="|")},Qe=function(E){var U;return E.length>1&&Le(F(E,0,2))&&(E.length===2||(U=D(E,2))==="/"||U==="\\"||U==="?"||U==="#")},Qt=function(E){return E==="."||Z(E)==="%2e"},Er=function(E){return E=Z(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},er={},tr={},$={},G={},W={},X={},ue={},de={},ye={},we={},Ee={},ze={},ft={},Kn={},Gs={},zn={},rr={},dt={},Ws={},Lt={},yt={},Hn=function(E,U,R){var I=p(E),O,ce,H;if(U){if(ce=this.parse(I),ce)throw new z(ce);this.searchParams=null}else{if(R!==void 0&&(O=new Hn(R,!0)),ce=this.parse(I,null,O),ce)throw new z(ce);H=x(new A),H.bindURL(this),this.searchParams=H}};Hn.prototype={type:"URL",parse:function(E,U,R){var I=this,O=U||er,ce=0,H="",Ie=!1,_e=!1,Ne=!1,tt,C,Oe,wt;for(E=p(E),U||(I.scheme="",I.username="",I.password="",I.host=null,I.port=null,I.path=[],I.query=null,I.fragment=null,I.cannotBeABaseURL=!1,E=S(E,T,""),E=S(E,K,"$1")),E=S(E,J,""),tt=f(E);ce<=tt.length;){switch(C=tt[ce],O){case er:if(C&&L(Re,C))H+=Z(C),O=tr;else{if(U)return oe;O=$;continue}break;case tr:if(C&&(L(Ue,C)||C==="+"||C==="-"||C==="."))H+=Z(C);else if(C===":"){if(U&&(I.isSpecial()!==l(Ge,H)||H==="file"&&(I.includesCredentials()||I.port!==null)||I.scheme==="file"&&!I.host))return;if(I.scheme=H,U){I.isSpecial()&&Ge[I.scheme]===I.port&&(I.port=null);return}H="",I.scheme==="file"?O=Kn:I.isSpecial()&&R&&R.scheme===I.scheme?O=G:I.isSpecial()?O=de:tt[ce+1]==="/"?(O=W,ce++):(I.cannotBeABaseURL=!0,Q(I.path,""),O=Ws)}else{if(U)return oe;H="",O=$,ce=0;continue}break;case $:if(!R||R.cannotBeABaseURL&&C!=="#")return oe;if(R.cannotBeABaseURL&&C==="#"){I.scheme=R.scheme,I.path=h(R.path),I.query=R.query,I.fragment="",I.cannotBeABaseURL=!0,O=yt;break}O=R.scheme==="file"?Kn:X;continue;case G:if(C==="/"&&tt[ce+1]==="/")O=ye,ce++;else{O=X;continue}break;case W:if(C==="/"){O=we;break}else{O=dt;continue}case X:if(I.scheme=R.scheme,C===re)I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query;else if(C==="/"||C==="\\"&&I.isSpecial())O=ue;else if(C==="?")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query="",O=Lt;else if(C==="#")I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.query=R.query,I.fragment="",O=yt;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,I.path=h(R.path),I.path.length--,O=dt;continue}break;case ue:if(I.isSpecial()&&(C==="/"||C==="\\"))O=ye;else if(C==="/")O=we;else{I.username=R.username,I.password=R.password,I.host=R.host,I.port=R.port,O=dt;continue}break;case de:if(O=ye,C!=="/"||D(H,ce+1)!=="/")continue;ce++;break;case ye:if(C!=="/"&&C!=="\\"){O=we;continue}break;case we:if(C==="@"){Ie&&(H="%40"+H),Ie=!0,Oe=f(H);for(var Bn=0;Bn<Oe.length;Bn++){var Zs=Oe[Bn];if(Zs===":"&&!Ne){Ne=!0;continue}var Ys=je(Zs,Xe);Ne?I.password+=Ys:I.username+=Ys}H=""}else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()){if(Ie&&H==="")return he;ce-=f(H).length+1,H="",O=Ee}else H+=C;break;case Ee:case ze:if(U&&I.scheme==="file"){O=zn;continue}else if(C===":"&&!_e){if(H==="")return le;if(wt=I.parseHost(H),wt)return wt;if(H="",O=ft,U===ze)return}else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()){if(I.isSpecial()&&H==="")return le;if(U&&H===""&&(I.includesCredentials()||I.port!==null))return;if(wt=I.parseHost(H),wt)return wt;if(H="",O=rr,U)return;continue}else C==="["?_e=!0:C==="]"&&(_e=!1),H+=C;break;case ft:if(L(Fe,C))H+=C;else if(C===re||C==="/"||C==="?"||C==="#"||C==="\\"&&I.isSpecial()||U){if(H!==""){var Gn=B(H,10);if(Gn>65535)return se;I.port=I.isSpecial()&&Gn===Ge[I.scheme]?null:Gn,H=""}if(U)return;O=rr;continue}else return se;break;case Kn:if(I.scheme="file",C==="/"||C==="\\")O=Gs;else if(R&&R.scheme==="file")switch(C){case re:I.host=R.host,I.path=h(R.path),I.query=R.query;break;case"?":I.host=R.host,I.path=h(R.path),I.query="",O=Lt;break;case"#":I.host=R.host,I.path=h(R.path),I.query=R.query,I.fragment="",O=yt;break;default:Qe(k(h(tt,ce),""))||(I.host=R.host,I.path=h(R.path),I.shortenPath()),O=dt;continue}else{O=dt;continue}break;case Gs:if(C==="/"||C==="\\"){O=zn;break}R&&R.scheme==="file"&&!Qe(k(h(tt,ce),""))&&(Le(R.path[0],!0)?Q(I.path,R.path[0]):I.host=R.host),O=dt;continue;case zn:if(C===re||C==="/"||C==="\\"||C==="?"||C==="#"){if(!U&&Le(H))O=dt;else if(H===""){if(I.host="",U)return;O=rr}else{if(wt=I.parseHost(H),wt)return wt;if(I.host==="localhost"&&(I.host=""),U)return;H="",O=rr}continue}else H+=C;break;case rr:if(I.isSpecial()){if(O=dt,C!=="/"&&C!=="\\")continue}else if(!U&&C==="?")I.query="",O=Lt;else if(!U&&C==="#")I.fragment="",O=yt;else if(C!==re&&(O=dt,C!=="/"))continue;break;case dt:if(C===re||C==="/"||C==="\\"&&I.isSpecial()||!U&&(C==="?"||C==="#")){if(Er(H)?(I.shortenPath(),C!=="/"&&!(C==="\\"&&I.isSpecial())&&Q(I.path,"")):Qt(H)?C!=="/"&&!(C==="\\"&&I.isSpecial())&&Q(I.path,""):(I.scheme==="file"&&!I.path.length&&Le(H)&&(I.host&&(I.host=""),H=D(H,0)+":"),Q(I.path,H)),H="",I.scheme==="file"&&(C===re||C==="?"||C==="#"))for(;I.path.length>1&&I.path[0]==="";)_(I.path);C==="?"?(I.query="",O=Lt):C==="#"&&(I.fragment="",O=yt)}else H+=je(C,ge);break;case Ws:C==="?"?(I.query="",O=Lt):C==="#"?(I.fragment="",O=yt):C!==re&&(I.path[0]+=je(C,fe));break;case Lt:!U&&C==="#"?(I.fragment="",O=yt):C!==re&&(C==="'"&&I.isSpecial()?I.query+="%27":C==="#"?I.query+="%23":I.query+=je(C,fe));break;case yt:C!==re&&(I.fragment+=je(C,ve));break}ce++}},parseHost:function(E){var U,R,I;if(D(E,0)==="["){if(D(E,E.length-1)!=="]"||(U=Ke(F(E,1,-1)),!U))return le;this.host=U}else if(this.isSpecial()){if(E=v(E),L(mt,E)||(U=me(E),U===null))return le;this.host=U}else{if(L(gt,E))return le;for(U="",R=f(E),I=0;I<R.length;I++)U+=je(R[I],fe);this.host=U}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Ge,this.scheme)},shortenPath:function(){var E=this.path,U=E.length;U&&(this.scheme!=="file"||U!==1||!Le(E[0],!0))&&E.length--},serialize:function(){var E=this,U=E.scheme,R=E.username,I=E.password,O=E.host,ce=E.port,H=E.path,Ie=E.query,_e=E.fragment,Ne=U+":";return O!==null?(Ne+="//",E.includesCredentials()&&(Ne+=R+(I?":"+I:"")+"@"),Ne+=ee(O),ce!==null&&(Ne+=":"+ce)):U==="file"&&(Ne+="//"),Ne+=E.cannotBeABaseURL?H[0]:H.length?"/"+k(H,"/"):"",Ie!==null&&(Ne+="?"+Ie),_e!==null&&(Ne+="#"+_e),Ne},setHref:function(E){var U=this.parse(E);if(U)throw new z(U);this.searchParams.update()},getOrigin:function(){var E=this.scheme,U=this.port;if(E==="blob")try{return new nr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+ee(this.host)+(U!==null?":"+U:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(p(E)+":",er)},getUsername:function(){return this.username},setUsername:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var R=0;R<U.length;R++)this.username+=je(U[R],Xe)}},getPassword:function(){return this.password},setPassword:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var R=0;R<U.length;R++)this.password+=je(U[R],Xe)}},getHost:function(){var E=this.host,U=this.port;return E===null?"":U===null?ee(E):ee(E)+":"+U},setHost:function(E){this.cannotBeABaseURL||this.parse(E,Ee)},getHostname:function(){var E=this.host;return E===null?"":ee(E)},setHostname:function(E){this.cannotBeABaseURL||this.parse(E,ze)},getPort:function(){var E=this.port;return E===null?"":p(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=p(E),E===""?this.port=null:this.parse(E,ft))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+k(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,rr))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=p(E),E===""?this.query=null:(D(E,0)==="?"&&(E=F(E,1)),this.query="",this.parse(E,Lt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var E=this.fragment;return E?"#"+E:""},setHash:function(E){if(E=p(E),E===""){this.fragment=null;return}D(E,0)==="#"&&(E=F(E,1)),this.fragment="",this.parse(E,yt)},update:function(){this.query=this.searchParams.serialize()||null}};var nr=function(U){var R=u(this,Be),I=P(arguments.length,1)>1?arguments[1]:void 0,O=g(R,new Hn(U,!1,I));e||(R.href=O.serialize(),R.origin=O.getOrigin(),R.protocol=O.getProtocol(),R.username=O.getUsername(),R.password=O.getPassword(),R.host=O.getHost(),R.hostname=O.getHostname(),R.port=O.getPort(),R.pathname=O.getPathname(),R.search=O.getSearch(),R.searchParams=O.getSearchParams(),R.hash=O.getHash())},Be=nr.prototype,et=function(E,U){return{get:function(){return w(this)[E]()},set:U&&function(R){return w(this)[U](R)},configurable:!0,enumerable:!0}};if(e&&(s(Be,"href",et("serialize","setHref")),s(Be,"origin",et("getOrigin")),s(Be,"protocol",et("getProtocol","setProtocol")),s(Be,"username",et("getUsername","setUsername")),s(Be,"password",et("getPassword","setPassword")),s(Be,"host",et("getHost","setHost")),s(Be,"hostname",et("getHostname","setHostname")),s(Be,"port",et("getPort","setPort")),s(Be,"pathname",et("getPathname","setPathname")),s(Be,"search",et("getSearch","setSearch")),s(Be,"searchParams",et("getSearchParams")),s(Be,"hash",et("getHash","setHash"))),o(Be,"toJSON",function(){return w(this).serialize()},{enumerable:!0}),o(Be,"toString",function(){return w(this).serialize()},{enumerable:!0}),N){var Vs=N.createObjectURL,Js=N.revokeObjectURL;Vs&&o(nr,"createObjectURL",a(Vs,N)),Js&&o(nr,"revokeObjectURL",a(Js,N))}return m(nr,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:nr}),nl}var ml;function bp(){return ml||(ml=1,wp()),rl}var gl={},yl;function Sp(){if(yl)return gl;yl=1;var t=Te(),e=at(),r=$e(),n=Xt(),a=_t(),i=Tn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),gl}var wl={},bl;function Ip(){if(bl)return wl;bl=1;var t=Te(),e=at(),r=Xt(),n=_t(),a=Tn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),wl}var Sl={},Il;function Pp(){if(Il)return Sl;Il=1;var t=Te(),e=He();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Sl}var Vi,Pl;function Ep(){if(Pl)return Vi;Pl=1,yh(),bp(),Sp(),Ip(),Pp();var t=An();return Vi=t.URL,Vi}var Ji,El;function Rp(){if(El)return Ji;El=1;var t=Ep();return Ji=t,Ji}var Zi,Rl;function _p(){if(Rl)return Zi;Rl=1;var t=Rp();return Zi=t,Zi}_p();var _l={},Yi,Tl;function Tp(){return Tl||(Tl=1,Yi={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}),Yi}var Xi,kl;function kp(){if(kl)return Xi;kl=1;var t=En(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return Xi=r===Object.prototype?void 0:r,Xi}var Ol;function Eh(){if(Ol)return _l;Ol=1;var t=Se(),e=Tp(),r=kp(),n=bs(),a=Yt(),i=yr(),o=De(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),_l}var Qi,Cl;function Op(){if(Cl)return Qi;Cl=1;var t=yh();return Eh(),Qi=t,Qi}var eo,Al;function Cp(){if(Al)return eo;Al=1;var t=Op();return eo=t,eo}Cp();var Ul={},jl={},to,Ll;function Ap(){if(Ll)return to;Ll=1;var t=nt(),e=Yt();return to=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},to}var ro,Nl;function Up(){if(Nl)return ro;Nl=1;var t=be(),e=Error,r=t("".replace),n=(function(o){return String(new e(o).stack)})("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,i=a.test(n);return ro=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},ro}var no,ql;function jp(){if(ql)return no;ql=1;var t=$e(),e=Zt();return no=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),no}var ao,xl;function Lp(){if(xl)return ao;xl=1;var t=Yt(),e=Up(),r=jp(),n=Error.captureStackTrace;return ao=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},ao}var io,$l;function Hr(){if($l)return io;$l=1;var t=wr(),e=He(),r=st(),n=_n(),a=Ih(),i=ds(),o=Rn(),s=Ps(),u=On(),l=Sh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return io=function(d,v,p){var m=p&&p.that,P=!!(p&&p.AS_ENTRIES),y=!!(p&&p.IS_RECORD),b=!!(p&&p.IS_ITERATOR),g=!!(p&&p.INTERRUPTED),w=t(v,m),A,x,N,z,B,ie,j,D=function(k){return A&&l(A,"normal"),new f(!0,k)},L=function(k){return P?(r(k),g?w(k[0],k[1],D):w(k[0],k[1])):g?w(k,D):w(k)};if(y)A=d.iterator;else if(b)A=d;else{if(x=u(d),!x)throw new c(n(d)+" is not iterable");if(a(x)){for(N=0,z=i(d);z>N;N++)if(B=L(d[N]),B&&o(h,B))return B;return new f(!1)}A=s(d,x)}for(ie=y?d.next:A.next;!(j=e(ie,A)).done;){try{B=L(j.value)}catch(k){l(A,"throw",k)}if(typeof B=="object"&&B&&o(h,B))return B}return new f(!1)},io}var oo,Dl;function Np(){if(Dl)return oo;Dl=1;var t=_t();return oo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},oo}var Ml;function qp(){if(Ml)return jl;Ml=1;var t=Te(),e=Rn(),r=gs(),n=ys(),a=fh(),i=Fr(),o=Yt(),s=Zt(),u=Ap(),l=Lp(),c=Hr(),f=Np(),h=De(),d=h("toStringTag"),v=Error,p=[].push,m=function(b,g){var w=e(P,this),A;n?A=n(new v,w?r(this):P):(A=w?this:i(P),o(A,d,"Error")),g!==void 0&&o(A,"message",f(g)),l(A,m,A.stack,1),arguments.length>2&&u(A,arguments[2]);var x=[];return c(b,p,{that:x}),o(A,"errors",x),A};n?n(m,v):a(m,v,{name:!0});var P=m.prototype=i(v.prototype,{constructor:s(1,m),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:m}),jl}var Fl;function xp(){return Fl||(Fl=1,qp()),Ul}var Kl={},so,zl;function $p(){if(zl)return so;zl=1;var t=Is(),e=zr();return so=t?{}.toString:function(){return"[object "+e(this)+"]"},so}var Hl;function Dp(){if(Hl)return Kl;Hl=1;var t=Is(),e=it(),r=$p();return t||e(Object.prototype,"toString",r,{unsafe:!0}),Kl}var Bl={},Gl={},co,Wl;function Rh(){if(Wl)return co;Wl=1;var t=Se(),e=Mr(),r=bn(),n=function(a){return e.slice(0,a.length)===a};return co=(function(){return n("Bun/")?"BUN":n("Cloudflare-Workers")?"CLOUDFLARE":n("Deno/")?"DENO":n("Node.js/")?"NODE":t.Bun&&typeof Bun.version=="string"?"BUN":t.Deno&&typeof Deno.version=="object"?"DENO":r(t.process)==="process"?"NODE":t.window&&t.document?"BROWSER":"REST"})(),co}var uo,Vl;function Es(){if(Vl)return uo;Vl=1;var t=Rh();return uo=t==="NODE",uo}var lo,Jl;function Mp(){if(Jl)return lo;Jl=1;var t=at(),e=kn(),r=De(),n=Me(),a=r("species");return lo=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},lo}var fo,Zl;function Fp(){if(Zl)return fo;Zl=1;var t=Ph(),e=_n(),r=TypeError;return fo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},fo}var ho,Yl;function _h(){if(Yl)return ho;Yl=1;var t=st(),e=Fp(),r=Sn(),n=De(),a=n("species");return ho=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},ho}var vo,Xl;function Th(){if(Xl)return vo;Xl=1;var t=wn(),e=Function.prototype,r=e.apply,n=e.call;return vo=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),vo}var po,Ql;function kh(){if(Ql)return po;Ql=1;var t=Mr();return po=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),po}var mo,ef;function Oh(){if(ef)return mo;ef=1;var t=Se(),e=Th(),r=wr(),n=Pe(),a=rt(),i=$e(),o=ih(),s=Cn(),u=En(),l=Xt(),c=kh(),f=Es(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,m=t.Function,P=t.MessageChannel,y=t.String,b=0,g={},w="onreadystatechange",A,x,N,z;i(function(){A=t.location});var B=function(L){if(a(g,L)){var k=g[L];delete g[L],k()}},ie=function(L){return function(){B(L)}},j=function(L){B(L.data)},D=function(L){t.postMessage(y(L),A.protocol+"//"+A.host)};return(!h||!d)&&(h=function(k){l(arguments.length,1);var Y=n(k)?k:m(k),te=s(arguments,1);return g[++b]=function(){e(Y,void 0,te)},x(b),b},d=function(k){delete g[k]},f?x=function(L){v.nextTick(ie(L))}:p&&p.now?x=function(L){p.now(ie(L))}:P&&!c?(N=new P,z=N.port2,N.port1.onmessage=j,x=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&A&&A.protocol!=="file:"&&!i(D)?(x=D,t.addEventListener("message",j,!1)):w in u("script")?x=function(L){o.appendChild(u("script"))[w]=function(){o.removeChild(this),B(L)}}:x=function(L){setTimeout(ie(L),0)}),mo={set:h,clear:d},mo}var go,tf;function Ch(){if(tf)return go;tf=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(e){var r={item:e,next:null},n=this.tail;n?n.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},go=t,go}var yo,rf;function Kp(){if(rf)return yo;rf=1;var t=Mr();return yo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",yo}var wo,nf;function zp(){if(nf)return wo;nf=1;var t=Mr();return wo=/web0s(?!.*chrome)/i.test(t),wo}var bo,af;function Hp(){if(af)return bo;af=1;var t=Se(),e=mh(),r=wr(),n=Oh().set,a=Ch(),i=kh(),o=Kp(),s=zp(),u=Es(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,m,P,y;if(!d){var b=new a,g=function(){var w,A;for(u&&(w=f.domain)&&w.exit();A=b.get();)try{A()}catch(x){throw b.head&&v(),x}w&&w.enter()};!i&&!u&&!s&&l&&c?(p=!0,m=c.createTextNode(""),new l(g).observe(m,{characterData:!0}),v=function(){m.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,y=r(P.then,P),v=function(){y(g)}):u?v=function(){f.nextTick(g)}:(n=r(n,t),v=function(){n(g)}),d=function(w){b.head||v(),b.add(w)}}return bo=d,bo}var So,of;function Bp(){return of||(of=1,So=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),So}var Io,sf;function br(){return sf||(sf=1,Io=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Io}var Po,cf;function Sr(){if(cf)return Po;cf=1;var t=Se();return Po=t.Promise,Po}var Eo,uf;function Br(){if(uf)return Eo;uf=1;var t=Se(),e=Sr(),r=Pe(),n=dh(),a=ms(),i=De(),o=Rh(),s=pt(),u=Jd(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var m=new e(function(b){b(1)}),P=function(b){b(function(){},function(){})},y=m.constructor={};if(y[c]=P,f=m.then(function(){})instanceof P,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return Eo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},Eo}var Ro={},lf;function Tt(){if(lf)return Ro;lf=1;var t=ct(),e=TypeError,r=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new e("Bad Promise constructor");a=o,i=s}),this.resolve=t(a),this.reject=t(i)};return Ro.f=function(n){return new r(n)},Ro}var ff;function Gp(){if(ff)return Gl;ff=1;var t=Te(),e=pt(),r=Es(),n=Se(),a=An(),i=He(),o=it(),s=ys(),u=yr(),l=Mp(),c=ct(),f=Pe(),h=nt(),d=Ss(),v=_h(),p=Oh().set,m=Hp(),P=Bp(),y=br(),b=Ch(),g=gr(),w=Sr(),A=Br(),x=Tt(),N="Promise",z=A.CONSTRUCTOR,B=A.REJECTION_EVENT,ie=A.SUBCLASSING,j=g.getterFor(N),D=g.set,L=w&&w.prototype,k=w,Y=L,te=n.TypeError,Q=n.document,S=n.process,_=x.f,q=_,F=!!(Q&&Q.createEvent&&n.dispatchEvent),Z="unhandledrejection",V="rejectionhandled",he=0,oe=1,le=2,se=1,Re=2,Ue,Fe,ke,Ye,ut=function(M){var ee;return h(M)&&f(ee=M.then)?ee:!1},lt=function(M,ee){var fe=ee.value,ve=ee.state===oe,ge=ve?M.ok:M.fail,Xe=M.resolve,je=M.reject,Ge=M.domain,Le,Qe,Qt;try{ge?(ve||(ee.rejection===Re&&J(ee),ee.rejection=se),ge===!0?Le=fe:(Ge&&Ge.enter(),Le=ge(fe),Ge&&(Ge.exit(),Qt=!0)),Le===M.promise?je(new te("Promise-chain cycle")):(Qe=ut(Le))?i(Qe,Le,Xe,je):Xe(Le)):je(fe)}catch(Er){Ge&&!Qt&&Ge.exit(),je(Er)}},mt=function(M,ee){M.notified||(M.notified=!0,m(function(){for(var fe=M.reactions,ve;ve=fe.get();)lt(ve,M);M.notified=!1,ee&&!M.rejection&&T(M)}))},gt=function(M,ee,fe){var ve,ge;F?(ve=Q.createEvent("Event"),ve.promise=ee,ve.reason=fe,ve.initEvent(M,!1,!0),n.dispatchEvent(ve)):ve={promise:ee,reason:fe},!B&&(ge=n["on"+M])?ge(ve):M===Z&&P("Unhandled promise rejection",fe)},T=function(M){i(p,n,function(){var ee=M.facade,fe=M.value,ve=K(M),ge;if(ve&&(ge=y(function(){r?S.emit("unhandledRejection",fe,ee):gt(Z,ee,fe)}),M.rejection=r||K(M)?Re:se,ge.error))throw ge.value})},K=function(M){return M.rejection!==se&&!M.parent},J=function(M){i(p,n,function(){var ee=M.facade;r?S.emit("rejectionHandled",ee):gt(V,ee,M.value)})},re=function(M,ee,fe){return function(ve){M(ee,ve,fe)}},me=function(M,ee,fe){M.done||(M.done=!0,fe&&(M=fe),M.value=ee,M.state=le,mt(M,!0))},Ke=function(M,ee,fe){if(!M.done){M.done=!0,fe&&(M=fe);try{if(M.facade===ee)throw new te("Promise can't be resolved itself");var ve=ut(ee);ve?m(function(){var ge={done:!1};try{i(ve,ee,re(Ke,ge,M),re(me,ge,M))}catch(Xe){me(ge,Xe,M)}}):(M.value=ee,M.state=oe,mt(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(z&&(k=function(ee){d(this,Y),c(ee),i(Ue,this);var fe=j(this);try{ee(re(Ke,fe),re(me,fe))}catch(ve){me(fe,ve)}},Y=k.prototype,Ue=function(ee){D(this,{type:N,done:!1,notified:!1,parent:!1,reactions:new b,rejection:!1,state:he,value:null})},Ue.prototype=o(Y,"then",function(ee,fe){var ve=j(this),ge=_(v(this,k));return ve.parent=!0,ge.ok=f(ee)?ee:!0,ge.fail=f(fe)&&fe,ge.domain=r?S.domain:void 0,ve.state===he?ve.reactions.add(ge):m(function(){lt(ge,ve)}),ge.promise}),Fe=function(){var M=new Ue,ee=j(M);this.promise=M,this.resolve=re(Ke,ee),this.reject=re(me,ee)},x.f=_=function(M){return M===k||M===ke?new Fe(M):q(M)},!e&&f(w)&&L!==Object.prototype)){Ye=L.then,ie||o(L,"then",function(ee,fe){var ve=this;return new k(function(ge,Xe){i(Ye,ve,ge,Xe)}).then(ee,fe)},{unsafe:!0});try{delete L.constructor}catch{}s&&s(L,Y)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:k}),ke=a.Promise,u(k,N,!1,!0),l(N),Gl}var df={},_o,hf;function Wp(){if(hf)return _o;hf=1;var t=De(),e=t("iterator"),r=!1;try{var n=0,a={next:function(){return{done:!!n++}},return:function(){r=!0}};a[e]=function(){return this},Array.from(a,function(){throw 2})}catch{}return _o=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},_o}var To,vf;function Un(){if(vf)return To;vf=1;var t=Sr(),e=Wp(),r=Br().CONSTRUCTOR;return To=r||!e(function(n){t.all(n).then(void 0,function(){})}),To}var pf;function Vp(){if(pf)return df;pf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],m=0,P=1;i(u,function(y){var b=m++,g=!1;P++,e(v,l,y).then(function(w){g||(g=!0,p[b]=w,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),df}var mf={},gf;function Jp(){if(gf)return mf;gf=1;var t=Te(),e=pt(),r=Br().CONSTRUCTOR,n=Sr(),a=at(),i=Pe(),o=it(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return mf}var yf={},wf;function Zp(){if(wf)return yf;wf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),yf}var bf={},Sf;function Yp(){if(Sf)return bf;Sf=1;var t=Te(),e=Tt(),r=Br().CONSTRUCTOR;return t({target:"Promise",stat:!0,forced:r},{reject:function(a){var i=e.f(this),o=i.reject;return o(a),i.promise}}),bf}var If={},ko,Pf;function Ah(){if(Pf)return ko;Pf=1;var t=st(),e=nt(),r=Tt();return ko=function(n,a){if(t(n),e(a)&&a.constructor===n)return a;var i=r.f(n),o=i.resolve;return o(a),i.promise},ko}var Ef;function Xp(){if(Ef)return If;Ef=1;var t=Te(),e=at(),r=pt(),n=Sr(),a=Br().CONSTRUCTOR,i=Ah(),o=e("Promise"),s=r&&!a;return t({target:"Promise",stat:!0,forced:r||a},{resolve:function(l){return i(s&&this===o?n:this,l)}}),If}var Rf;function Qp(){return Rf||(Rf=1,Gp(),Vp(),Jp(),Zp(),Yp(),Xp()),Bl}var _f={},Tf;function em(){if(Tf)return _f;Tf=1;var t=Te(),e=He(),r=ct(),n=Tt(),a=br(),i=Hr(),o=Un();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],m=0,P=1;i(u,function(y){var b=m++,g=!1;P++,e(v,l,y).then(function(w){g||(g=!0,p[b]={status:"fulfilled",value:w},--P||f(p))},function(w){g||(g=!0,p[b]={status:"rejected",reason:w},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),_f}var kf={},Of;function tm(){if(Of)return kf;Of=1;var t=Te(),e=He(),r=ct(),n=at(),a=Tt(),i=br(),o=Hr(),s=Un(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,m=i(function(){var P=r(f.resolve),y=[],b=0,g=1,w=!1;o(c,function(A){var x=b++,N=!1;g++,e(P,f,A).then(function(z){N||w||(w=!0,v(z))},function(z){N||w||(N=!0,y[x]=z,--g||p(new h(y,u)))})}),--g||p(new h(y,u))});return m.error&&p(m.value),d.promise}}),kf}var Cf={},Af;function Uh(){if(Af)return Cf;Af=1;var t=Te(),e=Se(),r=Th(),n=Cn(),a=Tt(),i=ct(),o=br(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Cf}var Uf={},jf;function jh(){if(jf)return Uf;jf=1;var t=Te(),e=Tt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Uf}var Lf={},Nf;function rm(){if(Nf)return Lf;Nf=1;var t=Te(),e=pt(),r=Sr(),n=$e(),a=at(),i=Pe(),o=_h(),s=Ah(),u=it(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Lf}var Oo,qf;function nm(){if(qf)return Oo;qf=1,xp(),bs(),Dp(),Qp(),em(),tm(),Uh(),jh(),rm(),bh();var t=An();return Oo=t.Promise,Oo}var Co,xf;function am(){if(xf)return Co;xf=1;var t=nm();return Eh(),Co=t,Co}var $f={},Df;function im(){return Df||(Df=1,Uh()),$f}var Mf={},Ff;function om(){return Ff||(Ff=1,jh()),Mf}var Ao,Kf;function sm(){if(Kf)return Ao;Kf=1;var t=am();return im(),om(),Ao=t,Ao}sm();const Lh="sesamy-debug";function cm(t,e,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${t}=${e}; ${a}; path=/`}function um(t){if(typeof document>"u")return null;const e=t+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null}function lm(t){cm(Lh,t.toString(),1)}function fm(){return um(Lh)==="true"}function pe(t){fm()&&console.log(t)}function jt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});pe(`Triggering event: ${t}`),dispatchEvent(r)}function vt(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var a=0;for(n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]])}return r}var $t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _s(t,e){return t(e={exports:{}},e.exports),e.exports}var qt=_s((function(t,e){Object.defineProperty(e,"__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})();e.default=function(){return r.getInstance()}}));Rs(qt);var dm=Rs(_s((function(t,e){var r=$t&&$t.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function m(b){try{y(d.next(b))}catch(g){p(g)}}function P(b){try{y(d.throw(b))}catch(g){p(g)}}function y(b){b.done?v(b.value):new h((function(g){g(b.value)})).then(m,P)}y((d=d.apply(c,f||[])).next())}))},n=$t&&$t.__generator||function(c,f){var h,d,v,p,m={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function P(y){return function(b){return(function(g){if(h)throw new TypeError("Generator is already executing.");for(;m;)try{if(h=1,d&&(v=2&g[0]?d.return:g[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,g[1])).done)return v;switch(d=0,v&&(g=[2&g[0],v.value]),g[0]){case 0:case 1:v=g;break;case 4:return m.label++,{value:g[1],done:!1};case 5:m.label++,d=g[1],g=[0];continue;case 7:g=m.ops.pop(),m.trys.pop();continue;default:if(v=m.trys,!((v=v.length>0&&v[v.length-1])||g[0]!==6&&g[0]!==2)){m=0;continue}if(g[0]===3&&(!v||g[1]>v[0]&&g[1]<v[3])){m.label=g[1];break}if(g[0]===6&&m.label<v[1]){m.label=v[1],v=g;break}if(v&&m.label<v[2]){m.label=v[2],m.ops.push(g);break}v[2]&&m.ops.pop(),m.trys.pop();continue}g=f.call(c,m)}catch(w){g=[6,w],d=0}finally{h=v=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}})([y,b])}}},a=$t;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){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=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,p,m,P,y,b;return n(this,(function(g){switch(g.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,m=this.storageHandler===void 0?o:this.storageHandler,g.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return g.sent(),m.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return g.sent(),m.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return g.sent(),(y=m.getItemSync(p))!==null&&(b=JSON.parse(y)).id===this.id&&b.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:g.sent(),g.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,m,P;return n(this,(function(y){switch(y.label){case 0:return[4,qt.default().lock(h)];case 1:return y.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(m=p.getItemSync(f))===null?(qt.default().unlock(h),[2]):((P=JSON.parse(m)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),qt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(qt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),m=!1;function P(){if(m||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(y),m=!0),!v){v=!0;var b=50-(Date.now()-p);b>0?setTimeout(d,b):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var y=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,p;return n(this,(function(m){switch(m.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,qt.default().lock(p.iat)];case 1:m.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),qt.default().unlock(p.iat),c.notifyWaiters(),m.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var m=d.keySync(p);if(m===null)break;v.push(m),p++}for(var P=!1,y=0;y<v.length;y++){var b=v[y];if(b.includes(i)){var g=d.getItemSync(b);if(g!==null){var w=JSON.parse(g);(w.timeRefreshed===void 0&&w.timeAcquired<h||w.timeRefreshed!==void 0&&w.timeRefreshed<h)&&(d.removeItemSync(b),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const hm={timeoutInSeconds:60},Nh={name:"auth0-spa-js",version:"2.8.0"},qh=()=>Date.now();let Ae=class Bo extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,Bo.prototype)}static fromPayload({error:e,error_description:r}){return new Bo(e,r)}},vm=class xh extends Ae{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,xh.prototype)}},pm=class $h extends Ae{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,$h.prototype)}},Go=class Dh extends Ae{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Dh.prototype)}};class Ts extends Go{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Ts.prototype)}}let mm=class Mh extends Ae{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,Mh.prototype)}},gm=class Fh extends Ae{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,Fh.prototype)}},Kh=class zh extends Ae{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${cn(e,["default"])}', scope: '${cn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,zh.prototype)}},ym=class Hh extends Ae{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${cn(e,["default"])}', missing scope: '${cn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,Hh.prototype)}},Bh=class Gh extends Ae{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,Gh.prototype)}};function cn(t,e=[]){return t&&!e.includes(t)?t:""}const un=()=>window.crypto,_r=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(un().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Uo=t=>btoa(t),wm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],bm=t=>Object.keys(t).reduce(((e,r)=>{const n=wm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),Wo=t=>{var{clientId:e}=t,r=vt(t,["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:e},r))).toString()},zf=async t=>await un().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),Hf=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),Bf=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Sm=new TextEncoder,Im=new TextDecoder;function Ur(t){return typeof t=="string"?Sm.encode(t):Im.decode(t)}function Gf(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Em(`${t.name} modulusLength must be at least 2048 bits`)}async function Pm(t,e,r){if(r.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const n=`${jr(Ur(JSON.stringify(t)))}.${jr(Ur(JSON.stringify(e)))}`;return`${n}.${jr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Gf(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Gf(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Ft})(r),r,Ur(n)))}`}let Vo;Uint8Array.prototype.toBase64?Vo=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):Vo=e=>{e instanceof ArrayBuffer&&(e=new Uint8Array(e));const r=[];for(let n=0;n<e.byteLength;n+=32768)r.push(String.fromCharCode.apply(null,e.subarray(n,n+32768)));return btoa(r.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function jr(t){return Vo(t)}let Ft=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},Em=class extends Error{constructor(e){var r;super(e),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}};function Rm(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Ft("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Ft("unsupported CryptoKey algorithm name")}}function Wh(t){return t instanceof CryptoKey}function Vh(t){return Wh(t)&&t.type==="public"}async function _m(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!Wh(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!Vh(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof e!="string")throw new TypeError('"htu" must be a string');if(typeof r!="string")throw new TypeError('"htm" must be a string');if(n!==void 0&&typeof n!="string")throw new TypeError('"nonce" must be a string or undefined');if(a!==void 0&&typeof a!="string")throw new TypeError('"accessToken" must be a string or undefined');return Pm({alg:Rm(o),typ:"dpop+jwt",jwk:await Jh(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?jr(await crypto.subtle.digest("SHA-256",Ur(a))):void 0}),o)}async function Jh(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const Tm=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function km(){return(async function(t,e){var r;let n;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new Ft}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function Om(t){return(async function(e){if(!Vh(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await Jh(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Ft("unsupported JWK kty")}return jr(await crypto.subtle.digest({name:"SHA-256"},Ur(JSON.stringify(n))))})(t.publicKey)}function Cm({keyPair:t,url:e,method:r,nonce:n,accessToken:a}){const i=(function(o){const s=new URL(o);return s.search="",s.hash="",s.href})(e);return _m(t,i,r,n,a)}const Am=async(t,e)=>{const r=await fetch(t,e);return{ok:r.ok,json:await r.json(),headers:(n=r.headers,[...n].reduce(((a,[i,o])=>(a[i]=o,a)),{}))};var n},Um=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([Am(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},jm=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},Lm=async(t,e,r,n,a,i,o=1e4,s)=>a?jm(t,e,r,n,o,a,i,s):Um(t,n,o);async function Zh(t,e,r,n,a,i,o,s,u,l){if(u){const b=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:b})}let c,f=null;for(let b=0;b<3;b++)try{c=await Lm(t,r,n,a,i,o,e,s),f=null;break}catch(g){f=g}if(f)throw f;const h=c.json,{error:d,error_description:v}=h,p=vt(h,["error","error_description"]),{headers:m,ok:P}=c;let y;if(u&&(y=m["dpop-nonce"],y&&await u.setNonce(y)),!P){const b=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new gm(d,b,p.mfa_token);if(d==="missing_refresh_token")throw new Kh(r,n);if(d==="use_dpop_nonce"){if(!u||!y||l)throw new Bh(y);return Zh(t,e,r,n,a,i,o,s,u,!0)}throw new Ae(d||"request_error",b)}return p}async function Nm(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=vt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?Wo(d):JSON.stringify(d),p=(m=c.grant_type,Tm.includes(m));var m;return await Zh(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(bm(o||Nh)))}},e,s,u,p?l:void 0)}const tn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},Wr=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),tn(n,e)};let St=class Jo{constructor(e,r="@@auth0spajs@@",n){this.prefix=r,this.suffix=n,this.clientId=e.clientId,this.scope=e.scope,this.audience=e.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(e){const[r,n,a,i]=e.split("::");return new Jo({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new Jo({scope:r,audience:n,clientId:a})}},qm=class{set(e,r){localStorage.setItem(e,JSON.stringify(r))}get(e){const r=window.localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return}}remove(e){localStorage.removeItem(e)}allKeys(){return Object.keys(window.localStorage).filter((e=>e.startsWith("@@auth0spajs@@")))}},Yh=class{constructor(){this.enclosedCache=(function(){let e={};return{set(r,n){e[r]=n},get(r){const n=e[r];if(n)return n},remove(r){delete e[r]},allKeys:()=>Object.keys(e)}})()}},xm=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||qh}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);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(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);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(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new St({clientId:e.client_id,scope:e.scope,audience:e.audience}),a=await this.wrapCacheEntry(e);await this.cache.set(n.toKey(),a),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(n.toKey()))}async remove(e,r,n){const a=new St({clientId:e,scope:n,audience:r});await this.cache.remove(a.toKey())}async clear(e){var r;const n=await this.getCacheKeys();n&&(await n.filter((a=>!e||a.includes(e))).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(e){const r=await this.nowProvider();return{body:e,expiresAt:Math.floor(r/1e3)+e.expires_in}}async getCacheKeys(){var e;return this.keyManifest?(e=await this.keyManifest.get())===null||e===void 0?void 0:e.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(e){return new St({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=St.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=St.fromKey(a);if(i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId){const o=await this.cache.get(a);if(!((n=o?.body)===null||n===void 0)&&n.refresh_token)return this.modifiedCachedEntry(o,e)}}}async updateEntry(e,r){var n;const a=await this.getCacheKeys();if(a)for(const i of a){const o=await this.cache.get(i);if(((n=o?.body)===null||n===void 0?void 0:n.refresh_token)===e){const s=Object.assign(Object.assign({},o.body),{refresh_token:r});await this.set(s)}}}},$m=class{constructor(e,r,n){this.storage=e,this.clientId=r,this.cookieDomain=n,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(e){this.storage.save(this.storageKey,e,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}};const Tr=t=>typeof t=="number",Dm=["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"],Mm=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(Hf(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],Dm.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(Hf(s)),claims:f,user:h}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.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(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!Tr(e.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(e.claims.exp==null||!Tr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Tr(e.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const r=t.leeway||60,n=new Date(t.now||Date.now()),a=new Date(0);if(a.setUTCSeconds(e.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(e.claims.nbf!=null&&Tr(e.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(e.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(e.claims.auth_time!=null&&Tr(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.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(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const o=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_id}"`)}else{const o=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_name}"`)}}return e};var Kt=_s((function(t,e){var r=$t&&$t.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Rs(Kt),Kt.encode,Kt.parse,Kt.getAll;var Fm=Kt.get,Xh=Kt.set,Qh=Kt.remove;const ar={get(t){const e=Fm(t);if(e!==void 0)return JSON.parse(e)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0,sameSite:"none"}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Xh(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Qh(t,r)}},Km={get(t){return ar.get(t)||ar.get(`_legacy_${t}`)},save(t,e,r){let n={};window.location.protocol==="https:"&&(n={secure:!0}),r?.daysUntilExpire&&(n.expires=r.daysUntilExpire),r?.cookieDomain&&(n.domain=r.cookieDomain),Xh(`_legacy_${t}`,JSON.stringify(e),n),ar.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Qh(t,r),ar.remove(t,e),ar.remove(`_legacy_${t}`,e)}},zm={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Dt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Dt||(Dt={}));function Hm(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,r!==void 0&&r),i=a.indexOf(`
|
|
2
2
|
`,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var Wf,Vf,Jf,jo,Bm=(Wf="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",Vf=null,Jf=!1,function(t){return jo=jo||Hm(Wf,Vf,Jf),new Worker(jo,t)});const Lo={};let Gm=class{constructor(e,r){this.cache=e,this.clientId=r,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(e){var r;const n=new Set(((r=await this.cache.get(this.manifestKey))===null||r===void 0?void 0:r.keys)||[]);n.add(e),await this.cache.set(this.manifestKey,{keys:[...n]})}async remove(e){const r=await this.cache.get(this.manifestKey);if(r){const n=new Set(r.keys);return n.delete(e),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(e){return`@@auth0spajs@@::${e}`}};const Wm={memory:()=>new Yh().enclosedCache,localstorage:()=>new qm},Zf=t=>Wm[t],Yf=t=>{const{openUrl:e,onRedirect:r}=t,n=vt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},Xf=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},Nt={NONCE:"nonce",KEYPAIR:"keypair"};let Vm=class{constructor(e){this.clientId=e}getVersion(){return 1}createDbHandle(){const e=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise(((r,n)=>{e.onupgradeneeded=()=>Object.values(Nt).forEach((a=>e.result.createObjectStore(a))),e.onerror=()=>n(e.error),e.onsuccess=()=>r(e.result)}))}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(e,r,n){const a=n((await this.getDbHandle()).transaction(e,r).objectStore(e));return new Promise(((i,o)=>{a.onsuccess=()=>i(a.result),a.onerror=()=>o(a.error)}))}buildKey(e){const r=e?`_${e}`:"auth0";return`${this.clientId}::${r}`}setNonce(e,r){return this.save(Nt.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save(Nt.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find(Nt.NONCE,this.buildKey(e))}findKeyPair(){return this.find(Nt.KEYPAIR,this.buildKey())}find(e,r){return this.executeDbRequest(e,"readonly",(n=>n.get(r)))}async deleteBy(e,r){const n=await this.executeDbRequest(e,"readonly",(a=>a.getAllKeys()));n?.filter(r).map((a=>this.executeDbRequest(e,"readwrite",(i=>i.delete(a)))))}deleteByClientId(e,r){return this.deleteBy(e,(n=>typeof n=="string"&&n.startsWith(`${r}::`)))}clearNonces(){return this.deleteByClientId(Nt.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(Nt.KEYPAIR,this.clientId)}},Jm=class{constructor(e){this.storage=new Vm(e)}getNonce(e){return this.storage.findNonce(e)}setNonce(e,r){return this.storage.setNonce(e,r)}async getOrGenerateKeyPair(){let e=await this.storage.findKeyPair();return e||(e=await km(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return Cm(Object.assign({keyPair:r},e))}async calculateThumbprint(){return Om(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var ir;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(ir||(ir={}));let Zm=class{constructor(e,r){this.hooks=r,this.config=Object.assign(Object.assign({},e),{fetch:e.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(e){return/^(https?:)?\/\//i.test(e)}buildUrl(e,r){if(r){if(this.isAbsoluteUrl(r))return r;if(e)return`${e.replace(/\/?\/$/,"")}/${r.replace(/^\/+/,"")}`}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(e){return this.config.getAccessToken?this.config.getAccessToken(e):this.hooks.getAccessToken(e)}extractUrl(e){return typeof e=="string"?e:e instanceof URL?e.href:e.url}buildBaseRequest(e,r){if(!this.config.baseUrl)return new Request(e,r);const n=this.buildUrl(this.config.baseUrl,this.extractUrl(e)),a=e instanceof Request?new Request(n,e):n;return new Request(a,r)}setAuthorizationHeader(e,r,n=ir.Bearer){e.headers.set("authorization",`${n} ${r}`)}async setDpopProofHeader(e,r){if(!this.config.dpopNonceId)return;const n=await this.hooks.getDpopNonce(),a=await this.hooks.generateDpopProof({accessToken:r,method:e.method,nonce:n,url:e.url});e.headers.set("dpop",a)}async prepareRequest(e,r){const n=await this.getAccessToken(r);let a,i;typeof n=="string"?(a=this.config.dpopNonceId?ir.DPoP:ir.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===ir.DPoP&&await this.setDpopProofHeader(e,i)}getHeader(e,r){return Array.isArray(e)?new Headers(e).get(r)||"":typeof e.get=="function"?e.get(r)||"":e[r]||""}hasUseDpopNonceError(e){if(e.status!==401)return!1;const r=this.getHeader(e.headers,"www-authenticate");return r.includes("invalid_dpop_nonce")||r.includes("use_dpop_nonce")}async handleResponse(e,r){const n=this.getHeader(e.headers,"dpop-nonce");if(n&&await this.hooks.setDpopNonce(n),!this.hasUseDpopNonceError(e))return e;if(!n||!r.onUseDpopNonceError)throw new Bh(n);return r.onUseDpopNonceError()}async internalFetchWithAuth(e,r,n,a){const i=this.buildBaseRequest(e,r);await this.prepareRequest(i,a);const o=await this.config.fetch(i);return this.handleResponse(o,n)}fetchWithAuth(e,r,n){const a={onUseDpopNonceError:()=>this.internalFetchWithAuth(e,r,Object.assign(Object.assign({},a),{onUseDpopNonceError:void 0}),n)};return this.internalFetchWithAuth(e,r,a,n)}},Ym=class{constructor(e,r){this.myAccountFetcher=e,this.apiBase=r}async connectAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async completeAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async _handleResponse(e){let r;try{r=await e.text(),r=JSON.parse(r)}catch(n){throw new Qf({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new Qf(r)}},Qf=class ev extends Error{constructor({type:e,status:r,title:n,detail:a,validation_errors:i}){super(a),this.name="MyAccountApiError",this.type=e,this.status=r,this.title=n,this.detail=a,this.validation_errors=i,Object.setPrototypeOf(this,ev.prototype)}};const No=new dm;let Xm=class{constructor(e){let r,n;if(this.userCache=new Yh().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await No.releaseLock(l);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),e),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),e.authorizationParams)}),typeof window<"u"&&(()=>{if(!un())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(un().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
|
-
`)})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(r=e.cacheLocation||"memory",!Zf(r))throw new Error(`Invalid cache location "${r}"`);n=Zf(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?ar:Km,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:zm;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:tn(l,u,...c)};let f={default:tn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=tn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new $m(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||qh,this.cacheManager=new xm(n,n.allKeys?void 0:new Gm(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Jm(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Ym(s,o),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Bm)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Nh)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${Wo(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return Mm({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,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(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,r,n){var a;const i=Uo(_r()),o=Uo(_r()),s=_r(),u=await zf(s),l=Bf(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,m,P,y,b,g,w)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:Wr(v,p.scope,p.audience),response_type:"code",response_mode:g||"query",state:m,nonce:P,redirect_uri:b||d.authorizationParams.redirect_uri,code_challenge:y,code_challenge_method:"S256",dpop_jkt:w}))(this.options,this.scope,e,i,o,l,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,r?.response_mode,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},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(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new mm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Ts(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ae.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ae("state_mismatch","Invalid state");const o=((n=e.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 e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(e={}){var r;const n=Yf(e),{openUrl:a,fragment:i,appState:o}=n,s=vt(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=vt(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Dt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ae("missing_transaction","Invalid state");this.transactionManager.remove();const a=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const o=new URLSearchParams(i);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(r.join(""));return n.response_type===Dt.ConnectCode?this._handleConnectAccountRedirectCallback(a,n):this._handleLoginRedirectCallback(a,n)}async _handleLoginRedirectCallback(e,r){const{code:n,state:a,error:i,error_description:o}=e;if(i)throw new vm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ae("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:Dt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new pm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ae("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ae("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:r.auth_session,connect_code:n,redirect_uri:r.redirect_uri,code_verifier:r.code_verifier});return Object.assign(Object.assign({},s),{appState:r.appState,response_type:Dt.ConnectCode})}async checkSession(e){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(e)}catch{}}async getTokenSilently(e={}){var r,n;const a=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Wr(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Lo[s];return u||(u=o().finally((()=>{delete Lo[s],u=null})),Lo[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=vt(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>No.acquireLock(a,5e3)),10))throw new Go;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await No.releaseLock(a),this.activeLockKeys.delete(a),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},r={}){var n,a;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Wr(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((a=e.authorizationParams)===null||a===void 0?void 0:a.audience)||this.options.authorizationParams.audience)})});return r=Object.assign(Object.assign({},hm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new St({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const r=e.logoutParams||{},{federated:n}=r,a=vt(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Wo(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=Yf(e),{openUrl:a}=n,i=vt(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.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@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.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:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ae("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch{h=this.domainUrl}const d=await((p,m,P=60)=>new Promise(((y,b)=>{const g=window.document.createElement("iframe");g.setAttribute("width","0"),g.setAttribute("height","0"),g.style.display="none";const w=()=>{window.document.body.contains(g)&&(window.document.body.removeChild(g),window.removeEventListener("message",A,!1))};let A;const x=setTimeout((()=>{b(new Go),w()}),1e3*P);A=function(N){if(N.origin!=m||!N.data||N.data.type!=="authorization_response")return;const z=N.source;z&&z.close(),N.data.response.error?b(Ae.fromPayload(N.data.response)):y(N.data.response),clearTimeout(x),window.removeEventListener("message",A,!1),setTimeout(w,2e3)},window.addEventListener("message",A,!1),window.document.body.appendChild(g),g.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ae("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new St({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new Kh(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),m=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=m.every((y=>p.includes(y)));return p.length>=m.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!Xf(l,s))&&!Xf(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((m=>p.indexOf(m)==-1)).join(",")})(i,c.scope);throw new ym(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=vt(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",r=this.scope[e],n=await this.cacheManager.getIdToken(new St({clientId:this.options.clientId,audience:e,scope:r})),a=this.userCache.get("@@user@@");return n&&n.id_token===a?.id_token?a:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:r,clientId:n,cacheMode:a}){const i=await this.cacheManager.get(new St({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await Nm(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:i||e.scope}),this.worker),s=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:s,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||s.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:s})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:Wr(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,r){return this._assertDpop(this.dpop),this.dpop.setNonce(e,r)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new Zm(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:r=>{var n;return this.getTokenSilently({authorizationParams:{scope:(n=r?.scope)===null||n===void 0?void 0:n.join(" "),audience:r?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:r=>this.setDpopNonce(r,e.dpopNonceId),generateDpopProof:r=>this.generateDpopProof(r)})}async connectAccountWithRedirect(e){const{openUrl:r,appState:n,connection:a,authorization_params:i,redirectUri:o=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!a)throw new Error("connection is required");const s=Uo(_r()),u=_r(),l=await zf(u),c=Bf(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:Dt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Qm(t){const e=new Xm(t);return await e.checkSession(),e}var Je=(t=>(t.AUTH_INITIALIZED="sesamyJsAuthInitialized",t.READY="sesamyJsReady",t.AUTHENTICATED="sesamyJsAuthenticated",t.LOGOUT="sesamyJsLogout",t.CLEAR_CACHE="sesamyJsClearCache",t.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",t.PURCHASE="sesamyJsPurchase",t))(Je||{});const eg="sesamy.com",tg="sesamy.dev",rg="https://sesa.my",ed="sesamyCacheTimestamp",td="sesamyContentReloaded";function tv(t,e){return`${t}.${e==="dev"?tg:eg}`}function ht(t,e){return`https://${tv(t,e)}`}function ln(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
|
|
4
|
+
`)})(),e.cache&&e.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),e.cache)n=e.cache;else{if(r=e.cacheLocation||"memory",!Zf(r))throw new Error(`Invalid cache location "${r}"`);n=Zf(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?ar:Km,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:zm;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:tn(l,u,...c)};let f={default:tn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=tn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new $m(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||qh,this.cacheManager=new xm(n,n.allKeys?void 0:new Gm(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Jm(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Ym(s,o),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&r==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Bm)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Nh)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${Wo(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return Mm({iss:this.tokenIssuer,aud:this.options.clientId,id_token:e,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(e){e?this.cookieStorage.save(this.orgHintCookieName,e,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(e,r,n){var a;const i=Uo(_r()),o=Uo(_r()),s=_r(),u=await zf(s),l=Bf(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,m,P,y,b,g,w)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:Wr(v,p.scope,p.audience),response_type:"code",response_mode:g||"query",state:m,nonce:P,redirect_uri:b||d.authorizationParams.redirect_uri,code_challenge:y,code_challenge_method:"S256",dpop_jkt:w}))(this.options,this.scope,e,i,o,l,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,r?.response_mode,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},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(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new mm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Ts(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ae.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ae("state_mismatch","Invalid state");const o=((n=e.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 e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.user}async getIdTokenClaims(){var e;const r=await this._getIdTokenFromCache();return(e=r?.decodedToken)===null||e===void 0?void 0:e.claims}async loginWithRedirect(e={}){var r;const n=Yf(e),{openUrl:a,fragment:i,appState:o}=n,s=vt(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=vt(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Dt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ae("missing_transaction","Invalid state");this.transactionManager.remove();const a=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const o=new URLSearchParams(i);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(r.join(""));return n.response_type===Dt.ConnectCode?this._handleConnectAccountRedirectCallback(a,n):this._handleLoginRedirectCallback(a,n)}async _handleLoginRedirectCallback(e,r){const{code:n,state:a,error:i,error_description:o}=e;if(i)throw new vm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ae("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:Dt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new pm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ae("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ae("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:r.auth_session,connect_code:n,redirect_uri:r.redirect_uri,code_verifier:r.code_verifier});return Object.assign(Object.assign({},s),{appState:r.appState,response_type:Dt.ConnectCode})}async checkSession(e){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(e)}catch{}}async getTokenSilently(e={}){var r,n;const a=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Wr(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Lo[s];return u||(u=o().finally((()=>{delete Lo[s],u=null})),Lo[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=vt(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>No.acquireLock(a,5e3)),10))throw new Go;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await No.releaseLock(a),this.activeLockKeys.delete(a),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(e={},r={}){var n,a;const i=Object.assign(Object.assign({},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:Wr(this.scope,(n=e.authorizationParams)===null||n===void 0?void 0:n.scope,((a=e.authorizationParams)===null||a===void 0?void 0:a.audience)||this.options.authorizationParams.audience)})});return r=Object.assign(Object.assign({},hm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new St({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(e){e.clientId!==null?e.clientId=e.clientId||this.options.clientId:delete e.clientId;const r=e.logoutParams||{},{federated:n}=r,a=vt(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${Wo(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=Yf(e),{openUrl:a}=n,i=vt(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.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@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.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:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ae("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const f=e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let h;try{h=new URL(this.domainUrl).origin}catch{h=this.domainUrl}const d=await((p,m,P=60)=>new Promise(((y,b)=>{const g=window.document.createElement("iframe");g.setAttribute("width","0"),g.setAttribute("height","0"),g.style.display="none";const w=()=>{window.document.body.contains(g)&&(window.document.body.removeChild(g),window.removeEventListener("message",A,!1))};let A;const x=setTimeout((()=>{b(new Go),w()}),1e3*P);A=function(N){if(N.origin!=m||!N.data||N.data.type!=="authorization_response")return;const z=N.source;z&&z.close(),N.data.response.error?b(Ae.fromPayload(N.data.response)):y(N.data.response),clearTimeout(x),window.removeEventListener("message",A,!1),setTimeout(w,2e3)},window.addEventListener("message",A,!1),window.document.body.appendChild(g),g.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ae("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new St({scope:e.authorizationParams.scope,audience:e.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw new Kh(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),m=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=m.every((y=>p.includes(y)));return p.length>=m.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!Xf(l,s))&&!Xf(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((m=>p.indexOf(m)==-1)).join(",")})(i,c.scope);throw new ym(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=vt(e,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:r,decodedToken:n}),await this.cacheManager.setIdToken(this.options.clientId,e.id_token,e.decodedToken),await this.cacheManager.set(a)}async _getIdTokenFromCache(){const e=this.options.authorizationParams.audience||"default",r=this.scope[e],n=await this.cacheManager.getIdToken(new St({clientId:this.options.clientId,audience:e,scope:r})),a=this.userCache.get("@@user@@");return n&&n.id_token===a?.id_token?a:(this.userCache.set("@@user@@",n),n)}async _getEntryFromCache({scope:e,audience:r,clientId:n,cacheMode:a}){const i=await this.cacheManager.get(new St({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await Nm(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},e),{scope:i||e.scope}),this.worker),s=await this._verifyIdToken(o.id_token,n,a);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},o),{decodedToken:s,scope:e.scope,audience:e.audience||"default"}),o.scope?{oauthTokenScope:o.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||s.claims.org_id),Object.assign(Object.assign({},o),{decodedToken:s})}async exchangeToken(e){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:e.subject_token,subject_token_type:e.subject_token_type,scope:Wr(this.scope,e.scope,e.audience||this.options.authorizationParams.audience),audience:e.audience||this.options.authorizationParams.audience})}_assertDpop(e){if(!e)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(e){return this._assertDpop(this.dpop),this.dpop.getNonce(e)}setDpopNonce(e,r){return this._assertDpop(this.dpop),this.dpop.setNonce(e,r)}generateDpopProof(e){return this._assertDpop(this.dpop),this.dpop.generateProof(e)}createFetcher(e={}){return new Zm(e,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:r=>{var n;return this.getTokenSilently({authorizationParams:{scope:(n=r?.scope)===null||n===void 0?void 0:n.join(" "),audience:r?.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(e.dpopNonceId),setDpopNonce:r=>this.setDpopNonce(r,e.dpopNonceId),generateDpopProof:r=>this.generateDpopProof(r)})}async connectAccountWithRedirect(e){const{openUrl:r,appState:n,connection:a,authorization_params:i,redirectUri:o=this.options.authorizationParams.redirect_uri||window.location.origin}=e;if(!a)throw new Error("connection is required");const s=Uo(_r()),u=_r(),l=await zf(u),c=Bf(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:Dt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Qm(t){const e=new Xm(t);return await e.checkSession(),e}var Ze=(t=>(t.AUTH_INITIALIZED="sesamyJsAuthInitialized",t.READY="sesamyJsReady",t.AUTHENTICATED="sesamyJsAuthenticated",t.LOGOUT="sesamyJsLogout",t.CLEAR_CACHE="sesamyJsClearCache",t.USER_ATTRIBUTE_CHANGED="sesamyUserAttributeChanged",t.PURCHASE="sesamyJsPurchase",t))(Ze||{});const eg="sesamy.com",tg="sesamy.dev",rg="https://sesa.my",ed="sesamyCacheTimestamp",td="sesamyContentReloaded";function tv(t,e){return`${t}.${e==="dev"?tg:eg}`}function ht(t,e){return`https://${tv(t,e)}`}function ln(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
|
|
5
5
|
*
|
|
6
6
|
* detectIncognito v1.6.2
|
|
7
7
|
*
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
*
|
|
32
32
|
* Please keep this comment intact in order to properly abide by the MIT License.
|
|
33
33
|
*
|
|
34
|
-
**/var Zo={d:(t,e)=>{for(var r in e)Zo.o(e,r)&&!Zo.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},ks={};Zo.d(ks,{A:()=>ng,k:()=>Os});var kr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Or=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Os(){return kr(this,void 0,Promise,function(){return Or(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",a=!1;function i(h){a||(a=!0,e({isPrivate:h,browserName:n}))}function o(){var h=0,d=parseInt("-1");try{d.toFixed(d)}catch(v){h=v.message.length}return h}function s(){return kr(this,void 0,void 0,function(){var h,d;return Or(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return kr(this,void 0,Promise,function(){return Or(this,function(d){switch(d.label){case 0:return typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var v=String(Math.random());try{var p=indexedDB.open(v,1);p.onupgradeneeded=function(m){var P=m.target.result,y=function(b){i(b)};try{P.createObjectStore("t",{autoIncrement:!0}).put(new Blob),y(!1)}catch(b){(b instanceof Error&&typeof b.message=="string"?b.message:String(b)).includes("are not yet supported")?y(!0):y(!1)}finally{P.close(),indexedDB.deleteDatabase(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var m,P,y,b=window;return(y=(P=(m=b?.performance)===null||m===void 0?void 0:m.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&y!==void 0?y:1073741824})()/1048576);i(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return kr(this,void 0,Promise,function(){var d,v,p;return Or(this,function(m){switch(m.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return m.sent(),i(!1),[3,4];case 3:return d=m.sent(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},m.label=6;case 6:return[2]}})})}(function(){return kr(this,void 0,Promise,function(){return Or(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Os);const ng=Os;ks.A;const ag=ks.k,rn="sesamy_incognito_mode";function Cs(){try{const t=sessionStorage.getItem(rn);return t===null?void 0:t==="true"}catch{return}}async function ig(){try{const t=sessionStorage.getItem(rn);if(t!==null)return t==="true";const{isPrivate:e}=await ag();return sessionStorage.setItem(rn,e.toString()),e}catch{try{sessionStorage.setItem(rn,"false")}catch{}return!1}}function qr(){return typeof window<"u"}function rd(t,e,r,n,a){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)t=t?t[e[n]]:a;return t===a?r:t}var og="function",sg="string",ot="undefined",cg="boolean",fn="object",ug="array",lg="number",fg="symbol",dg="null",Yo=function(){},rv="any",nv="*",Wt="__",hg="form",vg="input",pg="button",mg="select",dn=typeof process!==ot?process:{};dn.env&&dn.env.NODE_ENV;var xe=typeof document!==ot;dn.versions!=null&&dn.versions.node!=null;typeof Deno!==ot&&Deno.core;xe&&window.name==="nodejs"||typeof navigator!==ot&&typeof navigator.userAgent!==ot&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function av(t,e){return e.charAt(0)[t]()+e.slice(1)}var gg=av.bind(null,"toUpperCase"),yg=av.bind(null,"toLowerCase");function wg(t){return iv(t)?gg(dg):typeof t===fn?Pg(t):Object.prototype.toString.call(t).slice(8,-1)}function hn(t,e){e===void 0&&(e=!0);var r=wg(t);return e?yg(r):r}function Gr(t,e){return typeof e===t}var Ve=Gr.bind(null,og),At=Gr.bind(null,sg),or=Gr.bind(null,ot),bg=Gr.bind(null,cg);Gr.bind(null,fg);function iv(t){return t===null}function Sg(t){return hn(t)===lg&&!isNaN(t)}function ov(t){return hn(t)===ug}function We(t){if(!Ig(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ig(t){return t&&(typeof t===fn||t!==null)}function Pg(t){return Ve(t.constructor)?t.constructor.name:null}function Eg(t){return t instanceof Error||At(t.message)&&t.constructor&&Sg(t.constructor.stackTraceLimit)}function sv(t,e){if(typeof e!="object"||iv(e))return!1;if(e instanceof t)return!0;var r=hn(new t(""));if(Eg(e))for(;e;){if(hn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}sv.bind(null,TypeError);sv.bind(null,SyntaxError);function jn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Rg(t,e):r}function Rg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Ln(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Ln(jn,hg);Ln(jn,pg);Ln(jn,vg);Ln(jn,mg);function _g(t){return t?ov(t)?t:[t]:[]}function nd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Tg(){if(xe){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function kg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Og(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=nd(r[1]),o=nd(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(Cg(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return xe&&window.location.search.substring(1)})())}function Cg(t,e,r){for(var n=e.length-1,a=0;a<n;++a){var i=e[a];if(i==="__proto__"||i==="constructor")break;i in t||(t[i]={}),t=t[i]}t[e[n]]=r}function Nn(){for(var t="",e=0,r=4294967295*Math.random()|0;e++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],a=15&r;t+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=e%8==0?4294967295*Math.random()|0:r>>4}return t}function Ag(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var zt="global",dr=Wt+zt+Wt,hr=typeof self===fn&&self.self===self&&self||typeof global===fn&&global[zt]===global&&global||void 0;function Vt(t){return hr[dr][t]}function Jt(t,e){return hr[dr][t]=e}function Ir(t){delete hr[dr][t]}function Pr(t,e,r){var n;try{if(As(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}hr[dr]||(hr[dr]={});var Vr={};function As(t){if(typeof Vr[t]!==ot)return Vr[t];try{var e=window[t];e.setItem(ot,ot),e.removeItem(ot)}catch{return Vr[t]=!1}return Vr[t]=!0}function ae(){return ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ae.apply(null,arguments)}var Ot="function",It="undefined",Lr="reducer",cv="@@redux/",Xo=cv+"INIT",Ug=cv+Math.random().toString(36),ad=(function(){return typeof Symbol===Ot&&Symbol.observable||"@@observable"})(),Jr=" != "+Ot;function uv(t,e,r){var n;if(typeof e===Ot&&typeof r===It&&(r=e,e=void 0),typeof r!==It){if(typeof r!==Ot)throw new Error("enhancer"+Jr);return r(uv)(t,e)}if(typeof t!==Ot)throw new Error(Lr+Jr);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==Ot)throw new Error("Listener"+Jr);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!We(d))throw new Error("Act != obj");if(typeof d.type===It)throw new Error("ActType "+It);if(u)throw new Error("Dispatch in "+Lr);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:Xo}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Ot)throw new Error("next "+Lr+Jr);a=d,h({type:Xo})}})[ad]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function m(){p.next&&p.next(c())}return m(),{unsubscribe:v(m)}}})[ad]=function(){return this},d},n}function jg(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Lr+" "+t+" returns "+It}function vr(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function Lg(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ae({},o,{dispatch:s=vr.apply(void 0,i)(o.dispatch)})}}}var Ut=Wt+"anon_id",Ht=Wt+"user_id",cr=Wt+"user_traits",Qo="analytics",kt="userId",sr="anonymousId",nn=["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"],es=["name","EVENTS","config","loaded"],ne=nn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),id=/^utm_/,od=/^an_prop_/,sd=/^an_trait_/;function Ng(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===ne.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ut,o.anonymousId),l||e(Ht,o.userId),u.traits&&e(cr,ae({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(v,p){if(p.match(id)||p.match(/^(d|g)clid/)){var m=p.replace(id,"");v.campaign[m==="campaign"?"name":m]=i[p]}return p.match(od)&&(v.props[p.replace(od,"")]=i[p]),p.match(sd)&&(v.traits[p.replace(sd,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(ae({type:ne.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return t.identify(f,d.traits)},0),h&&setTimeout(function(){return t.track(h,d.props)},0),Object.keys(d.campaign).length&&r.dispatch({type:ne.campaign,campaign:d.campaign})}}return n(a)}}}}function qg(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===ne.setItemEnd){if(r.key===Ut)return ae({},e,{anonymousId:r.value});if(r.key===Ht)return ae({},e,{userId:r.value})}switch(r.type){case ne.identify:return Object.assign({},e,{userId:r.userId,traits:ae({},e.traits,r.traits)});case ne.reset:return[Ht,Ut,cr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function cd(t){return{userId:t.getItem(Ht),anonymousId:t.getItem(Ut),traits:t.getItem(cr)}}var ts=function(t){return Wt+"TEMP"+Wt+t};function xg(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===ne.reset&&([Ht,cr,Ut].forEach(function(d){n(d)}),[kt,sr,"traits"].forEach(function(d){Ir(ts(d))})),s.type===ne.identify){a(Ut)||r(Ut,Nn());var f=a(Ht),h=a(cr)||{};f&&f!==u&&i.dispatch({type:ne.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Ht,u),l&&r(cr,ae({},h,l))}return o(s)}}}}var Ar={};function ud(t,e){Ar[t]&&Ve(Ar[t])&&(Ar[t](e),delete Ar[t])}function lv(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ae({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return lv(t,e,r-10).then(n,a)})})}function $g(t){return{abort:t}}function fv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&Ve(p)){var m,P=(function(g,w){return g===void 0&&(g={}),w===void 0&&(w={}),[kt,sr].reduce(function(A,x){return g.hasOwnProperty(x)&&w[x]&&w[x]!==g[x]&&(A[x]=w[x]),A},g)})(h.payload,u),y=n[P.meta.rid];if(!y&&(m=p({payload:P,config:o[d].config,instance:r,abort:$g}))&&We(m)&&m.abort)return void(n[P.meta.rid]=!0);if(!y){var b=v+":"+d;t.dispatch(ae({},P,{type:b,_:{called:b,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var qo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(ur),d=e.exact.map(function(m){return m.pluginName});h&&(d=o.during.map(function(m){return m.pluginName}));var v=(function(m,P){return function(y,b,g){var w=b.config,A=b.name,x=A+"."+y.type;g&&(x=g.event);var N=y.type.match(ur)?(function(z,B,ie,j,D){return function(L,k){var Y=j?j.name:z,te=k&&xr(k)?k:ie;if(j&&(!(te=k&&xr(k)?k:[z]).includes(z)||te.length!==1))throw new Error("Method "+B+" can only abort "+z+" plugin. "+JSON.stringify(te)+" input valid");return ae({},D,{abort:{reason:L,plugins:te,caller:B,_:Y}})}})(A,x,P,g,y):(function(z,B){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+B)}})(y,x);return{payload:Dg(y),instance:m,config:w||{},abort:N}}})(n,d),p=e.exact.reduce(function(m,P){var y=P.pluginName,b=P.methodName,g=!1;return b.match(/^initialize/)||b.match(/^reset/)||(g=!l[y].loaded),c.offline&&b.match(/^(page|track|identify)/)&&(g=!0),m[""+y]=g,m},{});return Promise.resolve(e.exact.reduce(function(m,P,y){var b=P.pluginName;return Promise.resolve(m).then(function(g){function w(){return Promise.resolve(g)}var A=(function(){if(e.namespaced&&e.namespaced[b])return Promise.resolve(e.namespaced[b].reduce(function(x,N,z){return Promise.resolve(x).then(function(B){return N.method&&Ve(N.method)?((function(L,k){var Y=md(L);if(Y&&Y.name===k){var te=md(Y.method);throw new Error([k+" plugin is calling method "+L,"Plugins cant call self","Use "+Y.method+" "+(te?"or "+te.method:"")+" in "+k+" plugin insteadof "+L].join(`
|
|
35
|
-
`))}})(N.methodName,N.pluginName),Promise.resolve(N.method({payload:B,instance:n,abort:(ie=B,j=b,D=N.pluginName,function(L,k){return ae({},ie,{abort:{reason:L,plugins:k||[j],caller:f,from:D||j}})}),config:dd(N.pluginName,l,i),plugins:l})).then(function(L){var k=We(L)?L:{};return Promise.resolve(ae({},B,k))})):B;var ie,j,D})},Promise.resolve(r))).then(function(x){g[b]=x});g[b]=r})();return A&&A.then?A.then(w):w()})},Promise.resolve({}))).then(function(m){return Promise.resolve(e.exact.reduce(function(P,y,b){try{var g=e.exact.length===b+1,w=y.pluginName,A=i[w];return Promise.resolve(P).then(function(x){var N=m[w]?m[w]:{};if(h&&(N=x),$o(N,w))return xo({data:N,method:f,instance:n,pluginName:w,store:s}),Promise.resolve(x);if($o(x,w))return g&&xo({data:x,method:f,instance:n,store:s}),Promise.resolve(x);if(p.hasOwnProperty(w)&&p[w]===!0)return s.dispatch({type:"queue",plugin:w,payload:N,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(x);var z=v(m[w],i[w]);return Promise.resolve(A[f]({abort:z.abort,payload:N,instance:n,config:dd(w,l,i),plugins:l})).then(function(B){var ie=We(B)?B:{},j=ae({},x,ie),D=m[w];if($o(D,w))xo({data:D,method:f,instance:n,pluginName:w,store:s});else{var L=f+":"+w;(L.match(/:/g)||[]).length<2&&!f.match(ld)&&!f.match(fd)&&n.dispatch(ae({},h?j:N,{type:L,_:{called:L,from:"submethod"}}))}return Promise.resolve(j)})})}catch(x){return Promise.reject(x)}},Promise.resolve(r))).then(function(P){if(!(f.match(ur)||f.match(/^registerPlugin/)||f.match(fd)||f.match(ld)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var y=ae({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});dv(P,e.exact.length)&&!f.match(/End$/)&&(y=ae({},y,{type:P.type+"Aborted"})),s.dispatch(y)}return P})})}catch(m){return Promise.reject(m)}},ur=/Start$/,ld=/^bootstrap/,fd=/^ready/;function xo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ae({},t.data,{type:r,_:{called:r,from:"abort"}}))}function dd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function hd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function vd(t,e){var r=t.replace(ur,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function $o(t,e){var r=t.abort;return!!r&&(r===!0||pd(r,e)||r&&pd(r.plugins,e))}function dv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||At(r))return!0;var n=r.plugins;return xr(r)&&r.length===e||xr(n)&&n.length===e}function xr(t){return Array.isArray(t)}function pd(t,e){return!(!t||!xr(t))&&t.includes(e)}function md(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Dg(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=We(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Mg(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(g){return s?g:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===ne.enablePlugin&&a.dispatch({type:ne.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===ne.disablePlugin&&setTimeout(function(){return ud(o.meta.rid,{payload:o})},0),l===ne.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(g){return c.includes(g)}).map(function(g){return h[g]}),p=[],m=[],P=o.disabled,y=v.map(function(g){var w=g.loaded,A=g.name,x=g.config;return lv(g,function(){return w({config:x})},1e4).then(function(N){return n[A]||(a.dispatch({type:ne.pluginReadyType(A),name:A,events:Object.keys(g).filter(function(z){return!es.includes(z)})}),n[A]=!0),p=p.concat(A),g}).catch(function(N){if(N instanceof Error)throw new Error(N);return m=m.concat(N.name),N})});Promise.all(y).then(function(g){var w={plugins:p,failed:m,disabled:P};setTimeout(function(){d.length===y.length+P.length&&a.dispatch(ae({},{type:ne.ready},w))},0)})}var b=(function(){if(l!==ne.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return fv(a,e,t)},0),Promise.resolve((function(g,w,A,x,N){try{var z=Ve(w)?w():w,B=g.type,ie=B.replace(ur,"");if(g._&&g._.called)return Promise.resolve(g);var j=A.getState(),D=(Y=z,(te=j.plugins)===void 0&&(te={}),(Q=g.options)===void 0&&(Q={}),Object.keys(Y).filter(function(S){var _=Q.plugins||{};return bg(_[S])?_[S]:_.all!==!1&&(!te[S]||te[S].enabled!==!1)}).map(function(S){return Y[S]}));B===ne.initializeStart&&g.fromEnable&&(D=Object.keys(j.plugins).filter(function(S){var _=j.plugins[S];return g.plugins.includes(S)&&!_.initialized}).map(function(S){return z[S]}));var L=D.map(function(S){return S.name}),k=(function(S,_){var q=vd(S).map(function(F){return hd(F,_)});return _.reduce(function(F,Z){var V=Z.name,he=vd(S,V).map(function(Re){return hd(Re,_)}),oe=he[0],le=he[1],se=he[2];return oe.length&&(F.beforeNS[V]=oe),le.length&&(F.duringNS[V]=le),se.length&&(F.afterNS[V]=se),F},{before:q[0],beforeNS:{},during:q[1],duringNS:{},after:q[2],afterNS:{}})})(B,D);return Promise.resolve(qo({action:g,data:{exact:k.before,namespaced:k.beforeNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(S){function _(){var Z=(function(){if(B.match(ur))return Promise.resolve(qo({action:ae({},q,{type:ie+"End"}),data:{exact:k.after,namespaced:k.afterNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(V){V.meta&&V.meta.hasCallback&&ud(V.meta.rid,{payload:V})})})();return Z&&Z.then?Z.then(function(){return S}):S}if(dv(S,L.length))return S;var q,F=(function(){if(B!==ie)return Promise.resolve(qo({action:ae({},S,{type:ie}),data:{exact:k.during,namespaced:k.duringNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(Z){q=Z});q=S})();return F&&F.then?F.then(_):_()})}catch(S){return Promise.reject(S)}var Y,te,Q})(o,e,t,a,r)).then(function(g){var w=i(g);return s=1,w})})();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(g){return Promise.reject(g)}}}}}function Fg(t){return function(e){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===ne.setItem||a===ne.removeItem){if(n.abort)return r(n);a===ne.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var Kg=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return vr.apply(void 0,o)(n)(a)}}}}};function zg(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=gd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ae({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=gd(r.type,ne.initialize),l=t()[u];return l&&u?(n[u]=ae({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ae({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ae({},e[r.name],{loaded:!0}),ae({},e,n);switch(r.type){case ne.disablePlugin:return ae({},e,yd(r.plugins,!1,e));case ne.enablePlugin:return ae({},e,yd(r.plugins,!0,e));default:return e}}}function gd(t,e){return t.substring(e.length+1,t.length)}function yd(t,e,r){return t.reduce(function(n,a){return n[a]=ae({},r[a],{enabled:e}),n},r)}function hv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Hg={last:{},history:[]};function Bg(t,e){t===void 0&&(t=Hg);var r=e.options,n=e.meta;if(e.type===ne.track){var a=hv(ae({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ae({},t,{last:a,history:t.history.concat(a)})}return t}var Gg={actions:[]};function Wg(t,e){t===void 0&&(t=Gg);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===ne.identify?[e].concat(t.actions):t.actions.concat(e),ae({},t,{actions:n});case"dequeue":return[];default:return t}}var vv=/#.*$/;function Vg(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(vv,""):"")}var pv,mv,gv,yv,Jg=function(t){if(t===void 0&&(t={}),!xe)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(xe){for(var v,p=document.getElementsByTagName("link"),m=0;v=p[m];m++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(vv,"")})(l),f={title:r,url:c,path:Vg(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ae({},f,t)},Zg={last:{},history:[]};function Yg(t,e){t===void 0&&(t=Zg);var r=e.options;if(e.type===ne.page){var n=hv(ae({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ae({},t,{last:n,history:t.history.concat(n)})}return t}pv=(function(){if(!xe)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"})(),mv=xe?document.referrer:null,gv=Tg(),yv=kg();var wd={initialized:!1,sessionId:Nn(),app:null,version:null,debug:!1,offline:!!xe&&!navigator.onLine,os:{name:pv},userAgent:xe?navigator.userAgent:"node",library:{name:Qo,version:"0.13.1"},timezone:yv,locale:gv,campaign:{},referrer:mv};function Xg(t,e){t===void 0&&(t=wd);var r=t.initialized,n=e.campaign;switch(e.type){case ne.campaign:return ae({},t,{campaign:n});case ne.offline:return ae({},t,{offline:!0});case ne.online:return ae({},t,{offline:!1});default:return r?t:ae({},wd,t,{initialized:!0})}}var Qg=["plugins","reducers","storage"];function ey(t,e,r){if(xe){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function ty(t){var e=ey.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function wv(){return Jt(Qo,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return hr[dr][Qo].push(o.action||o),i(o)}})}}}function bd(t){return function(){return vr(vr.apply(null,arguments),wv())}}function Do(t){return t?ov(t)?t:[t]:[]}function Sd(t,e,r){t===void 0&&(t={});var n,a,i=Nn();return e&&(Ar[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(Ve(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ae({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function ry(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(S,_){if(Ve(_))return S.middlewares=S.middlewares.concat(_),S;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var q=_.EVENTS?Object.keys(_.EVENTS).map(function(V){return _.EVENTS[V]}):[];S.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(S.methods[_.name]=Object.keys(_.methods).reduce(function(V,he){var oe;return V[he]=(oe=_.methods[he],function(){for(var le=Array.prototype.slice.call(arguments),se=new Array(oe.length),Re=0;Re<le.length;Re++)se[Re]=le[Re];return se[se.length]=w,oe.apply({instance:w},se)}),V},{}),delete _.methods);var F=Object.keys(_).concat(q),Z=new Set(S.events.concat(F));if(S.events=Array.from(Z),S.pluginsArray=S.pluginsArray.concat(_),S.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return S.plugins[_.name]=_,S.plugins[_.name].loaded||(S.plugins[_.name].loaded=function(){return!0}),S},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Vt,setItem:Jt,removeItem:Ir},i=(function(S){return function(_,q,F){return q.getState("user")[_]||(F&&We(F)&&F[_]?F[_]:cd(S)[_]||Vt(ts(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(S){return!es.includes(S)}).sort(),u=new Set(s.concat(nn).filter(function(S){return!es.includes(S)})),l=Array.from(u).sort(),c=function(){return o},f=new Kg,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},m=Og(),P=cd(a),y=ae({},P,r,m.an_uid?{userId:m.an_uid}:{},m.an_aid?{anonymousId:m.an_aid}:{});y.anonymousId||(y.anonymousId=Nn());var b=ae({enable:function(S,_){return new Promise(function(q){k.dispatch({type:ne.enablePlugin,plugins:Do(S),_:{originalAction:ne.enablePlugin}},q,[_])})},disable:function(S,_){return new Promise(function(q){k.dispatch({type:ne.disablePlugin,plugins:Do(S),_:{originalAction:ne.disablePlugin}},q,[_])})}},n.methods),g=!1,w={identify:function(S,_,q,F){try{var Z=At(S)?S:null,V=We(S)?S:_,he=q||{},oe=w.user();Jt(ts(kt),Z);var le=Z||V.userId||i(kt,w,V);return Promise.resolve(new Promise(function(se){k.dispatch(ae({type:ne.identifyStart,userId:le,traits:V||{},options:he,anonymousId:oe.anonymousId},oe.id&&oe.id!==Z&&{previousId:oe.id}),se,[_,q,F])}))}catch(se){return Promise.reject(se)}},track:function(S,_,q,F){try{var Z=We(S)?S.event:S;if(!Z||!At(Z))throw new Error("EventMissing");var V=We(S)?S:_||{},he=We(q)?q:{};return Promise.resolve(new Promise(function(oe){k.dispatch({type:ne.trackStart,event:Z,properties:V,options:he,userId:i(kt,w,_),anonymousId:i(sr,w,_)},oe,[_,q,F])}))}catch(oe){return Promise.reject(oe)}},page:function(S,_,q){try{var F=We(S)?S:{},Z=We(_)?_:{};return Promise.resolve(new Promise(function(V){k.dispatch({type:ne.pageStart,properties:Jg(F),options:Z,userId:i(kt,w,F),anonymousId:i(sr,w,F)},V,[S,_,q])}))}catch(V){return Promise.reject(V)}},user:function(S){if(S===kt||S==="id")return i(kt,w);if(S===sr||S==="anonId")return i(sr,w);var _=w.getState("user");return S?rd(_,S):_},reset:function(S){return new Promise(function(_){k.dispatch({type:ne.resetStart},_,S)})},ready:function(S){return g&&S({plugins:b,instance:w}),w.on(ne.ready,function(_){S&&S(_),g=!0})},on:function(S,_){if(!S||!Ve(_))return!1;if(S===ne.bootstrap)throw new Error(".on disabled for "+S);var q=/Start$|Start:/;if(S==="*"){var F=function(oe){return function(le){return function(se){return se.type.match(q)&&_({payload:se,instance:w,plugins:o}),le(se)}}},Z=function(oe){return function(le){return function(se){return se.type.match(q)||_({payload:se,instance:w,plugins:o}),le(se)}}};return h(F,Zr),h(Z,Yr),function(){d(F,Zr),d(Z,Yr)}}var V=S.match(q)?Zr:Yr,he=function(oe){return function(le){return function(se){return se.type===S&&_({payload:se,instance:w,plugins:o,abort:p}),le(se)}}};return h(he,V),function(){return d(he,V)}},once:function(S,_){if(!S||!Ve(_))return!1;if(S===ne.bootstrap)throw new Error(".once disabled for "+S);var q=w.on(S,function(F){_({payload:F.payload,instance:w,plugins:o,abort:p}),q()});return q},getState:function(S){var _=k.getState();return S?rd(_,S):Object.assign({},_)},dispatch:function(S){var _=At(S)?{type:S}:S;if(nn.includes(_.type))throw new Error("reserved action "+_.type);var q=ae({},_,{_:ae({originalAction:_.type},S._||{})});k.dispatch(q)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(S,_,q){k.dispatch({type:ne.setItemStart,key:S,value:_,options:q})},removeItem:function(S,_){k.dispatch({type:ne.removeItemStart,key:S,options:_})}},setAnonymousId:function(S,_){w.storage.setItem(Ut,S,_)},events:{core:nn,plugins:s}},A=n.middlewares.concat([function(S){return function(_){return function(q){return q.meta||(q.meta=Sd()),_(q)}}},v(Zr),Mg(w,c,{all:l,plugins:s}),Fg(a),Ng(w),xg(w),v(Yr)]),x={context:Xg,user:qg(a),page:Yg,track:Bg,plugins:zg(c),queue:Wg},N=vr,z=vr;if(xe&&t.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(N=B({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?wv():We(typeof arguments[0])?bd():bd().apply(null,arguments)}}var ie,j=(function(S){return Object.keys(S).reduce(function(_,q){return Qg.includes(q)||(_[q]=S[q]),_},{})})(t),D=n.pluginsArray.reduce(function(S,_){var q=_.name,F=_.config,Z=_.loaded,V=n.pluginEnabled[q];return S[q]={enabled:V,initialized:!!V&&!_.initialize,loaded:!!Z({config:F}),config:F},S},{}),L={context:j,user:y,plugins:D},k=uv((function(S){for(var _=Object.keys(S),q={},F=0;F<_.length;F++){var Z=_[F];typeof S[Z]===Ot&&(q[Z]=S[Z])}var V,he=Object.keys(q);try{(function(oe){Object.keys(oe).forEach(function(le){var se=oe[le];if(typeof se(void 0,{type:Xo})===It||typeof se(void 0,{type:Ug})===It)throw new Error(Lr+" "+le+" "+It)})})(q)}catch(oe){V=oe}return function(oe,le){if(oe===void 0&&(oe={}),V)throw V;for(var se=!1,Re={},Ue=0;Ue<he.length;Ue++){var Fe=he[Ue],ke=oe[Fe],Ze=(0,q[Fe])(ke,le);if(typeof Ze===It){var ut=jg(Fe,le);throw new Error(ut)}Re[Fe]=Ze,se=se||Ze!==ke}return se?Re:oe}})(ae({},x,e)),L,z(N(Lg.apply(void 0,A))));k.dispatch=(ie=k.dispatch,function(S,_,q){var F=ae({},S,{meta:Sd(S.meta,_,Do(q))});return ie.apply(null,[F])});var Y=Object.keys(o);k.dispatch({type:ne.bootstrap,plugins:Y,config:j,params:m,user:y,initialUser:r,persistedUser:P});var te=Y.filter(function(S){return n.pluginEnabled[S]}),Q=Y.filter(function(S){return!n.pluginEnabled[S]});return k.dispatch({type:ne.registerPlugins,plugins:Y,enabled:n.pluginEnabled}),n.pluginsArray.map(function(S,_){var q=S.bootstrap,F=S.config,Z=S.name;q&&Ve(q)&&q({instance:w,config:F,payload:S}),k.dispatch({type:ne.registerPluginType(Z),name:Z,enabled:n.pluginEnabled[Z],plugin:S}),n.pluginsArray.length===_+1&&k.dispatch({type:ne.initializeStart,plugins:te,disabled:Q})}),ty(function(S){k.dispatch({type:S?ne.offline:ne.online})}),(function(S,_,q){setInterval(function(){return fv(S,_,q)},3e3)})(k,c,w),w}var Zr="before",Yr="after",Bt="cookie",Mt=Iv(),bv=qn,ny=qn;function Sv(t){return Mt?qn(t,"",-1):Ir(t)}function Iv(){if(Mt!==void 0)return Mt;var t=Bt+Bt;try{qn(t,t),Mt=document.cookie.indexOf(t)!==-1,Sv(t)}catch{Mt=!1}return Mt}function qn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Mt===!1&&(o?Jt(t,e):Vt(t)),o?document.cookie=t+"="+encodeURIComponent(e)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}}var Pt="localStorage",ay=As.bind(null,Pt);Pr(Pt,"getItem",Vt);Pr(Pt,"setItem",Jt);Pr(Pt,"removeItem",Ir);var Et="sessionStorage",iy=As.bind(null,Et);Pr(Et,"getItem",Vt);Pr(Et,"setItem",Jt);Pr(Et,"removeItem",Ir);function lr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(We(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var oy=ay(),sy=iy(),cy=Iv();function Gt(t,e){if(t){var r=Us(e),n=!qs(r),a=js(r)?lr(localStorage.getItem(t)):void 0;if(n&&!or(a))return a;var i=Ls(r)?lr(bv(t)):void 0;if(n&&i)return i;var o=Ns(r)?lr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Vt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function vn(t,e,r){if(t&&!or(e)){var n={},a=Us(r),i=JSON.stringify(e),o=!qs(a);return js(a)&&(n[Pt]=Xr(Pt,e,lr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[Pt]:Ls(a)&&(n[Bt]=Xr(Bt,e,lr(bv(t))),ny(t,i),o)?n[Bt]:Ns(a)&&(n[Et]=Xr(Et,e,lr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[Et]:(n[zt]=Xr(zt,e,Vt(t)),Jt(t,e),o?n[zt]:n)}}function uy(t,e){if(t){var r=Us(e),n=Gt(t,nv),a={};return!or(n.localStorage)&&js(r)&&(localStorage.removeItem(t),a[Pt]=n.localStorage),!or(n.cookie)&&Ls(r)&&(Sv(t),a[Bt]=n.cookie),!or(n.sessionStorage)&&Ns(r)&&(sessionStorage.removeItem(t),a[Et]=n.sessionStorage),!or(n.global)&&xn(r,zt)&&(Ir(t),a[zt]=n.global),a}}function Us(t){return t?At(t)?t:t.storage:rv}function js(t){return oy&&xn(t,Pt)}function Ls(t){return cy&&xn(t,Bt)}function Ns(t){return sy&&xn(t,Et)}function qs(t){return t===nv||t==="all"}function xn(t,e){return t===rv||t===e||qs(t)}function Xr(t,e,r){return{location:t,current:e,previous:r}}var ly={setItem:vn,getItem:Gt,removeItem:uy};function fy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Id(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Pd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Id(Object(r),!0).forEach(function(n){fy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Id(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:ly};return ry(Pd(Pd({},e),t))}const xs="@sesamy/sesamy-js",$n="1.53.0";function hy(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=py(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function vy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function py(t){return["#","?"].forEach(e=>t=vy(t,e)),t}function my(){hy(()=>{bt.page()})}var Mo="up",Fo="down";function gy(t){if(t===void 0&&(t={}),!xe)return Yo;var e=Rd(),r=rs(),n=Ed(),a=Qr(n,e),i=Qr(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return Yo;var d=h.map(function(p){return Number(p)}),v=Ag(function(){var p=Rd(),m=(function(j,D){return D.map(function(L){return L===100?j-5:j*(L/100)})})(p,d),P=rs(),y=Ed(),b=Qr(y,p),g=Qr(P,p);if(c=b>c?b:c,f=g<f?g:f,!(o.length>=d.length)){var w=l===y,A=Mo;w?A="initial":l<=y&&(A=Fo);var x=m,N=d;(A===Mo||w)&&(x=m.slice().reverse(),N=d.slice().reverse());var z=N.reduce(function(j,D,L){var k=x[L];return u.includes(D)&&y<=k&&(u=u.filter(function(Y){return Y!==D}),j.singleFunction=D),A===Fo&&!o.includes(D)&&y>=k&&D>i?(s.push(D),j.callbacks=j.callbacks.concat(D),j):A===Mo&&!o.includes(D)&&y<=k&&D<=b?(j.foundFunc=[D],j):(w&&y>=k&&j.foundFunc.length===0&&(j.foundFunc=[D]),!s.includes(D)&&y>=k&&(s.push(D),j.singleFunction?u.push(D):j.singleFunction=D),j)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(l=y,A===Fo&&z.callbacks&&z.callbacks.forEach(function(j){Ve(t[j])&&(t[j]({trigger:j,direction:A,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(j))}),z.singleFunction){var B=z.singleFunction,ie=z.direction;Ve(t[B])&&t[B]({trigger:B,direction:ie,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(B)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function rs(){return xe?document.body.scrollTop||document.documentElement.scrollTop:0}function yy(){return xe?window.innerHeight||document.documentElement.clientHeight:0}function Ed(){return Math.round(rs()+yy())}function Rd(){if(!xe)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function Qr(t,e){return Math.round(t/e*100)}var $s="Event",_d=$s+"Listener";function wy(t){return function(e,r,n,a){var i=n||Yo,o=a||!1;if(!xe)return i;var s=pn(r),u=pn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+$s);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+_d:"remove"+_d,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?by(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function pn(t,e){if(At(t))return e?pn(document.querySelectorAll(t)):(r=t).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(t)){for(var n=[],a=t.length>>>0;a--;)n[a]=t[a];return n}var i=_g(t);return e?i.map(function(o){return At(o)?pn(o,!0):o}).flat():i}function by(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var Ko=wy($s);function Pv(t,e){return xe&&Ve(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),Ve(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}Pv.bind(null,"onerror");Pv.bind(null,"onload");var Ev=typeof window>"u",Td="hidden";function Sy(t){if(Ev)return!1;var e=Iy(),r="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return t(!!document[e])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function Iy(){var t=["webkit","moz","ms","o"];return Ev||Td in document?Td:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Py=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ey(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=Sy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Py.map(function(s){return Ko(document,s,r)})).concat(Ko(window,"load",r)).concat(Ko(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Ry(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(m){d(),i&&!c&&i(Cr(h),m),a&&c&&(c=!1,a(Cr(r),m),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Cr(h),m))},s)}var p=Ey(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var m=p();return function(){return f=!1,h=new Date,v({type:"load"}),m()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Cr(h,f),idle:c?Cr(r,f):0}}}}function Cr(t,e){return e?0:Math.round((new Date-t)/1e3)}const kd=5e3;class _y{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(e){this.element=e.element,this.viewCallback=e.viewCallback,this.activeDurationCallback=e.activeDurationCallback,this.idleDurationCallback=e.idleDurationCallback,this.scrollCallback=e.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),Ry({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:kd}),gy({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(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*kd:Date.now(),this.isInViewport&&this.trackAwake(e,r)}handleScroll(e){this.scrollCallback&&this.scrollCallback(e)}handleVisibilityChange(){this.isAwake=!1;const e=Math.round((Date.now()-this.lastEventAt)/1e3);e>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,e))}trackAwake(e,r){!e&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),e&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Rv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Ty(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.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)}}}const Od="sesamy_session_id";function ky(){let t=sessionStorage.getItem(Od);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Od,t)),t}function _v(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}let Xe={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"}},Tv=[],an;function kv(){const t=window.location.pathname;return Tv.find(e=>e.path?t.includes(e.path):!0)}function Oy(t,e){Tv=t.content||[];const r=kv();r&&r.type==="article"&&(Xe={...Xe,...r.selectors}),an=e}function Cy(t,e){const{selector:r}=e;return r===Xe.article.selector?t:t.querySelector(r)}function Ov(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Ov(t.parentElement,e):t.textContent??void 0}function fr(t){const e=document.head.querySelectorAll(`[property~='${t}'][content]`);for(let n=0;n<e.length;n+=1)if(e[n].content)return e[n].content;const r=document.head.querySelectorAll(`[name~='${t}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content}function Cv({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||fr(`sesamy:${e}`)||fr(`og:${e}`)||fr(e)||r}function Ay(){const t=document.querySelectorAll(Xe.article.selector);return Array.from(t).map(Ds).filter(e=>e!==null)}function Ds(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:_v(e)},n=(i,o,s,u)=>{const l=Cy(e,o);if(l){const c=Ov(l,o)||Cv({publisherContentId:s,key:i});c!==void 0&&(r[i]=u?u(c):c)}};n("id",Xe.id),n("title",Xe.title,r.id),n("excerpt",Xe.excerpt,r.id),n("image",Xe.image,r.id),n("price",Xe.price,r.id,i=>parseFloat(i)),n("currency",Xe.currency,r.id),n("url",Xe.url,r.id),n("pass",Xe.pass,r.id),n("accessLevel",Xe.accessLevel,r.id,i=>i||"entitlement");const a=kv();return a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency)),r}async function Uy(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=Ds(r);if(!n?.url)throw new Error("Could not find content for element");const a=await an.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await an.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||_v(r.parentElement||r);return an.proxy.getContent(i.token,n.url,o)}let Av=!1,on,mn,ns;function Uv(t){return JSON.stringify(t.map(e=>{const{campaign:r,...n}=e.properties||{};return{anonymousId:e.anonymousId,userId:e.userId,type:e.type,properties:n,clientId:ns,requestId:Math.random().toString(36).slice(2,9),sessionId:ky(),timestamp:new Date().toISOString(),version:$n,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:fr("sesamy:item-src"),publisherContentId:fr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:xs,userAgent:navigator.userAgent,clientId:ns}}}))}const jv=Ty(async t=>{if(t.length>0){const e=Uv(t);Av?navigator.sendBeacon(mn,e):(await fetch(mn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function zo(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(mn,Uv([e]))}else jv.push(t)}function jy(){return Av=!0,jv.flush()}function Ly(t,e,r){on=e,mn=`${ht("logs",r)}/events`,ns=t}const Ny={name:"custom-analytics-plugin",page:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;zo({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;zo({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n}=t;zo({anonymousId:r,userId:n,properties:e,type:"identify"})}},Cd=["source","medium","campaign","term","content"],Ct="utm_",qy=1800*1e3;function Lv(t){return t?Date.now()-parseInt(t,10)>qy:!0}function Ad(){const t=document.referrer||"";if(!t)return;const e=Gt(`${Ct}set_at`);(Lv(e)||!Gt(`${Ct}referrer`))&&vn(`${Ct}referrer`,t)}function xy(){const t=()=>{const r={};for(const a of Cd){const i=Gt(`${Ct}${a}`);i&&(r[`utm_${a}`]=i)}const n=Gt(`${Ct}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Ad()},campaign({payload:r}){const n=r?.campaign||{},a=Gt(`${Ct}set_at`);if(Object.keys(n).length>0&&Lv(a)){for(const o of Cd){const s=n[o];s&&vn(`${Ct}${o}`,s)}vn(`${Ct}set_at`,String(Date.now()))}Ad()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const $y=xy(),Ud=new Map,jd=new Map;function Dy({clientId:t,enabled:e=!0,environment:r}){Ly(t,e,r),e&&(window.addEventListener("beforeunload",()=>{jd.forEach((n,a)=>{n.bind(a)()}),jy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ud.forEach((n,a)=>{n.bind(a)()})}),my(),Rv(()=>{const n=new _y({element:document.body,viewCallback:()=>{bt.page()},activeDurationCallback:(a,i,o)=>{bt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{bt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{bt.track("scroll",{scroll:a.scrollMax})}});jd.set(document.body,()=>{n.flush()}),Ud.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Je.AUTHENTICATED,async n=>{const a=n;await bt.identify(a.detail.sub)}),window.addEventListener(Je.LOGOUT,async()=>{await bt.track("logout",{}),await bt.reset()}))}const bt=dy({app:xs,version:$n,plugins:[$y,Ny]});function Nv(t,e){bt.track(t,e)}function qv(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});Nv(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function My(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function Fy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ky(){return/android/i.test(navigator.userAgent)}let qe,xv,Nr,as=!1,sn=!1;qr()&&window.addEventListener("pageshow",()=>{sn=!1});const pr="sesamyAccessToken",Ho="sesamyRefreshToken",gn="sesamySilentAuthThrottle",zy=300*1e3;async function Dn(){return as?!0:new Promise((t,e)=>{const r=setTimeout(()=>{as?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Je.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Hy(t){if(!t)return null;const e=localStorage.getItem(Ho);if(!e)return pe("No refresh token found in localstorage"),null;const r=new URLSearchParams;r.set("client_id",t.iss),r.set("refresh_token",e),r.set("grant_type","refresh_token");const n=new URL(t.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",t.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(Ho),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Ho,i.refresh_token),localStorage.setItem(pr,i.access_token),i.access_token}catch{Ks()}}async function Ms(){const t=localStorage.getItem(pr);if(!t)return null;const e=zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Hy(e);if(r)return r;localStorage.removeItem(pr)}return t}let en=null;const By=64;function Gy(){try{if(en!==null)return en;const e=Object.keys(localStorage).filter(r=>r.startsWith("@@auth0spajs@@"));for(const r of e){const n=JSON.parse(localStorage.getItem(r)||"{}");let a;if(typeof n=="object"&&(n.body&&typeof n.body=="object"&&"refresh_token"in n.body?a=n.body.refresh_token:"refresh_token"in n&&(a=n.refresh_token)),a&&typeof a=="string"&&a.length===By)return en=!0,!0}}catch(t){pe(`Error checking for existing auth0 tokens: ${t.message}`)}return en=!1,!1}function Wy(t){if(t.domains&&t.domains.length>0){const e=mr(window.location.href);if(e){for(const r of t.domains)if(mr(`https://${r}`)===e)return pe(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;pe(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return pe(`Using fallback domain property: ${t.domain}`),t.domain}function mr(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function Vy(t){if(t.enabled===!1)return;xv=t.organization;const e=Wy(t);Nr=e&&!Gy()?e:tv("token",t.environment);const r={domain:Nr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",mr(window.location.href)!==mr(`https://${Nr}`)&&(r.useRefreshTokens=!0),pe(`Initializing auth0 client: ${JSON.stringify(r)}`),qe=await Qm(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)pe("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{pe("Code found in URL, handling redirect");try{const u=await qe.handleRedirectCallback();pe(`Login result: ${JSON.stringify(u)}`);const l=await qe.getUser();if(!l)throw pe("No user found"),new Error("No user found");pe(`User found ${JSON.stringify(l)}`),Fs(),jt(Je.AUTHENTICATED,l),pe("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}as=!0,jt(Je.AUTH_INITIALIZED,{})}async function $r(){return await Dn(),await Ms()?!0:qe?qe.isAuthenticated():!1}async function Jy(){return await Dn(),await Ms()?(pe("Using local user"),{sub:"local",name:"Local User"}):qe?qe.getUser():null}function $v(t){if(sn)return pe("Login already in progress"),null;if(sn=!0,setTimeout(()=>{sn=!1},3e3),localStorage.removeItem(pr),!qe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:xv,redirect_uri:window.location.href,ui_locales:ln(),incognito:Cs(),...e}}}async function Mn(t){const e=$v(t);if(e)return qe.loginWithRedirect(e)}async function Dv(t){const e=$v(t);if(!e)return;await qe.loginWithPopup(e,{timeoutInSeconds:1800}),Fs(),qv(Je.AUTHENTICATED,await qe.getUser()).canceled||window.location.reload()}async function Zy(t){return Nr&&mr(window.location.href)!==mr(`https://${Nr}`)&&(Fy()||Ky()||Cs())?Dv(t):Mn(t)}function Yy(){try{const t=sessionStorage.getItem(gn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<zy}catch{return sessionStorage.removeItem(gn),!1}}function Xy(){try{const t={timestamp:Date.now()};sessionStorage.setItem(gn,JSON.stringify(t))}catch{pe("Failed to set silent auth throttle in sessionStorage")}}function Fs(){try{sessionStorage.removeItem(gn)}catch{}}async function xt(t=!0,e=!1){await Dn();const r=await Ms();if(r)return r;if(!e&&Yy()){if(pe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!qe)return pe("Auth client not initialized"),null;let n=await qe.getTokenSilently();const a=zs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await qe.getTokenSilently({cacheMode:e?"off":"on"})),Fs(),n}catch(n){const a=n;if(pe(`Failed to get token silently: ${a.message}`),Xy(),await qe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Ks(),t)throw n;return null}}async function Ks(t={}){if(await Dn(),localStorage.removeItem(pr),jt(Je.LOGOUT,{}),!!qe)return pe(`Logout with options: ${JSON.stringify(t)}`),qe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function zs(t){const e=t.split(".");if(e.length!==3)return null;const n=e[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 is(t){const e=zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");pe("Set token"),localStorage.setItem(pr,t),jt(Je.AUTHENTICATED,e)}const Qy=(t,e)=>e.skipDedupe||e.method!=="GET",ew=(t,e)=>e.method+"@"+t,tw=t=>t.clone(),Ld=({skip:t=Qy,key:e=ew,resolver:r=tw}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},rw=(t,e)=>t*e,nw=t=>t&&t.ok,Nd=({delayTimer:t=500,delayRamp:e=rw,maxAttempts:r=10,until:n=nw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(m=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((y={})=>{var b,g;m(u((b=y&&y.url)!==null&&b!==void 0?b:l,(g=y&&y.options)!==null&&g!==void 0?g:c))}):m(u(l,c))},P)}).then(h).catch(m=>{if(!i)throw m;return h(null,m)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};class aw{get(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}set(e,r){typeof sessionStorage<"u"&&sessionStorage.setItem(e,r)}remove(e){typeof sessionStorage<"u"&&sessionStorage.removeItem(e)}clear(){}}function os(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Mv(t,e){if(os(t))return{itemSrc:t};const r=t.split(":");if(r.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${r.length}`);const[n,a,i]=r;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:e||i}}function qd(t){return t.endsWith("/")?t.slice(0,-1):t}function xd(t,e){if(!os(t)||!os(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&qd(r.pathname)===qd(n.pathname)}function iw(t,e,r){const n=new URL(`${ht("checkout3",t.environment)}`);if(e.language&&n.searchParams.set("lang",e.language),e.sku)n.searchParams.set("sku",e.sku),e.purchaseOptionId&&n.searchParams.set("po-id",e.purchaseOptionId);else if(e.itemSrc){const{sku:s,purchaseOption:u,itemSrc:l}=Mv(e.itemSrc,e.purchaseOptionId);l&&n.searchParams.set("url",l),s&&n.searchParams.set("sku",s),u&&n.searchParams.set("po-id",u)}e.email&&n.searchParams.set("email",e.email),e.business&&n.searchParams.set("business","true"),e.currency&&n.searchParams.set("currency",e.currency),e.price&&n.searchParams.set("price",e.price.toString()),e.discountCode&&n.searchParams.set("discount-code",e.discountCode),e.attributionItemSrc?n.searchParams.set("itemSrc",e.attributionItemSrc):r.itemSrc&&n.searchParams.set("itemSrc",r.itemSrc),e.attributionPublisherContentId?n.searchParams.set("publisherContentId",e.attributionPublisherContentId):r.publisherContentId&&n.searchParams.set("publisherContentId",r.publisherContentId),e.utmSource?n.searchParams.set("utm_source",e.utmSource):r.utmSource&&n.searchParams.set("utm_source",r.utmSource),e.utmMedium?n.searchParams.set("utm_medium",e.utmMedium):r.utmMedium&&n.searchParams.set("utm_medium",r.utmMedium),e.utmCampaign?n.searchParams.set("utm_campaign",e.utmCampaign):r.utmCampaign&&n.searchParams.set("utm_campaign",r.utmCampaign),e.utmTerm?n.searchParams.set("utm_term",e.utmTerm):r.utmTerm&&n.searchParams.set("utm_term",r.utmTerm),e.utmContent?n.searchParams.set("utm_content",e.utmContent):r.utmContent&&n.searchParams.set("utm_content",r.utmContent);const a=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(s=>{const[u,l]=s.trim().split("=");return{key:u,value:l}}).filter(s=>a.some(u=>u===s.key)).forEach(s=>{n.searchParams.append(s.key,s.value)});let o=new URL(window.location.href);if(e.redirectUrl)try{o=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return o.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&o.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",o.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:s,methods:u})=>u?u.map(l=>`${s}|${l}`):s).join(",")),n}const Fv="sesamySignedURLs";function Hs(){const t=sessionStorage.getItem(Fv);return t?JSON.parse(t):[]}function ow(t){const e=Hs();e.push(t),pe(`Adding signed URL: ${t}`),sessionStorage.setItem(Fv,JSON.stringify(e))}function sw(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const ss="sesamyAttribution";function cw(t){const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e).value}catch{return console.error(`Failed to parse ${t}`),null}}function uw(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function yn(){return cw(ss)||{}}function Kv(t){if(t===null)localStorage.removeItem(ss);else{pe(`Setting attribution ${JSON.stringify(t)}`);const e=yn()??{},r=sw({...e,...uw(t)});localStorage.setItem(ss,JSON.stringify({value:r}))}}function lw(t){const e=t.endpoint||ht("api2",t.environment),r=async()=>{const T=await xt(!0);if(!T)throw new Error("No access token available");return T},n=Ce.client({baseUrl:e,tokenProvider:r,libraryName:xs,libraryVersion:$n,vendorId:t.vendorId,cache:{mode:Ce.CacheMode.BROWSER,storage:new aw}}),a=T=>async(K,J)=>{let re=sessionStorage.getItem(ed);re||(re=Date.now().toString(),sessionStorage.setItem(ed,re));const me={...J,headers:{...J.headers,"Cache-Timestamp":re}};return T(K,me)},i=(T=!0)=>K=>async(J,re)=>{let me=null;if(me=await xt(T),!me){if(T)throw new Error("No access token available");return K(J,re)}const Ke={...re,headers:{...re.headers,...me?{Authorization:`Bearer ${me}`}:{}}};return K(J,Ke)},o=T=>(K,J)=>{if(J.headers&&"Authorization"in J.headers)return T(K,J);const re=localStorage.getItem("__anon_id"),me=btoa(`${t.clientId}|${re}:`),Ke={...J,headers:{...J.headers,Authorization:`Basic ${me}`}};return T(K,Ke)},s=Ce.wretch(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Ld(),Nd({delayTimer:1e3,delayRamp:(T,K)=>T*K,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]),u=Ce.wretch(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Ld(),Nd({delayTimer:1e3,delayRamp:(T,K)=>T*K,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]);async function l(T={}){const{waitForEntitlementAfter:K,includeSignedLinks:J=!0}=T,re=await $r()?await n.entitlements.list({waitForEntitlementAfter:K?.toISOString()}):[];return J&&re.push(...Hs()),re}async function c(T,K=[]){return(await l())?.find(me=>{const{sku:Ke,purchaseOption:M}=Mv(T);return!!("sku"in me&&Ke===me.sku||M&&"purchaseOptionsId"in me&&M===me.purchaseOptionsId||xd(T,me.url)||K.some(ee=>xd(ee,me.url)))})}async function f(T){return n.entitlements.get(T)}async function h(T){return n.entitlements.getAccess(T)}async function d(T,K,J){const re=new URL(ht("api2",t.environment));return re.pathname="/proxy",re.searchParams.set("url",K),J&&re.searchParams.set("selector",J),Ce.wretch(re.toString()).headers({Authorization:`Bearer ${T}`}).get().text()}async function v(T){if(!T)throw new Error("SKU is required to get fulfillments");return await $r()?await s.get(`/fulfillments?sku=${encodeURIComponent(T)}`).json():[]}async function p(T,K){if(!T||!K)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:T},`/fulfillments/${encodeURIComponent(K)}/request-delivery?`).res()).ok}async function m(){return s.get("/contracts").json()}async function P(T){return(await s.get("/contracts").json())?.find(J=>J.id===T)}async function y(T){const K=await s.post({},`/contracts/${encodeURIComponent(T)}/cancel`).res();return Ce.clearCache(),K.ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function g(){return s.get("/bills").json()}async function w(T){return(await s.get("/bills").json())?.find(J=>J.id===T)}async function A(){return s.get("/transactions").json()}async function x(T){return(await s.get("/transactions").json())?.find(J=>J.id===T)}async function N(T,K){const J=await s.url(`/user-metadata/${encodeURIComponent(T)}`).put(K).json();return jt(Je.USER_ATTRIBUTE_CHANGED,{}),Ce.clearCache(),J}async function z(T){const K=await s.url(`/user-metadata/${encodeURIComponent(T)}`).delete().res();return Ce.clearCache(),K.ok}async function B(){return await s.url("/user-metadata").get().json()}async function ie(T){return(await B())[T]||null}async function j(){return await s.url("/tags").get().json()}async function D(T){const K=await s.url(`/tags/${encodeURIComponent(T)}`).delete().res();return Ce.clearCache(),K.ok}async function L(T){const K=await s.url("/tags").post(encodeURIComponent(T)).res();return jt(Je.USER_ATTRIBUTE_CHANGED,{}),Ce.clearCache(),K.ok}async function k(T){return(await u.url("/tallies").get().json())[T]}async function Y(){return await u.url("/tallies").get().json()}async function te(T){const K=await u.url(`/tallies/${T}`).delete().res();return Ce.clearCache(),K.ok}async function Q(T,K){return await u.url(`/tallies/${encodeURIComponent(T)}/push`).post(K).json()}async function S(T){return n.products.get(T)}async function _(){return await xt(!1)?await s.url("/profile").get().json():null}async function q(T){const K=await s.url("/profile").patch(T).res();return Ce.clearCache(),K.ok}async function F(){return await s.url("/payment-issues").get().json()}async function Z(){return(await s.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function V(){return(await s.url("/profile/unlink-spotify").post().res()).ok}async function he(T){const K=await xt(!1);if(!K)throw new Error("No access token available");const J=new URL(`${ht("access-sync",t.environment)}/spotify/sesamy-callback`);J.searchParams.set("access_token",K),J.searchParams.set("state",T),window.location.href=J.toString()}async function oe(T){const K=await s.url(`/products/${encodeURIComponent(T)}/auto-onboard`).post().json();return K.length&&Ce.clearCache(),K}async function le(T,K=3600){const{shortlink:J}=await Ce.wretch(rg).post({url:T,ttl:K}).json();return J}async function se(T){const K=await xt(!1,!0);let J;const re=T.language||ln(),me=yn();switch(T.target){case"account":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}${T.contractId?`/${encodeURIComponent(T.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"consume":J=new URL(`${ht("consume",t.environment)}/${encodeURIComponent(T.language||re)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.sku)}`),T.episodeId?J.href+=`/${T.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"checkout":J=iw(t,{language:re,...T},me);break;default:throw new Error("Invalid target")}return K&&(J.hash=`#access_token=${K}`),T.shorten?le(J.href,T.ttl):J.href}async function Re(T){const K=yn(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(me=>{const Ke=K,[M,ee]=me.trim().split("=");J.includes(M)&&!Ke[M]&&(Ke[M]=ee)}),(await u.url("/checkouts").post({language:ln(),...T,attribution:{...K,...T.attribution},vendorId:t.vendorId})).json()}async function Ue(T,K){return(await u.url(`/checkouts/${T}`).patch(K)).json()}async function Fe(T){return(await u.url(`/checkouts/${T}`).get()).json()}async function ke(T){return(await u.url(`/paywalls/${T}`).get()).json()}async function Ze(){return(await u.url("/vendor").get()).json()}async function ut(){return(await s.url("/vendors").get()).json()}async function lt(T){return(await s.url(`/contracts/${encodeURIComponent(T.contractId)}/amendments`).post({amendmentType:T.amendmentType,discountCode:T.discountCode})).json()}async function mt(T){return await s.url(`/amendments/${encodeURIComponent(T)}/confirm`).post(),!0}async function gt(){const T=await xt(!1),K=new URL(`${ht("account",t.environment)}/subscriptions/${t.clientId}`);T&&(K.hash=`#access_token=${T}`),window.location.href=K.toString()}return{autoOnboardProduct:oe,cancelContract:y,confirmAmendment:mt,createAmendment:lt,createCheckout:Re,deleteTag:D,deleteTally:te,deleteUserMetadata:z,generateLink:se,getBill:w,getBills:g,getCheckout:Fe,getProxyContent:d,getContract:P,getContracts:m,getEntitlement:f,getEntitlementAccess:h,getEntitlements:l,getFulfillments:v,requestDelivery:p,getPaywall:ke,getPaymentIssues:F,getProfile:_,getProduct:S,getSubscriptions:b,getTally:k,getTallies:Y,getTags:j,getTransaction:x,getTransactions:A,getUserMetadata:ie,hasAccess:c,isSpotifyLinked:Z,linkSpotify:he,listUserMetadata:B,openHostedAccountPage:gt,pushTally:Q,setTag:L,setUserMetadata:N,unlinkSpotify:V,updateCheckout:Ue,updateProfile:q,getVendorSettings:Ze,listVendors:ut}}const fw=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function dw(){return new Promise(t=>{const e=fw.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function hw(){const t=navigator.userAgent.toLowerCase(),e=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of e)if(r.regex.test(t))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(t)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}const zv="sesamyFlags";async function Hv(t){try{localStorage.setItem(zv,JSON.stringify(t))}catch{pe("Failed to save flags to localStorage")}}async function vw(t,e){const r=await Fn();r[t]=e,await Hv(r)}async function pw(t){return(await Fn())[t]}async function mw(t){const e=await Fn();t in e&&(delete e[t],await Hv(e))}async function Fn(){try{const t=localStorage.getItem(zv);return t?JSON.parse(t):{}}catch{return{}}}function gw(t){const{autoOnboardProduct:e,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:u,getBills:l,getCheckout:c,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:p,getFulfillments:m,getPaywall:P,getPaymentIssues:y,getProfile:b,getProduct:g,getProxyContent:w,getSubscriptions:A,getTags:x,getTally:N,getTallies:z,getTransaction:B,getTransactions:ie,getUserMetadata:j,getVendorSettings:D,listVendors:L,hasAccess:k,isSpotifyLinked:Y,linkSpotify:te,listUserMetadata:Q,openHostedAccountPage:S,pushTally:_,requestDelivery:q,setTag:F,setUserMetadata:Z,unlinkSpotify:V,updateCheckout:he,updateProfile:oe}=lw(t),le={analytics:{track:Nv},attribution:{get:yn,set:Kv},auth:{getUser:b,getTokenSilently:xt,isAuthenticated:$r,loginWithRedirect:Mn,loginWithPopup:Dv,login:Zy,logout:Ks,setToken:is},bills:{get:u,list:l},browser:{detectAdblock:dw,isInAppBrowser:hw,isIncognito:Cs},checkouts:{create:n,get:c,update:he},clearCache:Ce.clearCache,content:{list:Ay,get:Ds,getLanguage:ln,unlock:Uy,getPropertyFromHTML:Cv},contracts:{cancel:r,get:f,list:h},entitlements:{access:v,get:d,hasAccess:k,list:p,signedLinks:Hs},events:{emit:qv,cancel:My},flags:{get:pw,set:vw,list:Fn,delete:mw},fulfillments:{list:m,requestDelivery:q},generateLink:s,getPaymentIssues:y,getVersion:yw,isReady:()=>exports.isInitialized,log:pe,paywalls:{get:P},products:{autoOnboard:e,get:g,linkSpotify:te},profile:{get:b,isSpotifyLinked:Y,openHostedAccountPage:S,unlinkSpotify:V,update:oe},proxy:{getContent:w},subscriptions:{list:A},tags:{delete:a,list:x,set:F},tallies:{delete:i,get:N,list:z,push:_},transactions:{get:B,list:ie},userMetadata:{delete:o,get:j,list:Q,set:Z},vendors:{get:D,list:L},setToken:is};return t.namespace&&(window[t.namespace]=le),le}function yw(){return $n}function ww(t,e){t.style.position="relative",t.style.height="200px",t.style.overflow="hidden";let n=0;const a=Array.from(t.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
34
|
+
**/var Zo={d:(t,e)=>{for(var r in e)Zo.o(e,r)&&!Zo.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},ks={};Zo.d(ks,{A:()=>ng,k:()=>Os});var kr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Or=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Os(){return kr(this,void 0,Promise,function(){return Or(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",a=!1;function i(h){a||(a=!0,e({isPrivate:h,browserName:n}))}function o(){var h=0,d=parseInt("-1");try{d.toFixed(d)}catch(v){h=v.message.length}return h}function s(){return kr(this,void 0,void 0,function(){var h,d;return Or(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return kr(this,void 0,Promise,function(){return Or(this,function(d){switch(d.label){case 0:return typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function"?[3,2]:[4,s()];case 1:return d.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var v=String(Math.random());try{var p=indexedDB.open(v,1);p.onupgradeneeded=function(m){var P=m.target.result,y=function(b){i(b)};try{P.createObjectStore("t",{autoIncrement:!0}).put(new Blob),y(!1)}catch(b){(b instanceof Error&&typeof b.message=="string"?b.message:String(b)).includes("are not yet supported")?y(!0):y(!1)}finally{P.close(),indexedDB.deleteDatabase(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var m,P,y,b=window;return(y=(P=(m=b?.performance)===null||m===void 0?void 0:m.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&y!==void 0?y:1073741824})()/1048576);i(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return kr(this,void 0,Promise,function(){var d,v,p;return Or(this,function(m){switch(m.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];m.label=1;case 1:return m.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return m.sent(),i(!1),[3,4];case 3:return d=m.sent(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},m.label=6;case 6:return[2]}})})}(function(){return kr(this,void 0,Promise,function(){return Or(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Os);const ng=Os;ks.A;const ag=ks.k,rn="sesamy_incognito_mode";function Cs(){try{const t=sessionStorage.getItem(rn);return t===null?void 0:t==="true"}catch{return}}async function ig(){try{const t=sessionStorage.getItem(rn);if(t!==null)return t==="true";const{isPrivate:e}=await ag();return sessionStorage.setItem(rn,e.toString()),e}catch{try{sessionStorage.setItem(rn,"false")}catch{}return!1}}function qr(){return typeof window<"u"}function rd(t,e,r,n,a){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)t=t?t[e[n]]:a;return t===a?r:t}var og="function",sg="string",ot="undefined",cg="boolean",fn="object",ug="array",lg="number",fg="symbol",dg="null",Yo=function(){},rv="any",nv="*",Wt="__",hg="form",vg="input",pg="button",mg="select",dn=typeof process!==ot?process:{};dn.env&&dn.env.NODE_ENV;var xe=typeof document!==ot;dn.versions!=null&&dn.versions.node!=null;typeof Deno!==ot&&Deno.core;xe&&window.name==="nodejs"||typeof navigator!==ot&&typeof navigator.userAgent!==ot&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function av(t,e){return e.charAt(0)[t]()+e.slice(1)}var gg=av.bind(null,"toUpperCase"),yg=av.bind(null,"toLowerCase");function wg(t){return iv(t)?gg(dg):typeof t===fn?Pg(t):Object.prototype.toString.call(t).slice(8,-1)}function hn(t,e){e===void 0&&(e=!0);var r=wg(t);return e?yg(r):r}function Gr(t,e){return typeof e===t}var Je=Gr.bind(null,og),At=Gr.bind(null,sg),or=Gr.bind(null,ot),bg=Gr.bind(null,cg);Gr.bind(null,fg);function iv(t){return t===null}function Sg(t){return hn(t)===lg&&!isNaN(t)}function ov(t){return hn(t)===ug}function Ve(t){if(!Ig(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ig(t){return t&&(typeof t===fn||t!==null)}function Pg(t){return Je(t.constructor)?t.constructor.name:null}function Eg(t){return t instanceof Error||At(t.message)&&t.constructor&&Sg(t.constructor.stackTraceLimit)}function sv(t,e){if(typeof e!="object"||iv(e))return!1;if(e instanceof t)return!0;var r=hn(new t(""));if(Eg(e))for(;e;){if(hn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}sv.bind(null,TypeError);sv.bind(null,SyntaxError);function jn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Rg(t,e):r}function Rg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Ln(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Ln(jn,hg);Ln(jn,pg);Ln(jn,vg);Ln(jn,mg);function _g(t){return t?ov(t)?t:[t]:[]}function nd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Tg(){if(xe){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function kg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Og(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=nd(r[1]),o=nd(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(Cg(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return xe&&window.location.search.substring(1)})())}function Cg(t,e,r){for(var n=e.length-1,a=0;a<n;++a){var i=e[a];if(i==="__proto__"||i==="constructor")break;i in t||(t[i]={}),t=t[i]}t[e[n]]=r}function Nn(){for(var t="",e=0,r=4294967295*Math.random()|0;e++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],a=15&r;t+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=e%8==0?4294967295*Math.random()|0:r>>4}return t}function Ag(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var zt="global",dr=Wt+zt+Wt,hr=typeof self===fn&&self.self===self&&self||typeof global===fn&&global[zt]===global&&global||void 0;function Vt(t){return hr[dr][t]}function Jt(t,e){return hr[dr][t]=e}function Ir(t){delete hr[dr][t]}function Pr(t,e,r){var n;try{if(As(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}hr[dr]||(hr[dr]={});var Vr={};function As(t){if(typeof Vr[t]!==ot)return Vr[t];try{var e=window[t];e.setItem(ot,ot),e.removeItem(ot)}catch{return Vr[t]=!1}return Vr[t]=!0}function ae(){return ae=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ae.apply(null,arguments)}var Ot="function",It="undefined",Lr="reducer",cv="@@redux/",Xo=cv+"INIT",Ug=cv+Math.random().toString(36),ad=(function(){return typeof Symbol===Ot&&Symbol.observable||"@@observable"})(),Jr=" != "+Ot;function uv(t,e,r){var n;if(typeof e===Ot&&typeof r===It&&(r=e,e=void 0),typeof r!==It){if(typeof r!==Ot)throw new Error("enhancer"+Jr);return r(uv)(t,e)}if(typeof t!==Ot)throw new Error(Lr+Jr);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==Ot)throw new Error("Listener"+Jr);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!Ve(d))throw new Error("Act != obj");if(typeof d.type===It)throw new Error("ActType "+It);if(u)throw new Error("Dispatch in "+Lr);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:Xo}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Ot)throw new Error("next "+Lr+Jr);a=d,h({type:Xo})}})[ad]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function m(){p.next&&p.next(c())}return m(),{unsubscribe:v(m)}}})[ad]=function(){return this},d},n}function jg(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Lr+" "+t+" returns "+It}function vr(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function Lg(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ae({},o,{dispatch:s=vr.apply(void 0,i)(o.dispatch)})}}}var Ut=Wt+"anon_id",Ht=Wt+"user_id",cr=Wt+"user_traits",Qo="analytics",kt="userId",sr="anonymousId",nn=["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"],es=["name","EVENTS","config","loaded"],ne=nn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),id=/^utm_/,od=/^an_prop_/,sd=/^an_trait_/;function Ng(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===ne.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ut,o.anonymousId),l||e(Ht,o.userId),u.traits&&e(cr,ae({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(v,p){if(p.match(id)||p.match(/^(d|g)clid/)){var m=p.replace(id,"");v.campaign[m==="campaign"?"name":m]=i[p]}return p.match(od)&&(v.props[p.replace(od,"")]=i[p]),p.match(sd)&&(v.traits[p.replace(sd,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(ae({type:ne.params,raw:i},d,f?{userId:f}:{})),f&&setTimeout(function(){return t.identify(f,d.traits)},0),h&&setTimeout(function(){return t.track(h,d.props)},0),Object.keys(d.campaign).length&&r.dispatch({type:ne.campaign,campaign:d.campaign})}}return n(a)}}}}function qg(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===ne.setItemEnd){if(r.key===Ut)return ae({},e,{anonymousId:r.value});if(r.key===Ht)return ae({},e,{userId:r.value})}switch(r.type){case ne.identify:return Object.assign({},e,{userId:r.userId,traits:ae({},e.traits,r.traits)});case ne.reset:return[Ht,Ut,cr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function cd(t){return{userId:t.getItem(Ht),anonymousId:t.getItem(Ut),traits:t.getItem(cr)}}var ts=function(t){return Wt+"TEMP"+Wt+t};function xg(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===ne.reset&&([Ht,cr,Ut].forEach(function(d){n(d)}),[kt,sr,"traits"].forEach(function(d){Ir(ts(d))})),s.type===ne.identify){a(Ut)||r(Ut,Nn());var f=a(Ht),h=a(cr)||{};f&&f!==u&&i.dispatch({type:ne.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Ht,u),l&&r(cr,ae({},h,l))}return o(s)}}}}var Ar={};function ud(t,e){Ar[t]&&Je(Ar[t])&&(Ar[t](e),delete Ar[t])}function lv(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ae({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return lv(t,e,r-10).then(n,a)})})}function $g(t){return{abort:t}}function fv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&Je(p)){var m,P=(function(g,w){return g===void 0&&(g={}),w===void 0&&(w={}),[kt,sr].reduce(function(A,x){return g.hasOwnProperty(x)&&w[x]&&w[x]!==g[x]&&(A[x]=w[x]),A},g)})(h.payload,u),y=n[P.meta.rid];if(!y&&(m=p({payload:P,config:o[d].config,instance:r,abort:$g}))&&Ve(m)&&m.abort)return void(n[P.meta.rid]=!0);if(!y){var b=v+":"+d;t.dispatch(ae({},P,{type:b,_:{called:b,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var qo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(ur),d=e.exact.map(function(m){return m.pluginName});h&&(d=o.during.map(function(m){return m.pluginName}));var v=(function(m,P){return function(y,b,g){var w=b.config,A=b.name,x=A+"."+y.type;g&&(x=g.event);var N=y.type.match(ur)?(function(z,B,ie,j,D){return function(L,k){var Y=j?j.name:z,te=k&&xr(k)?k:ie;if(j&&(!(te=k&&xr(k)?k:[z]).includes(z)||te.length!==1))throw new Error("Method "+B+" can only abort "+z+" plugin. "+JSON.stringify(te)+" input valid");return ae({},D,{abort:{reason:L,plugins:te,caller:B,_:Y}})}})(A,x,P,g,y):(function(z,B){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+B)}})(y,x);return{payload:Dg(y),instance:m,config:w||{},abort:N}}})(n,d),p=e.exact.reduce(function(m,P){var y=P.pluginName,b=P.methodName,g=!1;return b.match(/^initialize/)||b.match(/^reset/)||(g=!l[y].loaded),c.offline&&b.match(/^(page|track|identify)/)&&(g=!0),m[""+y]=g,m},{});return Promise.resolve(e.exact.reduce(function(m,P,y){var b=P.pluginName;return Promise.resolve(m).then(function(g){function w(){return Promise.resolve(g)}var A=(function(){if(e.namespaced&&e.namespaced[b])return Promise.resolve(e.namespaced[b].reduce(function(x,N,z){return Promise.resolve(x).then(function(B){return N.method&&Je(N.method)?((function(L,k){var Y=md(L);if(Y&&Y.name===k){var te=md(Y.method);throw new Error([k+" plugin is calling method "+L,"Plugins cant call self","Use "+Y.method+" "+(te?"or "+te.method:"")+" in "+k+" plugin insteadof "+L].join(`
|
|
35
|
+
`))}})(N.methodName,N.pluginName),Promise.resolve(N.method({payload:B,instance:n,abort:(ie=B,j=b,D=N.pluginName,function(L,k){return ae({},ie,{abort:{reason:L,plugins:k||[j],caller:f,from:D||j}})}),config:dd(N.pluginName,l,i),plugins:l})).then(function(L){var k=Ve(L)?L:{};return Promise.resolve(ae({},B,k))})):B;var ie,j,D})},Promise.resolve(r))).then(function(x){g[b]=x});g[b]=r})();return A&&A.then?A.then(w):w()})},Promise.resolve({}))).then(function(m){return Promise.resolve(e.exact.reduce(function(P,y,b){try{var g=e.exact.length===b+1,w=y.pluginName,A=i[w];return Promise.resolve(P).then(function(x){var N=m[w]?m[w]:{};if(h&&(N=x),$o(N,w))return xo({data:N,method:f,instance:n,pluginName:w,store:s}),Promise.resolve(x);if($o(x,w))return g&&xo({data:x,method:f,instance:n,store:s}),Promise.resolve(x);if(p.hasOwnProperty(w)&&p[w]===!0)return s.dispatch({type:"queue",plugin:w,payload:N,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(x);var z=v(m[w],i[w]);return Promise.resolve(A[f]({abort:z.abort,payload:N,instance:n,config:dd(w,l,i),plugins:l})).then(function(B){var ie=Ve(B)?B:{},j=ae({},x,ie),D=m[w];if($o(D,w))xo({data:D,method:f,instance:n,pluginName:w,store:s});else{var L=f+":"+w;(L.match(/:/g)||[]).length<2&&!f.match(ld)&&!f.match(fd)&&n.dispatch(ae({},h?j:N,{type:L,_:{called:L,from:"submethod"}}))}return Promise.resolve(j)})})}catch(x){return Promise.reject(x)}},Promise.resolve(r))).then(function(P){if(!(f.match(ur)||f.match(/^registerPlugin/)||f.match(fd)||f.match(ld)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var y=ae({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});dv(P,e.exact.length)&&!f.match(/End$/)&&(y=ae({},y,{type:P.type+"Aborted"})),s.dispatch(y)}return P})})}catch(m){return Promise.reject(m)}},ur=/Start$/,ld=/^bootstrap/,fd=/^ready/;function xo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ae({},t.data,{type:r,_:{called:r,from:"abort"}}))}function dd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function hd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function vd(t,e){var r=t.replace(ur,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function $o(t,e){var r=t.abort;return!!r&&(r===!0||pd(r,e)||r&&pd(r.plugins,e))}function dv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||At(r))return!0;var n=r.plugins;return xr(r)&&r.length===e||xr(n)&&n.length===e}function xr(t){return Array.isArray(t)}function pd(t,e){return!(!t||!xr(t))&&t.includes(e)}function md(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Dg(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ve(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Mg(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(g){return s?g:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===ne.enablePlugin&&a.dispatch({type:ne.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===ne.disablePlugin&&setTimeout(function(){return ud(o.meta.rid,{payload:o})},0),l===ne.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(g){return c.includes(g)}).map(function(g){return h[g]}),p=[],m=[],P=o.disabled,y=v.map(function(g){var w=g.loaded,A=g.name,x=g.config;return lv(g,function(){return w({config:x})},1e4).then(function(N){return n[A]||(a.dispatch({type:ne.pluginReadyType(A),name:A,events:Object.keys(g).filter(function(z){return!es.includes(z)})}),n[A]=!0),p=p.concat(A),g}).catch(function(N){if(N instanceof Error)throw new Error(N);return m=m.concat(N.name),N})});Promise.all(y).then(function(g){var w={plugins:p,failed:m,disabled:P};setTimeout(function(){d.length===y.length+P.length&&a.dispatch(ae({},{type:ne.ready},w))},0)})}var b=(function(){if(l!==ne.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return fv(a,e,t)},0),Promise.resolve((function(g,w,A,x,N){try{var z=Je(w)?w():w,B=g.type,ie=B.replace(ur,"");if(g._&&g._.called)return Promise.resolve(g);var j=A.getState(),D=(Y=z,(te=j.plugins)===void 0&&(te={}),(Q=g.options)===void 0&&(Q={}),Object.keys(Y).filter(function(S){var _=Q.plugins||{};return bg(_[S])?_[S]:_.all!==!1&&(!te[S]||te[S].enabled!==!1)}).map(function(S){return Y[S]}));B===ne.initializeStart&&g.fromEnable&&(D=Object.keys(j.plugins).filter(function(S){var _=j.plugins[S];return g.plugins.includes(S)&&!_.initialized}).map(function(S){return z[S]}));var L=D.map(function(S){return S.name}),k=(function(S,_){var q=vd(S).map(function(F){return hd(F,_)});return _.reduce(function(F,Z){var V=Z.name,he=vd(S,V).map(function(Re){return hd(Re,_)}),oe=he[0],le=he[1],se=he[2];return oe.length&&(F.beforeNS[V]=oe),le.length&&(F.duringNS[V]=le),se.length&&(F.afterNS[V]=se),F},{before:q[0],beforeNS:{},during:q[1],duringNS:{},after:q[2],afterNS:{}})})(B,D);return Promise.resolve(qo({action:g,data:{exact:k.before,namespaced:k.beforeNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(S){function _(){var Z=(function(){if(B.match(ur))return Promise.resolve(qo({action:ae({},q,{type:ie+"End"}),data:{exact:k.after,namespaced:k.afterNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(V){V.meta&&V.meta.hasCallback&&ud(V.meta.rid,{payload:V})})})();return Z&&Z.then?Z.then(function(){return S}):S}if(dv(S,L.length))return S;var q,F=(function(){if(B!==ie)return Promise.resolve(qo({action:ae({},S,{type:ie}),data:{exact:k.during,namespaced:k.duringNS},state:j,allPlugins:z,allMatches:k,instance:A,store:x,EVENTS:N})).then(function(Z){q=Z});q=S})();return F&&F.then?F.then(_):_()})}catch(S){return Promise.reject(S)}var Y,te,Q})(o,e,t,a,r)).then(function(g){var w=i(g);return s=1,w})})();return Promise.resolve(b&&b.then?b.then(u):u(b))}catch(g){return Promise.reject(g)}}}}}function Fg(t){return function(e){return function(r){return function(n){var a=n.type,i=n.key,o=n.value,s=n.options;if(a===ne.setItem||a===ne.removeItem){if(n.abort)return r(n);a===ne.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var Kg=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return vr.apply(void 0,o)(n)(a)}}}}};function zg(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=gd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ae({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=gd(r.type,ne.initialize),l=t()[u];return l&&u?(n[u]=ae({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ae({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ae({},e[r.name],{loaded:!0}),ae({},e,n);switch(r.type){case ne.disablePlugin:return ae({},e,yd(r.plugins,!1,e));case ne.enablePlugin:return ae({},e,yd(r.plugins,!0,e));default:return e}}}function gd(t,e){return t.substring(e.length+1,t.length)}function yd(t,e,r){return t.reduce(function(n,a){return n[a]=ae({},r[a],{enabled:e}),n},r)}function hv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Hg={last:{},history:[]};function Bg(t,e){t===void 0&&(t=Hg);var r=e.options,n=e.meta;if(e.type===ne.track){var a=hv(ae({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ae({},t,{last:a,history:t.history.concat(a)})}return t}var Gg={actions:[]};function Wg(t,e){t===void 0&&(t=Gg);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===ne.identify?[e].concat(t.actions):t.actions.concat(e),ae({},t,{actions:n});case"dequeue":return[];default:return t}}var vv=/#.*$/;function Vg(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(vv,""):"")}var pv,mv,gv,yv,Jg=function(t){if(t===void 0&&(t={}),!xe)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(xe){for(var v,p=document.getElementsByTagName("link"),m=0;v=p[m];m++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(vv,"")})(l),f={title:r,url:c,path:Vg(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ae({},f,t)},Zg={last:{},history:[]};function Yg(t,e){t===void 0&&(t=Zg);var r=e.options;if(e.type===ne.page){var n=hv(ae({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ae({},t,{last:n,history:t.history.concat(n)})}return t}pv=(function(){if(!xe)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"})(),mv=xe?document.referrer:null,gv=Tg(),yv=kg();var wd={initialized:!1,sessionId:Nn(),app:null,version:null,debug:!1,offline:!!xe&&!navigator.onLine,os:{name:pv},userAgent:xe?navigator.userAgent:"node",library:{name:Qo,version:"0.13.1"},timezone:yv,locale:gv,campaign:{},referrer:mv};function Xg(t,e){t===void 0&&(t=wd);var r=t.initialized,n=e.campaign;switch(e.type){case ne.campaign:return ae({},t,{campaign:n});case ne.offline:return ae({},t,{offline:!0});case ne.online:return ae({},t,{offline:!1});default:return r?t:ae({},wd,t,{initialized:!0})}}var Qg=["plugins","reducers","storage"];function ey(t,e,r){if(xe){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function ty(t){var e=ey.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function wv(){return Jt(Qo,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return hr[dr][Qo].push(o.action||o),i(o)}})}}}function bd(t){return function(){return vr(vr.apply(null,arguments),wv())}}function Do(t){return t?ov(t)?t:[t]:[]}function Sd(t,e,r){t===void 0&&(t={});var n,a,i=Nn();return e&&(Ar[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(Je(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ae({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function ry(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(S,_){if(Je(_))return S.middlewares=S.middlewares.concat(_),S;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var q=_.EVENTS?Object.keys(_.EVENTS).map(function(V){return _.EVENTS[V]}):[];S.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(S.methods[_.name]=Object.keys(_.methods).reduce(function(V,he){var oe;return V[he]=(oe=_.methods[he],function(){for(var le=Array.prototype.slice.call(arguments),se=new Array(oe.length),Re=0;Re<le.length;Re++)se[Re]=le[Re];return se[se.length]=w,oe.apply({instance:w},se)}),V},{}),delete _.methods);var F=Object.keys(_).concat(q),Z=new Set(S.events.concat(F));if(S.events=Array.from(Z),S.pluginsArray=S.pluginsArray.concat(_),S.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return S.plugins[_.name]=_,S.plugins[_.name].loaded||(S.plugins[_.name].loaded=function(){return!0}),S},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Vt,setItem:Jt,removeItem:Ir},i=(function(S){return function(_,q,F){return q.getState("user")[_]||(F&&Ve(F)&&F[_]?F[_]:cd(S)[_]||Vt(ts(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(S){return!es.includes(S)}).sort(),u=new Set(s.concat(nn).filter(function(S){return!es.includes(S)})),l=Array.from(u).sort(),c=function(){return o},f=new Kg,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},m=Og(),P=cd(a),y=ae({},P,r,m.an_uid?{userId:m.an_uid}:{},m.an_aid?{anonymousId:m.an_aid}:{});y.anonymousId||(y.anonymousId=Nn());var b=ae({enable:function(S,_){return new Promise(function(q){k.dispatch({type:ne.enablePlugin,plugins:Do(S),_:{originalAction:ne.enablePlugin}},q,[_])})},disable:function(S,_){return new Promise(function(q){k.dispatch({type:ne.disablePlugin,plugins:Do(S),_:{originalAction:ne.disablePlugin}},q,[_])})}},n.methods),g=!1,w={identify:function(S,_,q,F){try{var Z=At(S)?S:null,V=Ve(S)?S:_,he=q||{},oe=w.user();Jt(ts(kt),Z);var le=Z||V.userId||i(kt,w,V);return Promise.resolve(new Promise(function(se){k.dispatch(ae({type:ne.identifyStart,userId:le,traits:V||{},options:he,anonymousId:oe.anonymousId},oe.id&&oe.id!==Z&&{previousId:oe.id}),se,[_,q,F])}))}catch(se){return Promise.reject(se)}},track:function(S,_,q,F){try{var Z=Ve(S)?S.event:S;if(!Z||!At(Z))throw new Error("EventMissing");var V=Ve(S)?S:_||{},he=Ve(q)?q:{};return Promise.resolve(new Promise(function(oe){k.dispatch({type:ne.trackStart,event:Z,properties:V,options:he,userId:i(kt,w,_),anonymousId:i(sr,w,_)},oe,[_,q,F])}))}catch(oe){return Promise.reject(oe)}},page:function(S,_,q){try{var F=Ve(S)?S:{},Z=Ve(_)?_:{};return Promise.resolve(new Promise(function(V){k.dispatch({type:ne.pageStart,properties:Jg(F),options:Z,userId:i(kt,w,F),anonymousId:i(sr,w,F)},V,[S,_,q])}))}catch(V){return Promise.reject(V)}},user:function(S){if(S===kt||S==="id")return i(kt,w);if(S===sr||S==="anonId")return i(sr,w);var _=w.getState("user");return S?rd(_,S):_},reset:function(S){return new Promise(function(_){k.dispatch({type:ne.resetStart},_,S)})},ready:function(S){return g&&S({plugins:b,instance:w}),w.on(ne.ready,function(_){S&&S(_),g=!0})},on:function(S,_){if(!S||!Je(_))return!1;if(S===ne.bootstrap)throw new Error(".on disabled for "+S);var q=/Start$|Start:/;if(S==="*"){var F=function(oe){return function(le){return function(se){return se.type.match(q)&&_({payload:se,instance:w,plugins:o}),le(se)}}},Z=function(oe){return function(le){return function(se){return se.type.match(q)||_({payload:se,instance:w,plugins:o}),le(se)}}};return h(F,Zr),h(Z,Yr),function(){d(F,Zr),d(Z,Yr)}}var V=S.match(q)?Zr:Yr,he=function(oe){return function(le){return function(se){return se.type===S&&_({payload:se,instance:w,plugins:o,abort:p}),le(se)}}};return h(he,V),function(){return d(he,V)}},once:function(S,_){if(!S||!Je(_))return!1;if(S===ne.bootstrap)throw new Error(".once disabled for "+S);var q=w.on(S,function(F){_({payload:F.payload,instance:w,plugins:o,abort:p}),q()});return q},getState:function(S){var _=k.getState();return S?rd(_,S):Object.assign({},_)},dispatch:function(S){var _=At(S)?{type:S}:S;if(nn.includes(_.type))throw new Error("reserved action "+_.type);var q=ae({},_,{_:ae({originalAction:_.type},S._||{})});k.dispatch(q)},enablePlugin:b.enable,disablePlugin:b.disable,plugins:b,storage:{getItem:a.getItem,setItem:function(S,_,q){k.dispatch({type:ne.setItemStart,key:S,value:_,options:q})},removeItem:function(S,_){k.dispatch({type:ne.removeItemStart,key:S,options:_})}},setAnonymousId:function(S,_){w.storage.setItem(Ut,S,_)},events:{core:nn,plugins:s}},A=n.middlewares.concat([function(S){return function(_){return function(q){return q.meta||(q.meta=Sd()),_(q)}}},v(Zr),Mg(w,c,{all:l,plugins:s}),Fg(a),Ng(w),xg(w),v(Yr)]),x={context:Xg,user:qg(a),page:Yg,track:Bg,plugins:zg(c),queue:Wg},N=vr,z=vr;if(xe&&t.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(N=B({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?wv():Ve(typeof arguments[0])?bd():bd().apply(null,arguments)}}var ie,j=(function(S){return Object.keys(S).reduce(function(_,q){return Qg.includes(q)||(_[q]=S[q]),_},{})})(t),D=n.pluginsArray.reduce(function(S,_){var q=_.name,F=_.config,Z=_.loaded,V=n.pluginEnabled[q];return S[q]={enabled:V,initialized:!!V&&!_.initialize,loaded:!!Z({config:F}),config:F},S},{}),L={context:j,user:y,plugins:D},k=uv((function(S){for(var _=Object.keys(S),q={},F=0;F<_.length;F++){var Z=_[F];typeof S[Z]===Ot&&(q[Z]=S[Z])}var V,he=Object.keys(q);try{(function(oe){Object.keys(oe).forEach(function(le){var se=oe[le];if(typeof se(void 0,{type:Xo})===It||typeof se(void 0,{type:Ug})===It)throw new Error(Lr+" "+le+" "+It)})})(q)}catch(oe){V=oe}return function(oe,le){if(oe===void 0&&(oe={}),V)throw V;for(var se=!1,Re={},Ue=0;Ue<he.length;Ue++){var Fe=he[Ue],ke=oe[Fe],Ye=(0,q[Fe])(ke,le);if(typeof Ye===It){var ut=jg(Fe,le);throw new Error(ut)}Re[Fe]=Ye,se=se||Ye!==ke}return se?Re:oe}})(ae({},x,e)),L,z(N(Lg.apply(void 0,A))));k.dispatch=(ie=k.dispatch,function(S,_,q){var F=ae({},S,{meta:Sd(S.meta,_,Do(q))});return ie.apply(null,[F])});var Y=Object.keys(o);k.dispatch({type:ne.bootstrap,plugins:Y,config:j,params:m,user:y,initialUser:r,persistedUser:P});var te=Y.filter(function(S){return n.pluginEnabled[S]}),Q=Y.filter(function(S){return!n.pluginEnabled[S]});return k.dispatch({type:ne.registerPlugins,plugins:Y,enabled:n.pluginEnabled}),n.pluginsArray.map(function(S,_){var q=S.bootstrap,F=S.config,Z=S.name;q&&Je(q)&&q({instance:w,config:F,payload:S}),k.dispatch({type:ne.registerPluginType(Z),name:Z,enabled:n.pluginEnabled[Z],plugin:S}),n.pluginsArray.length===_+1&&k.dispatch({type:ne.initializeStart,plugins:te,disabled:Q})}),ty(function(S){k.dispatch({type:S?ne.offline:ne.online})}),(function(S,_,q){setInterval(function(){return fv(S,_,q)},3e3)})(k,c,w),w}var Zr="before",Yr="after",Bt="cookie",Mt=Iv(),bv=qn,ny=qn;function Sv(t){return Mt?qn(t,"",-1):Ir(t)}function Iv(){if(Mt!==void 0)return Mt;var t=Bt+Bt;try{qn(t,t),Mt=document.cookie.indexOf(t)!==-1,Sv(t)}catch{Mt=!1}return Mt}function qn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Mt===!1&&(o?Jt(t,e):Vt(t)),o?document.cookie=t+"="+encodeURIComponent(e)+(r?"; expires="+new Date(+new Date+1e3*r).toUTCString()+(n?"; path="+n:"")+(a?"; domain="+a:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}}var Pt="localStorage",ay=As.bind(null,Pt);Pr(Pt,"getItem",Vt);Pr(Pt,"setItem",Jt);Pr(Pt,"removeItem",Ir);var Et="sessionStorage",iy=As.bind(null,Et);Pr(Et,"getItem",Vt);Pr(Et,"setItem",Jt);Pr(Et,"removeItem",Ir);function lr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ve(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var oy=ay(),sy=iy(),cy=Iv();function Gt(t,e){if(t){var r=Us(e),n=!qs(r),a=js(r)?lr(localStorage.getItem(t)):void 0;if(n&&!or(a))return a;var i=Ls(r)?lr(bv(t)):void 0;if(n&&i)return i;var o=Ns(r)?lr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Vt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function vn(t,e,r){if(t&&!or(e)){var n={},a=Us(r),i=JSON.stringify(e),o=!qs(a);return js(a)&&(n[Pt]=Xr(Pt,e,lr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[Pt]:Ls(a)&&(n[Bt]=Xr(Bt,e,lr(bv(t))),ny(t,i),o)?n[Bt]:Ns(a)&&(n[Et]=Xr(Et,e,lr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[Et]:(n[zt]=Xr(zt,e,Vt(t)),Jt(t,e),o?n[zt]:n)}}function uy(t,e){if(t){var r=Us(e),n=Gt(t,nv),a={};return!or(n.localStorage)&&js(r)&&(localStorage.removeItem(t),a[Pt]=n.localStorage),!or(n.cookie)&&Ls(r)&&(Sv(t),a[Bt]=n.cookie),!or(n.sessionStorage)&&Ns(r)&&(sessionStorage.removeItem(t),a[Et]=n.sessionStorage),!or(n.global)&&xn(r,zt)&&(Ir(t),a[zt]=n.global),a}}function Us(t){return t?At(t)?t:t.storage:rv}function js(t){return oy&&xn(t,Pt)}function Ls(t){return cy&&xn(t,Bt)}function Ns(t){return sy&&xn(t,Et)}function qs(t){return t===nv||t==="all"}function xn(t,e){return t===rv||t===e||qs(t)}function Xr(t,e,r){return{location:t,current:e,previous:r}}var ly={setItem:vn,getItem:Gt,removeItem:uy};function fy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Id(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Pd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Id(Object(r),!0).forEach(function(n){fy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Id(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:ly};return ry(Pd(Pd({},e),t))}const xs="@sesamy/sesamy-js",$n="1.54.0";function hy(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=py(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function vy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function py(t){return["#","?"].forEach(e=>t=vy(t,e)),t}function my(){hy(()=>{bt.page()})}var Mo="up",Fo="down";function gy(t){if(t===void 0&&(t={}),!xe)return Yo;var e=Rd(),r=rs(),n=Ed(),a=Qr(n,e),i=Qr(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return Yo;var d=h.map(function(p){return Number(p)}),v=Ag(function(){var p=Rd(),m=(function(j,D){return D.map(function(L){return L===100?j-5:j*(L/100)})})(p,d),P=rs(),y=Ed(),b=Qr(y,p),g=Qr(P,p);if(c=b>c?b:c,f=g<f?g:f,!(o.length>=d.length)){var w=l===y,A=Mo;w?A="initial":l<=y&&(A=Fo);var x=m,N=d;(A===Mo||w)&&(x=m.slice().reverse(),N=d.slice().reverse());var z=N.reduce(function(j,D,L){var k=x[L];return u.includes(D)&&y<=k&&(u=u.filter(function(Y){return Y!==D}),j.singleFunction=D),A===Fo&&!o.includes(D)&&y>=k&&D>i?(s.push(D),j.callbacks=j.callbacks.concat(D),j):A===Mo&&!o.includes(D)&&y<=k&&D<=b?(j.foundFunc=[D],j):(w&&y>=k&&j.foundFunc.length===0&&(j.foundFunc=[D]),!s.includes(D)&&y>=k&&(s.push(D),j.singleFunction?u.push(D):j.singleFunction=D),j)},{foundFunc:[],singleFunction:null,callbacks:[],direction:A});if(l=y,A===Fo&&z.callbacks&&z.callbacks.forEach(function(j){Je(t[j])&&(t[j]({trigger:j,direction:A,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(j))}),z.singleFunction){var B=z.singleFunction,ie=z.direction;Je(t[B])&&t[B]({trigger:B,direction:ie,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(B)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function rs(){return xe?document.body.scrollTop||document.documentElement.scrollTop:0}function yy(){return xe?window.innerHeight||document.documentElement.clientHeight:0}function Ed(){return Math.round(rs()+yy())}function Rd(){if(!xe)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function Qr(t,e){return Math.round(t/e*100)}var $s="Event",_d=$s+"Listener";function wy(t){return function(e,r,n,a){var i=n||Yo,o=a||!1;if(!xe)return i;var s=pn(r),u=pn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+$s);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+_d:"remove"+_d,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?by(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function pn(t,e){if(At(t))return e?pn(document.querySelectorAll(t)):(r=t).split(r.indexOf(",")>-1?",":" ").map(function(o){return o.trim()});var r;if(NodeList.prototype.isPrototypeOf(t)){for(var n=[],a=t.length>>>0;a--;)n[a]=t[a];return n}var i=_g(t);return e?i.map(function(o){return At(o)?pn(o,!0):o}).flat():i}function by(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var Ko=wy($s);function Pv(t,e){return xe&&Je(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),Je(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}Pv.bind(null,"onerror");Pv.bind(null,"onload");var Ev=typeof window>"u",Td="hidden";function Sy(t){if(Ev)return!1;var e=Iy(),r="".concat(e.replace(/[H|h]idden/,""),"visibilitychange"),n=function(){return t(!!document[e])},a=function(){return document.addEventListener(r,n)};return a(),function(){return document.removeEventListener(r,n),a}}function Iy(){var t=["webkit","moz","ms","o"];return Ev||Td in document?Td:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Py=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Ey(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=Sy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Py.map(function(s){return Ko(document,s,r)})).concat(Ko(window,"load",r)).concat(Ko(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Ry(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(m){d(),i&&!c&&i(Cr(h),m),a&&c&&(c=!1,a(Cr(r),m),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Cr(h),m))},s)}var p=Ey(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var m=p();return function(){return f=!1,h=new Date,v({type:"load"}),m()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Cr(h,f),idle:c?Cr(r,f):0}}}}function Cr(t,e){return e?0:Math.round((new Date-t)/1e3)}const kd=5e3;class _y{element;isInViewport=!1;isAwake=!1;isFlushing;observer;lastEventAt=Date.now();registeredView=!1;viewCallback;activeDurationCallback;idleDurationCallback;scrollCallback;constructor(e){this.element=e.element,this.viewCallback=e.viewCallback,this.activeDurationCallback=e.activeDurationCallback,this.idleDurationCallback=e.idleDurationCallback,this.scrollCallback=e.scrollCallback,this.observer=new IntersectionObserver(r=>{r.forEach(n=>{this.handleInViewPort(n.isIntersecting)})},{threshold:0}),this.observer.observe(this.element),Ry({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:kd}),gy({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(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*kd:Date.now(),this.isInViewport&&this.trackAwake(e,r)}handleScroll(e){this.scrollCallback&&this.scrollCallback(e)}handleVisibilityChange(){this.isAwake=!1;const e=Math.round((Date.now()-this.lastEventAt)/1e3);e>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,e))}trackAwake(e,r){!e&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),e&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Rv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Ty(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.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)}}}const Od="sesamy_session_id";function ky(){let t=sessionStorage.getItem(Od);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Od,t)),t}function _v(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}let We={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Tv=[],an;function kv(){const t=window.location.pathname;return Tv.find(e=>e.path?t.includes(e.path):!0)}function Oy(t,e){Tv=t.content||[];const r=kv();r&&r.type==="article"&&(We={...We,...r.selectors}),an=e}function Cy(t,e){const{selector:r}=e;return r===We.article.selector?t:t.querySelector(r)}function Ov(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Ov(t.parentElement,e):t.textContent??void 0}function fr(t){const e=document.head.querySelectorAll(`[property~='${t}'][content]`);for(let n=0;n<e.length;n+=1)if(e[n].content)return e[n].content;const r=document.head.querySelectorAll(`[name~='${t}'][content]`);for(let n=0;n<r.length;n+=1)if(r[n].content)return r[n].content}function Cv({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||fr(`sesamy:${e}`)||fr(`og:${e}`)||fr(e)||r}function Ay(){const t=document.querySelectorAll(We.article.selector);return Array.from(t).map(Ds).filter(e=>e!==null)}function Ds(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:_v(e)},n=(i,o,s,u)=>{const l=Cy(e,o);if(l){const c=Ov(l,o)||Cv({publisherContentId:s,key:i});c!==void 0&&(r[i]=u?u(c):c)}};n("id",We.id),n("title",We.title,r.id),n("excerpt",We.excerpt,r.id),n("image",We.image,r.id),n("price",We.price,r.id,i=>parseFloat(i)),n("currency",We.currency,r.id),n("url",We.url,r.id),n("pass",We.pass,r.id),n("paywallUrl",We.paywallUrl,r.id),n("accessLevel",We.accessLevel,r.id,i=>i||"entitlement");const a=kv();return a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency),a.paywallUrl&&!r.paywallUrl&&(r.paywallUrl=a.paywallUrl)),r}async function Uy(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=Ds(r);if(!n?.url)throw new Error("Could not find content for element");const a=await an.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await an.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||_v(r.parentElement||r);return an.proxy.getContent(i.token,n.url,o)}let Av=!1,on,mn,ns;function Uv(t){return JSON.stringify(t.map(e=>{const{campaign:r,...n}=e.properties||{};return{anonymousId:e.anonymousId,userId:e.userId,type:e.type,properties:n,clientId:ns,requestId:Math.random().toString(36).slice(2,9),sessionId:ky(),timestamp:new Date().toISOString(),version:$n,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:fr("sesamy:item-src"),publisherContentId:fr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:xs,userAgent:navigator.userAgent,clientId:ns}}}))}const jv=Ty(async t=>{if(t.length>0){const e=Uv(t);Av?navigator.sendBeacon(mn,e):(await fetch(mn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function zo(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(mn,Uv([e]))}else jv.push(t)}function jy(){return Av=!0,jv.flush()}function Ly(t,e,r){on=e,mn=`${ht("logs",r)}/events`,ns=t}const Ny={name:"custom-analytics-plugin",page:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;zo({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;zo({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!on)return;const{properties:e,anonymousId:r,userId:n}=t;zo({anonymousId:r,userId:n,properties:e,type:"identify"})}},Cd=["source","medium","campaign","term","content"],Ct="utm_",qy=1800*1e3;function Lv(t){return t?Date.now()-parseInt(t,10)>qy:!0}function Ad(){const t=document.referrer||"";if(!t)return;const e=Gt(`${Ct}set_at`);(Lv(e)||!Gt(`${Ct}referrer`))&&vn(`${Ct}referrer`,t)}function xy(){const t=()=>{const r={};for(const a of Cd){const i=Gt(`${Ct}${a}`);i&&(r[`utm_${a}`]=i)}const n=Gt(`${Ct}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Ad()},campaign({payload:r}){const n=r?.campaign||{},a=Gt(`${Ct}set_at`);if(Object.keys(n).length>0&&Lv(a)){for(const o of Cd){const s=n[o];s&&vn(`${Ct}${o}`,s)}vn(`${Ct}set_at`,String(Date.now()))}Ad()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const $y=xy(),Ud=new Map,jd=new Map;function Dy({clientId:t,enabled:e=!0,environment:r}){Ly(t,e,r),e&&(window.addEventListener("beforeunload",()=>{jd.forEach((n,a)=>{n.bind(a)()}),jy()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Ud.forEach((n,a)=>{n.bind(a)()})}),my(),Rv(()=>{const n=new _y({element:document.body,viewCallback:()=>{bt.page()},activeDurationCallback:(a,i,o)=>{bt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{bt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{bt.track("scroll",{scroll:a.scrollMax})}});jd.set(document.body,()=>{n.flush()}),Ud.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Ze.AUTHENTICATED,async n=>{const a=n;await bt.identify(a.detail.sub)}),window.addEventListener(Ze.LOGOUT,async()=>{await bt.track("logout",{}),await bt.reset()}))}const bt=dy({app:xs,version:$n,plugins:[$y,Ny]});function Nv(t,e){bt.track(t,e)}function qv(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});Nv(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function My(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function Fy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Ky(){return/android/i.test(navigator.userAgent)}let qe,xv,Nr,as=!1,sn=!1;qr()&&window.addEventListener("pageshow",()=>{sn=!1});const pr="sesamyAccessToken",Ho="sesamyRefreshToken",gn="sesamySilentAuthThrottle",zy=300*1e3;async function Dn(){return as?!0:new Promise((t,e)=>{const r=setTimeout(()=>{as?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Ze.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Hy(t){if(!t)return null;const e=localStorage.getItem(Ho);if(!e)return pe("No refresh token found in localstorage"),null;const r=new URLSearchParams;r.set("client_id",t.iss),r.set("refresh_token",e),r.set("grant_type","refresh_token");const n=new URL(t.iss);n.pathname="/oauth/token",n.searchParams.set("user_id",t.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(Ho),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Ho,i.refresh_token),localStorage.setItem(pr,i.access_token),i.access_token}catch{Ks()}}async function Ms(){const t=localStorage.getItem(pr);if(!t)return null;const e=zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Hy(e);if(r)return r;localStorage.removeItem(pr)}return t}let en=null;const By=64;function Gy(){try{if(en!==null)return en;const e=Object.keys(localStorage).filter(r=>r.startsWith("@@auth0spajs@@"));for(const r of e){const n=JSON.parse(localStorage.getItem(r)||"{}");let a;if(typeof n=="object"&&(n.body&&typeof n.body=="object"&&"refresh_token"in n.body?a=n.body.refresh_token:"refresh_token"in n&&(a=n.refresh_token)),a&&typeof a=="string"&&a.length===By)return en=!0,!0}}catch(t){pe(`Error checking for existing auth0 tokens: ${t.message}`)}return en=!1,!1}function Wy(t){if(t.domains&&t.domains.length>0){const e=mr(window.location.href);if(e){for(const r of t.domains)if(mr(`https://${r}`)===e)return pe(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;pe(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return pe(`Using fallback domain property: ${t.domain}`),t.domain}function mr(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function Vy(t){if(t.enabled===!1)return;xv=t.organization;const e=Wy(t);Nr=e&&!Gy()?e:tv("token",t.environment);const r={domain:Nr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",mr(window.location.href)!==mr(`https://${Nr}`)&&(r.useRefreshTokens=!0),pe(`Initializing auth0 client: ${JSON.stringify(r)}`),qe=await Qm(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)pe("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{pe("Code found in URL, handling redirect");try{const u=await qe.handleRedirectCallback();pe(`Login result: ${JSON.stringify(u)}`);const l=await qe.getUser();if(!l)throw pe("No user found"),new Error("No user found");pe(`User found ${JSON.stringify(l)}`),Fs(),jt(Ze.AUTHENTICATED,l),pe("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}as=!0,jt(Ze.AUTH_INITIALIZED,{})}async function $r(){return await Dn(),await Ms()?!0:qe?qe.isAuthenticated():!1}async function Jy(){return await Dn(),await Ms()?(pe("Using local user"),{sub:"local",name:"Local User"}):qe?qe.getUser():null}function $v(t){if(sn)return pe("Login already in progress"),null;if(sn=!0,setTimeout(()=>{sn=!1},3e3),localStorage.removeItem(pr),!qe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:xv,redirect_uri:window.location.href,ui_locales:ln(),incognito:Cs(),...e}}}async function Mn(t){const e=$v(t);if(e)return qe.loginWithRedirect(e)}async function Dv(t){const e=$v(t);if(!e)return;await qe.loginWithPopup(e,{timeoutInSeconds:1800}),Fs(),qv(Ze.AUTHENTICATED,await qe.getUser()).canceled||window.location.reload()}async function Zy(t){return Nr&&mr(window.location.href)!==mr(`https://${Nr}`)&&(Fy()||Ky()||Cs())?Dv(t):Mn(t)}function Yy(){try{const t=sessionStorage.getItem(gn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<zy}catch{return sessionStorage.removeItem(gn),!1}}function Xy(){try{const t={timestamp:Date.now()};sessionStorage.setItem(gn,JSON.stringify(t))}catch{pe("Failed to set silent auth throttle in sessionStorage")}}function Fs(){try{sessionStorage.removeItem(gn)}catch{}}async function xt(t=!0,e=!1){await Dn();const r=await Ms();if(r)return r;if(!e&&Yy()){if(pe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!qe)return pe("Auth client not initialized"),null;let n=await qe.getTokenSilently();const a=zs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await qe.getTokenSilently({cacheMode:e?"off":"on"})),Fs(),n}catch(n){const a=n;if(pe(`Failed to get token silently: ${a.message}`),Xy(),await qe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Ks(),t)throw n;return null}}async function Ks(t={}){if(await Dn(),localStorage.removeItem(pr),jt(Ze.LOGOUT,{}),!!qe)return pe(`Logout with options: ${JSON.stringify(t)}`),qe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function zs(t){const e=t.split(".");if(e.length!==3)return null;const n=e[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 is(t){const e=zs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");pe("Set token"),localStorage.setItem(pr,t),jt(Ze.AUTHENTICATED,e)}const Qy=(t,e)=>e.skipDedupe||e.method!=="GET",ew=(t,e)=>e.method+"@"+t,tw=t=>t.clone(),Ld=({skip:t=Qy,key:e=ew,resolver:r=tw}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},rw=(t,e)=>t*e,nw=t=>t&&t.ok,Nd=({delayTimer:t=500,delayRamp:e=rw,maxAttempts:r=10,until:n=nw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(m=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:c})).then((y={})=>{var b,g;m(u((b=y&&y.url)!==null&&b!==void 0?b:l,(g=y&&y.options)!==null&&g!==void 0?g:c))}):m(u(l,c))},P)}).then(h).catch(m=>{if(!i)throw m;return h(null,m)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};class aw{get(e){return typeof sessionStorage>"u"?null:sessionStorage.getItem(e)}set(e,r){typeof sessionStorage<"u"&&sessionStorage.setItem(e,r)}remove(e){typeof sessionStorage<"u"&&sessionStorage.removeItem(e)}clear(){}}function os(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Mv(t,e){if(os(t))return{itemSrc:t};const r=t.split(":");if(r.length<2)throw new Error(`Invalid itemSrc format: expected at least 2 segments separated by ':', got ${r.length}`);const[n,a,i]=r;if(!a)throw new Error("Invalid itemSrc format: sku segment is empty");return{sku:`${n}:${a}`,purchaseOption:e||i}}function qd(t){return t.endsWith("/")?t.slice(0,-1):t}function xd(t,e){if(!os(t)||!os(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&qd(r.pathname)===qd(n.pathname)}function iw(t,e,r){const n=new URL(`${ht("checkout3",t.environment)}`);if(e.language&&n.searchParams.set("lang",e.language),e.sku)n.searchParams.set("sku",e.sku),e.purchaseOptionId&&n.searchParams.set("po-id",e.purchaseOptionId);else if(e.itemSrc){const{sku:s,purchaseOption:u,itemSrc:l}=Mv(e.itemSrc,e.purchaseOptionId);l&&n.searchParams.set("url",l),s&&n.searchParams.set("sku",s),u&&n.searchParams.set("po-id",u)}e.email&&n.searchParams.set("email",e.email),e.business&&n.searchParams.set("business","true"),e.currency&&n.searchParams.set("currency",e.currency),e.price&&n.searchParams.set("price",e.price.toString()),e.discountCode&&n.searchParams.set("discount-code",e.discountCode),e.attributionItemSrc?n.searchParams.set("itemSrc",e.attributionItemSrc):r.itemSrc&&n.searchParams.set("itemSrc",r.itemSrc),e.attributionPublisherContentId?n.searchParams.set("publisherContentId",e.attributionPublisherContentId):r.publisherContentId&&n.searchParams.set("publisherContentId",r.publisherContentId),e.utmSource?n.searchParams.set("utm_source",e.utmSource):r.utmSource&&n.searchParams.set("utm_source",r.utmSource),e.utmMedium?n.searchParams.set("utm_medium",e.utmMedium):r.utmMedium&&n.searchParams.set("utm_medium",r.utmMedium),e.utmCampaign?n.searchParams.set("utm_campaign",e.utmCampaign):r.utmCampaign&&n.searchParams.set("utm_campaign",r.utmCampaign),e.utmTerm?n.searchParams.set("utm_term",e.utmTerm):r.utmTerm&&n.searchParams.set("utm_term",r.utmTerm),e.utmContent?n.searchParams.set("utm_content",e.utmContent):r.utmContent&&n.searchParams.set("utm_content",r.utmContent);const a=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(s=>{const[u,l]=s.trim().split("=");return{key:u,value:l}}).filter(s=>a.some(u=>u===s.key)).forEach(s=>{n.searchParams.append(s.key,s.value)});let o=new URL(window.location.href);if(e.redirectUrl)try{o=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return o.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&o.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",o.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:s,methods:u})=>u?u.map(l=>`${s}|${l}`):s).join(",")),n}const Fv="sesamySignedURLs";function Hs(){const t=sessionStorage.getItem(Fv);return t?JSON.parse(t):[]}function ow(t){const e=Hs();e.push(t),pe(`Adding signed URL: ${t}`),sessionStorage.setItem(Fv,JSON.stringify(e))}function sw(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const ss="sesamyAttribution";function cw(t){const e=localStorage.getItem(t);if(!e)return null;try{return JSON.parse(e).value}catch{return console.error(`Failed to parse ${t}`),null}}function uw(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function yn(){return cw(ss)||{}}function Kv(t){if(t===null)localStorage.removeItem(ss);else{pe(`Setting attribution ${JSON.stringify(t)}`);const e=yn()??{},r=sw({...e,...uw(t)});localStorage.setItem(ss,JSON.stringify({value:r}))}}function lw(t){const e=t.endpoint||ht("api2",t.environment),r=async()=>{const T=await xt(!0);if(!T)throw new Error("No access token available");return T},n=Ce.client({baseUrl:e,tokenProvider:r,libraryName:xs,libraryVersion:$n,vendorId:t.vendorId,cache:{mode:Ce.CacheMode.BROWSER,storage:new aw}}),a=T=>async(K,J)=>{let re=sessionStorage.getItem(ed);re||(re=Date.now().toString(),sessionStorage.setItem(ed,re));const me={...J,headers:{...J.headers,"Cache-Timestamp":re}};return T(K,me)},i=(T=!0)=>K=>async(J,re)=>{let me=null;if(me=await xt(T),!me){if(T)throw new Error("No access token available");return K(J,re)}const Ke={...re,headers:{...re.headers,...me?{Authorization:`Bearer ${me}`}:{}}};return K(J,Ke)},o=T=>(K,J)=>{if(J.headers&&"Authorization"in J.headers)return T(K,J);const re=localStorage.getItem("__anon_id"),me=btoa(`${t.clientId}|${re}:`),Ke={...J,headers:{...J.headers,Authorization:`Basic ${me}`}};return T(K,Ke)},s=Ce.wretch(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Ld(),Nd({delayTimer:1e3,delayRamp:(T,K)=>T*K,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]),u=Ce.wretch(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Ld(),Nd({delayTimer:1e3,delayRamp:(T,K)=>T*K,maxAttempts:3,until:T=>!!(T&&(T.ok||T.status>=400&&T.status<500)),retryOnNetworkError:!1})]);async function l(T={}){const{waitForEntitlementAfter:K,includeSignedLinks:J=!0}=T,re=await $r()?await n.entitlements.list({waitForEntitlementAfter:K?.toISOString()}):[];return J&&re.push(...Hs()),re}async function c(T,K=[]){return(await l())?.find(me=>{const{sku:Ke,purchaseOption:M}=Mv(T);return!!("sku"in me&&Ke===me.sku||M&&"purchaseOptionsId"in me&&M===me.purchaseOptionsId||xd(T,me.url)||K.some(ee=>xd(ee,me.url)))})}async function f(T){return n.entitlements.get(T)}async function h(T){return n.entitlements.getAccess(T)}async function d(T,K,J){const re=new URL(ht("api2",t.environment));return re.pathname="/proxy",re.searchParams.set("url",K),J&&re.searchParams.set("selector",J),Ce.wretch(re.toString()).headers({Authorization:`Bearer ${T}`}).get().text()}async function v(T){if(!T)throw new Error("SKU is required to get fulfillments");return await $r()?await s.get(`/fulfillments?sku=${encodeURIComponent(T)}`).json():[]}async function p(T,K){if(!T||!K)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:T},`/fulfillments/${encodeURIComponent(K)}/request-delivery?`).res()).ok}async function m(){return s.get("/contracts").json()}async function P(T){return(await s.get("/contracts").json())?.find(J=>J.id===T)}async function y(T){const K=await s.post({},`/contracts/${encodeURIComponent(T)}/cancel`).res();return Ce.clearCache(),K.ok}async function b(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function g(){return s.get("/bills").json()}async function w(T){return(await s.get("/bills").json())?.find(J=>J.id===T)}async function A(){return s.get("/transactions").json()}async function x(T){return(await s.get("/transactions").json())?.find(J=>J.id===T)}async function N(T,K){const J=await s.url(`/user-metadata/${encodeURIComponent(T)}`).put(K).json();return jt(Ze.USER_ATTRIBUTE_CHANGED,{}),Ce.clearCache(),J}async function z(T){const K=await s.url(`/user-metadata/${encodeURIComponent(T)}`).delete().res();return Ce.clearCache(),K.ok}async function B(){return await s.url("/user-metadata").get().json()}async function ie(T){return(await B())[T]||null}async function j(){return await s.url("/tags").get().json()}async function D(T){const K=await s.url(`/tags/${encodeURIComponent(T)}`).delete().res();return Ce.clearCache(),K.ok}async function L(T){const K=await s.url("/tags").post(encodeURIComponent(T)).res();return jt(Ze.USER_ATTRIBUTE_CHANGED,{}),Ce.clearCache(),K.ok}async function k(T){return(await u.url("/tallies").get().json())[T]}async function Y(){return await u.url("/tallies").get().json()}async function te(T){const K=await u.url(`/tallies/${T}`).delete().res();return Ce.clearCache(),K.ok}async function Q(T,K){return await u.url(`/tallies/${encodeURIComponent(T)}/push`).post(K).json()}async function S(T){return n.products.get(T)}async function _(){return await xt(!1)?await s.url("/profile").get().json():null}async function q(T){const K=await s.url("/profile").patch(T).res();return Ce.clearCache(),K.ok}async function F(){return await s.url("/payment-issues").get().json()}async function Z(){return(await s.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function V(){return(await s.url("/profile/unlink-spotify").post().res()).ok}async function he(T){const K=await xt(!1);if(!K)throw new Error("No access token available");const J=new URL(`${ht("access-sync",t.environment)}/spotify/sesamy-callback`);J.searchParams.set("access_token",K),J.searchParams.set("state",T),window.location.href=J.toString()}async function oe(T){const K=await s.url(`/products/${encodeURIComponent(T)}/auto-onboard`).post().json();return K.length&&Ce.clearCache(),K}async function le(T,K=3600){const{shortlink:J}=await Ce.wretch(rg).post({url:T,ttl:K}).json();return J}async function se(T){const K=await xt(!1,!0);let J;const re=T.language||ln(),me=yn();switch(T.target){case"account":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}${T.contractId?`/${encodeURIComponent(T.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(T.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"consume":J=new URL(`${ht("consume",t.environment)}/${encodeURIComponent(T.language||re)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(T.sku)}`),T.episodeId?J.href+=`/${T.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",T.redirectUrl||window.location.href);break;case"checkout":J=iw(t,{language:re,...T},me);break;default:throw new Error("Invalid target")}return K&&(J.hash=`#access_token=${K}`),T.shorten?le(J.href,T.ttl):J.href}async function Re(T){const K=yn(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(me=>{const Ke=K,[M,ee]=me.trim().split("=");J.includes(M)&&!Ke[M]&&(Ke[M]=ee)}),(await u.url("/checkouts").post({language:ln(),...T,attribution:{...K,...T.attribution},vendorId:t.vendorId})).json()}async function Ue(T,K){return(await u.url(`/checkouts/${T}`).patch(K)).json()}async function Fe(T){return(await u.url(`/checkouts/${T}`).get()).json()}async function ke(T){return(await u.url(`/paywalls/${T}`).get()).json()}async function Ye(){return(await u.url("/vendor").get()).json()}async function ut(){return(await s.url("/vendors").get()).json()}async function lt(T){return(await s.url(`/contracts/${encodeURIComponent(T.contractId)}/amendments`).post({amendmentType:T.amendmentType,discountCode:T.discountCode})).json()}async function mt(T){return await s.url(`/amendments/${encodeURIComponent(T)}/confirm`).post(),!0}async function gt(){const T=await xt(!1),K=new URL(`${ht("account",t.environment)}/subscriptions/${t.clientId}`);T&&(K.hash=`#access_token=${T}`),window.location.href=K.toString()}return{autoOnboardProduct:oe,cancelContract:y,confirmAmendment:mt,createAmendment:lt,createCheckout:Re,deleteTag:D,deleteTally:te,deleteUserMetadata:z,generateLink:se,getBill:w,getBills:g,getCheckout:Fe,getProxyContent:d,getContract:P,getContracts:m,getEntitlement:f,getEntitlementAccess:h,getEntitlements:l,getFulfillments:v,requestDelivery:p,getPaywall:ke,getPaymentIssues:F,getProfile:_,getProduct:S,getSubscriptions:b,getTally:k,getTallies:Y,getTags:j,getTransaction:x,getTransactions:A,getUserMetadata:ie,hasAccess:c,isSpotifyLinked:Z,linkSpotify:he,listUserMetadata:B,openHostedAccountPage:gt,pushTally:Q,setTag:L,setUserMetadata:N,unlinkSpotify:V,updateCheckout:Ue,updateProfile:q,getVendorSettings:Ye,listVendors:ut}}const fw=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function dw(){return new Promise(t=>{const e=fw.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function hw(){const t=navigator.userAgent.toLowerCase(),e=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of e)if(r.regex.test(t))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(t)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}const zv="sesamyFlags";async function Hv(t){try{localStorage.setItem(zv,JSON.stringify(t))}catch{pe("Failed to save flags to localStorage")}}async function vw(t,e){const r=await Fn();r[t]=e,await Hv(r)}async function pw(t){return(await Fn())[t]}async function mw(t){const e=await Fn();t in e&&(delete e[t],await Hv(e))}async function Fn(){try{const t=localStorage.getItem(zv);return t?JSON.parse(t):{}}catch{return{}}}function gw(t){const{autoOnboardProduct:e,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:u,getBills:l,getCheckout:c,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:p,getFulfillments:m,getPaywall:P,getPaymentIssues:y,getProfile:b,getProduct:g,getProxyContent:w,getSubscriptions:A,getTags:x,getTally:N,getTallies:z,getTransaction:B,getTransactions:ie,getUserMetadata:j,getVendorSettings:D,listVendors:L,hasAccess:k,isSpotifyLinked:Y,linkSpotify:te,listUserMetadata:Q,openHostedAccountPage:S,pushTally:_,requestDelivery:q,setTag:F,setUserMetadata:Z,unlinkSpotify:V,updateCheckout:he,updateProfile:oe}=lw(t),le={analytics:{track:Nv},attribution:{get:yn,set:Kv},auth:{getUser:b,getTokenSilently:xt,isAuthenticated:$r,loginWithRedirect:Mn,loginWithPopup:Dv,login:Zy,logout:Ks,setToken:is},bills:{get:u,list:l},browser:{detectAdblock:dw,isInAppBrowser:hw,isIncognito:Cs},checkouts:{create:n,get:c,update:he},clearCache:Ce.clearCache,content:{list:Ay,get:Ds,getLanguage:ln,unlock:Uy,getPropertyFromHTML:Cv},contracts:{cancel:r,get:f,list:h},entitlements:{access:v,get:d,hasAccess:k,list:p,signedLinks:Hs},events:{emit:qv,cancel:My},flags:{get:pw,set:vw,list:Fn,delete:mw},fulfillments:{list:m,requestDelivery:q},generateLink:s,getPaymentIssues:y,getVersion:yw,isReady:()=>exports.isInitialized,log:pe,paywalls:{get:P},products:{autoOnboard:e,get:g,linkSpotify:te},profile:{get:b,isSpotifyLinked:Y,openHostedAccountPage:S,unlinkSpotify:V,update:oe},proxy:{getContent:w},subscriptions:{list:A},tags:{delete:a,list:x,set:F},tallies:{delete:i,get:N,list:z,push:_},transactions:{get:B,list:ie},userMetadata:{delete:o,get:j,list:Q,set:Z},vendors:{get:D,list:L},setToken:is};return t.namespace&&(window[t.namespace]=le),le}function yw(){return $n}function ww(t,e){t.style.position="relative",t.style.height="200px",t.style.overflow="hidden";let n=0;const a=Array.from(t.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
36
36
|
${e.selector}::before {
|
|
37
37
|
content: '';
|
|
38
38
|
position: absolute;
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
44
44
|
pointer-events: none;
|
|
45
45
|
}
|
|
46
|
-
`,document.head.appendChild(i)}async function bw(t){try{const e=await fetch(t);return e.ok?await e.text():(console.error(`Failed to fetch content from ${t}: ${e.statusText}`),null)}catch(e){return console.error(`Error fetching content from ${t}:`,e),null}}async function Bs(t){if(t.contentType==="selector"&&t.content){const e=document.querySelector(t.content);if(e)return e.innerHTML;console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const e=await bw(t.content);if(e)return e;console.warn(`Failed to fetch content from URL '${t.content}'`)}else if(t.content)return t.content;return""}async function Sw(t,e){const r=e.insertionPoint||"inside",n=await Bs(e);switch(r){case"before":t.insertAdjacentHTML("beforebegin",n);break;case"after":t.insertAdjacentHTML("afterend",n);break;case"inside":default:t.innerHTML+=n;break}}async function Iw(t,e){const r=await Bs(e);t.innerHTML=r}async function Pw(t,e){const r=await Bs(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Ew({enabled:t=!1,rules:e}){t&&Rv(async()=>{const r=await $r(),n=window.location.href;for(const a of e){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await Sw(s,a);break;case"replace":await Iw(s,a);break;case"remove":o.remove();break;case"wrap":await Pw(s,a);break;case"gradient":ww(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const $d="access_token";function Rw(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get($d);if(e){is(e);const r=new URL(window.location.href);t.delete($d),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const Dd="sesamy-refresh",Md="force-refetch-entitlements";function _w(){const t=new URLSearchParams(window.location.search),e=t.get(Md),r=t.get(Dd);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(Md),t.delete(Dd),n.search=t.toString(),Ce.clearCache(),window.history.replaceState(null,"",n)}}function Tw(t){if(!t||typeof t!="string")throw new Error("Invalid token: token must be a non-empty string");const e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT format: token must have exactly 3 parts separated by dots");const[,r]=e;if(!r)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(r)}catch{throw new Error("Invalid JWT format: payload is not valid base64")}try{return JSON.parse(n)}catch{throw new Error("Invalid JWT format: payload is not valid JSON")}}function kw(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Tw(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOption:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",hasAccess:!0,expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};ow(i)}catch(n){pe(`Failed to extract signed link ${n}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const Fd="sesamy-user";async function Ow(){const e=new URLSearchParams(window.location.search).get(Fd)?.toLowerCase();if(!e)return;const r=await Jy();r?.email!==e?(pe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),Ce.clearCache(),Mn({authorizationParams:{login_hint:e}})):pe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(Fd),window.history.replaceState(null,"",n)}const Kd="sesamy-purchase";function Cw(){const t=new URLSearchParams(window.location.search),e=t.get(Kd);if(e!==null){const r=new URL(window.location.href);t.delete(Kd),r.search=t.toString(),pe(`Purchase ${e}`),jt(
|
|
46
|
+
`,document.head.appendChild(i)}async function bw(t){try{const e=await fetch(t);return e.ok?await e.text():(console.error(`Failed to fetch content from ${t}: ${e.statusText}`),null)}catch(e){return console.error(`Error fetching content from ${t}:`,e),null}}async function Bs(t){if(t.contentType==="selector"&&t.content){const e=document.querySelector(t.content);if(e)return e.innerHTML;console.warn(`Source element for selector '${t.content}' not found`)}else if(t.contentType==="url"&&t.content){const e=await bw(t.content);if(e)return e;console.warn(`Failed to fetch content from URL '${t.content}'`)}else if(t.content)return t.content;return""}async function Sw(t,e){const r=e.insertionPoint||"inside",n=await Bs(e);switch(r){case"before":t.insertAdjacentHTML("beforebegin",n);break;case"after":t.insertAdjacentHTML("afterend",n);break;case"inside":default:t.innerHTML+=n;break}}async function Iw(t,e){const r=await Bs(e);t.innerHTML=r}async function Pw(t,e){const r=await Bs(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Ew({enabled:t=!1,rules:e}){t&&Rv(async()=>{const r=await $r(),n=window.location.href;for(const a of e){const i=document.querySelectorAll(a.selector);if(!(a.path&&!new RegExp(a.path).test(n)))for(const o of i){const s=o;if(!(a.authenticated!==void 0&&a.authenticated!==r))switch(a.transform){case"insert":await Sw(s,a);break;case"replace":await Iw(s,a);break;case"remove":o.remove();break;case"wrap":await Pw(s,a);break;case"gradient":ww(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const $d="access_token";function Rw(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get($d);if(e){is(e);const r=new URL(window.location.href);t.delete($d),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const Dd="sesamy-refresh",Md="force-refetch-entitlements";function _w(){const t=new URLSearchParams(window.location.search),e=t.get(Md),r=t.get(Dd);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(Md),t.delete(Dd),n.search=t.toString(),Ce.clearCache(),window.history.replaceState(null,"",n)}}function Tw(t){if(!t||typeof t!="string")throw new Error("Invalid token: token must be a non-empty string");const e=t.split(".");if(e.length!==3)throw new Error("Invalid JWT format: token must have exactly 3 parts separated by dots");const[,r]=e;if(!r)throw new Error("Invalid JWT format: payload is empty");let n;try{n=atob(r)}catch{throw new Error("Invalid JWT format: payload is not valid base64")}try{return JSON.parse(n)}catch{throw new Error("Invalid JWT format: payload is not valid JSON")}}function kw(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Tw(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOption:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",hasAccess:!0,expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};ow(i)}catch(n){pe(`Failed to extract signed link ${n}`)}const r=new URL(window.location.href);r.searchParams.delete("ss"),r.searchParams.delete("se"),r.searchParams.delete("sp"),r.searchParams.delete("so"),r.searchParams.delete("token"),r.searchParams.delete("sesamy-token"),window.history.replaceState(null,"",r)}const Fd="sesamy-user";async function Ow(){const e=new URLSearchParams(window.location.search).get(Fd)?.toLowerCase();if(!e)return;const r=await Jy();r?.email!==e?(pe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),Ce.clearCache(),Mn({authorizationParams:{login_hint:e}})):pe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(Fd),window.history.replaceState(null,"",n)}const Kd="sesamy-purchase";function Cw(){const t=new URLSearchParams(window.location.search),e=t.get(Kd);if(e!==null){const r=new URL(window.location.href);t.delete(Kd),r.search=t.toString(),pe(`Purchase ${e}`),jt(Ze.PURCHASE,{itemSrc:e}),Ce.clearCache(),window.history.replaceState(null,"",r)}}const zd="sesamy-login",Aw="sesamy_login";async function Uw(){const t=new URLSearchParams(window.location.search);if(!(t.get(zd)||t.get(Aw)))return;await $r()||Mn();const n=new URL(window.location.href);n.searchParams.delete(zd),window.history.replaceState(null,"",n)}const Hd="sesamy-debug";async function jw(){const e=new URLSearchParams(window.location.search).get(Hd)?.toLowerCase();if(!e)return;lm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(Hd),window.history.replaceState(null,"",r)}function Lw(){if(!document.referrer.length)return;const t=new URL(document.referrer);if(!(t.hostname===window.location.hostname||t.hostname.includes("sesamy")))return document.referrer}async function Nw(t){if(!qr())return;const e=new URLSearchParams(window.location.search),r={utmSource:e.get("utm_source")??void 0,utmMedium:e.get("utm_medium")??void 0,utmCampaign:e.get("utm_campaign")??void 0,utmTerm:e.get("utm_term")??void 0,utmContent:e.get("utm_content")??void 0,ref:e.get("ref")??void 0,referrer:Lw()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),Kv(r)}function qw(){const t=new URLSearchParams(window.location.search);let e=!1;try{e=!!window.opener&&window.opener.location.origin===window.location.origin}catch{e=!1}const r=sessionStorage.getItem(td)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(td,"true"),n||(pe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function xw(t){const e=a=>i=>{i.preventDefault();try{a()}catch(o){console.error("Error handling click:",o)}},r=(a,i)=>{try{document.querySelectorAll(a).forEach(s=>{s.addEventListener("click",e(i))})}catch(o){console.error(`Error attaching event handlers (selector: ${a}):`,o)}};r('[sesamy-link="login"]',()=>t.auth.loginWithRedirect()),r('[sesamy-link="logout"]',()=>t.auth.logout());const n=await t.generateLink({target:"account"});n&&r('[sesamy-link="account"]',()=>{window.location.href=n})}async function $w(t){const e=await t.auth.isAuthenticated();try{document.querySelectorAll(`[sesamy-visibility="${e?"not-logged-in":"logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="none")}),document.querySelectorAll(`[sesamy-visibility="${e?"logged-in":"not-logged-in"}"]`).forEach(a=>{a instanceof HTMLElement&&(a.style.display="")})}catch(r){console.error("Error handling visibility:",r)}}async function Dw(t){const e=fr("sesamy:locked-content-redirect-url");if(!e)return;const[r]=t.content.list();if(!r)return;await t.entitlements.hasAccess(r.url||"",r.pass?.split(",")||[])||(location.href=e)}exports.isInitialized=!1;async function Bd(t,e){pe(`Init with config: ${JSON.stringify(t)}`);try{qw(),Dy({clientId:t.clientId,environment:t.environment,...t.analytics}),await Vy({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),Oy(t,e),t.transform&&await Ew(t.transform),ig(),jw(),Nw(e),Rw(),_w(),kw(),await Uw(),await Ow(),Cw(),await $w(e),await xw(e),await Dw(e),exports.isInitialized=!0,jt(Ze.READY,{})}catch(r){pe(`Failed to init ${r.message}`)}}async function Bv(t){pe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(qr()&&e in window)return pe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=gw({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return qr()?(t.awaitAllServices?await Bd(t,r):Bd(t,r),r):(exports.isInitialized=!0,r)}if(qr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);Bv(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Ze;exports.init=Bv;
|