@sesamy/sesamy-js 1.79.0 → 1.80.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={},ia,wc;function Ae(){return wc||(wc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,bc;function Un(){if(bc)return oa;bc=1;var t=Ae();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,Sc;function ve(){if(Sc)return sa;Sc=1;var t=Un(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return sa=t?n:function(a){return function(){return r.apply(a,arguments)}},sa}var ca,Ic;function $n(){if(Ic)return ca;Ic=1;var t=ve(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,Pc;function bh(){if(Pc)return ua;Pc=1;var t=ve(),e=Ae(),r=$n(),n=Object,a=t("".split);return ua=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ua}var la,Ec;function Ln(){return Ec||(Ec=1,la=function(t){return t==null}),la}var fa,kc;function qn(){if(kc)return fa;kc=1;var t=Ln(),e=TypeError;return fa=function(r){if(t(r))throw new e("Can't call method on "+r);return r},fa}var da,Tc;function Zr(){if(Tc)return da;Tc=1;var t=bh(),e=qn();return da=function(r){return t(e(r))},da}var $r,_c;function me(){if(_c)return $r;_c=1;var t=function(e){return e&&e.Math===Math&&e};return $r=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof gc=="object"&&gc)||t(typeof $r=="object"&&$r)||(function(){return this})()||Function("return this")(),$r}var ha={exports:{}},pa,Rc;function ut(){return Rc||(Rc=1,pa=!1),pa}var va,Oc;function _s(){if(Oc)return va;Oc=1;var t=me(),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 Cc;function Rs(){if(Cc)return ha.exports;Cc=1;var t=ut(),e=me(),r=_s(),n="__core-js_shared__",a=ha.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"}),ha.exports}var ma,Ac;function Sh(){if(Ac)return ma;Ac=1;var t=Rs();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Uc;function xn(){if(Uc)return ga;Uc=1;var t=qn(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,$c;function Je(){if($c)return ya;$c=1;var t=ve(),e=xn(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Lc;function Ih(){if(Lc)return wa;Lc=1;var t=ve(),e=0,r=Math.random(),n=t(1.1.toString);return wa=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},wa}var ba,qc;function Yr(){if(qc)return ba;qc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,xc;function Ph(){if(xc)return Sa;xc=1;var t=me(),e=Yr(),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]))),Sa=s,Sa}var Ia,Nc;function Eh(){if(Nc)return Ia;Nc=1;var t=Ph(),e=Ae(),r=me(),n=r.String;return Ia=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Ia}var Pa,jc;function kh(){if(jc)return Pa;jc=1;var t=Eh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,Dc;function Ue(){if(Dc)return Ea;Dc=1;var t=me(),e=Sh(),r=Je(),n=Ih(),a=Eh(),i=kh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Ea=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Ea}var ka,Mc;function we(){if(Mc)return ka;Mc=1;var t=typeof document=="object"&&document.all;return ka=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},ka}var Ta,Fc;function Ze(){if(Fc)return Ta;Fc=1;var t=we();return Ta=function(e){return typeof e=="object"?e!==null:t(e)},Ta}var _a,Kc;function nt(){if(Kc)return _a;Kc=1;var t=Ze(),e=String,r=TypeError;return _a=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},_a}var Ra={},Oa,zc;function $e(){if(zc)return Oa;zc=1;var t=Ae();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Hc;function Th(){if(Hc)return Ca;Hc=1;var t=$e(),e=Ae();return Ca=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ca}var Aa={},Ua,Bc;function Nn(){if(Bc)return Ua;Bc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Ua=function(a){return n?r.createElement(a):{}},Ua}var $a,Gc;function _h(){if(Gc)return $a;Gc=1;var t=$e(),e=Ae(),r=Nn();return $a=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),$a}var La,Wc;function xe(){if(Wc)return La;Wc=1;var t=Un(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var qa,Vc;function Ye(){if(Vc)return qa;Vc=1;var t=me(),e=we(),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 xa,Jc;function jn(){if(Jc)return xa;Jc=1;var t=ve();return xa=t({}.isPrototypeOf),xa}var Na,Zc;function Rh(){if(Zc)return Na;Zc=1;var t=Ye(),e=we(),r=jn(),n=kh(),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 ja,Yc;function Dn(){if(Yc)return ja;Yc=1;var t=String;return ja=function(e){try{return t(e)}catch{return"Object"}},ja}var Da,Xc;function at(){if(Xc)return Da;Xc=1;var t=we(),e=Dn(),r=TypeError;return Da=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Da}var Ma,Qc;function Os(){if(Qc)return Ma;Qc=1;var t=at(),e=Ln();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,eu;function qv(){if(eu)return Fa;eu=1;var t=xe(),e=we(),r=Ze(),n=TypeError;return Fa=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")},Fa}var Ka,tu;function xv(){if(tu)return Ka;tu=1;var t=xe(),e=Ze(),r=Rh(),n=Os(),a=qv(),i=Ue(),o=TypeError,s=i("toPrimitive");return Ka=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Ka}var za,ru;function Oh(){if(ru)return za;ru=1;var t=xv(),e=Rh();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var nu;function yt(){if(nu)return Aa;nu=1;var t=$e(),e=_h(),r=Th(),n=nt(),a=Oh(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Aa.f=t?r?function(h,d,p){if(n(h),d=a(d),n(p),typeof h=="function"&&d==="prototype"&&"value"in p&&c in p&&!p[c]){var v=s(h,d);v&&v[c]&&(h[d]=p.value,p={configurable:l in p?p[l]:v[l],enumerable:u in p?p[u]:v[u],writable:!1})}return o(h,d,p)}:o:function(h,d,p){if(n(h),d=a(d),n(p),e)try{return o(h,d,p)}catch{}if("get"in p||"set"in p)throw new i("Accessors not supported");return"value"in p&&(h[d]=p.value),h},Aa}var Ha,au;function Nv(){if(au)return Ha;au=1;var t=Math.ceil,e=Math.floor;return Ha=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ha}var Ba,iu;function Cs(){if(iu)return Ba;iu=1;var t=Nv();return Ba=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ba}var Ga,ou;function Ch(){if(ou)return Ga;ou=1;var t=Cs(),e=Math.max,r=Math.min;return Ga=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ga}var Wa,su;function jv(){if(su)return Wa;su=1;var t=Cs(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,cu;function As(){if(cu)return Va;cu=1;var t=jv();return Va=function(e){return t(e.length)},Va}var Ja,uu;function Dv(){if(uu)return Ja;uu=1;var t=Zr(),e=Ch(),r=As(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return Ja={includes:n(!0),indexOf:n(!1)},Ja}var Za,lu;function Us(){return lu||(lu=1,Za={}),Za}var Ya,fu;function Ah(){if(fu)return Ya;fu=1;var t=ve(),e=Je(),r=Zr(),n=Dv().indexOf,a=Us(),i=t([].push);return Ya=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Ya}var Xa,du;function $s(){return du||(du=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,hu;function Uh(){if(hu)return Qa;hu=1;var t=Ah(),e=$s();return Qa=Object.keys||function(n){return t(n,e)},Qa}var pu;function Mv(){if(pu)return Ra;pu=1;var t=$e(),e=Th(),r=yt(),n=nt(),a=Zr(),i=Uh();return Ra.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},Ra}var ei,vu;function $h(){if(vu)return ei;vu=1;var t=Ye();return ei=t("document","documentElement"),ei}var ti,mu;function Ls(){if(mu)return ti;mu=1;var t=Sh(),e=Ih(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,gu;function Xr(){if(gu)return ri;gu=1;var t=nt(),e=Mv(),r=$s(),n=Us(),a=$h(),i=Nn(),o=Ls(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},p=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},v=function(){var w=i("iframe"),y="java"+c+":",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,P=function(){try{g=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&g?p(g):v():p(g);for(var w=r.length;w--;)delete P[l][r[w]];return P()};return n[f]=!0,ri=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=P(),m===void 0?b:e.f(b,m)},ri}var ni,yu;function Fv(){if(yu)return ni;yu=1;var t=Ue(),e=Xr(),r=yt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ni=function(i){a[n][i]=!0},ni}var ai,wu;function Qr(){return wu||(wu=1,ai={}),ai}var ii,bu;function Kv(){if(bu)return ii;bu=1;var t=me(),e=we(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,Su;function Qt(){return Su||(Su=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,Iu;function er(){if(Iu)return si;Iu=1;var t=$e(),e=yt(),r=Qt();return si=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},si}var ci,Pu;function Er(){if(Pu)return ci;Pu=1;var t=Kv(),e=me(),r=Ze(),n=er(),a=Je(),i=Rs(),o=Ls(),s=Us(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,p=function(w){return d(w)?h(w):f(w,{})},v=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 c);g.get=g.get,g.has=g.has,g.set=g.set,f=function(w,y){if(g.has(w))throw new l(u);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 P=o("state");s[P]=!0,f=function(w,y){if(a(w,P))throw new l(u);return y.facade=w,n(w,P,y),y},h=function(w){return a(w,P)?w[P]:{}},d=function(w){return a(w,P)}}return ci={set:f,get:h,has:d,enforce:p,getterFor:v},ci}var ui={},li={},Eu;function Lh(){if(Eu)return li;Eu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return li.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,li}var ku;function qh(){if(ku)return ui;ku=1;var t=$e(),e=xe(),r=Lh(),n=Qt(),a=Zr(),i=Oh(),o=Je(),s=_h(),u=Object.getOwnPropertyDescriptor;return ui.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},ui}var fi={exports:{}},di,Tu;function xh(){if(Tu)return di;Tu=1;var t=$e(),e=Je(),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 di={EXISTS:a,PROPER:i,CONFIGURABLE:o},di}var hi,_u;function qs(){if(_u)return hi;_u=1;var t=ve(),e=we(),r=Rs(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var Ru;function Nh(){if(Ru)return fi.exports;Ru=1;var t=ve(),e=Ae(),r=we(),n=Je(),a=$e(),i=xh().CONFIGURABLE,o=qs(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),p=t([].join),v=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),g=String(String).split("String"),P=fi.exports=function(w,y,m){h(c(y),0,7)==="Symbol("&&(y="["+d(c(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),v&&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=u(w);return n(b,"source")||(b.source=p(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),fi.exports}var pi,Ou;function Xe(){if(Ou)return pi;Ou=1;var t=we(),e=yt(),r=Nh(),n=_s();return pi=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},pi}var vi={},Cu;function zv(){if(Cu)return vi;Cu=1;var t=Ah(),e=$s(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var mi={},Au;function jh(){return Au||(Au=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Uu;function Hv(){if(Uu)return gi;Uu=1;var t=Ye(),e=ve(),r=zv(),n=jh(),a=nt(),i=e([].concat);return gi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},gi}var yi,$u;function Dh(){if($u)return yi;$u=1;var t=Je(),e=Hv(),r=qh(),n=yt();return yi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},yi}var wi,Lu;function Mh(){if(Lu)return wi;Lu=1;var t=Ae(),e=we(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return wi=n,wi}var bi,qu;function Ie(){if(qu)return bi;qu=1;var t=me(),e=qh().f,r=er(),n=Xe(),a=_s(),i=Dh(),o=Mh();return bi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,p,v,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(p in u){if(g=u[p],s.dontCallGetSet?(P=e(d,p),v=P&&P.value):v=d[p],h=o(c?p:l+(f?".":"#")+p,s.forced),!h&&v!==void 0){if(typeof g==typeof v)continue;i(g,v)}(s.sham||v&&v.sham)&&r(g,"sham",!0),n(d,p,g,s)}},bi}var Si,xu;function Bv(){if(xu)return Si;xu=1;var t=Ae();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,Nu;function xs(){if(Nu)return Ii;Nu=1;var t=Je(),e=we(),r=xn(),n=Ls(),a=Bv(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Ii=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},Ii}var Pi,ju;function Fh(){if(ju)return Pi;ju=1;var t=Ae(),e=we(),r=Ze(),n=Xr(),a=xs(),i=Xe(),o=Ue(),s=ut(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var p={};return c[u].call(p)!==p});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),Pi={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Pi}var Ei,Du;function kr(){if(Du)return Ei;Du=1;var t=yt().f,e=Je(),r=Ue(),n=r("toStringTag");return Ei=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Ei}var ki,Mu;function Kh(){if(Mu)return ki;Mu=1;var t=Fh().IteratorPrototype,e=Xr(),r=Qt(),n=kr(),a=Qr(),i=function(){return this};return ki=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},ki}var Ti,Fu;function Gv(){if(Fu)return Ti;Fu=1;var t=ve(),e=at();return Ti=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},Ti}var _i,Ku;function Wv(){if(Ku)return _i;Ku=1;var t=Ze();return _i=function(e){return t(e)||e===null},_i}var Ri,zu;function Vv(){if(zu)return Ri;zu=1;var t=Wv(),e=String,r=TypeError;return Ri=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ri}var Oi,Hu;function Ns(){if(Hu)return Oi;Hu=1;var t=Gv(),e=Ze(),r=qn(),n=Vv();return Oi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),Oi}var Ci,Bu;function zh(){if(Bu)return Ci;Bu=1;var t=Ie(),e=xe(),r=ut(),n=xh(),a=we(),i=Kh(),o=xs(),s=Ns(),u=kr(),l=er(),c=Xe(),f=Ue(),h=Qr(),d=Fh(),p=n.PROPER,v=n.CONFIGURABLE,g=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",R=function(){return this};return Ci=function(A,x,z,V,te,L,M){i(z,x,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in q)return q[J];switch(J){case y:return function(){return new z(this,J)};case m:return function(){return new z(this,J)};case b:return function(){return new z(this,J)}}return function(){return new z(this)}},S=x+" Iterator",O=!1,q=A.prototype,F=q[w]||q["@@iterator"]||te&&q[te],I=!P&&F||N(te),T=x==="Array"&&q.entries||F,j,H,Y;if(T&&(j=o(T.call(new A)),j!==Object.prototype&&j.next&&(!r&&o(j)!==g&&(s?s(j,g):a(j[w])||c(j,w,R)),u(j,S,!0,!0),r&&(h[S]=R))),p&&te===m&&F&&F.name!==m&&(!r&&v?l(q,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(H={values:N(m),keys:L?I:N(y),entries:N(b)},M)for(Y in H)(P||O||!(Y in q))&&c(q,Y,H[Y]);else t({target:x,proto:!0,forced:P||O},H);return(!r||M)&&q[w]!==I&&c(q,w,I,{name:te}),h[x]=I,H},Ci}var Ai,Gu;function js(){return Gu||(Gu=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,Wu;function Ds(){if(Wu)return Ui;Wu=1;var t=Zr(),e=Fv(),r=Qr(),n=Er(),a=yt().f,i=zh(),o=js(),s=ut(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ui=i(Array,"Array",function(d,p){c(this,{type:l,target:t(d),index:0,kind:p})},function(){var d=f(this),p=d.target,v=d.index++;if(!p||v>=p.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(v,!1);case"values":return o(p[v],!1)}return o([v,p[v]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ui}var Vu={},Ju;function Jv(){if(Ju)return Vu;Ju=1;var t=Ie(),e=ve(),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 c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Vu}var $i,Zu;function Hh(){if(Zu)return $i;Zu=1;var t=me(),e=$e(),r=Object.getOwnPropertyDescriptor;return $i=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},$i}var Li,Yu;function Mn(){if(Yu)return Li;Yu=1;var t=Ae(),e=Ue(),r=$e(),n=ut(),a=e("iterator");return Li=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Li}var qi,Xu;function Fn(){if(Xu)return qi;Xu=1;var t=Nh(),e=yt();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 xi,Qu;function Zv(){if(Qu)return xi;Qu=1;var t=Xe();return xi=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},xi}var Ni,el;function Ms(){if(el)return Ni;el=1;var t=jn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var ji,tl;function Yv(){if(tl)return ji;tl=1;var t=$n(),e=ve();return ji=function(r){if(t(r)==="Function")return e(r)},ji}var Di,rl;function Tr(){if(rl)return Di;rl=1;var t=Yv(),e=at(),r=Un(),n=t(t.bind);return Di=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Di}var Mi,nl;function Fs(){if(nl)return Mi;nl=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,al;function en(){if(al)return Fi;al=1;var t=Fs(),e=we(),r=$n(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Fi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Fi}var Ki,il;function wt(){if(il)return Ki;il=1;var t=en(),e=String;return Ki=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ki}var zi,ol;function Kn(){if(ol)return zi;ol=1;var t=en(),e=Os(),r=Ln(),n=Qr(),a=Ue(),i=a("iterator");return zi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},zi}var Hi,sl;function Ks(){if(sl)return Hi;sl=1;var t=xe(),e=at(),r=nt(),n=Dn(),a=Kn(),i=TypeError;return Hi=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},Hi}var Bi,cl;function tr(){if(cl)return Bi;cl=1;var t=TypeError;return Bi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Bi}var Gi,ul;function zn(){if(ul)return Gi;ul=1;var t=ve();return Gi=t([].slice),Gi}var Wi,ll;function Xv(){if(ll)return Wi;ll=1;var t=zn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,p=0,v=0;p<h||v<d;)n[p+v]=p<h&&v<d?a(c[p],f[v])<=0?c[p++]:f[v++]:p<h?c[p++]:f[v++];return n};return Wi=r,Wi}var Vi,fl;function Bh(){if(fl)return Vi;fl=1,Ds(),Jv();var t=Ie(),e=me(),r=Hh(),n=Ye(),a=xe(),i=ve(),o=$e(),s=Mn(),u=Xe(),l=Fn(),c=Zv(),f=kr(),h=Kh(),d=Er(),p=Ms(),v=we(),g=Je(),P=Tr(),w=en(),y=nt(),m=Ze(),b=wt(),R=Xr(),A=Qt(),x=Ks(),z=Kn(),V=js(),te=tr(),L=Ue(),M=Xv(),N=L("iterator"),S="URLSearchParams",O=S+"Iterator",q=d.set,F=d.getterFor(S),I=d.getterFor(O),T=r("fetch"),j=r("Request"),H=r("Headers"),Y=j&&j.prototype,J=H&&H.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),ke=parseInt,Ne=i("".charAt),De=i([].join),Le=i([].push),Qe=i("".replace),St=i([].shift),It=i([].splice),Ct=i("".split),At=i("".slice),Ar=i(/./.exec),rr=/\+/g,Ut="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=At(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},$t=function(D){for(var G=0,W=128;W>0&&(D&W)!==0;W>>=1)G++;return G},K=function(D){var G=null;switch(D.length){case 1:G=D[0];break;case 2:G=(D[0]&31)<<6|D[1]&63;break;case 3:G=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:G=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return G>1114111?null:G},X=function(D){D=Qe(D,rr," ");for(var G=D.length,W="",Z=0;Z<G;){var ie=Ne(D,Z);if(ie==="%"){if(Ne(D,Z+1)==="%"||Z+3>G){W+="%",Z++;continue}var ce=et(D,Z+1);if(ce!==ce){W+=ie,Z++;continue}Z+=2;var he=$t(ce);if(he===0)ie=ue(ce);else{if(he===1||he>4){W+=Ut,Z++;continue}for(var pe=[ce],be=1;be<he&&(Z++,!(Z+3>G||Ne(D,Z)!=="%"));){var qe=et(D,Z+1);if(qe!==qe){Z+=3;break}if(qe>191||qe<128)break;Le(pe,qe),Z+=2,be++}if(pe.length!==he){W+=Ut;continue}var it=K(pe);it===null?W+=Ut:ie=ae(it)}}W+=ie,Z++}return W},se=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return le[D]},He=function(D){return Qe(ne(D),se,de)},Te=h(function(G,W){q(this,{type:O,target:F(G).entries,index:0,kind:W})},S,function(){var G=I(this),W=G.target,Z=G.index++;if(!W||Z>=W.length)return G.target=null,V(void 0,!0);var ie=W[Z];switch(G.kind){case"keys":return V(ie.key,!1);case"values":return V(ie.value,!1)}return V([ie.key,ie.value],!1)},!0),Me=function(D){this.entries=[],this.url=null,D!==void 0&&(m(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?Ne(D,0)==="?"?At(D,1):D:b(D)))};Me.prototype={type:S,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var G=this.entries,W=z(D),Z,ie,ce,he,pe,be,qe;if(W)for(Z=x(D,W),ie=Z.next;!(ce=a(ie,Z)).done;){if(he=x(y(ce.value)),pe=he.next,(be=a(pe,he)).done||(qe=a(pe,he)).done||!a(pe,he).done)throw new fe("Expected sequence with length 2");Le(G,{key:b(be.value),value:b(qe.value)})}else for(var it in D)g(D,it)&&Le(G,{key:it,value:b(D[it])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Ct(D,"&"),Z=0,ie,ce;Z<W.length;)ie=W[Z++],ie.length&&(ce=Ct(ie,"="),Le(G,{key:X(St(ce)),value:X(De(ce,"="))}))},serialize:function(){for(var D=this.entries,G=[],W=0,Z;W<D.length;)Z=D[W++],Le(G,He(Z.key)+"="+He(Z.value));return De(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){p(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=q(this,new Me(G));o||(this.size=W.entries.length)},Ge=_e.prototype;if(c(Ge,{append:function(G,W){var Z=F(this);te(arguments.length,2),Le(Z.entries,{key:b(G),value:b(W)}),o||this.length++,Z.updateURL()},delete:function(D){for(var G=F(this),W=te(arguments.length,1),Z=G.entries,ie=b(D),ce=W<2?void 0:arguments[1],he=ce===void 0?ce:b(ce),pe=0;pe<Z.length;){var be=Z[pe];if(be.key===ie&&(he===void 0||be.value===he)){if(It(Z,pe,1),he!==void 0)break}else pe++}o||(this.size=Z.length),G.updateURL()},get:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=0;ie<W.length;ie++)if(W[ie].key===Z)return W[ie].value;return null},getAll:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=[],ce=0;ce<W.length;ce++)W[ce].key===Z&&Le(ie,W[ce].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),ce=Z<2?void 0:arguments[1],he=ce===void 0?ce:b(ce),pe=0;pe<W.length;){var be=W[pe++];if(be.key===ie&&(he===void 0||be.value===he))return!0}return!1},set:function(G,W){var Z=F(this);te(arguments.length,1);for(var ie=Z.entries,ce=!1,he=b(G),pe=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(ce?It(ie,be--,1):(ce=!0,qe.value=pe));ce||Le(ie,{key:he,value:pe}),o||(this.size=ie.length),Z.updateURL()},sort:function(){var G=F(this);M(G.entries,function(W,Z){return W.key>Z.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=F(this).entries,Z=P(G,arguments.length>1?arguments[1]:void 0),ie=0,ce;ie<W.length;)ce=W[ie++],Z(ce.value,ce.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&l(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(_e,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:_e}),!s&&v(H)){var nr=i(J.has),Ur=i(J.set),ar=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,nr(W,"content-type")||Ur(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(D,{body:A(0,b(G)),headers:A(0,W)})}return D};if(v(T)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return T(G,arguments.length>1?ar(arguments[1]):{})}}),v(j)){var ir=function(G){return p(this,Y),new j(G,arguments.length>1?ar(arguments[1]):{})};Y.constructor=ir,ir.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ir})}}return Vi={URLSearchParams:_e,getState:F},Vi}var dl;function Qv(){return dl||(dl=1,Bh()),yc}var hl={},pl;function em(){if(pl)return hl;pl=1;var t=Xe(),e=ve(),r=wt(),n=tr(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var p=[];u(this,function(R,A){l(p,{key:A,value:R})}),n(h,1);for(var v=r(f),g=r(d),P=0,w=0,y=!1,m=p.length,b;P<m;)b=p[P++],y||b.key===v?(y=!0,s(this,b.key)):w++;for(;w<m;)b=p[w++],b.key===v&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),hl}var vl={},ml;function tm(){if(ml)return vl;ml=1;var t=Xe(),e=ve(),r=wt(),n=tr(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var p=r(h),v=0;v<d.length;)if(d[v++]===p)return!0;return!1},{enumerable:!0,unsafe:!0}),vl}var gl={},yl;function rm(){if(yl)return gl;yl=1;var t=$e(),e=ve(),r=Fn(),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 Ji,wl;function Hn(){if(wl)return Ji;wl=1;var t=me();return Ji=t,Ji}var Zi,bl;function Gh(){if(bl)return Zi;bl=1,Qv(),em(),tm(),rm();var t=Hn();return Zi=t.URLSearchParams,Zi}var Sl={},Il={},Pl={},Yi,El;function Wh(){if(El)return Yi;El=1;var t=ve(),e=Cs(),r=wt(),n=qn(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,p,v;return h<0||h>=d?u?"":void 0:(p=i(f,h),p<55296||p>56319||h+1===d||(v=i(f,h+1))<56320||v>57343?u?a(f,h):p:u?o(f,h,h+2):(p-55296<<10)+(v-56320)+65536)}};return Yi={codeAt:s(!1),charAt:s(!0)},Yi}var kl;function Vh(){if(kl)return Pl;kl=1;var t=Wh().charAt,e=wt(),r=Er(),n=zh(),a=js(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),Pl}var Xi,Tl;function nm(){if(Tl)return Xi;Tl=1;var t=$e(),e=ve(),r=xe(),n=Ae(),a=Uh(),i=jh(),o=Lh(),s=xn(),u=bh(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Xi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},p=Symbol("assign detection"),v="abcdefghijklmnopqrst";return h[p]=7,v.split("").forEach(function(g){d[g]=g}),l({},h)[p]!==7||a(l({},d)).join("")!==v})?function(d,p){for(var v=s(d),g=arguments.length,P=1,w=i.f,y=o.f;g>P;)for(var m=u(arguments[P++]),b=w?f(a(m),w(m)):a(m),R=b.length,A=0,x;R>A;)x=b[A++],(!t||r(y,m,x))&&(v[x]=m[x]);return v}:l,Xi}var Qi,_l;function Jh(){if(_l)return Qi;_l=1;var t=xe(),e=nt(),r=Os();return Qi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Qi}var eo,Rl;function am(){if(Rl)return eo;Rl=1;var t=nt(),e=Jh();return eo=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},eo}var to,Ol;function Zh(){if(Ol)return to;Ol=1;var t=Ue(),e=Qr(),r=t("iterator"),n=Array.prototype;return to=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},to}var ro,Cl;function Yh(){if(Cl)return ro;Cl=1;var t=ve(),e=Ae(),r=we(),n=en(),a=Ye(),i=qs(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(p){if(!r(p))return!1;try{return s(o,[],p),!0}catch{return!1}},h=function(p){if(!r(p))return!1;switch(n(p)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(p))}catch{return!0}};return h.sham=!0,ro=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,ro}var no,Al;function im(){if(Al)return no;Al=1;var t=$e(),e=yt(),r=Qt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Ul;function om(){if(Ul)return ao;Ul=1;var t=Tr(),e=xe(),r=xn(),n=am(),a=Zh(),i=Yh(),o=As(),s=im(),u=Ks(),l=Kn(),c=Array;return ao=function(h){var d=r(h),p=i(this),v=arguments.length,g=v>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,v>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,x,z;if(w&&!(this===c&&a(w)))for(b=p?new this:[],A=u(d,w),x=A.next;!(R=e(x,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=p?new this(m):c(m);m>y;y++)z=P?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},ao}var io,$l;function sm(){if($l)return io;$l=1;var t=ve(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,p=RangeError,v=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),x=function(L){for(var M=[],N=0,S=L.length;N<S;){var O=w(L,N++);if(O>=55296&&O<=56319&&N<S){var q=w(L,N++);(q&64512)===56320?m(M,((O&1023)<<10)+(q&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function(L){return L+22+75*(L<26)},V=function(L,M,N){var S=0;for(L=N?g(L/o):L>>1,L+=g(L/M);L>d*a>>1;)L=g(L/d),S+=r;return g(S+(d+1)*L/(L+i))},te=function(L){var M=[];L=x(L);var N=L.length,S=u,O=0,q=s,F,I;for(F=0;F<L.length;F++)I=L[F],I<128&&m(M,P(I));var T=M.length,j=T;for(T&&m(M,l);j<N;){var H=e;for(F=0;F<L.length;F++)I=L[F],I>=S&&I<H&&(H=I);var Y=j+1;if(H-S>g((e-O)/Y))throw new p(h);for(O+=(H-S)*Y,S=H,F=0;F<L.length;F++){if(I=L[F],I<S&&++O>e)throw new p(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=q?n:fe>=q+a?a:fe-q;if(J<ne)break;var ue=J-ne,ae=r-ne;m(M,P(z(ne+ue%ae))),J=g(ue/ae),fe+=r}m(M,P(z(J))),q=V(O,Y,j===T),O=0,j++}}O++,S++}return y(M,"")};return io=function(L){var M=[],N=R(b(A(L),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,v(c,O)?"xn--"+te(O):O);return y(M,".")},io}var Ll;function cm(){if(Ll)return Il;Ll=1,Vh();var t=Ie(),e=$e(),r=Mn(),n=me(),a=Tr(),i=ve(),o=Xe(),s=Fn(),u=Ms(),l=Je(),c=nm(),f=om(),h=zn(),d=Wh().codeAt,p=sm(),v=wt(),g=kr(),P=tr(),w=Bh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,x=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,L=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),q=i([].pop),F=i([].push),I=i("".replace),T=i([].shift),j=i("".split),H=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",ke=/[a-z]/i,Ne=/[\d+-.a-z]/i,De=/\d/,Le=/^0x/i,Qe=/^[0-7]+$/,St=/^\d+$/,It=/^[\da-f]+$/i,Ct=/[\0\t\n\r #%/:<>?@[\\\]^|]/,At=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,rr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ut=/[\t\n\r]/g,ge,et=function(k){var $=j(k,"."),_,E,C,re,B,ye,Se;if($.length&&$[$.length-1]===""&&$.length--,_=$.length,_>4)return k;for(E=[],C=0;C<_;C++){if(re=$[C],re==="")return k;if(B=10,re.length>1&&M(re,0)==="0"&&(B=N(Le,re)?16:8,re=H(re,B===8?1:2)),re==="")ye=0;else{if(!N(B===10?St:B===8?Qe:It,re))return k;ye=V(re,B)}F(E,ye)}for(C=0;C<_;C++)if(ye=E[C],C===_-1){if(ye>=L(256,5-_))return null}else if(ye>255)return null;for(Se=q(E),C=0;C<E.length;C++)Se+=E[C]*L(256,3-C);return Se},$t=function(k){var $=[0,0,0,0,0,0,0,0],_=0,E=null,C=0,re,B,ye,Se,Re,Ve,U,Pe=function(){return M(k,C)};if(Pe()===":"){if(M(k,1)!==":")return;C+=2,_++,E=_}for(;Pe();){if(_===8)return;if(Pe()===":"){if(E!==null)return;C++,_++,E=_;continue}for(re=B=0;B<4&&N(It,Pe());)re=re*16+V(Pe(),16),C++,B++;if(Pe()==="."){if(B===0||(C-=B,_>6))return;for(ye=0;Pe();){if(Se=null,ye>0)if(Pe()==="."&&ye<4)C++;else return;if(!N(De,Pe()))return;for(;N(De,Pe());){if(Re=V(Pe(),10),Se===null)Se=Re;else{if(Se===0)return;Se=Se*10+Re}if(Se>255)return;C++}$[_]=$[_]*256+Se,ye++,(ye===2||ye===4)&&_++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;$[_++]=re}if(E!==null)for(Ve=_-E,_=7;_!==0&&Ve>0;)U=$[_],$[_--]=$[E+Ve-1],$[E+--Ve]=U;else if(_!==8)return;return $},K=function(k){for(var $=null,_=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>_&&($=E,_=C),E=null,C=0):(E===null&&(E=re),++C);return C>_?E:$},X=function(k){var $,_,E,C;if(typeof k=="number"){for($=[],_=0;_<4;_++)J($,k%256),k=te(k/256);return S($,".")}if(typeof k=="object"){for($="",E=K(k),_=0;_<8;_++)C&&k[_]===0||(C&&(C=!1),E===_?($+=_?":":"::",C=!0):($+=O(k[_],16),_<7&&($+=":")));return"["+$+"]"}return k},se={},le=c({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},le,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(k,$){var _=d(k,0);return _>32&&_<127&&!l($,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},_e=function(k,$){var _;return k.length===2&&N(ke,M(k,0))&&((_=M(k,1))===":"||!$&&_==="|")},Ge=function(k){var $;return k.length>1&&_e(H(k,0,2))&&(k.length===2||($=M(k,2))==="/"||$==="\\"||$==="?"||$==="#")},nr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},ar={},ir={},D={},G={},W={},Z={},ie={},ce={},he={},pe={},be={},qe={},it={},ea={},fc={},ta={},or={},ot={},dc={},Lt={},lt={},ra=function(k,$,_){var E=v(k),C,re,B;if($){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(_!==void 0&&(C=new ra(_,!0)),re=this.parse(E,null,C),re)throw new z(re);B=A(new R),B.bindURL(this),this.searchParams=B}};ra.prototype={type:"URL",parse:function(k,$,_){var E=this,C=$||ar,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=v(k),$||(E.scheme="",E.username="",E.password="",E.host=null,E.port=null,E.path=[],E.query=null,E.fragment=null,E.cannotBeABaseURL=!1,k=I(k,Ar,""),k=I(k,rr,"$1")),k=I(k,Ut,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case ar:if(U&&N(ke,U))B+=Y(U),C=ir;else{if($)return ne;C=D;continue}break;case ir:if(U&&(N(Ne,U)||U==="+"||U==="-"||U==="."))B+=Y(U);else if(U===":"){if($&&(E.isSpecial()!==l(Me,B)||B==="file"&&(E.includesCredentials()||E.port!==null)||E.scheme==="file"&&!E.host))return;if(E.scheme=B,$){E.isSpecial()&&Me[E.scheme]===E.port&&(E.port=null);return}B="",E.scheme==="file"?C=ea:E.isSpecial()&&_&&_.scheme===E.scheme?C=G:E.isSpecial()?C=ce:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=dc)}else{if($)return ne;B="",C=D,re=0;continue}break;case D:if(!_||_.cannotBeABaseURL&&U!=="#")return ne;if(_.cannotBeABaseURL&&U==="#"){E.scheme=_.scheme,E.path=h(_.path),E.query=_.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=_.scheme==="file"?ea:Z;continue;case G:if(U==="/"&&Ve[re+1]==="/")C=he,re++;else{C=Z;continue}break;case W:if(U==="/"){C=pe;break}else{C=ot;continue}case Z:if(E.scheme=_.scheme,U===ge)E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query=_.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query="",C=Lt;else if(U==="#")E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query=_.query,E.fragment="",C=lt;else{E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.path.length--,C=ot;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=pe;else{E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,C=ot;continue}break;case ce:if(C=he,U!=="/"||M(B,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=pe;continue}break;case pe:if(U==="@"){ye&&(B="%40"+B),ye=!0,Pe=f(B);for(var na=0;na<Pe.length;na++){var vc=Pe[na];if(vc===":"&&!Re){Re=!0;continue}var mc=Te(vc,He);Re?E.password+=mc:E.username+=mc}B=""}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(ye&&B==="")return fe;re-=f(B).length+1,B="",C=be}else B+=U;break;case be:case qe:if($&&E.scheme==="file"){C=ta;continue}else if(U===":"&&!Se){if(B==="")return ue;if(ft=E.parseHost(B),ft)return ft;if(B="",C=it,$===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ue;if($&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=or,$)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case it:if(N(De,U))B+=U;else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()||$){if(B!==""){var aa=V(B,10);if(aa>65535)return ae;E.port=E.isSpecial()&&aa===Me[E.scheme]?null:aa,B=""}if($)return;C=or;continue}else return ae;break;case ea:if(E.scheme="file",U==="/"||U==="\\")C=fc;else if(_&&_.scheme==="file")switch(U){case ge:E.host=_.host,E.path=h(_.path),E.query=_.query;break;case"?":E.host=_.host,E.path=h(_.path),E.query="",C=Lt;break;case"#":E.host=_.host,E.path=h(_.path),E.query=_.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=_.host,E.path=h(_.path),E.shortenPath()),C=ot;continue}else{C=ot;continue}break;case fc:if(U==="/"||U==="\\"){C=ta;break}_&&_.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(_e(_.path[0],!0)?F(E.path,_.path[0]):E.host=_.host),C=ot;continue;case ta:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&_e(B))C=ot;else if(B===""){if(E.host="",$)return;C=or}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),$)return;B="",C=or}continue}else B+=U;break;case or:if(E.isSpecial()){if(C=ot,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")E.query="",C=Lt;else if(!$&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=ot,U!=="/"))continue;break;case ot:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!$&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):nr(B)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&_e(B)&&(E.host&&(E.host=""),B=M(B,0)+":"),F(E.path,B)),B="",E.scheme==="file"&&(U===ge||U==="?"||U==="#"))for(;E.path.length>1&&E.path[0]==="";)T(E.path);U==="?"?(E.query="",C=Lt):U==="#"&&(E.fragment="",C=lt)}else B+=Te(U,de);break;case dc:U==="?"?(E.query="",C=Lt):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=Te(U,se));break;case Lt:!$&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=Te(U,se));break;case lt:U!==ge&&(E.fragment+=Te(U,le));break}re++}},parseHost:function(k){var $,_,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||($=$t(H(k,1,-1)),!$))return ue;this.host=$}else if(this.isSpecial()){if(k=p(k),N(Ct,k)||($=et(k),$===null))return ue;this.host=$}else{if(N(At,k))return ue;for($="",_=f(k),E=0;E<_.length;E++)$+=Te(_[E],se);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Me,this.scheme)},shortenPath:function(){var k=this.path,$=k.length;$&&(this.scheme!=="file"||$!==1||!_e(k[0],!0))&&k.length--},serialize:function(){var k=this,$=k.scheme,_=k.username,E=k.password,C=k.host,re=k.port,B=k.path,ye=k.query,Se=k.fragment,Re=$+":";return C!==null?(Re+="//",k.includesCredentials()&&(Re+=_+(E?":"+E:"")+"@"),Re+=X(C),re!==null&&(Re+=":"+re)):$==="file"&&(Re+="//"),Re+=k.cannotBeABaseURL?B[0]:B.length?"/"+S(B,"/"):"",ye!==null&&(Re+="?"+ye),Se!==null&&(Re+="#"+Se),Re},setHref:function(k){var $=this.parse(k);if($)throw new z($);this.searchParams.update()},getOrigin:function(){var k=this.scheme,$=this.port;if(k==="blob")try{return new sr(k.path[0]).origin}catch{return"null"}return k==="file"||!this.isSpecial()?"null":k+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(k){this.parse(v(k)+":",ar)},getUsername:function(){return this.username},setUsername:function(k){var $=f(v(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var _=0;_<$.length;_++)this.username+=Te($[_],He)}},getPassword:function(){return this.password},setPassword:function(k){var $=f(v(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var _=0;_<$.length;_++)this.password+=Te($[_],He)}},getHost:function(){var k=this.host,$=this.port;return k===null?"":$===null?X(k):X(k)+":"+$},setHost:function(k){this.cannotBeABaseURL||this.parse(k,be)},getHostname:function(){var k=this.host;return k===null?"":X(k)},setHostname:function(k){this.cannotBeABaseURL||this.parse(k,qe)},getPort:function(){var k=this.port;return k===null?"":v(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=v(k),k===""?this.port=null:this.parse(k,it))},getPathname:function(){var k=this.path;return this.cannotBeABaseURL?k[0]:k.length?"/"+S(k,"/"):""},setPathname:function(k){this.cannotBeABaseURL||(this.path=[],this.parse(k,or))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=v(k),k===""?this.query=null:(M(k,0)==="?"&&(k=H(k,1)),this.query="",this.parse(k,Lt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=v(k),k===""){this.fragment=null;return}M(k,0)==="#"&&(k=H(k,1)),this.fragment="",this.parse(k,lt)},update:function(){this.query=this.searchParams.serialize()||null}};var sr=function($){var _=u(this,je),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(_,new ra($,!1,E));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())},je=sr.prototype,We=function(k,$){return{get:function(){return b(this)[k]()},set:$&&function(_){return b(this)[$](_)},configurable:!0,enumerable:!0}};if(e&&(s(je,"href",We("serialize","setHref")),s(je,"origin",We("getOrigin")),s(je,"protocol",We("getProtocol","setProtocol")),s(je,"username",We("getUsername","setUsername")),s(je,"password",We("getPassword","setPassword")),s(je,"host",We("getHost","setHost")),s(je,"hostname",We("getHostname","setHostname")),s(je,"port",We("getPort","setPort")),s(je,"pathname",We("getPathname","setPathname")),s(je,"search",We("getSearch","setSearch")),s(je,"searchParams",We("getSearchParams")),s(je,"hash",We("getHash","setHash"))),o(je,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(je,"toString",function(){return b(this).serialize()},{enumerable:!0}),x){var hc=x.createObjectURL,pc=x.revokeObjectURL;hc&&o(sr,"createObjectURL",a(hc,x)),pc&&o(sr,"revokeObjectURL",a(pc,x))}return g(sr,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:sr}),Il}var ql;function um(){return ql||(ql=1,cm()),Sl}var xl={},Nl;function lm(){if(Nl)return xl;Nl=1;var t=Ie(),e=Ye(),r=Ae(),n=tr(),a=wt(),i=Mn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),xl}var jl={},Dl;function fm(){if(Dl)return jl;Dl=1;var t=Ie(),e=Ye(),r=tr(),n=wt(),a=Mn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),jl}var Ml={},Fl;function dm(){if(Fl)return Ml;Fl=1;var t=Ie(),e=xe();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Ml}var oo,Kl;function hm(){if(Kl)return oo;Kl=1,Gh(),um(),lm(),fm(),dm();var t=Hn();return oo=t.URL,oo}var so,zl;function pm(){if(zl)return so;zl=1;var t=hm();return so=t,so}var co,Hl;function vm(){if(Hl)return co;Hl=1;var t=pm();return co=t,co}vm();var Bl={},uo,Gl;function mm(){return Gl||(Gl=1,uo={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}),uo}var lo,Wl;function gm(){if(Wl)return lo;Wl=1;var t=Nn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return lo=r===Object.prototype?void 0:r,lo}var Vl;function Xh(){if(Vl)return Bl;Vl=1;var t=me(),e=mm(),r=gm(),n=Ds(),a=er(),i=kr(),o=Ue(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),Bl}var fo,Jl;function ym(){if(Jl)return fo;Jl=1;var t=Gh();return Xh(),fo=t,fo}var ho,Zl;function wm(){if(Zl)return ho;Zl=1;var t=ym();return ho=t,ho}wm();var Yl={},Xl={},po,Ql;function bm(){if(Ql)return po;Ql=1;var t=Ze(),e=er();return po=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},po}var vo,ef;function Sm(){if(ef)return vo;ef=1;var t=ve(),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 mo,tf;function Im(){if(tf)return mo;tf=1;var t=Ae(),e=Qt();return mo=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),mo}var go,rf;function Pm(){if(rf)return go;rf=1;var t=er(),e=Sm(),r=Im(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,nf;function tn(){if(nf)return yo;nf=1;var t=Tr(),e=xe(),r=nt(),n=Dn(),a=Zh(),i=As(),o=jn(),s=Ks(),u=Kn(),l=Jh(),c=TypeError,f=function(d,p){this.stopped=d,this.result=p},h=f.prototype;return yo=function(d,p,v){var g=v&&v.that,P=!!(v&&v.AS_ENTRIES),w=!!(v&&v.IS_RECORD),y=!!(v&&v.IS_ITERATOR),m=!!(v&&v.INTERRUPTED),b=t(p,g),R,A,x,z,V,te,L,M=function(S){return R&&l(R,"normal"),new f(!0,S)},N=function(S){return P?(r(S),m?b(S[0],S[1],M):b(S[0],S[1])):m?b(S,M):b(S)};if(w)R=d.iterator;else if(y)R=d;else{if(A=u(d),!A)throw new c(n(d)+" is not iterable");if(a(A)){for(x=0,z=i(d);z>x;x++)if(V=N(d[x]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!(L=e(te,R)).done;){try{V=N(L.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},yo}var wo,af;function Em(){if(af)return wo;af=1;var t=wt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var of;function km(){if(of)return Xl;of=1;var t=Ie(),e=jn(),r=xs(),n=Ns(),a=Dh(),i=Xr(),o=er(),s=Qt(),u=bm(),l=Pm(),c=tn(),f=Em(),h=Ue(),d=h("toStringTag"),p=Error,v=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new p,b?r(this):P):(R=b?this:i(P),o(R,d,"Error")),m!==void 0&&o(R,"message",f(m)),l(R,g,R.stack,1),arguments.length>2&&u(R,arguments[2]);var A=[];return c(y,v,{that:A}),o(R,"errors",A),R};n?n(g,p):a(g,p,{name:!0});var P=g.prototype=i(p.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Xl}var sf;function Tm(){return sf||(sf=1,km()),Yl}var cf={},bo,uf;function _m(){if(uf)return bo;uf=1;var t=Fs(),e=en();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var lf;function Rm(){if(lf)return cf;lf=1;var t=Fs(),e=Xe(),r=_m();return t||e(Object.prototype,"toString",r,{unsafe:!0}),cf}var ff={},df={},So,hf;function Qh(){if(hf)return So;hf=1;var t=me(),e=Yr(),r=$n(),n=function(a){return e.slice(0,a.length)===a};return So=(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"})(),So}var Io,pf;function zs(){if(pf)return Io;pf=1;var t=Qh();return Io=t==="NODE",Io}var Po,vf;function Om(){if(vf)return Po;vf=1;var t=Ye(),e=Fn(),r=Ue(),n=$e(),a=r("species");return Po=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Po}var Eo,mf;function Cm(){if(mf)return Eo;mf=1;var t=Yh(),e=Dn(),r=TypeError;return Eo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Eo}var ko,gf;function ep(){if(gf)return ko;gf=1;var t=nt(),e=Cm(),r=Ln(),n=Ue(),a=n("species");return ko=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},ko}var To,yf;function tp(){if(yf)return To;yf=1;var t=Un(),e=Function.prototype,r=e.apply,n=e.call;return To=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),To}var _o,wf;function rp(){if(wf)return _o;wf=1;var t=Yr();return _o=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),_o}var Ro,bf;function np(){if(bf)return Ro;bf=1;var t=me(),e=tp(),r=Tr(),n=we(),a=Je(),i=Ae(),o=$h(),s=zn(),u=Nn(),l=tr(),c=rp(),f=zs(),h=t.setImmediate,d=t.clearImmediate,p=t.process,v=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,x,z;i(function(){R=t.location});var V=function(N){if(a(m,N)){var S=m[N];delete m[N],S()}},te=function(N){return function(){V(N)}},L=function(N){V(N.data)},M=function(N){t.postMessage(w(N),R.protocol+"//"+R.host)};return(!h||!d)&&(h=function(S){l(arguments.length,1);var O=n(S)?S:g(S),q=s(arguments,1);return m[++y]=function(){e(O,void 0,q)},A(y),y},d=function(S){delete m[S]},f?A=function(N){p.nextTick(te(N))}:v&&v.now?A=function(N){v.now(te(N))}:P&&!c?(x=new P,z=x.port2,x.port1.onmessage=L,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",L,!1)):b in u("script")?A=function(N){o.appendChild(u("script"))[b]=function(){o.removeChild(this),V(N)}}:A=function(N){setTimeout(te(N),0)}),Ro={set:h,clear:d},Ro}var Oo,Sf;function ap(){if(Sf)return Oo;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}}},Oo=t,Oo}var Co,If;function Am(){if(If)return Co;If=1;var t=Yr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,Pf;function Um(){if(Pf)return Ao;Pf=1;var t=Yr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,Ef;function $m(){if(Ef)return Uo;Ef=1;var t=me(),e=Hh(),r=Tr(),n=np().set,a=ap(),i=rp(),o=Am(),s=Um(),u=zs(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),p,v,g,P,w;if(!d){var y=new a,m=function(){var b,R;for(u&&(b=f.domain)&&b.exit();R=y.get();)try{R()}catch(A){throw y.head&&p(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(v=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),p=function(){g.data=v=!v}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),p=function(){w(m)}):u?p=function(){f.nextTick(m)}:(n=r(n,t),p=function(){n(m)}),d=function(b){y.head||p(),y.add(b)}}return Uo=d,Uo}var $o,kf;function Lm(){return kf||(kf=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}var Lo,Tf;function _r(){return Tf||(Tf=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var qo,_f;function Rr(){if(_f)return qo;_f=1;var t=me();return qo=t.Promise,qo}var xo,Rf;function rn(){if(Rf)return xo;Rf=1;var t=me(),e=Rr(),r=we(),n=Mh(),a=qs(),i=Ue(),o=Qh(),s=ut(),u=Ph(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var p=a(e),v=p!==String(e);if(!v&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(p)){var g=new e(function(y){y(1)}),P=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=P,f=g.then(function(){})instanceof P,!f)return!0}return!v&&(o==="BROWSER"||o==="DENO")&&!h});return xo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},xo}var No={},Of;function bt(){if(Of)return No;Of=1;var t=at(),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 Cf;function qm(){if(Cf)return df;Cf=1;var t=Ie(),e=ut(),r=zs(),n=me(),a=Hn(),i=xe(),o=Xe(),s=Ns(),u=kr(),l=Om(),c=at(),f=we(),h=Ze(),d=Ms(),p=ep(),v=np().set,g=$m(),P=Lm(),w=_r(),y=ap(),m=Er(),b=Rr(),R=rn(),A=bt(),x="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,L=m.getterFor(x),M=m.set,N=b&&b.prototype,S=b,O=N,q=n.TypeError,F=n.document,I=n.process,T=A.f,j=T,H=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ue=2,ae=1,ke=2,Ne,De,Le,Qe,St=function(K){var X;return h(K)&&f(X=K.then)?X:!1},It=function(K,X){var se=X.value,le=X.state===ne,de=le?K.ok:K.fail,He=K.resolve,Te=K.reject,Me=K.domain,_e,Ge,nr;try{de?(le||(X.rejection===ke&&Ut(X),X.rejection=ae),de===!0?_e=se:(Me&&Me.enter(),_e=de(se),Me&&(Me.exit(),nr=!0)),_e===K.promise?Te(new q("Promise-chain cycle")):(Ge=St(_e))?i(Ge,_e,He,Te):He(_e)):Te(se)}catch(Ur){Me&&!nr&&Me.exit(),Te(Ur)}},Ct=function(K,X){K.notified||(K.notified=!0,g(function(){for(var se=K.reactions,le;le=se.get();)It(le,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},At=function(K,X,se){var le,de;H?(le=F.createEvent("Event"),le.promise=X,le.reason=se,le.initEvent(K,!1,!0),n.dispatchEvent(le)):le={promise:X,reason:se},!V&&(de=n["on"+K])?de(le):K===Y&&P("Unhandled promise rejection",se)},Ar=function(K){i(v,n,function(){var X=K.facade,se=K.value,le=rr(K),de;if(le&&(de=w(function(){r?I.emit("unhandledRejection",se,X):At(Y,X,se)}),K.rejection=r||rr(K)?ke:ae,de.error))throw de.value})},rr=function(K){return K.rejection!==ae&&!K.parent},Ut=function(K){i(v,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):At(J,X,K.value)})},ge=function(K,X,se){return function(le){K(X,le,se)}},et=function(K,X,se){K.done||(K.done=!0,se&&(K=se),K.value=X,K.state=ue,Ct(K,!0))},$t=function(K,X,se){if(!K.done){K.done=!0,se&&(K=se);try{if(K.facade===X)throw new q("Promise can't be resolved itself");var le=St(X);le?g(function(){var de={done:!1};try{i(le,X,ge($t,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Ct(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var se=L(this);try{X(ge($t,se),ge(et,se))}catch(le){et(se,le)}},O=S.prototype,Ne=function(X){M(this,{type:x,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,se){var le=L(this),de=T(p(this,S));return le.parent=!0,de.ok=f(X)?X:!0,de.fail=f(se)&&se,de.domain=r?I.domain:void 0,le.state===fe?le.reactions.add(de):g(function(){It(de,le)}),de.promise}),De=function(){var K=new Ne,X=L(K);this.promise=K,this.resolve=ge($t,X),this.reject=ge(et,X)},A.f=T=function(K){return K===S||K===Le?new De(K):j(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,se){var le=this;return new S(function(de,He){i(Qe,le,de,He)}).then(X,se)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,O)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:S}),Le=a.Promise,u(S,x,!1,!0),l(x),df}var Af={},jo,Uf;function xm(){if(Uf)return jo;Uf=1;var t=Ue(),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 jo=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},jo}var Do,$f;function Bn(){if($f)return Do;$f=1;var t=Rr(),e=xm(),r=rn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Lf;function Nm(){if(Lf)return Af;Lf=1;var t=Ie(),e=xe(),r=at(),n=bt(),a=_r(),i=tn(),o=Bn();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var p=r(l.resolve),v=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(p,l,w).then(function(b){m||(m=!0,v[y]=b,--P||f(v))},h)}),--P||f(v)});return d.error&&h(d.value),c.promise}}),Af}var qf={},xf;function jm(){if(xf)return qf;xf=1;var t=Ie(),e=ut(),r=rn().CONSTRUCTOR,n=Rr(),a=Ye(),i=we(),o=Xe(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return qf}var Nf={},jf;function Dm(){if(jf)return Nf;jf=1;var t=Ie(),e=xe(),r=at(),n=bt(),a=_r(),i=tn(),o=Bn();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(p){e(d,l,p).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),Nf}var Df={},Mf;function Mm(){if(Mf)return Df;Mf=1;var t=Ie(),e=bt(),r=rn().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={},Mo,Kf;function ip(){if(Kf)return Mo;Kf=1;var t=nt(),e=Ze(),r=bt();return Mo=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},Mo}var zf;function Fm(){if(zf)return Ff;zf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=ip(),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 Hf;function Km(){return Hf||(Hf=1,qm(),Nm(),jm(),Dm(),Mm(),Fm()),ff}var Bf={},Gf;function zm(){if(Gf)return Bf;Gf=1;var t=Ie(),e=xe(),r=at(),n=bt(),a=_r(),i=tn(),o=Bn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var p=r(l.resolve),v=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(p,l,w).then(function(b){m||(m=!0,v[y]={status:"fulfilled",value:b},--P||f(v))},function(b){m||(m=!0,v[y]={status:"rejected",reason:b},--P||f(v))})}),--P||f(v)});return d.error&&h(d.value),c.promise}}),Bf}var Wf={},Vf;function Hm(){if(Vf)return Wf;Vf=1;var t=Ie(),e=xe(),r=at(),n=Ye(),a=bt(),i=_r(),o=tn(),s=Bn(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),p=d.resolve,v=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,x=!1;m++,e(P,f,R).then(function(z){x||b||(b=!0,p(z))},function(z){x||b||(x=!0,w[A]=z,--m||v(new h(w,u)))})}),--m||v(new h(w,u))});return g.error&&v(g.value),d.promise}}),Wf}var Jf={},Zf;function op(){if(Zf)return Jf;Zf=1;var t=Ie(),e=me(),r=tp(),n=zn(),a=bt(),i=at(),o=_r(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Jf}var Yf={},Xf;function sp(){if(Xf)return Yf;Xf=1;var t=Ie(),e=bt();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 Bm(){if(ed)return Qf;ed=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=ep(),s=ip(),u=Xe(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),p=i(h);return this.then(p?function(v){return s(d,h()).then(function(){return v})}:h,p?function(v){return s(d,h()).then(function(){throw v})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Qf}var Fo,td;function Gm(){if(td)return Fo;td=1,Tm(),Ds(),Rm(),Km(),zm(),Hm(),op(),sp(),Bm(),Vh();var t=Hn();return Fo=t.Promise,Fo}var Ko,rd;function Wm(){if(rd)return Ko;rd=1;var t=Gm();return Xh(),Ko=t,Ko}var nd={},ad;function Vm(){return ad||(ad=1,op()),nd}var id={},od;function Jm(){return od||(od=1,sp()),id}var zo,sd;function Zm(){if(sd)return zo;sd=1;var t=Wm();return Vm(),Jm(),zo=t,zo}Zm();const cp="sesamy-debug";function Ym(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 Xm(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 Qm(t){Ym(cp,t.toString(),1)}function eg(){return Xm(cp)==="true"}function oe(t){eg()&&console.log(t)}function Jt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});oe(`Triggering event: ${t}`),dispatchEvent(r)}function st(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 Nt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hs(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 xt=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()}}));Hs(xt);var tg=Hs(Bs((function(t,e){var r=Nt&&Nt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(p,v){function g(y){try{w(d.next(y))}catch(m){v(m)}}function P(y){try{w(d.throw(y))}catch(m){v(m)}}function w(y){y.done?p(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=Nt&&Nt.__generator||function(c,f){var h,d,p,v,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return v={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function P(w){return function(y){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;g;)try{if(h=1,d&&(p=2&m[0]?d.return:m[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,m[1])).done)return p;switch(d=0,p&&(m=[2&m[0],p.value]),m[0]){case 0:case 1:p=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(p=g.trys,!((p=p.length>0&&p[p.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!p||m[1]>p[0]&&m[1]<p[3])){g.label=m[1];break}if(m[0]===6&&g.label<p[1]){g.label=p[1],p=m;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(m);break}p[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=p=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=Nt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,p,v,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),p=Date.now()+h,v=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(v)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(v,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(v))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(v,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(p){return setTimeout((function(){return r(d,void 0,void 0,(function(){var v,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,xt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(v=this.storageHandler===void 0?o:this.storageHandler,(g=v.getItemSync(f))===null?(xt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),v.setItemSync(f,JSON.stringify(P)),xt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(xt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var p=!1,v=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!p){p=!0;var y=50-(Date.now()-v);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var w=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,p,v;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(p=h.getItemSync(d))===null?[2]:(v=JSON.parse(p)).id!==this.id?[3,2]:[4,xt.default().lock(v.iat)];case 1:g.sent(),this.acquiredIatSet.delete(v.iat),h.removeItemSync(d),xt.default().unlock(v.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,p=[],v=0;;){var g=d.keySync(v);if(g===null)break;p.push(g),v++}for(var P=!1,w=0;w<p.length;w++){var y=p[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),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const rg={timeoutInSeconds:60},up={name:"auth0-spa-js",version:"2.8.0"},lp=()=>Date.now();let Ee=class cs extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,cs.prototype)}static fromPayload({error:e,error_description:r}){return new cs(e,r)}},ng=class fp extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,fp.prototype)}},ag=class dp extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,dp.prototype)}},us=class hp extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,hp.prototype)}};class Gs extends us{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Gs.prototype)}}let ig=class pp extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,pp.prototype)}},og=class vp extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,vp.prototype)}},mp=class gp extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Sn(e,["default"])}', scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,gp.prototype)}},sg=class yp extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${Sn(e,["default"])}', missing scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,yp.prototype)}},wp=class bp extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,bp.prototype)}};function Sn(t,e=[]){return t&&!e.includes(t)?t:""}const In=()=>window.crypto,Lr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(In().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Ho=t=>btoa(t),cg=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],ug=t=>Object.keys(t).reduce(((e,r)=>{const n=cg.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),ls=t=>{var{clientId:e}=t,r=st(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 In().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))))},lg=new TextEncoder,fg=new TextDecoder;function zr(t){return typeof t=="string"?lg.encode(t):fg.decode(t)}function fd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new hg(`${t.name} modulusLength must be at least 2048 bits`)}async function dg(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=`${Hr(zr(JSON.stringify(t)))}.${Hr(zr(JSON.stringify(e)))}`;return`${n}.${Hr(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 Mt})(r),r,zr(n)))}`}let fs;Uint8Array.prototype.toBase64?fs=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):fs=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 Hr(t){return fs(t)}let Mt=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)}},hg=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 pg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Mt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Mt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Mt("unsupported CryptoKey algorithm name")}}function Sp(t){return t instanceof CryptoKey}function Ip(t){return Sp(t)&&t.type==="public"}async function vg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!Sp(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!Ip(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 dg({alg:pg(o),typ:"dpop+jwt",jwk:await Pp(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Hr(await crypto.subtle.digest("SHA-256",zr(a))):void 0}),o)}async function Pp(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 mg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function gg(){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 Mt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function yg(t){return(async function(e){if(!Ip(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 Pp(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 Mt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function wg({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 vg(t,i,r,n,a)}const bg=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},Sg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([bg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},Ig=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},Pg=async(t,e,r,n,a,i,o=1e4,s)=>a?Ig(t,e,r,n,o,a,i,s):Sg(t,n,o);async function Ep(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await Pg(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=c.json,{error:d,error_description:p}=h,v=st(h,["error","error_description"]),{headers:g,ok:P}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!P){const y=p||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new og(d,y,v.mfa_token);if(d==="missing_refresh_token")throw new mp(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new wp(w);return Ep(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return v}async function Eg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=st(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),p=s?ls(d):JSON.stringify(d),v=(g=c.grant_type,mg.includes(g));var g;return await Ep(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:p,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(ug(o||up)))}},e,s,u,v?l:void 0)}const mn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},cn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),mn(n,e)};let ht=class ds{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 ds({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new ds({scope:r,audience:n,clientId:a})}},kg=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@@")))}},kp=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)}})()}},Tg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||lp}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new ht({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 ht({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 ht({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=ht.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=ht.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)}}}},_g=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 qr=t=>typeof t=="number",Rg=["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"],Og=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(ud(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],Rg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,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&&!qr(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||!qr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!qr(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&&qr(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&&qr(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 Ft=Bs((function(t,e){var r=Nt&&Nt.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),p=d.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=p.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Hs(Ft),Ft.encode,Ft.parse,Ft.getAll;var Cg=Ft.get,Tp=Ft.set,_p=Ft.remove;const fr={get(t){const e=Cg(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),Tp(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),_p(t,r)}},Ag={get(t){return fr.get(t)||fr.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),Tp(`_legacy_${t}`,JSON.stringify(e),n),fr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),_p(t,r),fr.remove(t,e),fr.remove(`_legacy_${t}`,e)}},Ug={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 jt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(jt||(jt={}));function $g(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,r!==void 0&&r),i=a.indexOf(`
2
- `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var dd,hd,pd,Bo,Lg=(dd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",hd=null,pd=!1,function(t){return Bo=Bo||$g(dd,hd,pd),new Worker(Bo,t)});const Go={};let qg=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 xg={memory:()=>new kp().enclosedCache,localstorage:()=>new kg},vd=t=>xg[t],md=t=>{const{openUrl:e,onRedirect:r}=t,n=st(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)))},qt={NONCE:"nonce",KEYPAIR:"keypair"};let Ng=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(qt).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(qt.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save(qt.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find(qt.NONCE,this.buildKey(e))}findKeyPair(){return this.find(qt.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(qt.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(qt.KEYPAIR,this.clientId)}},jg=class{constructor(e){this.storage=new Ng(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 gg(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return wg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return yg(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var dr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(dr||(dr={}));let Dg=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=dr.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?dr.DPoP:dr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===dr.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 wp(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)}},Mg=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 Rp 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,Rp.prototype)}};const Wo=new tg;let Fg=class{constructor(e){let r,n;if(this.userCache=new kp().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await Wo.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(!In())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(In().subtle===void 0)throw new Error(`
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={},ia,wc;function Ae(){return wc||(wc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,bc;function Un(){if(bc)return oa;bc=1;var t=Ae();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,Sc;function ve(){if(Sc)return sa;Sc=1;var t=Un(),e=Function.prototype,r=e.call,n=t&&e.bind.bind(r,r);return sa=t?n:function(a){return function(){return r.apply(a,arguments)}},sa}var ca,Ic;function $n(){if(Ic)return ca;Ic=1;var t=ve(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,Pc;function bh(){if(Pc)return ua;Pc=1;var t=ve(),e=Ae(),r=$n(),n=Object,a=t("".split);return ua=e(function(){return!n("z").propertyIsEnumerable(0)})?function(i){return r(i)==="String"?a(i,""):n(i)}:n,ua}var la,Ec;function Ln(){return Ec||(Ec=1,la=function(t){return t==null}),la}var fa,kc;function qn(){if(kc)return fa;kc=1;var t=Ln(),e=TypeError;return fa=function(r){if(t(r))throw new e("Can't call method on "+r);return r},fa}var da,Tc;function Zr(){if(Tc)return da;Tc=1;var t=bh(),e=qn();return da=function(r){return t(e(r))},da}var $r,_c;function me(){if(_c)return $r;_c=1;var t=function(e){return e&&e.Math===Math&&e};return $r=t(typeof globalThis=="object"&&globalThis)||t(typeof window=="object"&&window)||t(typeof self=="object"&&self)||t(typeof gc=="object"&&gc)||t(typeof $r=="object"&&$r)||(function(){return this})()||Function("return this")(),$r}var ha={exports:{}},pa,Rc;function ut(){return Rc||(Rc=1,pa=!1),pa}var va,Oc;function _s(){if(Oc)return va;Oc=1;var t=me(),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 Cc;function Rs(){if(Cc)return ha.exports;Cc=1;var t=ut(),e=me(),r=_s(),n="__core-js_shared__",a=ha.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"}),ha.exports}var ma,Ac;function Sh(){if(Ac)return ma;Ac=1;var t=Rs();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Uc;function xn(){if(Uc)return ga;Uc=1;var t=qn(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,$c;function Je(){if($c)return ya;$c=1;var t=ve(),e=xn(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Lc;function Ih(){if(Lc)return wa;Lc=1;var t=ve(),e=0,r=Math.random(),n=t(1.1.toString);return wa=function(a){return"Symbol("+(a===void 0?"":a)+")_"+n(++e+r,36)},wa}var ba,qc;function Yr(){if(qc)return ba;qc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,xc;function Ph(){if(xc)return Sa;xc=1;var t=me(),e=Yr(),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]))),Sa=s,Sa}var Ia,Nc;function Eh(){if(Nc)return Ia;Nc=1;var t=Ph(),e=Ae(),r=me(),n=r.String;return Ia=!!Object.getOwnPropertySymbols&&!e(function(){var a=Symbol("symbol detection");return!n(a)||!(Object(a)instanceof Symbol)||!Symbol.sham&&t&&t<41}),Ia}var Pa,jc;function kh(){if(jc)return Pa;jc=1;var t=Eh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,Dc;function Ue(){if(Dc)return Ea;Dc=1;var t=me(),e=Sh(),r=Je(),n=Ih(),a=Eh(),i=kh(),o=t.Symbol,s=e("wks"),u=i?o.for||o:o&&o.withoutSetter||n;return Ea=function(l){return r(s,l)||(s[l]=a&&r(o,l)?o[l]:u("Symbol."+l)),s[l]},Ea}var ka,Mc;function we(){if(Mc)return ka;Mc=1;var t=typeof document=="object"&&document.all;return ka=typeof t>"u"&&t!==void 0?function(e){return typeof e=="function"||e===t}:function(e){return typeof e=="function"},ka}var Ta,Fc;function Ze(){if(Fc)return Ta;Fc=1;var t=we();return Ta=function(e){return typeof e=="object"?e!==null:t(e)},Ta}var _a,Kc;function nt(){if(Kc)return _a;Kc=1;var t=Ze(),e=String,r=TypeError;return _a=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},_a}var Ra={},Oa,zc;function $e(){if(zc)return Oa;zc=1;var t=Ae();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Bc;function Th(){if(Bc)return Ca;Bc=1;var t=$e(),e=Ae();return Ca=t&&e(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Ca}var Aa={},Ua,Hc;function Nn(){if(Hc)return Ua;Hc=1;var t=me(),e=Ze(),r=t.document,n=e(r)&&e(r.createElement);return Ua=function(a){return n?r.createElement(a):{}},Ua}var $a,Gc;function _h(){if(Gc)return $a;Gc=1;var t=$e(),e=Ae(),r=Nn();return $a=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),$a}var La,Wc;function xe(){if(Wc)return La;Wc=1;var t=Un(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var qa,Vc;function Ye(){if(Vc)return qa;Vc=1;var t=me(),e=we(),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 xa,Jc;function jn(){if(Jc)return xa;Jc=1;var t=ve();return xa=t({}.isPrototypeOf),xa}var Na,Zc;function Rh(){if(Zc)return Na;Zc=1;var t=Ye(),e=we(),r=jn(),n=kh(),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 ja,Yc;function Dn(){if(Yc)return ja;Yc=1;var t=String;return ja=function(e){try{return t(e)}catch{return"Object"}},ja}var Da,Xc;function at(){if(Xc)return Da;Xc=1;var t=we(),e=Dn(),r=TypeError;return Da=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Da}var Ma,Qc;function Os(){if(Qc)return Ma;Qc=1;var t=at(),e=Ln();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,eu;function qv(){if(eu)return Fa;eu=1;var t=xe(),e=we(),r=Ze(),n=TypeError;return Fa=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")},Fa}var Ka,tu;function xv(){if(tu)return Ka;tu=1;var t=xe(),e=Ze(),r=Rh(),n=Os(),a=qv(),i=Ue(),o=TypeError,s=i("toPrimitive");return Ka=function(u,l){if(!e(u)||r(u))return u;var c=n(u,s),f;if(c){if(l===void 0&&(l="default"),f=t(c,u,l),!e(f)||r(f))return f;throw new o("Can't convert object to primitive value")}return l===void 0&&(l="number"),a(u,l)},Ka}var za,ru;function Oh(){if(ru)return za;ru=1;var t=xv(),e=Rh();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var nu;function wt(){if(nu)return Aa;nu=1;var t=$e(),e=_h(),r=Th(),n=nt(),a=Oh(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Aa.f=t?r?function(h,d,p){if(n(h),d=a(d),n(p),typeof h=="function"&&d==="prototype"&&"value"in p&&c in p&&!p[c]){var v=s(h,d);v&&v[c]&&(h[d]=p.value,p={configurable:l in p?p[l]:v[l],enumerable:u in p?p[u]:v[u],writable:!1})}return o(h,d,p)}:o:function(h,d,p){if(n(h),d=a(d),n(p),e)try{return o(h,d,p)}catch{}if("get"in p||"set"in p)throw new i("Accessors not supported");return"value"in p&&(h[d]=p.value),h},Aa}var Ba,au;function Nv(){if(au)return Ba;au=1;var t=Math.ceil,e=Math.floor;return Ba=Math.trunc||function(n){var a=+n;return(a>0?e:t)(a)},Ba}var Ha,iu;function Cs(){if(iu)return Ha;iu=1;var t=Nv();return Ha=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ha}var Ga,ou;function Ch(){if(ou)return Ga;ou=1;var t=Cs(),e=Math.max,r=Math.min;return Ga=function(n,a){var i=t(n);return i<0?e(i+a,0):r(i,a)},Ga}var Wa,su;function jv(){if(su)return Wa;su=1;var t=Cs(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,cu;function As(){if(cu)return Va;cu=1;var t=jv();return Va=function(e){return t(e.length)},Va}var Ja,uu;function Dv(){if(uu)return Ja;uu=1;var t=Zr(),e=Ch(),r=As(),n=function(a){return function(i,o,s){var u=t(i),l=r(u);if(l===0)return!a&&-1;var c=e(s,l),f;if(a&&o!==o){for(;l>c;)if(f=u[c++],f!==f)return!0}else for(;l>c;c++)if((a||c in u)&&u[c]===o)return a||c||0;return!a&&-1}};return Ja={includes:n(!0),indexOf:n(!1)},Ja}var Za,lu;function Us(){return lu||(lu=1,Za={}),Za}var Ya,fu;function Ah(){if(fu)return Ya;fu=1;var t=ve(),e=Je(),r=Zr(),n=Dv().indexOf,a=Us(),i=t([].push);return Ya=function(o,s){var u=r(o),l=0,c=[],f;for(f in u)!e(a,f)&&e(u,f)&&i(c,f);for(;s.length>l;)e(u,f=s[l++])&&(~n(c,f)||i(c,f));return c},Ya}var Xa,du;function $s(){return du||(du=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,hu;function Uh(){if(hu)return Qa;hu=1;var t=Ah(),e=$s();return Qa=Object.keys||function(n){return t(n,e)},Qa}var pu;function Mv(){if(pu)return Ra;pu=1;var t=$e(),e=Th(),r=wt(),n=nt(),a=Zr(),i=Uh();return Ra.f=t&&!e?Object.defineProperties:function(s,u){n(s);for(var l=a(u),c=i(u),f=c.length,h=0,d;f>h;)r.f(s,d=c[h++],l[d]);return s},Ra}var ei,vu;function $h(){if(vu)return ei;vu=1;var t=Ye();return ei=t("document","documentElement"),ei}var ti,mu;function Ls(){if(mu)return ti;mu=1;var t=Sh(),e=Ih(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,gu;function Xr(){if(gu)return ri;gu=1;var t=nt(),e=Mv(),r=$s(),n=Us(),a=$h(),i=Nn(),o=Ls(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},p=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},v=function(){var w=i("iframe"),y="java"+c+":",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,P=function(){try{g=new ActiveXObject("htmlfile")}catch{}P=typeof document<"u"?document.domain&&g?p(g):v():p(g);for(var w=r.length;w--;)delete P[l][r[w]];return P()};return n[f]=!0,ri=Object.create||function(y,m){var b;return y!==null?(h[l]=t(y),b=new h,h[l]=null,b[f]=y):b=P(),m===void 0?b:e.f(b,m)},ri}var ni,yu;function Fv(){if(yu)return ni;yu=1;var t=Ue(),e=Xr(),r=wt().f,n=t("unscopables"),a=Array.prototype;return a[n]===void 0&&r(a,n,{configurable:!0,value:e(null)}),ni=function(i){a[n][i]=!0},ni}var ai,wu;function Qr(){return wu||(wu=1,ai={}),ai}var ii,bu;function Kv(){if(bu)return ii;bu=1;var t=me(),e=we(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,Su;function Qt(){return Su||(Su=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,Iu;function er(){if(Iu)return si;Iu=1;var t=$e(),e=wt(),r=Qt();return si=t?function(n,a,i){return e.f(n,a,r(1,i))}:function(n,a,i){return n[a]=i,n},si}var ci,Pu;function Er(){if(Pu)return ci;Pu=1;var t=Kv(),e=me(),r=Ze(),n=er(),a=Je(),i=Rs(),o=Ls(),s=Us(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,p=function(w){return d(w)?h(w):f(w,{})},v=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 c);g.get=g.get,g.has=g.has,g.set=g.set,f=function(w,y){if(g.has(w))throw new l(u);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 P=o("state");s[P]=!0,f=function(w,y){if(a(w,P))throw new l(u);return y.facade=w,n(w,P,y),y},h=function(w){return a(w,P)?w[P]:{}},d=function(w){return a(w,P)}}return ci={set:f,get:h,has:d,enforce:p,getterFor:v},ci}var ui={},li={},Eu;function Lh(){if(Eu)return li;Eu=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return li.f=r?function(a){var i=e(this,a);return!!i&&i.enumerable}:t,li}var ku;function qh(){if(ku)return ui;ku=1;var t=$e(),e=xe(),r=Lh(),n=Qt(),a=Zr(),i=Oh(),o=Je(),s=_h(),u=Object.getOwnPropertyDescriptor;return ui.f=t?u:function(c,f){if(c=a(c),f=i(f),s)try{return u(c,f)}catch{}if(o(c,f))return n(!e(r.f,c,f),c[f])},ui}var fi={exports:{}},di,Tu;function xh(){if(Tu)return di;Tu=1;var t=$e(),e=Je(),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 di={EXISTS:a,PROPER:i,CONFIGURABLE:o},di}var hi,_u;function qs(){if(_u)return hi;_u=1;var t=ve(),e=we(),r=Rs(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var Ru;function Nh(){if(Ru)return fi.exports;Ru=1;var t=ve(),e=Ae(),r=we(),n=Je(),a=$e(),i=xh().CONFIGURABLE,o=qs(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),p=t([].join),v=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),g=String(String).split("String"),P=fi.exports=function(w,y,m){h(c(y),0,7)==="Symbol("&&(y="["+d(c(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),v&&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=u(w);return n(b,"source")||(b.source=p(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),fi.exports}var pi,Ou;function Xe(){if(Ou)return pi;Ou=1;var t=we(),e=wt(),r=Nh(),n=_s();return pi=function(a,i,o,s){s||(s={});var u=s.enumerable,l=s.name!==void 0?s.name:i;if(t(o)&&r(o,l,s),s.global)u?a[i]=o:n(i,o);else{try{s.unsafe?a[i]&&(u=!0):delete a[i]}catch{}u?a[i]=o:e.f(a,i,{value:o,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return a},pi}var vi={},Cu;function zv(){if(Cu)return vi;Cu=1;var t=Ah(),e=$s(),r=e.concat("length","prototype");return vi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},vi}var mi={},Au;function jh(){return Au||(Au=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Uu;function Bv(){if(Uu)return gi;Uu=1;var t=Ye(),e=ve(),r=zv(),n=jh(),a=nt(),i=e([].concat);return gi=t("Reflect","ownKeys")||function(s){var u=r.f(a(s)),l=n.f;return l?i(u,l(s)):u},gi}var yi,$u;function Dh(){if($u)return yi;$u=1;var t=Je(),e=Bv(),r=qh(),n=wt();return yi=function(a,i,o){for(var s=e(i),u=n.f,l=r.f,c=0;c<s.length;c++){var f=s[c];!t(a,f)&&!(o&&t(o,f))&&u(a,f,l(i,f))}},yi}var wi,Lu;function Mh(){if(Lu)return wi;Lu=1;var t=Ae(),e=we(),r=/#|\.prototype\./,n=function(u,l){var c=i[a(u)];return c===s?!0:c===o?!1:e(l)?t(l):!!l},a=n.normalize=function(u){return String(u).replace(r,".").toLowerCase()},i=n.data={},o=n.NATIVE="N",s=n.POLYFILL="P";return wi=n,wi}var bi,qu;function Ie(){if(qu)return bi;qu=1;var t=me(),e=qh().f,r=er(),n=Xe(),a=_s(),i=Dh(),o=Mh();return bi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,p,v,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(p in u){if(g=u[p],s.dontCallGetSet?(P=e(d,p),v=P&&P.value):v=d[p],h=o(c?p:l+(f?".":"#")+p,s.forced),!h&&v!==void 0){if(typeof g==typeof v)continue;i(g,v)}(s.sham||v&&v.sham)&&r(g,"sham",!0),n(d,p,g,s)}},bi}var Si,xu;function Hv(){if(xu)return Si;xu=1;var t=Ae();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,Nu;function xs(){if(Nu)return Ii;Nu=1;var t=Je(),e=we(),r=xn(),n=Ls(),a=Hv(),i=n("IE_PROTO"),o=Object,s=o.prototype;return Ii=a?o.getPrototypeOf:function(u){var l=r(u);if(t(l,i))return l[i];var c=l.constructor;return e(c)&&l instanceof c?c.prototype:l instanceof o?s:null},Ii}var Pi,ju;function Fh(){if(ju)return Pi;ju=1;var t=Ae(),e=we(),r=Ze(),n=Xr(),a=xs(),i=Xe(),o=Ue(),s=ut(),u=o("iterator"),l=!1,c,f,h;[].keys&&(h=[].keys(),"next"in h?(f=a(a(h)),f!==Object.prototype&&(c=f)):l=!0);var d=!r(c)||t(function(){var p={};return c[u].call(p)!==p});return d?c={}:s&&(c=n(c)),e(c[u])||i(c,u,function(){return this}),Pi={IteratorPrototype:c,BUGGY_SAFARI_ITERATORS:l},Pi}var Ei,Du;function kr(){if(Du)return Ei;Du=1;var t=wt().f,e=Je(),r=Ue(),n=r("toStringTag");return Ei=function(a,i,o){a&&!o&&(a=a.prototype),a&&!e(a,n)&&t(a,n,{configurable:!0,value:i})},Ei}var ki,Mu;function Kh(){if(Mu)return ki;Mu=1;var t=Fh().IteratorPrototype,e=Xr(),r=Qt(),n=kr(),a=Qr(),i=function(){return this};return ki=function(o,s,u,l){var c=s+" Iterator";return o.prototype=e(t,{next:r(+!l,u)}),n(o,c,!1,!0),a[c]=i,o},ki}var Ti,Fu;function Gv(){if(Fu)return Ti;Fu=1;var t=ve(),e=at();return Ti=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},Ti}var _i,Ku;function Wv(){if(Ku)return _i;Ku=1;var t=Ze();return _i=function(e){return t(e)||e===null},_i}var Ri,zu;function Vv(){if(zu)return Ri;zu=1;var t=Wv(),e=String,r=TypeError;return Ri=function(n){if(t(n))return n;throw new r("Can't set "+e(n)+" as a prototype")},Ri}var Oi,Bu;function Ns(){if(Bu)return Oi;Bu=1;var t=Gv(),e=Ze(),r=qn(),n=Vv();return Oi=Object.setPrototypeOf||("__proto__"in{}?(function(){var a=!1,i={},o;try{o=t(Object.prototype,"__proto__","set"),o(i,[]),a=i instanceof Array}catch{}return function(u,l){return r(u),n(l),e(u)&&(a?o(u,l):u.__proto__=l),u}})():void 0),Oi}var Ci,Hu;function zh(){if(Hu)return Ci;Hu=1;var t=Ie(),e=xe(),r=ut(),n=xh(),a=we(),i=Kh(),o=xs(),s=Ns(),u=kr(),l=er(),c=Xe(),f=Ue(),h=Qr(),d=Fh(),p=n.PROPER,v=n.CONFIGURABLE,g=d.IteratorPrototype,P=d.BUGGY_SAFARI_ITERATORS,w=f("iterator"),y="keys",m="values",b="entries",R=function(){return this};return Ci=function(A,x,z,V,te,L,M){i(z,x,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in q)return q[J];switch(J){case y:return function(){return new z(this,J)};case m:return function(){return new z(this,J)};case b:return function(){return new z(this,J)}}return function(){return new z(this)}},S=x+" Iterator",O=!1,q=A.prototype,F=q[w]||q["@@iterator"]||te&&q[te],I=!P&&F||N(te),T=x==="Array"&&q.entries||F,j,B,Y;if(T&&(j=o(T.call(new A)),j!==Object.prototype&&j.next&&(!r&&o(j)!==g&&(s?s(j,g):a(j[w])||c(j,w,R)),u(j,S,!0,!0),r&&(h[S]=R))),p&&te===m&&F&&F.name!==m&&(!r&&v?l(q,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(B={values:N(m),keys:L?I:N(y),entries:N(b)},M)for(Y in B)(P||O||!(Y in q))&&c(q,Y,B[Y]);else t({target:x,proto:!0,forced:P||O},B);return(!r||M)&&q[w]!==I&&c(q,w,I,{name:te}),h[x]=I,B},Ci}var Ai,Gu;function js(){return Gu||(Gu=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,Wu;function Ds(){if(Wu)return Ui;Wu=1;var t=Zr(),e=Fv(),r=Qr(),n=Er(),a=wt().f,i=zh(),o=js(),s=ut(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ui=i(Array,"Array",function(d,p){c(this,{type:l,target:t(d),index:0,kind:p})},function(){var d=f(this),p=d.target,v=d.index++;if(!p||v>=p.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(v,!1);case"values":return o(p[v],!1)}return o([v,p[v]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ui}var Vu={},Ju;function Jv(){if(Ju)return Vu;Ju=1;var t=Ie(),e=ve(),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 c=[],f=arguments.length,h=0,d;f>h;){if(d=+arguments[h++],r(d,1114111)!==d)throw new n(d+" is not a valid code point");c[h]=d<65536?a(d):a(((d-=65536)>>10)+55296,d%1024+56320)}return o(c,"")}}),Vu}var $i,Zu;function Bh(){if(Zu)return $i;Zu=1;var t=me(),e=$e(),r=Object.getOwnPropertyDescriptor;return $i=function(n){if(!e)return t[n];var a=r(t,n);return a&&a.value},$i}var Li,Yu;function Mn(){if(Yu)return Li;Yu=1;var t=Ae(),e=Ue(),r=$e(),n=ut(),a=e("iterator");return Li=!t(function(){var i=new URL("b?a=1&b=2&c=3","https://a"),o=i.searchParams,s=new URLSearchParams("a=1&a=2&b=3"),u="";return i.pathname="c%20d",o.forEach(function(l,c){o.delete("b"),u+=c+l}),s.delete("a",2),s.delete("b",void 0),n&&(!i.toJSON||!s.has("a",1)||s.has("a",2)||!s.has("a",void 0)||s.has("b"))||!o.size&&(n||!r)||!o.sort||i.href!=="https://a/c%20d?a=1&c=3"||o.get("c")!=="3"||String(new URLSearchParams("?a=1"))!=="a=1"||!o[a]||new URL("https://a@b").username!=="a"||new URLSearchParams(new URLSearchParams("a=b")).get("a")!=="b"||new URL("https://тест").host!=="xn--e1aybc"||new URL("https://a#б").hash!=="#%D0%B1"||u!=="a1c3"||new URL("https://x",void 0).host!=="x"}),Li}var qi,Xu;function Fn(){if(Xu)return qi;Xu=1;var t=Nh(),e=wt();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 xi,Qu;function Zv(){if(Qu)return xi;Qu=1;var t=Xe();return xi=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},xi}var Ni,el;function Ms(){if(el)return Ni;el=1;var t=jn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var ji,tl;function Yv(){if(tl)return ji;tl=1;var t=$n(),e=ve();return ji=function(r){if(t(r)==="Function")return e(r)},ji}var Di,rl;function Tr(){if(rl)return Di;rl=1;var t=Yv(),e=at(),r=Un(),n=t(t.bind);return Di=function(a,i){return e(a),i===void 0?a:r?n(a,i):function(){return a.apply(i,arguments)}},Di}var Mi,nl;function Fs(){if(nl)return Mi;nl=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,al;function en(){if(al)return Fi;al=1;var t=Fs(),e=we(),r=$n(),n=Ue(),a=n("toStringTag"),i=Object,o=r((function(){return arguments})())==="Arguments",s=function(u,l){try{return u[l]}catch{}};return Fi=t?r:function(u){var l,c,f;return u===void 0?"Undefined":u===null?"Null":typeof(c=s(l=i(u),a))=="string"?c:o?r(l):(f=r(l))==="Object"&&e(l.callee)?"Arguments":f},Fi}var Ki,il;function bt(){if(il)return Ki;il=1;var t=en(),e=String;return Ki=function(r){if(t(r)==="Symbol")throw new TypeError("Cannot convert a Symbol value to a string");return e(r)},Ki}var zi,ol;function Kn(){if(ol)return zi;ol=1;var t=en(),e=Os(),r=Ln(),n=Qr(),a=Ue(),i=a("iterator");return zi=function(o){if(!r(o))return e(o,i)||e(o,"@@iterator")||n[t(o)]},zi}var Bi,sl;function Ks(){if(sl)return Bi;sl=1;var t=xe(),e=at(),r=nt(),n=Dn(),a=Kn(),i=TypeError;return Bi=function(o,s){var u=arguments.length<2?a(o):s;if(e(u))return r(t(u,o));throw new i(n(o)+" is not iterable")},Bi}var Hi,cl;function tr(){if(cl)return Hi;cl=1;var t=TypeError;return Hi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Hi}var Gi,ul;function zn(){if(ul)return Gi;ul=1;var t=ve();return Gi=t([].slice),Gi}var Wi,ll;function Xv(){if(ll)return Wi;ll=1;var t=zn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,p=0,v=0;p<h||v<d;)n[p+v]=p<h&&v<d?a(c[p],f[v])<=0?c[p++]:f[v++]:p<h?c[p++]:f[v++];return n};return Wi=r,Wi}var Vi,fl;function Hh(){if(fl)return Vi;fl=1,Ds(),Jv();var t=Ie(),e=me(),r=Bh(),n=Ye(),a=xe(),i=ve(),o=$e(),s=Mn(),u=Xe(),l=Fn(),c=Zv(),f=kr(),h=Kh(),d=Er(),p=Ms(),v=we(),g=Je(),P=Tr(),w=en(),y=nt(),m=Ze(),b=bt(),R=Xr(),A=Qt(),x=Ks(),z=Kn(),V=js(),te=tr(),L=Ue(),M=Xv(),N=L("iterator"),S="URLSearchParams",O=S+"Iterator",q=d.set,F=d.getterFor(S),I=d.getterFor(O),T=r("fetch"),j=r("Request"),B=r("Headers"),Y=j&&j.prototype,J=B&&B.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ue=String.fromCharCode,ae=n("String","fromCodePoint"),ke=parseInt,Ne=i("".charAt),De=i([].join),Le=i([].push),Qe=i("".replace),It=i([].shift),Pt=i([].splice),At=i("".split),Ut=i("".slice),Ar=i(/./.exec),rr=/\+/g,$t="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ut(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},Lt=function(D){for(var G=0,W=128;W>0&&(D&W)!==0;W>>=1)G++;return G},K=function(D){var G=null;switch(D.length){case 1:G=D[0];break;case 2:G=(D[0]&31)<<6|D[1]&63;break;case 3:G=(D[0]&15)<<12|(D[1]&63)<<6|D[2]&63;break;case 4:G=(D[0]&7)<<18|(D[1]&63)<<12|(D[2]&63)<<6|D[3]&63;break}return G>1114111?null:G},X=function(D){D=Qe(D,rr," ");for(var G=D.length,W="",Z=0;Z<G;){var ie=Ne(D,Z);if(ie==="%"){if(Ne(D,Z+1)==="%"||Z+3>G){W+="%",Z++;continue}var ce=et(D,Z+1);if(ce!==ce){W+=ie,Z++;continue}Z+=2;var he=Lt(ce);if(he===0)ie=ue(ce);else{if(he===1||he>4){W+=$t,Z++;continue}for(var pe=[ce],be=1;be<he&&(Z++,!(Z+3>G||Ne(D,Z)!=="%"));){var qe=et(D,Z+1);if(qe!==qe){Z+=3;break}if(qe>191||qe<128)break;Le(pe,qe),Z+=2,be++}if(pe.length!==he){W+=$t;continue}var it=K(pe);it===null?W+=$t:ie=ae(it)}}W+=ie,Z++}return W},se=/[!'()~]|%20/g,le={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return le[D]},Be=function(D){return Qe(ne(D),se,de)},Te=h(function(G,W){q(this,{type:O,target:F(G).entries,index:0,kind:W})},S,function(){var G=I(this),W=G.target,Z=G.index++;if(!W||Z>=W.length)return G.target=null,V(void 0,!0);var ie=W[Z];switch(G.kind){case"keys":return V(ie.key,!1);case"values":return V(ie.value,!1)}return V([ie.key,ie.value],!1)},!0),Me=function(D){this.entries=[],this.url=null,D!==void 0&&(m(D)?this.parseObject(D):this.parseQuery(typeof D=="string"?Ne(D,0)==="?"?Ut(D,1):D:b(D)))};Me.prototype={type:S,bindURL:function(D){this.url=D,this.update()},parseObject:function(D){var G=this.entries,W=z(D),Z,ie,ce,he,pe,be,qe;if(W)for(Z=x(D,W),ie=Z.next;!(ce=a(ie,Z)).done;){if(he=x(y(ce.value)),pe=he.next,(be=a(pe,he)).done||(qe=a(pe,he)).done||!a(pe,he).done)throw new fe("Expected sequence with length 2");Le(G,{key:b(be.value),value:b(qe.value)})}else for(var it in D)g(D,it)&&Le(G,{key:it,value:b(D[it])})},parseQuery:function(D){if(D)for(var G=this.entries,W=At(D,"&"),Z=0,ie,ce;Z<W.length;)ie=W[Z++],ie.length&&(ce=At(ie,"="),Le(G,{key:X(It(ce)),value:X(De(ce,"="))}))},serialize:function(){for(var D=this.entries,G=[],W=0,Z;W<D.length;)Z=D[W++],Le(G,Be(Z.key)+"="+Be(Z.value));return De(G,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var _e=function(){p(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=q(this,new Me(G));o||(this.size=W.entries.length)},Ge=_e.prototype;if(c(Ge,{append:function(G,W){var Z=F(this);te(arguments.length,2),Le(Z.entries,{key:b(G),value:b(W)}),o||this.length++,Z.updateURL()},delete:function(D){for(var G=F(this),W=te(arguments.length,1),Z=G.entries,ie=b(D),ce=W<2?void 0:arguments[1],he=ce===void 0?ce:b(ce),pe=0;pe<Z.length;){var be=Z[pe];if(be.key===ie&&(he===void 0||be.value===he)){if(Pt(Z,pe,1),he!==void 0)break}else pe++}o||(this.size=Z.length),G.updateURL()},get:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=0;ie<W.length;ie++)if(W[ie].key===Z)return W[ie].value;return null},getAll:function(G){var W=F(this).entries;te(arguments.length,1);for(var Z=b(G),ie=[],ce=0;ce<W.length;ce++)W[ce].key===Z&&Le(ie,W[ce].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),ce=Z<2?void 0:arguments[1],he=ce===void 0?ce:b(ce),pe=0;pe<W.length;){var be=W[pe++];if(be.key===ie&&(he===void 0||be.value===he))return!0}return!1},set:function(G,W){var Z=F(this);te(arguments.length,1);for(var ie=Z.entries,ce=!1,he=b(G),pe=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(ce?Pt(ie,be--,1):(ce=!0,qe.value=pe));ce||Le(ie,{key:he,value:pe}),o||(this.size=ie.length),Z.updateURL()},sort:function(){var G=F(this);M(G.entries,function(W,Z){return W.key>Z.key?1:-1}),G.updateURL()},forEach:function(G){for(var W=F(this).entries,Z=P(G,arguments.length>1?arguments[1]:void 0),ie=0,ce;ie<W.length;)ce=W[ie++],Z(ce.value,ce.key,this)},keys:function(){return new Te(this,"keys")},values:function(){return new Te(this,"values")},entries:function(){return new Te(this,"entries")}},{enumerable:!0}),u(Ge,N,Ge.entries,{name:"entries"}),u(Ge,"toString",function(){return F(this).serialize()},{enumerable:!0}),o&&l(Ge,"size",{get:function(){return F(this).entries.length},configurable:!0,enumerable:!0}),f(_e,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:_e}),!s&&v(B)){var nr=i(J.has),Ur=i(J.set),ar=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new B(D.headers):new B,nr(W,"content-type")||Ur(W,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),R(D,{body:A(0,b(G)),headers:A(0,W)})}return D};if(v(T)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return T(G,arguments.length>1?ar(arguments[1]):{})}}),v(j)){var ir=function(G){return p(this,Y),new j(G,arguments.length>1?ar(arguments[1]):{})};Y.constructor=ir,ir.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:ir})}}return Vi={URLSearchParams:_e,getState:F},Vi}var dl;function Qv(){return dl||(dl=1,Hh()),yc}var hl={},pl;function em(){if(pl)return hl;pl=1;var t=Xe(),e=ve(),r=bt(),n=tr(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var p=[];u(this,function(R,A){l(p,{key:A,value:R})}),n(h,1);for(var v=r(f),g=r(d),P=0,w=0,y=!1,m=p.length,b;P<m;)b=p[P++],y||b.key===v?(y=!0,s(this,b.key)):w++;for(;w<m;)b=p[w++],b.key===v&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),hl}var vl={},ml;function tm(){if(ml)return vl;ml=1;var t=Xe(),e=ve(),r=bt(),n=tr(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var p=r(h),v=0;v<d.length;)if(d[v++]===p)return!0;return!1},{enumerable:!0,unsafe:!0}),vl}var gl={},yl;function rm(){if(yl)return gl;yl=1;var t=$e(),e=ve(),r=Fn(),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 Ji,wl;function Bn(){if(wl)return Ji;wl=1;var t=me();return Ji=t,Ji}var Zi,bl;function Gh(){if(bl)return Zi;bl=1,Qv(),em(),tm(),rm();var t=Bn();return Zi=t.URLSearchParams,Zi}var Sl={},Il={},Pl={},Yi,El;function Wh(){if(El)return Yi;El=1;var t=ve(),e=Cs(),r=bt(),n=qn(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,p,v;return h<0||h>=d?u?"":void 0:(p=i(f,h),p<55296||p>56319||h+1===d||(v=i(f,h+1))<56320||v>57343?u?a(f,h):p:u?o(f,h,h+2):(p-55296<<10)+(v-56320)+65536)}};return Yi={codeAt:s(!1),charAt:s(!0)},Yi}var kl;function Vh(){if(kl)return Pl;kl=1;var t=Wh().charAt,e=bt(),r=Er(),n=zh(),a=js(),i="String Iterator",o=r.set,s=r.getterFor(i);return n(String,"String",function(u){o(this,{type:i,string:e(u),index:0})},function(){var l=s(this),c=l.string,f=l.index,h;return f>=c.length?a(void 0,!0):(h=t(c,f),l.index+=h.length,a(h,!1))}),Pl}var Xi,Tl;function nm(){if(Tl)return Xi;Tl=1;var t=$e(),e=ve(),r=xe(),n=Ae(),a=Uh(),i=jh(),o=Lh(),s=xn(),u=bh(),l=Object.assign,c=Object.defineProperty,f=e([].concat);return Xi=!l||n(function(){if(t&&l({b:1},l(c({},"a",{enumerable:!0,get:function(){c(this,"b",{value:3,enumerable:!1})}}),{b:2})).b!==1)return!0;var h={},d={},p=Symbol("assign detection"),v="abcdefghijklmnopqrst";return h[p]=7,v.split("").forEach(function(g){d[g]=g}),l({},h)[p]!==7||a(l({},d)).join("")!==v})?function(d,p){for(var v=s(d),g=arguments.length,P=1,w=i.f,y=o.f;g>P;)for(var m=u(arguments[P++]),b=w?f(a(m),w(m)):a(m),R=b.length,A=0,x;R>A;)x=b[A++],(!t||r(y,m,x))&&(v[x]=m[x]);return v}:l,Xi}var Qi,_l;function Jh(){if(_l)return Qi;_l=1;var t=xe(),e=nt(),r=Os();return Qi=function(n,a,i){var o,s;e(n);try{if(o=r(n,"return"),!o){if(a==="throw")throw i;return i}o=t(o,n)}catch(u){s=!0,o=u}if(a==="throw")throw i;if(s)throw o;return e(o),i},Qi}var eo,Rl;function am(){if(Rl)return eo;Rl=1;var t=nt(),e=Jh();return eo=function(r,n,a,i){try{return i?n(t(a)[0],a[1]):n(a)}catch(o){e(r,"throw",o)}},eo}var to,Ol;function Zh(){if(Ol)return to;Ol=1;var t=Ue(),e=Qr(),r=t("iterator"),n=Array.prototype;return to=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},to}var ro,Cl;function Yh(){if(Cl)return ro;Cl=1;var t=ve(),e=Ae(),r=we(),n=en(),a=Ye(),i=qs(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(p){if(!r(p))return!1;try{return s(o,[],p),!0}catch{return!1}},h=function(p){if(!r(p))return!1;switch(n(p)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(p))}catch{return!0}};return h.sham=!0,ro=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,ro}var no,Al;function im(){if(Al)return no;Al=1;var t=$e(),e=wt(),r=Qt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Ul;function om(){if(Ul)return ao;Ul=1;var t=Tr(),e=xe(),r=xn(),n=am(),a=Zh(),i=Yh(),o=As(),s=im(),u=Ks(),l=Kn(),c=Array;return ao=function(h){var d=r(h),p=i(this),v=arguments.length,g=v>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,v>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,x,z;if(w&&!(this===c&&a(w)))for(b=p?new this:[],A=u(d,w),x=A.next;!(R=e(x,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=p?new this(m):c(m);m>y;y++)z=P?g(d[y],y):d[y],s(b,y,z);return b.length=y,b},ao}var io,$l;function sm(){if($l)return io;$l=1;var t=ve(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,p=RangeError,v=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),x=function(L){for(var M=[],N=0,S=L.length;N<S;){var O=w(L,N++);if(O>=55296&&O<=56319&&N<S){var q=w(L,N++);(q&64512)===56320?m(M,((O&1023)<<10)+(q&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function(L){return L+22+75*(L<26)},V=function(L,M,N){var S=0;for(L=N?g(L/o):L>>1,L+=g(L/M);L>d*a>>1;)L=g(L/d),S+=r;return g(S+(d+1)*L/(L+i))},te=function(L){var M=[];L=x(L);var N=L.length,S=u,O=0,q=s,F,I;for(F=0;F<L.length;F++)I=L[F],I<128&&m(M,P(I));var T=M.length,j=T;for(T&&m(M,l);j<N;){var B=e;for(F=0;F<L.length;F++)I=L[F],I>=S&&I<B&&(B=I);var Y=j+1;if(B-S>g((e-O)/Y))throw new p(h);for(O+=(B-S)*Y,S=B,F=0;F<L.length;F++){if(I=L[F],I<S&&++O>e)throw new p(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=q?n:fe>=q+a?a:fe-q;if(J<ne)break;var ue=J-ne,ae=r-ne;m(M,P(z(ne+ue%ae))),J=g(ue/ae),fe+=r}m(M,P(z(J))),q=V(O,Y,j===T),O=0,j++}}O++,S++}return y(M,"")};return io=function(L){var M=[],N=R(b(A(L),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,v(c,O)?"xn--"+te(O):O);return y(M,".")},io}var Ll;function cm(){if(Ll)return Il;Ll=1,Vh();var t=Ie(),e=$e(),r=Mn(),n=me(),a=Tr(),i=ve(),o=Xe(),s=Fn(),u=Ms(),l=Je(),c=nm(),f=om(),h=zn(),d=Wh().codeAt,p=sm(),v=bt(),g=kr(),P=tr(),w=Hh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,x=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,L=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),q=i([].pop),F=i([].push),I=i("".replace),T=i([].shift),j=i("".split),B=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ue="Invalid host",ae="Invalid port",ke=/[a-z]/i,Ne=/[\d+-.a-z]/i,De=/\d/,Le=/^0x/i,Qe=/^[0-7]+$/,It=/^\d+$/,Pt=/^[\da-f]+$/i,At=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ut=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,rr=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,$t=/[\t\n\r]/g,ge,et=function(k){var $=j(k,"."),_,E,C,re,H,ye,Se;if($.length&&$[$.length-1]===""&&$.length--,_=$.length,_>4)return k;for(E=[],C=0;C<_;C++){if(re=$[C],re==="")return k;if(H=10,re.length>1&&M(re,0)==="0"&&(H=N(Le,re)?16:8,re=B(re,H===8?1:2)),re==="")ye=0;else{if(!N(H===10?It:H===8?Qe:Pt,re))return k;ye=V(re,H)}F(E,ye)}for(C=0;C<_;C++)if(ye=E[C],C===_-1){if(ye>=L(256,5-_))return null}else if(ye>255)return null;for(Se=q(E),C=0;C<E.length;C++)Se+=E[C]*L(256,3-C);return Se},Lt=function(k){var $=[0,0,0,0,0,0,0,0],_=0,E=null,C=0,re,H,ye,Se,Re,Ve,U,Pe=function(){return M(k,C)};if(Pe()===":"){if(M(k,1)!==":")return;C+=2,_++,E=_}for(;Pe();){if(_===8)return;if(Pe()===":"){if(E!==null)return;C++,_++,E=_;continue}for(re=H=0;H<4&&N(Pt,Pe());)re=re*16+V(Pe(),16),C++,H++;if(Pe()==="."){if(H===0||(C-=H,_>6))return;for(ye=0;Pe();){if(Se=null,ye>0)if(Pe()==="."&&ye<4)C++;else return;if(!N(De,Pe()))return;for(;N(De,Pe());){if(Re=V(Pe(),10),Se===null)Se=Re;else{if(Se===0)return;Se=Se*10+Re}if(Se>255)return;C++}$[_]=$[_]*256+Se,ye++,(ye===2||ye===4)&&_++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;$[_++]=re}if(E!==null)for(Ve=_-E,_=7;_!==0&&Ve>0;)U=$[_],$[_--]=$[E+Ve-1],$[E+--Ve]=U;else if(_!==8)return;return $},K=function(k){for(var $=null,_=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>_&&($=E,_=C),E=null,C=0):(E===null&&(E=re),++C);return C>_?E:$},X=function(k){var $,_,E,C;if(typeof k=="number"){for($=[],_=0;_<4;_++)J($,k%256),k=te(k/256);return S($,".")}if(typeof k=="object"){for($="",E=K(k),_=0;_<8;_++)C&&k[_]===0||(C&&(C=!1),E===_?($+=_?":":"::",C=!0):($+=O(k[_],16),_<7&&($+=":")));return"["+$+"]"}return k},se={},le=c({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},le,{"#":1,"?":1,"{":1,"}":1}),Be=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Te=function(k,$){var _=d(k,0);return _>32&&_<127&&!l($,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},_e=function(k,$){var _;return k.length===2&&N(ke,M(k,0))&&((_=M(k,1))===":"||!$&&_==="|")},Ge=function(k){var $;return k.length>1&&_e(B(k,0,2))&&(k.length===2||($=M(k,2))==="/"||$==="\\"||$==="?"||$==="#")},nr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},ar={},ir={},D={},G={},W={},Z={},ie={},ce={},he={},pe={},be={},qe={},it={},ea={},fc={},ta={},or={},ot={},dc={},qt={},lt={},ra=function(k,$,_){var E=v(k),C,re,H;if($){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(_!==void 0&&(C=new ra(_,!0)),re=this.parse(E,null,C),re)throw new z(re);H=A(new R),H.bindURL(this),this.searchParams=H}};ra.prototype={type:"URL",parse:function(k,$,_){var E=this,C=$||ar,re=0,H="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=v(k),$||(E.scheme="",E.username="",E.password="",E.host=null,E.port=null,E.path=[],E.query=null,E.fragment=null,E.cannotBeABaseURL=!1,k=I(k,Ar,""),k=I(k,rr,"$1")),k=I(k,$t,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case ar:if(U&&N(ke,U))H+=Y(U),C=ir;else{if($)return ne;C=D;continue}break;case ir:if(U&&(N(Ne,U)||U==="+"||U==="-"||U==="."))H+=Y(U);else if(U===":"){if($&&(E.isSpecial()!==l(Me,H)||H==="file"&&(E.includesCredentials()||E.port!==null)||E.scheme==="file"&&!E.host))return;if(E.scheme=H,$){E.isSpecial()&&Me[E.scheme]===E.port&&(E.port=null);return}H="",E.scheme==="file"?C=ea:E.isSpecial()&&_&&_.scheme===E.scheme?C=G:E.isSpecial()?C=ce:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=dc)}else{if($)return ne;H="",C=D,re=0;continue}break;case D:if(!_||_.cannotBeABaseURL&&U!=="#")return ne;if(_.cannotBeABaseURL&&U==="#"){E.scheme=_.scheme,E.path=h(_.path),E.query=_.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=_.scheme==="file"?ea:Z;continue;case G:if(U==="/"&&Ve[re+1]==="/")C=he,re++;else{C=Z;continue}break;case W:if(U==="/"){C=pe;break}else{C=ot;continue}case Z:if(E.scheme=_.scheme,U===ge)E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query=_.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query="",C=qt;else if(U==="#")E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.query=_.query,E.fragment="",C=lt;else{E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,E.path=h(_.path),E.path.length--,C=ot;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=pe;else{E.username=_.username,E.password=_.password,E.host=_.host,E.port=_.port,C=ot;continue}break;case ce:if(C=he,U!=="/"||M(H,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=pe;continue}break;case pe:if(U==="@"){ye&&(H="%40"+H),ye=!0,Pe=f(H);for(var na=0;na<Pe.length;na++){var vc=Pe[na];if(vc===":"&&!Re){Re=!0;continue}var mc=Te(vc,Be);Re?E.password+=mc:E.username+=mc}H=""}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(ye&&H==="")return fe;re-=f(H).length+1,H="",C=be}else H+=U;break;case be:case qe:if($&&E.scheme==="file"){C=ta;continue}else if(U===":"&&!Se){if(H==="")return ue;if(ft=E.parseHost(H),ft)return ft;if(H="",C=it,$===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&H==="")return ue;if($&&H===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(H),ft)return ft;if(H="",C=or,$)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),H+=U;break;case it:if(N(De,U))H+=U;else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()||$){if(H!==""){var aa=V(H,10);if(aa>65535)return ae;E.port=E.isSpecial()&&aa===Me[E.scheme]?null:aa,H=""}if($)return;C=or;continue}else return ae;break;case ea:if(E.scheme="file",U==="/"||U==="\\")C=fc;else if(_&&_.scheme==="file")switch(U){case ge:E.host=_.host,E.path=h(_.path),E.query=_.query;break;case"?":E.host=_.host,E.path=h(_.path),E.query="",C=qt;break;case"#":E.host=_.host,E.path=h(_.path),E.query=_.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=_.host,E.path=h(_.path),E.shortenPath()),C=ot;continue}else{C=ot;continue}break;case fc:if(U==="/"||U==="\\"){C=ta;break}_&&_.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(_e(_.path[0],!0)?F(E.path,_.path[0]):E.host=_.host),C=ot;continue;case ta:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&_e(H))C=ot;else if(H===""){if(E.host="",$)return;C=or}else{if(ft=E.parseHost(H),ft)return ft;if(E.host==="localhost"&&(E.host=""),$)return;H="",C=or}continue}else H+=U;break;case or:if(E.isSpecial()){if(C=ot,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")E.query="",C=qt;else if(!$&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=ot,U!=="/"))continue;break;case ot:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!$&&(U==="?"||U==="#")){if(Ur(H)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):nr(H)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&_e(H)&&(E.host&&(E.host=""),H=M(H,0)+":"),F(E.path,H)),H="",E.scheme==="file"&&(U===ge||U==="?"||U==="#"))for(;E.path.length>1&&E.path[0]==="";)T(E.path);U==="?"?(E.query="",C=qt):U==="#"&&(E.fragment="",C=lt)}else H+=Te(U,de);break;case dc:U==="?"?(E.query="",C=qt):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=Te(U,se));break;case qt:!$&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=Te(U,se));break;case lt:U!==ge&&(E.fragment+=Te(U,le));break}re++}},parseHost:function(k){var $,_,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||($=Lt(B(k,1,-1)),!$))return ue;this.host=$}else if(this.isSpecial()){if(k=p(k),N(At,k)||($=et(k),$===null))return ue;this.host=$}else{if(N(Ut,k))return ue;for($="",_=f(k),E=0;E<_.length;E++)$+=Te(_[E],se);this.host=$}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||this.scheme==="file"},includesCredentials:function(){return this.username!==""||this.password!==""},isSpecial:function(){return l(Me,this.scheme)},shortenPath:function(){var k=this.path,$=k.length;$&&(this.scheme!=="file"||$!==1||!_e(k[0],!0))&&k.length--},serialize:function(){var k=this,$=k.scheme,_=k.username,E=k.password,C=k.host,re=k.port,H=k.path,ye=k.query,Se=k.fragment,Re=$+":";return C!==null?(Re+="//",k.includesCredentials()&&(Re+=_+(E?":"+E:"")+"@"),Re+=X(C),re!==null&&(Re+=":"+re)):$==="file"&&(Re+="//"),Re+=k.cannotBeABaseURL?H[0]:H.length?"/"+S(H,"/"):"",ye!==null&&(Re+="?"+ye),Se!==null&&(Re+="#"+Se),Re},setHref:function(k){var $=this.parse(k);if($)throw new z($);this.searchParams.update()},getOrigin:function(){var k=this.scheme,$=this.port;if(k==="blob")try{return new sr(k.path[0]).origin}catch{return"null"}return k==="file"||!this.isSpecial()?"null":k+"://"+X(this.host)+($!==null?":"+$:"")},getProtocol:function(){return this.scheme+":"},setProtocol:function(k){this.parse(v(k)+":",ar)},getUsername:function(){return this.username},setUsername:function(k){var $=f(v(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var _=0;_<$.length;_++)this.username+=Te($[_],Be)}},getPassword:function(){return this.password},setPassword:function(k){var $=f(v(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var _=0;_<$.length;_++)this.password+=Te($[_],Be)}},getHost:function(){var k=this.host,$=this.port;return k===null?"":$===null?X(k):X(k)+":"+$},setHost:function(k){this.cannotBeABaseURL||this.parse(k,be)},getHostname:function(){var k=this.host;return k===null?"":X(k)},setHostname:function(k){this.cannotBeABaseURL||this.parse(k,qe)},getPort:function(){var k=this.port;return k===null?"":v(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=v(k),k===""?this.port=null:this.parse(k,it))},getPathname:function(){var k=this.path;return this.cannotBeABaseURL?k[0]:k.length?"/"+S(k,"/"):""},setPathname:function(k){this.cannotBeABaseURL||(this.path=[],this.parse(k,or))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=v(k),k===""?this.query=null:(M(k,0)==="?"&&(k=B(k,1)),this.query="",this.parse(k,qt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=v(k),k===""){this.fragment=null;return}M(k,0)==="#"&&(k=B(k,1)),this.fragment="",this.parse(k,lt)},update:function(){this.query=this.searchParams.serialize()||null}};var sr=function($){var _=u(this,je),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(_,new ra($,!1,E));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())},je=sr.prototype,We=function(k,$){return{get:function(){return b(this)[k]()},set:$&&function(_){return b(this)[$](_)},configurable:!0,enumerable:!0}};if(e&&(s(je,"href",We("serialize","setHref")),s(je,"origin",We("getOrigin")),s(je,"protocol",We("getProtocol","setProtocol")),s(je,"username",We("getUsername","setUsername")),s(je,"password",We("getPassword","setPassword")),s(je,"host",We("getHost","setHost")),s(je,"hostname",We("getHostname","setHostname")),s(je,"port",We("getPort","setPort")),s(je,"pathname",We("getPathname","setPathname")),s(je,"search",We("getSearch","setSearch")),s(je,"searchParams",We("getSearchParams")),s(je,"hash",We("getHash","setHash"))),o(je,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(je,"toString",function(){return b(this).serialize()},{enumerable:!0}),x){var hc=x.createObjectURL,pc=x.revokeObjectURL;hc&&o(sr,"createObjectURL",a(hc,x)),pc&&o(sr,"revokeObjectURL",a(pc,x))}return g(sr,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:sr}),Il}var ql;function um(){return ql||(ql=1,cm()),Sl}var xl={},Nl;function lm(){if(Nl)return xl;Nl=1;var t=Ie(),e=Ye(),r=Ae(),n=tr(),a=bt(),i=Mn(),o=e("URL"),s=i&&r(function(){o.canParse()}),u=r(function(){return o.canParse.length!==1});return t({target:"URL",stat:!0,forced:!s||u},{canParse:function(c){var f=n(arguments.length,1),h=a(c),d=f<2||arguments[1]===void 0?void 0:a(arguments[1]);try{return!!new o(h,d)}catch{return!1}}}),xl}var jl={},Dl;function fm(){if(Dl)return jl;Dl=1;var t=Ie(),e=Ye(),r=tr(),n=bt(),a=Mn(),i=e("URL");return t({target:"URL",stat:!0,forced:!a},{parse:function(s){var u=r(arguments.length,1),l=n(s),c=u<2||arguments[1]===void 0?void 0:n(arguments[1]);try{return new i(l,c)}catch{return null}}}),jl}var Ml={},Fl;function dm(){if(Fl)return Ml;Fl=1;var t=Ie(),e=xe();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Ml}var oo,Kl;function hm(){if(Kl)return oo;Kl=1,Gh(),um(),lm(),fm(),dm();var t=Bn();return oo=t.URL,oo}var so,zl;function pm(){if(zl)return so;zl=1;var t=hm();return so=t,so}var co,Bl;function vm(){if(Bl)return co;Bl=1;var t=pm();return co=t,co}vm();var Hl={},uo,Gl;function mm(){return Gl||(Gl=1,uo={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}),uo}var lo,Wl;function gm(){if(Wl)return lo;Wl=1;var t=Nn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return lo=r===Object.prototype?void 0:r,lo}var Vl;function Xh(){if(Vl)return Hl;Vl=1;var t=me(),e=mm(),r=gm(),n=Ds(),a=er(),i=kr(),o=Ue(),s=o("iterator"),u=n.values,l=function(f,h){if(f){if(f[s]!==u)try{a(f,s,u)}catch{f[s]=u}if(i(f,h,!0),e[h]){for(var d in n)if(f[d]!==n[d])try{a(f,d,n[d])}catch{f[d]=n[d]}}}};for(var c in e)l(t[c]&&t[c].prototype,c);return l(r,"DOMTokenList"),Hl}var fo,Jl;function ym(){if(Jl)return fo;Jl=1;var t=Gh();return Xh(),fo=t,fo}var ho,Zl;function wm(){if(Zl)return ho;Zl=1;var t=ym();return ho=t,ho}wm();var Yl={},Xl={},po,Ql;function bm(){if(Ql)return po;Ql=1;var t=Ze(),e=er();return po=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},po}var vo,ef;function Sm(){if(ef)return vo;ef=1;var t=ve(),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 mo,tf;function Im(){if(tf)return mo;tf=1;var t=Ae(),e=Qt();return mo=!t(function(){var r=new Error("a");return"stack"in r?(Object.defineProperty(r,"stack",e(1,7)),r.stack!==7):!0}),mo}var go,rf;function Pm(){if(rf)return go;rf=1;var t=er(),e=Sm(),r=Im(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,nf;function tn(){if(nf)return yo;nf=1;var t=Tr(),e=xe(),r=nt(),n=Dn(),a=Zh(),i=As(),o=jn(),s=Ks(),u=Kn(),l=Jh(),c=TypeError,f=function(d,p){this.stopped=d,this.result=p},h=f.prototype;return yo=function(d,p,v){var g=v&&v.that,P=!!(v&&v.AS_ENTRIES),w=!!(v&&v.IS_RECORD),y=!!(v&&v.IS_ITERATOR),m=!!(v&&v.INTERRUPTED),b=t(p,g),R,A,x,z,V,te,L,M=function(S){return R&&l(R,"normal"),new f(!0,S)},N=function(S){return P?(r(S),m?b(S[0],S[1],M):b(S[0],S[1])):m?b(S,M):b(S)};if(w)R=d.iterator;else if(y)R=d;else{if(A=u(d),!A)throw new c(n(d)+" is not iterable");if(a(A)){for(x=0,z=i(d);z>x;x++)if(V=N(d[x]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!(L=e(te,R)).done;){try{V=N(L.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},yo}var wo,af;function Em(){if(af)return wo;af=1;var t=bt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var of;function km(){if(of)return Xl;of=1;var t=Ie(),e=jn(),r=xs(),n=Ns(),a=Dh(),i=Xr(),o=er(),s=Qt(),u=bm(),l=Pm(),c=tn(),f=Em(),h=Ue(),d=h("toStringTag"),p=Error,v=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new p,b?r(this):P):(R=b?this:i(P),o(R,d,"Error")),m!==void 0&&o(R,"message",f(m)),l(R,g,R.stack,1),arguments.length>2&&u(R,arguments[2]);var A=[];return c(y,v,{that:A}),o(R,"errors",A),R};n?n(g,p):a(g,p,{name:!0});var P=g.prototype=i(p.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Xl}var sf;function Tm(){return sf||(sf=1,km()),Yl}var cf={},bo,uf;function _m(){if(uf)return bo;uf=1;var t=Fs(),e=en();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var lf;function Rm(){if(lf)return cf;lf=1;var t=Fs(),e=Xe(),r=_m();return t||e(Object.prototype,"toString",r,{unsafe:!0}),cf}var ff={},df={},So,hf;function Qh(){if(hf)return So;hf=1;var t=me(),e=Yr(),r=$n(),n=function(a){return e.slice(0,a.length)===a};return So=(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"})(),So}var Io,pf;function zs(){if(pf)return Io;pf=1;var t=Qh();return Io=t==="NODE",Io}var Po,vf;function Om(){if(vf)return Po;vf=1;var t=Ye(),e=Fn(),r=Ue(),n=$e(),a=r("species");return Po=function(i){var o=t(i);n&&o&&!o[a]&&e(o,a,{configurable:!0,get:function(){return this}})},Po}var Eo,mf;function Cm(){if(mf)return Eo;mf=1;var t=Yh(),e=Dn(),r=TypeError;return Eo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Eo}var ko,gf;function ep(){if(gf)return ko;gf=1;var t=nt(),e=Cm(),r=Ln(),n=Ue(),a=n("species");return ko=function(i,o){var s=t(i).constructor,u;return s===void 0||r(u=t(s)[a])?o:e(u)},ko}var To,yf;function tp(){if(yf)return To;yf=1;var t=Un(),e=Function.prototype,r=e.apply,n=e.call;return To=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),To}var _o,wf;function rp(){if(wf)return _o;wf=1;var t=Yr();return _o=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),_o}var Ro,bf;function np(){if(bf)return Ro;bf=1;var t=me(),e=tp(),r=Tr(),n=we(),a=Je(),i=Ae(),o=$h(),s=zn(),u=Nn(),l=tr(),c=rp(),f=zs(),h=t.setImmediate,d=t.clearImmediate,p=t.process,v=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,x,z;i(function(){R=t.location});var V=function(N){if(a(m,N)){var S=m[N];delete m[N],S()}},te=function(N){return function(){V(N)}},L=function(N){V(N.data)},M=function(N){t.postMessage(w(N),R.protocol+"//"+R.host)};return(!h||!d)&&(h=function(S){l(arguments.length,1);var O=n(S)?S:g(S),q=s(arguments,1);return m[++y]=function(){e(O,void 0,q)},A(y),y},d=function(S){delete m[S]},f?A=function(N){p.nextTick(te(N))}:v&&v.now?A=function(N){v.now(te(N))}:P&&!c?(x=new P,z=x.port2,x.port1.onmessage=L,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",L,!1)):b in u("script")?A=function(N){o.appendChild(u("script"))[b]=function(){o.removeChild(this),V(N)}}:A=function(N){setTimeout(te(N),0)}),Ro={set:h,clear:d},Ro}var Oo,Sf;function ap(){if(Sf)return Oo;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}}},Oo=t,Oo}var Co,If;function Am(){if(If)return Co;If=1;var t=Yr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,Pf;function Um(){if(Pf)return Ao;Pf=1;var t=Yr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,Ef;function $m(){if(Ef)return Uo;Ef=1;var t=me(),e=Bh(),r=Tr(),n=np().set,a=ap(),i=rp(),o=Am(),s=Um(),u=zs(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),p,v,g,P,w;if(!d){var y=new a,m=function(){var b,R;for(u&&(b=f.domain)&&b.exit();R=y.get();)try{R()}catch(A){throw y.head&&p(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(v=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),p=function(){g.data=v=!v}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),p=function(){w(m)}):u?p=function(){f.nextTick(m)}:(n=r(n,t),p=function(){n(m)}),d=function(b){y.head||p(),y.add(b)}}return Uo=d,Uo}var $o,kf;function Lm(){return kf||(kf=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}var Lo,Tf;function _r(){return Tf||(Tf=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var qo,_f;function Rr(){if(_f)return qo;_f=1;var t=me();return qo=t.Promise,qo}var xo,Rf;function rn(){if(Rf)return xo;Rf=1;var t=me(),e=Rr(),r=we(),n=Mh(),a=qs(),i=Ue(),o=Qh(),s=ut(),u=Ph(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var p=a(e),v=p!==String(e);if(!v&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(p)){var g=new e(function(y){y(1)}),P=function(y){y(function(){},function(){})},w=g.constructor={};if(w[c]=P,f=g.then(function(){})instanceof P,!f)return!0}return!v&&(o==="BROWSER"||o==="DENO")&&!h});return xo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},xo}var No={},Of;function St(){if(Of)return No;Of=1;var t=at(),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 Cf;function qm(){if(Cf)return df;Cf=1;var t=Ie(),e=ut(),r=zs(),n=me(),a=Bn(),i=xe(),o=Xe(),s=Ns(),u=kr(),l=Om(),c=at(),f=we(),h=Ze(),d=Ms(),p=ep(),v=np().set,g=$m(),P=Lm(),w=_r(),y=ap(),m=Er(),b=Rr(),R=rn(),A=St(),x="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,L=m.getterFor(x),M=m.set,N=b&&b.prototype,S=b,O=N,q=n.TypeError,F=n.document,I=n.process,T=A.f,j=T,B=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ue=2,ae=1,ke=2,Ne,De,Le,Qe,It=function(K){var X;return h(K)&&f(X=K.then)?X:!1},Pt=function(K,X){var se=X.value,le=X.state===ne,de=le?K.ok:K.fail,Be=K.resolve,Te=K.reject,Me=K.domain,_e,Ge,nr;try{de?(le||(X.rejection===ke&&$t(X),X.rejection=ae),de===!0?_e=se:(Me&&Me.enter(),_e=de(se),Me&&(Me.exit(),nr=!0)),_e===K.promise?Te(new q("Promise-chain cycle")):(Ge=It(_e))?i(Ge,_e,Be,Te):Be(_e)):Te(se)}catch(Ur){Me&&!nr&&Me.exit(),Te(Ur)}},At=function(K,X){K.notified||(K.notified=!0,g(function(){for(var se=K.reactions,le;le=se.get();)Pt(le,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ut=function(K,X,se){var le,de;B?(le=F.createEvent("Event"),le.promise=X,le.reason=se,le.initEvent(K,!1,!0),n.dispatchEvent(le)):le={promise:X,reason:se},!V&&(de=n["on"+K])?de(le):K===Y&&P("Unhandled promise rejection",se)},Ar=function(K){i(v,n,function(){var X=K.facade,se=K.value,le=rr(K),de;if(le&&(de=w(function(){r?I.emit("unhandledRejection",se,X):Ut(Y,X,se)}),K.rejection=r||rr(K)?ke:ae,de.error))throw de.value})},rr=function(K){return K.rejection!==ae&&!K.parent},$t=function(K){i(v,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ut(J,X,K.value)})},ge=function(K,X,se){return function(le){K(X,le,se)}},et=function(K,X,se){K.done||(K.done=!0,se&&(K=se),K.value=X,K.state=ue,At(K,!0))},Lt=function(K,X,se){if(!K.done){K.done=!0,se&&(K=se);try{if(K.facade===X)throw new q("Promise can't be resolved itself");var le=It(X);le?g(function(){var de={done:!1};try{i(le,X,ge(Lt,de,K),ge(et,de,K))}catch(Be){et(de,Be,K)}}):(K.value=X,K.state=ne,At(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var se=L(this);try{X(ge(Lt,se),ge(et,se))}catch(le){et(se,le)}},O=S.prototype,Ne=function(X){M(this,{type:x,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,se){var le=L(this),de=T(p(this,S));return le.parent=!0,de.ok=f(X)?X:!0,de.fail=f(se)&&se,de.domain=r?I.domain:void 0,le.state===fe?le.reactions.add(de):g(function(){Pt(de,le)}),de.promise}),De=function(){var K=new Ne,X=L(K);this.promise=K,this.resolve=ge(Lt,X),this.reject=ge(et,X)},A.f=T=function(K){return K===S||K===Le?new De(K):j(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,se){var le=this;return new S(function(de,Be){i(Qe,le,de,Be)}).then(X,se)},{unsafe:!0});try{delete N.constructor}catch{}s&&s(N,O)}return t({global:!0,constructor:!0,wrap:!0,forced:z},{Promise:S}),Le=a.Promise,u(S,x,!1,!0),l(x),df}var Af={},jo,Uf;function xm(){if(Uf)return jo;Uf=1;var t=Ue(),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 jo=function(i,o){try{if(!o&&!r)return!1}catch{return!1}var s=!1;try{var u={};u[e]=function(){return{next:function(){return{done:s=!0}}}},i(u)}catch{}return s},jo}var Do,$f;function Hn(){if($f)return Do;$f=1;var t=Rr(),e=xm(),r=rn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Lf;function Nm(){if(Lf)return Af;Lf=1;var t=Ie(),e=xe(),r=at(),n=St(),a=_r(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var p=r(l.resolve),v=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(p,l,w).then(function(b){m||(m=!0,v[y]=b,--P||f(v))},h)}),--P||f(v)});return d.error&&h(d.value),c.promise}}),Af}var qf={},xf;function jm(){if(xf)return qf;xf=1;var t=Ie(),e=ut(),r=rn().CONSTRUCTOR,n=Rr(),a=Ye(),i=we(),o=Xe(),s=n&&n.prototype;if(t({target:"Promise",proto:!0,forced:r,real:!0},{catch:function(l){return this.then(void 0,l)}}),!e&&i(n)){var u=a("Promise").prototype.catch;s.catch!==u&&o(s,"catch",u,{unsafe:!0})}return qf}var Nf={},jf;function Dm(){if(jf)return Nf;jf=1;var t=Ie(),e=xe(),r=at(),n=St(),a=_r(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(p){e(d,l,p).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),Nf}var Df={},Mf;function Mm(){if(Mf)return Df;Mf=1;var t=Ie(),e=St(),r=rn().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={},Mo,Kf;function ip(){if(Kf)return Mo;Kf=1;var t=nt(),e=Ze(),r=St();return Mo=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},Mo}var zf;function Fm(){if(zf)return Ff;zf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=ip(),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 Bf;function Km(){return Bf||(Bf=1,qm(),Nm(),jm(),Dm(),Mm(),Fm()),ff}var Hf={},Gf;function zm(){if(Gf)return Hf;Gf=1;var t=Ie(),e=xe(),r=at(),n=St(),a=_r(),i=tn(),o=Hn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var p=r(l.resolve),v=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(p,l,w).then(function(b){m||(m=!0,v[y]={status:"fulfilled",value:b},--P||f(v))},function(b){m||(m=!0,v[y]={status:"rejected",reason:b},--P||f(v))})}),--P||f(v)});return d.error&&h(d.value),c.promise}}),Hf}var Wf={},Vf;function Bm(){if(Vf)return Wf;Vf=1;var t=Ie(),e=xe(),r=at(),n=Ye(),a=St(),i=_r(),o=tn(),s=Hn(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),p=d.resolve,v=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,x=!1;m++,e(P,f,R).then(function(z){x||b||(b=!0,p(z))},function(z){x||b||(x=!0,w[A]=z,--m||v(new h(w,u)))})}),--m||v(new h(w,u))});return g.error&&v(g.value),d.promise}}),Wf}var Jf={},Zf;function op(){if(Zf)return Jf;Zf=1;var t=Ie(),e=me(),r=tp(),n=zn(),a=St(),i=at(),o=_r(),s=e.Promise,u=!1,l=!s||!s.try||o(function(){s.try(function(c){u=c===8},8)}).error||!u;return t({target:"Promise",stat:!0,forced:l},{try:function(c){var f=arguments.length>1?n(arguments,1):[],h=a.f(this),d=o(function(){return r(i(c),void 0,f)});return(d.error?h.reject:h.resolve)(d.value),h.promise}}),Jf}var Yf={},Xf;function sp(){if(Xf)return Yf;Xf=1;var t=Ie(),e=St();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 Hm(){if(ed)return Qf;ed=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=ep(),s=ip(),u=Xe(),l=r&&r.prototype,c=!!r&&n(function(){l.finally.call({then:function(){}},function(){})});if(t({target:"Promise",proto:!0,real:!0,forced:c},{finally:function(h){var d=o(this,a("Promise")),p=i(h);return this.then(p?function(v){return s(d,h()).then(function(){return v})}:h,p?function(v){return s(d,h()).then(function(){throw v})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Qf}var Fo,td;function Gm(){if(td)return Fo;td=1,Tm(),Ds(),Rm(),Km(),zm(),Bm(),op(),sp(),Hm(),Vh();var t=Bn();return Fo=t.Promise,Fo}var Ko,rd;function Wm(){if(rd)return Ko;rd=1;var t=Gm();return Xh(),Ko=t,Ko}var nd={},ad;function Vm(){return ad||(ad=1,op()),nd}var id={},od;function Jm(){return od||(od=1,sp()),id}var zo,sd;function Zm(){if(sd)return zo;sd=1;var t=Wm();return Vm(),Jm(),zo=t,zo}Zm();const cp="sesamy-debug";function Ym(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 Xm(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 Qm(t){Ym(cp,t.toString(),1)}function eg(){return Xm(cp)==="true"}function oe(t){eg()&&console.log(t)}function Jt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});oe(`Triggering event: ${t}`),dispatchEvent(r)}function st(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 jt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Hs(t,e){return t(e={exports:{}},e.exports),e.exports}var Nt=Hs((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()}}));Bs(Nt);var tg=Bs(Hs((function(t,e){var r=jt&&jt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(p,v){function g(y){try{w(d.next(y))}catch(m){v(m)}}function P(y){try{w(d.throw(y))}catch(m){v(m)}}function w(y){y.done?p(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=jt&&jt.__generator||function(c,f){var h,d,p,v,g={label:0,sent:function(){if(1&p[0])throw p[1];return p[1]},trys:[],ops:[]};return v={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function P(w){return function(y){return(function(m){if(h)throw new TypeError("Generator is already executing.");for(;g;)try{if(h=1,d&&(p=2&m[0]?d.return:m[0]?d.throw||((p=d.return)&&p.call(d),0):d.next)&&!(p=p.call(d,m[1])).done)return p;switch(d=0,p&&(m=[2&m[0],p.value]),m[0]){case 0:case 1:p=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(p=g.trys,!((p=p.length>0&&p[p.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!p||m[1]>p[0]&&m[1]<p[3])){g.label=m[1];break}if(m[0]===6&&g.label<p[1]){g.label=p[1],p=m;break}if(p&&g.label<p[2]){g.label=p[2],g.ops.push(m);break}p[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=p=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=jt;Object.defineProperty(e,"__esModule",{value:!0});var i="browser-tabs-lock-key",o={key:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},getItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},clear:function(){return r(a,void 0,void 0,(function(){return n(this,(function(c){return[2,window.localStorage.clear()]}))}))},removeItem:function(c){return r(a,void 0,void 0,(function(){return n(this,(function(f){throw new Error("Unsupported")}))}))},setItem:function(c,f){return r(a,void 0,void 0,(function(){return n(this,(function(h){throw new Error("Unsupported")}))}))},keySync:function(c){return window.localStorage.key(c)},getItemSync:function(c){return window.localStorage.getItem(c)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(c){return window.localStorage.removeItem(c)},setItemSync:function(c,f){return window.localStorage.setItem(c,f)}};function s(c){return new Promise((function(f){return setTimeout(f,c)}))}function u(c){for(var f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",h="",d=0;d<c;d++)h+=f[Math.floor(Math.random()*f.length)];return h}var l=(function(){function c(f){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+u(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=f,c.waiters===void 0&&(c.waiters=[])}return c.prototype.acquireLock=function(f,h){return h===void 0&&(h=5e3),r(this,void 0,void 0,(function(){var d,p,v,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),p=Date.now()+h,v=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<p?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(v)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(v,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(v))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(v,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(p)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(p){return setTimeout((function(){return r(d,void 0,void 0,(function(){var v,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,Nt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(v=this.storageHandler===void 0?o:this.storageHandler,(g=v.getItemSync(f))===null?(Nt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),v.setItemSync(f,JSON.stringify(P)),Nt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Nt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var p=!1,v=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!p){p=!0;var y=50-(Date.now()-v);y>0?setTimeout(d,y):d(null)}}window.addEventListener("storage",P),c.addToWaiting(P);var w=setTimeout(P,Math.max(0,f-Date.now()))}))];case 1:return h.sent(),[2]}}))}))},c.addToWaiting=function(f){this.removeFromWaiting(f),c.waiters!==void 0&&c.waiters.push(f)},c.removeFromWaiting=function(f){c.waiters!==void 0&&(c.waiters=c.waiters.filter((function(h){return h!==f})))},c.notifyWaiters=function(){c.waiters!==void 0&&c.waiters.slice().forEach((function(f){return f()}))},c.prototype.releaseLock=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,this.releaseLock__private__(f)];case 1:return[2,h.sent()]}}))}))},c.prototype.releaseLock__private__=function(f){return r(this,void 0,void 0,(function(){var h,d,p,v;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(p=h.getItemSync(d))===null?[2]:(v=JSON.parse(p)).id!==this.id?[3,2]:[4,Nt.default().lock(v.iat)];case 1:g.sent(),this.acquiredIatSet.delete(v.iat),h.removeItemSync(d),Nt.default().unlock(v.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,p=[],v=0;;){var g=d.keySync(v);if(g===null)break;p.push(g),v++}for(var P=!1,w=0;w<p.length;w++){var y=p[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),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const rg={timeoutInSeconds:60},up={name:"auth0-spa-js",version:"2.8.0"},lp=()=>Date.now();let Ee=class cs extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,cs.prototype)}static fromPayload({error:e,error_description:r}){return new cs(e,r)}},ng=class fp extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,fp.prototype)}},ag=class dp extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,dp.prototype)}},us=class hp extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,hp.prototype)}};class Gs extends us{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,Gs.prototype)}}let ig=class pp extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,pp.prototype)}},og=class vp extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,vp.prototype)}},mp=class gp extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${Sn(e,["default"])}', scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,gp.prototype)}},sg=class yp extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${Sn(e,["default"])}', missing scope: '${Sn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,yp.prototype)}},wp=class bp extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,bp.prototype)}};function Sn(t,e=[]){return t&&!e.includes(t)?t:""}const In=()=>window.crypto,Lr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(In().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Bo=t=>btoa(t),cg=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],ug=t=>Object.keys(t).reduce(((e,r)=>{const n=cg.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),ls=t=>{var{clientId:e}=t,r=st(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 In().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))))},lg=new TextEncoder,fg=new TextDecoder;function zr(t){return typeof t=="string"?lg.encode(t):fg.decode(t)}function fd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new hg(`${t.name} modulusLength must be at least 2048 bits`)}async function dg(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 Ft})(r),r,zr(n)))}`}let fs;Uint8Array.prototype.toBase64?fs=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):fs=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 fs(t)}let Ft=class extends Error{constructor(e){var r;super(e??"operation not supported"),this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}},hg=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 pg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Ft("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Ft("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Ft("unsupported CryptoKey algorithm name")}}function Sp(t){return t instanceof CryptoKey}function Ip(t){return Sp(t)&&t.type==="public"}async function vg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!Sp(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!Ip(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 dg({alg:pg(o),typ:"dpop+jwt",jwk:await Pp(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 Pp(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 mg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function gg(){return(async function(t,e){var r;let n;if(t.length===0)throw new TypeError('"alg" must be a non-empty string');switch(t){case"PS256":n={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":n={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":n={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":n={name:"Ed25519"};break;default:throw new Ft}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function yg(t){return(async function(e){if(!Ip(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 Pp(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Ft("unsupported JWK kty")}return Br(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function wg({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 vg(t,i,r,n,a)}const bg=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},Sg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([bg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},Ig=async(t,e,r,n,a,i,o,s)=>{return u={auth:{audience:e,scope:r},timeout:a,fetchUrl:t,fetchOptions:n,useFormData:o,useMrrt:s},l=i,new Promise((function(c,f){const h=new MessageChannel;h.port1.onmessage=function(d){d.data.error?f(new Error(d.data.error)):c(d.data),h.port1.close()},l.postMessage(u,[h.port2])}));var u,l},Pg=async(t,e,r,n,a,i,o=1e4,s)=>a?Ig(t,e,r,n,o,a,i,s):Sg(t,n,o);async function Ep(t,e,r,n,a,i,o,s,u,l){if(u){const y=await u.generateProof({url:t,method:a.method||"GET",nonce:await u.getNonce()});a.headers=Object.assign(Object.assign({},a.headers),{dpop:y})}let c,f=null;for(let y=0;y<3;y++)try{c=await Pg(t,r,n,a,i,o,e,s),f=null;break}catch(m){f=m}if(f)throw f;const h=c.json,{error:d,error_description:p}=h,v=st(h,["error","error_description"]),{headers:g,ok:P}=c;let w;if(u&&(w=g["dpop-nonce"],w&&await u.setNonce(w)),!P){const y=p||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new og(d,y,v.mfa_token);if(d==="missing_refresh_token")throw new mp(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new wp(w);return Ep(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return v}async function Eg(t,e){var{baseUrl:r,timeout:n,audience:a,scope:i,auth0Client:o,useFormData:s,useMrrt:u,dpop:l}=t,c=st(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=c.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=c.grant_type==="refresh_token"&&u,d=Object.assign(Object.assign(Object.assign(Object.assign({},c),f&&a&&{audience:a}),f&&i&&{scope:i}),h&&{audience:a,scope:i}),p=s?ls(d):JSON.stringify(d),v=(g=c.grant_type,mg.includes(g));var g;return await Ep(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:p,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(ug(o||up)))}},e,s,u,v?l:void 0)}const mn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},cn=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),mn(n,e)};let pt=class ds{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 ds({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new ds({scope:r,audience:n,clientId:a})}},kg=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@@")))}},kp=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)}})()}},Tg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||lp}async setIdToken(e,r,n){var a;const i=this.getIdTokenCacheKey(e);await this.cache.set(i,{id_token:r,decodedToken:n}),await((a=this.keyManifest)===null||a===void 0?void 0:a.add(i))}async getIdToken(e){const r=await this.cache.get(this.getIdTokenCacheKey(e.clientId));if(!r&&e.scope&&e.audience){const n=await this.get(e);return!n||!n.id_token||!n.decodedToken?void 0:{id_token:n.id_token,decodedToken:n.decodedToken}}if(r)return{id_token:r.id_token,decodedToken:r.decodedToken}}async get(e,r=0,n=!1,a){var i;let o=await this.cache.get(e.toKey());if(!o){const l=await this.getCacheKeys();if(!l)return;const c=this.matchExistingCacheKey(e,l);if(c&&(o=await this.cache.get(c)),!c&&n&&a!=="cache-only")return this.getEntryWithRefreshToken(e,l)}if(!o)return;const s=await this.nowProvider(),u=Math.floor(s/1e3);return o.expiresAt-r<u?o.body.refresh_token?this.modifiedCachedEntry(o,e):(await this.cache.remove(e.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(e.toKey()))):o.body}async modifiedCachedEntry(e,r){return e.body={refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope},await this.cache.set(r.toKey(),e),{refresh_token:e.body.refresh_token,audience:e.body.audience,scope:e.body.scope}}async set(e){var r;const n=new pt({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 pt({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 pt({clientId:e},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(e,r){return r.filter((n=>{var a;const i=pt.fromKey(n),o=new Set(i.scope&&i.scope.split(" ")),s=((a=e.scope)===null||a===void 0?void 0:a.split(" "))||[],u=i.scope&&s.reduce(((l,c)=>l&&o.has(c)),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===e.clientId&&i.audience===e.audience&&u}))[0]}async getEntryWithRefreshToken(e,r){var n;for(const a of r){const i=pt.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)}}}},_g=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 qr=t=>typeof t=="number",Rg=["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"],Og=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const e=(i=>{const o=i.split("."),[s,u,l]=o;if(o.length!==3||!s||!u||!l)throw new Error("ID token could not be decoded");const c=JSON.parse(ud(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],Rg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,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&&!qr(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||!qr(e.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!qr(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&&qr(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&&qr(e.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(e.claims.auth_time)+t.max_age+r),n>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${n}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const o=i;if(!e.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(o!==e.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_id}"`)}else{const o=i.toLowerCase();if(!e.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(o!==e.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${o}", found "${e.claims.org_name}"`)}}return e};var Kt=Hs((function(t,e){var r=jt&&jt.__assign||function(){return r=Object.assign||function(u){for(var l,c=1,f=arguments.length;c<f;c++)for(var h in l=arguments[c])Object.prototype.hasOwnProperty.call(l,h)&&(u[h]=l[h]);return u},r.apply(this,arguments)};function n(u,l){if(!l)return"";var c="; "+u;return l===!0?c:c+"="+l}function a(u,l,c){return encodeURIComponent(u).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(l).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+(function(f){if(typeof f.expires=="number"){var h=new Date;h.setMilliseconds(h.getMilliseconds()+864e5*f.expires),f.expires=h}return n("Expires",f.expires?f.expires.toUTCString():"")+n("Domain",f.domain)+n("Path",f.path)+n("Secure",f.secure)+n("SameSite",f.sameSite)})(c)}function i(u){for(var l={},c=u?u.split("; "):[],f=/(%[\dA-F]{2})+/gi,h=0;h<c.length;h++){var d=c[h].split("="),p=d.slice(1).join("=");p.charAt(0)==='"'&&(p=p.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=p.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Bs(Kt),Kt.encode,Kt.parse,Kt.getAll;var Cg=Kt.get,Tp=Kt.set,_p=Kt.remove;const fr={get(t){const e=Cg(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),Tp(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),_p(t,r)}},Ag={get(t){return fr.get(t)||fr.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),Tp(`_legacy_${t}`,JSON.stringify(e),n),fr.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),_p(t,r),fr.remove(t,e),fr.remove(`_legacy_${t}`,e)}},Ug={get(t){if(typeof sessionStorage>"u")return;const e=sessionStorage.getItem(t);return e!=null?JSON.parse(e):void 0},save(t,e){sessionStorage.setItem(t,JSON.stringify(e))},remove(t){sessionStorage.removeItem(t)}};var Dt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Dt||(Dt={}));function $g(t,e,r){var n=e===void 0?null:e,a=(function(u,l){var c=atob(u);if(l){for(var f=new Uint8Array(c.length),h=0,d=c.length;h<d;++h)f[h]=c.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return c})(t,r!==void 0&&r),i=a.indexOf(`
2
+ `,10)+1,o=a.substring(i)+(n?"//# sourceMappingURL="+n:""),s=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(s)}var dd,hd,pd,Ho,Lg=(dd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",hd=null,pd=!1,function(t){return Ho=Ho||$g(dd,hd,pd),new Worker(Ho,t)});const Go={};let qg=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 xg={memory:()=>new kp().enclosedCache,localstorage:()=>new kg},vd=t=>xg[t],md=t=>{const{openUrl:e,onRedirect:r}=t,n=st(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)))},xt={NONCE:"nonce",KEYPAIR:"keypair"};let Ng=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(xt).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(xt.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save(xt.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find(xt.NONCE,this.buildKey(e))}findKeyPair(){return this.find(xt.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(xt.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(xt.KEYPAIR,this.clientId)}},jg=class{constructor(e){this.storage=new Ng(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 gg(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return wg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return yg(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var dr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(dr||(dr={}));let Dg=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=dr.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?dr.DPoP:dr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===dr.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 wp(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)}},Mg=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 Rp 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,Rp.prototype)}};const Wo=new tg;let Fg=class{constructor(e){let r,n;if(this.userCache=new kp().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const u=Array.from(this.activeLockKeys);for(const l of u)await Wo.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(!In())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(In().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",!vd(r))throw new Error(`Invalid cache location "${r}"`);n=vd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?fr:Ag,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:Ug;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:mn(l,u,...c)};let f={default:mn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=mn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new _g(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||lp,this.cacheManager=new Tg(n,n.allKeys?void 0:new qg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new jg(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Mg(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 Lg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||up)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${ls(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return Og({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=Ho(Lr()),o=Ho(Lr()),s=Lr(),u=await cd(s),l=ld(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,p,v,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),v),{scope:cn(p,v.scope,v.audience),response_type:"code",response_mode:m||"query",state:g,nonce:P,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,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new ig(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Gs(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ee.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ee("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=st(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=st(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:jt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ee("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===jt.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 ng(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ee("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:jt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new ag(i,o||i,r.connection,a,r.appState);if(!n)throw new Ee("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ee("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:jt.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:cn(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Go[s];return u||(u=o().finally((()=>{delete Go[s],u=null})),Go[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=st(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>Wo.acquireLock(a,5e3)),10))throw new us;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await Wo.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:cn(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({},rg),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new ht({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=st(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ls(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=md(e),{openUrl:a}=n,i=st(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ee("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((v,g,P=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",R,!1))};let R;const A=setTimeout((()=>{y(new us),b()}),1e3*P);R=function(x){if(x.origin!=g||!x.data||x.data.type!=="authorization_response")return;const z=x.source;z&&z.close(),x.data.response.error?y(Ee.fromPayload(x.data.response)):w(x.data.response),clearTimeout(A),window.removeEventListener("message",R,!1),setTimeout(b,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(m),m.setAttribute("src",v)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const p=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},p),{scope:l,oauthTokenScope:p.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new ht({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 mp(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var p;if(c&&h&&d){if(f.audience!==h)return f.scope;const v=d.split(" "),g=((p=f.scope)===null||p===void 0?void 0:p.split(" "))||[],P=g.every((w=>v.includes(w)));return v.length>=g.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!gd(l,s))&&!gd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const p=h?.split(" ")||[],v=d?.split(" ")||[];return p.filter((g=>v.indexOf(g)==-1)).join(",")})(i,c.scope);throw new sg(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=st(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 ht({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 ht({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await Eg(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:cn(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 Dg(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=Ho(Lr()),u=Lr(),l=await cd(u),c=ld(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:jt.ConnectCode});const p=new URL(f);p.searchParams.set("ticket",h.ticket),r?await r(p.toString()):window.location.assign(p)}};async function Kg(t){const e=new Fg(t);return await e.checkSession(),e}var Be=(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))(Be||{});const zg="sesamy.com",Hg="sesamy.dev",Bg="https://sesa.my",wd="sesamyCacheTimestamp",bd="sesamyContentReloaded";function Op(t,e){return`${t}.${e==="dev"?Hg:zg}`}function tt(t,e){return`https://${Op(t,e)}`}function Br(){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",!vd(r))throw new Error(`Invalid cache location "${r}"`);n=vd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?fr:Ag,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(u=>`auth0.${u}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=e.sessionCheckExpiryDays||1;const a=e.useCookiesForTransactions?this.cookieStorage:Ug;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:mn(l,u,...c)};let f={default:mn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=mn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new _g(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||lp,this.cacheManager=new Tg(n,n.allKeys?void 0:new qg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new jg(this.options.clientId):void 0,this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((u,l)=>u?u.startsWith("https://")?u:`https://${u}/`:`${l}/`)(this.options.issuer,this.domainUrl);const o=`${this.domainUrl}/me/`,s=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:o},detailedResponse:!0})}));this.myAccountApi=new Mg(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 Lg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||up)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${ls(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return Og({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=Bo(Lr()),o=Bo(Lr()),s=Lr(),u=await cd(s),l=ld(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,p,v,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),v),{scope:cn(p,v.scope,v.audience),response_type:"code",response_mode:m||"query",state:g,nonce:P,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,c),h=this._authorizeUrl(f);return{nonce:o,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(e,r){var n;if(e=e||{},!(r=r||{}).popup&&(r.popup=(s=>{const u=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup",`left=${u},top=${l},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!r.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const a=await this._prepareAuthorizeUrl(e.authorizationParams||{},{response_mode:"web_message"},window.location.origin);r.popup.location.href=a.url;const i=await(s=>new Promise(((u,l)=>{let c;const f=setInterval((()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",c,!1),l(new ig(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new Gs(s.popup)),window.removeEventListener("message",c,!1)}),1e3*(s.timeoutInSeconds||60));c=function(d){if(d.data&&d.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",c,!1),s.popup.close(),d.data.response.error)return l(Ee.fromPayload(d.data.response));u(d.data.response)}},window.addEventListener("message",c)})))(Object.assign(Object.assign({},r),{timeoutInSeconds:r.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(a.state!==i.state)throw new Ee("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=st(n,["openUrl","fragment","appState"]),u=((r=s.authorizationParams)===null||r===void 0?void 0:r.organization)||this.options.authorizationParams.organization,l=await this._prepareAuthorizeUrl(s.authorizationParams||{}),{url:c}=l,f=st(l,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:o,response_type:Dt.Code}),u&&{organization:u}));const h=i?`${c}#${i}`:c;a?await a(h):window.location.assign(h)}async handleRedirectCallback(e=window.location.href){const r=e.split("?").slice(1);if(r.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new Ee("missing_transaction","Invalid state");this.transactionManager.remove();const a=(i=>{i.indexOf("#")>-1&&(i=i.substring(0,i.indexOf("#")));const o=new URLSearchParams(i);return{state:o.get("state"),code:o.get("code")||void 0,connect_code:o.get("connect_code")||void 0,error:o.get("error")||void 0,error_description:o.get("error_description")||void 0}})(r.join(""));return n.response_type===Dt.ConnectCode?this._handleConnectAccountRedirectCallback(a,n):this._handleLoginRedirectCallback(a,n)}async _handleLoginRedirectCallback(e,r){const{code:n,state:a,error:i,error_description:o}=e;if(i)throw new ng(i,o||i,a,r.appState);if(!r.code_verifier||r.state&&r.state!==a)throw new Ee("state_mismatch","Invalid state");const s=r.organization,u=r.nonce,l=r.redirect_uri;return await this._requestToken(Object.assign({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:n},l?{redirect_uri:l}:{}),{nonceIn:u,organization:s}),{appState:r.appState,response_type:Dt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new ag(i,o||i,r.connection,a,r.appState);if(!n)throw new Ee("missing_connect_code","Missing connect code");if(!(r.code_verifier&&r.state&&r.auth_session&&r.redirect_uri&&r.state===a))throw new Ee("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:r.auth_session,connect_code:n,redirect_uri:r.redirect_uri,code_verifier:r.code_verifier});return Object.assign(Object.assign({},s),{appState:r.appState,response_type:Dt.ConnectCode})}async checkSession(e){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(e)}catch{}}async getTokenSilently(e={}){var r,n;const a=Object.assign(Object.assign({cacheMode:"on"},e),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),e.authorizationParams),{scope:cn(this.scope,(r=e.authorizationParams)===null||r===void 0?void 0:r.scope,((n=e.authorizationParams)===null||n===void 0?void 0:n.audience)||this.options.authorizationParams.audience)})}),i=await((o,s)=>{let u=Go[s];return u||(u=o().finally((()=>{delete Go[s],u=null})),Go[s]=u),u})((()=>this._getTokenSilently(a)),`${this.options.clientId}::${a.authorizationParams.audience}::${a.authorizationParams.scope}`);return e.detailedResponse?i:i?.access_token}async _getTokenSilently(e){const{cacheMode:r}=e,n=st(e,["cacheMode"]);if(r!=="off"){const s=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:r});if(s)return s}if(r==="cache-only")return;const a=(i=this.options.clientId,o=n.authorizationParams.audience||"default",`auth0.lock.getTokenSilently.${i}.${o}`);var i,o;if(!await(async(s,u=3)=>{for(let l=0;l<u;l++)if(await s())return!0;return!1})((()=>Wo.acquireLock(a,5e3)),10))throw new us;this.activeLockKeys.add(a),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(r!=="off"){const d=await this._getEntryFromCache({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId});if(d)return d}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(n):await this._getTokenFromIFrame(n),{id_token:u,token_type:l,access_token:c,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:u,token_type:l,access_token:c},f?{scope:f}:null),{expires_in:h})}finally{await Wo.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:cn(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({},rg),r),await this.loginWithPopup(i,r),(await this.cacheManager.get(new pt({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=st(r,["federated"]),i=n?"&federated":"";return this._url(`/v2/logout?${ls(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=md(e),{openUrl:a}=n,i=st(n,["openUrl"]);e.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(e.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@"),await((r=this.dpop)===null||r===void 0?void 0:r.clear());const o=this._buildLogoutUrl(i);a?await a(o):a!==!1&&window.location.assign(o)}async _getTokenFromIFrame(e){const r=Object.assign(Object.assign({},e.authorizationParams),{prompt:"none"}),n=this.cookieStorage.get(this.orgHintCookieName);n&&!r.organization&&(r.organization=n);const{url:a,state:i,nonce:o,code_verifier:s,redirect_uri:u,scope:l,audience:c}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new Ee("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((v,g,P=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",R,!1))};let R;const A=setTimeout((()=>{y(new us),b()}),1e3*P);R=function(x){if(x.origin!=g||!x.data||x.data.type!=="authorization_response")return;const z=x.source;z&&z.close(),x.data.response.error?y(Ee.fromPayload(x.data.response)):w(x.data.response),clearTimeout(A),window.removeEventListener("message",R,!1),setTimeout(b,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(m),m.setAttribute("src",v)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const p=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},p),{scope:l,oauthTokenScope:p.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new pt({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 mp(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var p;if(c&&h&&d){if(f.audience!==h)return f.scope;const v=d.split(" "),g=((p=f.scope)===null||p===void 0?void 0:p.split(" "))||[],P=g.every((w=>v.includes(w)));return v.length>=g.length&&P?d:f.scope}return f.scope})(this.options.useMrrt,e.authorizationParams,r?.audience,r?.scope);try{const c=await this._requestToken(Object.assign(Object.assign(Object.assign({},e.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:n}),a&&{timeout:a}),{scopesToRequest:i});if(c.refresh_token&&this.options.useMrrt&&r?.refresh_token&&await this.cacheManager.updateEntry(r.refresh_token,c.refresh_token),this.options.useMrrt&&(o=r?.audience,s=r?.scope,u=e.authorizationParams.audience,l=e.authorizationParams.scope,(o!==u||!gd(l,s))&&!gd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const p=h?.split(" ")||[],v=d?.split(" ")||[];return p.filter((g=>v.indexOf(g)==-1)).join(",")})(i,c.scope);throw new sg(e.authorizationParams.audience||"default",f)}return Object.assign(Object.assign({},c),{scope:e.authorizationParams.scope,oauthTokenScope:c.scope,audience:e.authorizationParams.audience||"default"})}catch(c){if((c.message.indexOf("Missing Refresh Token")>-1||c.message&&c.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);throw c}var o,s,u,l}async _saveEntryInCache(e){const{id_token:r,decodedToken:n}=e,a=st(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 pt({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 pt({scope:e,audience:r,clientId:n}),60,this.options.useMrrt,a);if(i&&i.access_token){const{token_type:o,access_token:s,oauthTokenScope:u,expires_in:l}=i,c=await this._getIdTokenFromCache();return c&&Object.assign(Object.assign({id_token:c.id_token,token_type:o||"Bearer",access_token:s},u?{scope:u}:null),{expires_in:l})}}async _requestToken(e,r){const{nonceIn:n,organization:a,scopesToRequest:i}=r||{},o=await Eg(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:cn(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 Dg(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=Bo(Lr()),u=Lr(),l=await cd(u),c=ld(l),{connect_uri:f,connect_params:h,auth_session:d}=await this.myAccountApi.connectAccount({connection:a,redirect_uri:o,state:s,code_challenge:c,code_challenge_method:"S256",authorization_params:i});this.transactionManager.create({state:s,code_verifier:u,auth_session:d,redirect_uri:o,appState:n,connection:a,response_type:Dt.ConnectCode});const p=new URL(f);p.searchParams.set("ticket",h.ticket),r?await r(p.toString()):window.location.assign(p)}};async function Kg(t){const e=new Fg(t);return await e.checkSession(),e}var He=(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))(He||{});const zg="sesamy.com",Bg="sesamy.dev",Hg="https://sesa.my",wd="sesamyCacheTimestamp",bd="sesamyContentReloaded";function Op(t,e){return`${t}.${e==="dev"?Bg:zg}`}function tt(t,e){return`https://${Op(t,e)}`}function Hr(){return(document.documentElement.getAttribute("lang")??navigator.language??"en").split("-")[0]?.toLowerCase()??"en"}/*!
5
5
  *
6
6
  * detectIncognito v1.6.2
7
7
  *
@@ -31,9 +31,9 @@
31
31
  *
32
32
  * Please keep this comment intact in order to properly abide by the MIT License.
33
33
  *
34
- **/var hs={d:(t,e)=>{for(var r in e)hs.o(e,r)&&!hs.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ws={};hs.d(Ws,{A:()=>Gg,k:()=>Vs});var xr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Nr=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Vs(){return xr(this,void 0,Promise,function(){return Nr(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(p){h=p.message.length}return h}function s(){return xr(this,void 0,void 0,function(){var h,d;return Nr(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return p.sent(),i(!1),[3,3];case 2:return h=p.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return xr(this,void 0,Promise,function(){return Nr(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 p=String(Math.random());try{var v=indexedDB.open(p,1);v.onupgradeneeded=function(g){var P=g.target.result,w=function(y){i(y)};try{P.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{P.close(),indexedDB.deleteDatabase(p)}},v.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var p=window.openDatabase,v=window.localStorage;try{p(null,null,null,null)}catch{return void i(!0)}try{v.setItem("test","1"),v.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 p=Math.round(d/1048576),v=2*Math.round((function(){var g,P,w,y=window;return(w=(P=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&w!==void 0?w:1073741824})()/1048576);i(p<v)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return xr(this,void 0,Promise,function(){var d,p,v;return Nr(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(),p=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(p.includes("Security error")),[2];case 4:return[3,6];case 5:(v=indexedDB.open("inPrivate")).onerror=function(P){v.error&&v.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},v.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return xr(this,void 0,Promise,function(){return Nr(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Vs);const Gg=Vs;Ws.A;const Wg=Ws.k,gn="sesamy_incognito_mode";function Gn(){try{const t=sessionStorage.getItem(gn);return t===null?void 0:t==="true"}catch{return}}async function Cp(){try{const t=sessionStorage.getItem(gn);if(t!==null)return t==="true";const{isPrivate:e}=await Wg();return sessionStorage.setItem(gn,e.toString()),e}catch{try{sessionStorage.setItem(gn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function Vg(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Jg(){return/android/i.test(navigator.userAgent)}let Oe,Ap,Gr,ps=!1,yn=!1;Vr()&&window.addEventListener("pageshow",()=>{yn=!1});const yr="sesamyAccessToken",Vo="sesamyRefreshToken",Pn="sesamySilentAuthThrottle",Zg=300*1e3;async function Wn(){return ps?!0:new Promise((t,e)=>{const r=setTimeout(()=>{ps?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Yg(t){if(!t)return null;const e=localStorage.getItem(Vo);if(!e)return oe("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(Vo),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Vo,i.refresh_token),localStorage.setItem(yr,i.access_token),i.access_token}catch{Ys()}}async function Js(){const t=localStorage.getItem(yr);if(!t)return null;const e=Xs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Yg(e);if(r)return r;localStorage.removeItem(yr)}return t}let un=null;const Xg=64;function Qg(){try{if(un!==null)return un;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===Xg)return un=!0,!0}}catch(t){oe(`Error checking for existing auth0 tokens: ${t.message}`)}return un=!1,!1}function ey(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 oe(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;oe(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return oe(`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 ty(t){if(t.enabled===!1)return;Ap=t.organization;const e=ey(t);Gr=e&&!Qg()?e:Op("token",t.environment);const r={domain:Gr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",wr(window.location.href)!==wr(`https://${Gr}`)&&(r.useRefreshTokens=!0),oe(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Kg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)oe("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{oe("Code found in URL, handling redirect");const o=window.location.href,s=new URL(location.href),u=s.searchParams;u.delete("code"),u.delete("state"),s.search=u.toString(),window.history.replaceState({},document.title,s.toString()),oe("Rewrote url to remove code and state");try{const l=await Oe.handleRedirectCallback(o);oe(`Login result: ${JSON.stringify(l)}`);const c=await Oe.getUser();if(!c)throw oe("No user found"),new Error("No user found");oe(`User found ${JSON.stringify(c)}`),Zs(),oe(`Triggering AUTHENTICATED event with appState: ${JSON.stringify(l.appState)}`),Jt(Be.AUTHENTICATED,{...c,appState:l.appState})}catch(l){alert("There was an error logging in"),console.error(l)}}ps=!0,Jt(Be.AUTH_INITIALIZED,{})}async function zt(){return await Wn(),await Js()?!0:Oe?Oe.isAuthenticated():!1}async function ry(){return await Wn(),await Js()?(oe("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function Up(t){if(yn)return oe("Login already in progress"),null;if(yn=!0,setTimeout(()=>{yn=!1},3e3),localStorage.removeItem(yr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:Ap,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gn(),...e}}}async function Vn(t){const e=Up(t);if(e)return Oe.loginWithRedirect(e)}async function $p(t){const e=Up(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),Zs();const r=await Oe.getUser();if(!r)throw oe("No user found after popup login"),new Error("No user found");const n=new CustomEvent(Be.AUTHENTICATED,{detail:{...r,appState:t?.appState},composed:!0,bubbles:!0});window.dispatchEvent(n)&&window.location.reload()}async function ny(t){return Gr&&wr(window.location.href)!==wr(`https://${Gr}`)&&(Vg()||Jg()||Gn())?$p(t):Vn(t)}function ay(){try{const t=sessionStorage.getItem(Pn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<Zg}catch{return sessionStorage.removeItem(Pn),!1}}function iy(){try{const t={timestamp:Date.now()};sessionStorage.setItem(Pn,JSON.stringify(t))}catch{oe("Failed to set silent auth throttle in sessionStorage")}}function Zs(){try{sessionStorage.removeItem(Pn)}catch{}}async function Pt(t=!0,e=!1){await Wn();const r=await Js();if(r)return r;if(!e&&ay()){if(oe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return oe("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=Xs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),Zs(),n}catch(n){const a=n;if(oe(`Failed to get token silently: ${a.message}`),iy(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Ys(),t)throw n;return null}}async function Ys(t={}){if(await Wn(),localStorage.removeItem(yr),Jt(Be.LOGOUT,{}),!!Oe)return oe(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function Xs(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 vs(t){const e=Xs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");oe("Set token"),localStorage.setItem(yr,t),Jt(Be.AUTHENTICATED,{...e,appState:void 0})}const oy=(t,e)=>e.skipDedupe||e.method!=="GET",sy=(t,e)=>e.method+"@"+t,cy=t=>t.clone(),uy=({skip:t=oy,key:e=sy,resolver:r=cy}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},ly=(t,e)=>t*e,fy=t=>t&&t.ok,dy=({delayTimer:t=500,delayRamp:e=ly,maxAttempts:r=10,until:n=fy,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,p)=>Promise.resolve(n(d,p)).then(v=>v?d&&o?d:p?Promise.reject(p):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:p,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};let Jo=class Lp extends Error{status;statusText;url;body;constructor(e,r,n,a,i){super(a),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Lp)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var En=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(En||{});const hy="application/json",qp="Content-Type",cr=Symbol(),xp=Symbol();function Sd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===qp.toLowerCase()))===null||e===void 0?void 0:e[1]}function Id(t){return/^application\/.*json.*/.test(t)}const Ht=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]=Ht(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 py(t,e=!1){br.options=e?t:Ht(br.options,t)}function vy(t,e=!1){br.polyfills=e?t:Ht(br.polyfills,t)}function my(t){br.errorType=t}const gy=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;let Np=class extends Error{};const yy=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:u}=t,l=new Map(i),c=Ht(a.options,n);let f=r;const h=gy(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,p=h.catch(y=>{throw{[cr]:y}}).then(y=>{var m;if(!y.ok){const b=new Np;if(b.cause=d,b.stack=b.stack+`
35
- CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const R=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(R&&typeof A=="string"){b.text=A;try{b.json=JSON.parse(A)}catch{}}else b[a.errorType]=A;throw b})}return y}),v=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,cr),R=b?m[cr]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(cr)&&l.get(cr);if(A)return A(R,t);const x=l.get(xp);if(x)return x(R,t);throw R}),g=y=>m=>v(y?p.then(b=>b&&b[y]()).then(b=>m?m(b):b):p.then(b=>m?m(b):b)),P={_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(cr,y)}},w=u.reduce((y,m)=>({...y,...typeof m.resolver=="function"?m.resolver(y):m.resolver}),P);return o.reduce((y,m)=>m(y,t),w)},wy={_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:Ht(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:Ht(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:Ht(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[qp]: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(xp,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=Sd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Id(a));return n=r?o?n.json(r,a):n.body(r):n,yy(n._deferred.reduce((s,u)=>u(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=Sd(this._options.headers);return this.content(e||Id(r)&&r||hy).body(JSON.stringify(t))}};function ct(t="",e={}){return{...wy,_url:t,_options:e}}ct.default=ct;ct.options=py;ct.errorType=my;ct.polyfills=vy;ct.WretchError=Np;const by=(t,e)=>e.skipDedupe||e.method!=="GET",Sy=(t,e)=>e.method+"@"+t,Iy=t=>t.clone(),Py=({skip:t=by,key:e=Sy,resolver:r=Iy}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Ey=(t,e)=>e.skipCache||e.method!=="GET",ky=(t,e)=>e.method+"@"+t,Ty=()=>!1,_y=()=>null,Ry=t=>t.ok,Oy=({throttle:t=1e3,skip:e=Ey,key:r=ky,clear:n=Ty,invalidate:a=_y,condition:i=Ry,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,l=new Set,c=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,p)=>{const v=r(d,p);let g=a(d,p);if(g&&(g instanceof Array||(g=[g]),g.forEach(P=>{typeof P=="string"?s.delete(P):P instanceof RegExp&&s.forEach((w,y)=>{P.test(y)&&s.delete(y)})})),n(d,p)&&s.clear(),e(d,p))return h(d,p);if(l.has(v)){if(s.has(v)){const P=s.get(v).clone();return o&&Object.defineProperty(P,o,{value:v,enumerable:!1}),Promise.resolve(P)}else if(u.has(v))return new Promise((P,w)=>{u.get(v).push([P,w])})}return u.has(v)||u.set(v,[]),c(v),h(d,p).then(P=>(i(P.clone())&&s.set(v,P.clone()),u.get(v).forEach(([w])=>w(P.clone())),u.delete(v),P)).catch(P=>{throw u.get(v).forEach(([,w])=>w(P)),u.delete(v),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Cy=(t,e)=>t*e,Ay=t=>t&&t.ok,Uy=({delayTimer:t=500,delayRamp:e=Cy,maxAttempts:r=10,until:n=Ay,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,p)=>Promise.resolve(n(d,p)).then(v=>v?d&&o?d:p?Promise.reject(p):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:p,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},$y="@sesamy/sdk",Ly="1.22.0";let qy=class{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 Fr="sesamyCacheTimestamp",xy=t=>{const{libraryName:e=$y,libraryVersion:r=Ly,cache:n}=t,a=n?.storage||new qy,i=[s=>async(u,l)=>{if(n?.mode===En.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Fr),c||(c=Date.now().toString(),sessionStorage.setItem(Fr,c))):(c=a.get(Fr),c||(c=Date.now().toString(),a.set(Fr,c)));const f={...l,headers:{...l.headers,"Cache-Timestamp":c}};return s(u,f)}return s(u,l)},s=>async(u,l)=>{const c=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:c}};return s(u,f)},Py()];n?.mode===En.NORMAL&&i.push(Oy({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Uy({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ct(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.headers}).middlewares(i);return{async request(s,u={}){try{const l=/^https?:\/\//.test(s);let c=o.url(s,l);u.headers&&(c=c.headers(u.headers));const f=(u.method||"GET").toLowerCase();let h;switch(f){case"get":h=c.get();break;case"post":h=c.post(u.body);break;case"put":h=c.put(u.body);break;case"patch":h=c.patch(u.body);break;case"delete":h=c.delete();break;default:h=c.get()}const d=await h.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&pt(),d.status===204)return null;if(!d.ok){const p=await d.text().catch(()=>"Unknown error");throw new Jo(d.status,d.statusText,d.url,`API Error ${d.status}: ${p}`,p)}return await d.json()}catch(l){if(l instanceof Jo)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Jo(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},pt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Fr),"Cache cleared"),jr={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"})}},Zo={list:async(t,e)=>{const r=new URLSearchParams;e?.type&&r.append("type",e.type),e?.sku&&r.append("sku",e.sku),e?.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),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`)},Pd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Ed={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Ny=(t,e)=>{if(!t||!e)return t;const r=new URL(t);return r.hash=`access_token=${e}`,r.toString()},kd=(t,e)=>!t.manageUrl||!e?t:{...t,manageUrl:Ny(t.manageUrl,e)},Dr={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"})},Yo={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:r})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},ur={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)}),delete:async(t,e)=>{try{return await t.request(`/tallies/${e}`,{method:"DELETE"}),!0}catch{return!1}},push:async(t,e,r)=>t.request(`/tallies/${e}/push`,{method:"POST",body:JSON.stringify(r)})},Xo={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"})}},lr={generateCheckoutLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},generateAccountLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}${e.contractId?`/${encodeURIComponent(e.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePlanLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateConsumeLink:(t,e)=>{const r=e.language||"en";let n=new URL(`${t.baseUrl}/consume/${encodeURIComponent(r)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.sku)}`);return e.episodeId?n.href+=`/${encodeURIComponent(e.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()}},Qo={generateLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkouts",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkouts/${e}`),update:async(t,e,r)=>t.request(`/checkouts/${e}`,{method:"PATCH",body:JSON.stringify(r)})},Td={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},_d={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},jy={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},Dy={list:async t=>t.request("/payment-issues")},My={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)}},Fy={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},Rd={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},Ky=t=>{const e=xy(t);return{profile:{get:r=>jr.get(e,r),update:(r,n)=>jr.update(e,r,n),checkSpotifyLink:()=>jr.checkSpotifyLink(e),unlinkSpotify:()=>jr.unlinkSpotify(e),delete:()=>jr.delete(e)},entitlements:{list:r=>Zo.list(e,r),get:r=>Zo.get(e,r),getAccess:r=>Zo.getAccess(e,r)},subscriptions:{list:()=>Pd.list(e),get:r=>Pd.get(e,r)},products:{get:r=>Ed.get(e,r),autoOnboard:r=>Ed.autoOnboard(e,r)},contracts:{list:async()=>{const r=await Dr.list(e),n=await t.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return r;const a=n.substring(7);return r.map(i=>kd(i,a))},get:async r=>{const n=await Dr.get(e,r),a=await t.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return kd(n,i)},cancel:r=>Dr.cancel(e,r),createAmendment:(r,n)=>Dr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Dr.confirmAmendment(e,r,n)},userMetadata:{get:()=>Yo.get(e),set:(r,n)=>Yo.set(e,r,n),delete:r=>Yo.delete(e,r)},tallies:{list:()=>ur.list(e),get:r=>ur.get(e,r),update:(r,n)=>ur.update(e,r,n),create:r=>ur.create(e,r),delete:r=>ur.delete(e,r),push:(r,n)=>ur.push(e,r,n)},tags:{list:()=>Xo.list(e),add:r=>Xo.add(e,r),remove:r=>Xo.remove(e,r)},checkouts:{generateLink:(r,n)=>lr.generateCheckoutLink(r,n),create:r=>Qo.create(e,r),get:r=>Qo.get(e,r),update:(r,n)=>Qo.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>lr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>lr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>lr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>lr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>lr.generateConsumeLink(r,n)},bills:{list:()=>Td.list(e),get:r=>Td.get(e,r)},fulfillments:{list:()=>_d.list(e),create:r=>_d.create(e,r)},paywalls:{get:r=>jy.get(e,r)},paymentIssues:{list:()=>Dy.list(e)},proxy:{content:(r,n,a,i)=>My.content(e,r,n,a,i)},transactions:{list:r=>Fy.list(e,r)},vendor:{get:()=>Rd.get(e),list:()=>Rd.list(e)}}};class zy{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 ms(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function jp(t,e){if(ms(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 Od(t){return t.endsWith("/")?t.slice(0,-1):t}function Cd(t,e){if(!ms(t)||!ms(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&Od(r.pathname)===Od(n.pathname)}function Hy(t,e,r){const n=new URL(`${tt("checkout3",t.environment)}`);e.language&&n.searchParams.set("lang",e.language);let a=e.sku,i=e.purchaseOptionId,o=e.itemSrc;if(e.itemSrc){const c=jp(e.itemSrc,e.purchaseOptionId);a=c.sku||a,i=c.purchaseOption||i,o=c.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),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 s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(c=>{const[f,h]=c.trim().split("=");return{key:f,value:h}}).filter(c=>s.some(f=>f===c.key)).forEach(c=>{n.searchParams.append(c.key,c.value)});let l=new URL(window.location.href);if(e.redirectUrl)try{l=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return l.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&l.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",l.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:c,methods:f})=>f?f.map(h=>`${c}|${h}`):c).join(",")),e.requireAddress&&n.searchParams.set("require-address","true"),e.giftMode&&n.searchParams.set("gift-mode","true"),e.payerEmail&&n.searchParams.set("payer-email",e.payerEmail),e.metadata&&Object.entries(e.metadata).forEach(([c,f])=>{n.searchParams.set(`metadata.${c}`,String(f))}),n}const Dp="sesamySignedURLs";function Qs(){const t=sessionStorage.getItem(Dp);return t?JSON.parse(t):[]}function By(t){const e=Qs();e.push(t),oe(`Adding signed URL: ${t}`),sessionStorage.setItem(Dp,JSON.stringify(e))}function Gy(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const gs="sesamyAttribution";function Wy(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 Vy(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function kn(){return Wy(gs)||{}}function Mp(t){if(t===null)localStorage.removeItem(gs);else{oe(`Setting attribution ${JSON.stringify(t)}`);const e=kn()??{},r=Gy({...e,...Vy(t)});localStorage.setItem(gs,JSON.stringify({value:r}))}}const ec="@sesamy/sesamy-js",nn="1.79.0",Fp="sesamyFlags";async function Kp(t){try{localStorage.setItem(Fp,JSON.stringify(t))}catch{oe("Failed to save flags to localStorage")}}async function zp(t,e){const r=await an();r[t]=e,await Kp(r)}async function Hp(t){return(await an())[t]}async function Bp(t){const e=await an();t in e&&(delete e[t],await Kp(e))}async function an(){try{const t=localStorage.getItem(Fp);return t?JSON.parse(t):{}}catch{return{}}}function Gp(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}function Jy(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}function Zy(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}let Fe={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Wp=[],Vp=!1,_t;function tc(){const t=window.location.pathname,e=new URLSearchParams(window.location.search),r=navigator.userAgent;return Wp.find(n=>{if(n.path&&!t.includes(n.path)||n.queryParam&&e.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!r.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!r.includes(n.userAgentContains))})}function Yy(){return tc()}function Xy(t,e){Wp=t.content||[];const r=tc();r&&r.type==="article"&&(Fe={...Fe,...Jy(r.selectors)},Vp=r.enablePaywallSettingsUrlFallback||!1),_t=e}function Qy(t,e){const{selector:r,attribute:n}=e;return r===Fe.article.selector||n&&t.hasAttribute(n)?t:t.querySelector(r)}function Jp(t,e,r=!1){if(t){if(e.attribute){if(e.attribute==="textContent")return t.textContent??void 0;const n=t.getAttribute(e.attribute),a=Jp(t.parentElement,e,r);if(r){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return t.textContent??void 0}}function Kt(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 rc({publisherContentId:t,key:e,defaultValue:r=""}){const n=t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null,a=e.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(e)||Kt(`sesamy:${e}`)||Kt(`sesamy:${a}`)||Kt(`og:${e}`)||Kt(e)||r}function Zp(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(on).filter(e=>e!==null)}function on(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Gp(e)},n=(i,o,s,u)=>{const{transform:l,collect:c=!1}=u||{},f=Qy(e,o),h=Jp(f,o,c),d=rc({publisherContentId:s,key:Zy(String(i))}),p=h||d||void 0;p&&(r[i]=l?l(p):p)};n("id",Fe.id),n("title",Fe.title,r.id),n("excerpt",Fe.excerpt,r.id),n("image",Fe.image,r.id),n("price",Fe.price,r.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id,{collect:!0}),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,{transform:i=>i||"entitlement"});const a=tc();if(a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency),a.paywallUrl&&!r.paywallUrl&&(r.paywallUrl=a.paywallUrl)),Vp&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r.url||(r.url=window.location.href),r}async function ew(t){const e=on(t);if(!e)throw new Error("Could not find article element");if(e.accessLevel==="public")return!0;if(e.accessLevel==="logged-in"&&!e.paywallUrl)return await _t.auth.isAuthenticated()?!0:null;if(e.paywallUrl&&((await _t.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await _t.auth.isAuthenticated()?!0:null;if(!e.url)throw new Error("Article must have a URL");return await _t.entitlements.hasAccess(e.url,e.pass?.split(",")||[])||null}async function Yp(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=on(r);if(!n?.url)throw new Error("Could not find content for element");const a=await _t.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await _t.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Gp(r.parentElement||r);return _t.proxy.getContent(i.token,n.url,o)}function Xp(t,e={}){const{closeOnBackdropClick:r=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=e,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof t=="string"?u.innerHTML=t:u.appendChild(t),s.appendChild(u);const l=()=>{s.remove(),n&&document.removeEventListener("keydown",c)},c=f=>{f.key==="Escape"&&l()};return r&&s.addEventListener("click",f=>{f.target===s&&l()}),n&&document.addEventListener("keydown",c),document.body.appendChild(s),{element:s,close:l}}function tw(t,e={}){const{position:r="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=e,l=document.createElement("div");l.setAttribute("data-sesamy-notification-bar","true"),l.setAttribute("data-sesamy-notification-position",r),Object.assign(l.style,{position:n?"fixed":"absolute",[r]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof t=="string"?l.innerHTML=t:l.appendChild(t);let c,f,h;const d=()=>{if(h&&clearTimeout(h),o&&s){const p=document.documentElement;p.style.transform=c||"",setTimeout(()=>{l.remove(),p.style.transition=f||""},parseFloat(u)*1e3)}else l.remove()};if(i&&(h=setTimeout(d,i)),o&&s){const p=document.documentElement;c=p.style.transform,f=p.style.transition,p.style.transition=`transform ${u} ease`,l.style.transition=`transform ${u} ease`,r==="top"?(p.style.transform=`translateY(${s})`,l.style.transform=`translateY(-${s})`):(p.style.transform=`translateY(-${s})`,l.style.transform=`translateY(${s})`),document.documentElement.prepend(l)}else document.body.appendChild(l);return{element:l,close:d}}function rw(t){const e=t.endpoint||tt("api2",t.environment),n=Ky({baseUrl:e,tokenProvider:async()=>{if(await zt())try{const q=await Pt(!1);if(q)return`Bearer ${q}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:ec,libraryVersion:nn,vendorId:t.vendorId,cache:{mode:En.BROWSER,storage:new zy}}),a=S=>async(O,q)=>{let F=sessionStorage.getItem(wd);F||(F=Date.now().toString(),sessionStorage.setItem(wd,F));const I={...q,headers:{...q.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(q,F)=>{let I=null;if(I=await Pt(S),!I){if(S)throw new Error("No access token available");return O(q,F)}const T={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(q,T)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),uy(),dy({delayTimer:1e3,delayRamp:(S,O)=>S*O,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(S={}){const{waitForEntitlementAfter:O,includeSignedLinks:q=!0}=S,F=await zt()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return q&&F.push(...Qs()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:T,purchaseOption:j}=jp(S);if("sku"in I&&T===I.sku||j&&"purchaseOptionsId"in I&&j===I.purchaseOptionsId||Cd(S,I.url))return!0}return!!O.some(T=>Cd(T,I.url))})}async function l(S,O,q){const F=new URL(tt("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),q&&F.searchParams.set("selector",q),ct(F.toString()).headers({Authorization:`Bearer ${S}`}).get().text()}async function c(S){if(!S)throw new Error("SKU is required to get fulfillments");return await zt()?await o.get(`/fulfillments?sku=${encodeURIComponent(S)}`).json():[]}async function f(S,O){if(!S||!O)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:S},`/fulfillments/${encodeURIComponent(O)}/request-delivery?`).res()).ok}async function h(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(S){return(await n.transactions.list())?.find(q=>q.id===S)}async function p(){return await o.url("/tags").get().json()}async function v(S){const O=await o.url(`/tags/${encodeURIComponent(S)}`).delete().res();return pt(),O.ok}async function g(S){const O=await o.url("/tags").post(encodeURIComponent(S)).res();return Jt(Be.USER_ATTRIBUTE_CHANGED,{}),pt(),O.ok}async function P(S){return(await n.tallies.get(S)).value}async function w(){const S=await n.tallies.list(),O={};for(const q of S)O[q.id]=q.value;return O}async function y(S){return await n.tallies.delete(S)}async function m(S,O){return await n.tallies.push(S,O)}async function b(){return await Pt(!1)?await o.url("/profile").get().json():null}async function R(S){const O=await o.url("/profile").patch(S).res();return pt(),O.ok}async function A(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function x(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await Pt(!1);if(!O)throw new Error("No access token available");const q=new URL(`${tt("access-sync",t.environment)}/spotify/sesamy-callback`);q.searchParams.set("access_token",O),q.searchParams.set("state",S),window.location.href=q.toString()}async function V(S){const O=await o.url(`/products/${encodeURIComponent(S)}/auto-onboard`).post().json();return O.length&&pt(),O}async function te(S,O=3600){const{shortlink:q}=await ct(Bg).post({url:S,ttl:O}).json();return q}async function L(S){const O=await Pt(!1,!0);let q;const F=S.language||Br(),I=kn();switch(S.target){case"account":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":q=new URL(`${tt("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?q.href+=`/${S.episodeId}`:q.href+="/listen",q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":q=Hy(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(q.hash=`#access_token=${O}`),S.shorten?te(q.href,S.ttl):q.href}async function M(){const S=await Pt(!1),O=new URL(`${tt("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=kn(),q=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,T]=F.trim().split("=");q.includes(I)&&!O[I]&&(O[I]=T)}),n.checkouts.create({language:Br(),...S,attribution:{...O,...S.attribution}})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Zp,get:on,getLanguage:Br,unlock:Yp,getPropertyFromHTML:rc},contracts:n.contracts,deleteTag:v,deleteTally:y,entitlements:n.entitlements,flags:{get:Hp,set:zp,list:an,delete:Bp},generateLink:L,getProxyContent:l,getEntitlements:s,getFulfillments:c,requestDelivery:f,hasAccess:u,isSpotifyLinked:A,linkSpotify:z,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:b,products:n.products,getSubscriptions:h,getTally:P,getTallies:w,getTags:p,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:x,updateProfile:R,vendor:n.vendor}}function Ad(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 nw="function",aw="string",rt="undefined",iw="boolean",Tn="object",ow="array",sw="number",cw="symbol",uw="null",ys=function(){},Qp="any",ev="*",Zt="__",lw="form",fw="input",dw="button",hw="select",_n=typeof process!==rt?process:{};_n.env&&_n.env.NODE_ENV;var Ce=typeof document!==rt;_n.versions!=null&&_n.versions.node!=null;typeof Deno!==rt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==rt&&typeof navigator.userAgent!==rt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function tv(t,e){return e.charAt(0)[t]()+e.slice(1)}var pw=tv.bind(null,"toUpperCase"),vw=tv.bind(null,"toLowerCase");function mw(t){return rv(t)?pw(uw):typeof t===Tn?bw(t):Object.prototype.toString.call(t).slice(8,-1)}function Rn(t,e){e===void 0&&(e=!0);var r=mw(t);return e?vw(r):r}function sn(t,e){return typeof e===t}var ze=sn.bind(null,nw),Rt=sn.bind(null,aw),hr=sn.bind(null,rt),gw=sn.bind(null,iw);sn.bind(null,cw);function rv(t){return t===null}function yw(t){return Rn(t)===sw&&!isNaN(t)}function nv(t){return Rn(t)===ow}function Ke(t){if(!ww(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ww(t){return t&&(typeof t===Tn||t!==null)}function bw(t){return ze(t.constructor)?t.constructor.name:null}function Sw(t){return t instanceof Error||Rt(t.message)&&t.constructor&&yw(t.constructor.stackTraceLimit)}function av(t,e){if(typeof e!="object"||rv(e))return!1;if(e instanceof t)return!0;var r=Rn(new t(""));if(Sw(e))for(;e;){if(Rn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}av.bind(null,TypeError);av.bind(null,SyntaxError);function Jn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Iw(t,e):r}function Iw(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Zn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Zn(Jn,lw);Zn(Jn,dw);Zn(Jn,fw);Zn(Jn,hw);function Pw(t){return t?nv(t)?t:[t]:[]}function Ud(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Ew(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function kw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Tw(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Ud(r[1]),o=Ud(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(_w(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return Ce&&window.location.search.substring(1)})())}function _w(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 Yn(){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 Rw(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var Bt="global",Sr=Zt+Bt+Zt,Ir=typeof self===Tn&&self.self===self&&self||typeof global===Tn&&global[Bt]===global&&global||void 0;function Yt(t){return Ir[Sr][t]}function Xt(t,e){return Ir[Sr][t]=e}function Or(t){delete Ir[Sr][t]}function Cr(t,e,r){var n;try{if(nc(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}Ir[Sr]||(Ir[Sr]={});var ln={};function nc(t){if(typeof ln[t]!==rt)return ln[t];try{var e=window[t];e.setItem(rt,rt),e.removeItem(rt)}catch{return ln[t]=!1}return ln[t]=!0}function ee(){return ee=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},ee.apply(null,arguments)}var kt="function",vt="undefined",Wr="reducer",iv="@@redux/",ws=iv+"INIT",Ow=iv+Math.random().toString(36),$d=(function(){return typeof Symbol===kt&&Symbol.observable||"@@observable"})(),fn=" != "+kt;function ov(t,e,r){var n;if(typeof e===kt&&typeof r===vt&&(r=e,e=void 0),typeof r!==vt){if(typeof r!==kt)throw new Error("enhancer"+fn);return r(ov)(t,e)}if(typeof t!==kt)throw new Error(Wr+fn);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==kt)throw new Error("Listener"+fn);var p=!0;return l(),s.push(d),function(){if(p){p=!1,l();var v=s.indexOf(d);s.splice(v,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===vt)throw new Error("ActType "+vt);if(u)throw new Error("Dispatch in "+Wr);try{u=!0,i=a(i,d)}finally{u=!1}for(var p=o=s,v=0;v<p.length;v++)(0,p[v])();return d}return h({type:ws}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==kt)throw new Error("next "+Wr+fn);a=d,h({type:ws})}})[$d]=function(){var d,p=f;return(d={subscribe:function(v){if(typeof v!="object")throw new TypeError("Observer != obj");function g(){v.next&&v.next(c())}return g(),{unsubscribe:p(g)}}})[$d]=function(){return this},d},n}function Cw(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Wr+" "+t+" returns "+vt}function Pr(){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 Aw(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ee({},o,{dispatch:s=Pr.apply(void 0,i)(o.dispatch)})}}}var Ot=Zt+"anon_id",Gt=Zt+"user_id",vr=Zt+"user_traits",bs="analytics",Et="userId",pr="anonymousId",wn=["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"],Ss=["name","EVENTS","config","loaded"],Q=wn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Ld=/^utm_/,qd=/^an_prop_/,xd=/^an_trait_/;function Uw(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===Q.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ot,o.anonymousId),l||e(Gt,o.userId),u.traits&&e(vr,ee({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(p,v){if(v.match(Ld)||v.match(/^(d|g)clid/)){var g=v.replace(Ld,"");p.campaign[g==="campaign"?"name":g]=i[v]}return v.match(qd)&&(p.props[v.replace(qd,"")]=i[v]),v.match(xd)&&(p.traits[v.replace(xd,"")]=i[v]),p},{campaign:{},props:{},traits:{}});r.dispatch(ee({type:Q.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:Q.campaign,campaign:d.campaign})}}return n(a)}}}}function $w(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Ot)return ee({},e,{anonymousId:r.value});if(r.key===Gt)return ee({},e,{userId:r.value})}switch(r.type){case Q.identify:return Object.assign({},e,{userId:r.userId,traits:ee({},e.traits,r.traits)});case Q.reset:return[Gt,Ot,vr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Nd(t){return{userId:t.getItem(Gt),anonymousId:t.getItem(Ot),traits:t.getItem(vr)}}var Is=function(t){return Zt+"TEMP"+Zt+t};function Lw(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===Q.reset&&([Gt,vr,Ot].forEach(function(d){n(d)}),[Et,pr,"traits"].forEach(function(d){Or(Is(d))})),s.type===Q.identify){a(Ot)||r(Ot,Yn());var f=a(Gt),h=a(vr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Gt,u),l&&r(vr,ee({},h,l))}return o(s)}}}}var Kr={};function jd(t,e){Kr[t]&&ze(Kr[t])&&(Kr[t](e),delete Kr[t])}function sv(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ee({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return sv(t,e,r-10).then(n,a)})})}function qw(t){return{abort:t}}function cv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,p=h.payload.type,v=a[d][p];if(v&&ze(v)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Et,pr].reduce(function(R,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(R[A]=b[A]),R},m)})(h.payload,u),w=n[P.meta.rid];if(!w&&(g=v({payload:P,config:o[d].config,instance:r,abort:qw}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=p+":"+d;t.dispatch(ee({},P,{type:y,_:{called:y,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var es=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(mr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var p=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var x=w.type.match(mr)?(function(z,V,te,L,M){return function(N,S){var O=L?L.name:z,q=S&&Jr(S)?S:te;if(L&&(!(q=S&&Jr(S)?S:[z]).includes(z)||q.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(q)+" input valid");return ee({},M,{abort:{reason:N,plugins:q,caller:V,_:O}})}})(R,A,P,m,w):(function(z,V){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+V)}})(w,A);return{payload:xw(w),instance:g,config:b||{},abort:x}}})(n,d),v=e.exact.reduce(function(g,P){var w=P.pluginName,y=P.methodName,m=!1;return y.match(/^initialize/)||y.match(/^reset/)||(m=!l[w].loaded),c.offline&&y.match(/^(page|track|identify)/)&&(m=!0),g[""+w]=m,g},{});return Promise.resolve(e.exact.reduce(function(g,P,w){var y=P.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var R=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,x,z){return Promise.resolve(A).then(function(V){return x.method&&ze(x.method)?((function(N,S){var O=Bd(N);if(O&&O.name===S){var q=Bd(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(q?"or "+q.method:"")+" in "+S+" plugin insteadof "+N].join(`
36
- `))}})(x.methodName,x.pluginName),Promise.resolve(x.method({payload:V,instance:n,abort:(te=V,L=y,M=x.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[L],caller:f,from:M||L}})}),config:Fd(x.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,L,M})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return R&&R.then?R.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(P,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,R=i[b];return Promise.resolve(P).then(function(A){var x=g[b]?g[b]:{};if(h&&(x=A),rs(x,b))return ts({data:x,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(rs(A,b))return m&&ts({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(v.hasOwnProperty(b)&&v[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:x,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=p(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:x,instance:n,config:Fd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},L=ee({},A,te),M=g[b];if(rs(M,b))ts({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(Dd)&&!f.match(Md)&&n.dispatch(ee({},h?L:x,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(mr)||f.match(/^registerPlugin/)||f.match(Md)||f.match(Dd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var w=ee({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});uv(P,e.exact.length)&&!f.match(/End$/)&&(w=ee({},w,{type:P.type+"Aborted"})),s.dispatch(w)}return P})})}catch(g){return Promise.reject(g)}},mr=/Start$/,Dd=/^bootstrap/,Md=/^ready/;function ts(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Fd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Kd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function zd(t,e){var r=t.replace(mr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function rs(t,e){var r=t.abort;return!!r&&(r===!0||Hd(r,e)||r&&Hd(r.plugins,e))}function uv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||Rt(r))return!0;var n=r.plugins;return Jr(r)&&r.length===e||Jr(n)&&n.length===e}function Jr(t){return Array.isArray(t)}function Hd(t,e){return!(!t||!Jr(t))&&t.includes(e)}function Bd(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function xw(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ke(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Nw(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(m){return s?m:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===Q.enablePlugin&&a.dispatch({type:Q.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===Q.disablePlugin&&setTimeout(function(){return jd(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),p=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),v=[],g=[],P=o.disabled,w=p.map(function(m){var b=m.loaded,R=m.name,A=m.config;return sv(m,function(){return b({config:A})},1e4).then(function(x){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!Ss.includes(z)})}),n[R]=!0),v=v.concat(R),m}).catch(function(x){if(x instanceof Error)throw new Error(x);return g=g.concat(x.name),x})});Promise.all(w).then(function(m){var b={plugins:v,failed:g,disabled:P};setTimeout(function(){d.length===w.length+P.length&&a.dispatch(ee({},{type:Q.ready},b))},0)})}var y=(function(){if(l!==Q.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return cv(a,e,t)},0),Promise.resolve((function(m,b,R,A,x){try{var z=ze(b)?b():b,V=m.type,te=V.replace(mr,"");if(m._&&m._.called)return Promise.resolve(m);var L=R.getState(),M=(O=z,(q=L.plugins)===void 0&&(q={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var T=F.plugins||{};return gw(T[I])?T[I]:T.all!==!1&&(!q[I]||q[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys(L.plugins).filter(function(I){var T=L.plugins[I];return m.plugins.includes(I)&&!T.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,T){var j=zd(I).map(function(H){return Kd(H,T)});return T.reduce(function(H,Y){var J=Y.name,fe=zd(I,J).map(function(ke){return Kd(ke,T)}),ne=fe[0],ue=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ue.length&&(H.duringNS[J]=ue),ae.length&&(H.afterNS[J]=ae),H},{before:j[0],beforeNS:{},during:j[1],duringNS:{},after:j[2],afterNS:{}})})(V,M);return Promise.resolve(es({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(I){function T(){var Y=(function(){if(V.match(mr))return Promise.resolve(es({action:ee({},j,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(J){J.meta&&J.meta.hasCallback&&jd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(uv(I,N.length))return I;var j,H=(function(){if(V!==te)return Promise.resolve(es({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(Y){j=Y});j=I})();return H&&H.then?H.then(T):T()})}catch(I){return Promise.reject(I)}var O,q,F})(o,e,t,a,r)).then(function(m){var b=i(m);return s=1,b})})();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(m){return Promise.reject(m)}}}}}function jw(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===Q.setItem||a===Q.removeItem){if(n.abort)return r(n);a===Q.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var Dw=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 Pr.apply(void 0,o)(n)(a)}}}}};function Mw(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Gd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Gd(r.type,Q.initialize),l=t()[u];return l&&u?(n[u]=ee({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ee({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ee({},e[r.name],{loaded:!0}),ee({},e,n);switch(r.type){case Q.disablePlugin:return ee({},e,Wd(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Wd(r.plugins,!0,e));default:return e}}}function Gd(t,e){return t.substring(e.length+1,t.length)}function Wd(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function lv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Fw={last:{},history:[]};function Kw(t,e){t===void 0&&(t=Fw);var r=e.options,n=e.meta;if(e.type===Q.track){var a=lv(ee({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ee({},t,{last:a,history:t.history.concat(a)})}return t}var zw={actions:[]};function Hw(t,e){t===void 0&&(t=zw);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===Q.identify?[e].concat(t.actions):t.actions.concat(e),ee({},t,{actions:n});case"dequeue":return[];default:return t}}var fv=/#.*$/;function Bw(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(fv,""):"")}var dv,hv,pv,vv,Gw=function(t){if(t===void 0&&(t={}),!Ce)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(Ce){for(var p,v=document.getElementsByTagName("link"),g=0;p=v[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(fv,"")})(l),f={title:r,url:c,path:Bw(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},Ww={last:{},history:[]};function Vw(t,e){t===void 0&&(t=Ww);var r=e.options;if(e.type===Q.page){var n=lv(ee({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ee({},t,{last:n,history:t.history.concat(n)})}return t}dv=(function(){if(!Ce)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"})(),hv=Ce?document.referrer:null,pv=Ew(),vv=kw();var Vd={initialized:!1,sessionId:Yn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:dv},userAgent:Ce?navigator.userAgent:"node",library:{name:bs,version:"0.13.1"},timezone:vv,locale:pv,campaign:{},referrer:hv};function Jw(t,e){t===void 0&&(t=Vd);var r=t.initialized,n=e.campaign;switch(e.type){case Q.campaign:return ee({},t,{campaign:n});case Q.offline:return ee({},t,{offline:!0});case Q.online:return ee({},t,{offline:!1});default:return r?t:ee({},Vd,t,{initialized:!0})}}var Zw=["plugins","reducers","storage"];function Yw(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Xw(t){var e=Yw.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function mv(){return Xt(bs,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Ir[Sr][bs].push(o.action||o),i(o)}})}}}function Jd(t){return function(){return Pr(Pr.apply(null,arguments),mv())}}function ns(t){return t?nv(t)?t:[t]:[]}function Zd(t,e,r){t===void 0&&(t={});var n,a,i=Yn();return e&&(Kr[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(ze(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ee({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Qw(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,T){if(ze(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 j=T.EVENTS?Object.keys(T.EVENTS).map(function(J){return T.EVENTS[J]}):[];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(J,fe){var ne;return J[fe]=(ne=T.methods[fe],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ue.length;ke++)ae[ke]=ue[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete T.methods);var H=Object.keys(T).concat(j),Y=new Set(I.events.concat(H));if(I.events=Array.from(Y),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:Or},i=(function(I){return function(T,j,H){return j.getState("user")[T]||(H&&Ke(H)&&H[T]?H[T]:Nd(I)[T]||Yt(Is(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!Ss.includes(I)}).sort(),u=new Set(s.concat(wn).filter(function(I){return!Ss.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new Dw,h=f.addMiddleware,d=f.removeMiddleware,p=f.dynamicMiddlewares,v=function(){throw new Error("Abort disabled inListener")},g=Tw(),P=Nd(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Yn());var y=ee({enable:function(I,T){return new Promise(function(j){S.dispatch({type:Q.enablePlugin,plugins:ns(I),_:{originalAction:Q.enablePlugin}},j,[T])})},disable:function(I,T){return new Promise(function(j){S.dispatch({type:Q.disablePlugin,plugins:ns(I),_:{originalAction:Q.disablePlugin}},j,[T])})}},n.methods),m=!1,b={identify:function(I,T,j,H){try{var Y=Rt(I)?I:null,J=Ke(I)?I:T,fe=j||{},ne=b.user();Xt(Is(Et),Y);var ue=Y||J.userId||i(Et,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ue,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[T,j,H])}))}catch(ae){return Promise.reject(ae)}},track:function(I,T,j,H){try{var Y=Ke(I)?I.event:I;if(!Y||!Rt(Y))throw new Error("EventMissing");var J=Ke(I)?I:T||{},fe=Ke(j)?j:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Et,b,T),anonymousId:i(pr,b,T)},ne,[T,j,H])}))}catch(ne){return Promise.reject(ne)}},page:function(I,T,j){try{var H=Ke(I)?I:{},Y=Ke(T)?T:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:Gw(H),options:Y,userId:i(Et,b,H),anonymousId:i(pr,b,H)},J,[I,T,j])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Et||I==="id")return i(Et,b);if(I===pr||I==="anonId")return i(pr,b);var T=b.getState("user");return I?Ad(T,I):T},reset:function(I){return new Promise(function(T){S.dispatch({type:Q.resetStart},T,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(T){I&&I(T),m=!0})},on:function(I,T){if(!I||!ze(T))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var j=/Start$|Start:/;if(I==="*"){var H=function(ne){return function(ue){return function(ae){return ae.type.match(j)&&T({payload:ae,instance:b,plugins:o}),ue(ae)}}},Y=function(ne){return function(ue){return function(ae){return ae.type.match(j)||T({payload:ae,instance:b,plugins:o}),ue(ae)}}};return h(H,dn),h(Y,hn),function(){d(H,dn),d(Y,hn)}}var J=I.match(j)?dn:hn,fe=function(ne){return function(ue){return function(ae){return ae.type===I&&T({payload:ae,instance:b,plugins:o,abort:v}),ue(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,T){if(!I||!ze(T))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var j=b.on(I,function(H){T({payload:H.payload,instance:b,plugins:o,abort:v}),j()});return j},getState:function(I){var T=S.getState();return I?Ad(T,I):Object.assign({},T)},dispatch:function(I){var T=Rt(I)?{type:I}:I;if(wn.includes(T.type))throw new Error("reserved action "+T.type);var j=ee({},T,{_:ee({originalAction:T.type},I._||{})});S.dispatch(j)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,T,j){S.dispatch({type:Q.setItemStart,key:I,value:T,options:j})},removeItem:function(I,T){S.dispatch({type:Q.removeItemStart,key:I,options:T})}},setAnonymousId:function(I,T){b.storage.setItem(Ot,I,T)},events:{core:wn,plugins:s}},R=n.middlewares.concat([function(I){return function(T){return function(j){return j.meta||(j.meta=Zd()),T(j)}}},p(dn),Nw(b,c,{all:l,plugins:s}),jw(a),Uw(b),Lw(b),p(hn)]),A={context:Jw,user:$w(a),page:Vw,track:Kw,plugins:Mw(c),queue:Hw},x=Pr,z=Pr;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(x=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?mv():Ke(typeof arguments[0])?Jd():Jd().apply(null,arguments)}}var te,L=(function(I){return Object.keys(I).reduce(function(T,j){return Zw.includes(j)||(T[j]=I[j]),T},{})})(t),M=n.pluginsArray.reduce(function(I,T){var j=T.name,H=T.config,Y=T.loaded,J=n.pluginEnabled[j];return I[j]={enabled:J,initialized:!!J&&!T.initialize,loaded:!!Y({config:H}),config:H},I},{}),N={context:L,user:w,plugins:M},S=ov((function(I){for(var T=Object.keys(I),j={},H=0;H<T.length;H++){var Y=T[H];typeof I[Y]===kt&&(j[Y]=I[Y])}var J,fe=Object.keys(j);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:ws})===vt||typeof ae(void 0,{type:Ow})===vt)throw new Error(Wr+" "+ue+" "+vt)})})(j)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,ke={},Ne=0;Ne<fe.length;Ne++){var De=fe[Ne],Le=ne[De],Qe=(0,j[De])(Le,ue);if(typeof Qe===vt){var St=Cw(De,ue);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),N,z(x(Aw.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,T,j){var H=ee({},I,{meta:Zd(I.meta,T,ns(j))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:L,params:g,user:w,initialUser:r,persistedUser:P});var q=O.filter(function(I){return n.pluginEnabled[I]}),F=O.filter(function(I){return!n.pluginEnabled[I]});return S.dispatch({type:Q.registerPlugins,plugins:O,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,T){var j=I.bootstrap,H=I.config,Y=I.name;j&&ze(j)&&j({instance:b,config:H,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===T+1&&S.dispatch({type:Q.initializeStart,plugins:q,disabled:F})}),Xw(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,T,j){setInterval(function(){return cv(I,T,j)},3e3)})(S,c,b),b}var dn="before",hn="after",Wt="cookie",Dt=wv(),gv=Xn,eb=Xn;function yv(t){return Dt?Xn(t,"",-1):Or(t)}function wv(){if(Dt!==void 0)return Dt;var t=Wt+Wt;try{Xn(t,t),Dt=document.cookie.indexOf(t)!==-1,yv(t)}catch{Dt=!1}return Dt}function Xn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Dt===!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 mt="localStorage",tb=nc.bind(null,mt);Cr(mt,"getItem",Yt);Cr(mt,"setItem",Xt);Cr(mt,"removeItem",Or);var gt="sessionStorage",rb=nc.bind(null,gt);Cr(gt,"getItem",Yt);Cr(gt,"setItem",Xt);Cr(gt,"removeItem",Or);function gr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ke(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var nb=tb(),ab=rb(),ib=wv();function Vt(t,e){if(t){var r=ac(e),n=!cc(r),a=ic(r)?gr(localStorage.getItem(t)):void 0;if(n&&!hr(a))return a;var i=oc(r)?gr(gv(t)):void 0;if(n&&i)return i;var o=sc(r)?gr(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 On(t,e,r){if(t&&!hr(e)){var n={},a=ac(r),i=JSON.stringify(e),o=!cc(a);return ic(a)&&(n[mt]=pn(mt,e,gr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:oc(a)&&(n[Wt]=pn(Wt,e,gr(gv(t))),eb(t,i),o)?n[Wt]:sc(a)&&(n[gt]=pn(gt,e,gr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Bt]=pn(Bt,e,Yt(t)),Xt(t,e),o?n[Bt]:n)}}function ob(t,e){if(t){var r=ac(e),n=Vt(t,ev),a={};return!hr(n.localStorage)&&ic(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!hr(n.cookie)&&oc(r)&&(yv(t),a[Wt]=n.cookie),!hr(n.sessionStorage)&&sc(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!hr(n.global)&&Qn(r,Bt)&&(Or(t),a[Bt]=n.global),a}}function ac(t){return t?Rt(t)?t:t.storage:Qp}function ic(t){return nb&&Qn(t,mt)}function oc(t){return ib&&Qn(t,Wt)}function sc(t){return ab&&Qn(t,gt)}function cc(t){return t===ev||t==="all"}function Qn(t,e){return t===Qp||t===e||cc(t)}function pn(t,e,r){return{location:t,current:e,previous:r}}var sb={setItem:On,getItem:Vt,removeItem:ob};function cb(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yd(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?Yd(Object(r),!0).forEach(function(n){cb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ub(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:sb};return Qw(Xd(Xd({},e),t))}function lb(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=db(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function fb(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function db(t){return["#","?"].forEach(e=>t=fb(t,e)),t}function hb(){lb(()=>{dt.page()})}var as="up",is="down";function pb(t){if(t===void 0&&(t={}),!Ce)return ys;var e=eh(),r=Ps(),n=Qd(),a=vn(n,e),i=vn(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return ys;var d=h.map(function(v){return Number(v)}),p=Rw(function(){var v=eh(),g=(function(L,M){return M.map(function(N){return N===100?L-5:L*(N/100)})})(v,d),P=Ps(),w=Qd(),y=vn(w,v),m=vn(P,v);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=as;b?R="initial":l<=w&&(R=is);var A=g,x=d;(R===as||b)&&(A=g.slice().reverse(),x=d.slice().reverse());var z=x.reduce(function(L,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),L.singleFunction=M),R===is&&!o.includes(M)&&w>=S&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):R===as&&!o.includes(M)&&w<=S&&M<=y?(L.foundFunc=[M],L):(b&&w>=S&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===is&&z.callbacks&&z.callbacks.forEach(function(L){ze(t[L])&&(t[L]({trigger:L,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(L))}),z.singleFunction){var V=z.singleFunction,te=z.direction;ze(t[V])&&t[V]({trigger:V,direction:te,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(V)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function Ps(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function vb(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Qd(){return Math.round(Ps()+vb())}function eh(){if(!Ce)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function vn(t,e){return Math.round(t/e*100)}var uc="Event",th=uc+"Listener";function mb(t){return function(e,r,n,a){var i=n||ys,o=a||!1;if(!Ce)return i;var s=Cn(r),u=Cn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+uc);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+th:"remove"+th,d=0;d<u.length;d++){var p=u[d];l[d]=f?o&&o.once?gb(i):i:l[d]||i;for(var v=0;v<s.length;v++)p[h]?p["on"+s[v]]=f?l[d]:null:p[h](s[v],l[d],o)}return c.bind(null,!f)})(t)}}function Cn(t,e){if(Rt(t))return e?Cn(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=Pw(t);return e?i.map(function(o){return Rt(o)?Cn(o,!0):o}).flat():i}function gb(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var os=mb(uc);function bv(t,e){return Ce&&ze(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),ze(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 Sv=typeof window>"u",rh="hidden";function yb(t){if(Sv)return!1;var e=wb(),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 wb(){var t=["webkit","moz","ms","o"];return Sv||rh in document?rh:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var bb=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Sb(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=yb(function(s){s||r({type:"tabVisible"})});return n=[o].concat(bb.map(function(s){return os(document,s,r)})).concat(os(window,"load",r)).concat(os(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Ib(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function p(g){d(),i&&!c&&i(Mr(h),g),a&&c&&(c=!1,a(Mr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Mr(h),g))},s)}var v=Sb(p,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=v();return function(){return f=!1,h=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Mr(h,f),idle:c?Mr(r,f):0}}}}function Mr(t,e){return e?0:Math.round((new Date-t)/1e3)}const nh=5e3;class Pb{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),Ib({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:nh}),pb({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*nh: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 Iv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Eb(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}const ah="sesamy_session_id";function kb(){let t=sessionStorage.getItem(ah);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ah,t)),t}let Pv=!1,bn,An,Es;function Ev(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:Es,requestId:Math.random().toString(36).slice(2,9),sessionId:kb(),timestamp:new Date().toISOString(),version:nn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:Kt("sesamy:item-src"),publisherContentId:Kt("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:ec,userAgent:navigator.userAgent,clientId:Es}}}))}const kv=Eb(async t=>{if(t.length>0){const e=Ev(t);Pv?navigator.sendBeacon(An,e):(await fetch(An,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function ss(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(An,Ev([e]))}else kv.push(t)}function Tb(){return Pv=!0,kv.flush()}function _b(t,e,r){bn=e,An=`${tt("logs",r)}/events`,Es=t}const Rb={name:"custom-analytics-plugin",page:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ss({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;ss({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n}=t;ss({anonymousId:r,userId:n,properties:e,type:"identify"})}},ih=["source","medium","campaign","term","content"],Tt="utm_",Ob=1800*1e3;function Tv(t){return t?Date.now()-parseInt(t,10)>Ob:!0}function oh(){const t=document.referrer||"";if(!t)return;const e=Vt(`${Tt}set_at`);(Tv(e)||!Vt(`${Tt}referrer`))&&On(`${Tt}referrer`,t)}function Cb(){const t=()=>{const r={};for(const a of ih){const i=Vt(`${Tt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Vt(`${Tt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){oh()},campaign({payload:r}){const n=r?.campaign||{},a=Vt(`${Tt}set_at`);if(Object.keys(n).length>0&&Tv(a)){for(const o of ih){const s=n[o];s&&On(`${Tt}${o}`,s)}On(`${Tt}set_at`,String(Date.now()))}oh()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const Ab=Cb(),sh=new Map,ch=new Map;function Ub({clientId:t,enabled:e=!0,environment:r}){_b(t,e,r),e&&(window.addEventListener("beforeunload",()=>{ch.forEach((n,a)=>{n.bind(a)()}),Tb()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&sh.forEach((n,a)=>{n.bind(a)()})}),hb(),Iv(()=>{const n=new Pb({element:document.body,viewCallback:()=>{dt.page()},activeDurationCallback:(a,i,o)=>{dt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{dt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{dt.track("scroll",{scroll:a.scrollMax})}});ch.set(document.body,()=>{n.flush()}),sh.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(Be.AUTHENTICATED,async n=>{const a=n;await dt.identify(a.detail.sub)}),window.addEventListener(Be.LOGOUT,async()=>{await dt.track("logout",{}),await dt.reset()}))}const dt=ub({app:ec,version:nn,plugins:[Ab,Rb]});function _v(t,e){dt.track(t,e)}const $b=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function Rv(){return new Promise(t=>{const e=$b.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 Ov(){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}}function Lb(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});_v(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function qb(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}const xb=["sesamy","__sesamy","__anon_id","auth0","a0","_legacy_auth0"],Nb=["access_token","id_token","refresh_token","token"];function ks(t){const e=t.split(".");return e.length===3?`${e[0]}.${e[1]}.[REDACTED]`:t}function Cv(t){const e=t.toLowerCase();return Nb.some(r=>e.includes(r))}function Av(t){const e=t.split(".");return e.length===3&&e.every(r=>r.length>0)}function uh(t){const e=[];for(let r=0;r<t.length;r++){const n=t.key(r);if(!n)continue;if(xb.some(i=>n.toLowerCase().startsWith(i.toLowerCase()))){let i=t.getItem(n)||"",o=!1;(Cv(n)||Av(i))&&(i=ks(i),o=!0);try{const s=JSON.parse(i);if(typeof s=="object"&&s!==null){const u=Ts(s);u.wasRedacted&&(i=JSON.stringify(u.value),o=!0)}}catch{}e.push({key:n,value:i,redacted:o})}}return e}function Ts(t){if(t==null)return{value:t,wasRedacted:!1};if(typeof t=="string")return Av(t)?{value:ks(t),wasRedacted:!0}:{value:t,wasRedacted:!1};if(Array.isArray(t)){let e=!1;return{value:t.map(n=>{const a=Ts(n);return a.wasRedacted&&(e=!0),a.value}),wasRedacted:e}}if(typeof t=="object"){let e=!1;const r={};for(const[n,a]of Object.entries(t))if(Cv(n)&&typeof a=="string")r[n]=ks(a),e=!0;else{const i=Ts(a);i.wasRedacted&&(e=!0),r[n]=i.value}return{value:r,wasRedacted:e}}return{value:t,wasRedacted:!1}}function jb(){const t=navigator;return{userAgent:t.userAgent,platform:t.platform,language:t.language,languages:[...t.languages||[]],cookiesEnabled:t.cookieEnabled,onLine:t.onLine,hardwareConcurrency:t.hardwareConcurrency,deviceMemory:t.deviceMemory,maxTouchPoints:t.maxTouchPoints,vendor:t.vendor,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,screenWidth:screen.width,screenHeight:screen.height,pixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}async function Db(){await Cp();const[t]=await Promise.all([Rv()]),e=Ov();return{adBlockEnabled:t,incognitoMode:Gn()??!1,inAppBrowser:e.isInAppBrowser}}async function Uv(t){const e=[],r={timestamp:new Date().toISOString(),sdkVersion:nn,clientId:t.clientId,fallbackId:t.fallbackId};r.pageUrl=window.location.href,r.pageTitle=document.title;try{r.browser=jb()}catch(a){e.push(`Browser info collection failed: ${a.message}`)}try{r.detection=await Db()}catch(a){e.push(`Detection collection failed: ${a.message}`)}try{r.localStorage=uh(localStorage)}catch(a){e.push(`LocalStorage collection failed: ${a.message}`)}try{r.sessionStorage=uh(sessionStorage)}catch(a){e.push(`SessionStorage collection failed: ${a.message}`)}if(await zt()){try{const a=await Pt(!1);if(a){const i=a.split(".");if(i.length>=2){const o=JSON.parse(atob(i[1]));r.userId=o.sub}}}catch(a){e.push(`User ID extraction failed: ${a.message}`)}if(t.getProfile)try{r.profile=await t.getProfile()||void 0}catch(a){e.push(`Profile collection failed: ${a.message}`)}if(t.getEntitlements)try{r.entitlements=await t.getEntitlements()}catch(a){e.push(`Entitlements collection failed: ${a.message}`)}if(t.getContracts)try{r.contracts=await t.getContracts()}catch(a){e.push(`Contracts collection failed: ${a.message}`)}if(t.getTags)try{r.tags=await t.getTags()}catch(a){e.push(`Tags collection failed: ${a.message}`)}if(t.getTallies)try{r.tallies=await t.getTallies()}catch(a){e.push(`Tallies collection failed: ${a.message}`)}}return e.length>0&&(r.errors=e),r}async function Mb(t,e){const n=`${tt("api2",e)}/diagnostics`,a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok){const i=await a.text();throw new Error(`Failed to submit diagnostics: ${i}`)}return a.json()}const lh="user-diagnostics",fh="diagnostics-id",Fb=`
34
+ **/var hs={d:(t,e)=>{for(var r in e)hs.o(e,r)&&!hs.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Ws={};hs.d(Ws,{A:()=>Gg,k:()=>Vs});var xr=function(t,e,r,n){return new(r||(r=Promise))(function(a,i){function o(l){try{u(n.next(l))}catch(c){i(c)}}function s(l){try{u(n.throw(l))}catch(c){i(c)}}function u(l){var c;l.done?a(l.value):(c=l.value,c instanceof r?c:new r(function(f){f(c)})).then(o,s)}u((n=n.apply(t,[])).next())})},Nr=function(t,e){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(u){return function(l){return(function(c){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&c[0]?n.return:c[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,c[1])).done)return a;switch(n=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,n=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){o.label=c[1];break}if(c[0]===6&&o.label<a[1]){o.label=a[1],a=c;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(c);break}a[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(f){c=[6,f],n=0}finally{r=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}})([u,l])}}};function Vs(){return xr(this,void 0,Promise,function(){return Nr(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(p){h=p.message.length}return h}function s(){return xr(this,void 0,void 0,function(){var h,d;return Nr(this,function(p){switch(p.label){case 0:return p.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return p.sent(),i(!1),[3,3];case 2:return h=p.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return xr(this,void 0,Promise,function(){return Nr(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 p=String(Math.random());try{var v=indexedDB.open(p,1);v.onupgradeneeded=function(g){var P=g.target.result,w=function(y){i(y)};try{P.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{P.close(),indexedDB.deleteDatabase(p)}},v.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var p=window.openDatabase,v=window.localStorage;try{p(null,null,null,null)}catch{return void i(!0)}try{v.setItem("test","1"),v.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 p=Math.round(d/1048576),v=2*Math.round((function(){var g,P,w,y=window;return(w=(P=(g=y?.performance)===null||g===void 0?void 0:g.memory)===null||P===void 0?void 0:P.jsHeapSizeLimit)!==null&&w!==void 0?w:1073741824})()/1048576);i(p<v)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return xr(this,void 0,Promise,function(){var d,p,v;return Nr(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(),p=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(p.includes("Security error")),[2];case 4:return[3,6];case 5:(v=indexedDB.open("inPrivate")).onerror=function(P){v.error&&v.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},v.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return xr(this,void 0,Promise,function(){return Nr(this,function(h){switch(h.label){case 0:return o()!==44&&o()!==43?[3,2]:(n="Safari",[4,u()]);case 1:return h.sent(),[3,6];case 2:return o()!==51?[3,3]:(d=navigator.userAgent,n=d.match(/Chrome/)?navigator.brave!==void 0?"Brave":d.match(/Edg/)?"Edge":d.match(/OPR/)?"Opera":"Chrome":"Chromium",c(),[3,6]);case 3:return o()!==25?[3,5]:(n="Firefox",[4,f()]);case 4:return h.sent(),[3,6];case 5:navigator.msSaveBlob!==void 0?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),h.label=6;case 6:return[2]}var d})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Vs);const Gg=Vs;Ws.A;const Wg=Ws.k,gn="sesamy_incognito_mode";function Gn(){try{const t=sessionStorage.getItem(gn);return t===null?void 0:t==="true"}catch{return}}async function Cp(){try{const t=sessionStorage.getItem(gn);if(t!==null)return t==="true";const{isPrivate:e}=await Wg();return sessionStorage.setItem(gn,e.toString()),e}catch{try{sessionStorage.setItem(gn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function Vg(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Jg(){return/android/i.test(navigator.userAgent)}let Oe,Ap,Gr,ps=!1,yn=!1;Vr()&&window.addEventListener("pageshow",()=>{yn=!1});const yr="sesamyAccessToken",Vo="sesamyRefreshToken",Pn="sesamySilentAuthThrottle",Zg=300*1e3;async function Wn(){return ps?!0:new Promise((t,e)=>{const r=setTimeout(()=>{ps?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(He.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function Yg(t){if(!t)return null;const e=localStorage.getItem(Vo);if(!e)return oe("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(Vo),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(Vo,i.refresh_token),localStorage.setItem(yr,i.access_token),i.access_token}catch{Ys()}}async function Js(){const t=localStorage.getItem(yr);if(!t)return null;const e=Xs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await Yg(e);if(r)return r;localStorage.removeItem(yr)}return t}let un=null;const Xg=64;function Qg(){try{if(un!==null)return un;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===Xg)return un=!0,!0}}catch(t){oe(`Error checking for existing auth0 tokens: ${t.message}`)}return un=!1,!1}function ey(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 oe(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;oe(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return oe(`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 ty(t){if(t.enabled===!1)return;Ap=t.organization;const e=ey(t);Gr=e&&!Qg()?e:Op("token",t.environment);const r={domain:Gr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",wr(window.location.href)!==wr(`https://${Gr}`)&&(r.useRefreshTokens=!0),oe(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Kg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)oe("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{oe("Code found in URL, handling redirect");const o=window.location.href,s=new URL(location.href),u=s.searchParams;u.delete("code"),u.delete("state"),s.search=u.toString(),window.history.replaceState({},document.title,s.toString()),oe("Rewrote url to remove code and state");try{const l=await Oe.handleRedirectCallback(o);oe(`Login result: ${JSON.stringify(l)}`);const c=await Oe.getUser();if(!c)throw oe("No user found"),new Error("No user found");oe(`User found ${JSON.stringify(c)}`),Zs(),oe(`Triggering AUTHENTICATED event with appState: ${JSON.stringify(l.appState)}`),Jt(He.AUTHENTICATED,{...c,appState:l.appState})}catch(l){alert("There was an error logging in"),console.error(l)}}ps=!0,Jt(He.AUTH_INITIALIZED,{})}async function Rt(){return await Wn(),await Js()?!0:Oe?Oe.isAuthenticated():!1}async function ry(){return await Wn(),await Js()?(oe("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function Up(t){if(yn)return oe("Login already in progress"),null;if(yn=!0,setTimeout(()=>{yn=!1},3e3),localStorage.removeItem(yr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:Ap,redirect_uri:window.location.href,ui_locales:Hr(),incognito:Gn(),...e}}}async function Vn(t){const e=Up(t);if(e)return Oe.loginWithRedirect(e)}async function $p(t){const e=Up(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),Zs();const r=await Oe.getUser();if(!r)throw oe("No user found after popup login"),new Error("No user found");const n=new CustomEvent(He.AUTHENTICATED,{detail:{...r,appState:t?.appState},composed:!0,bubbles:!0});window.dispatchEvent(n)&&window.location.reload()}async function ny(t){return Gr&&wr(window.location.href)!==wr(`https://${Gr}`)&&(Vg()||Jg()||Gn())?$p(t):Vn(t)}function ay(){try{const t=sessionStorage.getItem(Pn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<Zg}catch{return sessionStorage.removeItem(Pn),!1}}function iy(){try{const t={timestamp:Date.now()};sessionStorage.setItem(Pn,JSON.stringify(t))}catch{oe("Failed to set silent auth throttle in sessionStorage")}}function Zs(){try{sessionStorage.removeItem(Pn)}catch{}}async function ht(t=!0,e=!1){await Wn();const r=await Js();if(r)return r;if(!e&&ay()){if(oe("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return oe("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=Xs(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),Zs(),n}catch(n){const a=n;if(oe(`Failed to get token silently: ${a.message}`),iy(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await Ys(),t)throw n;return null}}async function Ys(t={}){if(await Wn(),localStorage.removeItem(yr),Jt(He.LOGOUT,{}),!!Oe)return oe(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function Xs(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 vs(t){const e=Xs(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");oe("Set token"),localStorage.setItem(yr,t),Jt(He.AUTHENTICATED,{...e,appState:void 0})}const oy=(t,e)=>e.skipDedupe||e.method!=="GET",sy=(t,e)=>e.method+"@"+t,cy=t=>t.clone(),uy=({skip:t=oy,key:e=sy,resolver:r=cy}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},ly=(t,e)=>t*e,fy=t=>t&&t.ok,dy=({delayTimer:t=500,delayRamp:e=ly,maxAttempts:r=10,until:n=fy,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,p)=>Promise.resolve(n(d,p)).then(v=>v?d&&o?d:p?Promise.reject(p):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:p,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};let Jo=class Lp extends Error{status;statusText;url;body;constructor(e,r,n,a,i){super(a),this.name="APIError",this.status=e,this.statusText=r,this.url=n,this.body=i,Error.captureStackTrace&&Error.captureStackTrace(this,Lp)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}};var En=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(En||{});const hy="application/json",qp="Content-Type",cr=Symbol(),xp=Symbol();function Sd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===qp.toLowerCase()))===null||e===void 0?void 0:e[1]}function Id(t){return/^application\/.*json.*/.test(t)}const Bt=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]=Bt(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 py(t,e=!1){br.options=e?t:Bt(br.options,t)}function vy(t,e=!1){br.polyfills=e?t:Bt(br.polyfills,t)}function my(t){br.errorType=t}const gy=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;let Np=class extends Error{};const yy=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:u}=t,l=new Map(i),c=Bt(a.options,n);let f=r;const h=gy(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,p=h.catch(y=>{throw{[cr]:y}}).then(y=>{var m;if(!y.ok){const b=new Np;if(b.cause=d,b.stack=b.stack+`
35
+ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const R=a.errorType==="json"||((m=y.headers.get("Content-Type"))===null||m===void 0?void 0:m.split(";")[0])==="application/json";return(a.errorType?R?y.text():y[a.errorType]():Promise.resolve(y.body)).then(A=>{if(b.message=typeof A=="string"?A:y.statusText,A)if(R&&typeof A=="string"){b.text=A;try{b.json=JSON.parse(A)}catch{}}else b[a.errorType]=A;throw b})}return y}),v=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,cr),R=b?m[cr]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(cr)&&l.get(cr);if(A)return A(R,t);const x=l.get(xp);if(x)return x(R,t);throw R}),g=y=>m=>v(y?p.then(b=>b&&b[y]()).then(b=>m?m(b):b):p.then(b=>m?m(b):b)),P={_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(cr,y)}},w=u.reduce((y,m)=>({...y,...typeof m.resolver=="function"?m.resolver(y):m.resolver}),P);return o.reduce((y,m)=>m(y,t),w)},wy={_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:Bt(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:Bt(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:Bt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[qp]: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(xp,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=Sd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Id(a));return n=r?o?n.json(r,a):n.body(r):n,yy(n._deferred.reduce((s,u)=>u(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=Sd(this._options.headers);return this.content(e||Id(r)&&r||hy).body(JSON.stringify(t))}};function ct(t="",e={}){return{...wy,_url:t,_options:e}}ct.default=ct;ct.options=py;ct.errorType=my;ct.polyfills=vy;ct.WretchError=Np;const by=(t,e)=>e.skipDedupe||e.method!=="GET",Sy=(t,e)=>e.method+"@"+t,Iy=t=>t.clone(),Py=({skip:t=by,key:e=Sy,resolver:r=Iy}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((u,l)=>{n.get(s).push([u,l])});try{return a(i,o).then(u=>(n.get(s).forEach(([l])=>l(r(u))),n.delete(s),u)).catch(u=>{throw n.get(s).forEach(([,l])=>l(u)),n.delete(s),u})}catch(u){return n.delete(s),Promise.reject(u)}}},Ey=(t,e)=>e.skipCache||e.method!=="GET",ky=(t,e)=>e.method+"@"+t,Ty=()=>!1,_y=()=>null,Ry=t=>t.ok,Oy=({throttle:t=1e3,skip:e=Ey,key:r=ky,clear:n=Ty,invalidate:a=_y,condition:i=Ry,flagResponseOnCacheHit:o="__cached"}={})=>{const s=new Map,u=new Map,l=new Set,c=h=>{t&&!l.has(h)&&(l.add(h),setTimeout(()=>{l.delete(h)},t))},f=h=>(d,p)=>{const v=r(d,p);let g=a(d,p);if(g&&(g instanceof Array||(g=[g]),g.forEach(P=>{typeof P=="string"?s.delete(P):P instanceof RegExp&&s.forEach((w,y)=>{P.test(y)&&s.delete(y)})})),n(d,p)&&s.clear(),e(d,p))return h(d,p);if(l.has(v)){if(s.has(v)){const P=s.get(v).clone();return o&&Object.defineProperty(P,o,{value:v,enumerable:!1}),Promise.resolve(P)}else if(u.has(v))return new Promise((P,w)=>{u.get(v).push([P,w])})}return u.has(v)||u.set(v,[]),c(v),h(d,p).then(P=>(i(P.clone())&&s.set(v,P.clone()),u.get(v).forEach(([w])=>w(P.clone())),u.delete(v),P)).catch(P=>{throw u.get(v).forEach(([,w])=>w(P)),u.delete(v),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Cy=(t,e)=>t*e,Ay=t=>t&&t.ok,Uy=({delayTimer:t=500,delayRamp:e=Cy,maxAttempts:r=10,until:n=Ay,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,p)=>Promise.resolve(n(d,p)).then(v=>v?d&&o?d:p?Promise.reject(p):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:p,url:l,options:c})).then((w={})=>{var y,m;g(u((y=w&&w.url)!==null&&y!==void 0?y:l,(m=w&&w.options)!==null&&m!==void 0?m:c))}):g(u(l,c))},P)}).then(h).catch(g=>{if(!i)throw g;return h(null,g)}):d&&o?d:Promise.reject(p||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},$y="@sesamy/sdk",Ly="1.22.0";let qy=class{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 Fr="sesamyCacheTimestamp",xy=t=>{const{libraryName:e=$y,libraryVersion:r=Ly,cache:n}=t,a=n?.storage||new qy,i=[s=>async(u,l)=>{if(n?.mode===En.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Fr),c||(c=Date.now().toString(),sessionStorage.setItem(Fr,c))):(c=a.get(Fr),c||(c=Date.now().toString(),a.set(Fr,c)));const f={...l,headers:{...l.headers,"Cache-Timestamp":c}};return s(u,f)}return s(u,l)},s=>async(u,l)=>{const c=await t.tokenProvider(),f={...l,headers:{...l.headers,Authorization:c}};return s(u,f)},Py()];n?.mode===En.NORMAL&&i.push(Oy({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Uy({delayTimer:1e3,delayRamp:(s,u)=>s*u,maxAttempts:3,until:s=>!!(s&&(s.ok||s.status>=400&&s.status<500)),retryOnNetworkError:!1}));const o=ct(t.baseUrl).headers({"Content-Type":"application/json","X-Sesamy-Client":`${e}/${r}`,...t.headers}).middlewares(i);return{async request(s,u={}){try{const l=/^https?:\/\//.test(s);let c=o.url(s,l);u.headers&&(c=c.headers(u.headers));const f=(u.method||"GET").toLowerCase();let h;switch(f){case"get":h=c.get();break;case"post":h=c.post(u.body);break;case"put":h=c.put(u.body);break;case"patch":h=c.patch(u.body);break;case"delete":h=c.delete();break;default:h=c.get()}const d=await h.res();if(d.ok&&["post","patch","put","delete"].includes(f)&&vt(),d.status===204)return null;if(!d.ok){const p=await d.text().catch(()=>"Unknown error");throw new Jo(d.status,d.statusText,d.url,`API Error ${d.status}: ${p}`,p)}return await d.json()}catch(l){if(l instanceof Jo)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Jo(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},vt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Fr),"Cache cleared"),jr={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"})}},Zo={list:async(t,e)=>{const r=new URLSearchParams;e?.type&&r.append("type",e.type),e?.sku&&r.append("sku",e.sku),e?.purchaseOptionId&&r.append("purchase-option-id",e.purchaseOptionId),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`)},Pd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Ed={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Ny=(t,e)=>{if(!t||!e)return t;const r=new URL(t);return r.hash=`access_token=${e}`,r.toString()},kd=(t,e)=>!t.manageUrl||!e?t:{...t,manageUrl:Ny(t.manageUrl,e)},Dr={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"})},Yo={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:r})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},ur={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)}),delete:async(t,e)=>{try{return await t.request(`/tallies/${e}`,{method:"DELETE"}),!0}catch{return!1}},push:async(t,e,r)=>t.request(`/tallies/${e}/push`,{method:"POST",body:JSON.stringify(r)})},Xo={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"})}},lr={generateCheckoutLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},generateAccountLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}${e.contractId?`/${encodeURIComponent(e.contractId)}`:""}`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePaymentLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/change-payment-method`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateChangePlanLink:(t,e)=>{const r=e.language||"en",n=new URL(`${t.baseUrl}/account/${encodeURIComponent(r)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.contractId)}/edit-plan`);return n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()},generateConsumeLink:(t,e)=>{const r=e.language||"en";let n=new URL(`${t.baseUrl}/consume/${encodeURIComponent(r)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(e.sku)}`);return e.episodeId?n.href+=`/${encodeURIComponent(e.episodeId)}`:n.href+="/listen",n.searchParams.set("sesamy-redirect-url",e.redirectUrl||"/"),n.toString()}},Qo={generateLink:(t,e)=>{const r=new URL(`${t.apiUrl}/checkouts`);return e.items&&r.searchParams.set("items",JSON.stringify(e.items)),e.email&&r.searchParams.set("email",e.email),e.language&&r.searchParams.set("lang",e.language),e.redirectUrl&&r.searchParams.set("redirect-url",e.redirectUrl),e.giftMode&&r.searchParams.set("gift-mode","true"),e.payerEmail&&r.searchParams.set("payer-email",e.payerEmail),e.requireAddress&&r.searchParams.set("require-address","true"),e.metadata&&Object.entries(e.metadata).forEach(([n,a])=>{r.searchParams.set(`metadata.${n}`,a)}),r.toString()},create:async(t,e)=>t.request("/checkouts",{method:"POST",body:JSON.stringify(e)}),get:async(t,e)=>t.request(`/checkouts/${e}`),update:async(t,e,r)=>t.request(`/checkouts/${e}`,{method:"PATCH",body:JSON.stringify(r)})},Td={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},_d={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},jy={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},Dy={list:async t=>t.request("/payment-issues")},My={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)}},Fy={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},Rd={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},Ky=t=>{const e=xy(t);return{profile:{get:r=>jr.get(e,r),update:(r,n)=>jr.update(e,r,n),checkSpotifyLink:()=>jr.checkSpotifyLink(e),unlinkSpotify:()=>jr.unlinkSpotify(e),delete:()=>jr.delete(e)},entitlements:{list:r=>Zo.list(e,r),get:r=>Zo.get(e,r),getAccess:r=>Zo.getAccess(e,r)},subscriptions:{list:()=>Pd.list(e),get:r=>Pd.get(e,r)},products:{get:r=>Ed.get(e,r),autoOnboard:r=>Ed.autoOnboard(e,r)},contracts:{list:async()=>{const r=await Dr.list(e),n=await t.tokenProvider();if(!n.toLowerCase().startsWith("bearer "))return r;const a=n.substring(7);return r.map(i=>kd(i,a))},get:async r=>{const n=await Dr.get(e,r),a=await t.tokenProvider();if(!a.toLowerCase().startsWith("bearer "))return n;const i=a.substring(7);return kd(n,i)},cancel:r=>Dr.cancel(e,r),createAmendment:(r,n)=>Dr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Dr.confirmAmendment(e,r,n)},userMetadata:{get:()=>Yo.get(e),set:(r,n)=>Yo.set(e,r,n),delete:r=>Yo.delete(e,r)},tallies:{list:()=>ur.list(e),get:r=>ur.get(e,r),update:(r,n)=>ur.update(e,r,n),create:r=>ur.create(e,r),delete:r=>ur.delete(e,r),push:(r,n)=>ur.push(e,r,n)},tags:{list:()=>Xo.list(e),add:r=>Xo.add(e,r),remove:r=>Xo.remove(e,r)},checkouts:{generateLink:(r,n)=>lr.generateCheckoutLink(r,n),create:r=>Qo.create(e,r),get:r=>Qo.get(e,r),update:(r,n)=>Qo.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>lr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>lr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>lr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>lr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>lr.generateConsumeLink(r,n)},bills:{list:()=>Td.list(e),get:r=>Td.get(e,r)},fulfillments:{list:()=>_d.list(e),create:r=>_d.create(e,r)},paywalls:{get:r=>jy.get(e,r)},paymentIssues:{list:()=>Dy.list(e)},proxy:{content:(r,n,a,i)=>My.content(e,r,n,a,i)},transactions:{list:r=>Fy.list(e,r)},vendor:{get:()=>Rd.get(e),list:()=>Rd.list(e)}}};class zy{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 ms(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function jp(t,e){if(ms(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 Od(t){return t.endsWith("/")?t.slice(0,-1):t}function Cd(t,e){if(!ms(t)||!ms(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&Od(r.pathname)===Od(n.pathname)}function By(t,e,r){const n=new URL(`${tt("checkout3",t.environment)}`);e.language&&n.searchParams.set("lang",e.language);let a=e.sku,i=e.purchaseOptionId,o=e.itemSrc;if(e.itemSrc){const c=jp(e.itemSrc,e.purchaseOptionId);a=c.sku||a,i=c.purchaseOption||i,o=c.itemSrc}a?(n.searchParams.set("sku",a),i&&n.searchParams.set("po-id",i)):o&&n.searchParams.set("url",o),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 s=["_ga","_gid","_fbp","_fbc"];document.cookie.split(";").map(c=>{const[f,h]=c.trim().split("=");return{key:f,value:h}}).filter(c=>s.some(f=>f===c.key)).forEach(c=>{n.searchParams.append(c.key,c.value)});let l=new URL(window.location.href);if(e.redirectUrl)try{l=new URL(e.redirectUrl)}catch{console.warn("Invalid redirect URL provided, using current URL instead:",e.redirectUrl)}return l.searchParams.set("force-refetch-entitlements","true"),e.itemSrc&&l.searchParams.set("sesamy-purchase",e.itemSrc),n.searchParams.set("redirect-url",l.toString()),e.paymentMethodsFilter&&n.searchParams.set("paymentmethods-filter",e.paymentMethodsFilter.flatMap(({provider:c,methods:f})=>f?f.map(h=>`${c}|${h}`):c).join(",")),e.requireAddress&&n.searchParams.set("require-address","true"),e.giftMode&&n.searchParams.set("gift-mode","true"),e.payerEmail&&n.searchParams.set("payer-email",e.payerEmail),e.metadata&&Object.entries(e.metadata).forEach(([c,f])=>{n.searchParams.set(`metadata.${c}`,String(f))}),n}const Dp="sesamySignedURLs";function Qs(){const t=sessionStorage.getItem(Dp);return t?JSON.parse(t):[]}function Hy(t){const e=Qs();e.push(t),oe(`Adding signed URL: ${t}`),sessionStorage.setItem(Dp,JSON.stringify(e))}function Gy(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const gs="sesamyAttribution";function Wy(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 Vy(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function kn(){return Wy(gs)||{}}function Mp(t){if(t===null)localStorage.removeItem(gs);else{oe(`Setting attribution ${JSON.stringify(t)}`);const e=kn()??{},r=Gy({...e,...Vy(t)});localStorage.setItem(gs,JSON.stringify({value:r}))}}const ec="@sesamy/sesamy-js",nn="1.80.0",Fp="sesamyFlags";async function Kp(t){try{localStorage.setItem(Fp,JSON.stringify(t))}catch{oe("Failed to save flags to localStorage")}}async function zp(t,e){const r=await an();r[t]=e,await Kp(r)}async function Bp(t){return(await an())[t]}async function Hp(t){const e=await an();t in e&&(delete e[t],await Kp(e))}async function an(){try{const t=localStorage.getItem(Fp);return t?JSON.parse(t):{}}catch{return{}}}function Gp(t){function e(n){return n.id?`#${n.id}`:n.classList.length>0?Array.from(n.classList).map(i=>`.${i}`).join(""):null}function r(n){const a=[];let i=n;for(;i&&i!==document.body&&i!==document.documentElement;){const o=e(i);if(o){a.unshift(o);break}if(i.parentElement){const s=Array.from(i.parentElement.children),u=s.indexOf(i)+1,l=i.tagName.toLowerCase();s.filter(f=>f.tagName.toLowerCase()===l).length>1?a.unshift(`${l}:nth-child(${u})`):a.unshift(l)}i=i.parentElement}return a.join(" > ")}return r(t)}function Jy(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}function Zy(t){return t.replace(/([A-Z])/g,"-$1").toLowerCase()}let Fe={article:{selector:"sesamy-article"},image:{selector:"img",attribute:"src"},title:{selector:"h1",attribute:"textContent"},excerpt:{selector:"p",attribute:"textContent"},price:{selector:"sesamy-article",attribute:"price"},currency:{selector:"sesamy-article",attribute:"currency"},url:{selector:"sesamy-article",attribute:"item-src"},accessLevel:{selector:"sesamy-article",attribute:"access-level"},id:{selector:"sesamy-article",attribute:"publisher-content-id"},pass:{selector:"sesamy-article",attribute:"pass"},paywallUrl:{selector:"sesamy-article",attribute:"paywall-url"}},Wp=[],Vp=!1,_t;function tc(){const t=window.location.pathname,e=new URLSearchParams(window.location.search),r=navigator.userAgent;return Wp.find(n=>{if(n.path&&!t.includes(n.path)||n.queryParam&&e.get(n.queryParam.key)!==n.queryParam.value)return!1;if(n.headers){const a=n.headers.name.toLowerCase(),i=n.headers.contains.toLowerCase();if(a==="user-agent"){if(!r.toLowerCase().includes(i))return!1}else return!1}return!(n.userAgentContains&&!r.includes(n.userAgentContains))})}function Yy(){return tc()}function Xy(t,e){Wp=t.content||[];const r=tc();r&&r.type==="article"&&(Fe={...Fe,...Jy(r.selectors)},Vp=r.enablePaywallSettingsUrlFallback||!1),_t=e}function Qy(t,e){const{selector:r,attribute:n}=e;return r===Fe.article.selector||n&&t.hasAttribute(n)?t:t.querySelector(r)}function Jp(t,e,r=!1){if(t){if(e.attribute){if(e.attribute==="textContent")return t.textContent??void 0;const n=t.getAttribute(e.attribute),a=Jp(t.parentElement,e,r);if(r){const i=[];return n&&i.push(...n.split(",").map(o=>o.trim()).filter(Boolean)),a&&i.push(...a.split(",").map(o=>o.trim()).filter(Boolean)),i.length>0?[...new Set(i)].join(","):void 0}return n??a}return t.textContent??void 0}}function zt(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 rc({publisherContentId:t,key:e,defaultValue:r=""}){const n=t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null,a=e.replace(/-([a-z])/g,(i,o)=>o.toUpperCase());return n?.getAttribute(e)||zt(`sesamy:${e}`)||zt(`sesamy:${a}`)||zt(`og:${e}`)||zt(e)||r}function Zp(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(on).filter(e=>e!==null)}function on(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Gp(e)},n=(i,o,s,u)=>{const{transform:l,collect:c=!1}=u||{},f=Qy(e,o),h=Jp(f,o,c),d=rc({publisherContentId:s,key:Zy(String(i))}),p=h||d||void 0;p&&(r[i]=l?l(p):p)};n("id",Fe.id),n("title",Fe.title,r.id),n("excerpt",Fe.excerpt,r.id),n("image",Fe.image,r.id),n("price",Fe.price,r.id,{transform:i=>{const o=parseFloat(i);return Number.isNaN(o)?void 0:o}}),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id,{collect:!0}),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,{transform:i=>i||"entitlement"});const a=tc();if(a&&a.type==="article"&&(a.pass&&(r.pass=r.pass?`${r.pass},${a.pass}`:a.pass),a.price&&!r.price&&(r.price=a.price.amount),a.price?.currency&&!r.currency&&(r.currency=a.price.currency),a.paywallUrl&&!r.paywallUrl&&(r.paywallUrl=a.paywallUrl)),Vp&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r.url||(r.url=window.location.href),r}async function ew(t){const e=on(t);if(!e)throw new Error("Could not find article element");if(e.accessLevel==="public")return!0;if(e.accessLevel==="logged-in"&&!e.paywallUrl)return await _t.auth.isAuthenticated()?!0:null;if(e.paywallUrl&&((await _t.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement")==="logged-in")return await _t.auth.isAuthenticated()?!0:null;if(!e.url)throw new Error("Article must have a URL");return await _t.entitlements.hasAccess(e.url,e.pass?.split(",")||[])||null}async function Yp(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=on(r);if(!n?.url)throw new Error("Could not find content for element");const a=await _t.entitlements.hasAccess(n.url,n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await _t.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Gp(r.parentElement||r);return _t.proxy.getContent(i.token,n.url,o)}function Xp(t,e={}){const{closeOnBackdropClick:r=!0,closeOnEscape:n=!0,zIndex:a=2147483647,backdropBlur:i="5px",overlayBackground:o="rgba(0,0,0,0.5)"}=e,s=document.createElement("div");s.setAttribute("data-sesamy-modal","true"),Object.assign(s.style,{position:"fixed",top:"0",left:"0",width:"100vw",height:"100vh",background:o,zIndex:String(a),display:"flex",alignItems:"center",justifyContent:"center",backdropFilter:`blur(${i})`});const u=document.createElement("div");u.setAttribute("data-sesamy-modal-content","true"),typeof t=="string"?u.innerHTML=t:u.appendChild(t),s.appendChild(u);const l=()=>{s.remove(),n&&document.removeEventListener("keydown",c)},c=f=>{f.key==="Escape"&&l()};return r&&s.addEventListener("click",f=>{f.target===s&&l()}),n&&document.addEventListener("keydown",c),document.body.appendChild(s),{element:s,close:l}}function tw(t,e={}){const{position:r="top",fixed:n=!0,zIndex:a=2147483647,autoDismissMs:i,pushContent:o=!1,height:s,transitionDuration:u="0.3s"}=e,l=document.createElement("div");l.setAttribute("data-sesamy-notification-bar","true"),l.setAttribute("data-sesamy-notification-position",r),Object.assign(l.style,{position:n?"fixed":"absolute",[r]:"0",left:"0",width:"100%",zIndex:String(a),boxSizing:"border-box",...s&&{height:s}}),typeof t=="string"?l.innerHTML=t:l.appendChild(t);let c,f,h;const d=()=>{if(h&&clearTimeout(h),o&&s){const p=document.documentElement;p.style.transform=c||"",setTimeout(()=>{l.remove(),p.style.transition=f||""},parseFloat(u)*1e3)}else l.remove()};if(i&&(h=setTimeout(d,i)),o&&s){const p=document.documentElement;c=p.style.transform,f=p.style.transition,p.style.transition=`transform ${u} ease`,l.style.transition=`transform ${u} ease`,r==="top"?(p.style.transform=`translateY(${s})`,l.style.transform=`translateY(-${s})`):(p.style.transform=`translateY(-${s})`,l.style.transform=`translateY(${s})`),document.documentElement.prepend(l)}else document.body.appendChild(l);return{element:l,close:d}}function rw(t){const e=t.endpoint||tt("api2",t.environment),n=Ky({baseUrl:e,tokenProvider:async()=>{if(await Rt())try{const q=await ht(!1);if(q)return`Bearer ${q}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:ec,libraryVersion:nn,vendorId:t.vendorId,cache:{mode:En.BROWSER,storage:new zy}}),a=S=>async(O,q)=>{let F=sessionStorage.getItem(wd);F||(F=Date.now().toString(),sessionStorage.setItem(wd,F));const I={...q,headers:{...q.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(q,F)=>{let I=null;if(I=await ht(S),!I){if(S)throw new Error("No access token available");return O(q,F)}const T={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(q,T)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),uy(),dy({delayTimer:1e3,delayRamp:(S,O)=>S*O,maxAttempts:3,until:S=>!!(S&&(S.ok||S.status>=400&&S.status<500)),retryOnNetworkError:!1})]);async function s(S={}){const{waitForEntitlementAfter:O,includeSignedLinks:q=!0}=S,F=await Rt()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return q&&F.push(...Qs()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:T,purchaseOption:j}=jp(S);if("sku"in I&&T===I.sku||j&&"purchaseOptionsId"in I&&j===I.purchaseOptionsId||Cd(S,I.url))return!0}return!!O.some(T=>Cd(T,I.url))})}async function l(S,O,q){const F=new URL(tt("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),q&&F.searchParams.set("selector",q),ct(F.toString()).headers({Authorization:`Bearer ${S}`}).get().text()}async function c(S){if(!S)throw new Error("SKU is required to get fulfillments");return await Rt()?await o.get(`/fulfillments?sku=${encodeURIComponent(S)}`).json():[]}async function f(S,O){if(!S||!O)throw new Error("SKU and itemId are required to request delivery");return(await o.post({sku:S},`/fulfillments/${encodeURIComponent(O)}/request-delivery?`).res()).ok}async function h(){return console.warn("getSubscriptions is deprecated, use getContracts instead"),o.get("/subscriptions").json()}async function d(S){return(await n.transactions.list())?.find(q=>q.id===S)}async function p(){return await o.url("/tags").get().json()}async function v(S){const O=await o.url(`/tags/${encodeURIComponent(S)}`).delete().res();return vt(),O.ok}async function g(S){const O=await o.url("/tags").post(encodeURIComponent(S)).res();return Jt(He.USER_ATTRIBUTE_CHANGED,{}),vt(),O.ok}async function P(S){return(await n.tallies.get(S)).value}async function w(){const S=await n.tallies.list(),O={};for(const q of S)O[q.id]=q.value;return O}async function y(S){return await n.tallies.delete(S)}async function m(S,O){return await n.tallies.push(S,O)}async function b(){return await ht(!1)?await o.url("/profile").get().json():null}async function R(S){const O=await o.url("/profile").patch(S).res();return vt(),O.ok}async function A(){return(await o.url("/profile/spotify-link").get().json()).isSpotifyLinked}async function x(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await ht(!1);if(!O)throw new Error("No access token available");const q=new URL(`${tt("access-sync",t.environment)}/spotify/sesamy-callback`);q.searchParams.set("access_token",O),q.searchParams.set("state",S),window.location.href=q.toString()}async function V(S){const O=await o.url(`/products/${encodeURIComponent(S)}/auto-onboard`).post().json();return O.length&&vt(),O}async function te(S,O=3600){const{shortlink:q}=await ct(Hg).post({url:S,ttl:O}).json();return q}async function L(S){const O=await ht(!1,!0);let q;const F=S.language||Hr(),I=kn();switch(S.target){case"account":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":q=new URL(`${tt("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":q=new URL(`${tt("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?q.href+=`/${S.episodeId}`:q.href+="/listen",q.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":q=By(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(q.hash=`#access_token=${O}`),S.shorten?te(q.href,S.ttl):q.href}async function M(){const S=await ht(!1),O=new URL(`${tt("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=kn(),q=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,T]=F.trim().split("=");q.includes(I)&&!O[I]&&(O[I]=T)}),n.checkouts.create({language:Hr(),...S,attribution:{...O,...S.attribution}})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Zp,get:on,getLanguage:Hr,unlock:Yp,getPropertyFromHTML:rc},contracts:n.contracts,deleteTag:v,deleteTally:y,entitlements:n.entitlements,flags:{get:Bp,set:zp,list:an,delete:Hp},generateLink:L,getProxyContent:l,getEntitlements:s,getFulfillments:c,requestDelivery:f,hasAccess:u,isSpotifyLinked:A,linkSpotify:z,openHostedAccountPage:M,paywalls:n.paywalls,paymentIssues:n.paymentIssues,getProfile:b,products:n.products,getSubscriptions:h,getTally:P,getTallies:w,getTags:p,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:x,updateProfile:R,vendor:n.vendor}}function Ad(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 nw="function",aw="string",rt="undefined",iw="boolean",Tn="object",ow="array",sw="number",cw="symbol",uw="null",ys=function(){},Qp="any",ev="*",Zt="__",lw="form",fw="input",dw="button",hw="select",_n=typeof process!==rt?process:{};_n.env&&_n.env.NODE_ENV;var Ce=typeof document!==rt;_n.versions!=null&&_n.versions.node!=null;typeof Deno!==rt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==rt&&typeof navigator.userAgent!==rt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function tv(t,e){return e.charAt(0)[t]()+e.slice(1)}var pw=tv.bind(null,"toUpperCase"),vw=tv.bind(null,"toLowerCase");function mw(t){return rv(t)?pw(uw):typeof t===Tn?bw(t):Object.prototype.toString.call(t).slice(8,-1)}function Rn(t,e){e===void 0&&(e=!0);var r=mw(t);return e?vw(r):r}function sn(t,e){return typeof e===t}var ze=sn.bind(null,nw),Ot=sn.bind(null,aw),hr=sn.bind(null,rt),gw=sn.bind(null,iw);sn.bind(null,cw);function rv(t){return t===null}function yw(t){return Rn(t)===sw&&!isNaN(t)}function nv(t){return Rn(t)===ow}function Ke(t){if(!ww(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function ww(t){return t&&(typeof t===Tn||t!==null)}function bw(t){return ze(t.constructor)?t.constructor.name:null}function Sw(t){return t instanceof Error||Ot(t.message)&&t.constructor&&yw(t.constructor.stackTraceLimit)}function av(t,e){if(typeof e!="object"||rv(e))return!1;if(e instanceof t)return!0;var r=Rn(new t(""));if(Sw(e))for(;e;){if(Rn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}av.bind(null,TypeError);av.bind(null,SyntaxError);function Jn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Iw(t,e):r}function Iw(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Zn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Zn(Jn,lw);Zn(Jn,dw);Zn(Jn,fw);Zn(Jn,hw);function Pw(t){return t?nv(t)?t:[t]:[]}function Ud(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Ew(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function kw(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Tw(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=Ud(r[1]),o=Ud(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(_w(n,l.map(function(c){return c.replace(/[?[\]\\ ]/g,"")}),n[u]),delete n[u])}return n})((function(e){return Ce&&window.location.search.substring(1)})())}function _w(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 Yn(){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 Rw(t,e){var r,n,a,i=null,o=0,s=function(){o=new Date,i=null,a=t.apply(r,n)};return function(){var u=new Date;o||(o=u);var l=e-(u-o);return r=this,n=arguments,l<=0?(clearTimeout(i),i=null,o=u,a=t.apply(r,n)):i||(i=setTimeout(s,l)),a}}var Ht="global",Sr=Zt+Ht+Zt,Ir=typeof self===Tn&&self.self===self&&self||typeof global===Tn&&global[Ht]===global&&global||void 0;function Yt(t){return Ir[Sr][t]}function Xt(t,e){return Ir[Sr][t]=e}function Or(t){delete Ir[Sr][t]}function Cr(t,e,r){var n;try{if(nc(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}Ir[Sr]||(Ir[Sr]={});var ln={};function nc(t){if(typeof ln[t]!==rt)return ln[t];try{var e=window[t];e.setItem(rt,rt),e.removeItem(rt)}catch{return ln[t]=!1}return ln[t]=!0}function ee(){return ee=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},ee.apply(null,arguments)}var kt="function",mt="undefined",Wr="reducer",iv="@@redux/",ws=iv+"INIT",Ow=iv+Math.random().toString(36),$d=(function(){return typeof Symbol===kt&&Symbol.observable||"@@observable"})(),fn=" != "+kt;function ov(t,e,r){var n;if(typeof e===kt&&typeof r===mt&&(r=e,e=void 0),typeof r!==mt){if(typeof r!==kt)throw new Error("enhancer"+fn);return r(ov)(t,e)}if(typeof t!==kt)throw new Error(Wr+fn);var a=t,i=e,o=[],s=o,u=!1;function l(){s===o&&(s=o.slice())}function c(){return i}function f(d){if(typeof d!==kt)throw new Error("Listener"+fn);var p=!0;return l(),s.push(d),function(){if(p){p=!1,l();var v=s.indexOf(d);s.splice(v,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===mt)throw new Error("ActType "+mt);if(u)throw new Error("Dispatch in "+Wr);try{u=!0,i=a(i,d)}finally{u=!1}for(var p=o=s,v=0;v<p.length;v++)(0,p[v])();return d}return h({type:ws}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==kt)throw new Error("next "+Wr+fn);a=d,h({type:ws})}})[$d]=function(){var d,p=f;return(d={subscribe:function(v){if(typeof v!="object")throw new TypeError("Observer != obj");function g(){v.next&&v.next(c())}return g(),{unsubscribe:p(g)}}})[$d]=function(){return this},d},n}function Cw(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Wr+" "+t+" returns "+mt}function Pr(){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 Aw(){var t=arguments;return function(e){return function(r,n,a){var i,o=e(r,n,a),s=o.dispatch,u={getState:o.getState,dispatch:function(l){return s(l)}};return i=[].slice.call(t).map(function(l){return l(u)}),ee({},o,{dispatch:s=Pr.apply(void 0,i)(o.dispatch)})}}}var Ct=Zt+"anon_id",Gt=Zt+"user_id",vr=Zt+"user_traits",bs="analytics",Et="userId",pr="anonymousId",wn=["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"],Ss=["name","EVENTS","config","loaded"],Q=wn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Ld=/^utm_/,qd=/^an_prop_/,xd=/^an_trait_/;function Uw(t){var e=t.storage.setItem;return function(r){return function(n){return function(a){if(a.type===Q.bootstrap){var i=a.params,o=a.user,s=a.persistedUser,u=a.initialUser,l=s.userId===o.userId;s.anonymousId!==o.anonymousId&&e(Ct,o.anonymousId),l||e(Gt,o.userId),u.traits&&e(vr,ee({},l&&s.traits?s.traits:{},u.traits));var c=Object.keys(a.params);if(c.length){var f=i.an_uid,h=i.an_event,d=c.reduce(function(p,v){if(v.match(Ld)||v.match(/^(d|g)clid/)){var g=v.replace(Ld,"");p.campaign[g==="campaign"?"name":g]=i[v]}return v.match(qd)&&(p.props[v.replace(qd,"")]=i[v]),v.match(xd)&&(p.traits[v.replace(xd,"")]=i[v]),p},{campaign:{},props:{},traits:{}});r.dispatch(ee({type:Q.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:Q.campaign,campaign:d.campaign})}}return n(a)}}}}function $w(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Ct)return ee({},e,{anonymousId:r.value});if(r.key===Gt)return ee({},e,{userId:r.value})}switch(r.type){case Q.identify:return Object.assign({},e,{userId:r.userId,traits:ee({},e.traits,r.traits)});case Q.reset:return[Gt,Ct,vr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Nd(t){return{userId:t.getItem(Gt),anonymousId:t.getItem(Ct),traits:t.getItem(vr)}}var Is=function(t){return Zt+"TEMP"+Zt+t};function Lw(t){var e=t.storage,r=e.setItem,n=e.removeItem,a=e.getItem;return function(i){return function(o){return function(s){var u=s.userId,l=s.traits,c=s.options;if(s.type===Q.reset&&([Gt,vr,Ct].forEach(function(d){n(d)}),[Et,pr,"traits"].forEach(function(d){Or(Is(d))})),s.type===Q.identify){a(Ct)||r(Ct,Yn());var f=a(Gt),h=a(vr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Gt,u),l&&r(vr,ee({},h,l))}return o(s)}}}}var Kr={};function jd(t,e){Kr[t]&&ze(Kr[t])&&(Kr[t](e),delete Kr[t])}function sv(t,e,r){return new Promise(function(n,a){return e()?n(t):r<1?a(ee({},t,{queue:!0})):new Promise(function(i){return setTimeout(i,10)}).then(function(i){return sv(t,e,r-10).then(n,a)})})}function qw(t){return{abort:t}}function cv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,p=h.payload.type,v=a[d][p];if(v&&ze(v)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Et,pr].reduce(function(R,A){return m.hasOwnProperty(A)&&b[A]&&b[A]!==m[A]&&(R[A]=b[A]),R},m)})(h.payload,u),w=n[P.meta.rid];if(!w&&(g=v({payload:P,config:o[d].config,instance:r,abort:qw}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=p+":"+d;t.dispatch(ee({},P,{type:y,_:{called:y,from:"queueDrain"}}))}}});var c=s.actions.filter(function(f,h){return!~l.processIndex.indexOf(h)});s.actions=c}}}var es=function(t){var e=t.data,r=t.action,n=t.instance,a=t.state,i=t.allPlugins,o=t.allMatches,s=t.store,u=t.EVENTS;try{var l=a.plugins,c=a.context,f=r.type,h=f.match(mr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var p=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var x=w.type.match(mr)?(function(z,V,te,L,M){return function(N,S){var O=L?L.name:z,q=S&&Jr(S)?S:te;if(L&&(!(q=S&&Jr(S)?S:[z]).includes(z)||q.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(q)+" input valid");return ee({},M,{abort:{reason:N,plugins:q,caller:V,_:O}})}})(R,A,P,m,w):(function(z,V){return function(){throw new Error(z.type+" action not cancellable. Remove abort in "+V)}})(w,A);return{payload:xw(w),instance:g,config:b||{},abort:x}}})(n,d),v=e.exact.reduce(function(g,P){var w=P.pluginName,y=P.methodName,m=!1;return y.match(/^initialize/)||y.match(/^reset/)||(m=!l[w].loaded),c.offline&&y.match(/^(page|track|identify)/)&&(m=!0),g[""+w]=m,g},{});return Promise.resolve(e.exact.reduce(function(g,P,w){var y=P.pluginName;return Promise.resolve(g).then(function(m){function b(){return Promise.resolve(m)}var R=(function(){if(e.namespaced&&e.namespaced[y])return Promise.resolve(e.namespaced[y].reduce(function(A,x,z){return Promise.resolve(A).then(function(V){return x.method&&ze(x.method)?((function(N,S){var O=Hd(N);if(O&&O.name===S){var q=Hd(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(q?"or "+q.method:"")+" in "+S+" plugin insteadof "+N].join(`
36
+ `))}})(x.methodName,x.pluginName),Promise.resolve(x.method({payload:V,instance:n,abort:(te=V,L=y,M=x.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[L],caller:f,from:M||L}})}),config:Fd(x.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,L,M})},Promise.resolve(r))).then(function(A){m[y]=A});m[y]=r})();return R&&R.then?R.then(b):b()})},Promise.resolve({}))).then(function(g){return Promise.resolve(e.exact.reduce(function(P,w,y){try{var m=e.exact.length===y+1,b=w.pluginName,R=i[b];return Promise.resolve(P).then(function(A){var x=g[b]?g[b]:{};if(h&&(x=A),rs(x,b))return ts({data:x,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(rs(A,b))return m&&ts({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(v.hasOwnProperty(b)&&v[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:x,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=p(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:x,instance:n,config:Fd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},L=ee({},A,te),M=g[b];if(rs(M,b))ts({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(Dd)&&!f.match(Md)&&n.dispatch(ee({},h?L:x,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(L)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(mr)||f.match(/^registerPlugin/)||f.match(Md)||f.match(Dd)||f.match(/^params/)||f.match(/^userIdChanged/))){if(u.plugins.includes(f),P._&&P._.originalAction===f)return P;var w=ee({},P,{_:{originalAction:P.type,called:P.type,from:"engineEnd"}});uv(P,e.exact.length)&&!f.match(/End$/)&&(w=ee({},w,{type:P.type+"Aborted"})),s.dispatch(w)}return P})})}catch(g){return Promise.reject(g)}},mr=/Start$/,Dd=/^bootstrap/,Md=/^ready/;function ts(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Fd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Kd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function zd(t,e){var r=t.replace(mr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function rs(t,e){var r=t.abort;return!!r&&(r===!0||Bd(r,e)||r&&Bd(r.plugins,e))}function uv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||Ot(r))return!0;var n=r.plugins;return Jr(r)&&r.length===e||Jr(n)&&n.length===e}function Jr(t){return Array.isArray(t)}function Bd(t,e){return!(!t||!Jr(t))&&t.includes(e)}function Hd(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function xw(t){return Object.keys(t).reduce(function(e,r){return r==="type"||(e[r]=Ke(t[r])?Object.assign({},t[r]):t[r]),e},{})}function Nw(t,e,r){var n={};return function(a){return function(i){return function(o){try{var s,u=function(m){return s?m:i(f)},l=o.type,c=o.plugins,f=o;if(o.abort)return Promise.resolve(i(o));if(l===Q.enablePlugin&&a.dispatch({type:Q.initializeStart,plugins:c,disabled:[],fromEnable:!0,meta:o.meta}),l===Q.disablePlugin&&setTimeout(function(){return jd(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),p=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),v=[],g=[],P=o.disabled,w=p.map(function(m){var b=m.loaded,R=m.name,A=m.config;return sv(m,function(){return b({config:A})},1e4).then(function(x){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!Ss.includes(z)})}),n[R]=!0),v=v.concat(R),m}).catch(function(x){if(x instanceof Error)throw new Error(x);return g=g.concat(x.name),x})});Promise.all(w).then(function(m){var b={plugins:v,failed:g,disabled:P};setTimeout(function(){d.length===w.length+P.length&&a.dispatch(ee({},{type:Q.ready},b))},0)})}var y=(function(){if(l!==Q.bootstrap)return/^ready:([^:]*)$/.test(l)&&setTimeout(function(){return cv(a,e,t)},0),Promise.resolve((function(m,b,R,A,x){try{var z=ze(b)?b():b,V=m.type,te=V.replace(mr,"");if(m._&&m._.called)return Promise.resolve(m);var L=R.getState(),M=(O=z,(q=L.plugins)===void 0&&(q={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var T=F.plugins||{};return gw(T[I])?T[I]:T.all!==!1&&(!q[I]||q[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys(L.plugins).filter(function(I){var T=L.plugins[I];return m.plugins.includes(I)&&!T.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,T){var j=zd(I).map(function(B){return Kd(B,T)});return T.reduce(function(B,Y){var J=Y.name,fe=zd(I,J).map(function(ke){return Kd(ke,T)}),ne=fe[0],ue=fe[1],ae=fe[2];return ne.length&&(B.beforeNS[J]=ne),ue.length&&(B.duringNS[J]=ue),ae.length&&(B.afterNS[J]=ae),B},{before:j[0],beforeNS:{},during:j[1],duringNS:{},after:j[2],afterNS:{}})})(V,M);return Promise.resolve(es({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(I){function T(){var Y=(function(){if(V.match(mr))return Promise.resolve(es({action:ee({},j,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(J){J.meta&&J.meta.hasCallback&&jd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(uv(I,N.length))return I;var j,B=(function(){if(V!==te)return Promise.resolve(es({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:L,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:x})).then(function(Y){j=Y});j=I})();return B&&B.then?B.then(T):T()})}catch(I){return Promise.reject(I)}var O,q,F})(o,e,t,a,r)).then(function(m){var b=i(m);return s=1,b})})();return Promise.resolve(y&&y.then?y.then(u):u(y))}catch(m){return Promise.reject(m)}}}}}function jw(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===Q.setItem||a===Q.removeItem){if(n.abort)return r(n);a===Q.setItem?t.setItem(i,o,s):t.removeItem(i,s)}return r(n)}}}}var Dw=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 Pr.apply(void 0,o)(n)(a)}}}}};function Mw(t){return function(e,r){e===void 0&&(e={});var n={};if(r.type==="initialize:aborted")return e;if(/^registerPlugin:([^:]*)$/.test(r.type)){var a=Gd(r.type,"registerPlugin"),i=t()[a];if(!i||!a)return e;var o=r.enabled,s=i.config;return n[a]={enabled:o,initialized:!!o&&!i.initialize,loaded:!!o&&!!i.loaded({config:s}),config:s},ee({},e,n)}if(/^initialize:([^:]*)$/.test(r.type)){var u=Gd(r.type,Q.initialize),l=t()[u];return l&&u?(n[u]=ee({},e[u],{initialized:!0,loaded:!!l.loaded({config:l.config})}),ee({},e,n)):e}if(/^ready:([^:]*)$/.test(r.type))return n[r.name]=ee({},e[r.name],{loaded:!0}),ee({},e,n);switch(r.type){case Q.disablePlugin:return ee({},e,Wd(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Wd(r.plugins,!0,e));default:return e}}}function Gd(t,e){return t.substring(e.length+1,t.length)}function Wd(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function lv(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var Fw={last:{},history:[]};function Kw(t,e){t===void 0&&(t=Fw);var r=e.options,n=e.meta;if(e.type===Q.track){var a=lv(ee({event:e.event,properties:e.properties},Object.keys(r).length&&{options:r},{meta:n}));return ee({},t,{last:a,history:t.history.concat(a)})}return t}var zw={actions:[]};function Bw(t,e){t===void 0&&(t=zw);var r=e.payload;switch(e.type){case"queue":var n;return n=r&&r.type&&r.type===Q.identify?[e].concat(t.actions):t.actions.concat(e),ee({},t,{actions:n});case"dequeue":return[];default:return t}}var fv=/#.*$/;function Hw(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(fv,""):"")}var dv,hv,pv,vv,Gw=function(t){if(t===void 0&&(t={}),!Ce)return t;var e=document,r=e.title,n=e.referrer,a=window,i=a.location,o=a.innerWidth,s=a.innerHeight,u=i.hash,l=i.search,c=(function(h){var d=(function(){if(Ce){for(var p,v=document.getElementsByTagName("link"),g=0;p=v[g];g++)if(p.getAttribute("rel")==="canonical")return p.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(fv,"")})(l),f={title:r,url:c,path:Hw(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},Ww={last:{},history:[]};function Vw(t,e){t===void 0&&(t=Ww);var r=e.options;if(e.type===Q.page){var n=lv(ee({properties:e.properties,meta:e.meta},Object.keys(r).length&&{options:r}));return ee({},t,{last:n,history:t.history.concat(n)})}return t}dv=(function(){if(!Ce)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"})(),hv=Ce?document.referrer:null,pv=Ew(),vv=kw();var Vd={initialized:!1,sessionId:Yn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:dv},userAgent:Ce?navigator.userAgent:"node",library:{name:bs,version:"0.13.1"},timezone:vv,locale:pv,campaign:{},referrer:hv};function Jw(t,e){t===void 0&&(t=Vd);var r=t.initialized,n=e.campaign;switch(e.type){case Q.campaign:return ee({},t,{campaign:n});case Q.offline:return ee({},t,{offline:!0});case Q.online:return ee({},t,{offline:!1});default:return r?t:ee({},Vd,t,{initialized:!0})}}var Zw=["plugins","reducers","storage"];function Yw(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Xw(t){var e=Yw.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function mv(){return Xt(bs,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return Ir[Sr][bs].push(o.action||o),i(o)}})}}}function Jd(t){return function(){return Pr(Pr.apply(null,arguments),mv())}}function ns(t){return t?nv(t)?t:[t]:[]}function Zd(t,e,r){t===void 0&&(t={});var n,a,i=Yn();return e&&(Kr[i]=(n=e,a=(function(o){for(var s,u=o||Array.prototype.slice.call(arguments),l=0;l<u.length;l++)if(ze(u[l])){s=u[l];break}return s})(r),function(o){a&&a(o),n(o)})),ee({},t,{rid:i,ts:new Date().getTime()},e?{hasCallback:!0}:{})}function Qw(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,T){if(ze(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 j=T.EVENTS?Object.keys(T.EVENTS).map(function(J){return T.EVENTS[J]}):[];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(J,fe){var ne;return J[fe]=(ne=T.methods[fe],function(){for(var ue=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ue.length;ke++)ae[ke]=ue[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete T.methods);var B=Object.keys(T).concat(j),Y=new Set(I.events.concat(B));if(I.events=Array.from(Y),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:Or},i=(function(I){return function(T,j,B){return j.getState("user")[T]||(B&&Ke(B)&&B[T]?B[T]:Nd(I)[T]||Yt(Is(T))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!Ss.includes(I)}).sort(),u=new Set(s.concat(wn).filter(function(I){return!Ss.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new Dw,h=f.addMiddleware,d=f.removeMiddleware,p=f.dynamicMiddlewares,v=function(){throw new Error("Abort disabled inListener")},g=Tw(),P=Nd(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Yn());var y=ee({enable:function(I,T){return new Promise(function(j){S.dispatch({type:Q.enablePlugin,plugins:ns(I),_:{originalAction:Q.enablePlugin}},j,[T])})},disable:function(I,T){return new Promise(function(j){S.dispatch({type:Q.disablePlugin,plugins:ns(I),_:{originalAction:Q.disablePlugin}},j,[T])})}},n.methods),m=!1,b={identify:function(I,T,j,B){try{var Y=Ot(I)?I:null,J=Ke(I)?I:T,fe=j||{},ne=b.user();Xt(Is(Et),Y);var ue=Y||J.userId||i(Et,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ue,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[T,j,B])}))}catch(ae){return Promise.reject(ae)}},track:function(I,T,j,B){try{var Y=Ke(I)?I.event:I;if(!Y||!Ot(Y))throw new Error("EventMissing");var J=Ke(I)?I:T||{},fe=Ke(j)?j:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Et,b,T),anonymousId:i(pr,b,T)},ne,[T,j,B])}))}catch(ne){return Promise.reject(ne)}},page:function(I,T,j){try{var B=Ke(I)?I:{},Y=Ke(T)?T:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:Gw(B),options:Y,userId:i(Et,b,B),anonymousId:i(pr,b,B)},J,[I,T,j])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Et||I==="id")return i(Et,b);if(I===pr||I==="anonId")return i(pr,b);var T=b.getState("user");return I?Ad(T,I):T},reset:function(I){return new Promise(function(T){S.dispatch({type:Q.resetStart},T,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(T){I&&I(T),m=!0})},on:function(I,T){if(!I||!ze(T))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var j=/Start$|Start:/;if(I==="*"){var B=function(ne){return function(ue){return function(ae){return ae.type.match(j)&&T({payload:ae,instance:b,plugins:o}),ue(ae)}}},Y=function(ne){return function(ue){return function(ae){return ae.type.match(j)||T({payload:ae,instance:b,plugins:o}),ue(ae)}}};return h(B,dn),h(Y,hn),function(){d(B,dn),d(Y,hn)}}var J=I.match(j)?dn:hn,fe=function(ne){return function(ue){return function(ae){return ae.type===I&&T({payload:ae,instance:b,plugins:o,abort:v}),ue(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,T){if(!I||!ze(T))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var j=b.on(I,function(B){T({payload:B.payload,instance:b,plugins:o,abort:v}),j()});return j},getState:function(I){var T=S.getState();return I?Ad(T,I):Object.assign({},T)},dispatch:function(I){var T=Ot(I)?{type:I}:I;if(wn.includes(T.type))throw new Error("reserved action "+T.type);var j=ee({},T,{_:ee({originalAction:T.type},I._||{})});S.dispatch(j)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,T,j){S.dispatch({type:Q.setItemStart,key:I,value:T,options:j})},removeItem:function(I,T){S.dispatch({type:Q.removeItemStart,key:I,options:T})}},setAnonymousId:function(I,T){b.storage.setItem(Ct,I,T)},events:{core:wn,plugins:s}},R=n.middlewares.concat([function(I){return function(T){return function(j){return j.meta||(j.meta=Zd()),T(j)}}},p(dn),Nw(b,c,{all:l,plugins:s}),jw(a),Uw(b),Lw(b),p(hn)]),A={context:Jw,user:$w(a),page:Vw,track:Kw,plugins:Mw(c),queue:Bw},x=Pr,z=Pr;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(x=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?mv():Ke(typeof arguments[0])?Jd():Jd().apply(null,arguments)}}var te,L=(function(I){return Object.keys(I).reduce(function(T,j){return Zw.includes(j)||(T[j]=I[j]),T},{})})(t),M=n.pluginsArray.reduce(function(I,T){var j=T.name,B=T.config,Y=T.loaded,J=n.pluginEnabled[j];return I[j]={enabled:J,initialized:!!J&&!T.initialize,loaded:!!Y({config:B}),config:B},I},{}),N={context:L,user:w,plugins:M},S=ov((function(I){for(var T=Object.keys(I),j={},B=0;B<T.length;B++){var Y=T[B];typeof I[Y]===kt&&(j[Y]=I[Y])}var J,fe=Object.keys(j);try{(function(ne){Object.keys(ne).forEach(function(ue){var ae=ne[ue];if(typeof ae(void 0,{type:ws})===mt||typeof ae(void 0,{type:Ow})===mt)throw new Error(Wr+" "+ue+" "+mt)})})(j)}catch(ne){J=ne}return function(ne,ue){if(ne===void 0&&(ne={}),J)throw J;for(var ae=!1,ke={},Ne=0;Ne<fe.length;Ne++){var De=fe[Ne],Le=ne[De],Qe=(0,j[De])(Le,ue);if(typeof Qe===mt){var It=Cw(De,ue);throw new Error(It)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),N,z(x(Aw.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,T,j){var B=ee({},I,{meta:Zd(I.meta,T,ns(j))});return te.apply(null,[B])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:L,params:g,user:w,initialUser:r,persistedUser:P});var q=O.filter(function(I){return n.pluginEnabled[I]}),F=O.filter(function(I){return!n.pluginEnabled[I]});return S.dispatch({type:Q.registerPlugins,plugins:O,enabled:n.pluginEnabled}),n.pluginsArray.map(function(I,T){var j=I.bootstrap,B=I.config,Y=I.name;j&&ze(j)&&j({instance:b,config:B,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===T+1&&S.dispatch({type:Q.initializeStart,plugins:q,disabled:F})}),Xw(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,T,j){setInterval(function(){return cv(I,T,j)},3e3)})(S,c,b),b}var dn="before",hn="after",Wt="cookie",Mt=wv(),gv=Xn,eb=Xn;function yv(t){return Mt?Xn(t,"",-1):Or(t)}function wv(){if(Mt!==void 0)return Mt;var t=Wt+Wt;try{Xn(t,t),Mt=document.cookie.indexOf(t)!==-1,yv(t)}catch{Mt=!1}return Mt}function Xn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return Mt===!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 gt="localStorage",tb=nc.bind(null,gt);Cr(gt,"getItem",Yt);Cr(gt,"setItem",Xt);Cr(gt,"removeItem",Or);var yt="sessionStorage",rb=nc.bind(null,yt);Cr(yt,"getItem",Yt);Cr(yt,"setItem",Xt);Cr(yt,"removeItem",Or);function gr(t){var e=t;try{if((e=JSON.parse(t))==="true")return!0;if(e==="false")return!1;if(Ke(e))return e;parseFloat(e)===e&&(e=parseFloat(e))}catch{}if(e!==null&&e!=="")return e}var nb=tb(),ab=rb(),ib=wv();function Vt(t,e){if(t){var r=ac(e),n=!cc(r),a=ic(r)?gr(localStorage.getItem(t)):void 0;if(n&&!hr(a))return a;var i=oc(r)?gr(gv(t)):void 0;if(n&&i)return i;var o=sc(r)?gr(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 On(t,e,r){if(t&&!hr(e)){var n={},a=ac(r),i=JSON.stringify(e),o=!cc(a);return ic(a)&&(n[gt]=pn(gt,e,gr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[gt]:oc(a)&&(n[Wt]=pn(Wt,e,gr(gv(t))),eb(t,i),o)?n[Wt]:sc(a)&&(n[yt]=pn(yt,e,gr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[yt]:(n[Ht]=pn(Ht,e,Yt(t)),Xt(t,e),o?n[Ht]:n)}}function ob(t,e){if(t){var r=ac(e),n=Vt(t,ev),a={};return!hr(n.localStorage)&&ic(r)&&(localStorage.removeItem(t),a[gt]=n.localStorage),!hr(n.cookie)&&oc(r)&&(yv(t),a[Wt]=n.cookie),!hr(n.sessionStorage)&&sc(r)&&(sessionStorage.removeItem(t),a[yt]=n.sessionStorage),!hr(n.global)&&Qn(r,Ht)&&(Or(t),a[Ht]=n.global),a}}function ac(t){return t?Ot(t)?t:t.storage:Qp}function ic(t){return nb&&Qn(t,gt)}function oc(t){return ib&&Qn(t,Wt)}function sc(t){return ab&&Qn(t,yt)}function cc(t){return t===ev||t==="all"}function Qn(t,e){return t===Qp||t===e||cc(t)}function pn(t,e,r){return{location:t,current:e,previous:r}}var sb={setItem:On,getItem:Vt,removeItem:ob};function cb(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yd(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?Yd(Object(r),!0).forEach(function(n){cb(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ub(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:sb};return Qw(Xd(Xd({},e),t))}function lb(t){if(typeof window>"u")return;const{addEventListener:e,history:r,location:n}=window;let a=n.pathname;e("popstate",()=>t(n.pathname)),["push","replace"].map(i=>{const o=`${i}State`;if(o!=="pushState"&&o!=="replaceState")return;const s=r[o];r[o]=function(...u){const l=u[2]?.toString()||"",c=db(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function fb(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function db(t){return["#","?"].forEach(e=>t=fb(t,e)),t}function hb(){lb(()=>{dt.page()})}var as="up",is="down";function pb(t){if(t===void 0&&(t={}),!Ce)return ys;var e=eh(),r=Ps(),n=Qd(),a=vn(n,e),i=vn(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return ys;var d=h.map(function(v){return Number(v)}),p=Rw(function(){var v=eh(),g=(function(L,M){return M.map(function(N){return N===100?L-5:L*(N/100)})})(v,d),P=Ps(),w=Qd(),y=vn(w,v),m=vn(P,v);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=as;b?R="initial":l<=w&&(R=is);var A=g,x=d;(R===as||b)&&(A=g.slice().reverse(),x=d.slice().reverse());var z=x.reduce(function(L,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),L.singleFunction=M),R===is&&!o.includes(M)&&w>=S&&M>i?(s.push(M),L.callbacks=L.callbacks.concat(M),L):R===as&&!o.includes(M)&&w<=S&&M<=y?(L.foundFunc=[M],L):(b&&w>=S&&L.foundFunc.length===0&&(L.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),L.singleFunction?u.push(M):L.singleFunction=M),L)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===is&&z.callbacks&&z.callbacks.forEach(function(L){ze(t[L])&&(t[L]({trigger:L,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(L))}),z.singleFunction){var V=z.singleFunction,te=z.direction;ze(t[V])&&t[V]({trigger:V,direction:te,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(V)}}},500);return window.addEventListener("scroll",p),function(){return window.removeEventListener("scroll",p)}}function Ps(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function vb(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Qd(){return Math.round(Ps()+vb())}function eh(){if(!Ce)return 0;var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,t.offsetHeight,e.clientHeight,e.scrollHeight,e.offsetHeight)}function vn(t,e){return Math.round(t/e*100)}var uc="Event",th=uc+"Listener";function mb(t){return function(e,r,n,a){var i=n||ys,o=a||!1;if(!Ce)return i;var s=Cn(r),u=Cn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+uc);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+th:"remove"+th,d=0;d<u.length;d++){var p=u[d];l[d]=f?o&&o.once?gb(i):i:l[d]||i;for(var v=0;v<s.length;v++)p[h]?p["on"+s[v]]=f?l[d]:null:p[h](s[v],l[d],o)}return c.bind(null,!f)})(t)}}function Cn(t,e){if(Ot(t))return e?Cn(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=Pw(t);return e?i.map(function(o){return Ot(o)?Cn(o,!0):o}).flat():i}function gb(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var os=mb(uc);function bv(t,e){return Ce&&ze(window[t])?(r=window[t],n=e,(a=window)===void 0&&(a=null),ze(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 Sv=typeof window>"u",rh="hidden";function yb(t){if(Sv)return!1;var e=wb(),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 wb(){var t=["webkit","moz","ms","o"];return Sv||rh in document?rh:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var bb=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Sb(t,e){e===void 0&&(e={});var r=(function(o,s){var u=this,l=!1;return function(c){l||(o.call(u,c),l=!0,setTimeout(function(){return l=!1},s))}})(t,e.throttle||1e4),n=[];function a(){var o=yb(function(s){s||r({type:"tabVisible"})});return n=[o].concat(bb.map(function(s){return os(document,s,r)})).concat(os(window,"load",r)).concat(os(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Ib(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function p(g){d(),i&&!c&&i(Mr(h),g),a&&c&&(c=!1,a(Mr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(Mr(h),g))},s)}var v=Sb(p,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=v();return function(){return f=!1,h=new Date,p({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:Mr(h,f),idle:c?Mr(r,f):0}}}}function Mr(t,e){return e?0:Math.round((new Date-t)/1e3)}const nh=5e3;class Pb{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),Ib({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:nh}),pb({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*nh: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 Iv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Eb(t,e){e=e||{};var r,n,a=[],i=e.max||1/0;function o(){clearInterval(r),t(a.splice(0,i)),s()}function s(){r=setInterval(o,e.interval||1e4)}return s(),{flush:o,push:function(u){return n=a.push(u),n>=i&&o(),n},size:function(){return a.length},end:function(u){u&&o(),clearInterval(r)}}}const ah="sesamy_session_id";function kb(){let t=sessionStorage.getItem(ah);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(ah,t)),t}let Pv=!1,bn,An,Es;function Ev(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:Es,requestId:Math.random().toString(36).slice(2,9),sessionId:kb(),timestamp:new Date().toISOString(),version:nn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:zt("sesamy:item-src"),publisherContentId:zt("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:ec,userAgent:navigator.userAgent,clientId:Es}}}))}const kv=Eb(async t=>{if(t.length>0){const e=Ev(t);Pv?navigator.sendBeacon(An,e):(await fetch(An,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function ss(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(An,Ev([e]))}else kv.push(t)}function Tb(){return Pv=!0,kv.flush()}function _b(t,e,r){bn=e,An=`${tt("logs",r)}/events`,Es=t}const Rb={name:"custom-analytics-plugin",page:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ss({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;ss({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!bn)return;const{properties:e,anonymousId:r,userId:n}=t;ss({anonymousId:r,userId:n,properties:e,type:"identify"})}},ih=["source","medium","campaign","term","content"],Tt="utm_",Ob=1800*1e3;function Tv(t){return t?Date.now()-parseInt(t,10)>Ob:!0}function oh(){const t=document.referrer||"";if(!t)return;const e=Vt(`${Tt}set_at`);(Tv(e)||!Vt(`${Tt}referrer`))&&On(`${Tt}referrer`,t)}function Cb(){const t=()=>{const r={};for(const a of ih){const i=Vt(`${Tt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Vt(`${Tt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){oh()},campaign({payload:r}){const n=r?.campaign||{},a=Vt(`${Tt}set_at`);if(Object.keys(n).length>0&&Tv(a)){for(const o of ih){const s=n[o];s&&On(`${Tt}${o}`,s)}On(`${Tt}set_at`,String(Date.now()))}oh()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const Ab=Cb(),sh=new Map,ch=new Map;function Ub({clientId:t,enabled:e=!0,environment:r}){_b(t,e,r),e&&(window.addEventListener("beforeunload",()=>{ch.forEach((n,a)=>{n.bind(a)()}),Tb()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&sh.forEach((n,a)=>{n.bind(a)()})}),hb(),Iv(()=>{const n=new Pb({element:document.body,viewCallback:()=>{dt.page()},activeDurationCallback:(a,i,o)=>{dt.track("activeDuration",{duration:a,durationStart:o,flushing:i})},idleDurationCallback:(a,i,o)=>{dt.track("idleDuration",{duration:a,durationStart:o,flushing:i})},scrollCallback:a=>{dt.track("scroll",{scroll:a.scrollMax})}});ch.set(document.body,()=>{n.flush()}),sh.set(document.body,()=>{n.handleVisibilityChange()})}),window.addEventListener(He.AUTHENTICATED,async n=>{const a=n;await dt.identify(a.detail.sub)}),window.addEventListener(He.LOGOUT,async()=>{await dt.track("logout",{}),await dt.reset()}))}const dt=ub({app:ec,version:nn,plugins:[Ab,Rb]});function _v(t,e){dt.track(t,e)}const $b=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function Rv(){return new Promise(t=>{const e=$b.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 Ov(){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}}function Lb(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});_v(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function qb(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}const xb=["sesamy","__sesamy","__anon_id","auth0","a0","_legacy_auth0"],Nb=["access_token","id_token","refresh_token","token"];function ks(t){const e=t.split(".");return e.length===3?`${e[0]}.${e[1]}.[REDACTED]`:t}function Cv(t){const e=t.toLowerCase();return Nb.some(r=>e.includes(r))}function Av(t){const e=t.split(".");return e.length===3&&e.every(r=>r.length>0)}function uh(t){const e=[];for(let r=0;r<t.length;r++){const n=t.key(r);if(!n)continue;if(xb.some(i=>n.toLowerCase().startsWith(i.toLowerCase()))){let i=t.getItem(n)||"",o=!1;(Cv(n)||Av(i))&&(i=ks(i),o=!0);try{const s=JSON.parse(i);if(typeof s=="object"&&s!==null){const u=Ts(s);u.wasRedacted&&(i=JSON.stringify(u.value),o=!0)}}catch{}e.push({key:n,value:i,redacted:o})}}return e}function Ts(t){if(t==null)return{value:t,wasRedacted:!1};if(typeof t=="string")return Av(t)?{value:ks(t),wasRedacted:!0}:{value:t,wasRedacted:!1};if(Array.isArray(t)){let e=!1;return{value:t.map(n=>{const a=Ts(n);return a.wasRedacted&&(e=!0),a.value}),wasRedacted:e}}if(typeof t=="object"){let e=!1;const r={};for(const[n,a]of Object.entries(t))if(Cv(n)&&typeof a=="string")r[n]=ks(a),e=!0;else{const i=Ts(a);i.wasRedacted&&(e=!0),r[n]=i.value}return{value:r,wasRedacted:e}}return{value:t,wasRedacted:!1}}function jb(){const t=navigator;return{userAgent:t.userAgent,platform:t.platform,language:t.language,languages:[...t.languages||[]],cookiesEnabled:t.cookieEnabled,onLine:t.onLine,hardwareConcurrency:t.hardwareConcurrency,deviceMemory:t.deviceMemory,maxTouchPoints:t.maxTouchPoints,vendor:t.vendor,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,screenWidth:screen.width,screenHeight:screen.height,pixelRatio:window.devicePixelRatio,colorDepth:screen.colorDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}async function Db(){await Cp();const[t]=await Promise.all([Rv()]),e=Ov();return{adBlockEnabled:t,incognitoMode:Gn()??!1,inAppBrowser:e.isInAppBrowser}}async function Uv(t){const e=[],r={timestamp:new Date().toISOString(),sdkVersion:nn,clientId:t.clientId,fallbackId:t.fallbackId};r.pageUrl=window.location.href,r.pageTitle=document.title;try{r.browser=jb()}catch(a){e.push(`Browser info collection failed: ${a.message}`)}try{r.detection=await Db()}catch(a){e.push(`Detection collection failed: ${a.message}`)}try{r.localStorage=uh(localStorage)}catch(a){e.push(`LocalStorage collection failed: ${a.message}`)}try{r.sessionStorage=uh(sessionStorage)}catch(a){e.push(`SessionStorage collection failed: ${a.message}`)}if(await Rt()){try{const a=await ht(!1);if(a){const i=a.split(".");if(i.length>=2){const o=JSON.parse(atob(i[1]));r.userId=o.sub}}}catch(a){e.push(`User ID extraction failed: ${a.message}`)}if(t.getProfile)try{r.profile=await t.getProfile()||void 0}catch(a){e.push(`Profile collection failed: ${a.message}`)}if(t.getEntitlements)try{r.entitlements=await t.getEntitlements()}catch(a){e.push(`Entitlements collection failed: ${a.message}`)}if(t.getContracts)try{r.contracts=await t.getContracts()}catch(a){e.push(`Contracts collection failed: ${a.message}`)}if(t.getTags)try{r.tags=await t.getTags()}catch(a){e.push(`Tags collection failed: ${a.message}`)}if(t.getTallies)try{r.tallies=await t.getTallies()}catch(a){e.push(`Tallies collection failed: ${a.message}`)}}return e.length>0&&(r.errors=e),r}async function Mb(t,e,r){const a=`${tt("api2",e)}/diagnostics`,i={"Content-Type":"application/json"};if(await Rt())try{const s=await ht(!1);s&&(i.Authorization=`Bearer ${s}`)}catch{}if(!i.Authorization&&r){const s=localStorage.getItem("__anon_id")?.replace(/"/g,"")||"",u=btoa(`${r}|${s}:`);i.Authorization=`Basic ${u}`}const o=await fetch(a,{method:"POST",headers:i,body:JSON.stringify(t)});if(!o.ok){const s=await o.text();throw new Error(`Failed to submit diagnostics: ${s}`)}return o.json()}const lh="user-diagnostics",fh="diagnostics-id",Fb=`
37
37
  .sesamy-diagnostics-modal {
38
38
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
39
39
  background: white;
@@ -142,7 +142,7 @@ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw
142
142
  <button class="btn-primary" data-action="send">Send Diagnostics</button>
143
143
  </div>
144
144
  <div class="status" style="display: none;"></div>
145
- `,t}function $v(t){return new Promise(e=>{const r=Kb(),{close:n}=Xp(r,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=r.querySelector('[data-action="cancel"]'),i=r.querySelector('[data-action="send"]'),o=r.querySelector(".status"),s=(u,l)=>{o.style.display="block",o.className=`status ${l}`,l==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),e({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await Uv(t);s("Sending diagnostics...","loading");const l=await Mb(u,t.environment);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),e({sent:!0,id:l.id})},1500)}catch(u){oe(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function zb(t){const e=new URLSearchParams(window.location.search);if(e.get(lh)?.toLowerCase()!=="true")return;const n=e.get(fh);n&&(t.fallbackId=n),oe("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(lh),a.searchParams.delete(fh),window.history.replaceState(null,"",a);const i=await $v(t);i.sent?oe(`Diagnostics sent with ID: ${i.id}`):oe("User cancelled diagnostics")}async function Hb(t){return $v(t)}function Bb(t){const{autoOnboardProduct:e,bills:r,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:l,getFulfillments:c,getProfile:f,getProxyContent:h,getSubscriptions:d,getTags:p,getTally:v,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:x,pushTally:z,requestDelivery:V,setTag:te,transactions:L,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=rw(t),q=()=>A.list(),T={analytics:{track:_v},attribution:{get:kn,set:Mp},auth:{getUser:f,getTokenSilently:Pt,isAuthenticated:zt,loginWithRedirect:Vn,loginWithPopup:$p,login:ny,logout:Ys,setToken:vs},bills:r,browser:{detectAdblock:Rv,isInAppBrowser:Ov,isIncognito:Gn},checkouts:n,clearCache:pt,content:{list:Zp,get:on,getLanguage:Br,hasAccess:ew,unlock:Yp,getPropertyFromHTML:rc,showModal:Xp,showNotificationBar:tw},contracts:a,diagnostics:{send:j=>Hb({clientId:t.clientId||t.vendorId,environment:t.environment,fallbackId:j,getProfile:()=>f(),getEntitlements:()=>l(),getContracts:()=>a.list(),getTags:()=>p(),getTallies:()=>g()}),collect:j=>Uv({clientId:t.clientId||t.vendorId,environment:t.environment,fallbackId:j,getProfile:()=>f(),getEntitlements:()=>l(),getContracts:()=>a.list(),getTags:()=>p(),getTallies:()=>g()})},entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:Qs},events:{emit:Lb,cancel:qb},flags:{get:Hp,set:zp,list:an,delete:Bp},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:Gb,isReady:()=>exports.isInitialized,log:oe,paywalls:R,paymentIssues:A,products:{...x,autoOnboard:e,linkSpotify:m},profile:{get:f,isSpotifyLinked:y,openHostedAccountPage:b,unlinkSpotify:M,update:N},proxy:{getContent:h},subscriptions:{list:d},tags:{delete:i,list:p,set:te},tallies:{delete:o,get:v,list:g,push:z},transactions:{...L,get:P},userMetadata:S,vendor:O,setToken:vs};return t.namespace&&(window[t.namespace]=T),T}function Gb(){return nn}function Wb(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=`
145
+ `,t}function $v(t){return new Promise(e=>{const r=Kb(),{close:n}=Xp(r,{closeOnBackdropClick:!1,closeOnEscape:!0}),a=r.querySelector('[data-action="cancel"]'),i=r.querySelector('[data-action="send"]'),o=r.querySelector(".status"),s=(u,l)=>{o.style.display="block",o.className=`status ${l}`,l==="loading"?o.innerHTML=`<span class="spinner"></span>${u}`:o.textContent=u};a.addEventListener("click",()=>{n(),e({sent:!1})}),i.addEventListener("click",async()=>{i.disabled=!0,a.disabled=!0,s("Collecting diagnostics...","loading");try{const u=await Uv(t);s("Sending diagnostics...","loading");const l=await Mb(u,t.environment,t.clientId);s("Diagnostics sent successfully!","success"),setTimeout(()=>{n(),e({sent:!0,id:l.id})},1500)}catch(u){oe(`Failed to send diagnostics: ${u.message}`),s(`Failed to send: ${u.message}`,"error"),i.disabled=!1,a.disabled=!1}})})}async function zb(t){const e=new URLSearchParams(window.location.search);if(e.get(lh)?.toLowerCase()!=="true")return;const n=e.get(fh);n&&(t.fallbackId=n),oe("User diagnostics requested via query parameter");const a=new URL(window.location.href);a.searchParams.delete(lh),a.searchParams.delete(fh),window.history.replaceState(null,"",a);const i=await $v(t);i.sent?oe(`Diagnostics sent with ID: ${i.id}`):oe("User cancelled diagnostics")}async function Bb(t){return $v(t)}function Hb(t){const{autoOnboardProduct:e,bills:r,checkouts:n,contracts:a,deleteTag:i,deleteTally:o,entitlements:s,generateLink:u,getEntitlements:l,getFulfillments:c,getProfile:f,getProxyContent:h,getSubscriptions:d,getTags:p,getTally:v,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:x,pushTally:z,requestDelivery:V,setTag:te,transactions:L,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=rw(t),q=()=>A.list(),T={analytics:{track:_v},attribution:{get:kn,set:Mp},auth:{getUser:f,getTokenSilently:ht,isAuthenticated:Rt,loginWithRedirect:Vn,loginWithPopup:$p,login:ny,logout:Ys,setToken:vs},bills:r,browser:{detectAdblock:Rv,isInAppBrowser:Ov,isIncognito:Gn},checkouts:n,clearCache:vt,content:{list:Zp,get:on,getLanguage:Hr,hasAccess:ew,unlock:Yp,getPropertyFromHTML:rc,showModal:Xp,showNotificationBar:tw},contracts:a,diagnostics:{send:j=>Bb({clientId:t.clientId||t.vendorId,environment:t.environment,fallbackId:j,getProfile:()=>f(),getEntitlements:()=>l(),getContracts:()=>a.list(),getTags:()=>p(),getTallies:()=>g()}),collect:j=>Uv({clientId:t.clientId||t.vendorId,environment:t.environment,fallbackId:j,getProfile:()=>f(),getEntitlements:()=>l(),getContracts:()=>a.list(),getTags:()=>p(),getTallies:()=>g()})},entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:Qs},events:{emit:Lb,cancel:qb},flags:{get:Bp,set:zp,list:an,delete:Hp},fulfillments:{list:c,requestDelivery:V},generateLink:u,getPaymentIssues:q,getVersion:Gb,isReady:()=>exports.isInitialized,log:oe,paywalls:R,paymentIssues:A,products:{...x,autoOnboard:e,linkSpotify:m},profile:{get:f,isSpotifyLinked:y,openHostedAccountPage:b,unlinkSpotify:M,update:N},proxy:{getContent:h},subscriptions:{list:d},tags:{delete:i,list:p,set:te},tallies:{delete:o,get:v,list:g,push:z},transactions:{...L,get:P},userMetadata:S,vendor:O,setToken:vs};return t.namespace&&(window[t.namespace]=T),T}function Gb(){return nn}function Wb(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=`
146
146
  ${e.selector}::before {
147
147
  content: '';
148
148
  position: absolute;
@@ -153,4 +153,4 @@ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw
153
153
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
154
154
  pointer-events: none;
155
155
  }
156
- `,document.head.appendChild(i)}async function Vb(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 Vb(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 Jb(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 Zb(t,e){const r=await lc(e);t.innerHTML=r}async function Yb(t,e){const r=await lc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Xb({enabled:t=!1,rules:e}){t&&Iv(async()=>{const r=await zt(),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 Jb(s,a);break;case"replace":await Zb(s,a);break;case"remove":o.remove();break;case"wrap":await Yb(s,a);break;case"gradient":Wb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const dh="access_token";function Qb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(dh);if(e){vs(e);const r=new URL(window.location.href);t.delete(dh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const hh="sesamy-refresh",ph="force-refetch-entitlements";function eS(){const t=new URLSearchParams(window.location.search),e=t.get(ph),r=t.get(hh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(ph),t.delete(hh),n.search=t.toString(),pt(),window.history.replaceState(null,"",n)}}function tS(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 rS(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=tS(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOption:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",hasAccess:!0,expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};By(i)}catch(n){oe(`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 vh="sesamy-user";async function nS(){const e=new URLSearchParams(window.location.search).get(vh)?.toLowerCase();if(!e)return;const r=await ry();r?.email!==e?(oe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),pt(),Vn({authorizationParams:{login_hint:e}})):oe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(vh),window.history.replaceState(null,"",n)}const mh="sesamy-purchase";function aS(){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(),oe(`Purchase ${e}`),Jt(Be.PURCHASE,{itemSrc:e}),pt(),window.history.replaceState(null,"",r)}}const gh="sesamy-login",iS="sesamy_login";async function oS(){const t=new URLSearchParams(window.location.search);if(!(t.get(gh)||t.get(iS)))return;await zt()||Vn();const n=new URL(window.location.href);n.searchParams.delete(gh),window.history.replaceState(null,"",n)}const yh="sesamy-debug";async function sS(){const e=new URLSearchParams(window.location.search).get(yh)?.toLowerCase();if(!e)return;Qm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(yh),window.history.replaceState(null,"",r)}function cS(){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 uS(t){if(!Vr())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:cS()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),Mp(r)}function lS(){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||(oe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function fS(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 dS(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 hS(t){const e=Kt("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){oe(`Init with config: ${JSON.stringify(t)}`);try{lS(),Ub({clientId:t.clientId,environment:t.environment,...t.analytics}),await ty({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),Xy(t,e),t.transform&&await Xb(t.transform),Cp(),sS(),zb({clientId:t.clientId||t.vendorId,environment:t.environment,getProfile:()=>e.profile.get(),getEntitlements:()=>e.entitlements.list(),getContracts:()=>e.contracts.list(),getTags:()=>e.tags.list(),getTallies:()=>e.tallies.list()}),uS(e),Qb(),eS(),rS(),await oS(),await nS(),aS(),await dS(e),await fS(e),await hS(e),exports.isInitialized=!0,Jt(Be.READY,{})}catch(r){oe(`Failed to init ${r.message}`)}}async function Lv(t){oe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Vr()&&e in window)return oe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=Bb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Vr()?(t.awaitAllServices?await wh(t,r):wh(t,r),r):(exports.isInitialized=!0,r)}if(Vr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);Lv(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Be;exports.getContentConfig=Yy;exports.init=Lv;
156
+ `,document.head.appendChild(i)}async function Vb(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 Vb(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 Jb(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 Zb(t,e){const r=await lc(e);t.innerHTML=r}async function Yb(t,e){const r=await lc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Xb({enabled:t=!1,rules:e}){t&&Iv(async()=>{const r=await Rt(),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 Jb(s,a);break;case"replace":await Zb(s,a);break;case"remove":o.remove();break;case"wrap":await Yb(s,a);break;case"gradient":Wb(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const dh="access_token";function Qb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(dh);if(e){vs(e);const r=new URL(window.location.href);t.delete(dh),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const hh="sesamy-refresh",ph="force-refetch-entitlements";function eS(){const t=new URLSearchParams(window.location.search),e=t.get(ph),r=t.get(hh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(ph),t.delete(hh),n.search=t.toString(),vt(),window.history.replaceState(null,"",n)}}function tS(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 rS(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=tS(e),a=new Date(n.exp*1e3),i={id:"",title:n.p?.toString(),sku:n.s?.toString(),purchaseOption:n.p?.toString(),publisherContentId:n.pid?.toString(),url:n.url?.toString(),token:e,type:"article",hasAccess:!0,expiresAt:a.toISOString(),createdAt:new Date(n.iat).toISOString(),updatedAt:new Date(n.iat).toISOString()};Hy(i)}catch(n){oe(`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 vh="sesamy-user";async function nS(){const e=new URLSearchParams(window.location.search).get(vh)?.toLowerCase();if(!e)return;const r=await ry();r?.email!==e?(oe(`Current user does not match sesamy user: ${r?.email} !== ${e}`),vt(),Vn({authorizationParams:{login_hint:e}})):oe(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(vh),window.history.replaceState(null,"",n)}const mh="sesamy-purchase";function aS(){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(),oe(`Purchase ${e}`),Jt(He.PURCHASE,{itemSrc:e}),vt(),window.history.replaceState(null,"",r)}}const gh="sesamy-login",iS="sesamy_login";async function oS(){const t=new URLSearchParams(window.location.search);if(!(t.get(gh)||t.get(iS)))return;await Rt()||Vn();const n=new URL(window.location.href);n.searchParams.delete(gh),window.history.replaceState(null,"",n)}const yh="sesamy-debug";async function sS(){const e=new URLSearchParams(window.location.search).get(yh)?.toLowerCase();if(!e)return;Qm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(yh),window.history.replaceState(null,"",r)}function cS(){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 uS(t){if(!Vr())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:cS()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),Mp(r)}function lS(){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||(oe("Reloading page to get query params in incognito browser"),window.location.reload()))}async function fS(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 dS(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 hS(t){const e=zt("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){oe(`Init with config: ${JSON.stringify(t)}`);try{lS(),Ub({clientId:t.clientId,environment:t.environment,...t.analytics}),await ty({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),Xy(t,e),t.transform&&await Xb(t.transform),Cp(),sS(),zb({clientId:t.clientId||t.vendorId,environment:t.environment,getProfile:()=>e.profile.get(),getEntitlements:()=>e.entitlements.list(),getContracts:()=>e.contracts.list(),getTags:()=>e.tags.list(),getTallies:()=>e.tallies.list()}),uS(e),Qb(),eS(),rS(),await oS(),await nS(),aS(),await dS(e),await fS(e),await hS(e),exports.isInitialized=!0,Jt(He.READY,{})}catch(r){oe(`Failed to init ${r.message}`)}}async function Lv(t){oe("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Vr()&&e in window)return oe("Sesamy already initialized. This is likely due to a duplicate import"),exports.isInitialized=!0,window[e];const r=Hb({clientId:t.clientId,vendorId:t.vendorId,environment:t.environment,...t.api});return Vr()?(t.awaitAllServices?await wh(t,r):wh(t,r),r):(exports.isInitialized=!0,r)}if(Vr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);Lv(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=He;exports.getContentConfig=Yy;exports.init=Lv;