@sesamy/sesamy-js 1.45.0 → 1.46.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.
@@ -1,7 +1,7 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var gc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},yc={},ca,wc;function $e(){return wc||(wc=1,ca=function(t){try{return!!t()}catch{return!0}}),ca}var ua,bc;function qn(){if(bc)return ua;bc=1;var t=$e();return ua=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ua}var la,Sc;function be(){if(Sc)return la;Sc=1;var t=qn(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return la=t?n:function(a){return function(){return r.apply(a,arguments)}},la}var fa,Ic;function Ln(){if(Ic)return fa;Ic=1;var t=be(),e=t({}.toString),r=t("".slice);return fa=function(n){return r(e(n),8,-1)},fa}var da,Pc;function bh(){if(Pc)return da;Pc=1;var t=be(),e=$e(),r=Ln(),n=Object,a=t("".split);return da=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,da}var ha,Ec;function Nn(){return Ec||(Ec=1,ha=function(t){return t==null}),ha}var va,_c;function $n(){if(_c)return va;_c=1;var t=Nn(),e=TypeError;return va=function(r){if(t(r))throw new e("Can't call method on "+r);return r},va}var pa,Tc;function Xr(){if(Tc)return pa;Tc=1;var t=bh(),e=$n();return pa=function(r){return t(e(r))},pa}var Ur,kc;function Se(){if(kc)return Ur;kc=1;var t=function(e){return e&&e.Math===Math&&e};return Ur=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof gc=="object"&&gc)||t(typeof Ur=="object"&&Ur)||(function(){return this})()||Function("return this")(),Ur}var ma={exports:{}},ga,Rc;function mt(){return Rc||(Rc=1,ga=!1),ga}var ya,Oc;function ks(){if(Oc)return ya;Oc=1;var t=Se(),e=Object.defineProperty;return ya=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},ya}var Cc;function Rs(){if(Cc)return ma.exports;Cc=1;var t=mt(),e=Se(),r=ks(),n="__core-js_shared__",a=ma.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"}),ma.exports}var wa,Ac;function Sh(){if(Ac)return wa;Ac=1;var t=Rs();return wa=function(e,r){return t[e]||(t[e]=r||{})},wa}var ba,jc;function xn(){if(jc)return ba;jc=1;var t=$n(),e=Object;return ba=function(r){return e(t(r))},ba}var Sa,Uc;function rt(){if(Uc)return Sa;Uc=1;var t=be(),e=xn(),r=t({}.hasOwnProperty);return Sa=Object.hasOwn||function(a,i){return r(e(a),i)},Sa}var Ia,qc;function Ih(){if(qc)return Ia;qc=1;var t=be(),e=0,r=Math.random(),n=t(1.1.toString);return Ia=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},Ia}var Pa,Lc;function Qr(){if(Lc)return Pa;Lc=1;var t=Se(),e=t.navigator,r=e&&e.userAgent;return Pa=r?String(r):"",Pa}var Ea,Nc;function Ph(){if(Nc)return Ea;Nc=1;var t=Se(),e=Qr(),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]))),Ea=s,Ea}var _a,$c;function Eh(){if($c)return _a;$c=1;var t=Ph(),e=$e(),r=Se(),n=r.String;return _a=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),_a}var Ta,xc;function _h(){if(xc)return Ta;xc=1;var t=Eh();return Ta=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ta}var ka,Dc;function xe(){if(Dc)return ka;Dc=1;var t=Se(),e=Sh(),r=rt(),n=Ih(),a=Eh(),i=_h(),o=t.Symbol,s=e("wks"),c=i?o.for||o:o&&o.withoutSetter||n;return ka=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:c("Symbol."+l)),s[l]},ka}var Ra,Mc;function Pe(){if(Mc)return Ra;Mc=1;var t=typeof document=="object"&&document.all;return Ra=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Ra}var Oa,Fc;function nt(){if(Fc)return Oa;Fc=1;var t=Pe();return Oa=function(e){return typeof e=="object"?e!==null:t(e)},Oa}var Ca,Kc;function st(){if(Kc)return Ca;Kc=1;var t=nt(),e=String,r=TypeError;return Ca=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ca}var Aa={},ja,Hc;function De(){if(Hc)return ja;Hc=1;var t=$e();return ja=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),ja}var Ua,zc;function Th(){if(zc)return Ua;zc=1;var t=De(),e=$e();return Ua=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ua}var qa={},La,Bc;function Dn(){if(Bc)return La;Bc=1;var t=Se(),e=nt(),r=t.document,n=e(r)&&e(r.createElement);return La=function(a){return n?r.createElement(a):{}},La}var Na,Gc;function kh(){if(Gc)return Na;Gc=1;var t=De(),e=$e(),r=Dn();return Na=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),Na}var $a,Wc;function He(){if(Wc)return $a;Wc=1;var t=qn(),e=Function.prototype.call;return $a=t?e.bind(e):function(){return e.apply(e,arguments)},$a}var xa,Vc;function at(){if(Vc)return xa;Vc=1;var t=Se(),e=Pe(),r=function(n){return e(n)?n:void 0};return xa=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},xa}var Da,Jc;function Mn(){if(Jc)return Da;Jc=1;var t=be();return Da=t({}.isPrototypeOf),Da}var Ma,Zc;function Rh(){if(Zc)return Ma;Zc=1;var t=at(),e=Pe(),r=Mn(),n=_h(),a=Object;return Ma=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},Ma}var Fa,Yc;function Fn(){if(Yc)return Fa;Yc=1;var t=String;return Fa=function(e){try{return t(e)}catch{return"Object"}},Fa}var Ka,Xc;function ct(){if(Xc)return Ka;Xc=1;var t=Pe(),e=Fn(),r=TypeError;return Ka=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Ka}var Ha,Qc;function Os(){if(Qc)return Ha;Qc=1;var t=ct(),e=Nn();return Ha=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ha}var za,eu;function Tp(){if(eu)return za;eu=1;var t=He(),e=Pe(),r=nt(),n=TypeError;return za=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")},za}var Ba,tu;function kp(){if(tu)return Ba;tu=1;var t=He(),e=nt(),r=Rh(),n=Os(),a=Tp(),i=xe(),o=TypeError,s=i("toPrimitive");return Ba=function(c,l){if(!e(c)||r(c))return c;var u=n(c,s),f;if(u){if(l===void 0&&(l="default"),f=t(u,c,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(c,l)},Ba}var Ga,ru;function Oh(){if(ru)return Ga;ru=1;var t=kp(),e=Rh();return Ga=function(r){var n=t(r,"string");return e(n)?n:n+""},Ga}var nu;function Tt(){if(nu)return qa;nu=1;var t=De(),e=kh(),r=Th(),n=st(),a=Oh(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c="enumerable",l="configurable",u="writable";return qa.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&u in v&&!v[u]){var g=s(h,d);g&&g[u]&&(h[d]=v.value,v={configurable:l in v?v[l]:g[l],enumerable:c in v?v[c]:g[c],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},qa}var Wa,au;function Rp(){if(au)return Wa;au=1;var t=Math.ceil,e=Math.floor;return Wa=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Wa}var Va,iu;function Cs(){if(iu)return Va;iu=1;var t=Rp();return Va=function(e){var r=+e;return r!==r||r===0?0:t(r)},Va}var Ja,ou;function Ch(){if(ou)return Ja;ou=1;var t=Cs(),e=Math.max,r=Math.min;return Ja=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ja}var Za,su;function Op(){if(su)return Za;su=1;var t=Cs(),e=Math.min;return Za=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Za}var Ya,cu;function As(){if(cu)return Ya;cu=1;var t=Op();return Ya=function(e){return t(e.length)},Ya}var Xa,uu;function Cp(){if(uu)return Xa;uu=1;var t=Xr(),e=Ch(),r=As(),n=function(a){return function(i,o,s){var c=t(i),l=r(c);if(l===0)return!a&&-1;var u=e(s,l),f;if(a&&o!==o){for(;l>u;)if(f=c[u++],f!==f)return!0}else for(;l>u;u++)if((a||u in c)&&c[u]===o)return a||u||0;return!a&&-1}};return Xa={includes:n(!0),indexOf:n(!1)},Xa}var Qa,lu;function js(){return lu||(lu=1,Qa={}),Qa}var ei,fu;function Ah(){if(fu)return ei;fu=1;var t=be(),e=rt(),r=Xr(),n=Cp().indexOf,a=js(),i=t([].push);return ei=function(o,s){var c=r(o),l=0,u=[],f;for(f in c)!e(a,f)&&e(c,f)&&i(u,f);for(;s.length>l;)e(c,f=s[l++])&&(~n(u,f)||i(u,f));return u},ei}var ti,du;function Us(){return du||(du=1,ti=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),ti}var ri,hu;function jh(){if(hu)return ri;hu=1;var t=Ah(),e=Us();return ri=Object.keys||function(n){return t(n,e)},ri}var vu;function Ap(){if(vu)return Aa;vu=1;var t=De(),e=Th(),r=Tt(),n=st(),a=Xr(),i=jh();return Aa.f=t&&!e?Object.defineProperties:function(s,c){n(s);for(var l=a(c),u=i(c),f=u.length,h=0,d;f>h;)r.f(s,d=u[h++],l[d]);return s},Aa}var ni,pu;function Uh(){if(pu)return ni;pu=1;var t=at();return ni=t("document","documentElement"),ni}var ai,mu;function qs(){if(mu)return ai;mu=1;var t=Sh(),e=Ih(),r=t("keys");return ai=function(n){return r[n]||(r[n]=e(n))},ai}var ii,gu;function en(){if(gu)return ii;gu=1;var t=st(),e=Ap(),r=Us(),n=js(),a=Uh(),i=Dn(),o=qs(),s=">",c="<",l="prototype",u="script",f=o("IE_PROTO"),h=function(){},d=function(b){return c+u+s+b+c+"/"+u+s},v=function(b){b.write(d("")),b.close();var p=b.parentWindow.Object;return b=null,p},g=function(){var b=i("iframe"),p="java"+u+":",m;return b.style.display="none",a.appendChild(b),b.src=String(p),m=b.contentWindow.document,m.open(),m.write(d("document.F=Object")),m.close(),m.F},y,S=function(){try{y=new ActiveXObject("htmlfile")}catch{}S=typeof document<"u"?document.domain&&y?v(y):g():v(y);for(var b=r.length;b--;)delete S[l][r[b]];return S()};return n[f]=!0,ii=Object.create||function(p,m){var w;return p!==null?(h[l]=t(p),w=new h,h[l]=null,w[f]=p):w=S(),m===void 0?w:e.f(w,m)},ii}var oi,yu;function jp(){if(yu)return oi;yu=1;var t=xe(),e=en(),r=Tt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),oi=function(i){a[n][i]=!0},oi}var si,wu;function tn(){return wu||(wu=1,si={}),si}var ci,bu;function Up(){if(bu)return ci;bu=1;var t=Se(),e=Pe(),r=t.WeakMap;return ci=e(r)&&/native code/.test(String(r)),ci}var ui,Su;function er(){return Su||(Su=1,ui=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),ui}var li,Iu;function tr(){if(Iu)return li;Iu=1;var t=De(),e=Tt(),r=er();return li=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},li}var fi,Pu;function _r(){if(Pu)return fi;Pu=1;var t=Up(),e=Se(),r=nt(),n=tr(),a=rt(),i=Rs(),o=qs(),s=js(),c="Object already initialized",l=e.TypeError,u=e.WeakMap,f,h,d,v=function(b){return d(b)?h(b):f(b,{})},g=function(b){return function(p){var m;if(!r(p)||(m=h(p)).type!==b)throw new l("Incompatible receiver, "+b+" required");return m}};if(t||i.state){var y=i.state||(i.state=new u);y.get=y.get,y.has=y.has,y.set=y.set,f=function(b,p){if(y.has(b))throw new l(c);return p.facade=b,y.set(b,p),p},h=function(b){return y.get(b)||{}},d=function(b){return y.has(b)}}else{var S=o("state");s[S]=!0,f=function(b,p){if(a(b,S))throw new l(c);return p.facade=b,n(b,S,p),p},h=function(b){return a(b,S)?b[S]:{}},d=function(b){return a(b,S)}}return fi={set:f,get:h,has:d,enforce:v,getterFor:g},fi}var di={},hi={},Eu;function qh(){if(Eu)return hi;Eu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return hi.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,hi}var _u;function Lh(){if(_u)return di;_u=1;var t=De(),e=He(),r=qh(),n=er(),a=Xr(),i=Oh(),o=rt(),s=kh(),c=Object.getOwnPropertyDescriptor;return di.f=t?c:function(u,f){if(u=a(u),f=i(f),s)try{return c(u,f)}catch{}if(o(u,f))return n(!e(r.f,u,f),u[f])},di}var vi={exports:{}},pi,Tu;function Nh(){if(Tu)return pi;Tu=1;var t=De(),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 pi={EXISTS:a,PROPER:i,CONFIGURABLE:o},pi}var mi,ku;function Ls(){if(ku)return mi;ku=1;var t=be(),e=Pe(),r=Rs(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),mi=r.inspectSource,mi}var Ru;function $h(){if(Ru)return vi.exports;Ru=1;var t=be(),e=$e(),r=Pe(),n=rt(),a=De(),i=Nh().CONFIGURABLE,o=Ls(),s=_r(),c=s.enforce,l=s.get,u=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),g=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),y=String(String).split("String"),S=vi.exports=function(b,p,m){h(u(p),0,7)==="Symbol("&&(p="["+d(u(p),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),m&&m.getter&&(p="get "+p),m&&m.setter&&(p="set "+p),(!n(b,"name")||i&&b.name!==p)&&(a?f(b,"name",{value:p,configurable:!0}):b.name=p),g&&m&&n(m,"arity")&&b.length!==m.arity&&f(b,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(b,"prototype",{writable:!1}):b.prototype&&(b.prototype=void 0)}catch{}var w=c(b);return n(w,"source")||(w.source=v(y,typeof p=="string"?p:"")),b};return Function.prototype.toString=S(function(){return r(this)&&l(this).source||o(this)},"toString"),vi.exports}var gi,Ou;function it(){if(Ou)return gi;Ou=1;var t=Pe(),e=Tt(),r=$h(),n=ks();return gi=function(a,i,o,s){s||(s={});var c=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)c?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(c=!0):delete a[i]}catch{}c?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},gi}var yi={},Cu;function qp(){if(Cu)return yi;Cu=1;var t=Ah(),e=Us(),r=e.concat("length","prototype");return yi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},yi}var wi={},Au;function xh(){return Au||(Au=1,wi.f=Object.getOwnPropertySymbols),wi}var bi,ju;function Lp(){if(ju)return bi;ju=1;var t=at(),e=be(),r=qp(),n=xh(),a=st(),i=e([].concat);return bi=t("Reflect","ownKeys")||function(s){var c=r.f(a(s)),l=n.f;return l?i(c,l(s)):c},bi}var Si,Uu;function Dh(){if(Uu)return Si;Uu=1;var t=rt(),e=Lp(),r=Lh(),n=Tt();return Si=function(a,i,o){for(var s=e(i),c=n.f,l=r.f,u=0;u<s.length;u++){var f=s[u];!t(a,f)&&!(o&&t(o,f))&&c(a,f,l(i,f))}},Si}var Ii,qu;function Mh(){if(qu)return Ii;qu=1;var t=$e(),e=Pe(),r=/#|\.prototype\./,n=function(c,l){var u=i[a(c)];return u===s?!0:u===o?!1:e(l)?t(l):!!l},a=n.normalize=function(c){return String(c).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return Ii=n,Ii}var Pi,Lu;function ke(){if(Lu)return Pi;Lu=1;var t=Se(),e=Lh().f,r=tr(),n=it(),a=ks(),i=Dh(),o=Mh();return Pi=function(s,c){var l=s.target,u=s.global,f=s.stat,h,d,v,g,y,S;if(u?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in c){if(y=c[v],s.dontCallGetSet?(S=e(d,v),g=S&&S.value):g=d[v],h=o(u?v:l+(f?".":"#")+v,s.forced),!h&&g!==void 0){if(typeof y==typeof g)continue;i(y,g)}(s.sham||g&&g.sham)&&r(y,"sham",!0),n(d,v,y,s)}},Pi}var Ei,Nu;function Np(){if(Nu)return Ei;Nu=1;var t=$e();return Ei=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Ei}var _i,$u;function Ns(){if($u)return _i;$u=1;var t=rt(),e=Pe(),r=xn(),n=qs(),a=Np(),i=n("IE_PROTO"),o=Object,s=o.prototype;return _i=a?o.getPrototypeOf:function(c){var l=r(c);if(t(l,i))return l[i];var u=l.constructor;return e(u)&&l instanceof u?u.prototype:l instanceof o?s:null},_i}var Ti,xu;function Fh(){if(xu)return Ti;xu=1;var t=$e(),e=Pe(),r=nt(),n=en(),a=Ns(),i=it(),o=xe(),s=mt(),c=o("iterator"),l=!1,u,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(u=f)):l=!0);var d=!r(u)||t(function(){var v={};return u[c].call(v)!==v});return d?u={}:s&&(u=n(u)),e(u[c])||i(u,c,function(){return this}),Ti={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},Ti}var ki,Du;function Tr(){if(Du)return ki;Du=1;var t=Tt().f,e=rt(),r=xe(),n=r("toStringTag");return ki=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},ki}var Ri,Mu;function Kh(){if(Mu)return Ri;Mu=1;var t=Fh().IteratorPrototype,e=en(),r=er(),n=Tr(),a=tn(),i=function(){return this};return Ri=function(o,s,c,l){var u=s+" Iterator";return o.prototype=e(t,{next:r(+!l,c)}),n(o,u,!1,!0),a[u]=i,o},Ri}var Oi,Fu;function $p(){if(Fu)return Oi;Fu=1;var t=be(),e=ct();return Oi=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},Oi}var Ci,Ku;function xp(){if(Ku)return Ci;Ku=1;var t=nt();return Ci=function(e){return t(e)||e===null},Ci}var Ai,Hu;function Dp(){if(Hu)return Ai;Hu=1;var t=xp(),e=String,r=TypeError;return Ai=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ai}var ji,zu;function $s(){if(zu)return ji;zu=1;var t=$p(),e=nt(),r=$n(),n=Dp();return ji=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(c,l){return r(c),n(l),e(c)&&(a?o(c,l):c.__proto__=l),c}})():void 0),ji}var Ui,Bu;function Hh(){if(Bu)return Ui;Bu=1;var t=ke(),e=He(),r=mt(),n=Nh(),a=Pe(),i=Kh(),o=Ns(),s=$s(),c=Tr(),l=tr(),u=it(),f=xe(),h=tn(),d=Fh(),v=n.PROPER,g=n.CONFIGURABLE,y=d.IteratorPrototype,S=d.BUGGY_SAFARI_ITERATORS,b=f("iterator"),p="keys",m="values",w="entries",R=function(){return this};return Ui=function(j,A,H,B,ie,L,D){i(H,A,B);var N=function(V){if(V===ie&&I)return I;if(!S&&V&&V in te)return te[V];switch(V){case p:return function(){return new H(this,V)};case m:return function(){return new H(this,V)};case w:return function(){return new H(this,V)}}return function(){return new H(this)}},O=A+" Iterator",Y=!1,te=j.prototype,Q=te[b]||te["@@iterator"]||ie&&te[ie],I=!S&&Q||N(ie),T=A==="Array"&&te.entries||Q,$,F,Z;if(T&&($=o(T.call(new j)),$!==Object.prototype&&$.next&&(!r&&o($)!==y&&(s?s($,y):a($[b])||u($,b,R)),c($,O,!0,!0),r&&(h[O]=R))),v&&ie===m&&Q&&Q.name!==m&&(!r&&g?l(te,"name",m):(Y=!0,I=function(){return e(Q,this)})),ie)if(F={values:N(m),keys:L?I:N(p),entries:N(w)},D)for(Z in F)(S||Y||!(Z in te))&&u(te,Z,F[Z]);else t({target:A,proto:!0,forced:S||Y},F);return(!r||D)&&te[b]!==I&&u(te,b,I,{name:ie}),h[A]=I,F},Ui}var qi,Gu;function xs(){return Gu||(Gu=1,qi=function(t,e){return{value:t,done:e}}),qi}var Li,Wu;function Ds(){if(Wu)return Li;Wu=1;var t=Xr(),e=jp(),r=tn(),n=_r(),a=Tt().f,i=Hh(),o=xs(),s=mt(),c=De(),l="Array Iterator",u=n.set,f=n.getterFor(l);Li=i(Array,"Array",function(d,v){u(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,g=d.index++;if(!v||g>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(g,!1);case"values":return o(v[g],!1)}return o([g,v[g]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&c&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Li}var Vu={},Ju;function Mp(){if(Ju)return Vu;Ju=1;var t=ke(),e=be(),r=Ch(),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 u=[],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");u[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(u,"")}}),Vu}var Ni,Zu;function zh(){if(Zu)return Ni;Zu=1;var t=Se(),e=De(),r=Object.getOwnPropertyDescriptor;return Ni=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},Ni}var $i,Yu;function Kn(){if(Yu)return $i;Yu=1;var t=$e(),e=xe(),r=De(),n=mt(),a=e("iterator");return $i=!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"),c="";return i.pathname="c%20d",o.forEach(function(l,u){o.delete("b"),c+=u+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"||c!=="a1c3"||new URL("https://x",void 0).host!=="x"}),$i}var xi,Xu;function Hn(){if(Xu)return xi;Xu=1;var t=$h(),e=Tt();return xi=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)},xi}var Di,Qu;function Fp(){if(Qu)return Di;Qu=1;var t=it();return Di=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},Di}var Mi,el;function Ms(){if(el)return Mi;el=1;var t=Mn(),e=TypeError;return Mi=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Mi}var Fi,tl;function Kp(){if(tl)return Fi;tl=1;var t=Ln(),e=be();return Fi=function(r){if(t(r)==="Function")return e(r)},Fi}var Ki,rl;function kr(){if(rl)return Ki;rl=1;var t=Kp(),e=ct(),r=qn(),n=t(t.bind);return Ki=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Ki}var Hi,nl;function Fs(){if(nl)return Hi;nl=1;var t=xe(),e=t("toStringTag"),r={};return r[e]="z",Hi=String(r)==="[object z]",Hi}var zi,al;function rn(){if(al)return zi;al=1;var t=Fs(),e=Pe(),r=Ln(),n=xe(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(c,l){try{return c[l]}catch{}};return zi=t?r:function(c){var l,u,f;return c===void 0?"Undefined":c===null?"Null":typeof(u=s(l=i(c),a))=="string"?u:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},zi}var Bi,il;function kt(){if(il)return Bi;il=1;var t=rn(),e=String;return Bi=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Bi}var Gi,ol;function zn(){if(ol)return Gi;ol=1;var t=rn(),e=Os(),r=Nn(),n=tn(),a=xe(),i=a("iterator");return Gi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Gi}var Wi,sl;function Ks(){if(sl)return Wi;sl=1;var t=He(),e=ct(),r=st(),n=Fn(),a=zn(),i=TypeError;return Wi=function(o,s){var c=arguments.length<2?a(o):s;if(e(c))return r(t(c,o));throw new i(n(o)+" is not iterable")},Wi}var Vi,cl;function rr(){if(cl)return Vi;cl=1;var t=TypeError;return Vi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Vi}var Ji,ul;function Bn(){if(ul)return Ji;ul=1;var t=be();return Ji=t([].slice),Ji}var Zi,ll;function Hp(){if(ll)return Zi;ll=1;var t=Bn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,c;o<i;){for(c=o,s=n[o];c&&a(n[c-1],s)>0;)n[c]=n[--c];c!==o++&&(n[c]=s)}else for(var l=e(i/2),u=r(t(n,0,l),a),f=r(t(n,l),a),h=u.length,d=f.length,v=0,g=0;v<h||g<d;)n[v+g]=v<h&&g<d?a(u[v],f[g])<=0?u[v++]:f[g++]:v<h?u[v++]:f[g++];return n};return Zi=r,Zi}var Yi,fl;function Bh(){if(fl)return Yi;fl=1,Ds(),Mp();var t=ke(),e=Se(),r=zh(),n=at(),a=He(),i=be(),o=De(),s=Kn(),c=it(),l=Hn(),u=Fp(),f=Tr(),h=Kh(),d=_r(),v=Ms(),g=Pe(),y=rt(),S=kr(),b=rn(),p=st(),m=nt(),w=kt(),R=en(),j=er(),A=Ks(),H=zn(),B=xs(),ie=rr(),L=xe(),D=Hp(),N=L("iterator"),O="URLSearchParams",Y=O+"Iterator",te=d.set,Q=d.getterFor(O),I=d.getterFor(Y),T=r("fetch"),$=r("Request"),F=r("Headers"),Z=$&&$.prototype,V=F&&F.prototype,he=e.TypeError,oe=e.encodeURIComponent,le=String.fromCharCode,se=n("String","fromCodePoint"),_e=parseInt,Ae=i("".charAt),Me=i([].join),Re=i([].push),Je=i("".replace),ut=i([].shift),lt=i([].splice),gt=i("".split),yt=i("".slice),k=i(/./.exec),K=/\+/g,J="�",re=/^[0-9a-f]+$/i,me=function(x,G){var W=yt(x,G,G+2);return k(re,W)?_e(W,16):NaN},Fe=function(x){for(var G=0,W=128;W>0&&(x&W)!==0;W>>=1)G++;return G},M=function(x){var G=null;switch(x.length){case 1:G=x[0];break;case 2:G=(x[0]&31)<<6|x[1]&63;break;case 3:G=(x[0]&15)<<12|(x[1]&63)<<6|x[2]&63;break;case 4:G=(x[0]&7)<<18|(x[1]&63)<<12|(x[2]&63)<<6|x[3]&63;break}return G>1114111?null:G},ee=function(x){x=Je(x,K," ");for(var G=x.length,W="",X=0;X<G;){var ue=Ae(x,X);if(ue==="%"){if(Ae(x,X+1)==="%"||X+3>G){W+="%",X++;continue}var de=me(x,X+1);if(de!==de){W+=ue,X++;continue}X+=2;var ye=Fe(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||Ae(x,X)!=="%"));){var Ke=me(x,X+1);if(Ke!==Ke){X+=3;break}if(Ke>191||Ke<128)break;Re(we,Ke),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(x){return ve[x]},Ze=function(x){return Je(oe(x),fe,ge)},je=h(function(G,W){te(this,{type:Y,target:Q(G).entries,index:0,kind:W})},O,function(){var G=I(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),Be=function(x){this.entries=[],this.url=null,x!==void 0&&(m(x)?this.parseObject(x):this.parseQuery(typeof x=="string"?Ae(x,0)==="?"?yt(x,1):x:w(x)))};Be.prototype={type:O,bindURL:function(x){this.url=x,this.update()},parseObject:function(x){var G=this.entries,W=H(x),X,ue,de,ye,we,Ee,Ke;if(W)for(X=A(x,W),ue=X.next;!(de=a(ue,X)).done;){if(ye=A(p(de.value)),we=ye.next,(Ee=a(we,ye)).done||(Ke=a(we,ye)).done||!a(we,ye).done)throw new he("Expected sequence with length 2");Re(G,{key:w(Ee.value),value:w(Ke.value)})}else for(var ft in x)y(x,ft)&&Re(G,{key:ft,value:w(x[ft])})},parseQuery:function(x){if(x)for(var G=this.entries,W=gt(x,"&"),X=0,ue,de;X<W.length;)ue=W[X++],ue.length&&(de=gt(ue,"="),Re(G,{key:ee(ut(de)),value:ee(Me(de,"="))}))},serialize:function(){for(var x=this.entries,G=[],W=0,X;W<x.length;)X=x[W++],Re(G,Ze(X.key)+"="+Ze(X.value));return Me(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ue=function(){v(this,Xe);var G=arguments.length>0?arguments[0]:void 0,W=te(this,new Be(G));o||(this.size=W.entries.length)},Xe=Ue.prototype;if(u(Xe,{append:function(G,W){var X=Q(this);ie(arguments.length,2),Re(X.entries,{key:w(G),value:w(W)}),o||this.length++,X.updateURL()},delete:function(x){for(var G=Q(this),W=ie(arguments.length,1),X=G.entries,ue=w(x),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&&Re(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,Ke;Ee<ue.length;Ee++)Ke=ue[Ee],Ke.key===ye&&(de?lt(ue,Ee--,1):(de=!0,Ke.value=we));de||Re(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=S(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}),c(Xe,N,Xe.entries,{name:"entries"}),c(Xe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Xe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Ue,O),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Ue}),!s&&g(F)){var nr=i(V.has),jr=i(V.set),ar=function(x){if(m(x)){var G=x.body,W;if(b(G)===O)return W=x.headers?new F(x.headers):new F,nr(W,"content-type")||jr(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(x,{body:j(0,w(G)),headers:j(0,W)})}return x};if(g(T)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return T(G,arguments.length>1?ar(arguments[1]):{})}}),g($)){var ir=function(G){return v(this,Z),new $(G,arguments.length>1?ar(arguments[1]):{})};Z.constructor=ir,ir.prototype=Z,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ir})}}return Yi={URLSearchParams:Ue,getState:Q},Yi}var dl;function zp(){return dl||(dl=1,Bh()),yc}var hl={},vl;function Bp(){if(vl)return hl;vl=1;var t=it(),e=be(),r=kt(),n=rr(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),c=e(i.forEach),l=e([].push),u=new a("a=1&a=2&b=3");return u.delete("a",1),u.delete("b",void 0),u+""!="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=[];c(this,function(R,j){l(v,{key:j,value:R})}),n(h,1);for(var g=r(f),y=r(d),S=0,b=0,p=!1,m=v.length,w;S<m;)w=v[S++],p||w.key===g?(p=!0,s(this,w.key)):b++;for(;b<m;)w=v[b++],w.key===g&&w.value===y||o(this,w.key,w.value)},{enumerable:!0,unsafe:!0}),hl}var pl={},ml;function Gp(){if(ml)return pl;ml=1;var t=it(),e=be(),r=kt(),n=rr(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),c=new a("a=1");return(c.has("a",2)||!c.has("a",void 0))&&t(i,"has",function(u){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,u);var d=o(this,u);n(f,1);for(var v=r(h),g=0;g<d.length;)if(d[g++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),pl}var gl={},yl;function Wp(){if(yl)return gl;yl=1;var t=De(),e=be(),r=Hn(),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}),gl}var Xi,wl;function Gn(){if(wl)return Xi;wl=1;var t=Se();return Xi=t,Xi}var Qi,bl;function Gh(){if(bl)return Qi;bl=1,zp(),Bp(),Gp(),Wp();var t=Gn();return Qi=t.URLSearchParams,Qi}var Sl={},Il={},Pl={},eo,El;function Wh(){if(El)return eo;El=1;var t=be(),e=Cs(),r=kt(),n=$n(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(c){return function(l,u){var f=r(n(l)),h=e(u),d=f.length,v,g;return h<0||h>=d?c?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(g=i(f,h+1))<56320||g>57343?c?a(f,h):v:c?o(f,h,h+2):(v-55296<<10)+(g-56320)+65536)}};return eo={codeAt:s(!1),charAt:s(!0)},eo}var _l;function Vh(){if(_l)return Pl;_l=1;var t=Wh().charAt,e=kt(),r=_r(),n=Hh(),a=xs(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(c){o(this,{type:i,string:e(c),index:0})},function(){var l=s(this),u=l.string,f=l.index,h;return f>=u.length?a(void 0,!0):(h=t(u,f),l.index+=h.length,a(h,!1))}),Pl}var to,Tl;function Vp(){if(Tl)return to;Tl=1;var t=De(),e=be(),r=He(),n=$e(),a=jh(),i=xh(),o=qh(),s=xn(),c=bh(),l=Object.assign,u=Object.defineProperty,f=e([].concat);return to=!l||n(function(){if(t&&l({b:1},l(u({},"a",{enumerable:!0,get:function(){u(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},v=Symbol("assign detection"),g="abcdefghijklmnopqrst";return h[v]=7,g.split("").forEach(function(y){d[y]=y}),l({},h)[v]!==7||a(l({},d)).join("")!==g})?function(d,v){for(var g=s(d),y=arguments.length,S=1,b=i.f,p=o.f;y>S;)for(var m=c(arguments[S++]),w=b?f(a(m),b(m)):a(m),R=w.length,j=0,A;R>j;)A=w[j++],(!t||r(p,m,A))&&(g[A]=m[A]);return g}:l,to}var ro,kl;function Jh(){if(kl)return ro;kl=1;var t=He(),e=st(),r=Os();return ro=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(c){s=!0,o=c}if(a==="throw")throw i;if(s)throw o;return e(o),i},ro}var no,Rl;function Jp(){if(Rl)return no;Rl=1;var t=st(),e=Jh();return no=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},no}var ao,Ol;function Zh(){if(Ol)return ao;Ol=1;var t=xe(),e=tn(),r=t("iterator"),n=Array.prototype;return ao=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},ao}var io,Cl;function Yh(){if(Cl)return io;Cl=1;var t=be(),e=$e(),r=Pe(),n=rn(),a=at(),i=Ls(),o=function(){},s=a("Reflect","construct"),c=/^\s*(?:class|function)\b/,l=t(c.exec),u=!c.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 u||!!l(c,i(v))}catch{return!0}};return h.sham=!0,io=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,io}var oo,Al;function Zp(){if(Al)return oo;Al=1;var t=De(),e=Tt(),r=er();return oo=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},oo}var so,jl;function Yp(){if(jl)return so;jl=1;var t=kr(),e=He(),r=xn(),n=Jp(),a=Zh(),i=Yh(),o=As(),s=Zp(),c=Ks(),l=zn(),u=Array;return so=function(h){var d=r(h),v=i(this),g=arguments.length,y=g>1?arguments[1]:void 0,S=y!==void 0;S&&(y=t(y,g>2?arguments[2]:void 0));var b=l(d),p=0,m,w,R,j,A,H;if(b&&!(this===u&&a(b)))for(w=v?new this:[],j=c(d,b),A=j.next;!(R=e(A,j)).done;p++)H=S?n(j,y,[R.value,p],!0):R.value,s(w,p,H);else for(m=o(d),w=v?new this(m):u(m);m>p;p++)H=S?y(d[p],p):d[p],s(w,p,H);return w.length=p,w},so}var co,Ul;function Xp(){if(Ul)return co;Ul=1;var t=be(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,c=128,l="-",u=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,g=t(f.exec),y=Math.floor,S=String.fromCharCode,b=t("".charCodeAt),p=t([].join),m=t([].push),w=t("".replace),R=t("".split),j=t("".toLowerCase),A=function(L){for(var D=[],N=0,O=L.length;N<O;){var Y=b(L,N++);if(Y>=55296&&Y<=56319&&N<O){var te=b(L,N++);(te&64512)===56320?m(D,((Y&1023)<<10)+(te&1023)+65536):(m(D,Y),N--)}else m(D,Y)}return D},H=function(L){return L+22+75*(L<26)},B=function(L,D,N){var O=0;for(L=N?y(L/o):L>>1,L+=y(L/D);L>d*a>>1;)L=y(L/d),O+=r;return y(O+(d+1)*L/(L+i))},ie=function(L){var D=[];L=A(L);var N=L.length,O=c,Y=0,te=s,Q,I;for(Q=0;Q<L.length;Q++)I=L[Q],I<128&&m(D,S(I));var T=D.length,$=T;for(T&&m(D,l);$<N;){var F=e;for(Q=0;Q<L.length;Q++)I=L[Q],I>=O&&I<F&&(F=I);var Z=$+1;if(F-O>y((e-Y)/Z))throw new v(h);for(Y+=(F-O)*Z,O=F,Q=0;Q<L.length;Q++){if(I=L[Q],I<O&&++Y>e)throw new v(h);if(I===O){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;m(D,S(H(oe+le%se))),V=y(le/se),he+=r}m(D,S(H(V))),te=B(Y,Z,$===T),Y=0,$++}}Y++,O++}return p(D,"")};return co=function(L){var D=[],N=R(w(j(L),f,"."),"."),O,Y;for(O=0;O<N.length;O++)Y=N[O],m(D,g(u,Y)?"xn--"+ie(Y):Y);return p(D,".")},co}var ql;function Qp(){if(ql)return Il;ql=1,Vh();var t=ke(),e=De(),r=Kn(),n=Se(),a=kr(),i=be(),o=it(),s=Hn(),c=Ms(),l=rt(),u=Vp(),f=Yp(),h=Bn(),d=Wh().codeAt,v=Xp(),g=kt(),y=Tr(),S=rr(),b=Bh(),p=_r(),m=p.set,w=p.getterFor("URL"),R=b.URLSearchParams,j=b.getState,A=n.URL,H=n.TypeError,B=n.parseInt,ie=Math.floor,L=Math.pow,D=i("".charAt),N=i(/./.exec),O=i([].join),Y=i(1.1.toString),te=i([].pop),Q=i([].push),I=i("".replace),T=i([].shift),$=i("".split),F=i("".slice),Z=i("".toLowerCase),V=i([].unshift),he="Invalid authority",oe="Invalid scheme",le="Invalid host",se="Invalid port",_e=/[a-z]/i,Ae=/[\d+-.a-z]/i,Me=/\d/,Re=/^0x/i,Je=/^[0-7]+$/,ut=/^\d+$/,lt=/^[\da-f]+$/i,gt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yt=/[\0\t\n\r #/:<>?@[\\\]^|]/,k=/^[\u0000-\u0020]+/,K=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,J=/[\t\n\r]/g,re,me=function(E){var q=$(E,"."),_,P,C,ce,z,Ie,Te;if(q.length&&q[q.length-1]===""&&q.length--,_=q.length,_>4)return E;for(P=[],C=0;C<_;C++){if(ce=q[C],ce==="")return E;if(z=10,ce.length>1&&D(ce,0)==="0"&&(z=N(Re,ce)?16:8,ce=F(ce,z===8?1:2)),ce==="")Ie=0;else{if(!N(z===10?ut:z===8?Je:lt,ce))return E;Ie=B(ce,z)}Q(P,Ie)}for(C=0;C<_;C++)if(Ie=P[C],C===_-1){if(Ie>=L(256,5-_))return null}else if(Ie>255)return null;for(Te=te(P),C=0;C<P.length;C++)Te+=P[C]*L(256,3-C);return Te},Fe=function(E){var q=[0,0,0,0,0,0,0,0],_=0,P=null,C=0,ce,z,Ie,Te,qe,et,U,Oe=function(){return D(E,C)};if(Oe()===":"){if(D(E,1)!==":")return;C+=2,_++,P=_}for(;Oe();){if(_===8)return;if(Oe()===":"){if(P!==null)return;C++,_++,P=_;continue}for(ce=z=0;z<4&&N(lt,Oe());)ce=ce*16+B(Oe(),16),C++,z++;if(Oe()==="."){if(z===0||(C-=z,_>6))return;for(Ie=0;Oe();){if(Te=null,Ie>0)if(Oe()==="."&&Ie<4)C++;else return;if(!N(Me,Oe()))return;for(;N(Me,Oe());){if(qe=B(Oe(),10),Te===null)Te=qe;else{if(Te===0)return;Te=Te*10+qe}if(Te>255)return;C++}q[_]=q[_]*256+Te,Ie++,(Ie===2||Ie===4)&&_++}if(Ie!==4)return;break}else if(Oe()===":"){if(C++,!Oe())return}else if(Oe())return;q[_++]=ce}if(P!==null)for(et=_-P,_=7;_!==0&&et>0;)U=q[_],q[_--]=q[P+et-1],q[P+--et]=U;else if(_!==8)return;return q},M=function(E){for(var q=null,_=1,P=null,C=0,ce=0;ce<8;ce++)E[ce]!==0?(C>_&&(q=P,_=C),P=null,C=0):(P===null&&(P=ce),++C);return C>_?P:q},ee=function(E){var q,_,P,C;if(typeof E=="number"){for(q=[],_=0;_<4;_++)V(q,E%256),E=ie(E/256);return O(q,".")}if(typeof E=="object"){for(q="",P=M(E),_=0;_<8;_++)C&&E[_]===0||(C&&(C=!1),P===_?(q+=_?":":"::",C=!0):(q+=Y(E[_],16),_<7&&(q+=":")));return"["+q+"]"}return E},fe={},ve=u({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),ge=u({},ve,{"#":1,"?":1,"{":1,"}":1}),Ze=u({},ge,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),je=function(E,q){var _=d(E,0);return _>32&&_<127&&!l(q,E)?E:encodeURIComponent(E)},Be={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ue=function(E,q){var _;return E.length===2&&N(_e,D(E,0))&&((_=D(E,1))===":"||!q&&_==="|")},Xe=function(E){var q;return E.length>1&&Ue(F(E,0,2))&&(E.length===2||(q=D(E,2))==="/"||q==="\\"||q==="?"||q==="#")},nr=function(E){return E==="."||Z(E)==="%2e"},jr=function(E){return E=Z(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},ar={},ir={},x={},G={},W={},X={},ue={},de={},ye={},we={},Ee={},Ke={},ft={},na={},fc={},aa={},or={},dt={},dc={},Lt={},wt={},ia=function(E,q,_){var P=g(E),C,ce,z;if(q){if(ce=this.parse(P),ce)throw new H(ce);this.searchParams=null}else{if(_!==void 0&&(C=new ia(_,!0)),ce=this.parse(P,null,C),ce)throw new H(ce);z=j(new R),z.bindURL(this),this.searchParams=z}};ia.prototype={type:"URL",parse:function(E,q,_){var P=this,C=q||ar,ce=0,z="",Ie=!1,Te=!1,qe=!1,et,U,Oe,bt;for(E=g(E),q||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=I(E,k,""),E=I(E,K,"$1")),E=I(E,J,""),et=f(E);ce<=et.length;){switch(U=et[ce],C){case ar:if(U&&N(_e,U))z+=Z(U),C=ir;else{if(q)return oe;C=x;continue}break;case ir:if(U&&(N(Ae,U)||U==="+"||U==="-"||U==="."))z+=Z(U);else if(U===":"){if(q&&(P.isSpecial()!==l(Be,z)||z==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=z,q){P.isSpecial()&&Be[P.scheme]===P.port&&(P.port=null);return}z="",P.scheme==="file"?C=na:P.isSpecial()&&_&&_.scheme===P.scheme?C=G:P.isSpecial()?C=de:et[ce+1]==="/"?(C=W,ce++):(P.cannotBeABaseURL=!0,Q(P.path,""),C=dc)}else{if(q)return oe;z="",C=x,ce=0;continue}break;case x:if(!_||_.cannotBeABaseURL&&U!=="#")return oe;if(_.cannotBeABaseURL&&U==="#"){P.scheme=_.scheme,P.path=h(_.path),P.query=_.query,P.fragment="",P.cannotBeABaseURL=!0,C=wt;break}C=_.scheme==="file"?na:X;continue;case G:if(U==="/"&&et[ce+1]==="/")C=ye,ce++;else{C=X;continue}break;case W:if(U==="/"){C=we;break}else{C=dt;continue}case X:if(P.scheme=_.scheme,U===re)P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query=_.query;else if(U==="/"||U==="\\"&&P.isSpecial())C=ue;else if(U==="?")P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query="",C=Lt;else if(U==="#")P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query=_.query,P.fragment="",C=wt;else{P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.path.length--,C=dt;continue}break;case ue:if(P.isSpecial()&&(U==="/"||U==="\\"))C=ye;else if(U==="/")C=we;else{P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,C=dt;continue}break;case de:if(C=ye,U!=="/"||D(z,ce+1)!=="/")continue;ce++;break;case ye:if(U!=="/"&&U!=="\\"){C=we;continue}break;case we:if(U==="@"){Ie&&(z="%40"+z),Ie=!0,Oe=f(z);for(var oa=0;oa<Oe.length;oa++){var pc=Oe[oa];if(pc===":"&&!qe){qe=!0;continue}var mc=je(pc,Ze);qe?P.password+=mc:P.username+=mc}z=""}else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(Ie&&z==="")return he;ce-=f(z).length+1,z="",C=Ee}else z+=U;break;case Ee:case Ke:if(q&&P.scheme==="file"){C=aa;continue}else if(U===":"&&!Te){if(z==="")return le;if(bt=P.parseHost(z),bt)return bt;if(z="",C=ft,q===Ke)return}else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()){if(P.isSpecial()&&z==="")return le;if(q&&z===""&&(P.includesCredentials()||P.port!==null))return;if(bt=P.parseHost(z),bt)return bt;if(z="",C=or,q)return;continue}else U==="["?Te=!0:U==="]"&&(Te=!1),z+=U;break;case ft:if(N(Me,U))z+=U;else if(U===re||U==="/"||U==="?"||U==="#"||U==="\\"&&P.isSpecial()||q){if(z!==""){var sa=B(z,10);if(sa>65535)return se;P.port=P.isSpecial()&&sa===Be[P.scheme]?null:sa,z=""}if(q)return;C=or;continue}else return se;break;case na:if(P.scheme="file",U==="/"||U==="\\")C=fc;else if(_&&_.scheme==="file")switch(U){case re:P.host=_.host,P.path=h(_.path),P.query=_.query;break;case"?":P.host=_.host,P.path=h(_.path),P.query="",C=Lt;break;case"#":P.host=_.host,P.path=h(_.path),P.query=_.query,P.fragment="",C=wt;break;default:Xe(O(h(et,ce),""))||(P.host=_.host,P.path=h(_.path),P.shortenPath()),C=dt;continue}else{C=dt;continue}break;case fc:if(U==="/"||U==="\\"){C=aa;break}_&&_.scheme==="file"&&!Xe(O(h(et,ce),""))&&(Ue(_.path[0],!0)?Q(P.path,_.path[0]):P.host=_.host),C=dt;continue;case aa:if(U===re||U==="/"||U==="\\"||U==="?"||U==="#"){if(!q&&Ue(z))C=dt;else if(z===""){if(P.host="",q)return;C=or}else{if(bt=P.parseHost(z),bt)return bt;if(P.host==="localhost"&&(P.host=""),q)return;z="",C=or}continue}else z+=U;break;case or:if(P.isSpecial()){if(C=dt,U!=="/"&&U!=="\\")continue}else if(!q&&U==="?")P.query="",C=Lt;else if(!q&&U==="#")P.fragment="",C=wt;else if(U!==re&&(C=dt,U!=="/"))continue;break;case dt:if(U===re||U==="/"||U==="\\"&&P.isSpecial()||!q&&(U==="?"||U==="#")){if(jr(z)?(P.shortenPath(),U!=="/"&&!(U==="\\"&&P.isSpecial())&&Q(P.path,"")):nr(z)?U!=="/"&&!(U==="\\"&&P.isSpecial())&&Q(P.path,""):(P.scheme==="file"&&!P.path.length&&Ue(z)&&(P.host&&(P.host=""),z=D(z,0)+":"),Q(P.path,z)),z="",P.scheme==="file"&&(U===re||U==="?"||U==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);U==="?"?(P.query="",C=Lt):U==="#"&&(P.fragment="",C=wt)}else z+=je(U,ge);break;case dc:U==="?"?(P.query="",C=Lt):U==="#"?(P.fragment="",C=wt):U!==re&&(P.path[0]+=je(U,fe));break;case Lt:!q&&U==="#"?(P.fragment="",C=wt):U!==re&&(U==="'"&&P.isSpecial()?P.query+="%27":U==="#"?P.query+="%23":P.query+=je(U,fe));break;case wt:U!==re&&(P.fragment+=je(U,ve));break}ce++}},parseHost:function(E){var q,_,P;if(D(E,0)==="["){if(D(E,E.length-1)!=="]"||(q=Fe(F(E,1,-1)),!q))return le;this.host=q}else if(this.isSpecial()){if(E=v(E),N(gt,E)||(q=me(E),q===null))return le;this.host=q}else{if(N(yt,E))return le;for(q="",_=f(E),P=0;P<_.length;P++)q+=je(_[P],fe);this.host=q}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Be,this.scheme)},shortenPath:function(){var E=this.path,q=E.length;q&&(this.scheme!=="file"||q!==1||!Ue(E[0],!0))&&E.length--},serialize:function(){var E=this,q=E.scheme,_=E.username,P=E.password,C=E.host,ce=E.port,z=E.path,Ie=E.query,Te=E.fragment,qe=q+":";return C!==null?(qe+="//",E.includesCredentials()&&(qe+=_+(P?":"+P:"")+"@"),qe+=ee(C),ce!==null&&(qe+=":"+ce)):q==="file"&&(qe+="//"),qe+=E.cannotBeABaseURL?z[0]:z.length?"/"+O(z,"/"):"",Ie!==null&&(qe+="?"+Ie),Te!==null&&(qe+="#"+Te),qe},setHref:function(E){var q=this.parse(E);if(q)throw new H(q);this.searchParams.update()},getOrigin:function(){var E=this.scheme,q=this.port;if(E==="blob")try{return new sr(E.path[0]).origin}catch{return"null"}return E==="file"||!this.isSpecial()?"null":E+"://"+ee(this.host)+(q!==null?":"+q:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(E){this.parse(g(E)+":",ar)},getUsername:function(){return this.username},setUsername:function(E){var q=f(g(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var _=0;_<q.length;_++)this.username+=je(q[_],Ze)}},getPassword:function(){return this.password},setPassword:function(E){var q=f(g(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var _=0;_<q.length;_++)this.password+=je(q[_],Ze)}},getHost:function(){var E=this.host,q=this.port;return E===null?"":q===null?ee(E):ee(E)+":"+q},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,Ke)},getPort:function(){var E=this.port;return E===null?"":g(E)},setPort:function(E){this.cannotHaveUsernamePasswordPort()||(E=g(E),E===""?this.port=null:this.parse(E,ft))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+O(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,or))},getSearch:function(){var E=this.query;return E?"?"+E:""},setSearch:function(E){E=g(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=g(E),E===""){this.fragment=null;return}D(E,0)==="#"&&(E=F(E,1)),this.fragment="",this.parse(E,wt)},update:function(){this.query=this.searchParams.serialize()||null}};var sr=function(q){var _=c(this,ze),P=S(arguments.length,1)>1?arguments[1]:void 0,C=m(_,new ia(q,!1,P));e||(_.href=C.serialize(),_.origin=C.getOrigin(),_.protocol=C.getProtocol(),_.username=C.getUsername(),_.password=C.getPassword(),_.host=C.getHost(),_.hostname=C.getHostname(),_.port=C.getPort(),_.pathname=C.getPathname(),_.search=C.getSearch(),_.searchParams=C.getSearchParams(),_.hash=C.getHash())},ze=sr.prototype,Qe=function(E,q){return{get:function(){return w(this)[E]()},set:q&&function(_){return w(this)[q](_)},configurable:!0,enumerable:!0}};if(e&&(s(ze,"href",Qe("serialize","setHref")),s(ze,"origin",Qe("getOrigin")),s(ze,"protocol",Qe("getProtocol","setProtocol")),s(ze,"username",Qe("getUsername","setUsername")),s(ze,"password",Qe("getPassword","setPassword")),s(ze,"host",Qe("getHost","setHost")),s(ze,"hostname",Qe("getHostname","setHostname")),s(ze,"port",Qe("getPort","setPort")),s(ze,"pathname",Qe("getPathname","setPathname")),s(ze,"search",Qe("getSearch","setSearch")),s(ze,"searchParams",Qe("getSearchParams")),s(ze,"hash",Qe("getHash","setHash"))),o(ze,"toJSON",function(){return w(this).serialize()},{enumerable:!0}),o(ze,"toString",function(){return w(this).serialize()},{enumerable:!0}),A){var hc=A.createObjectURL,vc=A.revokeObjectURL;hc&&o(sr,"createObjectURL",a(hc,A)),vc&&o(sr,"revokeObjectURL",a(vc,A))}return y(sr,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:sr}),Il}var Ll;function em(){return Ll||(Ll=1,Qp()),Sl}var Nl={},$l;function tm(){if($l)return Nl;$l=1;var t=ke(),e=at(),r=$e(),n=rr(),a=kt(),i=Kn(),o=e("URL"),s=i&&r(function(){o.canParse()}),c=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||c},{canParse:function(u){var f=n(arguments.length,1),h=a(u),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),Nl}var xl={},Dl;function rm(){if(Dl)return xl;Dl=1;var t=ke(),e=at(),r=rr(),n=kt(),a=Kn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var c=r(arguments.length,1),l=n(s),u=c<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,u)}catch{return null}}}),xl}var Ml={},Fl;function nm(){if(Fl)return Ml;Fl=1;var t=ke(),e=He();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Ml}var uo,Kl;function am(){if(Kl)return uo;Kl=1,Gh(),em(),tm(),rm(),nm();var t=Gn();return uo=t.URL,uo}var lo,Hl;function im(){if(Hl)return lo;Hl=1;var t=am();return lo=t,lo}var fo,zl;function om(){if(zl)return fo;zl=1;var t=im();return fo=t,fo}om();var Bl={},ho,Gl;function sm(){return Gl||(Gl=1,ho={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}),ho}var vo,Wl;function cm(){if(Wl)return vo;Wl=1;var t=Dn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return vo=r===Object.prototype?void 0:r,vo}var Vl;function Xh(){if(Vl)return Bl;Vl=1;var t=Se(),e=sm(),r=cm(),n=Ds(),a=tr(),i=Tr(),o=xe(),s=o("iterator"),c=n.values,l=function(f,h){if(f){if(f[s]!==c)try{a(f,s,c)}catch{f[s]=c}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 u in e)l(t[u]&&t[u].prototype,u);return l(r,"DOMTokenList"),Bl}var po,Jl;function um(){if(Jl)return po;Jl=1;var t=Gh();return Xh(),po=t,po}var mo,Zl;function lm(){if(Zl)return mo;Zl=1;var t=um();return mo=t,mo}lm();var Yl={},Xl={},go,Ql;function fm(){if(Ql)return go;Ql=1;var t=nt(),e=tr();return go=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},go}var yo,ef;function dm(){if(ef)return yo;ef=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 yo=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},yo}var wo,tf;function hm(){if(tf)return wo;tf=1;var t=$e(),e=er();return wo=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),wo}var bo,rf;function vm(){if(rf)return bo;rf=1;var t=tr(),e=dm(),r=hm(),n=Error.captureStackTrace;return bo=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},bo}var So,nf;function nn(){if(nf)return So;nf=1;var t=kr(),e=He(),r=st(),n=Fn(),a=Zh(),i=As(),o=Mn(),s=Ks(),c=zn(),l=Jh(),u=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return So=function(d,v,g){var y=g&&g.that,S=!!(g&&g.AS_ENTRIES),b=!!(g&&g.IS_RECORD),p=!!(g&&g.IS_ITERATOR),m=!!(g&&g.INTERRUPTED),w=t(v,y),R,j,A,H,B,ie,L,D=function(O){return R&&l(R,"normal"),new f(!0,O)},N=function(O){return S?(r(O),m?w(O[0],O[1],D):w(O[0],O[1])):m?w(O,D):w(O)};if(b)R=d.iterator;else if(p)R=d;else{if(j=c(d),!j)throw new u(n(d)+" is not iterable");if(a(j)){for(A=0,H=i(d);H>A;A++)if(B=N(d[A]),B&&o(h,B))return B;return new f(!1)}R=s(d,j)}for(ie=b?d.next:R.next;!(L=e(ie,R)).done;){try{B=N(L.value)}catch(O){l(R,"throw",O)}if(typeof B=="object"&&B&&o(h,B))return B}return new f(!1)},So}var Io,af;function pm(){if(af)return Io;af=1;var t=kt();return Io=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},Io}var of;function mm(){if(of)return Xl;of=1;var t=ke(),e=Mn(),r=Ns(),n=$s(),a=Dh(),i=en(),o=tr(),s=er(),c=fm(),l=vm(),u=nn(),f=pm(),h=xe(),d=h("toStringTag"),v=Error,g=[].push,y=function(p,m){var w=e(S,this),R;n?R=n(new v,w?r(this):S):(R=w?this:i(S),o(R,d,"Error")),m!==void 0&&o(R,"message",f(m)),l(R,y,R.stack,1),arguments.length>2&&c(R,arguments[2]);var j=[];return u(p,g,{that:j}),o(R,"errors",j),R};n?n(y,v):a(y,v,{name:!0});var S=y.prototype=i(v.prototype,{constructor:s(1,y),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:y}),Xl}var sf;function gm(){return sf||(sf=1,mm()),Yl}var cf={},Po,uf;function ym(){if(uf)return Po;uf=1;var t=Fs(),e=rn();return Po=t?{}.toString:function(){return"[object "+e(this)+"]"},Po}var lf;function wm(){if(lf)return cf;lf=1;var t=Fs(),e=it(),r=ym();return t||e(Object.prototype,"toString",r,{unsafe:!0}),cf}var ff={},df={},Eo,hf;function Qh(){if(hf)return Eo;hf=1;var t=Se(),e=Qr(),r=Ln(),n=function(a){return e.slice(0,a.length)===a};return Eo=(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"})(),Eo}var _o,vf;function Hs(){if(vf)return _o;vf=1;var t=Qh();return _o=t==="NODE",_o}var To,pf;function bm(){if(pf)return To;pf=1;var t=at(),e=Hn(),r=xe(),n=De(),a=r("species");return To=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},To}var ko,mf;function Sm(){if(mf)return ko;mf=1;var t=Yh(),e=Fn(),r=TypeError;return ko=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},ko}var Ro,gf;function ev(){if(gf)return Ro;gf=1;var t=st(),e=Sm(),r=Nn(),n=xe(),a=n("species");return Ro=function(i,o){var s=t(i).constructor,c;return s===void 0||r(c=t(s)[a])?o:e(c)},Ro}var Oo,yf;function tv(){if(yf)return Oo;yf=1;var t=qn(),e=Function.prototype,r=e.apply,n=e.call;return Oo=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),Oo}var Co,wf;function rv(){if(wf)return Co;wf=1;var t=Qr();return Co=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),Co}var Ao,bf;function nv(){if(bf)return Ao;bf=1;var t=Se(),e=tv(),r=kr(),n=Pe(),a=rt(),i=$e(),o=Uh(),s=Bn(),c=Dn(),l=rr(),u=rv(),f=Hs(),h=t.setImmediate,d=t.clearImmediate,v=t.process,g=t.Dispatch,y=t.Function,S=t.MessageChannel,b=t.String,p=0,m={},w="onreadystatechange",R,j,A,H;i(function(){R=t.location});var B=function(N){if(a(m,N)){var O=m[N];delete m[N],O()}},ie=function(N){return function(){B(N)}},L=function(N){B(N.data)},D=function(N){t.postMessage(b(N),R.protocol+"//"+R.host)};return(!h||!d)&&(h=function(O){l(arguments.length,1);var Y=n(O)?O:y(O),te=s(arguments,1);return m[++p]=function(){e(Y,void 0,te)},j(p),p},d=function(O){delete m[O]},f?j=function(N){v.nextTick(ie(N))}:g&&g.now?j=function(N){g.now(ie(N))}:S&&!u?(A=new S,H=A.port2,A.port1.onmessage=L,j=r(H.postMessage,H)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(D)?(j=D,t.addEventListener("message",L,!1)):w in c("script")?j=function(N){o.appendChild(c("script"))[w]=function(){o.removeChild(this),B(N)}}:j=function(N){setTimeout(ie(N),0)}),Ao={set:h,clear:d},Ao}var jo,Sf;function av(){if(Sf)return jo;Sf=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}}},jo=t,jo}var Uo,If;function Im(){if(If)return Uo;If=1;var t=Qr();return Uo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Uo}var qo,Pf;function Pm(){if(Pf)return qo;Pf=1;var t=Qr();return qo=/web0s(?!.*chrome)/i.test(t),qo}var Lo,Ef;function Em(){if(Ef)return Lo;Ef=1;var t=Se(),e=zh(),r=kr(),n=nv().set,a=av(),i=rv(),o=Im(),s=Pm(),c=Hs(),l=t.MutationObserver||t.WebKitMutationObserver,u=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,g,y,S,b;if(!d){var p=new a,m=function(){var w,R;for(c&&(w=f.domain)&&w.exit();R=p.get();)try{R()}catch(j){throw p.head&&v(),j}w&&w.enter()};!i&&!c&&!s&&l&&u?(g=!0,y=u.createTextNode(""),new l(m).observe(y,{characterData:!0}),v=function(){y.data=g=!g}):!o&&h&&h.resolve?(S=h.resolve(void 0),S.constructor=h,b=r(S.then,S),v=function(){b(m)}):c?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(w){p.head||v(),p.add(w)}}return Lo=d,Lo}var No,_f;function _m(){return _f||(_f=1,No=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),No}var $o,Tf;function Rr(){return Tf||(Tf=1,$o=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),$o}var xo,kf;function Or(){if(kf)return xo;kf=1;var t=Se();return xo=t.Promise,xo}var Do,Rf;function an(){if(Rf)return Do;Rf=1;var t=Se(),e=Or(),r=Pe(),n=Mh(),a=Ls(),i=xe(),o=Qh(),s=mt(),c=Ph(),l=e&&e.prototype,u=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),g=v!==String(e);if(!g&&c===66||s&&!(l.catch&&l.finally))return!0;if(!c||c<51||!/native code/.test(v)){var y=new e(function(p){p(1)}),S=function(p){p(function(){},function(){})},b=y.constructor={};if(b[u]=S,f=y.then(function(){})instanceof S,!f)return!0}return!g&&(o==="BROWSER"||o==="DENO")&&!h});return Do={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},Do}var Mo={},Of;function Rt(){if(Of)return Mo;Of=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 Mo.f=function(n){return new r(n)},Mo}var Cf;function Tm(){if(Cf)return df;Cf=1;var t=ke(),e=mt(),r=Hs(),n=Se(),a=Gn(),i=He(),o=it(),s=$s(),c=Tr(),l=bm(),u=ct(),f=Pe(),h=nt(),d=Ms(),v=ev(),g=nv().set,y=Em(),S=_m(),b=Rr(),p=av(),m=_r(),w=Or(),R=an(),j=Rt(),A="Promise",H=R.CONSTRUCTOR,B=R.REJECTION_EVENT,ie=R.SUBCLASSING,L=m.getterFor(A),D=m.set,N=w&&w.prototype,O=w,Y=N,te=n.TypeError,Q=n.document,I=n.process,T=j.f,$=T,F=!!(Q&&Q.createEvent&&n.dispatchEvent),Z="unhandledrejection",V="rejectionhandled",he=0,oe=1,le=2,se=1,_e=2,Ae,Me,Re,Je,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,Ze=M.resolve,je=M.reject,Be=M.domain,Ue,Xe,nr;try{ge?(ve||(ee.rejection===_e&&J(ee),ee.rejection=se),ge===!0?Ue=fe:(Be&&Be.enter(),Ue=ge(fe),Be&&(Be.exit(),nr=!0)),Ue===M.promise?je(new te("Promise-chain cycle")):(Xe=ut(Ue))?i(Xe,Ue,Ze,je):Ze(Ue)):je(fe)}catch(jr){Be&&!nr&&Be.exit(),je(jr)}},gt=function(M,ee){M.notified||(M.notified=!0,y(function(){for(var fe=M.reactions,ve;ve=fe.get();)lt(ve,M);M.notified=!1,ee&&!M.rejection&&k(M)}))},yt=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&&S("Unhandled promise rejection",fe)},k=function(M){i(g,n,function(){var ee=M.facade,fe=M.value,ve=K(M),ge;if(ve&&(ge=b(function(){r?I.emit("unhandledRejection",fe,ee):yt(Z,ee,fe)}),M.rejection=r||K(M)?_e:se,ge.error))throw ge.value})},K=function(M){return M.rejection!==se&&!M.parent},J=function(M){i(g,n,function(){var ee=M.facade;r?I.emit("rejectionHandled",ee):yt(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,gt(M,!0))},Fe=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?y(function(){var ge={done:!1};try{i(ve,ee,re(Fe,ge,M),re(me,ge,M))}catch(Ze){me(ge,Ze,M)}}):(M.value=ee,M.state=oe,gt(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(H&&(O=function(ee){d(this,Y),u(ee),i(Ae,this);var fe=L(this);try{ee(re(Fe,fe),re(me,fe))}catch(ve){me(fe,ve)}},Y=O.prototype,Ae=function(ee){D(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new p,rejection:!1,state:he,value:null})},Ae.prototype=o(Y,"then",function(ee,fe){var ve=L(this),ge=T(v(this,O));return ve.parent=!0,ge.ok=f(ee)?ee:!0,ge.fail=f(fe)&&fe,ge.domain=r?I.domain:void 0,ve.state===he?ve.reactions.add(ge):y(function(){lt(ge,ve)}),ge.promise}),Me=function(){var M=new Ae,ee=L(M);this.promise=M,this.resolve=re(Fe,ee),this.reject=re(me,ee)},j.f=T=function(M){return M===O||M===Re?new Me(M):$(M)},!e&&f(w)&&N!==Object.prototype)){Je=N.then,ie||o(N,"then",function(ee,fe){var ve=this;return new O(function(ge,Ze){i(Je,ve,ge,Ze)}).then(ee,fe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,Y)}return t({global:!0,constructor:!0,wrap:!0,forced:H},{Promise:O}),Re=a.Promise,c(O,A,!1,!0),l(A),df}var Af={},Fo,jf;function km(){if(jf)return Fo;jf=1;var t=xe(),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 Fo=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var c={};c[e]=function(){return{next:function(){return{done:s=!0}}}},i(c)}catch{}return s},Fo}var Ko,Uf;function Wn(){if(Uf)return Ko;Uf=1;var t=Or(),e=km(),r=an().CONSTRUCTOR;return Ko=r||!e(function(n){t.all(n).then(void 0,function(){})}),Ko}var qf;function Rm(){if(qf)return Af;qf=1;var t=ke(),e=He(),r=ct(),n=Rt(),a=Rr(),i=nn(),o=Wn();return t({target:"Promise",stat:!0,forced:o},{all:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=r(l.resolve),g=[],y=0,S=1;i(c,function(b){var p=y++,m=!1;S++,e(v,l,b).then(function(w){m||(m=!0,g[p]=w,--S||f(g))},h)}),--S||f(g)});return d.error&&h(d.value),u.promise}}),Af}var Lf={},Nf;function Om(){if(Nf)return Lf;Nf=1;var t=ke(),e=mt(),r=an().CONSTRUCTOR,n=Or(),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 c=a("Promise").prototype.catch;s.catch!==c&&o(s,"catch",c,{unsafe:!0})}return Lf}var $f={},xf;function Cm(){if(xf)return $f;xf=1;var t=ke(),e=He(),r=ct(),n=Rt(),a=Rr(),i=nn(),o=Wn();return t({target:"Promise",stat:!0,forced:o},{race:function(c){var l=this,u=n.f(l),f=u.reject,h=a(function(){var d=r(l.resolve);i(c,function(v){e(d,l,v).then(u.resolve,f)})});return h.error&&f(h.value),u.promise}}),$f}var Df={},Mf;function Am(){if(Mf)return Df;Mf=1;var t=ke(),e=Rt(),r=an().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}}),Df}var Ff={},Ho,Kf;function iv(){if(Kf)return Ho;Kf=1;var t=st(),e=nt(),r=Rt();return Ho=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},Ho}var Hf;function jm(){if(Hf)return Ff;Hf=1;var t=ke(),e=at(),r=mt(),n=Or(),a=an().CONSTRUCTOR,i=iv(),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)}}),Ff}var zf;function Um(){return zf||(zf=1,Tm(),Rm(),Om(),Cm(),Am(),jm()),ff}var Bf={},Gf;function qm(){if(Gf)return Bf;Gf=1;var t=ke(),e=He(),r=ct(),n=Rt(),a=Rr(),i=nn(),o=Wn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=r(l.resolve),g=[],y=0,S=1;i(c,function(b){var p=y++,m=!1;S++,e(v,l,b).then(function(w){m||(m=!0,g[p]={status:"fulfilled",value:w},--S||f(g))},function(w){m||(m=!0,g[p]={status:"rejected",reason:w},--S||f(g))})}),--S||f(g)});return d.error&&h(d.value),u.promise}}),Bf}var Wf={},Vf;function Lm(){if(Vf)return Wf;Vf=1;var t=ke(),e=He(),r=ct(),n=at(),a=Rt(),i=Rr(),o=nn(),s=Wn(),c="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(u){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,g=d.reject,y=i(function(){var S=r(f.resolve),b=[],p=0,m=1,w=!1;o(u,function(R){var j=p++,A=!1;m++,e(S,f,R).then(function(H){A||w||(w=!0,v(H))},function(H){A||w||(A=!0,b[j]=H,--m||g(new h(b,c)))})}),--m||g(new h(b,c))});return y.error&&g(y.value),d.promise}}),Wf}var Jf={},Zf;function ov(){if(Zf)return Jf;Zf=1;var t=ke(),e=Se(),r=tv(),n=Bn(),a=Rt(),i=ct(),o=Rr(),s=e.Promise,c=!1,l=!s||!s.try||o(function(){s.try(function(u){c=u===8},8)}).error||!c;return t({target:"Promise",stat:!0,forced:l},{try:function(u){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(u),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Jf}var Yf={},Xf;function sv(){if(Xf)return Yf;Xf=1;var t=ke(),e=Rt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Yf}var Qf={},ed;function Nm(){if(ed)return Qf;ed=1;var t=ke(),e=mt(),r=Or(),n=$e(),a=at(),i=Pe(),o=ev(),s=iv(),c=it(),l=r&&r.prototype,u=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:u},{finally:function(h){var d=o(this,a("Promise")),v=i(h);return this.then(v?function(g){return s(d,h()).then(function(){return g})}:h,v?function(g){return s(d,h()).then(function(){throw g})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&c(l,"finally",f,{unsafe:!0})}return Qf}var zo,td;function $m(){if(td)return zo;td=1,gm(),Ds(),wm(),Um(),qm(),Lm(),ov(),sv(),Nm(),Vh();var t=Gn();return zo=t.Promise,zo}var Bo,rd;function xm(){if(rd)return Bo;rd=1;var t=$m();return Xh(),Bo=t,Bo}var nd={},ad;function Dm(){return ad||(ad=1,ov()),nd}var id={},od;function Mm(){return od||(od=1,sv()),id}var Go,sd;function Fm(){if(sd)return Go;sd=1;var t=xm();return Dm(),Mm(),Go=t,Go}Fm();const cv="sesamy-debug";function Km(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 Hm(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 zm(t){Km(cv,t.toString(),1)}function Bm(){return Hm(cv)==="true"}function pe(t){Bm()&&console.log(t)}function qt(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 Dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function zs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Bs(t,e){return t(e={exports:{}},e.exports),e.exports}var $t=Bs((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()}}));zs($t);var Gm=zs(Bs((function(t,e){var r=Dt&&Dt.__awaiter||function(u,f,h,d){return new(h||(h=Promise))((function(v,g){function y(p){try{b(d.next(p))}catch(m){g(m)}}function S(p){try{b(d.throw(p))}catch(m){g(m)}}function b(p){p.done?v(p.value):new h((function(m){m(p.value)})).then(y,S)}b((d=d.apply(u,f||[])).next())}))},n=Dt&&Dt.__generator||function(u,f){var h,d,v,g,y={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return g={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function S(b){return function(p){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;y;)try{if(h=1,d&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return y.label++,{value:m[1],done:!1};case 5:y.label++,d=m[1],m=[0];continue;case 7:m=y.ops.pop(),y.trys.pop();continue;default:if(v=y.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){y=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){y.label=m[1];break}if(m[0]===6&&y.label<v[1]){y.label=v[1],v=m;break}if(v&&y.label<v[2]){y.label=v[2],y.ops.push(m);break}v[2]&&y.ops.pop(),y.trys.pop();continue}m=f.call(u,y)}catch(w){m=[6,w],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([b,p])}}},a=Dt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(u){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(u){return[2,window.localStorage.clear()]}))}))},removeItem:function(u){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(u,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,f){return window.localStorage.setItem(u,f)}};function s(u){return new Promise((function(f){return setTimeout(f,u)}))}function c(u){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<u;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function u(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+c(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,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,g,y,S,b,p;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+c(4),v=Date.now()+h,g=i+"-"+f,y=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),y.getItemSync(g)!==null?[3,5]:(S=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),y.setItemSync(g,JSON.stringify({id:this.id,iat:d,timeoutKey:S,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(b=y.getItemSync(g))!==null&&(p=JSON.parse(b)).id===this.id&&p.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(g,d),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+c(4),[3,1];case 8:return[2,!1]}}))}))},u.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 g,y,S;return n(this,(function(b){switch(b.label){case 0:return[4,$t.default().lock(h)];case 1:return b.sent(),this.acquiredIatSet.has(h)?(g=this.storageHandler===void 0?o:this.storageHandler,(y=g.getItemSync(f))===null?($t.default().unlock(h),[2]):((S=JSON.parse(y)).timeRefreshed=Date.now(),g.setItemSync(f,JSON.stringify(S)),$t.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):($t.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},u.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,g=Date.now(),y=!1;function S(){if(y||(window.removeEventListener("storage",S),u.removeFromWaiting(S),clearTimeout(b),y=!0),!v){v=!0;var p=50-(Date.now()-g);p>0?setTimeout(d,p):d(null)}}window.addEventListener("storage",S),u.addToWaiting(S);var b=setTimeout(S,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},u.addToWaiting=function(f){this.removeFromWaiting(f),u.waiters!==void 0&&u.waiters.push(f)},u.removeFromWaiting=function(f){u.waiters!==void 0&&(u.waiters=u.waiters.filter((function(h){return h!==f})))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach((function(f){return f()}))},u.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()]}}))}))},u.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,g;return n(this,(function(y){switch(y.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(g=JSON.parse(v)).id!==this.id?[3,2]:[4,$t.default().lock(g.iat)];case 1:y.sent(),this.acquiredIatSet.delete(g.iat),h.removeItemSync(d),$t.default().unlock(g.iat),u.notifyWaiters(),y.label=2;case 2:return[2]}}))}))},u.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],g=0;;){var y=d.keySync(g);if(y===null)break;v.push(y),g++}for(var S=!1,b=0;b<v.length;b++){var p=v[b];if(p.includes(i)){var m=d.getItemSync(p);if(m!==null){var w=JSON.parse(m);(w.timeRefreshed===void 0&&w.timeAcquired<h||w.timeRefreshed!==void 0&&w.timeRefreshed<h)&&(d.removeItemSync(p),S=!0)}}}S&&u.notifyWaiters()},u.waiters=void 0,u})();e.default=l})));const Wm={timeoutInSeconds:60},uv={name:"auth0-spa-js",version:"2.8.0"},lv=()=>Date.now();let Ce=class ls extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,ls.prototype)}static fromPayload({error:e,error_description:r}){return new ls(e,r)}},Vm=class fv extends Ce{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,fv.prototype)}},Jm=class dv extends Ce{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,dv.prototype)}},fs=class hv extends Ce{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,hv.prototype)}};class Gs extends fs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Gs.prototype)}}let Zm=class vv extends Ce{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,vv.prototype)}},Ym=class pv extends Ce{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,pv.prototype)}},mv=class gv extends Ce{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${In(e,["default"])}', scope: '${In(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,gv.prototype)}},Xm=class yv extends Ce{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${In(e,["default"])}', missing scope: '${In(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,yv.prototype)}},wv=class bv extends Ce{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,bv.prototype)}};function In(t,e=[]){return t&&!e.includes(t)?t:""}const Pn=()=>window.crypto,qr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(Pn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Wo=t=>btoa(t),Qm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],eg=t=>Object.keys(t).reduce(((e,r)=>{const n=Qm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),ds=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()},cd=async t=>await Pn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),ud=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),ld=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},tg=new TextEncoder,rg=new TextDecoder;function zr(t){return typeof t=="string"?tg.encode(t):rg.decode(t)}function fd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new ag(`${t.name} modulusLength must be at least 2048 bits`)}async function ng(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=`${Br(zr(JSON.stringify(t)))}.${Br(zr(JSON.stringify(e)))}`;return`${n}.${Br(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return fd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return fd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Kt})(r),r,zr(n)))}`}let hs;Uint8Array.prototype.toBase64?hs=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):hs=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 Br(t){return hs(t)}let Kt=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)}},ag=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 ig(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Kt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Kt("unsupported CryptoKey algorithm name")}}function Sv(t){return t instanceof CryptoKey}function Iv(t){return Sv(t)&&t.type==="public"}async function og(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!Sv(c=o)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Iv(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 ng({alg:ig(o),typ:"dpop+jwt",jwk:await Pv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Br(await crypto.subtle.digest("SHA-256",zr(a))):void 0}),o)}async function Pv(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 sg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function cg(){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 Kt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function ug(t){return(async function(e){if(!Iv(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 Pv(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 Kt("unsupported JWK kty")}return Br(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function lg({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 og(t,i,r,n,a)}const fg=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},dg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([fg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},hg=async(t,e,r,n,a,i,o,s)=>{return c={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(u,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):u(d.data),h.port1.close()},l.postMessage(c,[h.port2])}));var c,l},vg=async(t,e,r,n,a,i,o=1e4,s)=>a?hg(t,e,r,n,o,a,i,s):dg(t,n,o);async function Ev(t,e,r,n,a,i,o,s,c,l){if(c){const p=await c.generateProof({url:t,method:a.method||"GET",nonce:await c.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:p})}let u,f=null;for(let p=0;p<3;p++)try{u=await vg(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=u.json,{error:d,error_description:v}=h,g=vt(h,["error","error_description"]),{headers:y,ok:S}=u;let b;if(c&&(b=y["dpop-nonce"],b&&await c.setNonce(b)),!S){const p=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Ym(d,p,g.mfa_token);if(d==="missing_refresh_token")throw new mv(r,n);if(d==="use_dpop_nonce"){if(!c||!b||l)throw new wv(b);return Ev(t,e,r,n,a,i,o,s,c,!0)}throw new Ce(d||"request_error",p)}return g}async function pg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:c,dpop:l}=t,u=vt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=u.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=u.grant_type==="refresh_token"&&c,d=Object.assign(Object.assign(Object.assign(Object.assign({},u),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?ds(d):JSON.stringify(d),g=(y=u.grant_type,sg.includes(y));var y;return await Ev(`${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(eg(o||uv)))}},e,s,c,g?l:void 0)}const mn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},sn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),mn(n,e)};let It=class vs{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 vs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new vs({scope:r,audience:n,clientId:a})}},mg=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@@")))}},_v=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)}})()}},gg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||lv}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 u=this.matchExistingCacheKey(e,l);if(u&&(o=await this.cache.get(u)),!u&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return o.expiresAt-r<c?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 It({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 It({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 It({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=It.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],c=i.scope&&s.reduce(((l,u)=>l&&o.has(u)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&c}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=It.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)}}}},yg=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 Lr=t=>typeof t=="number",wg=["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"],bg=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,c,l]=o;if(o.length!==3||!s||!c||!l)throw new Error("ID token could not be decoded");const u=JSON.parse(ud(c)),f={__raw:i},h={};return Object.keys(u).forEach((d=>{f[d]=u[d],wg.includes(d)||(h[d]=u[d])})),{encoded:{header:s,payload:c,signature:l},header:JSON.parse(ud(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&&!Lr(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||!Lr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Lr(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&&Lr(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&&Lr(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 Ht=Bs((function(t,e){var r=Dt&&Dt.__assign||function(){return r=Object.assign||function(c){for(var l,u=1,f=arguments.length;u<f;u++)for(var h in l=arguments[u])Object.prototype.hasOwnProperty.call(l,h)&&(c[h]=l[h]);return c},r.apply(this,arguments)};function n(c,l){if(!l)return"";var u="; "+c;return l===!0?u:u+"="+l}function a(c,l,u){return encodeURIComponent(c).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)})(u)}function i(c){for(var l={},u=c?c.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<u.length;h++){var d=u[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(c,l,u){document.cookie=a(c,l,r({path:"/"},u))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(c){return o()[c]},e.set=s,e.remove=function(c,l){s(c,"",r(r({},l),{expires:-1}))}}));zs(Ht),Ht.encode,Ht.parse,Ht.getAll;var Sg=Ht.get,Tv=Ht.set,kv=Ht.remove;const lr={get(t){const e=Sg(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),Tv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),kv(t,r)}},Ig={get(t){return lr.get(t)||lr.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),Tv(`_legacy_${t}`,JSON.stringify(e),n),lr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),kv(t,r),lr.remove(t,e),lr.remove(`_legacy_${t}`,e)}},Pg={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 Mt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Mt||(Mt={}));function Eg(t,e,r){var n=e===void 0?null:e,a=(function(c,l){var u=atob(c);if(l){for(var f=new Uint8Array(u.length),h=0,d=u.length;h<d;++h)f[h]=u.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return u})(t,r!==void 0&&r),i=a.indexOf(`
2
- `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var dd,hd,vd,Vo,_g=(dd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",hd=null,vd=!1,function(t){return Vo=Vo||Eg(dd,hd,vd),new Worker(Vo,t)});const Jo={};let Tg=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 kg={memory:()=>new _v().enclosedCache,localstorage:()=>new mg},pd=t=>kg[t],md=t=>{const{openUrl:e,onRedirect:r}=t,n=vt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},gd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},Nt={NONCE:"nonce",KEYPAIR:"keypair"};let Rg=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)}},Og=class{constructor(e){this.storage=new Rg(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 cg(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return lg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ug(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var fr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(fr||(fr={}));let Cg=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=fr.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?fr.DPoP:fr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===fr.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 wv(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)}},Ag=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 yd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new yd(r)}},yd=class Rv 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,Rv.prototype)}};const Zo=new Gm;let jg=class{constructor(e){let r,n;if(this.userCache=new _v().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const c=Array.from(this.activeLockKeys);for(const l of c)await Zo.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(!Pn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Pn().subtle===void 0)throw new Error(`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vc={},aa,pc;function $e(){return pc||(pc=1,aa=function(t){try{return!!t()}catch{return!0}}),aa}var ia,mc;function Cn(){if(mc)return ia;mc=1;var t=$e();return ia=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),ia}var oa,gc;function be(){if(gc)return oa;gc=1;var t=Cn(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return oa=t?n:function(a){return function(){return r.apply(a,arguments)}},oa}var sa,yc;function An(){if(yc)return sa;yc=1;var t=be(),e=t({}.toString),r=t("".slice);return sa=function(n){return r(e(n),8,-1)},sa}var ca,wc;function vh(){if(wc)return ca;wc=1;var t=be(),e=$e(),r=An(),n=Object,a=t("".split);return ca=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ca}var ua,bc;function jn(){return bc||(bc=1,ua=function(t){return t==null}),ua}var la,Sc;function Un(){if(Sc)return la;Sc=1;var t=jn(),e=TypeError;return la=function(r){if(t(r))throw new e("Can't call method on "+r);return r},la}var fa,Ic;function Vr(){if(Ic)return fa;Ic=1;var t=vh(),e=Un();return fa=function(r){return t(e(r))},fa}var Or,Pc;function Se(){if(Pc)return Or;Pc=1;var t=function(e){return e&&e.Math===Math&&e};return Or=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof hc=="object"&&hc)||t(typeof Or=="object"&&Or)||(function(){return this})()||Function("return this")(),Or}var da={exports:{}},ha,Ec;function mt(){return Ec||(Ec=1,ha=!1),ha}var va,_c;function Ps(){if(_c)return va;_c=1;var t=Se(),e=Object.defineProperty;return va=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},va}var Tc;function Es(){if(Tc)return da.exports;Tc=1;var t=mt(),e=Se(),r=Ps(),n="__core-js_shared__",a=da.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"}),da.exports}var pa,kc;function ph(){if(kc)return pa;kc=1;var t=Es();return pa=function(e,r){return t[e]||(t[e]=r||{})},pa}var ma,Rc;function qn(){if(Rc)return ma;Rc=1;var t=Un(),e=Object;return ma=function(r){return e(t(r))},ma}var ga,Oc;function rt(){if(Oc)return ga;Oc=1;var t=be(),e=qn(),r=t({}.hasOwnProperty);return ga=Object.hasOwn||function(a,i){return r(e(a),i)},ga}var ya,Cc;function mh(){if(Cc)return ya;Cc=1;var t=be(),e=0,r=Math.random(),n=t(1.1.toString);return ya=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},ya}var wa,Ac;function Jr(){if(Ac)return wa;Ac=1;var t=Se(),e=t.navigator,r=e&&e.userAgent;return wa=r?String(r):"",wa}var ba,jc;function gh(){if(jc)return ba;jc=1;var t=Se(),e=Jr(),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]))),ba=s,ba}var Sa,Uc;function yh(){if(Uc)return Sa;Uc=1;var t=gh(),e=$e(),r=Se(),n=r.String;return Sa=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Sa}var Ia,qc;function wh(){if(qc)return Ia;qc=1;var t=yh();return Ia=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Ia}var Pa,Lc;function xe(){if(Lc)return Pa;Lc=1;var t=Se(),e=ph(),r=rt(),n=mh(),a=yh(),i=wh(),o=t.Symbol,s=e("wks"),c=i?o.for||o:o&&o.withoutSetter||n;return Pa=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:c("Symbol."+l)),s[l]},Pa}var Ea,Nc;function Pe(){if(Nc)return Ea;Nc=1;var t=typeof document=="object"&&document.all;return Ea=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},Ea}var _a,$c;function nt(){if($c)return _a;$c=1;var t=Pe();return _a=function(e){return typeof e=="object"?e!==null:t(e)},_a}var Ta,xc;function ct(){if(xc)return Ta;xc=1;var t=nt(),e=String,r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ta}var ka={},Ra,Dc;function De(){if(Dc)return Ra;Dc=1;var t=$e();return Ra=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Ra}var Oa,Mc;function bh(){if(Mc)return Oa;Mc=1;var t=De(),e=$e();return Oa=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Oa}var Ca={},Aa,Fc;function Ln(){if(Fc)return Aa;Fc=1;var t=Se(),e=nt(),r=t.document,n=e(r)&&e(r.createElement);return Aa=function(a){return n?r.createElement(a):{}},Aa}var ja,Kc;function Sh(){if(Kc)return ja;Kc=1;var t=De(),e=$e(),r=Ln();return ja=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),ja}var Ua,zc;function ze(){if(zc)return Ua;zc=1;var t=Cn(),e=Function.prototype.call;return Ua=t?e.bind(e):function(){return e.apply(e,arguments)},Ua}var qa,Hc;function at(){if(Hc)return qa;Hc=1;var t=Se(),e=Pe(),r=function(n){return e(n)?n:void 0};return qa=function(n,a){return arguments.length<2?r(t[n]):t[n]&&t[n][a]},qa}var La,Bc;function Nn(){if(Bc)return La;Bc=1;var t=be();return La=t({}.isPrototypeOf),La}var Na,Gc;function Ih(){if(Gc)return Na;Gc=1;var t=at(),e=Pe(),r=Nn(),n=wh(),a=Object;return Na=n?function(i){return typeof i=="symbol"}:function(i){var o=t("Symbol");return e(o)&&r(o.prototype,a(i))},Na}var $a,Wc;function $n(){if(Wc)return $a;Wc=1;var t=String;return $a=function(e){try{return t(e)}catch{return"Object"}},$a}var xa,Vc;function ut(){if(Vc)return xa;Vc=1;var t=Pe(),e=$n(),r=TypeError;return xa=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},xa}var Da,Jc;function _s(){if(Jc)return Da;Jc=1;var t=ut(),e=jn();return Da=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Da}var Ma,Zc;function gp(){if(Zc)return Ma;Zc=1;var t=ze(),e=Pe(),r=nt(),n=TypeError;return Ma=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")},Ma}var Fa,Yc;function yp(){if(Yc)return Fa;Yc=1;var t=ze(),e=nt(),r=Ih(),n=_s(),a=gp(),i=xe(),o=TypeError,s=i("toPrimitive");return Fa=function(c,l){if(!e(c)||r(c))return c;var u=n(c,s),f;if(u){if(l===void 0&&(l="default"),f=t(u,c,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(c,l)},Fa}var Ka,Xc;function Ph(){if(Xc)return Ka;Xc=1;var t=yp(),e=Ih();return Ka=function(r){var n=t(r,"string");return e(n)?n:n+""},Ka}var Qc;function Tt(){if(Qc)return Ca;Qc=1;var t=De(),e=Sh(),r=bh(),n=ct(),a=Ph(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,c="enumerable",l="configurable",u="writable";return Ca.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&u in v&&!v[u]){var p=s(h,d);p&&p[u]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:c in v?v[c]:p[c],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},Ca}var za,eu;function wp(){if(eu)return za;eu=1;var t=Math.ceil,e=Math.floor;return za=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},za}var Ha,tu;function Ts(){if(tu)return Ha;tu=1;var t=wp();return Ha=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ha}var Ba,ru;function Eh(){if(ru)return Ba;ru=1;var t=Ts(),e=Math.max,r=Math.min;return Ba=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ba}var Ga,nu;function bp(){if(nu)return Ga;nu=1;var t=Ts(),e=Math.min;return Ga=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Ga}var Wa,au;function ks(){if(au)return Wa;au=1;var t=bp();return Wa=function(e){return t(e.length)},Wa}var Va,iu;function Sp(){if(iu)return Va;iu=1;var t=Vr(),e=Eh(),r=ks(),n=function(a){return function(i,o,s){var c=t(i),l=r(c);if(l===0)return!a&&-1;var u=e(s,l),f;if(a&&o!==o){for(;l>u;)if(f=c[u++],f!==f)return!0}else for(;l>u;u++)if((a||u in c)&&c[u]===o)return a||u||0;return!a&&-1}};return Va={includes:n(!0),indexOf:n(!1)},Va}var Ja,ou;function Rs(){return ou||(ou=1,Ja={}),Ja}var Za,su;function _h(){if(su)return Za;su=1;var t=be(),e=rt(),r=Vr(),n=Sp().indexOf,a=Rs(),i=t([].push);return Za=function(o,s){var c=r(o),l=0,u=[],f;for(f in c)!e(a,f)&&e(c,f)&&i(u,f);for(;s.length>l;)e(c,f=s[l++])&&(~n(u,f)||i(u,f));return u},Za}var Ya,cu;function Os(){return cu||(cu=1,Ya=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Ya}var Xa,uu;function Th(){if(uu)return Xa;uu=1;var t=_h(),e=Os();return Xa=Object.keys||function(n){return t(n,e)},Xa}var lu;function Ip(){if(lu)return ka;lu=1;var t=De(),e=bh(),r=Tt(),n=ct(),a=Vr(),i=Th();return ka.f=t&&!e?Object.defineProperties:function(s,c){n(s);for(var l=a(c),u=i(c),f=u.length,h=0,d;f>h;)r.f(s,d=u[h++],l[d]);return s},ka}var Qa,fu;function kh(){if(fu)return Qa;fu=1;var t=at();return Qa=t("document","documentElement"),Qa}var ei,du;function Cs(){if(du)return ei;du=1;var t=ph(),e=mh(),r=t("keys");return ei=function(n){return r[n]||(r[n]=e(n))},ei}var ti,hu;function Zr(){if(hu)return ti;hu=1;var t=ct(),e=Ip(),r=Os(),n=Rs(),a=kh(),i=Ln(),o=Cs(),s=">",c="<",l="prototype",u="script",f=o("IE_PROTO"),h=function(){},d=function(w){return c+u+s+w+c+"/"+u+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+u+":",m;return w.style.display="none",a.appendChild(w),w.src=String(y),m=w.contentWindow.document,m.open(),m.write(d("document.F=Object")),m.close(),m.F},g,S=function(){try{g=new ActiveXObject("htmlfile")}catch{}S=typeof document<"u"?document.domain&&g?v(g):p():v(g);for(var w=r.length;w--;)delete S[l][r[w]];return S()};return n[f]=!0,ti=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=S(),m===void 0?b:e.f(b,m)},ti}var ri,vu;function Pp(){if(vu)return ri;vu=1;var t=xe(),e=Zr(),r=Tt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ri=function(i){a[n][i]=!0},ri}var ni,pu;function Yr(){return pu||(pu=1,ni={}),ni}var ai,mu;function Ep(){if(mu)return ai;mu=1;var t=Se(),e=Pe(),r=t.WeakMap;return ai=e(r)&&/native code/.test(String(r)),ai}var ii,gu;function Xt(){return gu||(gu=1,ii=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),ii}var oi,yu;function Qt(){if(yu)return oi;yu=1;var t=De(),e=Tt(),r=Xt();return oi=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},oi}var si,wu;function Sr(){if(wu)return si;wu=1;var t=Ep(),e=Se(),r=nt(),n=Qt(),a=rt(),i=Es(),o=Cs(),s=Rs(),c="Object already initialized",l=e.TypeError,u=e.WeakMap,f,h,d,v=function(w){return d(w)?h(w):f(w,{})},p=function(w){return function(y){var m;if(!r(y)||(m=h(y)).type!==w)throw new l("Incompatible receiver, "+w+" required");return m}};if(t||i.state){var g=i.state||(i.state=new u);g.get=g.get,g.has=g.has,g.set=g.set,f=function(w,y){if(g.has(w))throw new l(c);return y.facade=w,g.set(w,y),y},h=function(w){return g.get(w)||{}},d=function(w){return g.has(w)}}else{var S=o("state");s[S]=!0,f=function(w,y){if(a(w,S))throw new l(c);return y.facade=w,n(w,S,y),y},h=function(w){return a(w,S)?w[S]:{}},d=function(w){return a(w,S)}}return si={set:f,get:h,has:d,enforce:v,getterFor:p},si}var ci={},ui={},bu;function Rh(){if(bu)return ui;bu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ui.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,ui}var Su;function Oh(){if(Su)return ci;Su=1;var t=De(),e=ze(),r=Rh(),n=Xt(),a=Vr(),i=Ph(),o=rt(),s=Sh(),c=Object.getOwnPropertyDescriptor;return ci.f=t?c:function(u,f){if(u=a(u),f=i(f),s)try{return c(u,f)}catch{}if(o(u,f))return n(!e(r.f,u,f),u[f])},ci}var li={exports:{}},fi,Iu;function Ch(){if(Iu)return fi;Iu=1;var t=De(),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 fi={EXISTS:a,PROPER:i,CONFIGURABLE:o},fi}var di,Pu;function As(){if(Pu)return di;Pu=1;var t=be(),e=Pe(),r=Es(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),di=r.inspectSource,di}var Eu;function Ah(){if(Eu)return li.exports;Eu=1;var t=be(),e=$e(),r=Pe(),n=rt(),a=De(),i=Ch().CONFIGURABLE,o=As(),s=Sr(),c=s.enforce,l=s.get,u=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}),g=String(String).split("String"),S=li.exports=function(w,y,m){h(u(y),0,7)==="Symbol("&&(y="["+d(u(y),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),m&&m.getter&&(y="get "+y),m&&m.setter&&(y="set "+y),(!n(w,"name")||i&&w.name!==y)&&(a?f(w,"name",{value:y,configurable:!0}):w.name=y),p&&m&&n(m,"arity")&&w.length!==m.arity&&f(w,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(w,"prototype",{writable:!1}):w.prototype&&(w.prototype=void 0)}catch{}var b=c(w);return n(b,"source")||(b.source=v(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=S(function(){return r(this)&&l(this).source||o(this)},"toString"),li.exports}var hi,_u;function it(){if(_u)return hi;_u=1;var t=Pe(),e=Tt(),r=Ah(),n=Ps();return hi=function(a,i,o,s){s||(s={});var c=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)c?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(c=!0):delete a[i]}catch{}c?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},hi}var vi={},Tu;function _p(){if(Tu)return vi;Tu=1;var t=_h(),e=Os(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var pi={},ku;function jh(){return ku||(ku=1,pi.f=Object.getOwnPropertySymbols),pi}var mi,Ru;function Tp(){if(Ru)return mi;Ru=1;var t=at(),e=be(),r=_p(),n=jh(),a=ct(),i=e([].concat);return mi=t("Reflect","ownKeys")||function(s){var c=r.f(a(s)),l=n.f;return l?i(c,l(s)):c},mi}var gi,Ou;function Uh(){if(Ou)return gi;Ou=1;var t=rt(),e=Tp(),r=Oh(),n=Tt();return gi=function(a,i,o){for(var s=e(i),c=n.f,l=r.f,u=0;u<s.length;u++){var f=s[u];!t(a,f)&&!(o&&t(o,f))&&c(a,f,l(i,f))}},gi}var yi,Cu;function qh(){if(Cu)return yi;Cu=1;var t=$e(),e=Pe(),r=/#|\.prototype\./,n=function(c,l){var u=i[a(c)];return u===s?!0:u===o?!1:e(l)?t(l):!!l},a=n.normalize=function(c){return String(c).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return yi=n,yi}var wi,Au;function ke(){if(Au)return wi;Au=1;var t=Se(),e=Oh().f,r=Qt(),n=it(),a=Ps(),i=Uh(),o=qh();return wi=function(s,c){var l=s.target,u=s.global,f=s.stat,h,d,v,p,g,S;if(u?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in c){if(g=c[v],s.dontCallGetSet?(S=e(d,v),p=S&&S.value):p=d[v],h=o(u?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof g==typeof p)continue;i(g,p)}(s.sham||p&&p.sham)&&r(g,"sham",!0),n(d,v,g,s)}},wi}var bi,ju;function kp(){if(ju)return bi;ju=1;var t=$e();return bi=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),bi}var Si,Uu;function js(){if(Uu)return Si;Uu=1;var t=rt(),e=Pe(),r=qn(),n=Cs(),a=kp(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Si=a?o.getPrototypeOf:function(c){var l=r(c);if(t(l,i))return l[i];var u=l.constructor;return e(u)&&l instanceof u?u.prototype:l instanceof o?s:null},Si}var Ii,qu;function Lh(){if(qu)return Ii;qu=1;var t=$e(),e=Pe(),r=nt(),n=Zr(),a=js(),i=it(),o=xe(),s=mt(),c=o("iterator"),l=!1,u,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(u=f)):l=!0);var d=!r(u)||t(function(){var v={};return u[c].call(v)!==v});return d?u={}:s&&(u=n(u)),e(u[c])||i(u,c,function(){return this}),Ii={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:l},Ii}var Pi,Lu;function Ir(){if(Lu)return Pi;Lu=1;var t=Tt().f,e=rt(),r=xe(),n=r("toStringTag");return Pi=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Pi}var Ei,Nu;function Nh(){if(Nu)return Ei;Nu=1;var t=Lh().IteratorPrototype,e=Zr(),r=Xt(),n=Ir(),a=Yr(),i=function(){return this};return Ei=function(o,s,c,l){var u=s+" Iterator";return o.prototype=e(t,{next:r(+!l,c)}),n(o,u,!1,!0),a[u]=i,o},Ei}var _i,$u;function Rp(){if($u)return _i;$u=1;var t=be(),e=ut();return _i=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},_i}var Ti,xu;function Op(){if(xu)return Ti;xu=1;var t=nt();return Ti=function(e){return t(e)||e===null},Ti}var ki,Du;function Cp(){if(Du)return ki;Du=1;var t=Op(),e=String,r=TypeError;return ki=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},ki}var Ri,Mu;function Us(){if(Mu)return Ri;Mu=1;var t=Rp(),e=nt(),r=Un(),n=Cp();return Ri=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(c,l){return r(c),n(l),e(c)&&(a?o(c,l):c.__proto__=l),c}})():void 0),Ri}var Oi,Fu;function $h(){if(Fu)return Oi;Fu=1;var t=ke(),e=ze(),r=mt(),n=Ch(),a=Pe(),i=Nh(),o=js(),s=Us(),c=Ir(),l=Qt(),u=it(),f=xe(),h=Yr(),d=Lh(),v=n.PROPER,p=n.CONFIGURABLE,g=d.IteratorPrototype,S=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",O=function(){return this};return Oi=function(A,L,z,B,ie,q,D){i(z,L,B);var N=function(V){if(V===ie&&I)return I;if(!S&&V&&V in te)return te[V];switch(V){case y:return function(){return new z(this,V)};case m:return function(){return new z(this,V)};case b:return function(){return new z(this,V)}}return function(){return new z(this)}},R=L+" Iterator",Y=!1,te=A.prototype,Q=te[w]||te["@@iterator"]||ie&&te[ie],I=!S&&Q||N(ie),T=L==="Array"&&te.entries||Q,$,F,Z;if(T&&($=o(T.call(new A)),$!==Object.prototype&&$.next&&(!r&&o($)!==g&&(s?s($,g):a($[w])||u($,w,O)),c($,R,!0,!0),r&&(h[R]=O))),v&&ie===m&&Q&&Q.name!==m&&(!r&&p?l(te,"name",m):(Y=!0,I=function(){return e(Q,this)})),ie)if(F={values:N(m),keys:q?I:N(y),entries:N(b)},D)for(Z in F)(S||Y||!(Z in te))&&u(te,Z,F[Z]);else t({target:L,proto:!0,forced:S||Y},F);return(!r||D)&&te[w]!==I&&u(te,w,I,{name:ie}),h[L]=I,F},Oi}var Ci,Ku;function qs(){return Ku||(Ku=1,Ci=function(t,e){return{value:t,done:e}}),Ci}var Ai,zu;function Ls(){if(zu)return Ai;zu=1;var t=Vr(),e=Pp(),r=Yr(),n=Sr(),a=Tt().f,i=$h(),o=qs(),s=mt(),c=De(),l="Array Iterator",u=n.set,f=n.getterFor(l);Ai=i(Array,"Array",function(d,v){u(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&&c&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ai}var Hu={},Bu;function Ap(){if(Bu)return Hu;Bu=1;var t=ke(),e=be(),r=Eh(),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 u=[],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");u[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(u,"")}}),Hu}var ji,Gu;function xh(){if(Gu)return ji;Gu=1;var t=Se(),e=De(),r=Object.getOwnPropertyDescriptor;return ji=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},ji}var Ui,Wu;function xn(){if(Wu)return Ui;Wu=1;var t=$e(),e=xe(),r=De(),n=mt(),a=e("iterator");return Ui=!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"),c="";return i.pathname="c%20d",o.forEach(function(l,u){o.delete("b"),c+=u+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"||c!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Ui}var qi,Vu;function Dn(){if(Vu)return qi;Vu=1;var t=Ah(),e=Tt();return qi=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)},qi}var Li,Ju;function jp(){if(Ju)return Li;Ju=1;var t=it();return Li=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},Li}var Ni,Zu;function Ns(){if(Zu)return Ni;Zu=1;var t=Nn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var $i,Yu;function Up(){if(Yu)return $i;Yu=1;var t=An(),e=be();return $i=function(r){if(t(r)==="Function")return e(r)},$i}var xi,Xu;function Pr(){if(Xu)return xi;Xu=1;var t=Up(),e=ut(),r=Cn(),n=t(t.bind);return xi=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},xi}var Di,Qu;function $s(){if(Qu)return Di;Qu=1;var t=xe(),e=t("toStringTag"),r={};return r[e]="z",Di=String(r)==="[object z]",Di}var Mi,el;function Xr(){if(el)return Mi;el=1;var t=$s(),e=Pe(),r=An(),n=xe(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(c,l){try{return c[l]}catch{}};return Mi=t?r:function(c){var l,u,f;return c===void 0?"Undefined":c===null?"Null":typeof(u=s(l=i(c),a))=="string"?u:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Mi}var Fi,tl;function kt(){if(tl)return Fi;tl=1;var t=Xr(),e=String;return Fi=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Fi}var Ki,rl;function Mn(){if(rl)return Ki;rl=1;var t=Xr(),e=_s(),r=jn(),n=Yr(),a=xe(),i=a("iterator");return Ki=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},Ki}var zi,nl;function xs(){if(nl)return zi;nl=1;var t=ze(),e=ut(),r=ct(),n=$n(),a=Mn(),i=TypeError;return zi=function(o,s){var c=arguments.length<2?a(o):s;if(e(c))return r(t(c,o));throw new i(n(o)+" is not iterable")},zi}var Hi,al;function er(){if(al)return Hi;al=1;var t=TypeError;return Hi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Hi}var Bi,il;function Fn(){if(il)return Bi;il=1;var t=be();return Bi=t([].slice),Bi}var Gi,ol;function qp(){if(ol)return Gi;ol=1;var t=Fn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,c;o<i;){for(c=o,s=n[o];c&&a(n[c-1],s)>0;)n[c]=n[--c];c!==o++&&(n[c]=s)}else for(var l=e(i/2),u=r(t(n,0,l),a),f=r(t(n,l),a),h=u.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(u[v],f[p])<=0?u[v++]:f[p++]:v<h?u[v++]:f[p++];return n};return Gi=r,Gi}var Wi,sl;function Dh(){if(sl)return Wi;sl=1,Ls(),Ap();var t=ke(),e=Se(),r=xh(),n=at(),a=ze(),i=be(),o=De(),s=xn(),c=it(),l=Dn(),u=jp(),f=Ir(),h=Nh(),d=Sr(),v=Ns(),p=Pe(),g=rt(),S=Pr(),w=Xr(),y=ct(),m=nt(),b=kt(),O=Zr(),A=Xt(),L=xs(),z=Mn(),B=qs(),ie=er(),q=xe(),D=qp(),N=q("iterator"),R="URLSearchParams",Y=R+"Iterator",te=d.set,Q=d.getterFor(R),I=d.getterFor(Y),T=r("fetch"),$=r("Request"),F=r("Headers"),Z=$&&$.prototype,V=F&&F.prototype,he=e.TypeError,oe=e.encodeURIComponent,le=String.fromCharCode,se=n("String","fromCodePoint"),_e=parseInt,Ae=i("".charAt),Me=i([].join),Re=i([].push),Je=i("".replace),lt=i([].shift),ft=i([].splice),gt=i("".split),yt=i("".slice),k=i(/./.exec),K=/\+/g,J="�",re=/^[0-9a-f]+$/i,me=function(x,G){var W=yt(x,G,G+2);return k(re,W)?_e(W,16):NaN},Fe=function(x){for(var G=0,W=128;W>0&&(x&W)!==0;W>>=1)G++;return G},M=function(x){var G=null;switch(x.length){case 1:G=x[0];break;case 2:G=(x[0]&31)<<6|x[1]&63;break;case 3:G=(x[0]&15)<<12|(x[1]&63)<<6|x[2]&63;break;case 4:G=(x[0]&7)<<18|(x[1]&63)<<12|(x[2]&63)<<6|x[3]&63;break}return G>1114111?null:G},ee=function(x){x=Je(x,K," ");for(var G=x.length,W="",X=0;X<G;){var ue=Ae(x,X);if(ue==="%"){if(Ae(x,X+1)==="%"||X+3>G){W+="%",X++;continue}var de=me(x,X+1);if(de!==de){W+=ue,X++;continue}X+=2;var ye=Fe(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||Ae(x,X)!=="%"));){var Ke=me(x,X+1);if(Ke!==Ke){X+=3;break}if(Ke>191||Ke<128)break;Re(we,Ke),X+=2,Ee++}if(we.length!==ye){W+=J;continue}var dt=M(we);dt===null?W+=J:ue=se(dt)}}W+=ue,X++}return W},fe=/[!'()~]|%20/g,ve={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ge=function(x){return ve[x]},Ze=function(x){return Je(oe(x),fe,ge)},je=h(function(G,W){te(this,{type:Y,target:Q(G).entries,index:0,kind:W})},R,function(){var G=I(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),Be=function(x){this.entries=[],this.url=null,x!==void 0&&(m(x)?this.parseObject(x):this.parseQuery(typeof x=="string"?Ae(x,0)==="?"?yt(x,1):x:b(x)))};Be.prototype={type:R,bindURL:function(x){this.url=x,this.update()},parseObject:function(x){var G=this.entries,W=z(x),X,ue,de,ye,we,Ee,Ke;if(W)for(X=L(x,W),ue=X.next;!(de=a(ue,X)).done;){if(ye=L(y(de.value)),we=ye.next,(Ee=a(we,ye)).done||(Ke=a(we,ye)).done||!a(we,ye).done)throw new he("Expected sequence with length 2");Re(G,{key:b(Ee.value),value:b(Ke.value)})}else for(var dt in x)g(x,dt)&&Re(G,{key:dt,value:b(x[dt])})},parseQuery:function(x){if(x)for(var G=this.entries,W=gt(x,"&"),X=0,ue,de;X<W.length;)ue=W[X++],ue.length&&(de=gt(ue,"="),Re(G,{key:ee(lt(de)),value:ee(Me(de,"="))}))},serialize:function(){for(var x=this.entries,G=[],W=0,X;W<x.length;)X=x[W++],Re(G,Ze(X.key)+"="+Ze(X.value));return Me(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Ue=function(){v(this,Xe);var G=arguments.length>0?arguments[0]:void 0,W=te(this,new Be(G));o||(this.size=W.entries.length)},Xe=Ue.prototype;if(u(Xe,{append:function(G,W){var X=Q(this);ie(arguments.length,2),Re(X.entries,{key:b(G),value:b(W)}),o||this.length++,X.updateURL()},delete:function(x){for(var G=Q(this),W=ie(arguments.length,1),X=G.entries,ue=b(x),de=W<2?void 0:arguments[1],ye=de===void 0?de:b(de),we=0;we<X.length;){var Ee=X[we];if(Ee.key===ue&&(ye===void 0||Ee.value===ye)){if(ft(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=b(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=b(G),ue=[],de=0;de<W.length;de++)W[de].key===X&&Re(ue,W[de].value);return ue},has:function(G){for(var W=Q(this).entries,X=ie(arguments.length,1),ue=b(G),de=X<2?void 0:arguments[1],ye=de===void 0?de:b(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=b(G),we=b(W),Ee=0,Ke;Ee<ue.length;Ee++)Ke=ue[Ee],Ke.key===ye&&(de?ft(ue,Ee--,1):(de=!0,Ke.value=we));de||Re(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=S(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}),c(Xe,N,Xe.entries,{name:"entries"}),c(Xe,"toString",function(){return Q(this).serialize()},{enumerable:!0}),o&&l(Xe,"size",{get:function(){return Q(this).entries.length},configurable:!0,enumerable:!0}),f(Ue,R),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Ue}),!s&&p(F)){var tr=i(V.has),Rr=i(V.set),rr=function(x){if(m(x)){var G=x.body,W;if(w(G)===R)return W=x.headers?new F(x.headers):new F,tr(W,"content-type")||Rr(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),O(x,{body:A(0,b(G)),headers:A(0,W)})}return x};if(p(T)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return T(G,arguments.length>1?rr(arguments[1]):{})}}),p($)){var nr=function(G){return v(this,Z),new $(G,arguments.length>1?rr(arguments[1]):{})};Z.constructor=nr,nr.prototype=Z,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:nr})}}return Wi={URLSearchParams:Ue,getState:Q},Wi}var cl;function Lp(){return cl||(cl=1,Dh()),vc}var ul={},ll;function Np(){if(ll)return ul;ll=1;var t=it(),e=be(),r=kt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),c=e(i.forEach),l=e([].push),u=new a("a=1&a=2&b=3");return u.delete("a",1),u.delete("b",void 0),u+""!="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=[];c(this,function(O,A){l(v,{key:A,value:O})}),n(h,1);for(var p=r(f),g=r(d),S=0,w=0,y=!1,m=v.length,b;S<m;)b=v[S++],y||b.key===p?(y=!0,s(this,b.key)):w++;for(;w<m;)b=v[w++],b.key===p&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),ul}var fl={},dl;function $p(){if(dl)return fl;dl=1;var t=it(),e=be(),r=kt(),n=er(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),c=new a("a=1");return(c.has("a",2)||!c.has("a",void 0))&&t(i,"has",function(u){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,u);var d=o(this,u);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}),fl}var hl={},vl;function xp(){if(vl)return hl;vl=1;var t=De(),e=be(),r=Dn(),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}),hl}var Vi,pl;function Kn(){if(pl)return Vi;pl=1;var t=Se();return Vi=t,Vi}var Ji,ml;function Mh(){if(ml)return Ji;ml=1,Lp(),Np(),$p(),xp();var t=Kn();return Ji=t.URLSearchParams,Ji}var gl={},yl={},wl={},Zi,bl;function Fh(){if(bl)return Zi;bl=1;var t=be(),e=Ts(),r=kt(),n=Un(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(c){return function(l,u){var f=r(n(l)),h=e(u),d=f.length,v,p;return h<0||h>=d?c?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?c?a(f,h):v:c?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Zi={codeAt:s(!1),charAt:s(!0)},Zi}var Sl;function Kh(){if(Sl)return wl;Sl=1;var t=Fh().charAt,e=kt(),r=Sr(),n=$h(),a=qs(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(c){o(this,{type:i,string:e(c),index:0})},function(){var l=s(this),u=l.string,f=l.index,h;return f>=u.length?a(void 0,!0):(h=t(u,f),l.index+=h.length,a(h,!1))}),wl}var Yi,Il;function Dp(){if(Il)return Yi;Il=1;var t=De(),e=be(),r=ze(),n=$e(),a=Th(),i=jh(),o=Rh(),s=qn(),c=vh(),l=Object.assign,u=Object.defineProperty,f=e([].concat);return Yi=!l||n(function(){if(t&&l({b:1},l(u({},"a",{enumerable:!0,get:function(){u(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(g){d[g]=g}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),g=arguments.length,S=1,w=i.f,y=o.f;g>S;)for(var m=c(arguments[S++]),b=w?f(a(m),w(m)):a(m),O=b.length,A=0,L;O>A;)L=b[A++],(!t||r(y,m,L))&&(p[L]=m[L]);return p}:l,Yi}var Xi,Pl;function zh(){if(Pl)return Xi;Pl=1;var t=ze(),e=ct(),r=_s();return Xi=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(c){s=!0,o=c}if(a==="throw")throw i;if(s)throw o;return e(o),i},Xi}var Qi,El;function Mp(){if(El)return Qi;El=1;var t=ct(),e=zh();return Qi=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},Qi}var eo,_l;function Hh(){if(_l)return eo;_l=1;var t=xe(),e=Yr(),r=t("iterator"),n=Array.prototype;return eo=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},eo}var to,Tl;function Bh(){if(Tl)return to;Tl=1;var t=be(),e=$e(),r=Pe(),n=Xr(),a=at(),i=As(),o=function(){},s=a("Reflect","construct"),c=/^\s*(?:class|function)\b/,l=t(c.exec),u=!c.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 u||!!l(c,i(v))}catch{return!0}};return h.sham=!0,to=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,to}var ro,kl;function Fp(){if(kl)return ro;kl=1;var t=De(),e=Tt(),r=Xt();return ro=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},ro}var no,Rl;function Kp(){if(Rl)return no;Rl=1;var t=Pr(),e=ze(),r=qn(),n=Mp(),a=Hh(),i=Bh(),o=ks(),s=Fp(),c=xs(),l=Mn(),u=Array;return no=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,S=g!==void 0;S&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,O,A,L,z;if(w&&!(this===u&&a(w)))for(b=v?new this:[],A=c(d,w),L=A.next;!(O=e(L,A)).done;y++)z=S?n(A,g,[O.value,y],!0):O.value,s(b,y,z);else for(m=o(d),b=v?new this(m):u(m);m>y;y++)z=S?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},no}var ao,Ol;function zp(){if(Ol)return ao;Ol=1;var t=be(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,c=128,l="-",u=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),g=Math.floor,S=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),O=t("".split),A=t("".toLowerCase),L=function(q){for(var D=[],N=0,R=q.length;N<R;){var Y=w(q,N++);if(Y>=55296&&Y<=56319&&N<R){var te=w(q,N++);(te&64512)===56320?m(D,((Y&1023)<<10)+(te&1023)+65536):(m(D,Y),N--)}else m(D,Y)}return D},z=function(q){return q+22+75*(q<26)},B=function(q,D,N){var R=0;for(q=N?g(q/o):q>>1,q+=g(q/D);q>d*a>>1;)q=g(q/d),R+=r;return g(R+(d+1)*q/(q+i))},ie=function(q){var D=[];q=L(q);var N=q.length,R=c,Y=0,te=s,Q,I;for(Q=0;Q<q.length;Q++)I=q[Q],I<128&&m(D,S(I));var T=D.length,$=T;for(T&&m(D,l);$<N;){var F=e;for(Q=0;Q<q.length;Q++)I=q[Q],I>=R&&I<F&&(F=I);var Z=$+1;if(F-R>g((e-Y)/Z))throw new v(h);for(Y+=(F-R)*Z,R=F,Q=0;Q<q.length;Q++){if(I=q[Q],I<R&&++Y>e)throw new v(h);if(I===R){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;m(D,S(z(oe+le%se))),V=g(le/se),he+=r}m(D,S(z(V))),te=B(Y,Z,$===T),Y=0,$++}}Y++,R++}return y(D,"")};return ao=function(q){var D=[],N=O(b(A(q),f,"."),"."),R,Y;for(R=0;R<N.length;R++)Y=N[R],m(D,p(u,Y)?"xn--"+ie(Y):Y);return y(D,".")},ao}var Cl;function Hp(){if(Cl)return yl;Cl=1,Kh();var t=ke(),e=De(),r=xn(),n=Se(),a=Pr(),i=be(),o=it(),s=Dn(),c=Ns(),l=rt(),u=Dp(),f=Kp(),h=Fn(),d=Fh().codeAt,v=zp(),p=kt(),g=Ir(),S=er(),w=Dh(),y=Sr(),m=y.set,b=y.getterFor("URL"),O=w.URLSearchParams,A=w.getState,L=n.URL,z=n.TypeError,B=n.parseInt,ie=Math.floor,q=Math.pow,D=i("".charAt),N=i(/./.exec),R=i([].join),Y=i(1.1.toString),te=i([].pop),Q=i([].push),I=i("".replace),T=i([].shift),$=i("".split),F=i("".slice),Z=i("".toLowerCase),V=i([].unshift),he="Invalid authority",oe="Invalid scheme",le="Invalid host",se="Invalid port",_e=/[a-z]/i,Ae=/[\d+-.a-z]/i,Me=/\d/,Re=/^0x/i,Je=/^[0-7]+$/,lt=/^\d+$/,ft=/^[\da-f]+$/i,gt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,yt=/[\0\t\n\r #/:<>?@[\\\]^|]/,k=/^[\u0000-\u0020]+/,K=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,J=/[\t\n\r]/g,re,me=function(E){var U=$(E,"."),_,P,C,ce,H,Ie,Te;if(U.length&&U[U.length-1]===""&&U.length--,_=U.length,_>4)return E;for(P=[],C=0;C<_;C++){if(ce=U[C],ce==="")return E;if(H=10,ce.length>1&&D(ce,0)==="0"&&(H=N(Re,ce)?16:8,ce=F(ce,H===8?1:2)),ce==="")Ie=0;else{if(!N(H===10?lt:H===8?Je:ft,ce))return E;Ie=B(ce,H)}Q(P,Ie)}for(C=0;C<_;C++)if(Ie=P[C],C===_-1){if(Ie>=q(256,5-_))return null}else if(Ie>255)return null;for(Te=te(P),C=0;C<P.length;C++)Te+=P[C]*q(256,3-C);return Te},Fe=function(E){var U=[0,0,0,0,0,0,0,0],_=0,P=null,C=0,ce,H,Ie,Te,qe,et,j,Oe=function(){return D(E,C)};if(Oe()===":"){if(D(E,1)!==":")return;C+=2,_++,P=_}for(;Oe();){if(_===8)return;if(Oe()===":"){if(P!==null)return;C++,_++,P=_;continue}for(ce=H=0;H<4&&N(ft,Oe());)ce=ce*16+B(Oe(),16),C++,H++;if(Oe()==="."){if(H===0||(C-=H,_>6))return;for(Ie=0;Oe();){if(Te=null,Ie>0)if(Oe()==="."&&Ie<4)C++;else return;if(!N(Me,Oe()))return;for(;N(Me,Oe());){if(qe=B(Oe(),10),Te===null)Te=qe;else{if(Te===0)return;Te=Te*10+qe}if(Te>255)return;C++}U[_]=U[_]*256+Te,Ie++,(Ie===2||Ie===4)&&_++}if(Ie!==4)return;break}else if(Oe()===":"){if(C++,!Oe())return}else if(Oe())return;U[_++]=ce}if(P!==null)for(et=_-P,_=7;_!==0&&et>0;)j=U[_],U[_--]=U[P+et-1],U[P+--et]=j;else if(_!==8)return;return U},M=function(E){for(var U=null,_=1,P=null,C=0,ce=0;ce<8;ce++)E[ce]!==0?(C>_&&(U=P,_=C),P=null,C=0):(P===null&&(P=ce),++C);return C>_?P:U},ee=function(E){var U,_,P,C;if(typeof E=="number"){for(U=[],_=0;_<4;_++)V(U,E%256),E=ie(E/256);return R(U,".")}if(typeof E=="object"){for(U="",P=M(E),_=0;_<8;_++)C&&E[_]===0||(C&&(C=!1),P===_?(U+=_?":":"::",C=!0):(U+=Y(E[_],16),_<7&&(U+=":")));return"["+U+"]"}return E},fe={},ve=u({},fe,{" ":1,'"':1,"<":1,">":1,"`":1}),ge=u({},ve,{"#":1,"?":1,"{":1,"}":1}),Ze=u({},ge,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),je=function(E,U){var _=d(E,0);return _>32&&_<127&&!l(U,E)?E:encodeURIComponent(E)},Be={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Ue=function(E,U){var _;return E.length===2&&N(_e,D(E,0))&&((_=D(E,1))===":"||!U&&_==="|")},Xe=function(E){var U;return E.length>1&&Ue(F(E,0,2))&&(E.length===2||(U=D(E,2))==="/"||U==="\\"||U==="?"||U==="#")},tr=function(E){return E==="."||Z(E)==="%2e"},Rr=function(E){return E=Z(E),E===".."||E==="%2e."||E===".%2e"||E==="%2e%2e"},rr={},nr={},x={},G={},W={},X={},ue={},de={},ye={},we={},Ee={},Ke={},dt={},Qn={},sc={},ea={},ar={},ht={},cc={},Lt={},wt={},ta=function(E,U,_){var P=p(E),C,ce,H;if(U){if(ce=this.parse(P),ce)throw new z(ce);this.searchParams=null}else{if(_!==void 0&&(C=new ta(_,!0)),ce=this.parse(P,null,C),ce)throw new z(ce);H=A(new O),H.bindURL(this),this.searchParams=H}};ta.prototype={type:"URL",parse:function(E,U,_){var P=this,C=U||rr,ce=0,H="",Ie=!1,Te=!1,qe=!1,et,j,Oe,bt;for(E=p(E),U||(P.scheme="",P.username="",P.password="",P.host=null,P.port=null,P.path=[],P.query=null,P.fragment=null,P.cannotBeABaseURL=!1,E=I(E,k,""),E=I(E,K,"$1")),E=I(E,J,""),et=f(E);ce<=et.length;){switch(j=et[ce],C){case rr:if(j&&N(_e,j))H+=Z(j),C=nr;else{if(U)return oe;C=x;continue}break;case nr:if(j&&(N(Ae,j)||j==="+"||j==="-"||j==="."))H+=Z(j);else if(j===":"){if(U&&(P.isSpecial()!==l(Be,H)||H==="file"&&(P.includesCredentials()||P.port!==null)||P.scheme==="file"&&!P.host))return;if(P.scheme=H,U){P.isSpecial()&&Be[P.scheme]===P.port&&(P.port=null);return}H="",P.scheme==="file"?C=Qn:P.isSpecial()&&_&&_.scheme===P.scheme?C=G:P.isSpecial()?C=de:et[ce+1]==="/"?(C=W,ce++):(P.cannotBeABaseURL=!0,Q(P.path,""),C=cc)}else{if(U)return oe;H="",C=x,ce=0;continue}break;case x:if(!_||_.cannotBeABaseURL&&j!=="#")return oe;if(_.cannotBeABaseURL&&j==="#"){P.scheme=_.scheme,P.path=h(_.path),P.query=_.query,P.fragment="",P.cannotBeABaseURL=!0,C=wt;break}C=_.scheme==="file"?Qn:X;continue;case G:if(j==="/"&&et[ce+1]==="/")C=ye,ce++;else{C=X;continue}break;case W:if(j==="/"){C=we;break}else{C=ht;continue}case X:if(P.scheme=_.scheme,j===re)P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query=_.query;else if(j==="/"||j==="\\"&&P.isSpecial())C=ue;else if(j==="?")P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query="",C=Lt;else if(j==="#")P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.query=_.query,P.fragment="",C=wt;else{P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,P.path=h(_.path),P.path.length--,C=ht;continue}break;case ue:if(P.isSpecial()&&(j==="/"||j==="\\"))C=ye;else if(j==="/")C=we;else{P.username=_.username,P.password=_.password,P.host=_.host,P.port=_.port,C=ht;continue}break;case de:if(C=ye,j!=="/"||D(H,ce+1)!=="/")continue;ce++;break;case ye:if(j!=="/"&&j!=="\\"){C=we;continue}break;case we:if(j==="@"){Ie&&(H="%40"+H),Ie=!0,Oe=f(H);for(var ra=0;ra<Oe.length;ra++){var fc=Oe[ra];if(fc===":"&&!qe){qe=!0;continue}var dc=je(fc,Ze);qe?P.password+=dc:P.username+=dc}H=""}else if(j===re||j==="/"||j==="?"||j==="#"||j==="\\"&&P.isSpecial()){if(Ie&&H==="")return he;ce-=f(H).length+1,H="",C=Ee}else H+=j;break;case Ee:case Ke:if(U&&P.scheme==="file"){C=ea;continue}else if(j===":"&&!Te){if(H==="")return le;if(bt=P.parseHost(H),bt)return bt;if(H="",C=dt,U===Ke)return}else if(j===re||j==="/"||j==="?"||j==="#"||j==="\\"&&P.isSpecial()){if(P.isSpecial()&&H==="")return le;if(U&&H===""&&(P.includesCredentials()||P.port!==null))return;if(bt=P.parseHost(H),bt)return bt;if(H="",C=ar,U)return;continue}else j==="["?Te=!0:j==="]"&&(Te=!1),H+=j;break;case dt:if(N(Me,j))H+=j;else if(j===re||j==="/"||j==="?"||j==="#"||j==="\\"&&P.isSpecial()||U){if(H!==""){var na=B(H,10);if(na>65535)return se;P.port=P.isSpecial()&&na===Be[P.scheme]?null:na,H=""}if(U)return;C=ar;continue}else return se;break;case Qn:if(P.scheme="file",j==="/"||j==="\\")C=sc;else if(_&&_.scheme==="file")switch(j){case re:P.host=_.host,P.path=h(_.path),P.query=_.query;break;case"?":P.host=_.host,P.path=h(_.path),P.query="",C=Lt;break;case"#":P.host=_.host,P.path=h(_.path),P.query=_.query,P.fragment="",C=wt;break;default:Xe(R(h(et,ce),""))||(P.host=_.host,P.path=h(_.path),P.shortenPath()),C=ht;continue}else{C=ht;continue}break;case sc:if(j==="/"||j==="\\"){C=ea;break}_&&_.scheme==="file"&&!Xe(R(h(et,ce),""))&&(Ue(_.path[0],!0)?Q(P.path,_.path[0]):P.host=_.host),C=ht;continue;case ea:if(j===re||j==="/"||j==="\\"||j==="?"||j==="#"){if(!U&&Ue(H))C=ht;else if(H===""){if(P.host="",U)return;C=ar}else{if(bt=P.parseHost(H),bt)return bt;if(P.host==="localhost"&&(P.host=""),U)return;H="",C=ar}continue}else H+=j;break;case ar:if(P.isSpecial()){if(C=ht,j!=="/"&&j!=="\\")continue}else if(!U&&j==="?")P.query="",C=Lt;else if(!U&&j==="#")P.fragment="",C=wt;else if(j!==re&&(C=ht,j!=="/"))continue;break;case ht:if(j===re||j==="/"||j==="\\"&&P.isSpecial()||!U&&(j==="?"||j==="#")){if(Rr(H)?(P.shortenPath(),j!=="/"&&!(j==="\\"&&P.isSpecial())&&Q(P.path,"")):tr(H)?j!=="/"&&!(j==="\\"&&P.isSpecial())&&Q(P.path,""):(P.scheme==="file"&&!P.path.length&&Ue(H)&&(P.host&&(P.host=""),H=D(H,0)+":"),Q(P.path,H)),H="",P.scheme==="file"&&(j===re||j==="?"||j==="#"))for(;P.path.length>1&&P.path[0]==="";)T(P.path);j==="?"?(P.query="",C=Lt):j==="#"&&(P.fragment="",C=wt)}else H+=je(j,ge);break;case cc:j==="?"?(P.query="",C=Lt):j==="#"?(P.fragment="",C=wt):j!==re&&(P.path[0]+=je(j,fe));break;case Lt:!U&&j==="#"?(P.fragment="",C=wt):j!==re&&(j==="'"&&P.isSpecial()?P.query+="%27":j==="#"?P.query+="%23":P.query+=je(j,fe));break;case wt:j!==re&&(P.fragment+=je(j,ve));break}ce++}},parseHost:function(E){var U,_,P;if(D(E,0)==="["){if(D(E,E.length-1)!=="]"||(U=Fe(F(E,1,-1)),!U))return le;this.host=U}else if(this.isSpecial()){if(E=v(E),N(gt,E)||(U=me(E),U===null))return le;this.host=U}else{if(N(yt,E))return le;for(U="",_=f(E),P=0;P<_.length;P++)U+=je(_[P],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(Be,this.scheme)},shortenPath:function(){var E=this.path,U=E.length;U&&(this.scheme!=="file"||U!==1||!Ue(E[0],!0))&&E.length--},serialize:function(){var E=this,U=E.scheme,_=E.username,P=E.password,C=E.host,ce=E.port,H=E.path,Ie=E.query,Te=E.fragment,qe=U+":";return C!==null?(qe+="//",E.includesCredentials()&&(qe+=_+(P?":"+P:"")+"@"),qe+=ee(C),ce!==null&&(qe+=":"+ce)):U==="file"&&(qe+="//"),qe+=E.cannotBeABaseURL?H[0]:H.length?"/"+R(H,"/"):"",Ie!==null&&(qe+="?"+Ie),Te!==null&&(qe+="#"+Te),qe},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 ir(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)+":",rr)},getUsername:function(){return this.username},setUsername:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var _=0;_<U.length;_++)this.username+=je(U[_],Ze)}},getPassword:function(){return this.password},setPassword:function(E){var U=f(p(E));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var _=0;_<U.length;_++)this.password+=je(U[_],Ze)}},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,Ke)},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,dt))},getPathname:function(){var E=this.path;return this.cannotBeABaseURL?E[0]:E.length?"/"+R(E,"/"):""},setPathname:function(E){this.cannotBeABaseURL||(this.path=[],this.parse(E,ar))},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,wt)},update:function(){this.query=this.searchParams.serialize()||null}};var ir=function(U){var _=c(this,He),P=S(arguments.length,1)>1?arguments[1]:void 0,C=m(_,new ta(U,!1,P));e||(_.href=C.serialize(),_.origin=C.getOrigin(),_.protocol=C.getProtocol(),_.username=C.getUsername(),_.password=C.getPassword(),_.host=C.getHost(),_.hostname=C.getHostname(),_.port=C.getPort(),_.pathname=C.getPathname(),_.search=C.getSearch(),_.searchParams=C.getSearchParams(),_.hash=C.getHash())},He=ir.prototype,Qe=function(E,U){return{get:function(){return b(this)[E]()},set:U&&function(_){return b(this)[U](_)},configurable:!0,enumerable:!0}};if(e&&(s(He,"href",Qe("serialize","setHref")),s(He,"origin",Qe("getOrigin")),s(He,"protocol",Qe("getProtocol","setProtocol")),s(He,"username",Qe("getUsername","setUsername")),s(He,"password",Qe("getPassword","setPassword")),s(He,"host",Qe("getHost","setHost")),s(He,"hostname",Qe("getHostname","setHostname")),s(He,"port",Qe("getPort","setPort")),s(He,"pathname",Qe("getPathname","setPathname")),s(He,"search",Qe("getSearch","setSearch")),s(He,"searchParams",Qe("getSearchParams")),s(He,"hash",Qe("getHash","setHash"))),o(He,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(He,"toString",function(){return b(this).serialize()},{enumerable:!0}),L){var uc=L.createObjectURL,lc=L.revokeObjectURL;uc&&o(ir,"createObjectURL",a(uc,L)),lc&&o(ir,"revokeObjectURL",a(lc,L))}return g(ir,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:ir}),yl}var Al;function Bp(){return Al||(Al=1,Hp()),gl}var jl={},Ul;function Gp(){if(Ul)return jl;Ul=1;var t=ke(),e=at(),r=$e(),n=er(),a=kt(),i=xn(),o=e("URL"),s=i&&r(function(){o.canParse()}),c=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||c},{canParse:function(u){var f=n(arguments.length,1),h=a(u),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),jl}var ql={},Ll;function Wp(){if(Ll)return ql;Ll=1;var t=ke(),e=at(),r=er(),n=kt(),a=xn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var c=r(arguments.length,1),l=n(s),u=c<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,u)}catch{return null}}}),ql}var Nl={},$l;function Vp(){if($l)return Nl;$l=1;var t=ke(),e=ze();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Nl}var io,xl;function Jp(){if(xl)return io;xl=1,Mh(),Bp(),Gp(),Wp(),Vp();var t=Kn();return io=t.URL,io}var oo,Dl;function Zp(){if(Dl)return oo;Dl=1;var t=Jp();return oo=t,oo}var so,Ml;function Yp(){if(Ml)return so;Ml=1;var t=Zp();return so=t,so}Yp();var Fl={},co,Kl;function Xp(){return Kl||(Kl=1,co={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}),co}var uo,zl;function Qp(){if(zl)return uo;zl=1;var t=Ln(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return uo=r===Object.prototype?void 0:r,uo}var Hl;function Gh(){if(Hl)return Fl;Hl=1;var t=Se(),e=Xp(),r=Qp(),n=Ls(),a=Qt(),i=Ir(),o=xe(),s=o("iterator"),c=n.values,l=function(f,h){if(f){if(f[s]!==c)try{a(f,s,c)}catch{f[s]=c}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 u in e)l(t[u]&&t[u].prototype,u);return l(r,"DOMTokenList"),Fl}var lo,Bl;function em(){if(Bl)return lo;Bl=1;var t=Mh();return Gh(),lo=t,lo}var fo,Gl;function tm(){if(Gl)return fo;Gl=1;var t=em();return fo=t,fo}tm();var Wl={},Vl={},ho,Jl;function rm(){if(Jl)return ho;Jl=1;var t=nt(),e=Qt();return ho=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},ho}var vo,Zl;function nm(){if(Zl)return vo;Zl=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 vo=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},vo}var po,Yl;function am(){if(Yl)return po;Yl=1;var t=$e(),e=Xt();return po=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),po}var mo,Xl;function im(){if(Xl)return mo;Xl=1;var t=Qt(),e=nm(),r=am(),n=Error.captureStackTrace;return mo=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},mo}var go,Ql;function Qr(){if(Ql)return go;Ql=1;var t=Pr(),e=ze(),r=ct(),n=$n(),a=Hh(),i=ks(),o=Nn(),s=xs(),c=Mn(),l=zh(),u=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return go=function(d,v,p){var g=p&&p.that,S=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),O,A,L,z,B,ie,q,D=function(R){return O&&l(O,"normal"),new f(!0,R)},N=function(R){return S?(r(R),m?b(R[0],R[1],D):b(R[0],R[1])):m?b(R,D):b(R)};if(w)O=d.iterator;else if(y)O=d;else{if(A=c(d),!A)throw new u(n(d)+" is not iterable");if(a(A)){for(L=0,z=i(d);z>L;L++)if(B=N(d[L]),B&&o(h,B))return B;return new f(!1)}O=s(d,A)}for(ie=w?d.next:O.next;!(q=e(ie,O)).done;){try{B=N(q.value)}catch(R){l(O,"throw",R)}if(typeof B=="object"&&B&&o(h,B))return B}return new f(!1)},go}var yo,ef;function om(){if(ef)return yo;ef=1;var t=kt();return yo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},yo}var tf;function sm(){if(tf)return Vl;tf=1;var t=ke(),e=Nn(),r=js(),n=Us(),a=Uh(),i=Zr(),o=Qt(),s=Xt(),c=rm(),l=im(),u=Qr(),f=om(),h=xe(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(S,this),O;n?O=n(new v,b?r(this):S):(O=b?this:i(S),o(O,d,"Error")),m!==void 0&&o(O,"message",f(m)),l(O,g,O.stack,1),arguments.length>2&&c(O,arguments[2]);var A=[];return u(y,p,{that:A}),o(O,"errors",A),O};n?n(g,v):a(g,v,{name:!0});var S=g.prototype=i(v.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Vl}var rf;function cm(){return rf||(rf=1,sm()),Wl}var nf={},wo,af;function um(){if(af)return wo;af=1;var t=$s(),e=Xr();return wo=t?{}.toString:function(){return"[object "+e(this)+"]"},wo}var of;function lm(){if(of)return nf;of=1;var t=$s(),e=it(),r=um();return t||e(Object.prototype,"toString",r,{unsafe:!0}),nf}var sf={},cf={},bo,uf;function Wh(){if(uf)return bo;uf=1;var t=Se(),e=Jr(),r=An(),n=function(a){return e.slice(0,a.length)===a};return bo=(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"})(),bo}var So,lf;function Ds(){if(lf)return So;lf=1;var t=Wh();return So=t==="NODE",So}var Io,ff;function fm(){if(ff)return Io;ff=1;var t=at(),e=Dn(),r=xe(),n=De(),a=r("species");return Io=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Io}var Po,df;function dm(){if(df)return Po;df=1;var t=Bh(),e=$n(),r=TypeError;return Po=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Po}var Eo,hf;function Vh(){if(hf)return Eo;hf=1;var t=ct(),e=dm(),r=jn(),n=xe(),a=n("species");return Eo=function(i,o){var s=t(i).constructor,c;return s===void 0||r(c=t(s)[a])?o:e(c)},Eo}var _o,vf;function Jh(){if(vf)return _o;vf=1;var t=Cn(),e=Function.prototype,r=e.apply,n=e.call;return _o=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),_o}var To,pf;function Zh(){if(pf)return To;pf=1;var t=Jr();return To=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),To}var ko,mf;function Yh(){if(mf)return ko;mf=1;var t=Se(),e=Jh(),r=Pr(),n=Pe(),a=rt(),i=$e(),o=kh(),s=Fn(),c=Ln(),l=er(),u=Zh(),f=Ds(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,S=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",O,A,L,z;i(function(){O=t.location});var B=function(N){if(a(m,N)){var R=m[N];delete m[N],R()}},ie=function(N){return function(){B(N)}},q=function(N){B(N.data)},D=function(N){t.postMessage(w(N),O.protocol+"//"+O.host)};return(!h||!d)&&(h=function(R){l(arguments.length,1);var Y=n(R)?R:g(R),te=s(arguments,1);return m[++y]=function(){e(Y,void 0,te)},A(y),y},d=function(R){delete m[R]},f?A=function(N){v.nextTick(ie(N))}:p&&p.now?A=function(N){p.now(ie(N))}:S&&!u?(L=new S,z=L.port2,L.port1.onmessage=q,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&O&&O.protocol!=="file:"&&!i(D)?(A=D,t.addEventListener("message",q,!1)):b in c("script")?A=function(N){o.appendChild(c("script"))[b]=function(){o.removeChild(this),B(N)}}:A=function(N){setTimeout(ie(N),0)}),ko={set:h,clear:d},ko}var Ro,gf;function Xh(){if(gf)return Ro;gf=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}}},Ro=t,Ro}var Oo,yf;function hm(){if(yf)return Oo;yf=1;var t=Jr();return Oo=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Oo}var Co,wf;function vm(){if(wf)return Co;wf=1;var t=Jr();return Co=/web0s(?!.*chrome)/i.test(t),Co}var Ao,bf;function pm(){if(bf)return Ao;bf=1;var t=Se(),e=xh(),r=Pr(),n=Yh().set,a=Xh(),i=Zh(),o=hm(),s=vm(),c=Ds(),l=t.MutationObserver||t.WebKitMutationObserver,u=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,g,S,w;if(!d){var y=new a,m=function(){var b,O;for(c&&(b=f.domain)&&b.exit();O=y.get();)try{O()}catch(A){throw y.head&&v(),A}b&&b.enter()};!i&&!c&&!s&&l&&u?(p=!0,g=u.createTextNode(""),new l(m).observe(g,{characterData:!0}),v=function(){g.data=p=!p}):!o&&h&&h.resolve?(S=h.resolve(void 0),S.constructor=h,w=r(S.then,S),v=function(){w(m)}):c?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(b){y.head||v(),y.add(b)}}return Ao=d,Ao}var jo,Sf;function mm(){return Sf||(Sf=1,jo=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),jo}var Uo,If;function Er(){return If||(If=1,Uo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Uo}var qo,Pf;function _r(){if(Pf)return qo;Pf=1;var t=Se();return qo=t.Promise,qo}var Lo,Ef;function en(){if(Ef)return Lo;Ef=1;var t=Se(),e=_r(),r=Pe(),n=qh(),a=As(),i=xe(),o=Wh(),s=mt(),c=gh(),l=e&&e.prototype,u=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&c===66||s&&!(l.catch&&l.finally))return!0;if(!c||c<51||!/native code/.test(v)){var g=new e(function(y){y(1)}),S=function(y){y(function(){},function(){})},w=g.constructor={};if(w[u]=S,f=g.then(function(){})instanceof S,!f)return!0}return!p&&(o==="BROWSER"||o==="DENO")&&!h});return Lo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},Lo}var No={},_f;function Rt(){if(_f)return No;_f=1;var t=ut(),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 No.f=function(n){return new r(n)},No}var Tf;function gm(){if(Tf)return cf;Tf=1;var t=ke(),e=mt(),r=Ds(),n=Se(),a=Kn(),i=ze(),o=it(),s=Us(),c=Ir(),l=fm(),u=ut(),f=Pe(),h=nt(),d=Ns(),v=Vh(),p=Yh().set,g=pm(),S=mm(),w=Er(),y=Xh(),m=Sr(),b=_r(),O=en(),A=Rt(),L="Promise",z=O.CONSTRUCTOR,B=O.REJECTION_EVENT,ie=O.SUBCLASSING,q=m.getterFor(L),D=m.set,N=b&&b.prototype,R=b,Y=N,te=n.TypeError,Q=n.document,I=n.process,T=A.f,$=T,F=!!(Q&&Q.createEvent&&n.dispatchEvent),Z="unhandledrejection",V="rejectionhandled",he=0,oe=1,le=2,se=1,_e=2,Ae,Me,Re,Je,lt=function(M){var ee;return h(M)&&f(ee=M.then)?ee:!1},ft=function(M,ee){var fe=ee.value,ve=ee.state===oe,ge=ve?M.ok:M.fail,Ze=M.resolve,je=M.reject,Be=M.domain,Ue,Xe,tr;try{ge?(ve||(ee.rejection===_e&&J(ee),ee.rejection=se),ge===!0?Ue=fe:(Be&&Be.enter(),Ue=ge(fe),Be&&(Be.exit(),tr=!0)),Ue===M.promise?je(new te("Promise-chain cycle")):(Xe=lt(Ue))?i(Xe,Ue,Ze,je):Ze(Ue)):je(fe)}catch(Rr){Be&&!tr&&Be.exit(),je(Rr)}},gt=function(M,ee){M.notified||(M.notified=!0,g(function(){for(var fe=M.reactions,ve;ve=fe.get();)ft(ve,M);M.notified=!1,ee&&!M.rejection&&k(M)}))},yt=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&&S("Unhandled promise rejection",fe)},k=function(M){i(p,n,function(){var ee=M.facade,fe=M.value,ve=K(M),ge;if(ve&&(ge=w(function(){r?I.emit("unhandledRejection",fe,ee):yt(Z,ee,fe)}),M.rejection=r||K(M)?_e: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?I.emit("rejectionHandled",ee):yt(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,gt(M,!0))},Fe=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=lt(ee);ve?g(function(){var ge={done:!1};try{i(ve,ee,re(Fe,ge,M),re(me,ge,M))}catch(Ze){me(ge,Ze,M)}}):(M.value=ee,M.state=oe,gt(M,!1))}catch(ge){me({done:!1},ge,M)}}};if(z&&(R=function(ee){d(this,Y),u(ee),i(Ae,this);var fe=q(this);try{ee(re(Fe,fe),re(me,fe))}catch(ve){me(fe,ve)}},Y=R.prototype,Ae=function(ee){D(this,{type:L,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:he,value:null})},Ae.prototype=o(Y,"then",function(ee,fe){var ve=q(this),ge=T(v(this,R));return ve.parent=!0,ge.ok=f(ee)?ee:!0,ge.fail=f(fe)&&fe,ge.domain=r?I.domain:void 0,ve.state===he?ve.reactions.add(ge):g(function(){ft(ge,ve)}),ge.promise}),Me=function(){var M=new Ae,ee=q(M);this.promise=M,this.resolve=re(Fe,ee),this.reject=re(me,ee)},A.f=T=function(M){return M===R||M===Re?new Me(M):$(M)},!e&&f(b)&&N!==Object.prototype)){Je=N.then,ie||o(N,"then",function(ee,fe){var ve=this;return new R(function(ge,Ze){i(Je,ve,ge,Ze)}).then(ee,fe)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,Y)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:R}),Re=a.Promise,c(R,L,!1,!0),l(L),cf}var kf={},$o,Rf;function ym(){if(Rf)return $o;Rf=1;var t=xe(),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 c={};c[e]=function(){return{next:function(){return{done:s=!0}}}},i(c)}catch{}return s},$o}var xo,Of;function zn(){if(Of)return xo;Of=1;var t=_r(),e=ym(),r=en().CONSTRUCTOR;return xo=r||!e(function(n){t.all(n).then(void 0,function(){})}),xo}var Cf;function wm(){if(Cf)return kf;Cf=1;var t=ke(),e=ze(),r=ut(),n=Rt(),a=Er(),i=Qr(),o=zn();return t({target:"Promise",stat:!0,forced:o},{all:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,S=1;i(c,function(w){var y=g++,m=!1;S++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--S||f(p))},h)}),--S||f(p)});return d.error&&h(d.value),u.promise}}),kf}var Af={},jf;function bm(){if(jf)return Af;jf=1;var t=ke(),e=mt(),r=en().CONSTRUCTOR,n=_r(),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 c=a("Promise").prototype.catch;s.catch!==c&&o(s,"catch",c,{unsafe:!0})}return Af}var Uf={},qf;function Sm(){if(qf)return Uf;qf=1;var t=ke(),e=ze(),r=ut(),n=Rt(),a=Er(),i=Qr(),o=zn();return t({target:"Promise",stat:!0,forced:o},{race:function(c){var l=this,u=n.f(l),f=u.reject,h=a(function(){var d=r(l.resolve);i(c,function(v){e(d,l,v).then(u.resolve,f)})});return h.error&&f(h.value),u.promise}}),Uf}var Lf={},Nf;function Im(){if(Nf)return Lf;Nf=1;var t=ke(),e=Rt(),r=en().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}}),Lf}var $f={},Do,xf;function Qh(){if(xf)return Do;xf=1;var t=ct(),e=nt(),r=Rt();return Do=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},Do}var Df;function Pm(){if(Df)return $f;Df=1;var t=ke(),e=at(),r=mt(),n=_r(),a=en().CONSTRUCTOR,i=Qh(),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)}}),$f}var Mf;function Em(){return Mf||(Mf=1,gm(),wm(),bm(),Sm(),Im(),Pm()),sf}var Ff={},Kf;function _m(){if(Kf)return Ff;Kf=1;var t=ke(),e=ze(),r=ut(),n=Rt(),a=Er(),i=Qr(),o=zn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(c){var l=this,u=n.f(l),f=u.resolve,h=u.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,S=1;i(c,function(w){var y=g++,m=!1;S++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--S||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--S||f(p))})}),--S||f(p)});return d.error&&h(d.value),u.promise}}),Ff}var zf={},Hf;function Tm(){if(Hf)return zf;Hf=1;var t=ke(),e=ze(),r=ut(),n=at(),a=Rt(),i=Er(),o=Qr(),s=zn(),c="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(u){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,g=i(function(){var S=r(f.resolve),w=[],y=0,m=1,b=!1;o(u,function(O){var A=y++,L=!1;m++,e(S,f,O).then(function(z){L||b||(b=!0,v(z))},function(z){L||b||(L=!0,w[A]=z,--m||p(new h(w,c)))})}),--m||p(new h(w,c))});return g.error&&p(g.value),d.promise}}),zf}var Bf={},Gf;function ev(){if(Gf)return Bf;Gf=1;var t=ke(),e=Se(),r=Jh(),n=Fn(),a=Rt(),i=ut(),o=Er(),s=e.Promise,c=!1,l=!s||!s.try||o(function(){s.try(function(u){c=u===8},8)}).error||!c;return t({target:"Promise",stat:!0,forced:l},{try:function(u){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(u),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Bf}var Wf={},Vf;function tv(){if(Vf)return Wf;Vf=1;var t=ke(),e=Rt();return t({target:"Promise",stat:!0},{withResolvers:function(){var n=e.f(this);return{promise:n.promise,resolve:n.resolve,reject:n.reject}}}),Wf}var Jf={},Zf;function km(){if(Zf)return Jf;Zf=1;var t=ke(),e=mt(),r=_r(),n=$e(),a=at(),i=Pe(),o=Vh(),s=Qh(),c=it(),l=r&&r.prototype,u=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:u},{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&&c(l,"finally",f,{unsafe:!0})}return Jf}var Mo,Yf;function Rm(){if(Yf)return Mo;Yf=1,cm(),Ls(),lm(),Em(),_m(),Tm(),ev(),tv(),km(),Kh();var t=Kn();return Mo=t.Promise,Mo}var Fo,Xf;function Om(){if(Xf)return Fo;Xf=1;var t=Rm();return Gh(),Fo=t,Fo}var Qf={},ed;function Cm(){return ed||(ed=1,ev()),Qf}var td={},rd;function Am(){return rd||(rd=1,tv()),td}var Ko,nd;function jm(){if(nd)return Ko;nd=1;var t=Om();return Cm(),Am(),Ko=t,Ko}jm();const rv="sesamy-debug";function Um(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 qm(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){Um(rv,t.toString(),1)}function Nm(){return qm(rv)==="true"}function pe(t){Nm()&&console.log(t)}function qt(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 pt(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 Dt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ms(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Fs(t,e){return t(e={exports:{}},e.exports),e.exports}var $t=Fs((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()}}));Ms($t);var $m=Ms(Fs((function(t,e){var r=Dt&&Dt.__awaiter||function(u,f,h,d){return new(h||(h=Promise))((function(v,p){function g(y){try{w(d.next(y))}catch(m){p(m)}}function S(y){try{w(d.throw(y))}catch(m){p(m)}}function w(y){y.done?v(y.value):new h((function(m){m(y.value)})).then(g,S)}w((d=d.apply(u,f||[])).next())}))},n=Dt&&Dt.__generator||function(u,f){var h,d,v,p,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:S(0),throw:S(1),return:S(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function S(w){return function(y){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;g;)try{if(h=1,d&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return g.label++,{value:m[1],done:!1};case 5:g.label++,d=m[1],m=[0];continue;case 7:m=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){g.label=m[1];break}if(m[0]===6&&g.label<v[1]){g.label=v[1],v=m;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(m);break}v[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(u,g)}catch(b){m=[6,b],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=Dt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(u){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(u){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(u){return[2,window.localStorage.clear()]}))}))},removeItem:function(u){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(u,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(u){return window.localStorage.key(u)},getItemSync:function(u){return window.localStorage.getItem(u)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(u){return window.localStorage.removeItem(u)},setItemSync:function(u,f){return window.localStorage.setItem(u,f)}};function s(u){return new Promise((function(f){return setTimeout(f,u)}))}function c(u){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<u;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function u(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+c(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,u.waiters===void 0&&(u.waiters=[])}return u.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,v,p,g,S,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+c(4),v=Date.now()+h,p=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(p)!==null?[3,5]:(S=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:S,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(p))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return u.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+c(4),[3,1];case 8:return[2,!1]}}))}))},u.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,g,S;return n(this,(function(w){switch(w.label){case 0:return[4,$t.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(g=p.getItemSync(f))===null?($t.default().unlock(h),[2]):((S=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(S)),$t.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):($t.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},u.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(),g=!1;function S(){if(g||(window.removeEventListener("storage",S),u.removeFromWaiting(S),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",S),u.addToWaiting(S);var w=setTimeout(S,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},u.addToWaiting=function(f){this.removeFromWaiting(f),u.waiters!==void 0&&u.waiters.push(f)},u.removeFromWaiting=function(f){u.waiters!==void 0&&(u.waiters=u.waiters.filter((function(h){return h!==f})))},u.notifyWaiters=function(){u.waiters!==void 0&&u.waiters.slice().forEach((function(f){return f()}))},u.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()]}}))}))},u.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,v,p;return n(this,(function(g){switch(g.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,$t.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),$t.default().unlock(p.iat),u.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},u.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var g=d.keySync(p);if(g===null)break;v.push(g),p++}for(var S=!1,w=0;w<v.length;w++){var y=v[w];if(y.includes(i)){var m=d.getItemSync(y);if(m!==null){var b=JSON.parse(m);(b.timeRefreshed===void 0&&b.timeAcquired<h||b.timeRefreshed!==void 0&&b.timeRefreshed<h)&&(d.removeItemSync(y),S=!0)}}}S&&u.notifyWaiters()},u.waiters=void 0,u})();e.default=l})));const xm={timeoutInSeconds:60},nv={name:"auth0-spa-js",version:"2.8.0"},av=()=>Date.now();let Ce=class os extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,os.prototype)}static fromPayload({error:e,error_description:r}){return new os(e,r)}},Dm=class iv extends Ce{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,iv.prototype)}},Mm=class ov extends Ce{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,ov.prototype)}},ss=class sv extends Ce{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,sv.prototype)}};class Ks extends ss{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Ks.prototype)}}let Fm=class cv extends Ce{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,cv.prototype)}},Km=class uv extends Ce{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,uv.prototype)}},lv=class fv extends Ce{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${yn(e,["default"])}', scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,fv.prototype)}},zm=class dv extends Ce{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${yn(e,["default"])}', missing scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,dv.prototype)}},hv=class vv extends Ce{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,vv.prototype)}};function yn(t,e=[]){return t&&!e.includes(t)?t:""}const wn=()=>window.crypto,Cr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},zo=t=>btoa(t),Hm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Bm=t=>Object.keys(t).reduce(((e,r)=>{const n=Hm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),cs=t=>{var{clientId:e}=t,r=pt(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()},ad=async t=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),id=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),od=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Gm=new TextEncoder,Wm=new TextDecoder;function Mr(t){return typeof t=="string"?Gm.encode(t):Wm.decode(t)}function sd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Jm(`${t.name} modulusLength must be at least 2048 bits`)}async function Vm(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=`${Fr(Mr(JSON.stringify(t)))}.${Fr(Mr(JSON.stringify(e)))}`;return`${n}.${Fr(await crypto.subtle.sign((function(a){switch(a.algorithm.name){case"ECDSA":return{name:a.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return sd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return sd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Kt})(r),r,Mr(n)))}`}let us;Uint8Array.prototype.toBase64?us=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):us=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 Fr(t){return us(t)}let Kt=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)}},Jm=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 Zm(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Kt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Kt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Kt("unsupported CryptoKey algorithm name")}}function pv(t){return t instanceof CryptoKey}function mv(t){return pv(t)&&t.type==="public"}async function Ym(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!pv(c=o)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!mv(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 Vm({alg:Zm(o),typ:"dpop+jwt",jwk:await gv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Fr(await crypto.subtle.digest("SHA-256",Mr(a))):void 0}),o)}async function gv(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 Xm=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function Qm(){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 Kt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function eg(t){return(async function(e){if(!mv(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 gv(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 Kt("unsupported JWK kty")}return Fr(await crypto.subtle.digest({name:"SHA-256"},Mr(JSON.stringify(n))))})(t.publicKey)}function tg({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 Ym(t,i,r,n,a)}const rg=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},ng=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([rg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ag=async(t,e,r,n,a,i,o,s)=>{return c={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(u,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):u(d.data),h.port1.close()},l.postMessage(c,[h.port2])}));var c,l},ig=async(t,e,r,n,a,i,o=1e4,s)=>a?ag(t,e,r,n,o,a,i,s):ng(t,n,o);async function yv(t,e,r,n,a,i,o,s,c,l){if(c){const y=await c.generateProof({url:t,method:a.method||"GET",nonce:await c.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let u,f=null;for(let y=0;y<3;y++)try{u=await ig(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=u.json,{error:d,error_description:v}=h,p=pt(h,["error","error_description"]),{headers:g,ok:S}=u;let w;if(c&&(w=g["dpop-nonce"],w&&await c.setNonce(w)),!S){const y=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Km(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new lv(r,n);if(d==="use_dpop_nonce"){if(!c||!w||l)throw new hv(w);return yv(t,e,r,n,a,i,o,s,c,!0)}throw new Ce(d||"request_error",y)}return p}async function og(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:c,dpop:l}=t,u=pt(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=u.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=u.grant_type==="refresh_token"&&c,d=Object.assign(Object.assign(Object.assign(Object.assign({},u),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),v=s?cs(d):JSON.stringify(d),p=(g=u.grant_type,Xm.includes(g));var g;return await yv(`${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||nv)))}},e,s,c,p?l:void 0)}const dn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},rn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),dn(n,e)};let It=class ls{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 ls({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new ls({scope:r,audience:n,clientId:a})}},sg=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@@")))}},wv=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)}})()}},cg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||av}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 u=this.matchExistingCacheKey(e,l);if(u&&(o=await this.cache.get(u)),!u&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return o.expiresAt-r<c?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 It({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 It({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 It({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=It.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],c=i.scope&&s.reduce(((l,u)=>l&&o.has(u)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&c}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=It.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)}}}},ug=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 Ar=t=>typeof t=="number",lg=["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"],fg=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,c,l]=o;if(o.length!==3||!s||!c||!l)throw new Error("ID token could not be decoded");const u=JSON.parse(id(c)),f={__raw:i},h={};return Object.keys(u).forEach((d=>{f[d]=u[d],lg.includes(d)||(h[d]=u[d])})),{encoded:{header:s,payload:c,signature:l},header:JSON.parse(id(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&&!Ar(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||!Ar(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Ar(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&&Ar(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&&Ar(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 zt=Fs((function(t,e){var r=Dt&&Dt.__assign||function(){return r=Object.assign||function(c){for(var l,u=1,f=arguments.length;u<f;u++)for(var h in l=arguments[u])Object.prototype.hasOwnProperty.call(l,h)&&(c[h]=l[h]);return c},r.apply(this,arguments)};function n(c,l){if(!l)return"";var u="; "+c;return l===!0?u:u+"="+l}function a(c,l,u){return encodeURIComponent(c).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)})(u)}function i(c){for(var l={},u=c?c.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<u.length;h++){var d=u[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(c,l,u){document.cookie=a(c,l,r({path:"/"},u))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(c){return o()[c]},e.set=s,e.remove=function(c,l){s(c,"",r(r({},l),{expires:-1}))}}));Ms(zt),zt.encode,zt.parse,zt.getAll;var dg=zt.get,bv=zt.set,Sv=zt.remove;const sr={get(t){const e=dg(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),bv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r)}},hg={get(t){return sr.get(t)||sr.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),bv(`_legacy_${t}`,JSON.stringify(e),n),sr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),Sv(t,r),sr.remove(t,e),sr.remove(`_legacy_${t}`,e)}},vg={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 Mt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Mt||(Mt={}));function pg(t,e,r){var n=e===void 0?null:e,a=(function(c,l){var u=atob(c);if(l){for(var f=new Uint8Array(u.length),h=0,d=u.length;h<d;++h)f[h]=u.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return u})(t,r!==void 0&&r),i=a.indexOf(`
2
+ `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var cd,ud,ld,Ho,mg=(cd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ud=null,ld=!1,function(t){return Ho=Ho||pg(cd,ud,ld),new Worker(Ho,t)});const Bo={};let gg=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 yg={memory:()=>new wv().enclosedCache,localstorage:()=>new sg},fd=t=>yg[t],dd=t=>{const{openUrl:e,onRedirect:r}=t,n=pt(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},hd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},Nt={NONCE:"nonce",KEYPAIR:"keypair"};let wg=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)}},bg=class{constructor(e){this.storage=new wg(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 Qm(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return tg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return eg(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var cr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(cr||(cr={}));let Sg=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=cr.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?cr.DPoP:cr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===cr.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 hv(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)}},Ig=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 vd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new vd(r)}},vd=class Iv 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,Iv.prototype)}};const Go=new $m;let Pg=class{constructor(e){let r,n;if(this.userCache=new wv().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const c=Array.from(this.activeLockKeys);for(const l of c)await Go.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(!wn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wn().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",!pd(r))throw new Error(`Invalid cache location "${r}"`);n=pd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?lr:Ig,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(c=>`auth0.${c}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:Pg;var i;this.scope=((c,l,...u)=>{if(typeof c!="object")return{default:mn(l,c,...u)};let f={default:mn(l,...u)};return Object.keys(c).forEach((h=>{const d=c[h];f[h]=mn(l,d,...u)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new yg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||lv,this.cacheManager=new gg(n,n.allKeys?void 0:new Tg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Og(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((c,l)=>c?c.startsWith("https://")?c:`https://${c}/`:`${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 Ag(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 _g)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||uv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${ds(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return bg({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=Wo(qr()),o=Wo(qr()),s=qr(),c=await cd(s),l=ld(c),u=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,g,y,S,b,p,m,w)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),g),{scope:sn(v,g.scope,g.audience),response_type:"code",response_mode:m||"query",state:y,nonce:S,redirect_uri:p||d.authorizationParams.redirect_uri,code_challenge:b,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,u),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 c=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${c},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(((c,l)=>{let u;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",u,!1),l(new Zm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Gs(s.popup)),window.removeEventListener("message",u,!1)}),1e3*(s.timeoutInSeconds||60));u=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",u,!1),s.popup.close(),d.data.response.error)return l(Ce.fromPayload(d.data.response));c(d.data.response)}},window.addEventListener("message",u)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ce("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=md(e),{openUrl:a,fragment:i,appState:o}=n,s=vt(n,["openUrl","fragment","appState"]),c=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=l,f=vt(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Mt.Code}),c&&{organization:c}));const h=i?`${u}#${i}`:u;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 Ce("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===Mt.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 Ce("state_mismatch","Invalid state");const s=r.organization,c=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:c,organization:s}),{appState:r.appState,response_type:Mt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Jm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ce("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ce("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:Mt.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:sn(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 c=Jo[s];return c||(c=o().finally((()=>{delete Jo[s],c=null})),Jo[s]=c),c})((()=>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,c=3)=>{for(let l=0;l<c;l++)if(await s())return!0;return!1})((()=>Zo.acquireLock(a,5e3)),10))throw new fs;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:c,token_type:l,access_token:u,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:c,token_type:l,access_token:u},f?{scope:f}:null),{expires_in:h})}finally{await Zo.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:sn(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({},Wm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new It({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?${ds(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=md(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:c,scope:l,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ce("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((g,y,S=60)=>new Promise(((b,p)=>{const m=window.document.createElement("iframe");m.setAttribute("width","0"),m.setAttribute("height","0"),m.style.display="none";const w=()=>{window.document.body.contains(m)&&(window.document.body.removeChild(m),window.removeEventListener("message",R,!1))};let R;const j=setTimeout((()=>{p(new fs),w()}),1e3*S);R=function(A){if(A.origin!=y||!A.data||A.data.type!=="authorization_response")return;const H=A.source;H&&H.close(),A.data.response.error?p(Ce.fromPayload(A.data.response)):b(A.data.response),clearTimeout(j),window.removeEventListener("message",R,!1),setTimeout(w,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(m),m.setAttribute("src",g)})))(a,h,f);if(i!==d.state)throw new Ce("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:c,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:u})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new It({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 mv(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=((u,f,h,d)=>{var v;if(u&&h&&d){if(f.audience!==h)return f.scope;const g=d.split(" "),y=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],S=y.every((b=>g.includes(b)));return g.length>=y.length&&S?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const u=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(u.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,u.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,c=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==c||!gd(l,s))&&!gd(i,u.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(" ")||[],g=d?.split(" ")||[];return v.filter((y=>g.indexOf(y)==-1)).join(",")})(i,u.scope);throw new Xm(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(u){if((u.message.indexOf("Missing Refresh Token")>-1||u.message&&u.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw u}var o,s,c,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 It({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 It({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:c,expires_in:l}=i,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,token_type:o||"Bearer",access_token:s},c?{scope:c}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await pg(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:sn(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 Cg(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=Wo(qr()),c=qr(),l=await cd(c),u=ld(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:u,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:Mt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Ug(t){const e=new jg(t);return await e.checkSession(),e}var Ve=(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))(Ve||{});const qg="sesamy.com",Lg="sesamy.dev",Ng="https://sesa.my",wd="sesamyCacheTimestamp",bd="sesamyContentReloaded";function Ov(t,e){return`${t}.${e==="dev"?Lg:qg}`}function ht(t,e){return`https://${Ov(t,e)}`}function En(){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",!fd(r))throw new Error(`Invalid cache location "${r}"`);n=fd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?sr:hg,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(c=>`auth0.${c}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:vg;var i;this.scope=((c,l,...u)=>{if(typeof c!="object")return{default:dn(l,c,...u)};let f={default:dn(l,...u)};return Object.keys(c).forEach((h=>{const d=c[h];f[h]=dn(l,d,...u)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new ug(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||av,this.cacheManager=new cg(n,n.allKeys?void 0:new gg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new bg(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((c,l)=>c?c.startsWith("https://")?c:`https://${c}/`:`${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 Ig(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 mg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||nv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${cs(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return fg({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=zo(Cr()),o=zo(Cr()),s=Cr(),c=await ad(s),l=od(c),u=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,S,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:rn(v,p.scope,p.audience),response_type:"code",response_mode:m||"query",state:g,nonce:S,redirect_uri:y||d.authorizationParams.redirect_uri,code_challenge:w,code_challenge_method:"S256",dpop_jkt:b}))(this.options,this.scope,e,i,o,l,e.redirect_uri||this.options.authorizationParams.redirect_uri||n,r?.response_mode,u),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 c=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${c},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(((c,l)=>{let u;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",u,!1),l(new Fm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Ks(s.popup)),window.removeEventListener("message",u,!1)}),1e3*(s.timeoutInSeconds||60));u=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",u,!1),s.popup.close(),d.data.response.error)return l(Ce.fromPayload(d.data.response));c(d.data.response)}},window.addEventListener("message",u)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ce("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=dd(e),{openUrl:a,fragment:i,appState:o}=n,s=pt(n,["openUrl","fragment","appState"]),c=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:u}=l,f=pt(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Mt.Code}),c&&{organization:c}));const h=i?`${u}#${i}`:u;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 Ce("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===Mt.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 Dm(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ce("state_mismatch","Invalid state");const s=r.organization,c=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:c,organization:s}),{appState:r.appState,response_type:Mt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Mm(i,o||i,r.connection,a,r.appState);if(!n)throw new Ce("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ce("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:Mt.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:rn(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 c=Bo[s];return c||(c=o().finally((()=>{delete Bo[s],c=null})),Bo[s]=c),c})((()=>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=pt(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,c=3)=>{for(let l=0;l<c;l++)if(await s())return!0;return!1})((()=>Go.acquireLock(a,5e3)),10))throw new ss;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:c,token_type:l,access_token:u,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:c,token_type:l,access_token:u},f?{scope:f}:null),{expires_in:h})}finally{await Go.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:rn(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({},xm),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new It({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=pt(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${cs(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=dd(e),{openUrl:a}=n,i=pt(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:c,scope:l,audience:u}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ce("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,g,S=60)=>new Promise(((w,y)=>{const m=window.document.createElement("iframe");m.setAttribute("width","0"),m.setAttribute("height","0"),m.style.display="none";const b=()=>{window.document.body.contains(m)&&(window.document.body.removeChild(m),window.removeEventListener("message",O,!1))};let O;const A=setTimeout((()=>{y(new ss),b()}),1e3*S);O=function(L){if(L.origin!=g||!L.data||L.data.type!=="authorization_response")return;const z=L.source;z&&z.close(),L.data.response.error?y(Ce.fromPayload(L.data.response)):w(L.data.response),clearTimeout(A),window.removeEventListener("message",O,!1),setTimeout(b,2e3)},window.addEventListener("message",O,!1),window.document.body.appendChild(m),m.setAttribute("src",p)})))(a,h,f);if(i!==d.state)throw new Ce("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:c,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:u})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new It({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 lv(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=((u,f,h,d)=>{var v;if(u&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],S=g.every((w=>p.includes(w)));return p.length>=g.length&&S?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const u=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(u.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,u.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,c=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==c||!hd(l,s))&&!hd(i,u.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((g=>p.indexOf(g)==-1)).join(",")})(i,u.scope);throw new zm(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},u),{scope:e.authorizationParams.scope,oauthTokenScope:u.scope,audience:e.authorizationParams.audience||"default"})}catch(u){if((u.message.indexOf("Missing Refresh Token")>-1||u.message&&u.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw u}var o,s,c,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=pt(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 It({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 It({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:c,expires_in:l}=i,u=await this._getIdTokenFromCache();return u&&Object.assign(Object.assign({id_token:u.id_token,token_type:o||"Bearer",access_token:s},c?{scope:c}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await og(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:rn(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 Sg(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=zo(Cr()),c=Cr(),l=await ad(c),u=od(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:u,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:c,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:Mt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Eg(t){const e=new Pg(t);return await e.checkSession(),e}var Ve=(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))(Ve||{});const _g="sesamy.com",Tg="sesamy.dev",kg="https://sesa.my",pd="sesamyCacheTimestamp",md="sesamyContentReloaded";function Pv(t,e){return`${t}.${e==="dev"?Tg:_g}`}function vt(t,e){return`https://${Pv(t,e)}`}function bn(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
5
5
  *
6
6
  * detectIncognito v1.6.2
7
7
  *
@@ -31,10 +31,9 @@
31
31
  *
32
32
  * Please keep this comment intact in order to properly abide by the MIT License.
33
33
  *
34
- **/var ps={d:(t,e)=>{for(var r in e)ps.o(e,r)&&!ps.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ws={};ps.d(Ws,{A:()=>$g,k:()=>Vs});var Nr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{c(n.next(l))}catch(u){i(u)}}function s(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){var u;l.done?a(l.value):(u=l.value,u instanceof r?u:new r(function(f){f(u)})).then(o,s)}c((n=n.apply(t,[])).next())})},$r=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(c){return function(l){return(function(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||u[0]!==6&&u[0]!==2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(f){u=[6,f],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}})([c,l])}}};function Vs(){return Nr(this,void 0,Promise,function(){return $r(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 Nr(this,void 0,void 0,function(){var h,d;return $r(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 c(){var h;return Nr(this,void 0,Promise,function(){return $r(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 g=indexedDB.open(v,1);g.onupgradeneeded=function(y){var S=y.target.result,b=function(p){i(p)};try{S.createObjectStore("t",{autoIncrement:!0}).put(new Blob),b(!1)}catch(p){(p instanceof Error&&typeof p.message=="string"?p.message:String(p)).includes("are not yet supported")?b(!0):b(!1)}finally{S.close(),indexedDB.deleteDatabase(v)}},g.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,g=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{g.setItem("test","1"),g.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),g=2*Math.round((function(){var y,S,b,p=window;return(b=(S=(y=p?.performance)===null||y===void 0?void 0:y.memory)===null||S===void 0?void 0:S.jsHeapSizeLimit)!==null&&b!==void 0?b:1073741824})()/1048576);i(v<g)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function u(){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 Nr(this,void 0,Promise,function(){var d,v,g;return $r(this,function(y){switch(y.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];y.label=1;case 1:return y.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return y.sent(),i(!1),[3,4];case 3:return d=y.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:(g=indexedDB.open("inPrivate")).onerror=function(S){g.error&&g.error.name==="InvalidStateError"&&S.preventDefault(),i(!0)},g.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},y.label=6;case 6:return[2]}})})}(function(){return Nr(this,void 0,Promise,function(){return $r(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,c()]);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",u(),[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=Vs);const $g=Vs;Ws.A;const xg=Ws.k,gn="sesamy_incognito_mode";function Js(){try{const t=sessionStorage.getItem(gn);return t===null?void 0:t==="true"}catch{return}}async function Dg(){try{const t=sessionStorage.getItem(gn);if(t!==null)return t==="true";const{isPrivate:e}=await xg();return sessionStorage.setItem(gn,e.toString()),e}catch{try{sessionStorage.setItem(gn,"false")}catch{}return!1}}function Jr(){return typeof window<"u"}function Sd(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 Mg="function",Fg="string",ot="undefined",Kg="boolean",_n="object",Hg="array",zg="number",Bg="symbol",Gg="null",ms=function(){},Cv="any",Av="*",Zt="__",Wg="form",Vg="input",Jg="button",Zg="select",Tn=typeof process!==ot?process:{};Tn.env&&Tn.env.NODE_ENV;var Ne=typeof document!==ot;Tn.versions!=null&&Tn.versions.node!=null;typeof Deno!==ot&&Deno.core;Ne&&window.name==="nodejs"||typeof navigator!==ot&&typeof navigator.userAgent!==ot&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function jv(t,e){return e.charAt(0)[t]()+e.slice(1)}var Yg=jv.bind(null,"toUpperCase"),Xg=jv.bind(null,"toLowerCase");function Qg(t){return Uv(t)?Yg(Gg):typeof t===_n?ny(t):Object.prototype.toString.call(t).slice(8,-1)}function kn(t,e){e===void 0&&(e=!0);var r=Qg(t);return e?Xg(r):r}function on(t,e){return typeof e===t}var We=on.bind(null,Mg),jt=on.bind(null,Fg),dr=on.bind(null,ot),ey=on.bind(null,Kg);on.bind(null,Bg);function Uv(t){return t===null}function ty(t){return kn(t)===zg&&!isNaN(t)}function qv(t){return kn(t)===Hg}function Ge(t){if(!ry(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ry(t){return t&&(typeof t===_n||t!==null)}function ny(t){return We(t.constructor)?t.constructor.name:null}function ay(t){return t instanceof Error||jt(t.message)&&t.constructor&&ty(t.constructor.stackTraceLimit)}function Lv(t,e){if(typeof e!="object"||Uv(e))return!1;if(e instanceof t)return!0;var r=kn(new t(""));if(ay(e))for(;e;){if(kn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Lv.bind(null,TypeError);Lv.bind(null,SyntaxError);function Vn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?iy(t,e):r}function iy(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Jn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Jn(Vn,Wg);Jn(Vn,Jg);Jn(Vn,Vg);Jn(Vn,Zg);function oy(t){return t?qv(t)?t:[t]:[]}function Id(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function sy(){if(Ne){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function cy(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function uy(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Id(r[1]),o=Id(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 c in n){var l=c.split("[");l.length>1&&(ly(n,l.map(function(u){return u.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n})((function(e){return Ne&&window.location.search.substring(1)})())}function ly(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 Zn(){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 fy(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 c=new Date;o||(o=c);var l=e-(c-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=c,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var zt="global",yr=Zt+zt+Zt,wr=typeof self===_n&&self.self===self&&self||typeof global===_n&&global[zt]===global&&global||void 0;function Yt(t){return wr[yr][t]}function Xt(t,e){return wr[yr][t]=e}function Cr(t){delete wr[yr][t]}function Ar(t,e,r){var n;try{if(Zs(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}wr[yr]||(wr[yr]={});var cn={};function Zs(t){if(typeof cn[t]!==ot)return cn[t];try{var e=window[t];e.setItem(ot,ot),e.removeItem(ot)}catch{return cn[t]=!1}return cn[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 Ct="function",Pt="undefined",Gr="reducer",Nv="@@redux/",gs=Nv+"INIT",dy=Nv+Math.random().toString(36),Pd=(function(){return typeof Symbol===Ct&&Symbol.observable||"@@observable"})(),un=" != "+Ct;function $v(t,e,r){var n;if(typeof e===Ct&&typeof r===Pt&&(r=e,e=void 0),typeof r!==Pt){if(typeof r!==Ct)throw new Error("enhancer"+un);return r($v)(t,e)}if(typeof t!==Ct)throw new Error(Gr+un);var a=t,i=e,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){return i}function f(d){if(typeof d!==Ct)throw new Error("Listener"+un);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var g=s.indexOf(d);s.splice(g,1)}}}function h(d){if(!Ge(d))throw new Error("Act != obj");if(typeof d.type===Pt)throw new Error("ActType "+Pt);if(c)throw new Error("Dispatch in "+Gr);try{c=!0,i=a(i,d)}finally{c=!1}for(var v=o=s,g=0;g<v.length;g++)(0,v[g])();return d}return h({type:gs}),(n={dispatch:h,subscribe:f,getState:u,replaceReducer:function(d){if(typeof d!==Ct)throw new Error("next "+Gr+un);a=d,h({type:gs})}})[Pd]=function(){var d,v=f;return(d={subscribe:function(g){if(typeof g!="object")throw new TypeError("Observer != obj");function y(){g.next&&g.next(u())}return y(),{unsubscribe:v(y)}}})[Pd]=function(){return this},d},n}function hy(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Gr+" "+t+" returns "+Pt}function br(){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 vy(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,c={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(c)}),ae({},o,{dispatch:s=br.apply(void 0,i)(o.dispatch)})}}}var Ut=Zt+"anon_id",Bt=Zt+"user_id",vr=Zt+"user_traits",ys="analytics",Ot="userId",hr="anonymousId",yn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ws=["name","EVENTS","config","loaded"],ne=yn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Ed=/^utm_/,_d=/^an_prop_/,Td=/^an_trait_/;function py(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,c=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ut,o.anonymousId),l||e(Bt,o.userId),c.traits&&e(vr,ae({},l&&s.traits?s.traits:{},c.traits));var u=Object.keys(a.params);if(u.length){var f=i.an_uid,h=i.an_event,d=u.reduce(function(v,g){if(g.match(Ed)||g.match(/^(d|g)clid/)){var y=g.replace(Ed,"");v.campaign[y==="campaign"?"name":y]=i[g]}return g.match(_d)&&(v.props[g.replace(_d,"")]=i[g]),g.match(Td)&&(v.traits[g.replace(Td,"")]=i[g]),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 my(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===Bt)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[Bt,Ut,vr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function kd(t){return{userId:t.getItem(Bt),anonymousId:t.getItem(Ut),traits:t.getItem(vr)}}var bs=function(t){return Zt+"TEMP"+Zt+t};function gy(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var c=s.userId,l=s.traits,u=s.options;if(s.type===ne.reset&&([Bt,vr,Ut].forEach(function(d){n(d)}),[Ot,hr,"traits"].forEach(function(d){Cr(bs(d))})),s.type===ne.identify){a(Ut)||r(Ut,Zn());var f=a(Bt),h=a(vr)||{};f&&f!==c&&i.dispatch({type:ne.userIdChanged,old:{userId:f,traits:h},new:{userId:c,traits:l},options:u}),c&&r(Bt,c),l&&r(vr,ae({},h,l))}return o(s)}}}}var Fr={};function Rd(t,e){Fr[t]&&We(Fr[t])&&(Fr[t](e),delete Fr[t])}function xv(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 xv(t,e,r-10).then(n,a)})})}function yy(t){return{abort:t}}function Dv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,c=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,g=a[d][v];if(g&&We(g)){var y,S=(function(m,w){return m===void 0&&(m={}),w===void 0&&(w={}),[Ot,hr].reduce(function(R,j){return m.hasOwnProperty(j)&&w[j]&&w[j]!==m[j]&&(R[j]=w[j]),R},m)})(h.payload,c),b=n[S.meta.rid];if(!b&&(y=g({payload:S,config:o[d].config,instance:r,abort:yy}))&&Ge(y)&&y.abort)return void(n[S.meta.rid]=!0);if(!b){var p=v+":"+d;t.dispatch(ae({},S,{type:p,_:{called:p,from:"queueDrain"}}))}}});var u=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=u}}}var Yo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,c=t.EVENTS;try{var l=a.plugins,u=a.context,f=r.type,h=f.match(pr),d=e.exact.map(function(y){return y.pluginName});h&&(d=o.during.map(function(y){return y.pluginName}));var v=(function(y,S){return function(b,p,m){var w=p.config,R=p.name,j=R+"."+b.type;m&&(j=m.event);var A=b.type.match(pr)?(function(H,B,ie,L,D){return function(N,O){var Y=L?L.name:H,te=O&&Zr(O)?O:ie;if(L&&(!(te=O&&Zr(O)?O:[H]).includes(H)||te.length!==1))throw new Error("Method "+B+" can only abort "+H+" plugin. "+JSON.stringify(te)+" input valid");return ae({},D,{abort:{reason:N,plugins:te,caller:B,_:Y}})}})(R,j,S,m,b):(function(H,B){return function(){throw new Error(H.type+" action not cancellable. Remove abort in "+B)}})(b,j);return{payload:wy(b),instance:y,config:w||{},abort:A}}})(n,d),g=e.exact.reduce(function(y,S){var b=S.pluginName,p=S.methodName,m=!1;return p.match(/^initialize/)||p.match(/^reset/)||(m=!l[b].loaded),u.offline&&p.match(/^(page|track|identify)/)&&(m=!0),y[""+b]=m,y},{});return Promise.resolve(e.exact.reduce(function(y,S,b){var p=S.pluginName;return Promise.resolve(y).then(function(m){function w(){return Promise.resolve(m)}var R=(function(){if(e.namespaced&&e.namespaced[p])return Promise.resolve(e.namespaced[p].reduce(function(j,A,H){return Promise.resolve(j).then(function(B){return A.method&&We(A.method)?((function(N,O){var Y=Ld(N);if(Y&&Y.name===O){var te=Ld(Y.method);throw new Error([O+" plugin is calling method "+N,"Plugins cant call self","Use "+Y.method+" "+(te?"or "+te.method:"")+" in "+O+" plugin insteadof "+N].join(`
35
- `))}})(A.methodName,A.pluginName),Promise.resolve(A.method({payload:B,instance:n,abort:(ie=B,L=p,D=A.pluginName,function(N,O){return ae({},ie,{abort:{reason:N,plugins:O||[L],caller:f,from:D||L}})}),config:Ad(A.pluginName,l,i),plugins:l})).then(function(N){var O=Ge(N)?N:{};return Promise.resolve(ae({},B,O))})):B;var ie,L,D})},Promise.resolve(r))).then(function(j){m[p]=j});m[p]=r})();return R&&R.then?R.then(w):w()})},Promise.resolve({}))).then(function(y){return Promise.resolve(e.exact.reduce(function(S,b,p){try{var m=e.exact.length===p+1,w=b.pluginName,R=i[w];return Promise.resolve(S).then(function(j){var A=y[w]?y[w]:{};if(h&&(A=j),Qo(A,w))return Xo({data:A,method:f,instance:n,pluginName:w,store:s}),Promise.resolve(j);if(Qo(j,w))return m&&Xo({data:j,method:f,instance:n,store:s}),Promise.resolve(j);if(g.hasOwnProperty(w)&&g[w]===!0)return s.dispatch({type:"queue",plugin:w,payload:A,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(j);var H=v(y[w],i[w]);return Promise.resolve(R[f]({abort:H.abort,payload:A,instance:n,config:Ad(w,l,i),plugins:l})).then(function(B){var ie=Ge(B)?B:{},L=ae({},j,ie),D=y[w];if(Qo(D,w))Xo({data:D,method:f,instance:n,pluginName:w,store:s});else{var N=f+":"+w;(N.match(/:/g)||[]).length<2&&!f.match(Od)&&!f.match(Cd)&&n.dispatch(ae({},h?L:A,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(j){return Promise.reject(j)}},Promise.resolve(r))).then(function(S){if(!(f.match(pr)||f.match(/^registerPlugin/)||f.match(Cd)||f.match(Od)||f.match(/^params/)||f.match(/^userIdChanged/))){if(c.plugins.includes(f),S._&&S._.originalAction===f)return S;var b=ae({},S,{_:{originalAction:S.type,called:S.type,from:"engineEnd"}});Mv(S,e.exact.length)&&!f.match(/End$/)&&(b=ae({},b,{type:S.type+"Aborted"})),s.dispatch(b)}return S})})}catch(y){return Promise.reject(y)}},pr=/Start$/,Od=/^bootstrap/,Cd=/^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 Ad(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function jd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Ud(t,e){var r=t.replace(pr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Qo(t,e){var r=t.abort;return!!r&&(r===!0||qd(r,e)||r&&qd(r.plugins,e))}function Mv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||jt(r))return!0;var n=r.plugins;return Zr(r)&&r.length===e||Zr(n)&&n.length===e}function Zr(t){return Array.isArray(t)}function qd(t,e){return!(!t||!Zr(t))&&t.includes(e)}function Ld(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function wy(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ge(t[r])?Object.assign({},t[r]):t[r]),e},{})}function by(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,c=function(m){return s?m:i(f)},l=o.type,u=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===ne.enablePlugin&&a.dispatch({type:ne.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),l===ne.disablePlugin&&setTimeout(function(){return Rd(o.meta.rid,{payload:o})},0),l===ne.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return u.includes(m)}).map(function(m){return h[m]}),g=[],y=[],S=o.disabled,b=v.map(function(m){var w=m.loaded,R=m.name,j=m.config;return xv(m,function(){return w({config:j})},1e4).then(function(A){return n[R]||(a.dispatch({type:ne.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(H){return!ws.includes(H)})}),n[R]=!0),g=g.concat(R),m}).catch(function(A){if(A instanceof Error)throw new Error(A);return y=y.concat(A.name),A})});Promise.all(b).then(function(m){var w={plugins:g,failed:y,disabled:S};setTimeout(function(){d.length===b.length+S.length&&a.dispatch(ae({},{type:ne.ready},w))},0)})}var p=(function(){if(l!==ne.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return Dv(a,e,t)},0),Promise.resolve((function(m,w,R,j,A){try{var H=We(w)?w():w,B=m.type,ie=B.replace(pr,"");if(m._&&m._.called)return Promise.resolve(m);var L=R.getState(),D=(Y=H,(te=L.plugins)===void 0&&(te={}),(Q=m.options)===void 0&&(Q={}),Object.keys(Y).filter(function(I){var T=Q.plugins||{};return ey(T[I])?T[I]:T.all!==!1&&(!te[I]||te[I].enabled!==!1)}).map(function(I){return Y[I]}));B===ne.initializeStart&&m.fromEnable&&(D=Object.keys(L.plugins).filter(function(I){var T=L.plugins[I];return m.plugins.includes(I)&&!T.initialized}).map(function(I){return H[I]}));var N=D.map(function(I){return I.name}),O=(function(I,T){var $=Ud(I).map(function(F){return jd(F,T)});return T.reduce(function(F,Z){var V=Z.name,he=Ud(I,V).map(function(_e){return jd(_e,T)}),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:$[0],beforeNS:{},during:$[1],duringNS:{},after:$[2],afterNS:{}})})(B,D);return Promise.resolve(Yo({action:m,data:{exact:O.before,namespaced:O.beforeNS},state:L,allPlugins:H,allMatches:O,instance:R,store:j,EVENTS:A})).then(function(I){function T(){var Z=(function(){if(B.match(pr))return Promise.resolve(Yo({action:ae({},$,{type:ie+"End"}),data:{exact:O.after,namespaced:O.afterNS},state:L,allPlugins:H,allMatches:O,instance:R,store:j,EVENTS:A})).then(function(V){V.meta&&V.meta.hasCallback&&Rd(V.meta.rid,{payload:V})})})();return Z&&Z.then?Z.then(function(){return I}):I}if(Mv(I,N.length))return I;var $,F=(function(){if(B!==ie)return Promise.resolve(Yo({action:ae({},I,{type:ie}),data:{exact:O.during,namespaced:O.duringNS},state:L,allPlugins:H,allMatches:O,instance:R,store:j,EVENTS:A})).then(function(Z){$=Z});$=I})();return F&&F.then?F.then(T):T()})}catch(I){return Promise.reject(I)}var Y,te,Q})(o,e,t,a,r)).then(function(m){var w=i(m);return s=1,w})})();return Promise.resolve(p&&p.then?p.then(c):c(p))}catch(m){return Promise.reject(m)}}}}}function Sy(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 Iy=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 br.apply(void 0,o)(n)(a)}}}}};function Py(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=Nd(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 c=Nd(r.type,ne.initialize),l=t()[c];return l&&c?(n[c]=ae({},e[c],{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,$d(r.plugins,!1,e));case ne.enablePlugin:return ae({},e,$d(r.plugins,!0,e));default:return e}}}function Nd(t,e){return t.substring(e.length+1,t.length)}function $d(t,e,r){return t.reduce(function(n,a){return n[a]=ae({},r[a],{enabled:e}),n},r)}function Fv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Ey={last:{},history:[]};function _y(t,e){t===void 0&&(t=Ey);var r=e.options,n=e.meta;if(e.type===ne.track){var a=Fv(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 Ty={actions:[]};function ky(t,e){t===void 0&&(t=Ty);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 Kv=/#.*$/;function Ry(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(Kv,""):"")}var Hv,zv,Bv,Gv,Oy=function(t){if(t===void 0&&(t={}),!Ne)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,c=i.hash,l=i.search,u=(function(h){var d=(function(){if(Ne){for(var v,g=document.getElementsByTagName("link"),y=0;v=g[y];y++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(Kv,"")})(l),f={title:r,url:u,path:Ry(u),hash:c,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ae({},f,t)},Cy={last:{},history:[]};function Ay(t,e){t===void 0&&(t=Cy);var r=e.options;if(e.type===ne.page){var n=Fv(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}Hv=(function(){if(!Ne)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"})(),zv=Ne?document.referrer:null,Bv=sy(),Gv=cy();var xd={initialized:!1,sessionId:Zn(),app:null,version:null,debug:!1,offline:!!Ne&&!navigator.onLine,os:{name:Hv},userAgent:Ne?navigator.userAgent:"node",library:{name:ys,version:"0.13.1"},timezone:Gv,locale:Bv,campaign:{},referrer:zv};function jy(t,e){t===void 0&&(t=xd);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({},xd,t,{initialized:!0})}}var Uy=["plugins","reducers","storage"];function qy(t,e,r){if(Ne){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Ly(t){var e=qy.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Wv(){return Xt(ys,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return wr[yr][ys].push(o.action||o),i(o)}})}}}function Dd(t){return function(){return br(br.apply(null,arguments),Wv())}}function es(t){return t?qv(t)?t:[t]:[]}function Md(t,e,r){t===void 0&&(t={});var n,a,i=Zn();return e&&(Fr[i]=(n=e,a=(function(o){for(var s,c=o||Array.prototype.slice.call(arguments),l=0;l<c.length;l++)if(We(c[l])){s=c[l];break}return s})(r),function(o){a&&a(o),n(o)})),ae({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Ny(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,T){if(We(T))return I.middlewares=I.middlewares.concat(T),I;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var $=T.EVENTS?Object.keys(T.EVENTS).map(function(V){return T.EVENTS[V]}):[];I.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(I.methods[T.name]=Object.keys(T.methods).reduce(function(V,he){var oe;return V[he]=(oe=T.methods[he],function(){for(var le=Array.prototype.slice.call(arguments),se=new Array(oe.length),_e=0;_e<le.length;_e++)se[_e]=le[_e];return se[se.length]=w,oe.apply({instance:w},se)}),V},{}),delete T.methods);var F=Object.keys(T).concat($),Z=new Set(I.events.concat(F));if(I.events=Array.from(Z),I.pluginsArray=I.pluginsArray.concat(T),I.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return I.plugins[T.name]=T,I.plugins[T.name].loaded||(I.plugins[T.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Yt,setItem:Xt,removeItem:Cr},i=(function(I){return function(T,$,F){return $.getState("user")[T]||(F&&Ge(F)&&F[T]?F[T]:kd(I)[T]||Yt(bs(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ws.includes(I)}).sort(),c=new Set(s.concat(yn).filter(function(I){return!ws.includes(I)})),l=Array.from(c).sort(),u=function(){return o},f=new Iy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,g=function(){throw new Error("Abort disabled inListener")},y=uy(),S=kd(a),b=ae({},S,r,y.an_uid?{userId:y.an_uid}:{},y.an_aid?{anonymousId:y.an_aid}:{});b.anonymousId||(b.anonymousId=Zn());var p=ae({enable:function(I,T){return new Promise(function($){O.dispatch({type:ne.enablePlugin,plugins:es(I),_:{originalAction:ne.enablePlugin}},$,[T])})},disable:function(I,T){return new Promise(function($){O.dispatch({type:ne.disablePlugin,plugins:es(I),_:{originalAction:ne.disablePlugin}},$,[T])})}},n.methods),m=!1,w={identify:function(I,T,$,F){try{var Z=jt(I)?I:null,V=Ge(I)?I:T,he=$||{},oe=w.user();Xt(bs(Ot),Z);var le=Z||V.userId||i(Ot,w,V);return Promise.resolve(new Promise(function(se){O.dispatch(ae({type:ne.identifyStart,userId:le,traits:V||{},options:he,anonymousId:oe.anonymousId},oe.id&&oe.id!==Z&&{previousId:oe.id}),se,[T,$,F])}))}catch(se){return Promise.reject(se)}},track:function(I,T,$,F){try{var Z=Ge(I)?I.event:I;if(!Z||!jt(Z))throw new Error("EventMissing");var V=Ge(I)?I:T||{},he=Ge($)?$:{};return Promise.resolve(new Promise(function(oe){O.dispatch({type:ne.trackStart,event:Z,properties:V,options:he,userId:i(Ot,w,T),anonymousId:i(hr,w,T)},oe,[T,$,F])}))}catch(oe){return Promise.reject(oe)}},page:function(I,T,$){try{var F=Ge(I)?I:{},Z=Ge(T)?T:{};return Promise.resolve(new Promise(function(V){O.dispatch({type:ne.pageStart,properties:Oy(F),options:Z,userId:i(Ot,w,F),anonymousId:i(hr,w,F)},V,[I,T,$])}))}catch(V){return Promise.reject(V)}},user:function(I){if(I===Ot||I==="id")return i(Ot,w);if(I===hr||I==="anonId")return i(hr,w);var T=w.getState("user");return I?Sd(T,I):T},reset:function(I){return new Promise(function(T){O.dispatch({type:ne.resetStart},T,I)})},ready:function(I){return m&&I({plugins:p,instance:w}),w.on(ne.ready,function(T){I&&I(T),m=!0})},on:function(I,T){if(!I||!We(T))return!1;if(I===ne.bootstrap)throw new Error(".on disabled for "+I);var $=/Start$|Start:/;if(I==="*"){var F=function(oe){return function(le){return function(se){return se.type.match($)&&T({payload:se,instance:w,plugins:o}),le(se)}}},Z=function(oe){return function(le){return function(se){return se.type.match($)||T({payload:se,instance:w,plugins:o}),le(se)}}};return h(F,ln),h(Z,fn),function(){d(F,ln),d(Z,fn)}}var V=I.match($)?ln:fn,he=function(oe){return function(le){return function(se){return se.type===I&&T({payload:se,instance:w,plugins:o,abort:g}),le(se)}}};return h(he,V),function(){return d(he,V)}},once:function(I,T){if(!I||!We(T))return!1;if(I===ne.bootstrap)throw new Error(".once disabled for "+I);var $=w.on(I,function(F){T({payload:F.payload,instance:w,plugins:o,abort:g}),$()});return $},getState:function(I){var T=O.getState();return I?Sd(T,I):Object.assign({},T)},dispatch:function(I){var T=jt(I)?{type:I}:I;if(yn.includes(T.type))throw new Error("reserved action "+T.type);var $=ae({},T,{_:ae({originalAction:T.type},I._||{})});O.dispatch($)},enablePlugin:p.enable,disablePlugin:p.disable,plugins:p,storage:{getItem:a.getItem,setItem:function(I,T,$){O.dispatch({type:ne.setItemStart,key:I,value:T,options:$})},removeItem:function(I,T){O.dispatch({type:ne.removeItemStart,key:I,options:T})}},setAnonymousId:function(I,T){w.storage.setItem(Ut,I,T)},events:{core:yn,plugins:s}},R=n.middlewares.concat([function(I){return function(T){return function($){return $.meta||($.meta=Md()),T($)}}},v(ln),by(w,u,{all:l,plugins:s}),Sy(a),py(w),gy(w),v(fn)]),j={context:jy,user:my(a),page:Ay,track:_y,plugins:Py(u),queue:ky},A=br,H=br;if(Ne&&t.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(A=B({trace:!0,traceLimit:25})),H=function(){return arguments.length===0?Wv():Ge(typeof arguments[0])?Dd():Dd().apply(null,arguments)}}var ie,L=(function(I){return Object.keys(I).reduce(function(T,$){return Uy.includes($)||(T[$]=I[$]),T},{})})(t),D=n.pluginsArray.reduce(function(I,T){var $=T.name,F=T.config,Z=T.loaded,V=n.pluginEnabled[$];return I[$]={enabled:V,initialized:!!V&&!T.initialize,loaded:!!Z({config:F}),config:F},I},{}),N={context:L,user:b,plugins:D},O=$v((function(I){for(var T=Object.keys(I),$={},F=0;F<T.length;F++){var Z=T[F];typeof I[Z]===Ct&&($[Z]=I[Z])}var V,he=Object.keys($);try{(function(oe){Object.keys(oe).forEach(function(le){var se=oe[le];if(typeof se(void 0,{type:gs})===Pt||typeof se(void 0,{type:dy})===Pt)throw new Error(Gr+" "+le+" "+Pt)})})($)}catch(oe){V=oe}return function(oe,le){if(oe===void 0&&(oe={}),V)throw V;for(var se=!1,_e={},Ae=0;Ae<he.length;Ae++){var Me=he[Ae],Re=oe[Me],Je=(0,$[Me])(Re,le);if(typeof Je===Pt){var ut=hy(Me,le);throw new Error(ut)}_e[Me]=Je,se=se||Je!==Re}return se?_e:oe}})(ae({},j,e)),N,H(A(vy.apply(void 0,R))));O.dispatch=(ie=O.dispatch,function(I,T,$){var F=ae({},I,{meta:Md(I.meta,T,es($))});return ie.apply(null,[F])});var Y=Object.keys(o);O.dispatch({type:ne.bootstrap,plugins:Y,config:L,params:y,user:b,initialUser:r,persistedUser:S});var te=Y.filter(function(I){return n.pluginEnabled[I]}),Q=Y.filter(function(I){return!n.pluginEnabled[I]});return O.dispatch({type:ne.registerPlugins,plugins:Y,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,T){var $=I.bootstrap,F=I.config,Z=I.name;$&&We($)&&$({instance:w,config:F,payload:I}),O.dispatch({type:ne.registerPluginType(Z),name:Z,enabled:n.pluginEnabled[Z],plugin:I}),n.pluginsArray.length===T+1&&O.dispatch({type:ne.initializeStart,plugins:te,disabled:Q})}),Ly(function(I){O.dispatch({type:I?ne.offline:ne.online})}),(function(I,T,$){setInterval(function(){return Dv(I,T,$)},3e3)})(O,u,w),w}var ln="before",fn="after",Gt="cookie",Ft=Zv(),Vv=Yn,$y=Yn;function Jv(t){return Ft?Yn(t,"",-1):Cr(t)}function Zv(){if(Ft!==void 0)return Ft;var t=Gt+Gt;try{Yn(t,t),Ft=document.cookie.indexOf(t)!==-1,Jv(t)}catch{Ft=!1}return Ft}function Yn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ft===!1&&(o?Xt(t,e):Yt(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 Et="localStorage",xy=Zs.bind(null,Et);Ar(Et,"getItem",Yt);Ar(Et,"setItem",Xt);Ar(Et,"removeItem",Cr);var _t="sessionStorage",Dy=Zs.bind(null,_t);Ar(_t,"getItem",Yt);Ar(_t,"setItem",Xt);Ar(_t,"removeItem",Cr);function mr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ge(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var My=xy(),Fy=Dy(),Ky=Zv();function Wt(t,e){if(t){var r=Ys(e),n=!tc(r),a=Xs(r)?mr(localStorage.getItem(t)):void 0;if(n&&!dr(a))return a;var i=Qs(r)?mr(Vv(t)):void 0;if(n&&i)return i;var o=ec(r)?mr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Yt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function Rn(t,e,r){if(t&&!dr(e)){var n={},a=Ys(r),i=JSON.stringify(e),o=!tc(a);return Xs(a)&&(n[Et]=dn(Et,e,mr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[Et]:Qs(a)&&(n[Gt]=dn(Gt,e,mr(Vv(t))),$y(t,i),o)?n[Gt]:ec(a)&&(n[_t]=dn(_t,e,mr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[_t]:(n[zt]=dn(zt,e,Yt(t)),Xt(t,e),o?n[zt]:n)}}function Hy(t,e){if(t){var r=Ys(e),n=Wt(t,Av),a={};return!dr(n.localStorage)&&Xs(r)&&(localStorage.removeItem(t),a[Et]=n.localStorage),!dr(n.cookie)&&Qs(r)&&(Jv(t),a[Gt]=n.cookie),!dr(n.sessionStorage)&&ec(r)&&(sessionStorage.removeItem(t),a[_t]=n.sessionStorage),!dr(n.global)&&Xn(r,zt)&&(Cr(t),a[zt]=n.global),a}}function Ys(t){return t?jt(t)?t:t.storage:Cv}function Xs(t){return My&&Xn(t,Et)}function Qs(t){return Ky&&Xn(t,Gt)}function ec(t){return Fy&&Xn(t,_t)}function tc(t){return t===Av||t==="all"}function Xn(t,e){return t===Cv||t===e||tc(t)}function dn(t,e,r){return{location:t,current:e,previous:r}}var zy={setItem:Rn,getItem:Wt,removeItem:Hy};function By(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fd(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 Kd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Fd(Object(r),!0).forEach(function(n){By(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Fd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Gy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:zy};return Ny(Kd(Kd({},e),t))}const rc="@sesamy/sesamy-js",Qn="1.45.0";function Wy(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(...c){const l=c[2]?.toString()||"",u=Jy(l);return a!==u&&(a=u,setTimeout(()=>t(l),0)),s.apply(r,c)}})}function Vy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Jy(t){return["#","?"].forEach(e=>t=Vy(t,e)),t}function Zy(){Wy(()=>{St.page()})}var ts="up",rs="down";function Yy(t){if(t===void 0&&(t={}),!Ne)return ms;var e=zd(),r=Ss(),n=Hd(),a=hn(n,e),i=hn(r,e),o=[],s=[],c=[],l=n,u=a,f=i,h=Object.keys(t);if(!h.length)return ms;var d=h.map(function(g){return Number(g)}),v=fy(function(){var g=zd(),y=(function(L,D){return D.map(function(N){return N===100?L-5:L*(N/100)})})(g,d),S=Ss(),b=Hd(),p=hn(b,g),m=hn(S,g);if(u=p>u?p:u,f=m<f?m:f,!(o.length>=d.length)){var w=l===b,R=ts;w?R="initial":l<=b&&(R=rs);var j=y,A=d;(R===ts||w)&&(j=y.slice().reverse(),A=d.slice().reverse());var H=A.reduce(function(L,D,N){var O=j[N];return c.includes(D)&&b<=O&&(c=c.filter(function(Y){return Y!==D}),L.singleFunction=D),R===rs&&!o.includes(D)&&b>=O&&D>i?(s.push(D),L.callbacks=L.callbacks.concat(D),L):R===ts&&!o.includes(D)&&b<=O&&D<=p?(L.foundFunc=[D],L):(w&&b>=O&&L.foundFunc.length===0&&(L.foundFunc=[D]),!s.includes(D)&&b>=O&&(s.push(D),L.singleFunction?c.push(D):L.singleFunction=D),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=b,R===rs&&H.callbacks&&H.callbacks.forEach(function(L){We(t[L])&&(t[L]({trigger:L,direction:R,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(L))}),H.singleFunction){var B=H.singleFunction,ie=H.direction;We(t[B])&&t[B]({trigger:B,direction:ie,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(B)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function Ss(){return Ne?document.body.scrollTop||document.documentElement.scrollTop:0}function Xy(){return Ne?window.innerHeight||document.documentElement.clientHeight:0}function Hd(){return Math.round(Ss()+Xy())}function zd(){if(!Ne)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function hn(t,e){return Math.round(t/e*100)}var nc="Event",Bd=nc+"Listener";function Qy(t){return function(e,r,n,a){var i=n||ms,o=a||!1;if(!Ne)return i;var s=On(r),c=On(e,!0);if(!c.length)throw new Error("noElements");if(!s.length)throw new Error("no"+nc);var l=[];return(function u(f){f&&(l=[]);for(var h=f?"add"+Bd:"remove"+Bd,d=0;d<c.length;d++){var v=c[d];l[d]=f?o&&o.once?ew(i):i:l[d]||i;for(var g=0;g<s.length;g++)v[h]?v["on"+s[g]]=f?l[d]:null:v[h](s[g],l[d],o)}return u.bind(null,!f)})(t)}}function On(t,e){if(jt(t))return e?On(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=oy(t);return e?i.map(function(o){return jt(o)?On(o,!0):o}).flat():i}function ew(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var ns=Qy(nc);function Yv(t,e){return Ne&&We(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),We(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}Yv.bind(null,"onerror");Yv.bind(null,"onload");var Xv=typeof window>"u",Gd="hidden";function tw(t){if(Xv)return!1;var e=rw(),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 rw(){var t=["webkit","moz","ms","o"];return Xv||Gd in document?Gd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var nw=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function aw(t,e){e===void 0&&(e={});var r=(function(o,s){var c=this,l=!1;return function(u){l||(o.call(c,u),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=tw(function(s){s||r({type:"tabVisible"})});return n=[o].concat(nw.map(function(s){return ns(document,s,r)})).concat(ns(window,"load",r)).concat(ns(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function iw(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,c=t.throttle,l=c===void 0?2e3:c,u=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(y){d(),i&&!u&&i(xr(h),y),a&&u&&(u=!1,a(xr(r),y),h=new Date),e=setTimeout(function(){u=!0,n&&(r=new Date,n(xr(h),y))},s)}var g=aw(v,{throttle:l});return{disable:function(){f=!0,u=!1,d();var y=g();return function(){return f=!1,h=new Date,v({type:"load"}),y()}},getStatus:function(){return{isIdle:u,isDisabled:f,active:u?0:xr(h,f),idle:u?xr(r,f):0}}}}function xr(t,e){return e?0:Math.round((new Date-t)/1e3)}const Wd=5e3;class ow{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),iw({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Wd}),Yy({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*Wd: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 Qv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function sw(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(c){return n=a.push(c),n>=i&&o(),n},size:function(){return a.length},end:function(c){c&&o(),clearInterval(r)}}}const Vd="sesamy_session_id";function cw(){let t=sessionStorage.getItem(Vd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Vd,t)),t}function ep(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),c=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${c})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}let Ye={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"}},tp=[],wn;function rp(){const t=window.location.pathname;return tp.find(e=>e.path?t.includes(e.path):!0)}function uw(t,e){tp=t.content||[];const r=rp();r&&r.type==="article"&&(Ye={...Ye,...r.selectors}),wn=e}function lw(t,e){const{selector:r}=e;return r===Ye.article.selector?t:t.querySelector(r)}function np(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??np(t.parentElement,e):t.textContent??void 0}function gr(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 ap({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||gr(`sesamy:${e}`)||gr(`og:${e}`)||gr(e)||r}function fw(){const t=document.querySelectorAll(Ye.article.selector);return Array.from(t).map(ac).filter(e=>e!==null)}function ac(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:ep(e)},n=(i,o,s,c)=>{const l=lw(e,o);if(l){const u=np(l,o)||ap({publisherContentId:s,key:i});u!==void 0&&(r[i]=c?c(u):u)}};n("id",Ye.id),n("title",Ye.title,r.id),n("excerpt",Ye.excerpt,r.id),n("image",Ye.image,r.id),n("price",Ye.price,r.id,i=>parseFloat(i)),n("currency",Ye.currency,r.id),n("url",Ye.url,r.id),n("pass",Ye.pass,r.id),n("accessLevel",Ye.accessLevel,r.id,i=>i||"entitlement");const a=rp();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 dw(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=ac(r);if(!n?.url)throw new Error("Could not find content for element");const a=await wn.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await wn.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||ep(r.parentElement||r);return wn.proxy.getContent(i.token,n.url,o)}let ip=!1,bn,Cn,Is;function op(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:Is,requestId:Math.random().toString(36).slice(2,9),sessionId:cw(),timestamp:new Date().toISOString(),version:Qn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:gr("sesamy:item-src"),publisherContentId:gr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:rc,userAgent:navigator.userAgent,clientId:Is}}}))}const sp=sw(async t=>{if(t.length>0){const e=op(t);ip?navigator.sendBeacon(Cn,e):(await fetch(Cn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function as(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Cn,op([e]))}else sp.push(t)}function hw(){return ip=!0,sp.flush()}function vw(t,e,r){bn=e,Cn=`${ht("logs",r)}/events`,Is=t}const pw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;as({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;as({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n}=t;as({anonymousId:r,userId:n,properties:e,type:"identify"})}},Jd=["source","medium","campaign","term","content"],At="utm_",mw=1800*1e3;function cp(t){return t?Date.now()-parseInt(t,10)>mw:!0}function Zd(){const t=document.referrer||"";if(!t)return;const e=Wt(`${At}set_at`);(cp(e)||!Wt(`${At}referrer`))&&Rn(`${At}referrer`,t)}function gw(){const t=()=>{const r={};for(const a of Jd){const i=Wt(`${At}${a}`);i&&(r[`utm_${a}`]=i)}const n=Wt(`${At}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Zd()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${At}set_at`);if(Object.keys(n).length>0&&cp(a)){for(const o of Jd){const s=n[o];s&&Rn(`${At}${o}`,s)}Rn(`${At}set_at`,String(Date.now()))}Zd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const yw=gw(),Yd=new Map,Xd=new Map;function ww({clientId:t,enabled:e=!0,environment:r}){vw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Xd.forEach((n,a)=>{n.bind(a)()}),hw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Yd.forEach((n,a)=>{n.bind(a)()})}),Zy(),Qv(()=>{const n=new ow({element:document.body,viewCallback:()=>{St.page()},activeDurationCallback:(a,i,o)=>{St.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{St.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{St.track("scroll",{scroll:a.scrollMax})}});Xd.set(document.body,()=>{n.flush()}),Yd.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Ve.AUTHENTICATED,async n=>{const a=n;await St.identify(a.detail.sub)}),window.addEventListener(Ve.LOGOUT,async()=>{await St.track("logout",{}),await St.reset()}))}const St=Gy({app:rc,version:Qn,plugins:[yw,pw]});function up(t,e){St.track(t,e)}function lp(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});up(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function bw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function Sw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Iw(){return/android/i.test(navigator.userAgent)}let Le,fp,Wr,Ps=!1,Sn=!1;Jr()&&window.addEventListener("pageshow",()=>{Sn=!1});const Sr="sesamyAccessToken",is="sesamyRefreshToken",An="sesamySilentAuthThrottle",Pw=300*1e3;async function ea(){return Ps?!0:new Promise((t,e)=>{const r=setTimeout(()=>{Ps?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Ve.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Ew(t){if(!t)return null;const e=localStorage.getItem(is);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(is),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(is,i.refresh_token),localStorage.setItem(Sr,i.access_token),i.access_token}catch{sc()}}async function ic(){const t=localStorage.getItem(Sr);if(!t)return null;const e=cc(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Ew(e);if(r)return r;localStorage.removeItem(Sr)}return t}let vn=null;const _w=64;function Tw(){try{if(vn!==null)return vn;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===_w)return vn=!0,!0}}catch(t){pe(`Error checking for existing auth0 tokens: ${t.message}`)}return vn=!1,!1}function kw(t){if(t.domains&&t.domains.length>0){const e=Ir(window.location.href);if(e){for(const r of t.domains)if(Ir(`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 Ir(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 Rw(t){if(t.enabled===!1)return;fp=t.organization;const e=kw(t);Wr=e&&!Tw()?e:Ov("token",t.environment);const r={domain:Wr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",Ir(window.location.href)!==Ir(`https://${Wr}`)&&(r.useRefreshTokens=!0),pe(`Initializing auth0 client: ${JSON.stringify(r)}`),Le=await Ug(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 c=await Le.handleRedirectCallback();pe(`Login result: ${JSON.stringify(c)}`);const l=await Le.getUser();if(!l)throw pe("No user found"),new Error("No user found");pe(`User found ${JSON.stringify(l)}`),oc(),qt(Ve.AUTHENTICATED,l),pe("Rewrite url")}catch(c){alert("There was an error logging in"),console.error(c)}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())}Ps=!0,qt(Ve.AUTH_INITIALIZED,{})}async function Yr(){return await ea(),await ic()?!0:Le?Le.isAuthenticated():!1}async function Ow(){return await ea(),await ic()?(pe("Using local user"),{sub:"local",name:"Local User"}):Le?Le.getUser():null}function dp(t){if(Sn)return pe("Login already in progress"),null;if(Sn=!0,setTimeout(()=>{Sn=!1},3e3),localStorage.removeItem(Sr),!Le)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:fp,redirect_uri:window.location.href,ui_locales:En(),incognito:Js(),...e}}}async function ta(t){const e=dp(t);if(e)return Le.loginWithRedirect(e)}async function hp(t){const e=dp(t);if(!e)return;await Le.loginWithPopup(e,{timeoutInSeconds:1800}),oc(),lp(Ve.AUTHENTICATED,await Le.getUser()).canceled||window.location.reload()}async function Cw(t){return Wr&&Ir(window.location.href)!==Ir(`https://${Wr}`)&&(Sw()||Iw()||Js())?hp(t):ta(t)}function Aw(){try{const t=sessionStorage.getItem(An);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<Pw}catch{return sessionStorage.removeItem(An),!1}}function jw(){try{const t={timestamp:Date.now()};sessionStorage.setItem(An,JSON.stringify(t))}catch{pe("Failed to set silent auth throttle in sessionStorage")}}function oc(){try{sessionStorage.removeItem(An)}catch{}}async function xt(t=!0,e=!1){await ea();const r=await ic();if(r)return r;if(!e&&Aw()){if(pe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Le)return pe("Auth client not initialized"),null;let n=await Le.getTokenSilently();const a=cc(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Le.getTokenSilently({cacheMode:e?"off":"on"})),oc(),n}catch(n){const a=n;if(pe(`Failed to get token silently: ${a.message}`),jw(),await Le.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await sc(),t)throw n;return null}}async function sc(t={}){if(await ea(),localStorage.removeItem(Sr),qt(Ve.LOGOUT,{}),!!Le)return pe(`Logout with options: ${JSON.stringify(t)}`),Le.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function cc(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 Es(t){const e=cc(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");pe("Set token"),localStorage.setItem(Sr,t),qt(Ve.AUTHENTICATED,e)}const Uw=(t,e)=>e.skipDedupe||e.method!=="GET",qw=(t,e)=>e.method+"@"+t,Lw=t=>t.clone(),Qd=({skip:t=Uw,key:e=qw,resolver:r=Lw}={})=>{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((c,l)=>{n.get(s).push([c,l])});try{return a(i,o).then(c=>(n.get(s).forEach(([l])=>l(r(c))),n.delete(s),c)).catch(c=>{throw n.get(s).forEach(([,l])=>l(c)),n.delete(s),c})}catch(c){return n.delete(s),Promise.reject(c)}}},Nw=(t,e)=>t*e,$w=t=>t&&t.ok,eh=({delayTimer:t=500,delayRamp:e=Nw,maxAttempts:r=10,until:n=$w,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>c=>(l,u)=>{let f=0;if(s&&s(l,u))return c(l,u);const h=(d,v)=>Promise.resolve(n(d,v)).then(g=>g?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(y=>{const S=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:u})).then((b={})=>{var p,m;y(c((p=b&&b.url)!==null&&p!==void 0?p:l,(m=b&&b.options)!==null&&m!==void 0?m:u))}):y(c(l,u))},S)}).then(h).catch(y=>{if(!i)throw y;return h(null,y)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return c(l,u).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},xw="application/json",vp="Content-Type",cr=Symbol(),pp=Symbol();function th(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===vp.toLowerCase()))===null||e===void 0?void 0:e[1]}function rh(t){return/^application\/.*json.*/.test(t)}const Vt=function(t,e,r=!1){return Object.entries(e).reduce((n,[a,i])=>{const o=t[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=Vt(o,i,r):n[a]=i,n},{...t})},Pr={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function Dw(t,e=!1){Pr.options=e?t:Vt(Pr.options,t)}function Mw(t,e=!1){Pr.polyfills=e?t:Vt(Pr.polyfills,t)}function Fw(t){Pr.errorType=t}const Kw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class mp extends Error{}const Hw=t=>{const e=Object.create(null);t=t._addons.reduce((p,m)=>m.beforeRequest&&m.beforeRequest(p,t._options,e)||p,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:c}=t,l=new Map(i),u=Vt(a.options,n);let f=r;const h=Kw(s)((p,m)=>(f=p,a.polyfill("fetch")(p,m)))(r,u),d=new Error,v=h.catch(p=>{throw{[cr]:p}}).then(p=>{var m;if(!p.ok){const w=new mp;if(w.cause=d,w.stack=w.stack+`
36
- CAUSE: `+d.stack,w.response=p,w.status=p.status,w.url=f,p.type==="opaque")throw w;const R=a.errorType==="json"||((m=p.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?p.text():p[a.errorType]():Promise.resolve(p.body)).then(A=>{if(w.message=typeof A=="string"?A:p.statusText,A)if(R&&typeof A=="string"){w.text=A;try{w.json=JSON.parse(A)}catch{}}else w[a.errorType]=A;throw w})}return p}),g=p=>p.catch(m=>{const w=Object.prototype.hasOwnProperty.call(m,cr),R=w?m[cr]:m,j=R?.status&&l.get(R.status)||l.get(R?.name)||w&&l.has(cr)&&l.get(cr);if(j)return j(R,t);const A=l.get(pp);if(A)return A(R,t);throw R}),y=p=>m=>g(p?v.then(w=>w&&w[p]()).then(w=>m?m(w):w):v.then(w=>m?m(w):w)),S={_wretchReq:t,_fetchReq:h,_sharedState:e,res:y(null),json:y("json"),blob:y("blob"),formData:y("formData"),arrayBuffer:y("arrayBuffer"),text:y("text"),error(p,m){return l.set(p,m),this},badRequest(p){return this.error(400,p)},unauthorized(p){return this.error(401,p)},forbidden(p){return this.error(403,p)},notFound(p){return this.error(404,p)},timeout(p){return this.error(408,p)},internalError(p){return this.error(500,p)},fetchError(p){return this.error(cr,p)}},b=c.reduce((p,m)=>({...p,...typeof m.resolver=="function"?m.resolver(p):m.resolver}),S);return o.reduce((p,m)=>m(p,t),b)},zw={_url:"",_options:{},_config:Pr,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:Vt(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+t+"?"+r[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:Vt(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:Vt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[vp]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const r=new Map(this._catchers);return r.set(t,e),{...this,_catchers:r}},catcherFallback(t){return this.catcher(pp,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",r=null){let n=this.url(e).options({method:t});const a=th(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||rh(a));return n=r?o?n.json(r,a):n.body(r):n,Hw(n._deferred.reduce((s,c)=>c(s,s._url,s._options),n))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const r=th(this._options.headers);return this.content(e||rh(r)&&r||xw).body(JSON.stringify(t))}};function pt(t="",e={}){return{...zw,_url:t,_options:e}}pt.default=pt;pt.options=Dw;pt.errorType=Fw;pt.polyfills=Mw;pt.WretchError=mp;var Bw=Object.defineProperty,Gw=(t,e,r)=>e in t?Bw(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kr=(t,e,r)=>Gw(t,typeof e!="symbol"?e+"":e,r),jn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(jn||{});class Vr extends Error{constructor(e,r,n,a,i){super(a),Kr(this,"status"),Kr(this,"statusText"),Kr(this,"url"),Kr(this,"body"),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Vr)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isAuthError(){return this.status===401}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}const Ww="application/json",gp="Content-Type",ur=Symbol(),yp=Symbol();function nh(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===gp.toLowerCase()))===null||e===void 0?void 0:e[1]}function ah(t){return/^application\/.*json.*/.test(t)}const Jt=function(t,e,r=!1){return Object.entries(e).reduce((n,[a,i])=>{const o=t[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=Jt(o,i,r):n[a]=i,n},{...t})},Er={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function Vw(t,e=!1){Er.options=e?t:Jt(Er.options,t)}function Jw(t,e=!1){Er.polyfills=e?t:Jt(Er.polyfills,t)}function Zw(t){Er.errorType=t}const Yw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class wp extends Error{}const Xw=t=>{const e=Object.create(null);t=t._addons.reduce((p,m)=>m.beforeRequest&&m.beforeRequest(p,t._options,e)||p,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:c}=t,l=new Map(i),u=Jt(a.options,n);let f=r;const h=Yw(s)((p,m)=>(f=p,a.polyfill("fetch")(p,m)))(r,u),d=new Error,v=h.catch(p=>{throw{[ur]:p}}).then(p=>{var m;if(!p.ok){const w=new wp;if(w.cause=d,w.stack=w.stack+`
37
- CAUSE: `+d.stack,w.response=p,w.status=p.status,w.url=f,p.type==="opaque")throw w;const R=a.errorType==="json"||((m=p.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?p.text():p[a.errorType]():Promise.resolve(p.body)).then(j=>{if(w.message=typeof j=="string"?j:p.statusText,j)if(R&&typeof j=="string"){w.text=j;try{w.json=JSON.parse(j)}catch{}}else w[a.errorType]=j;throw w})}return p}),g=p=>p.catch(m=>{const w=Object.prototype.hasOwnProperty.call(m,ur),R=w?m[ur]:m,j=R?.status&&l.get(R.status)||l.get(R?.name)||w&&l.has(ur)&&l.get(ur);if(j)return j(R,t);const A=l.get(yp);if(A)return A(R,t);throw R}),y=p=>m=>g(p?v.then(w=>w&&w[p]()).then(w=>m?m(w):w):v.then(w=>m?m(w):w)),S={_wretchReq:t,_fetchReq:h,_sharedState:e,res:y(null),json:y("json"),blob:y("blob"),formData:y("formData"),arrayBuffer:y("arrayBuffer"),text:y("text"),error(p,m){return l.set(p,m),this},badRequest(p){return this.error(400,p)},unauthorized(p){return this.error(401,p)},forbidden(p){return this.error(403,p)},notFound(p){return this.error(404,p)},timeout(p){return this.error(408,p)},internalError(p){return this.error(500,p)},fetchError(p){return this.error(ur,p)}},b=c.reduce((p,m)=>({...p,...typeof m.resolver=="function"?m.resolver(p):m.resolver}),S);return o.reduce((p,m)=>m(p,t),b)},Qw={_url:"",_options:{},_config:Er,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:Jt(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+t+"?"+r[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:Jt(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:Jt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[gp]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const r=new Map(this._catchers);return r.set(t,e),{...this,_catchers:r}},catcherFallback(t){return this.catcher(yp,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",r=null){let n=this.url(e).options({method:t});const a=nh(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||ah(a));return n=r?o?n.json(r,a):n.body(r):n,Xw(n._deferred.reduce((s,c)=>c(s,s._url,s._options),n))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const r=nh(this._options.headers);return this.content(e||ah(r)&&r||Ww).body(JSON.stringify(t))}};function Qt(t="",e={}){return{...Qw,_url:t,_options:e}}Qt.default=Qt;Qt.options=Vw;Qt.errorType=Zw;Qt.polyfills=Jw;Qt.WretchError=wp;const eb=(t,e)=>e.skipDedupe||e.method!=="GET",tb=(t,e)=>e.method+"@"+t,rb=t=>t.clone(),nb=({skip:t=eb,key:e=tb,resolver:r=rb}={})=>{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((c,l)=>{n.get(s).push([c,l])});try{return a(i,o).then(c=>(n.get(s).forEach(([l])=>l(r(c))),n.delete(s),c)).catch(c=>{throw n.get(s).forEach(([,l])=>l(c)),n.delete(s),c})}catch(c){return n.delete(s),Promise.reject(c)}}},ab=(t,e)=>e.skipCache||e.method!=="GET",ib=(t,e)=>e.method+"@"+t,ob=()=>!1,sb=()=>null,cb=t=>t.ok,ub=({throttle:t=1e3,skip:e=ab,key:r=ib,clear:n=ob,invalidate:a=sb,condition:i=cb,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,c=new Map,l=new Set,u=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,v)=>{const g=r(d,v);let y=a(d,v);if(y&&(y instanceof Array||(y=[y]),y.forEach(S=>{typeof S=="string"?s.delete(S):S instanceof RegExp&&s.forEach((b,p)=>{S.test(p)&&s.delete(p)})})),n(d,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(g)){if(s.has(g)){const S=s.get(g).clone();return o&&Object.defineProperty(S,o,{value:g,enumerable:!1}),Promise.resolve(S)}else if(c.has(g))return new Promise((S,b)=>{c.get(g).push([S,b])})}return c.has(g)||c.set(g,[]),u(g),h(d,v).then(S=>(i(S.clone())&&s.set(g,S.clone()),c.get(g).forEach(([b])=>b(S.clone())),c.delete(g),S)).catch(S=>{throw c.get(g).forEach(([,b])=>b(S)),c.delete(g),S})};return f.cacheResponse=function(h,d){u(h),s.set(h,d)},f.cache=s,f.inflight=c,f.throttling=l,f},lb=(t,e)=>t*e,fb=t=>t&&t.ok,db=({delayTimer:t=500,delayRamp:e=lb,maxAttempts:r=10,until:n=fb,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>c=>(l,u)=>{let f=0;if(s&&s(l,u))return c(l,u);const h=(d,v)=>Promise.resolve(n(d,v)).then(g=>g?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(y=>{const S=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:u})).then((b={})=>{var p,m;y(c((p=b&&b.url)!==null&&p!==void 0?p:l,(m=b&&b.options)!==null&&m!==void 0?m:u))}):y(c(l,u))},S)}).then(h).catch(y=>{if(!i)throw y;return h(null,y)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return c(l,u).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},hb="@sesamy/sdk",vb="1.1.0";class pb{constructor(){Kr(this,"cache",new Map)}get(e){return this.cache.get(e)||null}set(e,r){this.cache.set(e,r)}remove(e){this.cache.delete(e)}clear(){this.cache.clear()}}const Hr="sesamyCacheTimestamp",mb=t=>{const{libraryName:e=hb,libraryVersion:r=vb,cache:n}=t,a=n?.storage||new pb,i=[s=>async(c,l)=>{if(n?.mode===jn.BROWSER){let u;typeof sessionStorage<"u"?(u=sessionStorage.getItem(Hr),u||(u=Date.now().toString(),sessionStorage.setItem(Hr,u))):(u=a.get(Hr),u||(u=Date.now().toString(),a.set(Hr,u)));const f={...l,headers:{...l.headers,"Cache-Timestamp":u}};return s(c,f)}return s(c,l)},s=>async(c,l)=>{const u=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:`Bearer ${u}`}};return s(c,f)},nb()];n?.mode===jn.NORMAL&&i.push(ub({throttle:300*1e3,skip:(s,c)=>c.method!=="GET"})),i.push(db({delayTimer:1e3,delayRamp:(s,c)=>s*c,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=Qt(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.vendorId&&{"tenant-id":t.vendorId},...t.headers}).middlewares(i);return{async request(s,c={}){try{let l=o.url(s);c.headers&&(l=l.headers(c.headers));const u=(c.method||"GET").toLowerCase();let f;switch(u){case"get":f=l.get();break;case"post":f=l.post(c.body?JSON.parse(c.body):void 0);break;case"put":f=l.put(c.body?JSON.parse(c.body):void 0);break;case"patch":f=l.patch(c.body?JSON.parse(c.body):void 0);break;case"delete":f=l.delete();break;default:f=l.get()}const h=await f.res();if(h.status===204)return null;if(!h.ok){const d=await h.text().catch(()=>"Unknown error");throw new Vr(h.status,h.statusText,h.url,`API Error ${h.status}: ${d}`,d)}return await h.json()}catch(l){if(l instanceof Vr)throw l;const u=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Vr(u,f,h,`API Error ${u}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},tt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Hr),"Cache cleared"),Dr={get:async(t,e)=>t.request(`/client/users/${e}`),update:async(t,e,r)=>t.request(`/client/users/${e}`,{method:"PATCH",body:JSON.stringify(r)}),checkSpotifyLink:async t=>t.request("/client/profile/spotify-link"),unlinkSpotify:async t=>t.request("/client/profile/unlink-spotify",{method:"POST"}),delete:async t=>{await t.request("/client/profile",{method:"DELETE"})}},os={list:async(t,e)=>{const r=new URLSearchParams;e!=null&&e.type&&r.append("type",e.type),e!=null&&e.sku&&r.append("sku",e.sku),e!=null&&e.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),e!=null&&e.waitForEntitlementAfter&&r.append("wait-for-entitlement-after",e.waitForEntitlementAfter);const n=r.toString(),a=n?`/client/entitlements?${n}`:"/client/entitlements";return t.request(a)},get:async(t,e)=>t.request(`/client/entitlements/${e}`),getAccess:async(t,e)=>t.request(`/client/entitlements/${e}/access`)},ih={list:async t=>t.request("/client/subscriptions"),get:async(t,e)=>t.request(`/client/subscriptions/${e}`)},oh={get:async(t,e)=>t.request(`/client/products/${e}`),autoOnboard:async(t,e)=>t.request(`/client/products/${e}/auto-onboard`,{method:"POST"})},Mr={list:async t=>t.request("/client/contracts"),get:async(t,e)=>t.request(`/client/contracts/${e}`),cancel:async(t,e)=>t.request(`/client/contracts/${e}/cancel`,{method:"POST"}),createAmendment:async(t,e,r)=>t.request(`/client/contracts/${e}/amendments`,{method:"POST",body:JSON.stringify(r)}),confirmAmendment:async(t,e,r)=>t.request(`/client/contracts/${e}/amendments/${r}/confirm`,{method:"POST"})},ss={get:async t=>t.request("/client/user-metadata"),set:async(t,e,r)=>{await t.request(`/client/user-metadata/${e}`,{method:"PUT",body:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/client/user-metadata/${e}`,{method:"DELETE"})}},pn={list:async t=>t.request("/client/tallies"),get:async(t,e)=>t.request(`/client/tallies/${e}`),update:async(t,e,r)=>t.request(`/client/tallies/${e}`,{method:"PUT",body:JSON.stringify(r)}),create:async(t,e)=>t.request("/client/tallies",{method:"POST",body:JSON.stringify(e)})},cs={list:async t=>t.request("/client/tags"),add:async(t,e)=>{await t.request("/client/tags",{method:"POST",body:JSON.stringify({tag:e})})},remove:async(t,e)=>{await t.request(`/client/tags/${e}`,{method:"DELETE"})}},us={create:async(t,e)=>t.request("/client/checkout",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/client/checkout/${e}`),update:async(t,e,r)=>t.request(`/client/checkout/${e}`,{method:"PATCH",body:JSON.stringify(r)})},sh={list:async t=>t.request("/client/bills"),get:async(t,e)=>t.request(`/client/bills/${e}`)},ch={list:async t=>t.request("/client/fulfillments"),create:async(t,e)=>t.request("/client/fulfillments",{method:"POST",body:JSON.stringify(e)})},gb={get:async(t,e)=>t.request(`/client/paywalls/${e}`)},yb={list:async t=>t.request("/client/payment-issues")},wb={content:async(t,e,r,n,a)=>{const i=new URLSearchParams({url:e});return r&&i.append("selector",r),n&&i.append("cache",n),t.request(`/client/proxy?${i.toString()}`,a)}},bb={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/client/transactions?${r}`:"/client/transactions";return t.request(n)}},uh={get:async t=>t.request("/client/vendor"),list:async t=>t.request("/client/vendors")},Sb=t=>{const e=mb(t);return{profile:{get:r=>Dr.get(e,r),update:(r,n)=>Dr.update(e,r,n),checkSpotifyLink:()=>Dr.checkSpotifyLink(e),unlinkSpotify:()=>Dr.unlinkSpotify(e),delete:()=>Dr.delete(e)},entitlements:{list:r=>os.list(e,r),get:r=>os.get(e,r),getAccess:r=>os.getAccess(e,r)},subscriptions:{list:()=>ih.list(e),get:r=>ih.get(e,r)},products:{get:r=>oh.get(e,r),autoOnboard:r=>oh.autoOnboard(e,r)},contracts:{list:()=>Mr.list(e),get:r=>Mr.get(e,r),cancel:r=>Mr.cancel(e,r),createAmendment:(r,n)=>Mr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Mr.confirmAmendment(e,r,n)},userMetadata:{get:()=>ss.get(e),set:(r,n)=>ss.set(e,r,n),delete:r=>ss.delete(e,r)},tallies:{list:()=>pn.list(e),get:r=>pn.get(e,r),update:(r,n)=>pn.update(e,r,n),create:r=>pn.create(e,r)},tags:{list:()=>cs.list(e),add:r=>cs.add(e,r),remove:r=>cs.remove(e,r)},checkout:{create:r=>us.create(e,r),get:r=>us.get(e,r),update:(r,n)=>us.update(e,r,n)},bills:{list:()=>sh.list(e),get:r=>sh.get(e,r)},fulfillments:{list:()=>ch.list(e),create:r=>ch.create(e,r)},paywall:{get:r=>gb.get(e,r)},paymentIssues:{list:()=>yb.list(e)},proxy:{content:(r,n,a,i)=>wb.content(e,r,n,a,i)},transactions:{list:r=>bb.list(e,r)},vendor:{get:()=>uh.get(e),list:()=>uh.list(e)}}};class Ib{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 _s(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function bp(t,e){if(_s(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 lh(t){return t.endsWith("/")?t.slice(0,-1):t}function fh(t,e){if(!_s(t)||!_s(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&lh(r.pathname)===lh(n.pathname)}function Pb(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:c,itemSrc:l}=bp(e.itemSrc,e.purchaseOptionId);l&&n.searchParams.set("url",l),s&&n.searchParams.set("sku",s),c&&n.searchParams.set("po-id",c)}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[c,l]=s.trim().split("=");return{key:c,value:l}}).filter(s=>a.some(c=>c===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:c})=>c?c.map(l=>`${s}|${l}`):s).join(",")),n}const Sp="sesamySignedURLs";function uc(){const t=sessionStorage.getItem(Sp);return t?JSON.parse(t):[]}function Eb(t){const e=uc();e.push(t),pe(`Adding signed URL: ${t}`),sessionStorage.setItem(Sp,JSON.stringify(e))}function _b(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ts="sesamyAttribution";function Tb(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 kb(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function Un(){return Tb(Ts)||{}}function Ip(t){if(t===null)localStorage.removeItem(Ts);else{pe(`Setting attribution ${JSON.stringify(t)}`);const e=Un()??{},r=_b({...e,...kb(t)});localStorage.setItem(Ts,JSON.stringify({value:r}))}}function Rb(t){const e=t.endpoint||ht("api2",t.environment),n=Sb({baseUrl:e,tokenProvider:async()=>{const k=await xt(!0);if(!k)throw new Error("No access token available");return k},libraryName:rc,libraryVersion:Qn,vendorId:t.vendorId,cache:{mode:jn.BROWSER,storage:new Ib}}),a=k=>async(K,J)=>{let re=sessionStorage.getItem(wd);re||(re=Date.now().toString(),sessionStorage.setItem(wd,re));const me={...J,headers:{...J.headers,"Cache-Timestamp":re}};return k(K,me)},i=(k=!0)=>K=>async(J,re)=>{let me=null;if(me=await xt(k),!me){if(k)throw new Error("No access token available");return K(J,re)}const Fe={...re,headers:{...re.headers,...me?{Authorization:`Bearer ${me}`}:{}}};return K(J,Fe)},o=k=>(K,J)=>{if(J.headers&&"Authorization"in J.headers)return k(K,J);const re=localStorage.getItem("__anon_id"),me=btoa(`${t.clientId}|${re}:`),Fe={...J,headers:{...J.headers,Authorization:`Basic ${me}`}};return k(K,Fe)},s=pt(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Qd(),eh({delayTimer:1e3,delayRamp:(k,K)=>k*K,maxAttempts:3,until:k=>!!(k&&(k.ok||k.status>=400&&k.status<500)),retryOnNetworkError:!1})]),c=pt(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Qd(),eh({delayTimer:1e3,delayRamp:(k,K)=>k*K,maxAttempts:3,until:k=>!!(k&&(k.ok||k.status>=400&&k.status<500)),retryOnNetworkError:!1})]);async function l(k={}){const{waitForEntitlementAfter:K,includeSignedLinks:J=!0}=k,re=await Yr()?await n.entitlements.list({waitForEntitlementAfter:K?.toISOString()}):[];return J&&re.push(...uc()),re}async function u(k,K=[]){return(await l())?.find(me=>{const{sku:Fe,purchaseOption:M}=bp(k);return!!("sku"in me&&Fe===me.sku||M&&"purchaseOptionsId"in me&&M===me.purchaseOptionsId||fh(k,me.url)||K.some(ee=>fh(ee,me.url)))})}async function f(k){return n.entitlements.get(k)}async function h(k){return n.entitlements.getAccess(k)}async function d(k,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),pt(re.toString()).headers({Authorization:`Bearer ${k}`}).get().text()}async function v(k){if(!k)throw new Error("SKU is required to get fulfillments");return await Yr()?await s.get(`/fulfillments?sku=${encodeURIComponent(k)}`).json():[]}async function g(k,K){if(!k||!K)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:k},`/fulfillments/${encodeURIComponent(K)}/request-delivery?`).res()).ok}async function y(){return s.get("/contracts").json()}async function S(k){return(await s.get("/contracts").json())?.find(J=>J.id===k)}async function b(k){const K=await s.post({},`/contracts/${encodeURIComponent(k)}/cancel`).res();return tt(),K.ok}async function p(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function m(){return s.get("/bills").json()}async function w(k){return(await s.get("/bills").json())?.find(J=>J.id===k)}async function R(){return s.get("/transactions").json()}async function j(k){return(await s.get("/transactions").json())?.find(J=>J.id===k)}async function A(k,K){const J=await s.url(`/user-metadata/${encodeURIComponent(k)}`).put(K).json();return qt(Ve.USER_ATTRIBUTE_CHANGED,{}),tt(),J}async function H(k){const K=await s.url(`/user-metadata/${encodeURIComponent(k)}`).delete().res();return tt(),K.ok}async function B(){return await s.url("/user-metadata").get().json()}async function ie(k){return(await B())[k]||null}async function L(){return await s.url("/tags").get().json()}async function D(k){const K=await s.url(`/tags/${encodeURIComponent(k)}`).delete().res();return tt(),K.ok}async function N(k){const K=await s.url("/tags").post(encodeURIComponent(k)).res();return qt(Ve.USER_ATTRIBUTE_CHANGED,{}),tt(),K.ok}async function O(k){return(await c.url("/tallies").get().json())[k]}async function Y(){return await c.url("/tallies").get().json()}async function te(k){const K=await c.url(`/tallies/${k}`).delete().res();return tt(),K.ok}async function Q(k,K){return await c.url(`/tallies/${encodeURIComponent(k)}/push`).post(K).json()}async function I(k){return n.products.get(k)}async function T(){return await xt(!1)?await s.url("/profile").get().json():null}async function $(k){const K=await s.url("/profile").patch(k).res();return tt(),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(k){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",k),window.location.href=J.toString()}async function oe(k){const K=await s.url(`/products/${encodeURIComponent(k)}/auto-onboard`).post().json();return K.length&&tt(),K}async function le(k,K=3600){const{shortlink:J}=await pt(Ng).post({url:k,ttl:K}).json();return J}async function se(k){const K=await xt(!1,!0);let J;const re=k.language||En(),me=Un();switch(k.target){case"account":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}${k.contractId?`/${encodeURIComponent(k.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${ht("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"consume":J=new URL(`${ht("consume",t.environment)}/${encodeURIComponent(k.language||re)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.sku)}`),k.episodeId?J.href+=`/${k.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"checkout":J=Pb(t,{language:re,...k},me);break;default:throw new Error("Invalid target")}return K&&(J.hash=`#access_token=${K}`),k.shorten?le(J.href,k.ttl):J.href}async function _e(k){const K=Un(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(me=>{const Fe=K,[M,ee]=me.trim().split("=");J.includes(M)&&!Fe[M]&&(Fe[M]=ee)}),(await c.url("/checkouts").post({language:En(),...k,attribution:{...K,...k.attribution},vendorId:t.vendorId})).json()}async function Ae(k,K){return(await c.url(`/checkouts/${k}`).patch(K)).json()}async function Me(k){return(await c.url(`/checkouts/${k}`).get()).json()}async function Re(k){return(await c.url(`/paywalls/${k}`).get()).json()}async function Je(){return(await c.url("/vendor").get()).json()}async function ut(){return(await s.url("/vendors").get()).json()}async function lt(k){return(await s.url(`/contracts/${encodeURIComponent(k.contractId)}/amendments`).post({amendmentType:k.amendmentType,discountCode:k.discountCode})).json()}async function gt(k){return await s.url(`/amendments/${encodeURIComponent(k)}/confirm`).post(),!0}async function yt(){const k=await xt(!1),K=new URL(`${ht("account",t.environment)}/subscriptions/${t.clientId}`);k&&(K.hash=`#access_token=${k}`),window.location.href=K.toString()}return{autoOnboardProduct:oe,cancelContract:b,confirmAmendment:gt,createAmendment:lt,createCheckout:_e,deleteTag:D,deleteTally:te,deleteUserMetadata:H,generateLink:se,getBill:w,getBills:m,getCheckout:Me,getProxyContent:d,getContract:S,getContracts:y,getEntitlement:f,getEntitlementAccess:h,getEntitlements:l,getFulfillments:v,requestDelivery:g,getPaywall:Re,getPaymentIssues:F,getProfile:T,getProduct:I,getSubscriptions:p,getTally:O,getTallies:Y,getTags:L,getTransaction:j,getTransactions:R,getUserMetadata:ie,hasAccess:u,isSpotifyLinked:Z,linkSpotify:he,listUserMetadata:B,openHostedAccountPage:yt,pushTally:Q,setTag:N,setUserMetadata:A,unlinkSpotify:V,updateCheckout:Ae,updateProfile:$,getVendorSettings:Je,listVendors:ut}}const Ob=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function Cb(){return new Promise(t=>{const e=Ob.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",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 Ab(){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 Pp="sesamyFlags";async function Ep(t){try{localStorage.setItem(Pp,JSON.stringify(t))}catch{pe("Failed to save flags to localStorage")}}async function jb(t,e){const r=await ra();r[t]=e,await Ep(r)}async function Ub(t){return(await ra())[t]}async function qb(t){const e=await ra();t in e&&(delete e[t],await Ep(e))}async function ra(){try{const t=localStorage.getItem(Pp);return t?JSON.parse(t):{}}catch{return{}}}function Lb(t){const{autoOnboardProduct:e,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:c,getBills:l,getCheckout:u,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:g,getFulfillments:y,getPaywall:S,getPaymentIssues:b,getProfile:p,getProduct:m,getProxyContent:w,getSubscriptions:R,getTags:j,getTally:A,getTallies:H,getTransaction:B,getTransactions:ie,getUserMetadata:L,getVendorSettings:D,listVendors:N,hasAccess:O,isSpotifyLinked:Y,linkSpotify:te,listUserMetadata:Q,openHostedAccountPage:I,pushTally:T,requestDelivery:$,setTag:F,setUserMetadata:Z,unlinkSpotify:V,updateCheckout:he,updateProfile:oe}=Rb(t),le={analytics:{track:up},attribution:{get:Un,set:Ip},auth:{getUser:p,getTokenSilently:xt,isAuthenticated:Yr,loginWithRedirect:ta,loginWithPopup:hp,login:Cw,logout:sc,setToken:Es},bills:{get:c,list:l},browser:{detectAdblock:Cb,isInAppBrowser:Ab,isIncognito:Js},checkouts:{create:n,get:u,update:he},clearCache:tt,content:{list:fw,get:ac,getLanguage:En,unlock:dw,getPropertyFromHTML:ap},contracts:{cancel:r,get:f,list:h},entitlements:{access:v,get:d,hasAccess:O,list:g,signedLinks:uc},events:{emit:lp,cancel:bw},flags:{get:Ub,set:jb,list:ra,delete:qb},fulfillments:{list:y,requestDelivery:$},generateLink:s,getPaymentIssues:b,getVersion:Nb,isReady:()=>exports.isInitialized,log:pe,paywalls:{get:S},products:{autoOnboard:e,get:m,linkSpotify:te},profile:{get:p,isSpotifyLinked:Y,openHostedAccountPage:I,unlinkSpotify:V,update:oe},proxy:{getContent:w},subscriptions:{list:R},tags:{delete:a,list:j,set:F},tallies:{delete:i,get:A,list:H,push:T},transactions:{get:B,list:ie},userMetadata:{delete:o,get:L,list:Q,set:Z},vendors:{get:D,list:N},setToken:Es};return t.namespace&&(window[t.namespace]=le),le}function Nb(){return Qn}function $b(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 fs={d:(t,e)=>{for(var r in e)fs.o(e,r)&&!fs.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},zs={};fs.d(zs,{A:()=>Rg,k:()=>Hs});var jr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{c(n.next(l))}catch(u){i(u)}}function s(l){try{c(n.throw(l))}catch(u){i(u)}}function c(l){var u;l.done?a(l.value):(u=l.value,u instanceof r?u:new r(function(f){f(u)})).then(o,s)}c((n=n.apply(t,[])).next())})},Ur=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(c){return function(l){return(function(u){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&u[0]?n.return:u[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,u[1])).done)return a;switch(n=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||u[0]!==6&&u[0]!==2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(f){u=[6,f],n=0}finally{r=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}})([c,l])}}};function Hs(){return jr(this,void 0,Promise,function(){return Ur(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 jr(this,void 0,void 0,function(){var h,d;return Ur(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 c(){var h;return jr(this,void 0,Promise,function(){return Ur(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(g){var S=g.target.result,w=function(y){i(y)};try{S.createObjectStore("t",{autoIncrement:!0}).put(new Blob),w(!1)}catch(y){(y instanceof Error&&typeof y.message=="string"?y.message:String(y)).includes("are not yet supported")?w(!0):w(!1)}finally{S.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 g,S,w,y=window;return(w=(S=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||S===void 0?void 0:S.jsHeapSizeLimit)!==null&&w!==void 0?w:1073741824})()/1048576);i(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function u(){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 jr(this,void 0,Promise,function(){var d,v,p;return Ur(this,function(g){switch(g.label){case 0:if(typeof((h=navigator.storage)===null||h===void 0?void 0:h.getDirectory)!="function")return[3,5];g.label=1;case 1:return g.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return g.sent(),i(!1),[3,4];case 3:return d=g.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(S){p.error&&p.error.name==="InvalidStateError"&&S.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return jr(this,void 0,Promise,function(){return Ur(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,c()]);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",u(),[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=Hs);const Rg=Hs;zs.A;const Og=zs.k,hn="sesamy_incognito_mode";function Bs(){try{const t=sessionStorage.getItem(hn);return t===null?void 0:t==="true"}catch{return}}async function Cg(){try{const t=sessionStorage.getItem(hn);if(t!==null)return t==="true";const{isPrivate:e}=await Og();return sessionStorage.setItem(hn,e.toString()),e}catch{try{sessionStorage.setItem(hn,"false")}catch{}return!1}}function Br(){return typeof window<"u"}function gd(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 Ag="function",jg="string",ot="undefined",Ug="boolean",Sn="object",qg="array",Lg="number",Ng="symbol",$g="null",ds=function(){},Ev="any",_v="*",Jt="__",xg="form",Dg="input",Mg="button",Fg="select",In=typeof process!==ot?process:{};In.env&&In.env.NODE_ENV;var Ne=typeof document!==ot;In.versions!=null&&In.versions.node!=null;typeof Deno!==ot&&Deno.core;Ne&&window.name==="nodejs"||typeof navigator!==ot&&typeof navigator.userAgent!==ot&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Tv(t,e){return e.charAt(0)[t]()+e.slice(1)}var Kg=Tv.bind(null,"toUpperCase"),zg=Tv.bind(null,"toLowerCase");function Hg(t){return kv(t)?Kg($g):typeof t===Sn?Vg(t):Object.prototype.toString.call(t).slice(8,-1)}function Pn(t,e){e===void 0&&(e=!0);var r=Hg(t);return e?zg(r):r}function tn(t,e){return typeof e===t}var We=tn.bind(null,Ag),jt=tn.bind(null,jg),ur=tn.bind(null,ot),Bg=tn.bind(null,Ug);tn.bind(null,Ng);function kv(t){return t===null}function Gg(t){return Pn(t)===Lg&&!isNaN(t)}function Rv(t){return Pn(t)===qg}function Ge(t){if(!Wg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Wg(t){return t&&(typeof t===Sn||t!==null)}function Vg(t){return We(t.constructor)?t.constructor.name:null}function Jg(t){return t instanceof Error||jt(t.message)&&t.constructor&&Gg(t.constructor.stackTraceLimit)}function Ov(t,e){if(typeof e!="object"||kv(e))return!1;if(e instanceof t)return!0;var r=Pn(new t(""));if(Jg(e))for(;e;){if(Pn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Ov.bind(null,TypeError);Ov.bind(null,SyntaxError);function Hn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Zg(t,e):r}function Zg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Bn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Bn(Hn,xg);Bn(Hn,Mg);Bn(Hn,Dg);Bn(Hn,Fg);function Yg(t){return t?Rv(t)?t:[t]:[]}function yd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Xg(){if(Ne){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function Qg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ey(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=yd(r[1]),o=yd(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 c in n){var l=c.split("[");l.length>1&&(ty(n,l.map(function(u){return u.replace(/[?[\]\\ ]/g,"")}),n[c]),delete n[c])}return n})((function(e){return Ne&&window.location.search.substring(1)})())}function ty(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 Gn(){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 ry(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 c=new Date;o||(o=c);var l=e-(c-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=c,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var Ht="global",pr=Jt+Ht+Jt,mr=typeof self===Sn&&self.self===self&&self||typeof global===Sn&&global[Ht]===global&&global||void 0;function Zt(t){return mr[pr][t]}function Yt(t,e){return mr[pr][t]=e}function Tr(t){delete mr[pr][t]}function kr(t,e,r){var n;try{if(Gs(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}mr[pr]||(mr[pr]={});var nn={};function Gs(t){if(typeof nn[t]!==ot)return nn[t];try{var e=window[t];e.setItem(ot,ot),e.removeItem(ot)}catch{return nn[t]=!1}return nn[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 Ct="function",Pt="undefined",Kr="reducer",Cv="@@redux/",hs=Cv+"INIT",ny=Cv+Math.random().toString(36),wd=(function(){return typeof Symbol===Ct&&Symbol.observable||"@@observable"})(),an=" != "+Ct;function Av(t,e,r){var n;if(typeof e===Ct&&typeof r===Pt&&(r=e,e=void 0),typeof r!==Pt){if(typeof r!==Ct)throw new Error("enhancer"+an);return r(Av)(t,e)}if(typeof t!==Ct)throw new Error(Kr+an);var a=t,i=e,o=[],s=o,c=!1;function l(){s===o&&(s=o.slice())}function u(){return i}function f(d){if(typeof d!==Ct)throw new Error("Listener"+an);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(!Ge(d))throw new Error("Act != obj");if(typeof d.type===Pt)throw new Error("ActType "+Pt);if(c)throw new Error("Dispatch in "+Kr);try{c=!0,i=a(i,d)}finally{c=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:hs}),(n={dispatch:h,subscribe:f,getState:u,replaceReducer:function(d){if(typeof d!==Ct)throw new Error("next "+Kr+an);a=d,h({type:hs})}})[wd]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function g(){p.next&&p.next(u())}return g(),{unsubscribe:v(g)}}})[wd]=function(){return this},d},n}function ay(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Kr+" "+t+" returns "+Pt}function gr(){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 iy(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,c={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(c)}),ae({},o,{dispatch:s=gr.apply(void 0,i)(o.dispatch)})}}}var Ut=Jt+"anon_id",Bt=Jt+"user_id",fr=Jt+"user_traits",vs="analytics",Ot="userId",lr="anonymousId",vn=["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"],ps=["name","EVENTS","config","loaded"],ne=vn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),bd=/^utm_/,Sd=/^an_prop_/,Id=/^an_trait_/;function oy(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,c=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ut,o.anonymousId),l||e(Bt,o.userId),c.traits&&e(fr,ae({},l&&s.traits?s.traits:{},c.traits));var u=Object.keys(a.params);if(u.length){var f=i.an_uid,h=i.an_event,d=u.reduce(function(v,p){if(p.match(bd)||p.match(/^(d|g)clid/)){var g=p.replace(bd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Sd)&&(v.props[p.replace(Sd,"")]=i[p]),p.match(Id)&&(v.traits[p.replace(Id,"")]=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 sy(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===Bt)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[Bt,Ut,fr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Pd(t){return{userId:t.getItem(Bt),anonymousId:t.getItem(Ut),traits:t.getItem(fr)}}var ms=function(t){return Jt+"TEMP"+Jt+t};function cy(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var c=s.userId,l=s.traits,u=s.options;if(s.type===ne.reset&&([Bt,fr,Ut].forEach(function(d){n(d)}),[Ot,lr,"traits"].forEach(function(d){Tr(ms(d))})),s.type===ne.identify){a(Ut)||r(Ut,Gn());var f=a(Bt),h=a(fr)||{};f&&f!==c&&i.dispatch({type:ne.userIdChanged,old:{userId:f,traits:h},new:{userId:c,traits:l},options:u}),c&&r(Bt,c),l&&r(fr,ae({},h,l))}return o(s)}}}}var $r={};function Ed(t,e){$r[t]&&We($r[t])&&($r[t](e),delete $r[t])}function jv(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 jv(t,e,r-10).then(n,a)})})}function uy(t){return{abort:t}}function Uv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,c=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&&We(p)){var g,S=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Ot,lr].reduce(function(O,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(O[A]=b[A]),O},m)})(h.payload,c),w=n[S.meta.rid];if(!w&&(g=p({payload:S,config:o[d].config,instance:r,abort:uy}))&&Ge(g)&&g.abort)return void(n[S.meta.rid]=!0);if(!w){var y=v+":"+d;t.dispatch(ae({},S,{type:y,_:{called:y,from:"queueDrain"}}))}}});var u=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=u}}}var Wo=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,c=t.EVENTS;try{var l=a.plugins,u=a.context,f=r.type,h=f.match(dr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,S){return function(w,y,m){var b=y.config,O=y.name,A=O+"."+w.type;m&&(A=m.event);var L=w.type.match(dr)?(function(z,B,ie,q,D){return function(N,R){var Y=q?q.name:z,te=R&&Gr(R)?R:ie;if(q&&(!(te=R&&Gr(R)?R:[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:N,plugins:te,caller:B,_:Y}})}})(O,A,S,m,w):(function(z,B){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+B)}})(w,A);return{payload:ly(w),instance:g,config:b||{},abort:L}}})(n,d),p=e.exact.reduce(function(g,S){var w=S.pluginName,y=S.methodName,m=!1;return y.match(/^initialize/)||y.match(/^reset/)||(m=!l[w].loaded),u.offline&&y.match(/^(page|track|identify)/)&&(m=!0),g[""+w]=m,g},{});return Promise.resolve(e.exact.reduce(function(g,S,w){var y=S.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var O=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,L,z){return Promise.resolve(A).then(function(B){return L.method&&We(L.method)?((function(N,R){var Y=Ad(N);if(Y&&Y.name===R){var te=Ad(Y.method);throw new Error([R+" plugin is calling method "+N,"Plugins cant call self","Use "+Y.method+" "+(te?"or "+te.method:"")+" in "+R+" plugin insteadof "+N].join(`
35
+ `))}})(L.methodName,L.pluginName),Promise.resolve(L.method({payload:B,instance:n,abort:(ie=B,q=y,D=L.pluginName,function(N,R){return ae({},ie,{abort:{reason:N,plugins:R||[q],caller:f,from:D||q}})}),config:kd(L.pluginName,l,i),plugins:l})).then(function(N){var R=Ge(N)?N:{};return Promise.resolve(ae({},B,R))})):B;var ie,q,D})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return O&&O.then?O.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(S,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,O=i[b];return Promise.resolve(S).then(function(A){var L=g[b]?g[b]:{};if(h&&(L=A),Jo(L,b))return Vo({data:L,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(Jo(A,b))return m&&Vo({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(p.hasOwnProperty(b)&&p[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:L,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(g[b],i[b]);return Promise.resolve(O[f]({abort:z.abort,payload:L,instance:n,config:kd(b,l,i),plugins:l})).then(function(B){var ie=Ge(B)?B:{},q=ae({},A,ie),D=g[b];if(Jo(D,b))Vo({data:D,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(_d)&&!f.match(Td)&&n.dispatch(ae({},h?q:L,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(q)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(S){if(!(f.match(dr)||f.match(/^registerPlugin/)||f.match(Td)||f.match(_d)||f.match(/^params/)||f.match(/^userIdChanged/))){if(c.plugins.includes(f),S._&&S._.originalAction===f)return S;var w=ae({},S,{_:{originalAction:S.type,called:S.type,from:"engineEnd"}});qv(S,e.exact.length)&&!f.match(/End$/)&&(w=ae({},w,{type:S.type+"Aborted"})),s.dispatch(w)}return S})})}catch(g){return Promise.reject(g)}},dr=/Start$/,_d=/^bootstrap/,Td=/^ready/;function Vo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ae({},t.data,{type:r,_:{called:r,from:"abort"}}))}function kd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Rd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Od(t,e){var r=t.replace(dr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Jo(t,e){var r=t.abort;return!!r&&(r===!0||Cd(r,e)||r&&Cd(r.plugins,e))}function qv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||jt(r))return!0;var n=r.plugins;return Gr(r)&&r.length===e||Gr(n)&&n.length===e}function Gr(t){return Array.isArray(t)}function Cd(t,e){return!(!t||!Gr(t))&&t.includes(e)}function Ad(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function ly(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ge(t[r])?Object.assign({},t[r]):t[r]),e},{})}function fy(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,c=function(m){return s?m:i(f)},l=o.type,u=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===ne.enablePlugin&&a.dispatch({type:ne.initializeStart,plugins:u,disabled:[],fromEnable:!0,meta:o.meta}),l===ne.disablePlugin&&setTimeout(function(){return Ed(o.meta.rid,{payload:o})},0),l===ne.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return u.includes(m)}).map(function(m){return h[m]}),p=[],g=[],S=o.disabled,w=v.map(function(m){var b=m.loaded,O=m.name,A=m.config;return jv(m,function(){return b({config:A})},1e4).then(function(L){return n[O]||(a.dispatch({type:ne.pluginReadyType(O),name:O,events:Object.keys(m).filter(function(z){return!ps.includes(z)})}),n[O]=!0),p=p.concat(O),m}).catch(function(L){if(L instanceof Error)throw new Error(L);return g=g.concat(L.name),L})});Promise.all(w).then(function(m){var b={plugins:p,failed:g,disabled:S};setTimeout(function(){d.length===w.length+S.length&&a.dispatch(ae({},{type:ne.ready},b))},0)})}var y=(function(){if(l!==ne.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return Uv(a,e,t)},0),Promise.resolve((function(m,b,O,A,L){try{var z=We(b)?b():b,B=m.type,ie=B.replace(dr,"");if(m._&&m._.called)return Promise.resolve(m);var q=O.getState(),D=(Y=z,(te=q.plugins)===void 0&&(te={}),(Q=m.options)===void 0&&(Q={}),Object.keys(Y).filter(function(I){var T=Q.plugins||{};return Bg(T[I])?T[I]:T.all!==!1&&(!te[I]||te[I].enabled!==!1)}).map(function(I){return Y[I]}));B===ne.initializeStart&&m.fromEnable&&(D=Object.keys(q.plugins).filter(function(I){var T=q.plugins[I];return m.plugins.includes(I)&&!T.initialized}).map(function(I){return z[I]}));var N=D.map(function(I){return I.name}),R=(function(I,T){var $=Od(I).map(function(F){return Rd(F,T)});return T.reduce(function(F,Z){var V=Z.name,he=Od(I,V).map(function(_e){return Rd(_e,T)}),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:$[0],beforeNS:{},during:$[1],duringNS:{},after:$[2],afterNS:{}})})(B,D);return Promise.resolve(Wo({action:m,data:{exact:R.before,namespaced:R.beforeNS},state:q,allPlugins:z,allMatches:R,instance:O,store:A,EVENTS:L})).then(function(I){function T(){var Z=(function(){if(B.match(dr))return Promise.resolve(Wo({action:ae({},$,{type:ie+"End"}),data:{exact:R.after,namespaced:R.afterNS},state:q,allPlugins:z,allMatches:R,instance:O,store:A,EVENTS:L})).then(function(V){V.meta&&V.meta.hasCallback&&Ed(V.meta.rid,{payload:V})})})();return Z&&Z.then?Z.then(function(){return I}):I}if(qv(I,N.length))return I;var $,F=(function(){if(B!==ie)return Promise.resolve(Wo({action:ae({},I,{type:ie}),data:{exact:R.during,namespaced:R.duringNS},state:q,allPlugins:z,allMatches:R,instance:O,store:A,EVENTS:L})).then(function(Z){$=Z});$=I})();return F&&F.then?F.then(T):T()})}catch(I){return Promise.reject(I)}var Y,te,Q})(o,e,t,a,r)).then(function(m){var b=i(m);return s=1,b})})();return Promise.resolve(y&&y.then?y.then(c):c(y))}catch(m){return Promise.reject(m)}}}}}function dy(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 hy=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 gr.apply(void 0,o)(n)(a)}}}}};function vy(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=jd(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 c=jd(r.type,ne.initialize),l=t()[c];return l&&c?(n[c]=ae({},e[c],{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,Ud(r.plugins,!1,e));case ne.enablePlugin:return ae({},e,Ud(r.plugins,!0,e));default:return e}}}function jd(t,e){return t.substring(e.length+1,t.length)}function Ud(t,e,r){return t.reduce(function(n,a){return n[a]=ae({},r[a],{enabled:e}),n},r)}function Lv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var py={last:{},history:[]};function my(t,e){t===void 0&&(t=py);var r=e.options,n=e.meta;if(e.type===ne.track){var a=Lv(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 gy={actions:[]};function yy(t,e){t===void 0&&(t=gy);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 Nv=/#.*$/;function wy(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(Nv,""):"")}var $v,xv,Dv,Mv,by=function(t){if(t===void 0&&(t={}),!Ne)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,c=i.hash,l=i.search,u=(function(h){var d=(function(){if(Ne){for(var v,p=document.getElementsByTagName("link"),g=0;v=p[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(Nv,"")})(l),f={title:r,url:u,path:wy(u),hash:c,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ae({},f,t)},Sy={last:{},history:[]};function Iy(t,e){t===void 0&&(t=Sy);var r=e.options;if(e.type===ne.page){var n=Lv(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}$v=(function(){if(!Ne)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"})(),xv=Ne?document.referrer:null,Dv=Xg(),Mv=Qg();var qd={initialized:!1,sessionId:Gn(),app:null,version:null,debug:!1,offline:!!Ne&&!navigator.onLine,os:{name:$v},userAgent:Ne?navigator.userAgent:"node",library:{name:vs,version:"0.13.1"},timezone:Mv,locale:Dv,campaign:{},referrer:xv};function Py(t,e){t===void 0&&(t=qd);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({},qd,t,{initialized:!0})}}var Ey=["plugins","reducers","storage"];function _y(t,e,r){if(Ne){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Ty(t){var e=_y.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Fv(){return Yt(vs,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return mr[pr][vs].push(o.action||o),i(o)}})}}}function Ld(t){return function(){return gr(gr.apply(null,arguments),Fv())}}function Zo(t){return t?Rv(t)?t:[t]:[]}function Nd(t,e,r){t===void 0&&(t={});var n,a,i=Gn();return e&&($r[i]=(n=e,a=(function(o){for(var s,c=o||Array.prototype.slice.call(arguments),l=0;l<c.length;l++)if(We(c[l])){s=c[l];break}return s})(r),function(o){a&&a(o),n(o)})),ae({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function ky(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,T){if(We(T))return I.middlewares=I.middlewares.concat(T),I;if(T.NAMESPACE&&(T.name=T.NAMESPACE),!T.name)throw new Error("https://lytics.dev/errors/1");T.config||(T.config={});var $=T.EVENTS?Object.keys(T.EVENTS).map(function(V){return T.EVENTS[V]}):[];I.pluginEnabled[T.name]=!(T.enabled===!1||T.config.enabled===!1),delete T.enabled,T.methods&&(I.methods[T.name]=Object.keys(T.methods).reduce(function(V,he){var oe;return V[he]=(oe=T.methods[he],function(){for(var le=Array.prototype.slice.call(arguments),se=new Array(oe.length),_e=0;_e<le.length;_e++)se[_e]=le[_e];return se[se.length]=b,oe.apply({instance:b},se)}),V},{}),delete T.methods);var F=Object.keys(T).concat($),Z=new Set(I.events.concat(F));if(I.events=Array.from(Z),I.pluginsArray=I.pluginsArray.concat(T),I.plugins[T.name])throw new Error(T.name+"AlreadyLoaded");return I.plugins[T.name]=T,I.plugins[T.name].loaded||(I.plugins[T.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Zt,setItem:Yt,removeItem:Tr},i=(function(I){return function(T,$,F){return $.getState("user")[T]||(F&&Ge(F)&&F[T]?F[T]:Pd(I)[T]||Zt(ms(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ps.includes(I)}).sort(),c=new Set(s.concat(vn).filter(function(I){return!ps.includes(I)})),l=Array.from(c).sort(),u=function(){return o},f=new hy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=ey(),S=Pd(a),w=ae({},S,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Gn());var y=ae({enable:function(I,T){return new Promise(function($){R.dispatch({type:ne.enablePlugin,plugins:Zo(I),_:{originalAction:ne.enablePlugin}},$,[T])})},disable:function(I,T){return new Promise(function($){R.dispatch({type:ne.disablePlugin,plugins:Zo(I),_:{originalAction:ne.disablePlugin}},$,[T])})}},n.methods),m=!1,b={identify:function(I,T,$,F){try{var Z=jt(I)?I:null,V=Ge(I)?I:T,he=$||{},oe=b.user();Yt(ms(Ot),Z);var le=Z||V.userId||i(Ot,b,V);return Promise.resolve(new Promise(function(se){R.dispatch(ae({type:ne.identifyStart,userId:le,traits:V||{},options:he,anonymousId:oe.anonymousId},oe.id&&oe.id!==Z&&{previousId:oe.id}),se,[T,$,F])}))}catch(se){return Promise.reject(se)}},track:function(I,T,$,F){try{var Z=Ge(I)?I.event:I;if(!Z||!jt(Z))throw new Error("EventMissing");var V=Ge(I)?I:T||{},he=Ge($)?$:{};return Promise.resolve(new Promise(function(oe){R.dispatch({type:ne.trackStart,event:Z,properties:V,options:he,userId:i(Ot,b,T),anonymousId:i(lr,b,T)},oe,[T,$,F])}))}catch(oe){return Promise.reject(oe)}},page:function(I,T,$){try{var F=Ge(I)?I:{},Z=Ge(T)?T:{};return Promise.resolve(new Promise(function(V){R.dispatch({type:ne.pageStart,properties:by(F),options:Z,userId:i(Ot,b,F),anonymousId:i(lr,b,F)},V,[I,T,$])}))}catch(V){return Promise.reject(V)}},user:function(I){if(I===Ot||I==="id")return i(Ot,b);if(I===lr||I==="anonId")return i(lr,b);var T=b.getState("user");return I?gd(T,I):T},reset:function(I){return new Promise(function(T){R.dispatch({type:ne.resetStart},T,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(ne.ready,function(T){I&&I(T),m=!0})},on:function(I,T){if(!I||!We(T))return!1;if(I===ne.bootstrap)throw new Error(".on disabled for "+I);var $=/Start$|Start:/;if(I==="*"){var F=function(oe){return function(le){return function(se){return se.type.match($)&&T({payload:se,instance:b,plugins:o}),le(se)}}},Z=function(oe){return function(le){return function(se){return se.type.match($)||T({payload:se,instance:b,plugins:o}),le(se)}}};return h(F,on),h(Z,sn),function(){d(F,on),d(Z,sn)}}var V=I.match($)?on:sn,he=function(oe){return function(le){return function(se){return se.type===I&&T({payload:se,instance:b,plugins:o,abort:p}),le(se)}}};return h(he,V),function(){return d(he,V)}},once:function(I,T){if(!I||!We(T))return!1;if(I===ne.bootstrap)throw new Error(".once disabled for "+I);var $=b.on(I,function(F){T({payload:F.payload,instance:b,plugins:o,abort:p}),$()});return $},getState:function(I){var T=R.getState();return I?gd(T,I):Object.assign({},T)},dispatch:function(I){var T=jt(I)?{type:I}:I;if(vn.includes(T.type))throw new Error("reserved action "+T.type);var $=ae({},T,{_:ae({originalAction:T.type},I._||{})});R.dispatch($)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,T,$){R.dispatch({type:ne.setItemStart,key:I,value:T,options:$})},removeItem:function(I,T){R.dispatch({type:ne.removeItemStart,key:I,options:T})}},setAnonymousId:function(I,T){b.storage.setItem(Ut,I,T)},events:{core:vn,plugins:s}},O=n.middlewares.concat([function(I){return function(T){return function($){return $.meta||($.meta=Nd()),T($)}}},v(on),fy(b,u,{all:l,plugins:s}),dy(a),oy(b),cy(b),v(sn)]),A={context:Py,user:sy(a),page:Iy,track:my,plugins:vy(u),queue:yy},L=gr,z=gr;if(Ne&&t.debug){var B=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;B&&(L=B({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Fv():Ge(typeof arguments[0])?Ld():Ld().apply(null,arguments)}}var ie,q=(function(I){return Object.keys(I).reduce(function(T,$){return Ey.includes($)||(T[$]=I[$]),T},{})})(t),D=n.pluginsArray.reduce(function(I,T){var $=T.name,F=T.config,Z=T.loaded,V=n.pluginEnabled[$];return I[$]={enabled:V,initialized:!!V&&!T.initialize,loaded:!!Z({config:F}),config:F},I},{}),N={context:q,user:w,plugins:D},R=Av((function(I){for(var T=Object.keys(I),$={},F=0;F<T.length;F++){var Z=T[F];typeof I[Z]===Ct&&($[Z]=I[Z])}var V,he=Object.keys($);try{(function(oe){Object.keys(oe).forEach(function(le){var se=oe[le];if(typeof se(void 0,{type:hs})===Pt||typeof se(void 0,{type:ny})===Pt)throw new Error(Kr+" "+le+" "+Pt)})})($)}catch(oe){V=oe}return function(oe,le){if(oe===void 0&&(oe={}),V)throw V;for(var se=!1,_e={},Ae=0;Ae<he.length;Ae++){var Me=he[Ae],Re=oe[Me],Je=(0,$[Me])(Re,le);if(typeof Je===Pt){var lt=ay(Me,le);throw new Error(lt)}_e[Me]=Je,se=se||Je!==Re}return se?_e:oe}})(ae({},A,e)),N,z(L(iy.apply(void 0,O))));R.dispatch=(ie=R.dispatch,function(I,T,$){var F=ae({},I,{meta:Nd(I.meta,T,Zo($))});return ie.apply(null,[F])});var Y=Object.keys(o);R.dispatch({type:ne.bootstrap,plugins:Y,config:q,params:g,user:w,initialUser:r,persistedUser:S});var te=Y.filter(function(I){return n.pluginEnabled[I]}),Q=Y.filter(function(I){return!n.pluginEnabled[I]});return R.dispatch({type:ne.registerPlugins,plugins:Y,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,T){var $=I.bootstrap,F=I.config,Z=I.name;$&&We($)&&$({instance:b,config:F,payload:I}),R.dispatch({type:ne.registerPluginType(Z),name:Z,enabled:n.pluginEnabled[Z],plugin:I}),n.pluginsArray.length===T+1&&R.dispatch({type:ne.initializeStart,plugins:te,disabled:Q})}),Ty(function(I){R.dispatch({type:I?ne.offline:ne.online})}),(function(I,T,$){setInterval(function(){return Uv(I,T,$)},3e3)})(R,u,b),b}var on="before",sn="after",Gt="cookie",Ft=Hv(),Kv=Wn,Ry=Wn;function zv(t){return Ft?Wn(t,"",-1):Tr(t)}function Hv(){if(Ft!==void 0)return Ft;var t=Gt+Gt;try{Wn(t,t),Ft=document.cookie.indexOf(t)!==-1,zv(t)}catch{Ft=!1}return Ft}function Wn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Ft===!1&&(o?Yt(t,e):Zt(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 Et="localStorage",Oy=Gs.bind(null,Et);kr(Et,"getItem",Zt);kr(Et,"setItem",Yt);kr(Et,"removeItem",Tr);var _t="sessionStorage",Cy=Gs.bind(null,_t);kr(_t,"getItem",Zt);kr(_t,"setItem",Yt);kr(_t,"removeItem",Tr);function hr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ge(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var Ay=Oy(),jy=Cy(),Uy=Hv();function Wt(t,e){if(t){var r=Ws(e),n=!Ys(r),a=Vs(r)?hr(localStorage.getItem(t)):void 0;if(n&&!ur(a))return a;var i=Js(r)?hr(Kv(t)):void 0;if(n&&i)return i;var o=Zs(r)?hr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Zt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function En(t,e,r){if(t&&!ur(e)){var n={},a=Ws(r),i=JSON.stringify(e),o=!Ys(a);return Vs(a)&&(n[Et]=cn(Et,e,hr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[Et]:Js(a)&&(n[Gt]=cn(Gt,e,hr(Kv(t))),Ry(t,i),o)?n[Gt]:Zs(a)&&(n[_t]=cn(_t,e,hr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[_t]:(n[Ht]=cn(Ht,e,Zt(t)),Yt(t,e),o?n[Ht]:n)}}function qy(t,e){if(t){var r=Ws(e),n=Wt(t,_v),a={};return!ur(n.localStorage)&&Vs(r)&&(localStorage.removeItem(t),a[Et]=n.localStorage),!ur(n.cookie)&&Js(r)&&(zv(t),a[Gt]=n.cookie),!ur(n.sessionStorage)&&Zs(r)&&(sessionStorage.removeItem(t),a[_t]=n.sessionStorage),!ur(n.global)&&Vn(r,Ht)&&(Tr(t),a[Ht]=n.global),a}}function Ws(t){return t?jt(t)?t:t.storage:Ev}function Vs(t){return Ay&&Vn(t,Et)}function Js(t){return Uy&&Vn(t,Gt)}function Zs(t){return jy&&Vn(t,_t)}function Ys(t){return t===_v||t==="all"}function Vn(t,e){return t===Ev||t===e||Ys(t)}function cn(t,e,r){return{location:t,current:e,previous:r}}var Ly={setItem:En,getItem:Wt,removeItem:qy};function Ny(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $d(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 xd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$d(Object(r),!0).forEach(function(n){Ny(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$d(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $y(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Ly};return ky(xd(xd({},e),t))}const Xs="@sesamy/sesamy-js",Jn="1.46.0";function xy(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(...c){const l=c[2]?.toString()||"",u=My(l);return a!==u&&(a=u,setTimeout(()=>t(l),0)),s.apply(r,c)}})}function Dy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function My(t){return["#","?"].forEach(e=>t=Dy(t,e)),t}function Fy(){xy(()=>{St.page()})}var Yo="up",Xo="down";function Ky(t){if(t===void 0&&(t={}),!Ne)return ds;var e=Md(),r=gs(),n=Dd(),a=un(n,e),i=un(r,e),o=[],s=[],c=[],l=n,u=a,f=i,h=Object.keys(t);if(!h.length)return ds;var d=h.map(function(p){return Number(p)}),v=ry(function(){var p=Md(),g=(function(q,D){return D.map(function(N){return N===100?q-5:q*(N/100)})})(p,d),S=gs(),w=Dd(),y=un(w,p),m=un(S,p);if(u=y>u?y:u,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,O=Yo;b?O="initial":l<=w&&(O=Xo);var A=g,L=d;(O===Yo||b)&&(A=g.slice().reverse(),L=d.slice().reverse());var z=L.reduce(function(q,D,N){var R=A[N];return c.includes(D)&&w<=R&&(c=c.filter(function(Y){return Y!==D}),q.singleFunction=D),O===Xo&&!o.includes(D)&&w>=R&&D>i?(s.push(D),q.callbacks=q.callbacks.concat(D),q):O===Yo&&!o.includes(D)&&w<=R&&D<=y?(q.foundFunc=[D],q):(b&&w>=R&&q.foundFunc.length===0&&(q.foundFunc=[D]),!s.includes(D)&&w>=R&&(s.push(D),q.singleFunction?c.push(D):q.singleFunction=D),q)},{foundFunc:[],singleFunction:null,callbacks:[],direction:O});if(l=w,O===Xo&&z.callbacks&&z.callbacks.forEach(function(q){We(t[q])&&(t[q]({trigger:q,direction:O,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(q))}),z.singleFunction){var B=z.singleFunction,ie=z.direction;We(t[B])&&t[B]({trigger:B,direction:ie,scrollMin:f,scrollMax:u,range:[f,u]}),o.push(B)}}},500);return window.addEventListener("scroll",v),function(){return window.removeEventListener("scroll",v)}}function gs(){return Ne?document.body.scrollTop||document.documentElement.scrollTop:0}function zy(){return Ne?window.innerHeight||document.documentElement.clientHeight:0}function Dd(){return Math.round(gs()+zy())}function Md(){if(!Ne)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function un(t,e){return Math.round(t/e*100)}var Qs="Event",Fd=Qs+"Listener";function Hy(t){return function(e,r,n,a){var i=n||ds,o=a||!1;if(!Ne)return i;var s=_n(r),c=_n(e,!0);if(!c.length)throw new Error("noElements");if(!s.length)throw new Error("no"+Qs);var l=[];return(function u(f){f&&(l=[]);for(var h=f?"add"+Fd:"remove"+Fd,d=0;d<c.length;d++){var v=c[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 u.bind(null,!f)})(t)}}function _n(t,e){if(jt(t))return e?_n(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=Yg(t);return e?i.map(function(o){return jt(o)?_n(o,!0):o}).flat():i}function By(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var Qo=Hy(Qs);function Bv(t,e){return Ne&&We(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),We(r)?function(){r.apply(a,arguments),n.apply(a,arguments)}:n):window[t]=e;var r,n,a}Bv.bind(null,"onerror");Bv.bind(null,"onload");var Gv=typeof window>"u",Kd="hidden";function Gy(t){if(Gv)return!1;var e=Wy(),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 Wy(){var t=["webkit","moz","ms","o"];return Gv||Kd in document?Kd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Vy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Jy(t,e){e===void 0&&(e={});var r=(function(o,s){var c=this,l=!1;return function(u){l||(o.call(c,u),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=Gy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Vy.map(function(s){return Qo(document,s,r)})).concat(Qo(window,"load",r)).concat(Qo(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Zy(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,c=t.throttle,l=c===void 0?2e3:c,u=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(g){d(),i&&!u&&i(qr(h),g),a&&u&&(u=!1,a(qr(r),g),h=new Date),e=setTimeout(function(){u=!0,n&&(r=new Date,n(qr(h),g))},s)}var p=Jy(v,{throttle:l});return{disable:function(){f=!0,u=!1,d();var g=p();return function(){return f=!1,h=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:u,isDisabled:f,active:u?0:qr(h,f),idle:u?qr(r,f):0}}}}function qr(t,e){return e?0:Math.round((new Date-t)/1e3)}const zd=5e3;class Yy{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),Zy({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:zd}),Ky({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*zd: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 Wv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Xy(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(c){return n=a.push(c),n>=i&&o(),n},size:function(){return a.length},end:function(c){c&&o(),clearInterval(r)}}}const Hd="sesamy_session_id";function Qy(){let t=sessionStorage.getItem(Hd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Hd,t)),t}function Vv(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),c=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${c})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}let Ye={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"}},Jv=[],pn;function Zv(){const t=window.location.pathname;return Jv.find(e=>e.path?t.includes(e.path):!0)}function ew(t,e){Jv=t.content||[];const r=Zv();r&&r.type==="article"&&(Ye={...Ye,...r.selectors}),pn=e}function tw(t,e){const{selector:r}=e;return r===Ye.article.selector?t:t.querySelector(r)}function Yv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Yv(t.parentElement,e):t.textContent??void 0}function vr(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 Xv({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||vr(`sesamy:${e}`)||vr(`og:${e}`)||vr(e)||r}function rw(){const t=document.querySelectorAll(Ye.article.selector);return Array.from(t).map(ec).filter(e=>e!==null)}function ec(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Vv(e)},n=(i,o,s,c)=>{const l=tw(e,o);if(l){const u=Yv(l,o)||Xv({publisherContentId:s,key:i});u!==void 0&&(r[i]=c?c(u):u)}};n("id",Ye.id),n("title",Ye.title,r.id),n("excerpt",Ye.excerpt,r.id),n("image",Ye.image,r.id),n("price",Ye.price,r.id,i=>parseFloat(i)),n("currency",Ye.currency,r.id),n("url",Ye.url,r.id),n("pass",Ye.pass,r.id),n("accessLevel",Ye.accessLevel,r.id,i=>i||"entitlement");const a=Zv();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 nw(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=ec(r);if(!n?.url)throw new Error("Could not find content for element");const a=await pn.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await pn.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Vv(r.parentElement||r);return pn.proxy.getContent(i.token,n.url,o)}let Qv=!1,mn,Tn,ys;function ep(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:ys,requestId:Math.random().toString(36).slice(2,9),sessionId:Qy(),timestamp:new Date().toISOString(),version:Jn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:vr("sesamy:item-src"),publisherContentId:vr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Xs,userAgent:navigator.userAgent,clientId:ys}}}))}const tp=Xy(async t=>{if(t.length>0){const e=ep(t);Qv?navigator.sendBeacon(Tn,e):(await fetch(Tn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function es(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Tn,ep([e]))}else tp.push(t)}function aw(){return Qv=!0,tp.flush()}function iw(t,e,r){mn=e,Tn=`${vt("logs",r)}/events`,ys=t}const ow={name:"custom-analytics-plugin",page:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;es({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;es({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n}=t;es({anonymousId:r,userId:n,properties:e,type:"identify"})}},Bd=["source","medium","campaign","term","content"],At="utm_",sw=1800*1e3;function rp(t){return t?Date.now()-parseInt(t,10)>sw:!0}function Gd(){const t=document.referrer||"";if(!t)return;const e=Wt(`${At}set_at`);(rp(e)||!Wt(`${At}referrer`))&&En(`${At}referrer`,t)}function cw(){const t=()=>{const r={};for(const a of Bd){const i=Wt(`${At}${a}`);i&&(r[`utm_${a}`]=i)}const n=Wt(`${At}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Gd()},campaign({payload:r}){const n=r?.campaign||{},a=Wt(`${At}set_at`);if(Object.keys(n).length>0&&rp(a)){for(const o of Bd){const s=n[o];s&&En(`${At}${o}`,s)}En(`${At}set_at`,String(Date.now()))}Gd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const uw=cw(),Wd=new Map,Vd=new Map;function lw({clientId:t,enabled:e=!0,environment:r}){iw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Vd.forEach((n,a)=>{n.bind(a)()}),aw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Wd.forEach((n,a)=>{n.bind(a)()})}),Fy(),Wv(()=>{const n=new Yy({element:document.body,viewCallback:()=>{St.page()},activeDurationCallback:(a,i,o)=>{St.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{St.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{St.track("scroll",{scroll:a.scrollMax})}});Vd.set(document.body,()=>{n.flush()}),Wd.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Ve.AUTHENTICATED,async n=>{const a=n;await St.identify(a.detail.sub)}),window.addEventListener(Ve.LOGOUT,async()=>{await St.track("logout",{}),await St.reset()}))}const St=$y({app:Xs,version:Jn,plugins:[uw,ow]});function np(t,e){St.track(t,e)}function ap(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});np(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function fw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function dw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function hw(){return/android/i.test(navigator.userAgent)}let Le,ip,zr,ws=!1,gn=!1;Br()&&window.addEventListener("pageshow",()=>{gn=!1});const yr="sesamyAccessToken",ts="sesamyRefreshToken",kn="sesamySilentAuthThrottle",vw=300*1e3;async function Zn(){return ws?!0:new Promise((t,e)=>{const r=setTimeout(()=>{ws?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Ve.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function pw(t){if(!t)return null;const e=localStorage.getItem(ts);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(ts),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(ts,i.refresh_token),localStorage.setItem(yr,i.access_token),i.access_token}catch{nc()}}async function tc(){const t=localStorage.getItem(yr);if(!t)return null;const e=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await pw(e);if(r)return r;localStorage.removeItem(yr)}return t}let ln=null;const mw=64;function gw(){try{if(ln!==null)return ln;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===mw)return ln=!0,!0}}catch(t){pe(`Error checking for existing auth0 tokens: ${t.message}`)}return ln=!1,!1}function yw(t){if(t.domains&&t.domains.length>0){const e=wr(window.location.href);if(e){for(const r of t.domains)if(wr(`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 wr(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 ww(t){if(t.enabled===!1)return;ip=t.organization;const e=yw(t);zr=e&&!gw()?e:Pv("token",t.environment);const r={domain:zr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",wr(window.location.href)!==wr(`https://${zr}`)&&(r.useRefreshTokens=!0),pe(`Initializing auth0 client: ${JSON.stringify(r)}`),Le=await Eg(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 c=await Le.handleRedirectCallback();pe(`Login result: ${JSON.stringify(c)}`);const l=await Le.getUser();if(!l)throw pe("No user found"),new Error("No user found");pe(`User found ${JSON.stringify(l)}`),rc(),qt(Ve.AUTHENTICATED,l),pe("Rewrite url")}catch(c){alert("There was an error logging in"),console.error(c)}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())}ws=!0,qt(Ve.AUTH_INITIALIZED,{})}async function Wr(){return await Zn(),await tc()?!0:Le?Le.isAuthenticated():!1}async function bw(){return await Zn(),await tc()?(pe("Using local user"),{sub:"local",name:"Local User"}):Le?Le.getUser():null}function op(t){if(gn)return pe("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(yr),!Le)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:ip,redirect_uri:window.location.href,ui_locales:bn(),incognito:Bs(),...e}}}async function Yn(t){const e=op(t);if(e)return Le.loginWithRedirect(e)}async function sp(t){const e=op(t);if(!e)return;await Le.loginWithPopup(e,{timeoutInSeconds:1800}),rc(),ap(Ve.AUTHENTICATED,await Le.getUser()).canceled||window.location.reload()}async function Sw(t){return zr&&wr(window.location.href)!==wr(`https://${zr}`)&&(dw()||hw()||Bs())?sp(t):Yn(t)}function Iw(){try{const t=sessionStorage.getItem(kn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<vw}catch{return sessionStorage.removeItem(kn),!1}}function Pw(){try{const t={timestamp:Date.now()};sessionStorage.setItem(kn,JSON.stringify(t))}catch{pe("Failed to set silent auth throttle in sessionStorage")}}function rc(){try{sessionStorage.removeItem(kn)}catch{}}async function xt(t=!0,e=!1){await Zn();const r=await tc();if(r)return r;if(!e&&Iw()){if(pe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Le)return pe("Auth client not initialized"),null;let n=await Le.getTokenSilently();const a=ac(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Le.getTokenSilently({cacheMode:e?"off":"on"})),rc(),n}catch(n){const a=n;if(pe(`Failed to get token silently: ${a.message}`),Pw(),await Le.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await nc(),t)throw n;return null}}async function nc(t={}){if(await Zn(),localStorage.removeItem(yr),qt(Ve.LOGOUT,{}),!!Le)return pe(`Logout with options: ${JSON.stringify(t)}`),Le.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function ac(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 bs(t){const e=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");pe("Set token"),localStorage.setItem(yr,t),qt(Ve.AUTHENTICATED,e)}const Ew=(t,e)=>e.skipDedupe||e.method!=="GET",_w=(t,e)=>e.method+"@"+t,Tw=t=>t.clone(),Jd=({skip:t=Ew,key:e=_w,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((c,l)=>{n.get(s).push([c,l])});try{return a(i,o).then(c=>(n.get(s).forEach(([l])=>l(r(c))),n.delete(s),c)).catch(c=>{throw n.get(s).forEach(([,l])=>l(c)),n.delete(s),c})}catch(c){return n.delete(s),Promise.reject(c)}}},kw=(t,e)=>t*e,Rw=t=>t&&t.ok,Zd=({delayTimer:t=500,delayRamp:e=kw,maxAttempts:r=10,until:n=Rw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>c=>(l,u)=>{let f=0;if(s&&s(l,u))return c(l,u);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(g=>{const S=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:u})).then((w={})=>{var y,m;g(c((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:u))}):g(c(l,u))},S)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return c(l,u).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};var Ow=Object.defineProperty,Cw=(t,e,r)=>e in t?Ow(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xr=(t,e,r)=>Cw(t,typeof e!="symbol"?e+"":e,r),Rn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Rn||{});class Hr extends Error{constructor(e,r,n,a,i){super(a),xr(this,"status"),xr(this,"statusText"),xr(this,"url"),xr(this,"body"),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Hr)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isAuthError(){return this.status===401}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}const Aw="application/json",cp="Content-Type",or=Symbol(),up=Symbol();function Yd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===cp.toLowerCase()))===null||e===void 0?void 0:e[1]}function Xd(t){return/^application\/.*json.*/.test(t)}const Vt=function(t,e,r=!1){return Object.entries(e).reduce((n,[a,i])=>{const o=t[a];return Array.isArray(o)&&Array.isArray(i)?n[a]=r?[...o,...i]:i:typeof o=="object"&&typeof i=="object"?n[a]=Vt(o,i,r):n[a]=i,n},{...t})},br={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function jw(t,e=!1){br.options=e?t:Vt(br.options,t)}function Uw(t,e=!1){br.polyfills=e?t:Vt(br.polyfills,t)}function qw(t){br.errorType=t}const Lw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class lp extends Error{}const Nw=t=>{const e=Object.create(null);t=t._addons.reduce((y,m)=>m.beforeRequest&&m.beforeRequest(y,t._options,e)||y,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:c}=t,l=new Map(i),u=Vt(a.options,n);let f=r;const h=Lw(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,u),d=new Error,v=h.catch(y=>{throw{[or]:y}}).then(y=>{var m;if(!y.ok){const b=new lp;if(b.cause=d,b.stack=b.stack+`
36
+ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const O=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?O?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(O&&typeof A=="string"){b.text=A;try{b.json=JSON.parse(A)}catch{}}else b[a.errorType]=A;throw b})}return y}),p=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,or),O=b?m[or]:m,A=O?.status&&l.get(O.status)||l.get(O?.name)||b&&l.has(or)&&l.get(or);if(A)return A(O,t);const L=l.get(up);if(L)return L(O,t);throw O}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.then(b=>m?m(b):b)),S={_wretchReq:t,_fetchReq:h,_sharedState:e,res:g(null),json:g("json"),blob:g("blob"),formData:g("formData"),arrayBuffer:g("arrayBuffer"),text:g("text"),error(y,m){return l.set(y,m),this},badRequest(y){return this.error(400,y)},unauthorized(y){return this.error(401,y)},forbidden(y){return this.error(403,y)},notFound(y){return this.error(404,y)},timeout(y){return this.error(408,y)},internalError(y){return this.error(500,y)},fetchError(y){return this.error(or,y)}},w=c.reduce((y,m)=>({...y,...typeof m.resolver=="function"?m.resolver(y):m.resolver}),S);return o.reduce((y,m)=>m(y,t),w)},$w={_url:"",_options:{},_config:br,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:Vt(this._config.polyfills,t)}}},url(t,e=!1){if(e)return{...this,_url:t};const r=this._url.split("?");return{...this,_url:r.length>1?r[0]+t+"?"+r[1]:this._url+t}},options(t,e=!1){return{...this,_options:e?t:Vt(this._options,t)}},headers(t){const e=t?Array.isArray(t)?Object.fromEntries(t):"entries"in t?Object.fromEntries(t.entries()):t:{};return{...this,_options:Vt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[cp]:t})},auth(t){return this.headers({Authorization:t})},catcher(t,e){const r=new Map(this._catchers);return r.set(t,e),{...this,_catchers:r}},catcherFallback(t){return this.catcher(up,t)},resolve(t,e=!1){return{...this,_resolvers:e?[t]:[...this._resolvers,t]}},defer(t,e=!1){return{...this,_deferred:e?[t]:[...this._deferred,t]}},middlewares(t,e=!1){return{...this,_middlewares:e?t:[...this._middlewares,...t]}},fetch(t=this._options.method,e="",r=null){let n=this.url(e).options({method:t});const a=Yd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Xd(a));return n=r?o?n.json(r,a):n.body(r):n,Nw(n._deferred.reduce((s,c)=>c(s,s._url,s._options),n))},get(t=""){return this.fetch("GET",t)},delete(t=""){return this.fetch("DELETE",t)},put(t,e=""){return this.fetch("PUT",e,t)},post(t,e=""){return this.fetch("POST",e,t)},patch(t,e=""){return this.fetch("PATCH",e,t)},head(t=""){return this.fetch("HEAD",t)},opts(t=""){return this.fetch("OPTIONS",t)},body(t){return{...this,_options:{...this._options,body:t}}},json(t,e){const r=Yd(this._options.headers);return this.content(e||Xd(r)&&r||Aw).body(JSON.stringify(t))}};function st(t="",e={}){return{...$w,_url:t,_options:e}}st.default=st;st.options=jw;st.errorType=qw;st.polyfills=Uw;st.WretchError=lp;const xw=(t,e)=>e.skipDedupe||e.method!=="GET",Dw=(t,e)=>e.method+"@"+t,Mw=t=>t.clone(),Fw=({skip:t=xw,key:e=Dw,resolver:r=Mw}={})=>{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((c,l)=>{n.get(s).push([c,l])});try{return a(i,o).then(c=>(n.get(s).forEach(([l])=>l(r(c))),n.delete(s),c)).catch(c=>{throw n.get(s).forEach(([,l])=>l(c)),n.delete(s),c})}catch(c){return n.delete(s),Promise.reject(c)}}},Kw=(t,e)=>e.skipCache||e.method!=="GET",zw=(t,e)=>e.method+"@"+t,Hw=()=>!1,Bw=()=>null,Gw=t=>t.ok,Ww=({throttle:t=1e3,skip:e=Kw,key:r=zw,clear:n=Hw,invalidate:a=Bw,condition:i=Gw,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,c=new Map,l=new Set,u=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,v)=>{const p=r(d,v);let g=a(d,v);if(g&&(g instanceof Array||(g=[g]),g.forEach(S=>{typeof S=="string"?s.delete(S):S instanceof RegExp&&s.forEach((w,y)=>{S.test(y)&&s.delete(y)})})),n(d,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(p)){if(s.has(p)){const S=s.get(p).clone();return o&&Object.defineProperty(S,o,{value:p,enumerable:!1}),Promise.resolve(S)}else if(c.has(p))return new Promise((S,w)=>{c.get(p).push([S,w])})}return c.has(p)||c.set(p,[]),u(p),h(d,v).then(S=>(i(S.clone())&&s.set(p,S.clone()),c.get(p).forEach(([w])=>w(S.clone())),c.delete(p),S)).catch(S=>{throw c.get(p).forEach(([,w])=>w(S)),c.delete(p),S})};return f.cacheResponse=function(h,d){u(h),s.set(h,d)},f.cache=s,f.inflight=c,f.throttling=l,f},Vw=(t,e)=>t*e,Jw=t=>t&&t.ok,Zw=({delayTimer:t=500,delayRamp:e=Vw,maxAttempts:r=10,until:n=Jw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>c=>(l,u)=>{let f=0;if(s&&s(l,u))return c(l,u);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(g=>{const S=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,url:l,options:u})).then((w={})=>{var y,m;g(c((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:u))}):g(c(l,u))},S)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(v||new Error("Number of attempts exceeded."))));return c(l,u).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},Yw="@sesamy/sdk",Xw="1.2.0";class Qw{constructor(){xr(this,"cache",new Map)}get(e){return this.cache.get(e)||null}set(e,r){this.cache.set(e,r)}remove(e){this.cache.delete(e)}clear(){this.cache.clear()}}const Dr="sesamyCacheTimestamp",eb=t=>{const{libraryName:e=Yw,libraryVersion:r=Xw,cache:n}=t,a=n?.storage||new Qw,i=[s=>async(c,l)=>{if(n?.mode===Rn.BROWSER){let u;typeof sessionStorage<"u"?(u=sessionStorage.getItem(Dr),u||(u=Date.now().toString(),sessionStorage.setItem(Dr,u))):(u=a.get(Dr),u||(u=Date.now().toString(),a.set(Dr,u)));const f={...l,headers:{...l.headers,"Cache-Timestamp":u}};return s(c,f)}return s(c,l)},s=>async(c,l)=>{const u=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:`Bearer ${u}`}};return s(c,f)},Fw()];n?.mode===Rn.NORMAL&&i.push(Ww({throttle:300*1e3,skip:(s,c)=>c.method!=="GET"})),i.push(Zw({delayTimer:1e3,delayRamp:(s,c)=>s*c,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=st(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.vendorId&&{"tenant-id":t.vendorId},...t.headers}).middlewares(i);return{async request(s,c={}){try{let l=o.url(s);c.headers&&(l=l.headers(c.headers));const u=(c.method||"GET").toLowerCase();let f;switch(u){case"get":f=l.get();break;case"post":f=l.post(c.body?JSON.parse(c.body):void 0);break;case"put":f=l.put(c.body?JSON.parse(c.body):void 0);break;case"patch":f=l.patch(c.body?JSON.parse(c.body):void 0);break;case"delete":f=l.delete();break;default:f=l.get()}const h=await f.res();if(h.status===204)return null;if(!h.ok){const d=await h.text().catch(()=>"Unknown error");throw new Hr(h.status,h.statusText,h.url,`API Error ${h.status}: ${d}`,d)}return await h.json()}catch(l){if(l instanceof Hr)throw l;const u=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Hr(u,f,h,`API Error ${u}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},tt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Dr),"Cache cleared"),Lr={get:async(t,e)=>t.request(`/profile/${e}`),update:async(t,e,r)=>t.request(`/profile/${e}`,{method:"PATCH",body:JSON.stringify(r)}),checkSpotifyLink:async t=>t.request("/profile/spotify-link"),unlinkSpotify:async t=>t.request("/profile/unlink-spotify",{method:"POST"}),delete:async t=>{await t.request("/profile",{method:"DELETE"})}},rs={list:async(t,e)=>{const r=new URLSearchParams;e!=null&&e.type&&r.append("type",e.type),e!=null&&e.sku&&r.append("sku",e.sku),e!=null&&e.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),e!=null&&e.waitForEntitlementAfter&&r.append("wait-for-entitlement-after",e.waitForEntitlementAfter);const n=r.toString(),a=n?`/entitlements?${n}`:"/entitlements";return t.request(a)},get:async(t,e)=>t.request(`/entitlements/${e}`),getAccess:async(t,e)=>t.request(`/entitlements/${e}/access`)},Qd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},eh={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Nr={list:async t=>t.request("/contracts"),get:async(t,e)=>t.request(`/contracts/${e}`),cancel:async(t,e)=>t.request(`/contracts/${e}/cancel`,{method:"POST"}),createAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments`,{method:"POST",body:JSON.stringify(r)}),confirmAmendment:async(t,e,r)=>t.request(`/contracts/${e}/amendments/${r}/confirm`,{method:"POST"})},ns={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},fn={list:async t=>t.request("/tallies"),get:async(t,e)=>t.request(`/tallies/${e}`),update:async(t,e,r)=>t.request(`/tallies/${e}`,{method:"PUT",body:JSON.stringify(r)}),create:async(t,e)=>t.request("/tallies",{method:"POST",body:JSON.stringify(e)})},as={list:async t=>t.request("/tags"),add:async(t,e)=>{await t.request("/tags",{method:"POST",body:JSON.stringify({tag:e})})},remove:async(t,e)=>{await t.request(`/tags/${e}`,{method:"DELETE"})}},is={create:async(t,e)=>t.request("/checkout",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkout/${e}`),update:async(t,e,r)=>t.request(`/checkout/${e}`,{method:"PATCH",body:JSON.stringify(r)})},th={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},rh={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},tb={get:async(t,e)=>t.request(`/paywalls/${e}`)},rb={list:async t=>t.request("/payment-issues")},nb={content:async(t,e,r,n,a)=>{const i=new URLSearchParams({url:e});return r&&i.append("selector",r),n&&i.append("cache",n),t.request(`/proxy?${i.toString()}`,a)}},ab={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},nh={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ib=t=>{const e=eb(t);return{profile:{get:r=>Lr.get(e,r),update:(r,n)=>Lr.update(e,r,n),checkSpotifyLink:()=>Lr.checkSpotifyLink(e),unlinkSpotify:()=>Lr.unlinkSpotify(e),delete:()=>Lr.delete(e)},entitlements:{list:r=>rs.list(e,r),get:r=>rs.get(e,r),getAccess:r=>rs.getAccess(e,r)},subscriptions:{list:()=>Qd.list(e),get:r=>Qd.get(e,r)},products:{get:r=>eh.get(e,r),autoOnboard:r=>eh.autoOnboard(e,r)},contracts:{list:()=>Nr.list(e),get:r=>Nr.get(e,r),cancel:r=>Nr.cancel(e,r),createAmendment:(r,n)=>Nr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Nr.confirmAmendment(e,r,n)},userMetadata:{get:()=>ns.get(e),set:(r,n)=>ns.set(e,r,n),delete:r=>ns.delete(e,r)},tallies:{list:()=>fn.list(e),get:r=>fn.get(e,r),update:(r,n)=>fn.update(e,r,n),create:r=>fn.create(e,r)},tags:{list:()=>as.list(e),add:r=>as.add(e,r),remove:r=>as.remove(e,r)},checkout:{create:r=>is.create(e,r),get:r=>is.get(e,r),update:(r,n)=>is.update(e,r,n)},bills:{list:()=>th.list(e),get:r=>th.get(e,r)},fulfillments:{list:()=>rh.list(e),create:r=>rh.create(e,r)},paywall:{get:r=>tb.get(e,r)},paymentIssues:{list:()=>rb.list(e)},proxy:{content:(r,n,a,i)=>nb.content(e,r,n,a,i)},transactions:{list:r=>ab.list(e,r)},vendor:{get:()=>nh.get(e),list:()=>nh.list(e)}}};class ob{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 Ss(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function fp(t,e){if(Ss(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 ah(t){return t.endsWith("/")?t.slice(0,-1):t}function ih(t,e){if(!Ss(t)||!Ss(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&ah(r.pathname)===ah(n.pathname)}function sb(t,e,r){const n=new URL(`${vt("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:c,itemSrc:l}=fp(e.itemSrc,e.purchaseOptionId);l&&n.searchParams.set("url",l),s&&n.searchParams.set("sku",s),c&&n.searchParams.set("po-id",c)}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[c,l]=s.trim().split("=");return{key:c,value:l}}).filter(s=>a.some(c=>c===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:c})=>c?c.map(l=>`${s}|${l}`):s).join(",")),n}const dp="sesamySignedURLs";function ic(){const t=sessionStorage.getItem(dp);return t?JSON.parse(t):[]}function cb(t){const e=ic();e.push(t),pe(`Adding signed URL: ${t}`),sessionStorage.setItem(dp,JSON.stringify(e))}function ub(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Is="sesamyAttribution";function lb(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 fb(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function On(){return lb(Is)||{}}function hp(t){if(t===null)localStorage.removeItem(Is);else{pe(`Setting attribution ${JSON.stringify(t)}`);const e=On()??{},r=ub({...e,...fb(t)});localStorage.setItem(Is,JSON.stringify({value:r}))}}function db(t){const e=t.endpoint||vt("api2",t.environment),n=ib({baseUrl:e,tokenProvider:async()=>{const k=await xt(!0);if(!k)throw new Error("No access token available");return k},libraryName:Xs,libraryVersion:Jn,vendorId:t.vendorId,cache:{mode:Rn.BROWSER,storage:new ob}}),a=k=>async(K,J)=>{let re=sessionStorage.getItem(pd);re||(re=Date.now().toString(),sessionStorage.setItem(pd,re));const me={...J,headers:{...J.headers,"Cache-Timestamp":re}};return k(K,me)},i=(k=!0)=>K=>async(J,re)=>{let me=null;if(me=await xt(k),!me){if(k)throw new Error("No access token available");return K(J,re)}const Fe={...re,headers:{...re.headers,...me?{Authorization:`Bearer ${me}`}:{}}};return K(J,Fe)},o=k=>(K,J)=>{if(J.headers&&"Authorization"in J.headers)return k(K,J);const re=localStorage.getItem("__anon_id"),me=btoa(`${t.clientId}|${re}:`),Fe={...J,headers:{...J.headers,Authorization:`Basic ${me}`}};return k(K,Fe)},s=st(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Jd(),Zd({delayTimer:1e3,delayRamp:(k,K)=>k*K,maxAttempts:3,until:k=>!!(k&&(k.ok||k.status>=400&&k.status<500)),retryOnNetworkError:!1})]),c=st(e).headers({"Content-Type":"application/json"}).middlewares([a,i(!1),o,Jd(),Zd({delayTimer:1e3,delayRamp:(k,K)=>k*K,maxAttempts:3,until:k=>!!(k&&(k.ok||k.status>=400&&k.status<500)),retryOnNetworkError:!1})]);async function l(k={}){const{waitForEntitlementAfter:K,includeSignedLinks:J=!0}=k,re=await Wr()?await n.entitlements.list({waitForEntitlementAfter:K?.toISOString()}):[];return J&&re.push(...ic()),re}async function u(k,K=[]){return(await l())?.find(me=>{const{sku:Fe,purchaseOption:M}=fp(k);return!!("sku"in me&&Fe===me.sku||M&&"purchaseOptionsId"in me&&M===me.purchaseOptionsId||ih(k,me.url)||K.some(ee=>ih(ee,me.url)))})}async function f(k){return n.entitlements.get(k)}async function h(k){return n.entitlements.getAccess(k)}async function d(k,K,J){const re=new URL(vt("api2",t.environment));return re.pathname="/proxy",re.searchParams.set("url",K),J&&re.searchParams.set("selector",J),st(re.toString()).headers({Authorization:`Bearer ${k}`}).get().text()}async function v(k){if(!k)throw new Error("SKU is required to get fulfillments");return await Wr()?await s.get(`/fulfillments?sku=${encodeURIComponent(k)}`).json():[]}async function p(k,K){if(!k||!K)throw new Error("SKU and itemId are required to request delivery");return(await s.post({sku:k},`/fulfillments/${encodeURIComponent(K)}/request-delivery?`).res()).ok}async function g(){return s.get("/contracts").json()}async function S(k){return(await s.get("/contracts").json())?.find(J=>J.id===k)}async function w(k){const K=await s.post({},`/contracts/${encodeURIComponent(k)}/cancel`).res();return tt(),K.ok}async function y(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),s.get("/subscriptions").json()}async function m(){return s.get("/bills").json()}async function b(k){return(await s.get("/bills").json())?.find(J=>J.id===k)}async function O(){return s.get("/transactions").json()}async function A(k){return(await s.get("/transactions").json())?.find(J=>J.id===k)}async function L(k,K){const J=await s.url(`/user-metadata/${encodeURIComponent(k)}`).put(K).json();return qt(Ve.USER_ATTRIBUTE_CHANGED,{}),tt(),J}async function z(k){const K=await s.url(`/user-metadata/${encodeURIComponent(k)}`).delete().res();return tt(),K.ok}async function B(){return await s.url("/user-metadata").get().json()}async function ie(k){return(await B())[k]||null}async function q(){return await s.url("/tags").get().json()}async function D(k){const K=await s.url(`/tags/${encodeURIComponent(k)}`).delete().res();return tt(),K.ok}async function N(k){const K=await s.url("/tags").post(encodeURIComponent(k)).res();return qt(Ve.USER_ATTRIBUTE_CHANGED,{}),tt(),K.ok}async function R(k){return(await c.url("/tallies").get().json())[k]}async function Y(){return await c.url("/tallies").get().json()}async function te(k){const K=await c.url(`/tallies/${k}`).delete().res();return tt(),K.ok}async function Q(k,K){return await c.url(`/tallies/${encodeURIComponent(k)}/push`).post(K).json()}async function I(k){return n.products.get(k)}async function T(){return await xt(!1)?await s.url("/profile").get().json():null}async function $(k){const K=await s.url("/profile").patch(k).res();return tt(),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(k){const K=await xt(!1);if(!K)throw new Error("No access token available");const J=new URL(`${vt("access-sync",t.environment)}/spotify/sesamy-callback`);J.searchParams.set("access_token",K),J.searchParams.set("state",k),window.location.href=J.toString()}async function oe(k){const K=await s.url(`/products/${encodeURIComponent(k)}/auto-onboard`).post().json();return K.length&&tt(),K}async function le(k,K=3600){const{shortlink:J}=await st(kg).post({url:k,ttl:K}).json();return J}async function se(k){const K=await xt(!1,!0);let J;const re=k.language||bn(),me=On();switch(k.target){case"account":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}${k.contractId?`/${encodeURIComponent(k.contractId)}`:""}`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"change-payment":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.contractId)}/change-payment-method`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"change-plan":J=new URL(`${vt("account",t.environment)}/${encodeURIComponent(k.language||re)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.contractId)}/edit-plan`),J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"consume":J=new URL(`${vt("consume",t.environment)}/${encodeURIComponent(k.language||re)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(k.sku)}`),k.episodeId?J.href+=`/${k.episodeId}`:J.href+="/listen",J.searchParams.set("sesamy-redirect-url",k.redirectUrl||window.location.href);break;case"checkout":J=sb(t,{language:re,...k},me);break;default:throw new Error("Invalid target")}return K&&(J.hash=`#access_token=${K}`),k.shorten?le(J.href,k.ttl):J.href}async function _e(k){const K=On(),J=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(me=>{const Fe=K,[M,ee]=me.trim().split("=");J.includes(M)&&!Fe[M]&&(Fe[M]=ee)}),(await c.url("/checkouts").post({language:bn(),...k,attribution:{...K,...k.attribution},vendorId:t.vendorId})).json()}async function Ae(k,K){return(await c.url(`/checkouts/${k}`).patch(K)).json()}async function Me(k){return(await c.url(`/checkouts/${k}`).get()).json()}async function Re(k){return(await c.url(`/paywalls/${k}`).get()).json()}async function Je(){return(await c.url("/vendor").get()).json()}async function lt(){return(await s.url("/vendors").get()).json()}async function ft(k){return(await s.url(`/contracts/${encodeURIComponent(k.contractId)}/amendments`).post({amendmentType:k.amendmentType,discountCode:k.discountCode})).json()}async function gt(k){return await s.url(`/amendments/${encodeURIComponent(k)}/confirm`).post(),!0}async function yt(){const k=await xt(!1),K=new URL(`${vt("account",t.environment)}/subscriptions/${t.clientId}`);k&&(K.hash=`#access_token=${k}`),window.location.href=K.toString()}return{autoOnboardProduct:oe,cancelContract:w,confirmAmendment:gt,createAmendment:ft,createCheckout:_e,deleteTag:D,deleteTally:te,deleteUserMetadata:z,generateLink:se,getBill:b,getBills:m,getCheckout:Me,getProxyContent:d,getContract:S,getContracts:g,getEntitlement:f,getEntitlementAccess:h,getEntitlements:l,getFulfillments:v,requestDelivery:p,getPaywall:Re,getPaymentIssues:F,getProfile:T,getProduct:I,getSubscriptions:y,getTally:R,getTallies:Y,getTags:q,getTransaction:A,getTransactions:O,getUserMetadata:ie,hasAccess:u,isSpotifyLinked:Z,linkSpotify:he,listUserMetadata:B,openHostedAccountPage:yt,pushTally:Q,setTag:N,setUserMetadata:L,unlinkSpotify:V,updateCheckout:Ae,updateProfile:$,getVendorSettings:Je,listVendors:lt}}const hb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function vb(){return new Promise(t=>{const e=hb.map(r=>{const n=document.createElement("div");return n.innerHTML="&nbsp;",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 pb(){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 vp="sesamyFlags";async function pp(t){try{localStorage.setItem(vp,JSON.stringify(t))}catch{pe("Failed to save flags to localStorage")}}async function mb(t,e){const r=await Xn();r[t]=e,await pp(r)}async function gb(t){return(await Xn())[t]}async function yb(t){const e=await Xn();t in e&&(delete e[t],await pp(e))}async function Xn(){try{const t=localStorage.getItem(vp);return t?JSON.parse(t):{}}catch{return{}}}function wb(t){const{autoOnboardProduct:e,cancelContract:r,createCheckout:n,deleteTag:a,deleteTally:i,deleteUserMetadata:o,generateLink:s,getBill:c,getBills:l,getCheckout:u,getContract:f,getContracts:h,getEntitlement:d,getEntitlementAccess:v,getEntitlements:p,getFulfillments:g,getPaywall:S,getPaymentIssues:w,getProfile:y,getProduct:m,getProxyContent:b,getSubscriptions:O,getTags:A,getTally:L,getTallies:z,getTransaction:B,getTransactions:ie,getUserMetadata:q,getVendorSettings:D,listVendors:N,hasAccess:R,isSpotifyLinked:Y,linkSpotify:te,listUserMetadata:Q,openHostedAccountPage:I,pushTally:T,requestDelivery:$,setTag:F,setUserMetadata:Z,unlinkSpotify:V,updateCheckout:he,updateProfile:oe}=db(t),le={analytics:{track:np},attribution:{get:On,set:hp},auth:{getUser:y,getTokenSilently:xt,isAuthenticated:Wr,loginWithRedirect:Yn,loginWithPopup:sp,login:Sw,logout:nc,setToken:bs},bills:{get:c,list:l},browser:{detectAdblock:vb,isInAppBrowser:pb,isIncognito:Bs},checkouts:{create:n,get:u,update:he},clearCache:tt,content:{list:rw,get:ec,getLanguage:bn,unlock:nw,getPropertyFromHTML:Xv},contracts:{cancel:r,get:f,list:h},entitlements:{access:v,get:d,hasAccess:R,list:p,signedLinks:ic},events:{emit:ap,cancel:fw},flags:{get:gb,set:mb,list:Xn,delete:yb},fulfillments:{list:g,requestDelivery:$},generateLink:s,getPaymentIssues:w,getVersion:bb,isReady:()=>exports.isInitialized,log:pe,paywalls:{get:S},products:{autoOnboard:e,get:m,linkSpotify:te},profile:{get:y,isSpotifyLinked:Y,openHostedAccountPage:I,unlinkSpotify:V,update:oe},proxy:{getContent:b},subscriptions:{list:O},tags:{delete:a,list:A,set:F},tallies:{delete:i,get:L,list:z,push:T},transactions:{get:B,list:ie},userMetadata:{delete:o,get:q,list:Q,set:Z},vendors:{get:D,list:N},setToken:bs};return t.namespace&&(window[t.namespace]=le),le}function bb(){return Jn}function Sb(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=`
38
37
  ${e.selector}::before {
39
38
  content: '';
40
39
  position: absolute;
@@ -45,4 +44,4 @@ CAUSE: `+d.stack,w.response=p,w.status=p.status,w.url=f,p.type==="opaque")throw
45
44
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
46
45
  pointer-events: none;
47
46
  }
48
- `,document.head.appendChild(i)}async function xb(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 lc(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 xb(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 Db(t,e){const r=e.insertionPoint||"inside",n=await lc(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 Mb(t,e){const r=await lc(e);t.innerHTML=r}async function Fb(t,e){const r=await lc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Kb({enabled:t=!1,rules:e}){t&&Qv(async()=>{const r=await Yr(),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 Db(s,a);break;case"replace":await Mb(s,a);break;case"remove":o.remove();break;case"wrap":await Fb(s,a);break;case"gradient":$b(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const dh="access_token";function Hb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(dh);if(e){Es(e);const r=new URL(window.location.href);t.delete(dh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const hh="sesamy-refresh",vh="force-refetch-entitlements";function zb(){const t=new URLSearchParams(window.location.search),e=t.get(vh),r=t.get(hh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(vh),t.delete(hh),n.search=t.toString(),tt(),window.history.replaceState(null,"",n)}}function Bb(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 Gb(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Bb(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOptionsId:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};Eb(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 ph="sesamy-user";async function Wb(){const e=new URLSearchParams(window.location.search).get(ph)?.toLowerCase();if(!e)return;const r=await Ow();r?.email!==e?(pe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),tt(),ta({authorizationParams:{login_hint:e}})):pe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(ph),window.history.replaceState(null,"",n)}const mh="sesamy-purchase";function Vb(){const t=new URLSearchParams(window.location.search),e=t.get(mh);if(e!==null){const r=new URL(window.location.href);t.delete(mh),r.search=t.toString(),pe(`Purchase ${e}`),qt(Ve.PURCHASE,{itemSrc:e}),tt(),window.history.replaceState(null,"",r)}}const gh="sesamy-login",Jb="sesamy_login";async function Zb(){const t=new URLSearchParams(window.location.search);if(!(t.get(gh)||t.get(Jb)))return;await Yr()||ta();const n=new URL(window.location.href);n.searchParams.delete(gh),window.history.replaceState(null,"",n)}const yh="sesamy-debug";async function Yb(){const e=new URLSearchParams(window.location.search).get(yh)?.toLowerCase();if(!e)return;zm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(yh),window.history.replaceState(null,"",r)}function Xb(){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 Qb(t){if(!Jr())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:Xb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),Ip(r)}function eS(){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(bd)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(bd,"true"),n||(pe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function tS(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 rS(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 nS(t){const e=gr("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 wh(t,e){pe(`Init with config: ${JSON.stringify(t)}`);try{eS(),ww({clientId:t.clientId,environment:t.environment,...t.analytics}),await Rw({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),uw(t,e),t.transform&&await Kb(t.transform),Dg(),Yb(),Qb(e),Hb(),zb(),Gb(),await Zb(),await Wb(),Vb(),await rS(e),await tS(e),await nS(e),exports.isInitialized=!0,qt(Ve.READY,{})}catch(r){pe(`Failed to init ${r.message}`)}}async function _p(t){pe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Jr()&&e in window)return pe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=Lb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Jr()?(t.awaitAllServices?await wh(t,r):wh(t,r),r):(exports.isInitialized=!0,r)}if(Jr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);_p(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Ve;exports.init=_p;
47
+ `,document.head.appendChild(i)}async function Ib(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 oc(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 Ib(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 Pb(t,e){const r=e.insertionPoint||"inside",n=await oc(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 Eb(t,e){const r=await oc(e);t.innerHTML=r}async function _b(t,e){const r=await oc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Tb({enabled:t=!1,rules:e}){t&&Wv(async()=>{const r=await Wr(),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 Pb(s,a);break;case"replace":await Eb(s,a);break;case"remove":o.remove();break;case"wrap":await _b(s,a);break;case"gradient":Sb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const oh="access_token";function kb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(oh);if(e){bs(e);const r=new URL(window.location.href);t.delete(oh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const sh="sesamy-refresh",ch="force-refetch-entitlements";function Rb(){const t=new URLSearchParams(window.location.search),e=t.get(ch),r=t.get(sh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(ch),t.delete(sh),n.search=t.toString(),tt(),window.history.replaceState(null,"",n)}}function Ob(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 Cb(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Ob(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOptionsId:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};cb(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 uh="sesamy-user";async function Ab(){const e=new URLSearchParams(window.location.search).get(uh)?.toLowerCase();if(!e)return;const r=await bw();r?.email!==e?(pe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),tt(),Yn({authorizationParams:{login_hint:e}})):pe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(uh),window.history.replaceState(null,"",n)}const lh="sesamy-purchase";function jb(){const t=new URLSearchParams(window.location.search),e=t.get(lh);if(e!==null){const r=new URL(window.location.href);t.delete(lh),r.search=t.toString(),pe(`Purchase ${e}`),qt(Ve.PURCHASE,{itemSrc:e}),tt(),window.history.replaceState(null,"",r)}}const fh="sesamy-login",Ub="sesamy_login";async function qb(){const t=new URLSearchParams(window.location.search);if(!(t.get(fh)||t.get(Ub)))return;await Wr()||Yn();const n=new URL(window.location.href);n.searchParams.delete(fh),window.history.replaceState(null,"",n)}const dh="sesamy-debug";async function Lb(){const e=new URLSearchParams(window.location.search).get(dh)?.toLowerCase();if(!e)return;Lm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(dh),window.history.replaceState(null,"",r)}function Nb(){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 $b(t){if(!Br())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:Nb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),hp(r)}function xb(){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(md)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(md,"true"),n||(pe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Db(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 Mb(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 Fb(t){const e=vr("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 hh(t,e){pe(`Init with config: ${JSON.stringify(t)}`);try{xb(),lw({clientId:t.clientId,environment:t.environment,...t.analytics}),await ww({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),ew(t,e),t.transform&&await Tb(t.transform),Cg(),Lb(),$b(e),kb(),Rb(),Cb(),await qb(),await Ab(),jb(),await Mb(e),await Db(e),await Fb(e),exports.isInitialized=!0,qt(Ve.READY,{})}catch(r){pe(`Failed to init ${r.message}`)}}async function mp(t){pe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Br()&&e in window)return pe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=wb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Br()?(t.awaitAllServices?await hh(t,r):hh(t,r),r):(exports.isInitialized=!0,r)}if(Br()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);mp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Ve;exports.init=mp;