@sesamy/sesamy-js 1.63.0 → 1.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sesamy-js.cjs +7 -7
- package/dist/sesamy-js.d.ts +2 -0
- package/dist/sesamy-js.iife.js +7 -7
- package/dist/sesamy-js.mjs +1573 -1561
- package/package.json +1 -1
package/dist/sesamy-js.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var hc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vc={},ia,pc;function Ae(){return pc||(pc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,mc;function Cn(){if(mc)return oa;mc=1;var t=Ae();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,gc;function pe(){if(gc)return sa;gc=1;var t=Cn(),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,yc;function An(){if(yc)return ca;yc=1;var t=pe(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,wc;function dh(){if(wc)return ua;wc=1;var t=pe(),e=Ae(),r=An(),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,bc;function Un(){return bc||(bc=1,la=function(t){return t==null}),la}var fa,Sc;function $n(){if(Sc)return fa;Sc=1;var t=Un(),e=TypeError;return fa=function(r){if(t(r))throw new e("Can't call method on "+r);return r},fa}var da,Ic;function Zr(){if(Ic)return da;Ic=1;var t=dh(),e=$n();return da=function(r){return t(e(r))},da}var $r,Pc;function me(){if(Pc)return $r;Pc=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 hc=="object"&&hc)||t(typeof $r=="object"&&$r)||(function(){return this})()||Function("return this")(),$r}var ha={exports:{}},va,Ec;function ut(){return Ec||(Ec=1,va=!1),va}var pa,kc;function Es(){if(kc)return pa;kc=1;var t=me(),e=Object.defineProperty;return pa=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},pa}var _c;function ks(){if(_c)return ha.exports;_c=1;var t=ut(),e=me(),r=Es(),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,Tc;function hh(){if(Tc)return ma;Tc=1;var t=ks();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Rc;function Ln(){if(Rc)return ga;Rc=1;var t=$n(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,Oc;function Je(){if(Oc)return ya;Oc=1;var t=pe(),e=Ln(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Cc;function vh(){if(Cc)return wa;Cc=1;var t=pe(),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,Ac;function Yr(){if(Ac)return ba;Ac=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,Uc;function ph(){if(Uc)return Sa;Uc=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,$c;function mh(){if($c)return Ia;$c=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,Lc;function gh(){if(Lc)return Pa;Lc=1;var t=mh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,qc;function Ue(){if(qc)return Ea;qc=1;var t=me(),e=hh(),r=Je(),n=vh(),a=mh(),i=gh(),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,jc;function we(){if(jc)return ka;jc=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 _a,Nc;function Ze(){if(Nc)return _a;Nc=1;var t=we();return _a=function(e){return typeof e=="object"?e!==null:t(e)},_a}var Ta,xc;function rt(){if(xc)return Ta;xc=1;var t=Ze(),e=String,r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ta}var Ra={},Oa,Dc;function $e(){if(Dc)return Oa;Dc=1;var t=Ae();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Mc;function yh(){if(Mc)return Ca;Mc=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,Fc;function qn(){if(Fc)return Ua;Fc=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,Kc;function wh(){if(Kc)return $a;Kc=1;var t=$e(),e=Ae(),r=qn();return $a=!t&&!e(function(){return Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a!==7}),$a}var La,zc;function je(){if(zc)return La;zc=1;var t=Cn(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var qa,Hc;function Ye(){if(Hc)return qa;Hc=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 ja,Bc;function jn(){if(Bc)return ja;Bc=1;var t=pe();return ja=t({}.isPrototypeOf),ja}var Na,Gc;function bh(){if(Gc)return Na;Gc=1;var t=Ye(),e=we(),r=jn(),n=gh(),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 xa,Wc;function Nn(){if(Wc)return xa;Wc=1;var t=String;return xa=function(e){try{return t(e)}catch{return"Object"}},xa}var Da,Vc;function nt(){if(Vc)return Da;Vc=1;var t=we(),e=Nn(),r=TypeError;return Da=function(n){if(t(n))return n;throw new r(e(n)+" is not a function")},Da}var Ma,Jc;function _s(){if(Jc)return Ma;Jc=1;var t=nt(),e=Un();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,Zc;function mp(){if(Zc)return Fa;Zc=1;var t=je(),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,Yc;function gp(){if(Yc)return Ka;Yc=1;var t=je(),e=Ze(),r=bh(),n=_s(),a=mp(),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,Xc;function Sh(){if(Xc)return za;Xc=1;var t=gp(),e=bh();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var Qc;function yt(){if(Qc)return Aa;Qc=1;var t=$e(),e=wh(),r=yh(),n=rt(),a=Sh(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Aa.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},Aa}var Ha,eu;function yp(){if(eu)return Ha;eu=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,tu;function Ts(){if(tu)return Ba;tu=1;var t=yp();return Ba=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ba}var Ga,ru;function Ih(){if(ru)return Ga;ru=1;var t=Ts(),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,nu;function wp(){if(nu)return Wa;nu=1;var t=Ts(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,au;function Rs(){if(au)return Va;au=1;var t=wp();return Va=function(e){return t(e.length)},Va}var Ja,iu;function bp(){if(iu)return Ja;iu=1;var t=Zr(),e=Ih(),r=Rs(),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,ou;function Os(){return ou||(ou=1,Za={}),Za}var Ya,su;function Ph(){if(su)return Ya;su=1;var t=pe(),e=Je(),r=Zr(),n=bp().indexOf,a=Os(),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,cu;function Cs(){return cu||(cu=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,uu;function Eh(){if(uu)return Qa;uu=1;var t=Ph(),e=Cs();return Qa=Object.keys||function(n){return t(n,e)},Qa}var lu;function Sp(){if(lu)return Ra;lu=1;var t=$e(),e=yh(),r=yt(),n=rt(),a=Zr(),i=Eh();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,fu;function kh(){if(fu)return ei;fu=1;var t=Ye();return ei=t("document","documentElement"),ei}var ti,du;function As(){if(du)return ti;du=1;var t=hh(),e=vh(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,hu;function Xr(){if(hu)return ri;hu=1;var t=rt(),e=Sp(),r=Cs(),n=Os(),a=kh(),i=qn(),o=As(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+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?v(g):p():v(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,vu;function Ip(){if(vu)return ni;vu=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,pu;function Qr(){return pu||(pu=1,ai={}),ai}var ii,mu;function Pp(){if(mu)return ii;mu=1;var t=me(),e=we(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,gu;function Yt(){return gu||(gu=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,yu;function Xt(){if(yu)return si;yu=1;var t=$e(),e=yt(),r=Yt();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,wu;function Er(){if(wu)return ci;wu=1;var t=Pp(),e=me(),r=Ze(),n=Xt(),a=Je(),i=ks(),o=As(),s=Os(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(w){return d(w)?h(w):f(w,{})},p=function(w){return function(y){var m;if(!r(y)||(m=h(y)).type!==w)throw new l("Incompatible receiver, "+w+" required");return m}};if(t||i.state){var g=i.state||(i.state=new 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:v,getterFor:p},ci}var ui={},li={},bu;function _h(){if(bu)return li;bu=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 Su;function Th(){if(Su)return ui;Su=1;var t=$e(),e=je(),r=_h(),n=Yt(),a=Zr(),i=Sh(),o=Je(),s=wh(),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,Iu;function Rh(){if(Iu)return di;Iu=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,Pu;function Us(){if(Pu)return hi;Pu=1;var t=pe(),e=we(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var Eu;function Oh(){if(Eu)return fi.exports;Eu=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=$e(),i=Rh().CONFIGURABLE,o=Us(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),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),p&&m&&n(m,"arity")&&w.length!==m.arity&&f(w,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(w,"prototype",{writable:!1}):w.prototype&&(w.prototype=void 0)}catch{}var b=u(w);return n(b,"source")||(b.source=v(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),fi.exports}var vi,ku;function Xe(){if(ku)return vi;ku=1;var t=we(),e=yt(),r=Oh(),n=Es();return vi=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},vi}var pi={},_u;function Ep(){if(_u)return pi;_u=1;var t=Ph(),e=Cs(),r=e.concat("length","prototype");return pi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},pi}var mi={},Tu;function Ch(){return Tu||(Tu=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Ru;function kp(){if(Ru)return gi;Ru=1;var t=Ye(),e=pe(),r=Ep(),n=Ch(),a=rt(),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,Ou;function Ah(){if(Ou)return yi;Ou=1;var t=Je(),e=kp(),r=Th(),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,Cu;function Uh(){if(Cu)return wi;Cu=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,Au;function Ie(){if(Au)return bi;Au=1;var t=me(),e=Th().f,r=Xt(),n=Xe(),a=Es(),i=Ah(),o=Uh();return bi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(g=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof g==typeof p)continue;i(g,p)}(s.sham||p&&p.sham)&&r(g,"sham",!0),n(d,v,g,s)}},bi}var Si,Uu;function _p(){if(Uu)return Si;Uu=1;var t=Ae();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,$u;function $s(){if($u)return Ii;$u=1;var t=Je(),e=we(),r=Ln(),n=As(),a=_p(),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,Lu;function $h(){if(Lu)return Pi;Lu=1;var t=Ae(),e=we(),r=Ze(),n=Xr(),a=$s(),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 v={};return c[u].call(v)!==v});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,qu;function kr(){if(qu)return Ei;qu=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,ju;function Lh(){if(ju)return ki;ju=1;var t=$h().IteratorPrototype,e=Xr(),r=Yt(),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 _i,Nu;function Tp(){if(Nu)return _i;Nu=1;var t=pe(),e=nt();return _i=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},_i}var Ti,xu;function Rp(){if(xu)return Ti;xu=1;var t=Ze();return Ti=function(e){return t(e)||e===null},Ti}var Ri,Du;function Op(){if(Du)return Ri;Du=1;var t=Rp(),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,Mu;function Ls(){if(Mu)return Oi;Mu=1;var t=Tp(),e=Ze(),r=$n(),n=Op();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,Fu;function qh(){if(Fu)return Ci;Fu=1;var t=Ie(),e=je(),r=ut(),n=Rh(),a=we(),i=Lh(),o=$s(),s=Ls(),u=kr(),l=Xt(),c=Xe(),f=Ue(),h=Qr(),d=$h(),v=n.PROPER,p=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,j,z,V,te,q,M){i(z,j,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in L)return L[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=j+" Iterator",O=!1,L=A.prototype,F=L[w]||L["@@iterator"]||te&&L[te],I=!P&&F||N(te),_=j==="Array"&&L.entries||F,x,H,Y;if(_&&(x=o(_.call(new A)),x!==Object.prototype&&x.next&&(!r&&o(x)!==g&&(s?s(x,g):a(x[w])||c(x,w,R)),u(x,S,!0,!0),r&&(h[S]=R))),v&&te===m&&F&&F.name!==m&&(!r&&p?l(L,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(H={values:N(m),keys:q?I:N(y),entries:N(b)},M)for(Y in H)(P||O||!(Y in L))&&c(L,Y,H[Y]);else t({target:j,proto:!0,forced:P||O},H);return(!r||M)&&L[w]!==I&&c(L,w,I,{name:te}),h[j]=I,H},Ci}var Ai,Ku;function qs(){return Ku||(Ku=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,zu;function js(){if(zu)return Ui;zu=1;var t=Zr(),e=Ip(),r=Qr(),n=Er(),a=yt().f,i=qh(),o=qs(),s=ut(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ui=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ui}var Hu={},Bu;function Cp(){if(Bu)return Hu;Bu=1;var t=Ie(),e=pe(),r=Ih(),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,"")}}),Hu}var $i,Gu;function jh(){if(Gu)return $i;Gu=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,Wu;function xn(){if(Wu)return Li;Wu=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,Vu;function Dn(){if(Vu)return qi;Vu=1;var t=Oh(),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 ji,Ju;function Ap(){if(Ju)return ji;Ju=1;var t=Xe();return ji=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},ji}var Ni,Zu;function Ns(){if(Zu)return Ni;Zu=1;var t=jn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var xi,Yu;function Up(){if(Yu)return xi;Yu=1;var t=An(),e=pe();return xi=function(r){if(t(r)==="Function")return e(r)},xi}var Di,Xu;function _r(){if(Xu)return Di;Xu=1;var t=Up(),e=nt(),r=Cn(),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,Qu;function xs(){if(Qu)return Mi;Qu=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,el;function en(){if(el)return Fi;el=1;var t=xs(),e=we(),r=An(),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,tl;function wt(){if(tl)return Ki;tl=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,rl;function Mn(){if(rl)return zi;rl=1;var t=en(),e=_s(),r=Un(),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,nl;function Ds(){if(nl)return Hi;nl=1;var t=je(),e=nt(),r=rt(),n=Nn(),a=Mn(),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,al;function Qt(){if(al)return Bi;al=1;var t=TypeError;return Bi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Bi}var Gi,il;function Fn(){if(il)return Gi;il=1;var t=pe();return Gi=t([].slice),Gi}var Wi,ol;function $p(){if(ol)return Wi;ol=1;var t=Fn(),e=Math.floor,r=function(n,a){var i=n.length;if(i<8)for(var o=1,s,u;o<i;){for(u=o,s=n[o];u&&a(n[u-1],s)>0;)n[u]=n[--u];u!==o++&&(n[u]=s)}else for(var l=e(i/2),c=r(t(n,0,l),a),f=r(t(n,l),a),h=c.length,d=f.length,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Wi=r,Wi}var Vi,sl;function Nh(){if(sl)return Vi;sl=1,js(),Cp();var t=Ie(),e=me(),r=jh(),n=Ye(),a=je(),i=pe(),o=$e(),s=xn(),u=Xe(),l=Dn(),c=Ap(),f=kr(),h=Lh(),d=Er(),v=Ns(),p=we(),g=Je(),P=_r(),w=en(),y=rt(),m=Ze(),b=wt(),R=Xr(),A=Yt(),j=Ds(),z=Mn(),V=qs(),te=Qt(),q=Ue(),M=$p(),N=q("iterator"),S="URLSearchParams",O=S+"Iterator",L=d.set,F=d.getterFor(S),I=d.getterFor(O),_=r("fetch"),x=r("Request"),H=r("Headers"),Y=x&&x.prototype,J=H&&H.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ce=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),Rt=i("".split),Ot=i("".slice),Ar=i(/./.exec),er=/\+/g,Ct="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ot(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},At=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,er," ");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 se=et(D,Z+1);if(se!==se){W+=ie,Z++;continue}Z+=2;var he=At(se);if(he===0)ie=ce(se);else{if(he===1||he>4){W+=Ct,Z++;continue}for(var ve=[se],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(ve,qe),Z+=2,be++}if(ve.length!==he){W+=Ct;continue}var at=K(ve);at===null?W+=Ct:ie=ae(at)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return ue[D]},He=function(D){return Qe(ne(D),oe,de)},_e=h(function(G,W){L(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)==="?"?Ot(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,se,he,ve,be,qe;if(W)for(Z=j(D,W),ie=Z.next;!(se=a(ie,Z)).done;){if(he=j(y(se.value)),ve=he.next,(be=a(ve,he)).done||(qe=a(ve,he)).done||!a(ve,he).done)throw new fe("Expected sequence with length 2");Le(G,{key:b(be.value),value:b(qe.value)})}else for(var at in D)g(D,at)&&Le(G,{key:at,value:b(D[at])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Rt(D,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Rt(ie,"="),Le(G,{key:X(St(se)),value:X(De(se,"="))}))},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 Te=function(){v(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=L(this,new Me(G));o||(this.size=W.entries.length)},Ge=Te.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),se=W<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<Z.length;){var be=Z[ve];if(be.key===ie&&(he===void 0||be.value===he)){if(It(Z,ve,1),he!==void 0)break}else ve++}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=[],se=0;se<W.length;se++)W[se].key===Z&&Le(ie,W[se].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),se=Z<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<W.length;){var be=W[ve++];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,se=!1,he=b(G),ve=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(se?It(ie,be--,1):(se=!0,qe.value=ve));se||Le(ie,{key:he,value:ve}),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,se;ie<W.length;)se=W[ie++],Z(se.value,se.key,this)},keys:function(){return new _e(this,"keys")},values:function(){return new _e(this,"values")},entries:function(){return new _e(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(Te,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Te}),!s&&p(H)){var tr=i(J.has),Ur=i(J.set),rr=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,tr(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(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?rr(arguments[1]):{})}}),p(x)){var nr=function(G){return v(this,Y),new x(G,arguments.length>1?rr(arguments[1]):{})};Y.constructor=nr,nr.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:nr})}}return Vi={URLSearchParams:Te,getState:F},Vi}var cl;function Lp(){return cl||(cl=1,Nh()),vc}var ul={},ll;function qp(){if(ll)return ul;ll=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(R,A){l(v,{key:A,value:R})}),n(h,1);for(var p=r(f),g=r(d),P=0,w=0,y=!1,m=v.length,b;P<m;)b=v[P++],y||b.key===p?(y=!0,s(this,b.key)):w++;for(;w<m;)b=v[w++],b.key===p&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),ul}var fl={},dl;function jp(){if(dl)return fl;dl=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),fl}var hl={},vl;function Np(){if(vl)return hl;vl=1;var t=$e(),e=pe(),r=Dn(),n=URLSearchParams.prototype,a=e(n.forEach);return t&&!("size"in n)&&r(n,"size",{get:function(){var o=0;return a(this,function(){o++}),o},configurable:!0,enumerable:!0}),hl}var Ji,pl;function Kn(){if(pl)return Ji;pl=1;var t=me();return Ji=t,Ji}var Zi,ml;function xh(){if(ml)return Zi;ml=1,Lp(),qp(),jp(),Np();var t=Kn();return Zi=t.URLSearchParams,Zi}var gl={},yl={},wl={},Yi,bl;function Dh(){if(bl)return Yi;bl=1;var t=pe(),e=Ts(),r=wt(),n=$n(),a=t("".charAt),i=t("".charCodeAt),o=t("".slice),s=function(u){return function(l,c){var f=r(n(l)),h=e(c),d=f.length,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Yi={codeAt:s(!1),charAt:s(!0)},Yi}var Sl;function Mh(){if(Sl)return wl;Sl=1;var t=Dh().charAt,e=wt(),r=Er(),n=qh(),a=qs(),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))}),wl}var Xi,Il;function xp(){if(Il)return Xi;Il=1;var t=$e(),e=pe(),r=je(),n=Ae(),a=Eh(),i=Ch(),o=_h(),s=Ln(),u=dh(),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={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(g){d[g]=g}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),g=arguments.length,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,j;R>A;)j=b[A++],(!t||r(y,m,j))&&(p[j]=m[j]);return p}:l,Xi}var Qi,Pl;function Fh(){if(Pl)return Qi;Pl=1;var t=je(),e=rt(),r=_s();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,El;function Dp(){if(El)return eo;El=1;var t=rt(),e=Fh();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,kl;function Kh(){if(kl)return to;kl=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,_l;function zh(){if(_l)return ro;_l=1;var t=pe(),e=Ae(),r=we(),n=en(),a=Ye(),i=Us(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,ro=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,ro}var no,Tl;function Mp(){if(Tl)return no;Tl=1;var t=$e(),e=yt(),r=Yt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Rl;function Fp(){if(Rl)return ao;Rl=1;var t=_r(),e=je(),r=Ln(),n=Dp(),a=Kh(),i=zh(),o=Rs(),s=Mp(),u=Ds(),l=Mn(),c=Array;return ao=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,j,z;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),j=A.next;!(R=e(j,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=v?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,Ol;function Kp(){if(Ol)return io;Ol=1;var t=pe(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),j=function(q){for(var M=[],N=0,S=q.length;N<S;){var O=w(q,N++);if(O>=55296&&O<=56319&&N<S){var L=w(q,N++);(L&64512)===56320?m(M,((O&1023)<<10)+(L&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function(q){return q+22+75*(q<26)},V=function(q,M,N){var S=0;for(q=N?g(q/o):q>>1,q+=g(q/M);q>d*a>>1;)q=g(q/d),S+=r;return g(S+(d+1)*q/(q+i))},te=function(q){var M=[];q=j(q);var N=q.length,S=u,O=0,L=s,F,I;for(F=0;F<q.length;F++)I=q[F],I<128&&m(M,P(I));var _=M.length,x=_;for(_&&m(M,l);x<N;){var H=e;for(F=0;F<q.length;F++)I=q[F],I>=S&&I<H&&(H=I);var Y=x+1;if(H-S>g((e-O)/Y))throw new v(h);for(O+=(H-S)*Y,S=H,F=0;F<q.length;F++){if(I=q[F],I<S&&++O>e)throw new v(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=L?n:fe>=L+a?a:fe-L;if(J<ne)break;var ce=J-ne,ae=r-ne;m(M,P(z(ne+ce%ae))),J=g(ce/ae),fe+=r}m(M,P(z(J))),L=V(O,Y,x===_),O=0,x++}}O++,S++}return y(M,"")};return io=function(q){var M=[],N=R(b(A(q),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,p(c,O)?"xn--"+te(O):O);return y(M,".")},io}var Cl;function zp(){if(Cl)return yl;Cl=1,Mh();var t=Ie(),e=$e(),r=xn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Dn(),u=Ns(),l=Je(),c=xp(),f=Fp(),h=Fn(),d=Dh().codeAt,v=Kp(),p=wt(),g=kr(),P=Qt(),w=Nh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,j=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,q=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),L=i([].pop),F=i([].push),I=i("".replace),_=i([].shift),x=i("".split),H=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ce="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,Rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ot=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,er=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ct=/[\t\n\r]/g,ge,et=function(k){var $=x(k,"."),T,E,C,re,B,ye,Se;if($.length&&$[$.length-1]===""&&$.length--,T=$.length,T>4)return k;for(E=[],C=0;C<T;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<T;C++)if(ye=E[C],C===T-1){if(ye>=q(256,5-T))return null}else if(ye>255)return null;for(Se=L(E),C=0;C<E.length;C++)Se+=E[C]*q(256,3-C);return Se},At=function(k){var $=[0,0,0,0,0,0,0,0],T=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,T++,E=T}for(;Pe();){if(T===8)return;if(Pe()===":"){if(E!==null)return;C++,T++,E=T;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,T>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++}$[T]=$[T]*256+Se,ye++,(ye===2||ye===4)&&T++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;$[T++]=re}if(E!==null)for(Ve=T-E,T=7;T!==0&&Ve>0;)U=$[T],$[T--]=$[E+Ve-1],$[E+--Ve]=U;else if(T!==8)return;return $},K=function(k){for(var $=null,T=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>T&&($=E,T=C),E=null,C=0):(E===null&&(E=re),++C);return C>T?E:$},X=function(k){var $,T,E,C;if(typeof k=="number"){for($=[],T=0;T<4;T++)J($,k%256),k=te(k/256);return S($,".")}if(typeof k=="object"){for($="",E=K(k),T=0;T<8;T++)C&&k[T]===0||(C&&(C=!1),E===T?($+=T?":":"::",C=!0):($+=O(k[T],16),T<7&&($+=":")));return"["+$+"]"}return k},oe={},ue=c({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},ue,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),_e=function(k,$){var T=d(k,0);return T>32&&T<127&&!l($,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Te=function(k,$){var T;return k.length===2&&N(ke,M(k,0))&&((T=M(k,1))===":"||!$&&T==="|")},Ge=function(k){var $;return k.length>1&&Te(H(k,0,2))&&(k.length===2||($=M(k,2))==="/"||$==="\\"||$==="?"||$==="#")},tr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},rr={},nr={},D={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},at={},ea={},sc={},ta={},ar={},it={},cc={},Ut={},lt={},ra=function(k,$,T){var E=p(k),C,re,B;if($){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(T!==void 0&&(C=new ra(T,!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,$,T){var E=this,C=$||rr,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=p(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,er,"$1")),k=I(k,Ct,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case rr:if(U&&N(ke,U))B+=Y(U),C=nr;else{if($)return ne;C=D;continue}break;case nr: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()&&T&&T.scheme===E.scheme?C=G:E.isSpecial()?C=se:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=cc)}else{if($)return ne;B="",C=D,re=0;continue}break;case D:if(!T||T.cannotBeABaseURL&&U!=="#")return ne;if(T.cannotBeABaseURL&&U==="#"){E.scheme=T.scheme,E.path=h(T.path),E.query=T.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=T.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=ve;break}else{C=it;continue}case Z:if(E.scheme=T.scheme,U===ge)E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query="",C=Ut;else if(U==="#")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.path.length--,C=it;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=ve;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,C=it;continue}break;case se:if(C=he,U!=="/"||M(B,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=ve;continue}break;case ve:if(U==="@"){ye&&(B="%40"+B),ye=!0,Pe=f(B);for(var na=0;na<Pe.length;na++){var fc=Pe[na];if(fc===":"&&!Re){Re=!0;continue}var dc=_e(fc,He);Re?E.password+=dc:E.username+=dc}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 ce;if(ft=E.parseHost(B),ft)return ft;if(B="",C=at,$===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ce;if($&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=ar,$)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case at: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=ar;continue}else return ae;break;case ea:if(E.scheme="file",U==="/"||U==="\\")C=sc;else if(T&&T.scheme==="file")switch(U){case ge:E.host=T.host,E.path=h(T.path),E.query=T.query;break;case"?":E.host=T.host,E.path=h(T.path),E.query="",C=Ut;break;case"#":E.host=T.host,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=T.host,E.path=h(T.path),E.shortenPath()),C=it;continue}else{C=it;continue}break;case sc:if(U==="/"||U==="\\"){C=ta;break}T&&T.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(Te(T.path[0],!0)?F(E.path,T.path[0]):E.host=T.host),C=it;continue;case ta:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&Te(B))C=it;else if(B===""){if(E.host="",$)return;C=ar}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),$)return;B="",C=ar}continue}else B+=U;break;case ar:if(E.isSpecial()){if(C=it,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")E.query="",C=Ut;else if(!$&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=it,U!=="/"))continue;break;case it:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!$&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):tr(B)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&Te(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]==="";)_(E.path);U==="?"?(E.query="",C=Ut):U==="#"&&(E.fragment="",C=lt)}else B+=_e(U,de);break;case cc:U==="?"?(E.query="",C=Ut):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=_e(U,oe));break;case Ut:!$&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=_e(U,oe));break;case lt:U!==ge&&(E.fragment+=_e(U,ue));break}re++}},parseHost:function(k){var $,T,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||($=At(H(k,1,-1)),!$))return ce;this.host=$}else if(this.isSpecial()){if(k=v(k),N(Rt,k)||($=et(k),$===null))return ce;this.host=$}else{if(N(Ot,k))return ce;for($="",T=f(k),E=0;E<T.length;E++)$+=_e(T[E],oe);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||!Te(k[0],!0))&&k.length--},serialize:function(){var k=this,$=k.scheme,T=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+=T+(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 ir(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(p(k)+":",rr)},getUsername:function(){return this.username},setUsername:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var T=0;T<$.length;T++)this.username+=_e($[T],He)}},getPassword:function(){return this.password},setPassword:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var T=0;T<$.length;T++)this.password+=_e($[T],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?"":p(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=p(k),k===""?this.port=null:this.parse(k,at))},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,ar))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=p(k),k===""?this.query=null:(M(k,0)==="?"&&(k=H(k,1)),this.query="",this.parse(k,Ut)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=p(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 ir=function($){var T=u(this,xe),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(T,new ra($,!1,E));e||(T.href=C.serialize(),T.origin=C.getOrigin(),T.protocol=C.getProtocol(),T.username=C.getUsername(),T.password=C.getPassword(),T.host=C.getHost(),T.hostname=C.getHostname(),T.port=C.getPort(),T.pathname=C.getPathname(),T.search=C.getSearch(),T.searchParams=C.getSearchParams(),T.hash=C.getHash())},xe=ir.prototype,We=function(k,$){return{get:function(){return b(this)[k]()},set:$&&function(T){return b(this)[$](T)},configurable:!0,enumerable:!0}};if(e&&(s(xe,"href",We("serialize","setHref")),s(xe,"origin",We("getOrigin")),s(xe,"protocol",We("getProtocol","setProtocol")),s(xe,"username",We("getUsername","setUsername")),s(xe,"password",We("getPassword","setPassword")),s(xe,"host",We("getHost","setHost")),s(xe,"hostname",We("getHostname","setHostname")),s(xe,"port",We("getPort","setPort")),s(xe,"pathname",We("getPathname","setPathname")),s(xe,"search",We("getSearch","setSearch")),s(xe,"searchParams",We("getSearchParams")),s(xe,"hash",We("getHash","setHash"))),o(xe,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(xe,"toString",function(){return b(this).serialize()},{enumerable:!0}),j){var uc=j.createObjectURL,lc=j.revokeObjectURL;uc&&o(ir,"createObjectURL",a(uc,j)),lc&&o(ir,"revokeObjectURL",a(lc,j))}return g(ir,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:ir}),yl}var Al;function Hp(){return Al||(Al=1,zp()),gl}var Ul={},$l;function Bp(){if($l)return Ul;$l=1;var t=Ie(),e=Ye(),r=Ae(),n=Qt(),a=wt(),i=xn(),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}}}),Ul}var Ll={},ql;function Gp(){if(ql)return Ll;ql=1;var t=Ie(),e=Ye(),r=Qt(),n=wt(),a=xn(),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}}}),Ll}var jl={},Nl;function Wp(){if(Nl)return jl;Nl=1;var t=Ie(),e=je();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),jl}var oo,xl;function Vp(){if(xl)return oo;xl=1,xh(),Hp(),Bp(),Gp(),Wp();var t=Kn();return oo=t.URL,oo}var so,Dl;function Jp(){if(Dl)return so;Dl=1;var t=Vp();return so=t,so}var co,Ml;function Zp(){if(Ml)return co;Ml=1;var t=Jp();return co=t,co}Zp();var Fl={},uo,Kl;function Yp(){return Kl||(Kl=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,zl;function Xp(){if(zl)return lo;zl=1;var t=qn(),e=t("span").classList,r=e&&e.constructor&&e.constructor.prototype;return lo=r===Object.prototype?void 0:r,lo}var Hl;function Hh(){if(Hl)return Fl;Hl=1;var t=me(),e=Yp(),r=Xp(),n=js(),a=Xt(),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"),Fl}var fo,Bl;function Qp(){if(Bl)return fo;Bl=1;var t=xh();return Hh(),fo=t,fo}var ho,Gl;function em(){if(Gl)return ho;Gl=1;var t=Qp();return ho=t,ho}em();var Wl={},Vl={},vo,Jl;function tm(){if(Jl)return vo;Jl=1;var t=Ze(),e=Xt();return vo=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},vo}var po,Zl;function rm(){if(Zl)return po;Zl=1;var t=pe(),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 po=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},po}var mo,Yl;function nm(){if(Yl)return mo;Yl=1;var t=Ae(),e=Yt();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,Xl;function am(){if(Xl)return go;Xl=1;var t=Xt(),e=rm(),r=nm(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,Ql;function tn(){if(Ql)return yo;Ql=1;var t=_r(),e=je(),r=rt(),n=Nn(),a=Kh(),i=Rs(),o=jn(),s=Ds(),u=Mn(),l=Fh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return yo=function(d,v,p){var g=p&&p.that,P=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),R,A,j,z,V,te,q,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(j=0,z=i(d);z>j;j++)if(V=N(d[j]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!(q=e(te,R)).done;){try{V=N(q.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},yo}var wo,ef;function im(){if(ef)return wo;ef=1;var t=wt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var tf;function om(){if(tf)return Vl;tf=1;var t=Ie(),e=jn(),r=$s(),n=Ls(),a=Ah(),i=Xr(),o=Xt(),s=Yt(),u=tm(),l=am(),c=tn(),f=im(),h=Ue(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new v,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,p,{that:A}),o(R,"errors",A),R};n?n(g,v):a(g,v,{name:!0});var P=g.prototype=i(v.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Vl}var rf;function sm(){return rf||(rf=1,om()),Wl}var nf={},bo,af;function cm(){if(af)return bo;af=1;var t=xs(),e=en();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var of;function um(){if(of)return nf;of=1;var t=xs(),e=Xe(),r=cm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),nf}var sf={},cf={},So,uf;function Bh(){if(uf)return So;uf=1;var t=me(),e=Yr(),r=An(),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,lf;function Ms(){if(lf)return Io;lf=1;var t=Bh();return Io=t==="NODE",Io}var Po,ff;function lm(){if(ff)return Po;ff=1;var t=Ye(),e=Dn(),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,df;function fm(){if(df)return Eo;df=1;var t=zh(),e=Nn(),r=TypeError;return Eo=function(n){if(t(n))return n;throw new r(e(n)+" is not a constructor")},Eo}var ko,hf;function Gh(){if(hf)return ko;hf=1;var t=rt(),e=fm(),r=Un(),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 _o,vf;function Wh(){if(vf)return _o;vf=1;var t=Cn(),e=Function.prototype,r=e.apply,n=e.call;return _o=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),_o}var To,pf;function Vh(){if(pf)return To;pf=1;var t=Yr();return To=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),To}var Ro,mf;function Jh(){if(mf)return Ro;mf=1;var t=me(),e=Wh(),r=_r(),n=we(),a=Je(),i=Ae(),o=kh(),s=Fn(),u=qn(),l=Qt(),c=Vh(),f=Ms(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,j,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)}},q=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),L=s(arguments,1);return m[++y]=function(){e(O,void 0,L)},A(y),y},d=function(S){delete m[S]},f?A=function(N){v.nextTick(te(N))}:p&&p.now?A=function(N){p.now(te(N))}:P&&!c?(j=new P,z=j.port2,j.port1.onmessage=q,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",q,!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,gf;function Zh(){if(gf)return Oo;gf=1;var t=function(){this.head=null,this.tail=null};return t.prototype={add:function(e){var r={item:e,next:null},n=this.tail;n?n.next=r:this.head=r,this.tail=r},get:function(){var e=this.head;if(e){var r=this.head=e.next;return r===null&&(this.tail=null),e.item}}},Oo=t,Oo}var Co,yf;function dm(){if(yf)return Co;yf=1;var t=Yr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,wf;function hm(){if(wf)return Ao;wf=1;var t=Yr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,bf;function vm(){if(bf)return Uo;bf=1;var t=me(),e=jh(),r=_r(),n=Jh().set,a=Zh(),i=Vh(),o=dm(),s=hm(),u=Ms(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,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&&v(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(p=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),v=function(){g.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),v=function(){w(m)}):u?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(b){y.head||v(),y.add(b)}}return Uo=d,Uo}var $o,Sf;function pm(){return Sf||(Sf=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}var Lo,If;function Tr(){return If||(If=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var qo,Pf;function Rr(){if(Pf)return qo;Pf=1;var t=me();return qo=t.Promise,qo}var jo,Ef;function rn(){if(Ef)return jo;Ef=1;var t=me(),e=Rr(),r=we(),n=Uh(),a=Us(),i=Ue(),o=Bh(),s=ut(),u=ph(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var 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!p&&(o==="BROWSER"||o==="DENO")&&!h});return jo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},jo}var No={},kf;function bt(){if(kf)return No;kf=1;var t=nt(),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 _f;function mm(){if(_f)return cf;_f=1;var t=Ie(),e=ut(),r=Ms(),n=me(),a=Kn(),i=je(),o=Xe(),s=Ls(),u=kr(),l=lm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Gh(),p=Jh().set,g=vm(),P=pm(),w=Tr(),y=Zh(),m=Er(),b=Rr(),R=rn(),A=bt(),j="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,q=m.getterFor(j),M=m.set,N=b&&b.prototype,S=b,O=N,L=n.TypeError,F=n.document,I=n.process,_=A.f,x=_,H=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ce=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 oe=X.value,ue=X.state===ne,de=ue?K.ok:K.fail,He=K.resolve,_e=K.reject,Me=K.domain,Te,Ge,tr;try{de?(ue||(X.rejection===ke&&Ct(X),X.rejection=ae),de===!0?Te=oe:(Me&&Me.enter(),Te=de(oe),Me&&(Me.exit(),tr=!0)),Te===K.promise?_e(new L("Promise-chain cycle")):(Ge=St(Te))?i(Ge,Te,He,_e):He(Te)):_e(oe)}catch(Ur){Me&&!tr&&Me.exit(),_e(Ur)}},Rt=function(K,X){K.notified||(K.notified=!0,g(function(){for(var oe=K.reactions,ue;ue=oe.get();)It(ue,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ot=function(K,X,oe){var ue,de;H?(ue=F.createEvent("Event"),ue.promise=X,ue.reason=oe,ue.initEvent(K,!1,!0),n.dispatchEvent(ue)):ue={promise:X,reason:oe},!V&&(de=n["on"+K])?de(ue):K===Y&&P("Unhandled promise rejection",oe)},Ar=function(K){i(p,n,function(){var X=K.facade,oe=K.value,ue=er(K),de;if(ue&&(de=w(function(){r?I.emit("unhandledRejection",oe,X):Ot(Y,X,oe)}),K.rejection=r||er(K)?ke:ae,de.error))throw de.value})},er=function(K){return K.rejection!==ae&&!K.parent},Ct=function(K){i(p,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ot(J,X,K.value)})},ge=function(K,X,oe){return function(ue){K(X,ue,oe)}},et=function(K,X,oe){K.done||(K.done=!0,oe&&(K=oe),K.value=X,K.state=ce,Rt(K,!0))},At=function(K,X,oe){if(!K.done){K.done=!0,oe&&(K=oe);try{if(K.facade===X)throw new L("Promise can't be resolved itself");var ue=St(X);ue?g(function(){var de={done:!1};try{i(ue,X,ge(At,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Rt(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var oe=q(this);try{X(ge(At,oe),ge(et,oe))}catch(ue){et(oe,ue)}},O=S.prototype,Ne=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,oe){var ue=q(this),de=_(v(this,S));return ue.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?I.domain:void 0,ue.state===fe?ue.reactions.add(de):g(function(){It(de,ue)}),de.promise}),De=function(){var K=new Ne,X=q(K);this.promise=K,this.resolve=ge(At,X),this.reject=ge(et,X)},A.f=_=function(K){return K===S||K===Le?new De(K):x(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,oe){var ue=this;return new S(function(de,He){i(Qe,ue,de,He)}).then(X,oe)},{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,j,!1,!0),l(j),cf}var Tf={},xo,Rf;function gm(){if(Rf)return xo;Rf=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 xo=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},xo}var Do,Of;function zn(){if(Of)return Do;Of=1;var t=Rr(),e=gm(),r=rn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Cf;function ym(){if(Cf)return Tf;Cf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=zn();return t({target:"Promise",stat:!0,forced:o},{all:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Tf}var Af={},Uf;function wm(){if(Uf)return Af;Uf=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 Af}var $f={},Lf;function bm(){if(Lf)return $f;Lf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=zn();return t({target:"Promise",stat:!0,forced:o},{race:function(u){var l=this,c=n.f(l),f=c.reject,h=a(function(){var d=r(l.resolve);i(u,function(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),$f}var qf={},jf;function Sm(){if(jf)return qf;jf=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}}),qf}var Nf={},Mo,xf;function Yh(){if(xf)return Mo;xf=1;var t=rt(),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 Df;function Im(){if(Df)return Nf;Df=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=rn().CONSTRUCTOR,i=Yh(),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)}}),Nf}var Mf;function Pm(){return Mf||(Mf=1,mm(),ym(),wm(),bm(),Sm(),Im()),sf}var Ff={},Kf;function Em(){if(Kf)return Ff;Kf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=tn(),o=zn();return t({target:"Promise",stat:!0,forced:o},{allSettled:function(u){var l=this,c=n.f(l),f=c.resolve,h=c.reject,d=a(function(){var v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--P||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Ff}var zf={},Hf;function km(){if(Hf)return zf;Hf=1;var t=Ie(),e=je(),r=nt(),n=Ye(),a=bt(),i=Tr(),o=tn(),s=zn(),u="No one promise resolved";return t({target:"Promise",stat:!0,forced:s},{any:function(c){var f=this,h=n("AggregateError"),d=a.f(f),v=d.resolve,p=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,j=!1;m++,e(P,f,R).then(function(z){j||b||(b=!0,v(z))},function(z){j||b||(j=!0,w[A]=z,--m||p(new h(w,u)))})}),--m||p(new h(w,u))});return g.error&&p(g.value),d.promise}}),zf}var Bf={},Gf;function Xh(){if(Gf)return Bf;Gf=1;var t=Ie(),e=me(),r=Wh(),n=Fn(),a=bt(),i=nt(),o=Tr(),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}}),Bf}var Wf={},Vf;function Qh(){if(Vf)return Wf;Vf=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}}}),Wf}var Jf={},Zf;function _m(){if(Zf)return Jf;Zf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Gh(),s=Yh(),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")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Jf}var Fo,Yf;function Tm(){if(Yf)return Fo;Yf=1,sm(),js(),um(),Pm(),Em(),km(),Xh(),Qh(),_m(),Mh();var t=Kn();return Fo=t.Promise,Fo}var Ko,Xf;function Rm(){if(Xf)return Ko;Xf=1;var t=Tm();return Hh(),Ko=t,Ko}var Qf={},ed;function Om(){return ed||(ed=1,Xh()),Qf}var td={},rd;function Cm(){return rd||(rd=1,Qh()),td}var zo,nd;function Am(){if(nd)return zo;nd=1;var t=Rm();return Om(),Cm(),zo=t,zo}Am();const ev="sesamy-debug";function Um(t,e,r){const n=new Date;n.setTime(n.getTime()+r*60*60*1e3);const a="expires="+n.toUTCString();document.cookie=`${t}=${e}; ${a}; path=/`}function $m(t){if(typeof document>"u")return null;const e=t+"=",r=document.cookie.split(";");for(let n=0;n<r.length;n++){let a=r[n];for(;a.charAt(0)===" ";)a=a.substring(1);if(a.indexOf(e)===0)return a.substring(e.length,a.length)}return null}function Lm(t){Um(ev,t.toString(),1)}function qm(){return $m(ev)==="true"}function le(t){qm()&&console.log(t)}function Wt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});le(`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 Fs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ks(t,e){return t(e={exports:{}},e.exports),e.exports}var Lt=Ks((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()}}));Fs(Lt);var jm=Fs(Ks((function(t,e){var r=jt&&jt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function g(y){try{w(d.next(y))}catch(m){p(m)}}function P(y){try{w(d.throw(y))}catch(m){p(m)}}function w(y){y.done?v(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=jt&&jt.__generator||function(c,f){var h,d,v,p,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;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&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return g.label++,{value:m[1],done:!1};case 5:g.label++,d=m[1],m=[0];continue;case 7:m=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){g.label=m[1];break}if(m[0]===6&&g.label<v[1]){g.label=v[1],v=m;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(m);break}v[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=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,v,p,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(p))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,Lt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(g=p.getItemSync(f))===null?(Lt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),Lt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Lt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);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,v,p;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,Lt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),Lt.default().unlock(p.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var g=d.keySync(p);if(g===null)break;v.push(g),p++}for(var P=!1,w=0;w<v.length;w++){var y=v[w];if(y.includes(i)){var m=d.getItemSync(y);if(m!==null){var b=JSON.parse(m);(b.timeRefreshed===void 0&&b.timeAcquired<h||b.timeRefreshed!==void 0&&b.timeRefreshed<h)&&(d.removeItemSync(y),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const Nm={timeoutInSeconds:60},tv={name:"auth0-spa-js",version:"2.8.0"},rv=()=>Date.now();let Ee=class ss extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,ss.prototype)}static fromPayload({error:e,error_description:r}){return new ss(e,r)}},xm=class nv extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,nv.prototype)}},Dm=class av extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,av.prototype)}},cs=class iv extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,iv.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Mm=class ov extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,ov.prototype)}},Fm=class sv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,sv.prototype)}},cv=class uv extends Ee{constructor(e,r){super("missing_refresh_token",`Missing Refresh Token (audience: '${yn(e,["default"])}', scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,uv.prototype)}},Km=class lv extends Ee{constructor(e,r){super("missing_scopes",`Missing requested scopes after refresh (audience: '${yn(e,["default"])}', missing scope: '${yn(r)}')`),this.audience=e,this.scope=r,Object.setPrototypeOf(this,lv.prototype)}},fv=class dv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,dv.prototype)}};function yn(t,e=[]){return t&&!e.includes(t)?t:""}const wn=()=>window.crypto,Lr=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let e="";return Array.from(wn().getRandomValues(new Uint8Array(43))).forEach((r=>e+=t[r%t.length])),e},Ho=t=>btoa(t),zm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Hm=t=>Object.keys(t).reduce(((e,r)=>{const n=zm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),us=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()},ad=async t=>await wn().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),id=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),od=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Bm=new TextEncoder,Gm=new TextDecoder;function zr(t){return typeof t=="string"?Bm.encode(t):Gm.decode(t)}function sd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Vm(`${t.name} modulusLength must be at least 2048 bits`)}async function Wm(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 sd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return sd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Dt})(r),r,zr(n)))}`}let ls;Uint8Array.prototype.toBase64?ls=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):ls=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 ls(t)}let Dt=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)}},Vm=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 Jm(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Dt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Dt("unsupported CryptoKey algorithm name")}}function hv(t){return t instanceof CryptoKey}function vv(t){return hv(t)&&t.type==="public"}async function Zm(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!hv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!vv(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 Wm({alg:Jm(o),typ:"dpop+jwt",jwk:await pv(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:r,nonce:n,htu:e,ath:a?Hr(await crypto.subtle.digest("SHA-256",zr(a))):void 0}),o)}async function pv(t){const{kty:e,e:r,n,x:a,y:i,crv:o}=await crypto.subtle.exportKey("jwk",t);return{kty:e,crv:o,e:r,n,x:a,y:i}}const Ym=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function Xm(){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 Dt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function Qm(t){return(async function(e){if(!vv(e))throw new TypeError('"publicKey" must be a public CryptoKey');if(e.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const r=await pv(e);let n;switch(r.kty){case"EC":n={crv:r.crv,kty:r.kty,x:r.x,y:r.y};break;case"OKP":n={crv:r.crv,kty:r.kty,x:r.x};break;case"RSA":n={e:r.e,kty:r.kty,n:r.n};break;default:throw new Dt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function eg({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 Zm(t,i,r,n,a)}const tg=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},rg=async(t,e,r)=>{const n=new AbortController;let a;return e.signal=n.signal,Promise.race([tg(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},ng=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},ag=async(t,e,r,n,a,i,o=1e4,s)=>a?ng(t,e,r,n,o,a,i,s):rg(t,n,o);async function mv(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 ag(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:v}=h,p=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=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Fm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new cv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new fv(w);return mv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function ig(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}),v=s?us(d):JSON.stringify(d),p=(g=c.grant_type,Ym.includes(g));var g;return await mv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Hm(o||tv)))}},e,s,u,p?l:void 0)}const hn=(...t)=>{return(e=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(e))).join(" ");var e},an=(t,e,r)=>{let n;return r&&(n=t[r]),n||(n=t.default),hn(n,e)};let ht=class fs{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 fs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new fs({scope:r,audience:n,clientId:a})}},og=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@@")))}},gv=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)}})()}},sg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||rv}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)}}}},cg=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",ug=["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"],lg=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(id(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],ug.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(id(s)),claims:f,user:h}})(t.id_token);if(!e.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(e.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${e.claims.iss}"`);if(!e.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(e.header.alg!=="RS256")throw new Error(`Signature algorithm of "${e.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!e.claims.aud||typeof e.claims.aud!="string"&&!Array.isArray(e.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(e.claims.aud)){if(!e.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${e.claims.aud.join(", ")}"`);if(e.claims.aud.length>1){if(!e.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(e.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${e.claims.azp}"`)}}else if(e.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${e.claims.aud}"`);if(t.nonce){if(!e.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(e.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${e.claims.nonce}"`)}if(t.max_age&&!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 Mt=Ks((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("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Fs(Mt),Mt.encode,Mt.parse,Mt.getAll;var fg=Mt.get,yv=Mt.set,wv=Mt.remove;const ur={get(t){const e=fg(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),yv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),wv(t,r)}},dg={get(t){return ur.get(t)||ur.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),yv(`_legacy_${t}`,JSON.stringify(e),n),ur.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),wv(t,r),ur.remove(t,e),ur.remove(`_legacy_${t}`,e)}},hg={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 Nt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Nt||(Nt={}));function vg(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 cd,ud,ld,Bo,pg=(cd="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ud=null,ld=!1,function(t){return Bo=Bo||vg(cd,ud,ld),new Worker(Bo,t)});const Go={};let mg=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 gg={memory:()=>new gv().enclosedCache,localstorage:()=>new og},fd=t=>gg[t],dd=t=>{const{openUrl:e,onRedirect:r}=t,n=st(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},hd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},$t={NONCE:"nonce",KEYPAIR:"keypair"};let yg=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($t).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($t.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save($t.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find($t.NONCE,this.buildKey(e))}findKeyPair(){return this.find($t.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($t.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId($t.KEYPAIR,this.clientId)}},wg=class{constructor(e){this.storage=new yg(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 Xm(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return eg(Object.assign({keyPair:r},e))}async calculateThumbprint(){return Qm(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var lr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(lr||(lr={}));let bg=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=lr.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?lr.DPoP:lr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===lr.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 fv(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)}},Sg=class{constructor(e,r){this.myAccountFetcher=e,this.apiBase=r}async connectAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/connect`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async completeAccount(e){const r=await this.myAccountFetcher.fetchWithAuth(`${this.apiBase}v1/connected-accounts/complete`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return this._handleResponse(r)}async _handleResponse(e){let r;try{r=await e.text(),r=JSON.parse(r)}catch(n){throw new vd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new vd(r)}},vd=class bv 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,bv.prototype)}};const Wo=new jm;let Ig=class{constructor(e){let r,n;if(this.userCache=new gv().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(!wn())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(wn().subtle===void 0)throw new Error(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var vc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},pc={},ia,mc;function Ae(){return mc||(mc=1,ia=function(t){try{return!!t()}catch{return!0}}),ia}var oa,gc;function Un(){if(gc)return oa;gc=1;var t=Ae();return oa=!t(function(){var e=(function(){}).bind();return typeof e!="function"||e.hasOwnProperty("prototype")}),oa}var sa,yc;function pe(){if(yc)return sa;yc=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,wc;function $n(){if(wc)return ca;wc=1;var t=pe(),e=t({}.toString),r=t("".slice);return ca=function(n){return r(e(n),8,-1)},ca}var ua,bc;function hh(){if(bc)return ua;bc=1;var t=pe(),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,Sc;function Ln(){return Sc||(Sc=1,la=function(t){return t==null}),la}var fa,Ic;function qn(){if(Ic)return fa;Ic=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,Pc;function Yr(){if(Pc)return da;Pc=1;var t=hh(),e=qn();return da=function(r){return t(e(r))},da}var $r,Ec;function me(){if(Ec)return $r;Ec=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 vc=="object"&&vc)||t(typeof $r=="object"&&$r)||(function(){return this})()||Function("return this")(),$r}var ha={exports:{}},va,kc;function ut(){return kc||(kc=1,va=!1),va}var pa,_c;function Es(){if(_c)return pa;_c=1;var t=me(),e=Object.defineProperty;return pa=function(r,n){try{e(t,r,{value:n,configurable:!0,writable:!0})}catch{t[r]=n}return n},pa}var Tc;function ks(){if(Tc)return ha.exports;Tc=1;var t=ut(),e=me(),r=Es(),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,Rc;function vh(){if(Rc)return ma;Rc=1;var t=ks();return ma=function(e,r){return t[e]||(t[e]=r||{})},ma}var ga,Oc;function jn(){if(Oc)return ga;Oc=1;var t=qn(),e=Object;return ga=function(r){return e(t(r))},ga}var ya,Cc;function Je(){if(Cc)return ya;Cc=1;var t=pe(),e=jn(),r=t({}.hasOwnProperty);return ya=Object.hasOwn||function(a,i){return r(e(a),i)},ya}var wa,Ac;function ph(){if(Ac)return wa;Ac=1;var t=pe(),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,Uc;function Xr(){if(Uc)return ba;Uc=1;var t=me(),e=t.navigator,r=e&&e.userAgent;return ba=r?String(r):"",ba}var Sa,$c;function mh(){if($c)return Sa;$c=1;var t=me(),e=Xr(),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,Lc;function gh(){if(Lc)return Ia;Lc=1;var t=mh(),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,qc;function yh(){if(qc)return Pa;qc=1;var t=gh();return Pa=t&&!Symbol.sham&&typeof Symbol.iterator=="symbol",Pa}var Ea,jc;function Ue(){if(jc)return Ea;jc=1;var t=me(),e=vh(),r=Je(),n=ph(),a=gh(),i=yh(),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,Nc;function we(){if(Nc)return ka;Nc=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 _a,xc;function Ze(){if(xc)return _a;xc=1;var t=we();return _a=function(e){return typeof e=="object"?e!==null:t(e)},_a}var Ta,Dc;function rt(){if(Dc)return Ta;Dc=1;var t=Ze(),e=String,r=TypeError;return Ta=function(n){if(t(n))return n;throw new r(e(n)+" is not an object")},Ta}var Ra={},Oa,Mc;function $e(){if(Mc)return Oa;Mc=1;var t=Ae();return Oa=!t(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),Oa}var Ca,Fc;function wh(){if(Fc)return Ca;Fc=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,Kc;function Nn(){if(Kc)return Ua;Kc=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,zc;function bh(){if(zc)return $a;zc=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,Hc;function je(){if(Hc)return La;Hc=1;var t=Un(),e=Function.prototype.call;return La=t?e.bind(e):function(){return e.apply(e,arguments)},La}var qa,Bc;function Ye(){if(Bc)return qa;Bc=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 ja,Gc;function xn(){if(Gc)return ja;Gc=1;var t=pe();return ja=t({}.isPrototypeOf),ja}var Na,Wc;function Sh(){if(Wc)return Na;Wc=1;var t=Ye(),e=we(),r=xn(),n=yh(),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 xa,Vc;function Dn(){if(Vc)return xa;Vc=1;var t=String;return xa=function(e){try{return t(e)}catch{return"Object"}},xa}var Da,Jc;function nt(){if(Jc)return Da;Jc=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,Zc;function _s(){if(Zc)return Ma;Zc=1;var t=nt(),e=Ln();return Ma=function(r,n){var a=r[n];return e(a)?void 0:t(a)},Ma}var Fa,Yc;function Sp(){if(Yc)return Fa;Yc=1;var t=je(),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,Xc;function Ip(){if(Xc)return Ka;Xc=1;var t=je(),e=Ze(),r=Sh(),n=_s(),a=Sp(),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,Qc;function Ih(){if(Qc)return za;Qc=1;var t=Ip(),e=Sh();return za=function(r){var n=t(r,"string");return e(n)?n:n+""},za}var eu;function yt(){if(eu)return Aa;eu=1;var t=$e(),e=bh(),r=wh(),n=rt(),a=Ih(),i=TypeError,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,u="enumerable",l="configurable",c="writable";return Aa.f=t?r?function(h,d,v){if(n(h),d=a(d),n(v),typeof h=="function"&&d==="prototype"&&"value"in v&&c in v&&!v[c]){var p=s(h,d);p&&p[c]&&(h[d]=v.value,v={configurable:l in v?v[l]:p[l],enumerable:u in v?v[u]:p[u],writable:!1})}return o(h,d,v)}:o:function(h,d,v){if(n(h),d=a(d),n(v),e)try{return o(h,d,v)}catch{}if("get"in v||"set"in v)throw new i("Accessors not supported");return"value"in v&&(h[d]=v.value),h},Aa}var Ha,tu;function Pp(){if(tu)return Ha;tu=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,ru;function Ts(){if(ru)return Ba;ru=1;var t=Pp();return Ba=function(e){var r=+e;return r!==r||r===0?0:t(r)},Ba}var Ga,nu;function Ph(){if(nu)return Ga;nu=1;var t=Ts(),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,au;function Ep(){if(au)return Wa;au=1;var t=Ts(),e=Math.min;return Wa=function(r){var n=t(r);return n>0?e(n,9007199254740991):0},Wa}var Va,iu;function Rs(){if(iu)return Va;iu=1;var t=Ep();return Va=function(e){return t(e.length)},Va}var Ja,ou;function kp(){if(ou)return Ja;ou=1;var t=Yr(),e=Ph(),r=Rs(),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,su;function Os(){return su||(su=1,Za={}),Za}var Ya,cu;function Eh(){if(cu)return Ya;cu=1;var t=pe(),e=Je(),r=Yr(),n=kp().indexOf,a=Os(),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,uu;function Cs(){return uu||(uu=1,Xa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]),Xa}var Qa,lu;function kh(){if(lu)return Qa;lu=1;var t=Eh(),e=Cs();return Qa=Object.keys||function(n){return t(n,e)},Qa}var fu;function _p(){if(fu)return Ra;fu=1;var t=$e(),e=wh(),r=yt(),n=rt(),a=Yr(),i=kh();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,du;function _h(){if(du)return ei;du=1;var t=Ye();return ei=t("document","documentElement"),ei}var ti,hu;function As(){if(hu)return ti;hu=1;var t=vh(),e=ph(),r=t("keys");return ti=function(n){return r[n]||(r[n]=e(n))},ti}var ri,vu;function Qr(){if(vu)return ri;vu=1;var t=rt(),e=_p(),r=Cs(),n=Os(),a=_h(),i=Nn(),o=As(),s=">",u="<",l="prototype",c="script",f=o("IE_PROTO"),h=function(){},d=function(w){return u+c+s+w+u+"/"+c+s},v=function(w){w.write(d("")),w.close();var y=w.parentWindow.Object;return w=null,y},p=function(){var w=i("iframe"),y="java"+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?v(g):p():v(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,pu;function Tp(){if(pu)return ni;pu=1;var t=Ue(),e=Qr(),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,mu;function en(){return mu||(mu=1,ai={}),ai}var ii,gu;function Rp(){if(gu)return ii;gu=1;var t=me(),e=we(),r=t.WeakMap;return ii=e(r)&&/native code/.test(String(r)),ii}var oi,yu;function Yt(){return yu||(yu=1,oi=function(t,e){return{enumerable:!(t&1),configurable:!(t&2),writable:!(t&4),value:e}}),oi}var si,wu;function Xt(){if(wu)return si;wu=1;var t=$e(),e=yt(),r=Yt();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,bu;function Er(){if(bu)return ci;bu=1;var t=Rp(),e=me(),r=Ze(),n=Xt(),a=Je(),i=ks(),o=As(),s=Os(),u="Object already initialized",l=e.TypeError,c=e.WeakMap,f,h,d,v=function(w){return d(w)?h(w):f(w,{})},p=function(w){return function(y){var m;if(!r(y)||(m=h(y)).type!==w)throw new l("Incompatible receiver, "+w+" required");return m}};if(t||i.state){var g=i.state||(i.state=new 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:v,getterFor:p},ci}var ui={},li={},Su;function Th(){if(Su)return li;Su=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 Iu;function Rh(){if(Iu)return ui;Iu=1;var t=$e(),e=je(),r=Th(),n=Yt(),a=Yr(),i=Ih(),o=Je(),s=bh(),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,Pu;function Oh(){if(Pu)return di;Pu=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,Eu;function Us(){if(Eu)return hi;Eu=1;var t=pe(),e=we(),r=ks(),n=t(Function.toString);return e(r.inspectSource)||(r.inspectSource=function(a){return n(a)}),hi=r.inspectSource,hi}var ku;function Ch(){if(ku)return fi.exports;ku=1;var t=pe(),e=Ae(),r=we(),n=Je(),a=$e(),i=Oh().CONFIGURABLE,o=Us(),s=Er(),u=s.enforce,l=s.get,c=String,f=Object.defineProperty,h=t("".slice),d=t("".replace),v=t([].join),p=a&&!e(function(){return f(function(){},"length",{value:8}).length!==8}),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),p&&m&&n(m,"arity")&&w.length!==m.arity&&f(w,"length",{value:m.arity});try{m&&n(m,"constructor")&&m.constructor?a&&f(w,"prototype",{writable:!1}):w.prototype&&(w.prototype=void 0)}catch{}var b=u(w);return n(b,"source")||(b.source=v(g,typeof y=="string"?y:"")),w};return Function.prototype.toString=P(function(){return r(this)&&l(this).source||o(this)},"toString"),fi.exports}var vi,_u;function Xe(){if(_u)return vi;_u=1;var t=we(),e=yt(),r=Ch(),n=Es();return vi=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},vi}var pi={},Tu;function Op(){if(Tu)return pi;Tu=1;var t=Eh(),e=Cs(),r=e.concat("length","prototype");return pi.f=Object.getOwnPropertyNames||function(a){return t(a,r)},pi}var mi={},Ru;function Ah(){return Ru||(Ru=1,mi.f=Object.getOwnPropertySymbols),mi}var gi,Ou;function Cp(){if(Ou)return gi;Ou=1;var t=Ye(),e=pe(),r=Op(),n=Ah(),a=rt(),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,Cu;function Uh(){if(Cu)return yi;Cu=1;var t=Je(),e=Cp(),r=Rh(),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,Au;function $h(){if(Au)return wi;Au=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,Uu;function Ie(){if(Uu)return bi;Uu=1;var t=me(),e=Rh().f,r=Xt(),n=Xe(),a=Es(),i=Uh(),o=$h();return bi=function(s,u){var l=s.target,c=s.global,f=s.stat,h,d,v,p,g,P;if(c?d=t:f?d=t[l]||a(l,{}):d=t[l]&&t[l].prototype,d)for(v in u){if(g=u[v],s.dontCallGetSet?(P=e(d,v),p=P&&P.value):p=d[v],h=o(c?v:l+(f?".":"#")+v,s.forced),!h&&p!==void 0){if(typeof g==typeof p)continue;i(g,p)}(s.sham||p&&p.sham)&&r(g,"sham",!0),n(d,v,g,s)}},bi}var Si,$u;function Ap(){if($u)return Si;$u=1;var t=Ae();return Si=!t(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),Si}var Ii,Lu;function $s(){if(Lu)return Ii;Lu=1;var t=Je(),e=we(),r=jn(),n=As(),a=Ap(),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,qu;function Lh(){if(qu)return Pi;qu=1;var t=Ae(),e=we(),r=Ze(),n=Qr(),a=$s(),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 v={};return c[u].call(v)!==v});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,ju;function kr(){if(ju)return Ei;ju=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,Nu;function qh(){if(Nu)return ki;Nu=1;var t=Lh().IteratorPrototype,e=Qr(),r=Yt(),n=kr(),a=en(),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 _i,xu;function Up(){if(xu)return _i;xu=1;var t=pe(),e=nt();return _i=function(r,n,a){try{return t(e(Object.getOwnPropertyDescriptor(r,n)[a]))}catch{}},_i}var Ti,Du;function $p(){if(Du)return Ti;Du=1;var t=Ze();return Ti=function(e){return t(e)||e===null},Ti}var Ri,Mu;function Lp(){if(Mu)return Ri;Mu=1;var t=$p(),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,Fu;function Ls(){if(Fu)return Oi;Fu=1;var t=Up(),e=Ze(),r=qn(),n=Lp();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,Ku;function jh(){if(Ku)return Ci;Ku=1;var t=Ie(),e=je(),r=ut(),n=Oh(),a=we(),i=qh(),o=$s(),s=Ls(),u=kr(),l=Xt(),c=Xe(),f=Ue(),h=en(),d=Lh(),v=n.PROPER,p=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,j,z,V,te,q,M){i(z,j,V);var N=function(J){if(J===te&&I)return I;if(!P&&J&&J in L)return L[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=j+" Iterator",O=!1,L=A.prototype,F=L[w]||L["@@iterator"]||te&&L[te],I=!P&&F||N(te),_=j==="Array"&&L.entries||F,x,H,Y;if(_&&(x=o(_.call(new A)),x!==Object.prototype&&x.next&&(!r&&o(x)!==g&&(s?s(x,g):a(x[w])||c(x,w,R)),u(x,S,!0,!0),r&&(h[S]=R))),v&&te===m&&F&&F.name!==m&&(!r&&p?l(L,"name",m):(O=!0,I=function(){return e(F,this)})),te)if(H={values:N(m),keys:q?I:N(y),entries:N(b)},M)for(Y in H)(P||O||!(Y in L))&&c(L,Y,H[Y]);else t({target:j,proto:!0,forced:P||O},H);return(!r||M)&&L[w]!==I&&c(L,w,I,{name:te}),h[j]=I,H},Ci}var Ai,zu;function qs(){return zu||(zu=1,Ai=function(t,e){return{value:t,done:e}}),Ai}var Ui,Hu;function js(){if(Hu)return Ui;Hu=1;var t=Yr(),e=Tp(),r=en(),n=Er(),a=yt().f,i=jh(),o=qs(),s=ut(),u=$e(),l="Array Iterator",c=n.set,f=n.getterFor(l);Ui=i(Array,"Array",function(d,v){c(this,{type:l,target:t(d),index:0,kind:v})},function(){var d=f(this),v=d.target,p=d.index++;if(!v||p>=v.length)return d.target=null,o(void 0,!0);switch(d.kind){case"keys":return o(p,!1);case"values":return o(v[p],!1)}return o([p,v[p]],!1)},"values");var h=r.Arguments=r.Array;if(e("keys"),e("values"),e("entries"),!s&&u&&h.name!=="values")try{a(h,"name",{value:"values"})}catch{}return Ui}var Bu={},Gu;function qp(){if(Gu)return Bu;Gu=1;var t=Ie(),e=pe(),r=Ph(),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,"")}}),Bu}var $i,Wu;function Nh(){if(Wu)return $i;Wu=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,Vu;function Mn(){if(Vu)return Li;Vu=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,Ju;function Fn(){if(Ju)return qi;Ju=1;var t=Ch(),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 ji,Zu;function jp(){if(Zu)return ji;Zu=1;var t=Xe();return ji=function(e,r,n){for(var a in r)t(e,a,r[a],n);return e},ji}var Ni,Yu;function Ns(){if(Yu)return Ni;Yu=1;var t=xn(),e=TypeError;return Ni=function(r,n){if(t(n,r))return r;throw new e("Incorrect invocation")},Ni}var xi,Xu;function Np(){if(Xu)return xi;Xu=1;var t=$n(),e=pe();return xi=function(r){if(t(r)==="Function")return e(r)},xi}var Di,Qu;function _r(){if(Qu)return Di;Qu=1;var t=Np(),e=nt(),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,el;function xs(){if(el)return Mi;el=1;var t=Ue(),e=t("toStringTag"),r={};return r[e]="z",Mi=String(r)==="[object z]",Mi}var Fi,tl;function tn(){if(tl)return Fi;tl=1;var t=xs(),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,rl;function wt(){if(rl)return Ki;rl=1;var t=tn(),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,nl;function Kn(){if(nl)return zi;nl=1;var t=tn(),e=_s(),r=Ln(),n=en(),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,al;function Ds(){if(al)return Hi;al=1;var t=je(),e=nt(),r=rt(),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,il;function Qt(){if(il)return Bi;il=1;var t=TypeError;return Bi=function(e,r){if(e<r)throw new t("Not enough arguments");return e},Bi}var Gi,ol;function zn(){if(ol)return Gi;ol=1;var t=pe();return Gi=t([].slice),Gi}var Wi,sl;function xp(){if(sl)return Wi;sl=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,v=0,p=0;v<h||p<d;)n[v+p]=v<h&&p<d?a(c[v],f[p])<=0?c[v++]:f[p++]:v<h?c[v++]:f[p++];return n};return Wi=r,Wi}var Vi,cl;function xh(){if(cl)return Vi;cl=1,js(),qp();var t=Ie(),e=me(),r=Nh(),n=Ye(),a=je(),i=pe(),o=$e(),s=Mn(),u=Xe(),l=Fn(),c=jp(),f=kr(),h=qh(),d=Er(),v=Ns(),p=we(),g=Je(),P=_r(),w=tn(),y=rt(),m=Ze(),b=wt(),R=Qr(),A=Yt(),j=Ds(),z=Kn(),V=qs(),te=Qt(),q=Ue(),M=xp(),N=q("iterator"),S="URLSearchParams",O=S+"Iterator",L=d.set,F=d.getterFor(S),I=d.getterFor(O),_=r("fetch"),x=r("Request"),H=r("Headers"),Y=x&&x.prototype,J=H&&H.prototype,fe=e.TypeError,ne=e.encodeURIComponent,ce=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),Rt=i("".split),Ot=i("".slice),Ar=i(/./.exec),er=/\+/g,Ct="�",ge=/^[0-9a-f]+$/i,et=function(D,G){var W=Ot(D,G,G+2);return Ar(ge,W)?ke(W,16):NaN},At=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,er," ");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 se=et(D,Z+1);if(se!==se){W+=ie,Z++;continue}Z+=2;var he=At(se);if(he===0)ie=ce(se);else{if(he===1||he>4){W+=Ct,Z++;continue}for(var ve=[se],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(ve,qe),Z+=2,be++}if(ve.length!==he){W+=Ct;continue}var at=K(ve);at===null?W+=Ct:ie=ae(at)}}W+=ie,Z++}return W},oe=/[!'()~]|%20/g,ue={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},de=function(D){return ue[D]},He=function(D){return Qe(ne(D),oe,de)},_e=h(function(G,W){L(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)==="?"?Ot(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,se,he,ve,be,qe;if(W)for(Z=j(D,W),ie=Z.next;!(se=a(ie,Z)).done;){if(he=j(y(se.value)),ve=he.next,(be=a(ve,he)).done||(qe=a(ve,he)).done||!a(ve,he).done)throw new fe("Expected sequence with length 2");Le(G,{key:b(be.value),value:b(qe.value)})}else for(var at in D)g(D,at)&&Le(G,{key:at,value:b(D[at])})},parseQuery:function(D){if(D)for(var G=this.entries,W=Rt(D,"&"),Z=0,ie,se;Z<W.length;)ie=W[Z++],ie.length&&(se=Rt(ie,"="),Le(G,{key:X(St(se)),value:X(De(se,"="))}))},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 Te=function(){v(this,Ge);var G=arguments.length>0?arguments[0]:void 0,W=L(this,new Me(G));o||(this.size=W.entries.length)},Ge=Te.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),se=W<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<Z.length;){var be=Z[ve];if(be.key===ie&&(he===void 0||be.value===he)){if(It(Z,ve,1),he!==void 0)break}else ve++}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=[],se=0;se<W.length;se++)W[se].key===Z&&Le(ie,W[se].value);return ie},has:function(G){for(var W=F(this).entries,Z=te(arguments.length,1),ie=b(G),se=Z<2?void 0:arguments[1],he=se===void 0?se:b(se),ve=0;ve<W.length;){var be=W[ve++];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,se=!1,he=b(G),ve=b(W),be=0,qe;be<ie.length;be++)qe=ie[be],qe.key===he&&(se?It(ie,be--,1):(se=!0,qe.value=ve));se||Le(ie,{key:he,value:ve}),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,se;ie<W.length;)se=W[ie++],Z(se.value,se.key,this)},keys:function(){return new _e(this,"keys")},values:function(){return new _e(this,"values")},entries:function(){return new _e(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(Te,S),t({global:!0,constructor:!0,forced:!s},{URLSearchParams:Te}),!s&&p(H)){var tr=i(J.has),Ur=i(J.set),rr=function(D){if(m(D)){var G=D.body,W;if(w(G)===S)return W=D.headers?new H(D.headers):new H,tr(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(p(_)&&t({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(G){return _(G,arguments.length>1?rr(arguments[1]):{})}}),p(x)){var nr=function(G){return v(this,Y),new x(G,arguments.length>1?rr(arguments[1]):{})};Y.constructor=nr,nr.prototype=Y,t({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:nr})}}return Vi={URLSearchParams:Te,getState:F},Vi}var ul;function Dp(){return ul||(ul=1,xh()),pc}var ll={},fl;function Mp(){if(fl)return ll;fl=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),a=URLSearchParams,i=a.prototype,o=e(i.append),s=e(i.delete),u=e(i.forEach),l=e([].push),c=new a("a=1&a=2&b=3");return c.delete("a",1),c.delete("b",void 0),c+""!="a=2"&&t(i,"delete",function(f){var h=arguments.length,d=h<2?void 0:arguments[1];if(h&&d===void 0)return s(this,f);var v=[];u(this,function(R,A){l(v,{key:A,value:R})}),n(h,1);for(var p=r(f),g=r(d),P=0,w=0,y=!1,m=v.length,b;P<m;)b=v[P++],y||b.key===p?(y=!0,s(this,b.key)):w++;for(;w<m;)b=v[w++],b.key===p&&b.value===g||o(this,b.key,b.value)},{enumerable:!0,unsafe:!0}),ll}var dl={},hl;function Fp(){if(hl)return dl;hl=1;var t=Xe(),e=pe(),r=wt(),n=Qt(),a=URLSearchParams,i=a.prototype,o=e(i.getAll),s=e(i.has),u=new a("a=1");return(u.has("a",2)||!u.has("a",void 0))&&t(i,"has",function(c){var f=arguments.length,h=f<2?void 0:arguments[1];if(f&&h===void 0)return s(this,c);var d=o(this,c);n(f,1);for(var v=r(h),p=0;p<d.length;)if(d[p++]===v)return!0;return!1},{enumerable:!0,unsafe:!0}),dl}var vl={},pl;function Kp(){if(pl)return vl;pl=1;var t=$e(),e=pe(),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}),vl}var Ji,ml;function Hn(){if(ml)return Ji;ml=1;var t=me();return Ji=t,Ji}var Zi,gl;function Dh(){if(gl)return Zi;gl=1,Dp(),Mp(),Fp(),Kp();var t=Hn();return Zi=t.URLSearchParams,Zi}var yl={},wl={},bl={},Yi,Sl;function Mh(){if(Sl)return Yi;Sl=1;var t=pe(),e=Ts(),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,v,p;return h<0||h>=d?u?"":void 0:(v=i(f,h),v<55296||v>56319||h+1===d||(p=i(f,h+1))<56320||p>57343?u?a(f,h):v:u?o(f,h,h+2):(v-55296<<10)+(p-56320)+65536)}};return Yi={codeAt:s(!1),charAt:s(!0)},Yi}var Il;function Fh(){if(Il)return bl;Il=1;var t=Mh().charAt,e=wt(),r=Er(),n=jh(),a=qs(),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))}),bl}var Xi,Pl;function zp(){if(Pl)return Xi;Pl=1;var t=$e(),e=pe(),r=je(),n=Ae(),a=kh(),i=Ah(),o=Th(),s=jn(),u=hh(),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={},v=Symbol("assign detection"),p="abcdefghijklmnopqrst";return h[v]=7,p.split("").forEach(function(g){d[g]=g}),l({},h)[v]!==7||a(l({},d)).join("")!==p})?function(d,v){for(var p=s(d),g=arguments.length,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,j;R>A;)j=b[A++],(!t||r(y,m,j))&&(p[j]=m[j]);return p}:l,Xi}var Qi,El;function Kh(){if(El)return Qi;El=1;var t=je(),e=rt(),r=_s();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,kl;function Hp(){if(kl)return eo;kl=1;var t=rt(),e=Kh();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,_l;function zh(){if(_l)return to;_l=1;var t=Ue(),e=en(),r=t("iterator"),n=Array.prototype;return to=function(a){return a!==void 0&&(e.Array===a||n[r]===a)},to}var ro,Tl;function Hh(){if(Tl)return ro;Tl=1;var t=pe(),e=Ae(),r=we(),n=tn(),a=Ye(),i=Us(),o=function(){},s=a("Reflect","construct"),u=/^\s*(?:class|function)\b/,l=t(u.exec),c=!u.test(o),f=function(v){if(!r(v))return!1;try{return s(o,[],v),!0}catch{return!1}},h=function(v){if(!r(v))return!1;switch(n(v)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!l(u,i(v))}catch{return!0}};return h.sham=!0,ro=!s||e(function(){var d;return f(f.call)||!f(Object)||!f(function(){d=!0})||d})?h:f,ro}var no,Rl;function Bp(){if(Rl)return no;Rl=1;var t=$e(),e=yt(),r=Yt();return no=function(n,a,i){t?e.f(n,a,r(0,i)):n[a]=i},no}var ao,Ol;function Gp(){if(Ol)return ao;Ol=1;var t=_r(),e=je(),r=jn(),n=Hp(),a=zh(),i=Hh(),o=Rs(),s=Bp(),u=Ds(),l=Kn(),c=Array;return ao=function(h){var d=r(h),v=i(this),p=arguments.length,g=p>1?arguments[1]:void 0,P=g!==void 0;P&&(g=t(g,p>2?arguments[2]:void 0));var w=l(d),y=0,m,b,R,A,j,z;if(w&&!(this===c&&a(w)))for(b=v?new this:[],A=u(d,w),j=A.next;!(R=e(j,A)).done;y++)z=P?n(A,g,[R.value,y],!0):R.value,s(b,y,z);else for(m=o(d),b=v?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,Cl;function Wp(){if(Cl)return io;Cl=1;var t=pe(),e=2147483647,r=36,n=1,a=26,i=38,o=700,s=72,u=128,l="-",c=/[^\0-\u007E]/,f=/[.\u3002\uFF0E\uFF61]/g,h="Overflow: input needs wider integers to process",d=r-n,v=RangeError,p=t(f.exec),g=Math.floor,P=String.fromCharCode,w=t("".charCodeAt),y=t([].join),m=t([].push),b=t("".replace),R=t("".split),A=t("".toLowerCase),j=function(q){for(var M=[],N=0,S=q.length;N<S;){var O=w(q,N++);if(O>=55296&&O<=56319&&N<S){var L=w(q,N++);(L&64512)===56320?m(M,((O&1023)<<10)+(L&1023)+65536):(m(M,O),N--)}else m(M,O)}return M},z=function(q){return q+22+75*(q<26)},V=function(q,M,N){var S=0;for(q=N?g(q/o):q>>1,q+=g(q/M);q>d*a>>1;)q=g(q/d),S+=r;return g(S+(d+1)*q/(q+i))},te=function(q){var M=[];q=j(q);var N=q.length,S=u,O=0,L=s,F,I;for(F=0;F<q.length;F++)I=q[F],I<128&&m(M,P(I));var _=M.length,x=_;for(_&&m(M,l);x<N;){var H=e;for(F=0;F<q.length;F++)I=q[F],I>=S&&I<H&&(H=I);var Y=x+1;if(H-S>g((e-O)/Y))throw new v(h);for(O+=(H-S)*Y,S=H,F=0;F<q.length;F++){if(I=q[F],I<S&&++O>e)throw new v(h);if(I===S){for(var J=O,fe=r;;){var ne=fe<=L?n:fe>=L+a?a:fe-L;if(J<ne)break;var ce=J-ne,ae=r-ne;m(M,P(z(ne+ce%ae))),J=g(ce/ae),fe+=r}m(M,P(z(J))),L=V(O,Y,x===_),O=0,x++}}O++,S++}return y(M,"")};return io=function(q){var M=[],N=R(b(A(q),f,"."),"."),S,O;for(S=0;S<N.length;S++)O=N[S],m(M,p(c,O)?"xn--"+te(O):O);return y(M,".")},io}var Al;function Vp(){if(Al)return wl;Al=1,Fh();var t=Ie(),e=$e(),r=Mn(),n=me(),a=_r(),i=pe(),o=Xe(),s=Fn(),u=Ns(),l=Je(),c=zp(),f=Gp(),h=zn(),d=Mh().codeAt,v=Wp(),p=wt(),g=kr(),P=Qt(),w=xh(),y=Er(),m=y.set,b=y.getterFor("URL"),R=w.URLSearchParams,A=w.getState,j=n.URL,z=n.TypeError,V=n.parseInt,te=Math.floor,q=Math.pow,M=i("".charAt),N=i(/./.exec),S=i([].join),O=i(1.1.toString),L=i([].pop),F=i([].push),I=i("".replace),_=i([].shift),x=i("".split),H=i("".slice),Y=i("".toLowerCase),J=i([].unshift),fe="Invalid authority",ne="Invalid scheme",ce="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,Rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Ot=/[\0\t\n\r #/:<>?@[\\\]^|]/,Ar=/^[\u0000-\u0020]+/,er=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,Ct=/[\t\n\r]/g,ge,et=function(k){var $=x(k,"."),T,E,C,re,B,ye,Se;if($.length&&$[$.length-1]===""&&$.length--,T=$.length,T>4)return k;for(E=[],C=0;C<T;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<T;C++)if(ye=E[C],C===T-1){if(ye>=q(256,5-T))return null}else if(ye>255)return null;for(Se=L(E),C=0;C<E.length;C++)Se+=E[C]*q(256,3-C);return Se},At=function(k){var $=[0,0,0,0,0,0,0,0],T=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,T++,E=T}for(;Pe();){if(T===8)return;if(Pe()===":"){if(E!==null)return;C++,T++,E=T;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,T>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++}$[T]=$[T]*256+Se,ye++,(ye===2||ye===4)&&T++}if(ye!==4)return;break}else if(Pe()===":"){if(C++,!Pe())return}else if(Pe())return;$[T++]=re}if(E!==null)for(Ve=T-E,T=7;T!==0&&Ve>0;)U=$[T],$[T--]=$[E+Ve-1],$[E+--Ve]=U;else if(T!==8)return;return $},K=function(k){for(var $=null,T=1,E=null,C=0,re=0;re<8;re++)k[re]!==0?(C>T&&($=E,T=C),E=null,C=0):(E===null&&(E=re),++C);return C>T?E:$},X=function(k){var $,T,E,C;if(typeof k=="number"){for($=[],T=0;T<4;T++)J($,k%256),k=te(k/256);return S($,".")}if(typeof k=="object"){for($="",E=K(k),T=0;T<8;T++)C&&k[T]===0||(C&&(C=!1),E===T?($+=T?":":"::",C=!0):($+=O(k[T],16),T<7&&($+=":")));return"["+$+"]"}return k},oe={},ue=c({},oe,{" ":1,'"':1,"<":1,">":1,"`":1}),de=c({},ue,{"#":1,"?":1,"{":1,"}":1}),He=c({},de,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),_e=function(k,$){var T=d(k,0);return T>32&&T<127&&!l($,k)?k:encodeURIComponent(k)},Me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Te=function(k,$){var T;return k.length===2&&N(ke,M(k,0))&&((T=M(k,1))===":"||!$&&T==="|")},Ge=function(k){var $;return k.length>1&&Te(H(k,0,2))&&(k.length===2||($=M(k,2))==="/"||$==="\\"||$==="?"||$==="#")},tr=function(k){return k==="."||Y(k)==="%2e"},Ur=function(k){return k=Y(k),k===".."||k==="%2e."||k===".%2e"||k==="%2e%2e"},rr={},nr={},D={},G={},W={},Z={},ie={},se={},he={},ve={},be={},qe={},at={},ea={},cc={},ta={},ar={},it={},uc={},Ut={},lt={},ra=function(k,$,T){var E=p(k),C,re,B;if($){if(re=this.parse(E),re)throw new z(re);this.searchParams=null}else{if(T!==void 0&&(C=new ra(T,!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,$,T){var E=this,C=$||rr,re=0,B="",ye=!1,Se=!1,Re=!1,Ve,U,Pe,ft;for(k=p(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,er,"$1")),k=I(k,Ct,""),Ve=f(k);re<=Ve.length;){switch(U=Ve[re],C){case rr:if(U&&N(ke,U))B+=Y(U),C=nr;else{if($)return ne;C=D;continue}break;case nr: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()&&T&&T.scheme===E.scheme?C=G:E.isSpecial()?C=se:Ve[re+1]==="/"?(C=W,re++):(E.cannotBeABaseURL=!0,F(E.path,""),C=uc)}else{if($)return ne;B="",C=D,re=0;continue}break;case D:if(!T||T.cannotBeABaseURL&&U!=="#")return ne;if(T.cannotBeABaseURL&&U==="#"){E.scheme=T.scheme,E.path=h(T.path),E.query=T.query,E.fragment="",E.cannotBeABaseURL=!0,C=lt;break}C=T.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=ve;break}else{C=it;continue}case Z:if(E.scheme=T.scheme,U===ge)E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query;else if(U==="/"||U==="\\"&&E.isSpecial())C=ie;else if(U==="?")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query="",C=Ut;else if(U==="#")E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,E.path=h(T.path),E.path.length--,C=it;continue}break;case ie:if(E.isSpecial()&&(U==="/"||U==="\\"))C=he;else if(U==="/")C=ve;else{E.username=T.username,E.password=T.password,E.host=T.host,E.port=T.port,C=it;continue}break;case se:if(C=he,U!=="/"||M(B,re+1)!=="/")continue;re++;break;case he:if(U!=="/"&&U!=="\\"){C=ve;continue}break;case ve:if(U==="@"){ye&&(B="%40"+B),ye=!0,Pe=f(B);for(var na=0;na<Pe.length;na++){var dc=Pe[na];if(dc===":"&&!Re){Re=!0;continue}var hc=_e(dc,He);Re?E.password+=hc:E.username+=hc}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 ce;if(ft=E.parseHost(B),ft)return ft;if(B="",C=at,$===qe)return}else if(U===ge||U==="/"||U==="?"||U==="#"||U==="\\"&&E.isSpecial()){if(E.isSpecial()&&B==="")return ce;if($&&B===""&&(E.includesCredentials()||E.port!==null))return;if(ft=E.parseHost(B),ft)return ft;if(B="",C=ar,$)return;continue}else U==="["?Se=!0:U==="]"&&(Se=!1),B+=U;break;case at: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=ar;continue}else return ae;break;case ea:if(E.scheme="file",U==="/"||U==="\\")C=cc;else if(T&&T.scheme==="file")switch(U){case ge:E.host=T.host,E.path=h(T.path),E.query=T.query;break;case"?":E.host=T.host,E.path=h(T.path),E.query="",C=Ut;break;case"#":E.host=T.host,E.path=h(T.path),E.query=T.query,E.fragment="",C=lt;break;default:Ge(S(h(Ve,re),""))||(E.host=T.host,E.path=h(T.path),E.shortenPath()),C=it;continue}else{C=it;continue}break;case cc:if(U==="/"||U==="\\"){C=ta;break}T&&T.scheme==="file"&&!Ge(S(h(Ve,re),""))&&(Te(T.path[0],!0)?F(E.path,T.path[0]):E.host=T.host),C=it;continue;case ta:if(U===ge||U==="/"||U==="\\"||U==="?"||U==="#"){if(!$&&Te(B))C=it;else if(B===""){if(E.host="",$)return;C=ar}else{if(ft=E.parseHost(B),ft)return ft;if(E.host==="localhost"&&(E.host=""),$)return;B="",C=ar}continue}else B+=U;break;case ar:if(E.isSpecial()){if(C=it,U!=="/"&&U!=="\\")continue}else if(!$&&U==="?")E.query="",C=Ut;else if(!$&&U==="#")E.fragment="",C=lt;else if(U!==ge&&(C=it,U!=="/"))continue;break;case it:if(U===ge||U==="/"||U==="\\"&&E.isSpecial()||!$&&(U==="?"||U==="#")){if(Ur(B)?(E.shortenPath(),U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,"")):tr(B)?U!=="/"&&!(U==="\\"&&E.isSpecial())&&F(E.path,""):(E.scheme==="file"&&!E.path.length&&Te(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]==="";)_(E.path);U==="?"?(E.query="",C=Ut):U==="#"&&(E.fragment="",C=lt)}else B+=_e(U,de);break;case uc:U==="?"?(E.query="",C=Ut):U==="#"?(E.fragment="",C=lt):U!==ge&&(E.path[0]+=_e(U,oe));break;case Ut:!$&&U==="#"?(E.fragment="",C=lt):U!==ge&&(U==="'"&&E.isSpecial()?E.query+="%27":U==="#"?E.query+="%23":E.query+=_e(U,oe));break;case lt:U!==ge&&(E.fragment+=_e(U,ue));break}re++}},parseHost:function(k){var $,T,E;if(M(k,0)==="["){if(M(k,k.length-1)!=="]"||($=At(H(k,1,-1)),!$))return ce;this.host=$}else if(this.isSpecial()){if(k=v(k),N(Rt,k)||($=et(k),$===null))return ce;this.host=$}else{if(N(Ot,k))return ce;for($="",T=f(k),E=0;E<T.length;E++)$+=_e(T[E],oe);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||!Te(k[0],!0))&&k.length--},serialize:function(){var k=this,$=k.scheme,T=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+=T+(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 ir(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(p(k)+":",rr)},getUsername:function(){return this.username},setUsername:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var T=0;T<$.length;T++)this.username+=_e($[T],He)}},getPassword:function(){return this.password},setPassword:function(k){var $=f(p(k));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var T=0;T<$.length;T++)this.password+=_e($[T],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?"":p(k)},setPort:function(k){this.cannotHaveUsernamePasswordPort()||(k=p(k),k===""?this.port=null:this.parse(k,at))},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,ar))},getSearch:function(){var k=this.query;return k?"?"+k:""},setSearch:function(k){k=p(k),k===""?this.query=null:(M(k,0)==="?"&&(k=H(k,1)),this.query="",this.parse(k,Ut)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var k=this.fragment;return k?"#"+k:""},setHash:function(k){if(k=p(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 ir=function($){var T=u(this,xe),E=P(arguments.length,1)>1?arguments[1]:void 0,C=m(T,new ra($,!1,E));e||(T.href=C.serialize(),T.origin=C.getOrigin(),T.protocol=C.getProtocol(),T.username=C.getUsername(),T.password=C.getPassword(),T.host=C.getHost(),T.hostname=C.getHostname(),T.port=C.getPort(),T.pathname=C.getPathname(),T.search=C.getSearch(),T.searchParams=C.getSearchParams(),T.hash=C.getHash())},xe=ir.prototype,We=function(k,$){return{get:function(){return b(this)[k]()},set:$&&function(T){return b(this)[$](T)},configurable:!0,enumerable:!0}};if(e&&(s(xe,"href",We("serialize","setHref")),s(xe,"origin",We("getOrigin")),s(xe,"protocol",We("getProtocol","setProtocol")),s(xe,"username",We("getUsername","setUsername")),s(xe,"password",We("getPassword","setPassword")),s(xe,"host",We("getHost","setHost")),s(xe,"hostname",We("getHostname","setHostname")),s(xe,"port",We("getPort","setPort")),s(xe,"pathname",We("getPathname","setPathname")),s(xe,"search",We("getSearch","setSearch")),s(xe,"searchParams",We("getSearchParams")),s(xe,"hash",We("getHash","setHash"))),o(xe,"toJSON",function(){return b(this).serialize()},{enumerable:!0}),o(xe,"toString",function(){return b(this).serialize()},{enumerable:!0}),j){var lc=j.createObjectURL,fc=j.revokeObjectURL;lc&&o(ir,"createObjectURL",a(lc,j)),fc&&o(ir,"revokeObjectURL",a(fc,j))}return g(ir,"URL"),t({global:!0,constructor:!0,forced:!r,sham:!e},{URL:ir}),wl}var Ul;function Jp(){return Ul||(Ul=1,Vp()),yl}var $l={},Ll;function Zp(){if(Ll)return $l;Ll=1;var t=Ie(),e=Ye(),r=Ae(),n=Qt(),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}}}),$l}var ql={},jl;function Yp(){if(jl)return ql;jl=1;var t=Ie(),e=Ye(),r=Qt(),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}}}),ql}var Nl={},xl;function Xp(){if(xl)return Nl;xl=1;var t=Ie(),e=je();return t({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return e(URL.prototype.toString,this)}}),Nl}var oo,Dl;function Qp(){if(Dl)return oo;Dl=1,Dh(),Jp(),Zp(),Yp(),Xp();var t=Hn();return oo=t.URL,oo}var so,Ml;function em(){if(Ml)return so;Ml=1;var t=Qp();return so=t,so}var co,Fl;function tm(){if(Fl)return co;Fl=1;var t=em();return co=t,co}tm();var Kl={},uo,zl;function rm(){return zl||(zl=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,Hl;function nm(){if(Hl)return lo;Hl=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 Bl;function Bh(){if(Bl)return Kl;Bl=1;var t=me(),e=rm(),r=nm(),n=js(),a=Xt(),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"),Kl}var fo,Gl;function am(){if(Gl)return fo;Gl=1;var t=Dh();return Bh(),fo=t,fo}var ho,Wl;function im(){if(Wl)return ho;Wl=1;var t=am();return ho=t,ho}im();var Vl={},Jl={},vo,Zl;function om(){if(Zl)return vo;Zl=1;var t=Ze(),e=Xt();return vo=function(r,n){t(n)&&"cause"in n&&e(r,"cause",n.cause)},vo}var po,Yl;function sm(){if(Yl)return po;Yl=1;var t=pe(),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 po=function(o,s){if(i&&typeof o=="string"&&!e.prepareStackTrace)for(;s--;)o=r(o,a,"");return o},po}var mo,Xl;function cm(){if(Xl)return mo;Xl=1;var t=Ae(),e=Yt();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,Ql;function um(){if(Ql)return go;Ql=1;var t=Xt(),e=sm(),r=cm(),n=Error.captureStackTrace;return go=function(a,i,o,s){r&&(n?n(a,i):t(a,"stack",e(o,s)))},go}var yo,ef;function rn(){if(ef)return yo;ef=1;var t=_r(),e=je(),r=rt(),n=Dn(),a=zh(),i=Rs(),o=xn(),s=Ds(),u=Kn(),l=Kh(),c=TypeError,f=function(d,v){this.stopped=d,this.result=v},h=f.prototype;return yo=function(d,v,p){var g=p&&p.that,P=!!(p&&p.AS_ENTRIES),w=!!(p&&p.IS_RECORD),y=!!(p&&p.IS_ITERATOR),m=!!(p&&p.INTERRUPTED),b=t(v,g),R,A,j,z,V,te,q,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(j=0,z=i(d);z>j;j++)if(V=N(d[j]),V&&o(h,V))return V;return new f(!1)}R=s(d,A)}for(te=w?d.next:R.next;!(q=e(te,R)).done;){try{V=N(q.value)}catch(S){l(R,"throw",S)}if(typeof V=="object"&&V&&o(h,V))return V}return new f(!1)},yo}var wo,tf;function lm(){if(tf)return wo;tf=1;var t=wt();return wo=function(e,r){return e===void 0?arguments.length<2?"":r:t(e)},wo}var rf;function fm(){if(rf)return Jl;rf=1;var t=Ie(),e=xn(),r=$s(),n=Ls(),a=Uh(),i=Qr(),o=Xt(),s=Yt(),u=om(),l=um(),c=rn(),f=lm(),h=Ue(),d=h("toStringTag"),v=Error,p=[].push,g=function(y,m){var b=e(P,this),R;n?R=n(new v,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,p,{that:A}),o(R,"errors",A),R};n?n(g,v):a(g,v,{name:!0});var P=g.prototype=i(v.prototype,{constructor:s(1,g),message:s(1,""),name:s(1,"AggregateError")});return t({global:!0,constructor:!0,arity:2},{AggregateError:g}),Jl}var nf;function dm(){return nf||(nf=1,fm()),Vl}var af={},bo,of;function hm(){if(of)return bo;of=1;var t=xs(),e=tn();return bo=t?{}.toString:function(){return"[object "+e(this)+"]"},bo}var sf;function vm(){if(sf)return af;sf=1;var t=xs(),e=Xe(),r=hm();return t||e(Object.prototype,"toString",r,{unsafe:!0}),af}var cf={},uf={},So,lf;function Gh(){if(lf)return So;lf=1;var t=me(),e=Xr(),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,ff;function Ms(){if(ff)return Io;ff=1;var t=Gh();return Io=t==="NODE",Io}var Po,df;function pm(){if(df)return Po;df=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,hf;function mm(){if(hf)return Eo;hf=1;var t=Hh(),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,vf;function Wh(){if(vf)return ko;vf=1;var t=rt(),e=mm(),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 _o,pf;function Vh(){if(pf)return _o;pf=1;var t=Un(),e=Function.prototype,r=e.apply,n=e.call;return _o=typeof Reflect=="object"&&Reflect.apply||(t?n.bind(r):function(){return n.apply(r,arguments)}),_o}var To,mf;function Jh(){if(mf)return To;mf=1;var t=Xr();return To=/(?:ipad|iphone|ipod).*applewebkit/i.test(t),To}var Ro,gf;function Zh(){if(gf)return Ro;gf=1;var t=me(),e=Vh(),r=_r(),n=we(),a=Je(),i=Ae(),o=_h(),s=zn(),u=Nn(),l=Qt(),c=Jh(),f=Ms(),h=t.setImmediate,d=t.clearImmediate,v=t.process,p=t.Dispatch,g=t.Function,P=t.MessageChannel,w=t.String,y=0,m={},b="onreadystatechange",R,A,j,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)}},q=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),L=s(arguments,1);return m[++y]=function(){e(O,void 0,L)},A(y),y},d=function(S){delete m[S]},f?A=function(N){v.nextTick(te(N))}:p&&p.now?A=function(N){p.now(te(N))}:P&&!c?(j=new P,z=j.port2,j.port1.onmessage=q,A=r(z.postMessage,z)):t.addEventListener&&n(t.postMessage)&&!t.importScripts&&R&&R.protocol!=="file:"&&!i(M)?(A=M,t.addEventListener("message",q,!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,yf;function Yh(){if(yf)return Oo;yf=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,wf;function gm(){if(wf)return Co;wf=1;var t=Xr();return Co=/ipad|iphone|ipod/i.test(t)&&typeof Pebble<"u",Co}var Ao,bf;function ym(){if(bf)return Ao;bf=1;var t=Xr();return Ao=/web0s(?!.*chrome)/i.test(t),Ao}var Uo,Sf;function wm(){if(Sf)return Uo;Sf=1;var t=me(),e=Nh(),r=_r(),n=Zh().set,a=Yh(),i=Jh(),o=gm(),s=ym(),u=Ms(),l=t.MutationObserver||t.WebKitMutationObserver,c=t.document,f=t.process,h=t.Promise,d=e("queueMicrotask"),v,p,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&&v(),A}b&&b.enter()};!i&&!u&&!s&&l&&c?(p=!0,g=c.createTextNode(""),new l(m).observe(g,{characterData:!0}),v=function(){g.data=p=!p}):!o&&h&&h.resolve?(P=h.resolve(void 0),P.constructor=h,w=r(P.then,P),v=function(){w(m)}):u?v=function(){f.nextTick(m)}:(n=r(n,t),v=function(){n(m)}),d=function(b){y.head||v(),y.add(b)}}return Uo=d,Uo}var $o,If;function bm(){return If||(If=1,$o=function(t,e){try{arguments.length===1?console.error(t):console.error(t,e)}catch{}}),$o}var Lo,Pf;function Tr(){return Pf||(Pf=1,Lo=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}),Lo}var qo,Ef;function Rr(){if(Ef)return qo;Ef=1;var t=me();return qo=t.Promise,qo}var jo,kf;function nn(){if(kf)return jo;kf=1;var t=me(),e=Rr(),r=we(),n=$h(),a=Us(),i=Ue(),o=Gh(),s=ut(),u=mh(),l=e&&e.prototype,c=i("species"),f=!1,h=r(t.PromiseRejectionEvent),d=n("Promise",function(){var v=a(e),p=v!==String(e);if(!p&&u===66||s&&!(l.catch&&l.finally))return!0;if(!u||u<51||!/native code/.test(v)){var 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!p&&(o==="BROWSER"||o==="DENO")&&!h});return jo={CONSTRUCTOR:d,REJECTION_EVENT:h,SUBCLASSING:f},jo}var No={},_f;function bt(){if(_f)return No;_f=1;var t=nt(),e=TypeError,r=function(n){var a,i;this.promise=new n(function(o,s){if(a!==void 0||i!==void 0)throw new e("Bad Promise constructor");a=o,i=s}),this.resolve=t(a),this.reject=t(i)};return No.f=function(n){return new r(n)},No}var Tf;function Sm(){if(Tf)return uf;Tf=1;var t=Ie(),e=ut(),r=Ms(),n=me(),a=Hn(),i=je(),o=Xe(),s=Ls(),u=kr(),l=pm(),c=nt(),f=we(),h=Ze(),d=Ns(),v=Wh(),p=Zh().set,g=wm(),P=bm(),w=Tr(),y=Yh(),m=Er(),b=Rr(),R=nn(),A=bt(),j="Promise",z=R.CONSTRUCTOR,V=R.REJECTION_EVENT,te=R.SUBCLASSING,q=m.getterFor(j),M=m.set,N=b&&b.prototype,S=b,O=N,L=n.TypeError,F=n.document,I=n.process,_=A.f,x=_,H=!!(F&&F.createEvent&&n.dispatchEvent),Y="unhandledrejection",J="rejectionhandled",fe=0,ne=1,ce=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 oe=X.value,ue=X.state===ne,de=ue?K.ok:K.fail,He=K.resolve,_e=K.reject,Me=K.domain,Te,Ge,tr;try{de?(ue||(X.rejection===ke&&Ct(X),X.rejection=ae),de===!0?Te=oe:(Me&&Me.enter(),Te=de(oe),Me&&(Me.exit(),tr=!0)),Te===K.promise?_e(new L("Promise-chain cycle")):(Ge=St(Te))?i(Ge,Te,He,_e):He(Te)):_e(oe)}catch(Ur){Me&&!tr&&Me.exit(),_e(Ur)}},Rt=function(K,X){K.notified||(K.notified=!0,g(function(){for(var oe=K.reactions,ue;ue=oe.get();)It(ue,K);K.notified=!1,X&&!K.rejection&&Ar(K)}))},Ot=function(K,X,oe){var ue,de;H?(ue=F.createEvent("Event"),ue.promise=X,ue.reason=oe,ue.initEvent(K,!1,!0),n.dispatchEvent(ue)):ue={promise:X,reason:oe},!V&&(de=n["on"+K])?de(ue):K===Y&&P("Unhandled promise rejection",oe)},Ar=function(K){i(p,n,function(){var X=K.facade,oe=K.value,ue=er(K),de;if(ue&&(de=w(function(){r?I.emit("unhandledRejection",oe,X):Ot(Y,X,oe)}),K.rejection=r||er(K)?ke:ae,de.error))throw de.value})},er=function(K){return K.rejection!==ae&&!K.parent},Ct=function(K){i(p,n,function(){var X=K.facade;r?I.emit("rejectionHandled",X):Ot(J,X,K.value)})},ge=function(K,X,oe){return function(ue){K(X,ue,oe)}},et=function(K,X,oe){K.done||(K.done=!0,oe&&(K=oe),K.value=X,K.state=ce,Rt(K,!0))},At=function(K,X,oe){if(!K.done){K.done=!0,oe&&(K=oe);try{if(K.facade===X)throw new L("Promise can't be resolved itself");var ue=St(X);ue?g(function(){var de={done:!1};try{i(ue,X,ge(At,de,K),ge(et,de,K))}catch(He){et(de,He,K)}}):(K.value=X,K.state=ne,Rt(K,!1))}catch(de){et({done:!1},de,K)}}};if(z&&(S=function(X){d(this,O),c(X),i(Ne,this);var oe=q(this);try{X(ge(At,oe),ge(et,oe))}catch(ue){et(oe,ue)}},O=S.prototype,Ne=function(X){M(this,{type:j,done:!1,notified:!1,parent:!1,reactions:new y,rejection:!1,state:fe,value:null})},Ne.prototype=o(O,"then",function(X,oe){var ue=q(this),de=_(v(this,S));return ue.parent=!0,de.ok=f(X)?X:!0,de.fail=f(oe)&&oe,de.domain=r?I.domain:void 0,ue.state===fe?ue.reactions.add(de):g(function(){It(de,ue)}),de.promise}),De=function(){var K=new Ne,X=q(K);this.promise=K,this.resolve=ge(At,X),this.reject=ge(et,X)},A.f=_=function(K){return K===S||K===Le?new De(K):x(K)},!e&&f(b)&&N!==Object.prototype)){Qe=N.then,te||o(N,"then",function(X,oe){var ue=this;return new S(function(de,He){i(Qe,ue,de,He)}).then(X,oe)},{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,j,!1,!0),l(j),uf}var Rf={},xo,Of;function Im(){if(Of)return xo;Of=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 xo=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},xo}var Do,Cf;function Bn(){if(Cf)return Do;Cf=1;var t=Rr(),e=Im(),r=nn().CONSTRUCTOR;return Do=r||!e(function(n){t.all(n).then(void 0,function(){})}),Do}var Af;function Pm(){if(Af)return Rf;Af=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),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 v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]=b,--P||f(p))},h)}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Rf}var Uf={},$f;function Em(){if($f)return Uf;$f=1;var t=Ie(),e=ut(),r=nn().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 Uf}var Lf={},qf;function km(){if(qf)return Lf;qf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),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(v){e(d,l,v).then(c.resolve,f)})});return h.error&&f(h.value),c.promise}}),Lf}var jf={},Nf;function _m(){if(Nf)return jf;Nf=1;var t=Ie(),e=bt(),r=nn().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}}),jf}var xf={},Mo,Df;function Xh(){if(Df)return Mo;Df=1;var t=rt(),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 Mf;function Tm(){if(Mf)return xf;Mf=1;var t=Ie(),e=Ye(),r=ut(),n=Rr(),a=nn().CONSTRUCTOR,i=Xh(),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)}}),xf}var Ff;function Rm(){return Ff||(Ff=1,Sm(),Pm(),Em(),km(),_m(),Tm()),cf}var Kf={},zf;function Om(){if(zf)return Kf;zf=1;var t=Ie(),e=je(),r=nt(),n=bt(),a=Tr(),i=rn(),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 v=r(l.resolve),p=[],g=0,P=1;i(u,function(w){var y=g++,m=!1;P++,e(v,l,w).then(function(b){m||(m=!0,p[y]={status:"fulfilled",value:b},--P||f(p))},function(b){m||(m=!0,p[y]={status:"rejected",reason:b},--P||f(p))})}),--P||f(p)});return d.error&&h(d.value),c.promise}}),Kf}var Hf={},Bf;function Cm(){if(Bf)return Hf;Bf=1;var t=Ie(),e=je(),r=nt(),n=Ye(),a=bt(),i=Tr(),o=rn(),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),v=d.resolve,p=d.reject,g=i(function(){var P=r(f.resolve),w=[],y=0,m=1,b=!1;o(c,function(R){var A=y++,j=!1;m++,e(P,f,R).then(function(z){j||b||(b=!0,v(z))},function(z){j||b||(j=!0,w[A]=z,--m||p(new h(w,u)))})}),--m||p(new h(w,u))});return g.error&&p(g.value),d.promise}}),Hf}var Gf={},Wf;function Qh(){if(Wf)return Gf;Wf=1;var t=Ie(),e=me(),r=Vh(),n=zn(),a=bt(),i=nt(),o=Tr(),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}}),Gf}var Vf={},Jf;function ev(){if(Jf)return Vf;Jf=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}}}),Vf}var Zf={},Yf;function Am(){if(Yf)return Zf;Yf=1;var t=Ie(),e=ut(),r=Rr(),n=Ae(),a=Ye(),i=we(),o=Wh(),s=Xh(),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")),v=i(h);return this.then(v?function(p){return s(d,h()).then(function(){return p})}:h,v?function(p){return s(d,h()).then(function(){throw p})}:h)}}),!e&&i(r)){var f=a("Promise").prototype.finally;l.finally!==f&&u(l,"finally",f,{unsafe:!0})}return Zf}var Fo,Xf;function Um(){if(Xf)return Fo;Xf=1,dm(),js(),vm(),Rm(),Om(),Cm(),Qh(),ev(),Am(),Fh();var t=Hn();return Fo=t.Promise,Fo}var Ko,Qf;function $m(){if(Qf)return Ko;Qf=1;var t=Um();return Bh(),Ko=t,Ko}var ed={},td;function Lm(){return td||(td=1,Qh()),ed}var rd={},nd;function qm(){return nd||(nd=1,ev()),rd}var zo,ad;function jm(){if(ad)return zo;ad=1;var t=$m();return Lm(),qm(),zo=t,zo}jm();const tv="sesamy-debug";function Nm(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 Dm(t){Nm(tv,t.toString(),1)}function Mm(){return xm(tv)==="true"}function le(t){Mm()&&console.log(t)}function Wt(t,e){if(typeof window>"u")return;const r=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});le(`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 Fs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Ks(t,e){return t(e={exports:{}},e.exports),e.exports}var Lt=Ks((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()}}));Fs(Lt);var Fm=Fs(Ks((function(t,e){var r=jt&&jt.__awaiter||function(c,f,h,d){return new(h||(h=Promise))((function(v,p){function g(y){try{w(d.next(y))}catch(m){p(m)}}function P(y){try{w(d.throw(y))}catch(m){p(m)}}function w(y){y.done?v(y.value):new h((function(m){m(y.value)})).then(g,P)}w((d=d.apply(c,f||[])).next())}))},n=jt&&jt.__generator||function(c,f){var h,d,v,p,g={label:0,sent:function(){if(1&v[0])throw v[1];return v[1]},trys:[],ops:[]};return p={next:P(0),throw:P(1),return:P(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;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&&(v=2&m[0]?d.return:m[0]?d.throw||((v=d.return)&&v.call(d),0):d.next)&&!(v=v.call(d,m[1])).done)return v;switch(d=0,v&&(m=[2&m[0],v.value]),m[0]){case 0:case 1:v=m;break;case 4:return g.label++,{value:m[1],done:!1};case 5:g.label++,d=m[1],m=[0];continue;case 7:m=g.ops.pop(),g.trys.pop();continue;default:if(v=g.trys,!((v=v.length>0&&v[v.length-1])||m[0]!==6&&m[0]!==2)){g=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){g.label=m[1];break}if(m[0]===6&&g.label<v[1]){g.label=v[1],v=m;break}if(v&&g.label<v[2]){g.label=v[2],g.ops.push(m);break}v[2]&&g.ops.pop(),g.trys.pop();continue}m=f.call(c,g)}catch(b){m=[6,b],d=0}finally{h=v=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([w,y])}}},a=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,v,p,g,P,w,y;return n(this,(function(m){switch(m.label){case 0:d=Date.now()+u(4),v=Date.now()+h,p=i+"-"+f,g=this.storageHandler===void 0?o:this.storageHandler,m.label=1;case 1:return Date.now()<v?[4,s(30)]:[3,8];case 2:return m.sent(),g.getItemSync(p)!==null?[3,5]:(P=this.id+"-"+f+"-"+d,[4,s(Math.floor(25*Math.random()))]);case 3:return m.sent(),g.setItemSync(p,JSON.stringify({id:this.id,iat:d,timeoutKey:P,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,s(30)];case 4:return m.sent(),(w=g.getItemSync(p))!==null&&(y=JSON.parse(w)).id===this.id&&y.iat===d?(this.acquiredIatSet.add(d),this.refreshLockWhileAcquired(p,d),[2,!0]):[3,7];case 5:return c.lockCorrector(this.storageHandler===void 0?o:this.storageHandler),[4,this.waitForSomethingToChange(v)];case 6:m.sent(),m.label=7;case 7:return d=Date.now()+u(4),[3,1];case 8:return[2,!1]}}))}))},c.prototype.refreshLockWhileAcquired=function(f,h){return r(this,void 0,void 0,(function(){var d=this;return n(this,(function(v){return setTimeout((function(){return r(d,void 0,void 0,(function(){var p,g,P;return n(this,(function(w){switch(w.label){case 0:return[4,Lt.default().lock(h)];case 1:return w.sent(),this.acquiredIatSet.has(h)?(p=this.storageHandler===void 0?o:this.storageHandler,(g=p.getItemSync(f))===null?(Lt.default().unlock(h),[2]):((P=JSON.parse(g)).timeRefreshed=Date.now(),p.setItemSync(f,JSON.stringify(P)),Lt.default().unlock(h),this.refreshLockWhileAcquired(f,h),[2])):(Lt.default().unlock(h),[2])}}))}))}),1e3),[2]}))}))},c.prototype.waitForSomethingToChange=function(f){return r(this,void 0,void 0,(function(){return n(this,(function(h){switch(h.label){case 0:return[4,new Promise((function(d){var v=!1,p=Date.now(),g=!1;function P(){if(g||(window.removeEventListener("storage",P),c.removeFromWaiting(P),clearTimeout(w),g=!0),!v){v=!0;var y=50-(Date.now()-p);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,v,p;return n(this,(function(g){switch(g.label){case 0:return h=this.storageHandler===void 0?o:this.storageHandler,d=i+"-"+f,(v=h.getItemSync(d))===null?[2]:(p=JSON.parse(v)).id!==this.id?[3,2]:[4,Lt.default().lock(p.iat)];case 1:g.sent(),this.acquiredIatSet.delete(p.iat),h.removeItemSync(d),Lt.default().unlock(p.iat),c.notifyWaiters(),g.label=2;case 2:return[2]}}))}))},c.lockCorrector=function(f){for(var h=Date.now()-5e3,d=f,v=[],p=0;;){var g=d.keySync(p);if(g===null)break;v.push(g),p++}for(var P=!1,w=0;w<v.length;w++){var y=v[w];if(y.includes(i)){var m=d.getItemSync(y);if(m!==null){var b=JSON.parse(m);(b.timeRefreshed===void 0&&b.timeAcquired<h||b.timeRefreshed!==void 0&&b.timeRefreshed<h)&&(d.removeItemSync(y),P=!0)}}}P&&c.notifyWaiters()},c.waiters=void 0,c})();e.default=l})));const Km={timeoutInSeconds:60},rv={name:"auth0-spa-js",version:"2.8.0"},nv=()=>Date.now();let Ee=class ss extends Error{constructor(e,r){super(r),this.error=e,this.error_description=r,Object.setPrototypeOf(this,ss.prototype)}static fromPayload({error:e,error_description:r}){return new ss(e,r)}},zm=class av extends Ee{constructor(e,r,n,a=null){super(e,r),this.state=n,this.appState=a,Object.setPrototypeOf(this,av.prototype)}},Hm=class iv extends Ee{constructor(e,r,n,a,i=null){super(e,r),this.connection=n,this.state=a,this.appState=i,Object.setPrototypeOf(this,iv.prototype)}},cs=class ov extends Ee{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,ov.prototype)}};class zs extends cs{constructor(e){super(),this.popup=e,Object.setPrototypeOf(this,zs.prototype)}}let Bm=class sv extends Ee{constructor(e){super("cancelled","Popup closed"),this.popup=e,Object.setPrototypeOf(this,sv.prototype)}},Gm=class cv extends Ee{constructor(e,r,n){super(e,r),this.mfa_token=n,Object.setPrototypeOf(this,cv.prototype)}},uv=class lv 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,lv.prototype)}},Wm=class fv 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,fv.prototype)}},dv=class hv extends Ee{constructor(e){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=e,Object.setPrototypeOf(this,hv.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),Vm=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Jm=t=>Object.keys(t).reduce(((e,r)=>{const n=Vm.find((a=>a.key===r));return n&&n.type.includes(typeof t[r])&&(e[r]=t[r]),e}),{}),us=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()},id=async t=>await In().subtle.digest({name:"SHA-256"},new TextEncoder().encode(t)),od=t=>(e=>decodeURIComponent(atob(e).split("").map((r=>"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2))).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),sd=t=>{const e=new Uint8Array(t);return(r=>{const n={"+":"-","/":"_","=":""};return r.replace(/[+/=]/g,(a=>n[a]))})(window.btoa(String.fromCharCode(...Array.from(e))))},Zm=new TextEncoder,Ym=new TextDecoder;function zr(t){return typeof t=="string"?Zm.encode(t):Ym.decode(t)}function cd(t){if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new Qm(`${t.name} modulusLength must be at least 2048 bits`)}async function Xm(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 cd(a.algorithm),{name:a.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return cd(a.algorithm),{name:a.algorithm.name};case"Ed25519":return{name:a.algorithm.name}}throw new Dt})(r),r,zr(n)))}`}let ls;Uint8Array.prototype.toBase64?ls=t=>(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),t.toBase64({alphabet:"base64url",omitPadding:!0})):ls=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 ls(t)}let Dt=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)}},Qm=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 eg(t){switch(t.algorithm.name){case"RSA-PSS":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"PS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"RSASSA-PKCS1-v1_5":return(function(e){if(e.algorithm.hash.name==="SHA-256")return"RS256";throw new Dt("unsupported RsaHashedKeyAlgorithm hash name")})(t);case"ECDSA":return(function(e){if(e.algorithm.namedCurve==="P-256")return"ES256";throw new Dt("unsupported EcKeyAlgorithm namedCurve")})(t);case"Ed25519":return"Ed25519";default:throw new Dt("unsupported CryptoKey algorithm name")}}function vv(t){return t instanceof CryptoKey}function pv(t){return vv(t)&&t.type==="public"}async function tg(t,e,r,n,a,i){const o=t?.privateKey,s=t?.publicKey;if(!vv(u=o)||u.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var u;if(!pv(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 Xm({alg:eg(o),typ:"dpop+jwt",jwk:await mv(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 mv(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 rg=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange"];function ng(){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 Dt}return crypto.subtle.generateKey(n,(r=e?.extractable)!==null&&r!==void 0&&r,["sign","verify"])})("ES256",{extractable:!1})}function ag(t){return(async function(e){if(!pv(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 mv(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 Dt("unsupported JWK kty")}return Hr(await crypto.subtle.digest({name:"SHA-256"},zr(JSON.stringify(n))))})(t.publicKey)}function ig({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 tg(t,i,r,n,a)}const og=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([og(t,e),new Promise(((i,o)=>{a=setTimeout((()=>{n.abort(),o(new Error("Timeout when executing 'fetch'"))}),r)}))]).finally((()=>{clearTimeout(a)}))},cg=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},ug=async(t,e,r,n,a,i,o=1e4,s)=>a?cg(t,e,r,n,o,a,i,s):sg(t,n,o);async function gv(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 ug(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:v}=h,p=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=v||`HTTP error. Unable to fetch ${t}`;if(d==="mfa_required")throw new Gm(d,y,p.mfa_token);if(d==="missing_refresh_token")throw new uv(r,n);if(d==="use_dpop_nonce"){if(!u||!w||l)throw new dv(w);return gv(t,e,r,n,a,i,o,s,u,!0)}throw new Ee(d||"request_error",y)}return p}async function lg(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}),v=s?us(d):JSON.stringify(d),p=(g=c.grant_type,rg.includes(g));var g;return await gv(`${r}/oauth/token`,n,a||"default",i,{method:"POST",body:v,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Jm(o||rv)))}},e,s,u,p?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 fs{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 fs({clientId:n,scope:i,audience:a},r)}static fromCacheEntry(e){const{scope:r,audience:n,client_id:a}=e;return new fs({scope:r,audience:n,clientId:a})}},fg=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@@")))}},yv=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)}})()}},dg=class{constructor(e,r,n){this.cache=e,this.keyManifest=r,this.nowProvider=n||nv}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)}}}},hg=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",vg=["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"],pg=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(od(u)),f={__raw:i},h={};return Object.keys(c).forEach((d=>{f[d]=c[d],vg.includes(d)||(h[d]=c[d])})),{encoded:{header:s,payload:u,signature:l},header:JSON.parse(od(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 Mt=Ks((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("="),v=d.slice(1).join("=");v.charAt(0)==='"'&&(v=v.slice(1,-1));try{l[d[0].replace(f,decodeURIComponent)]=v.replace(f,decodeURIComponent)}catch{}}return l}function o(){return i(document.cookie)}function s(u,l,c){document.cookie=a(u,l,r({path:"/"},c))}e.__esModule=!0,e.encode=a,e.parse=i,e.getAll=o,e.get=function(u){return o()[u]},e.set=s,e.remove=function(u,l){s(u,"",r(r({},l),{expires:-1}))}}));Fs(Mt),Mt.encode,Mt.parse,Mt.getAll;var mg=Mt.get,wv=Mt.set,bv=Mt.remove;const ur={get(t){const e=mg(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),wv(t,JSON.stringify(e),n)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r)}},gg={get(t){return ur.get(t)||ur.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),wv(`_legacy_${t}`,JSON.stringify(e),n),ur.save(t,e,r)},remove(t,e){let r={};e?.cookieDomain&&(r.domain=e.cookieDomain),bv(t,r),ur.remove(t,e),ur.remove(`_legacy_${t}`,e)}},yg={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 Nt;(function(t){t.Code="code",t.ConnectCode="connect_code"})(Nt||(Nt={}));function wg(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 ud,ld,fd,Bo,bg=(ud="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YSx1c2VNcnJ0OmZ9LHBvcnRzOltwXX0pPT57bGV0IGgsdSxsPXt9O2NvbnN0e2F1ZGllbmNlOmQsc2NvcGU6eX09cnx8e307dHJ5e2NvbnN0IHI9YT8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShjLmJvZHkpOkpTT04ucGFyc2UoYy5ib2R5KTtpZighci5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1yLmdyYW50X3R5cGUpe2lmKHU9KChlLHQpPT5vW24oZSx0KV0pKGQseSksIXUmJmYpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKGAke2V9fGApKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxkKTtlJiYhdCYmKHU9ZSl9aWYoIXUpdGhyb3cgbmV3IHQoZCx5KTtjLmJvZHk9YT9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxyKSx7cmVmcmVzaF90b2tlbjp1fSkpfWxldCBqLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGo9bmV3IEFib3J0Q29udHJvbGxlcixjLnNpZ25hbD1qLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoXz1lLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsXykpKSksZmV0Y2goaSxPYmplY3QuYXNzaWduKHt9LGMpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHAucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBqJiZqLmFib3J0KCksdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO2c9ay5oZWFkZXJzLGw9Wy4uLmddLnJlZHVjZSgoKGUsW3Qscl0pPT4oZVt0XT1yLGUpKSx7fSksaD1hd2FpdCBrLmpzb24oKSxoLnJlZnJlc2hfdG9rZW4/KGYmJihvLmxhdGVzdF9yZWZyZXNoX3Rva2VuPWgucmVmcmVzaF90b2tlbixPPXUsYj1oLnJlZnJlc2hfdG9rZW4sT2JqZWN0LmVudHJpZXMobykuZm9yRWFjaCgoKFtlLHRdKT0+e3Q9PT1PJiYob1tlXT1iKX0pKSksKChlLHQscik9PntvW24odCxyKV09ZX0pKGgucmVmcmVzaF90b2tlbixkLHkpLGRlbGV0ZSBoLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KShkLHkpLHAucG9zdE1lc3NhZ2Uoe29rOmsub2ssanNvbjpoLGhlYWRlcnM6bH0pfWNhdGNoKGUpe3AucG9zdE1lc3NhZ2Uoe29rOiExLGpzb246e2Vycm9yOmUuZXJyb3IsZXJyb3JfZGVzY3JpcHRpb246ZS5tZXNzYWdlfSxoZWFkZXJzOmx9KX12YXIgTyxiLGcsX30pKX0oKTsKCg==",ld=null,fd=!1,function(t){return Bo=Bo||wg(ud,ld,fd),new Worker(Bo,t)});const Go={};let Sg=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 Ig={memory:()=>new yv().enclosedCache,localstorage:()=>new fg},dd=t=>Ig[t],hd=t=>{const{openUrl:e,onRedirect:r}=t,n=st(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},n),{openUrl:e===!1||e?e:r})},vd=(t,e)=>{const r=e?.split(" ")||[];return(t?.split(" ")||[]).every((n=>r.includes(n)))},$t={NONCE:"nonce",KEYPAIR:"keypair"};let Pg=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($t).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($t.NONCE,this.buildKey(r),e)}setKeyPair(e){return this.save($t.KEYPAIR,this.buildKey(),e)}async save(e,r,n){await this.executeDbRequest(e,"readwrite",(a=>a.put(n,r)))}findNonce(e){return this.find($t.NONCE,this.buildKey(e))}findKeyPair(){return this.find($t.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($t.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId($t.KEYPAIR,this.clientId)}},Eg=class{constructor(e){this.storage=new Pg(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 ng(),await this.storage.setKeyPair(e)),e}async generateProof(e){const r=await this.getOrGenerateKeyPair();return ig(Object.assign({keyPair:r},e))}async calculateThumbprint(){return ag(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}};var lr;(function(t){t.Bearer="Bearer",t.DPoP="DPoP"})(lr||(lr={}));let kg=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=lr.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?lr.DPoP:lr.Bearer,i=n):(a=n.token_type,i=n.access_token),this.setAuthorizationHeader(e,i,a),a===lr.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 dv(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)}},_g=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 pd({type:"invalid_json",status:e.status,title:"Invalid JSON response",detail:r||String(n)})}if(e.ok)return r;throw new pd(r)}},pd=class Sv 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,Sv.prototype)}};const Wo=new Fm;let Tg=class{constructor(e){let r,n;if(this.userCache=new yv().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",!fd(r))throw new Error(`Invalid cache location "${r}"`);n=fd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?ur:dg,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:hg;var i;this.scope=((u,l,...c)=>{if(typeof u!="object")return{default:hn(l,u,...c)};let f={default:hn(l,...c)};return Object.keys(u).forEach((h=>{const d=u[h];f[h]=hn(l,d,...c)})),f})(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new cg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||rv,this.cacheManager=new sg(n,n.allKeys?void 0:new mg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new wg(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 Sg(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 pg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||tv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${us(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return lg({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 ad(s),l=od(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:an(v,p.scope,p.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 Mm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new zs(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=dd(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:Nt.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===Nt.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 xm(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:Nt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Dm(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:Nt.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:an(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 cs;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:an(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({},Nm),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?${us(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=dd(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((p,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 cs),b()}),1e3*P);R=function(j){if(j.origin!=g||!j.data||j.data.type!=="authorization_response")return;const z=j.source;z&&z.close(),j.data.response.error?y(Ee.fromPayload(j.data.response)):w(j.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",p)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new 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 cv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=g.every((w=>p.includes(w)));return p.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||!hd(l,s))&&!hd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((g=>p.indexOf(g)==-1)).join(",")})(i,c.scope);throw new Km(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 ig(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:an(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 bg(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 ad(u),c=od(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:Nt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Pg(t){const e=new Ig(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 Eg="sesamy.com",kg="sesamy.dev",_g="https://sesa.my",pd="sesamyCacheTimestamp",md="sesamyContentReloaded";function Sv(t,e){return`${t}.${e==="dev"?kg:Eg}`}function ot(t,e){return`https://${Sv(t,e)}`}function bn(){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",!dd(r))throw new Error(`Invalid cache location "${r}"`);n=dd(r)()}this.httpTimeoutMs=e.httpTimeoutInSeconds?1e3*e.httpTimeoutInSeconds:1e4,this.cookieStorage=e.legacySameSiteCookie===!1?ur:gg,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:yg;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 hg(a,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||nv,this.cacheManager=new dg(n,n.allKeys?void 0:new Sg(n,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new Eg(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 _g(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 bg)}_url(e){const r=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||rv)));return`${this.domainUrl}${e}&auth0Client=${r}`}_authorizeUrl(e){return this._url(`/authorize?${us(e)}`)}async _verifyIdToken(e,r,n){const a=await this.nowProvider();return pg({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 id(s),l=sd(u),c=await((a=this.dpop)===null||a===void 0?void 0:a.calculateThumbprint()),f=((d,v,p,g,P,w,y,m,b)=>Object.assign(Object.assign(Object.assign({client_id:d.clientId},d.authorizationParams),p),{scope:cn(v,p.scope,p.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 Bm(s.popup)))}),1e3),h=setTimeout((()=>{clearInterval(f),l(new zs(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=hd(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:Nt.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===Nt.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 zm(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:Nt.Code}}async _handleConnectAccountRedirectCallback(e,r){const{connect_code:n,state:a,error:i,error_description:o}=e;if(i)throw new Hm(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:Nt.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 cs;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({},Km),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?${us(Object.assign({clientId:e.clientId},a))}`)+i}async logout(e={}){var r;const n=hd(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((p,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 cs),b()}),1e3*P);R=function(j){if(j.origin!=g||!j.data||j.data.type!=="authorization_response")return;const z=j.source;z&&z.close(),j.data.response.error?y(Ee.fromPayload(j.data.response)):w(j.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",p)})))(a,h,f);if(i!==d.state)throw new Ee("state_mismatch","Invalid state");const v=await this._requestToken(Object.assign(Object.assign({},e.authorizationParams),{code_verifier:s,code:d.code,grant_type:"authorization_code",redirect_uri:u,timeout:e.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:o,organization:r.organization});return Object.assign(Object.assign({},v),{scope:l,oauthTokenScope:v.scope,audience:c})}catch(f){throw f.error==="login_required"&&this.logout({openUrl:!1}),f}}async _getTokenUsingRefreshToken(e){const r=await this.cacheManager.get(new 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 uv(e.authorizationParams.audience||"default",e.authorizationParams.scope)}const n=e.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof e.timeoutInSeconds=="number"?1e3*e.timeoutInSeconds:null,i=((c,f,h,d)=>{var v;if(c&&h&&d){if(f.audience!==h)return f.scope;const p=d.split(" "),g=((v=f.scope)===null||v===void 0?void 0:v.split(" "))||[],P=g.every((w=>p.includes(w)));return p.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||!vd(l,s))&&!vd(i,c.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(e);await this.cacheManager.remove(this.options.clientId,e.authorizationParams.audience,e.authorizationParams.scope);const f=((h,d)=>{const v=h?.split(" ")||[],p=d?.split(" ")||[];return v.filter((g=>p.indexOf(g)==-1)).join(",")})(i,c.scope);throw new Wm(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 lg(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 kg(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 id(u),c=sd(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:Nt.ConnectCode});const v=new URL(f);v.searchParams.set("ticket",h.ticket),r?await r(v.toString()):window.location.assign(v)}};async function Rg(t){const e=new Tg(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 Og="sesamy.com",Cg="sesamy.dev",Ag="https://sesa.my",md="sesamyCacheTimestamp",gd="sesamyContentReloaded";function Iv(t,e){return`${t}.${e==="dev"?Cg:Og}`}function ot(t,e){return`https://${Iv(t,e)}`}function Br(){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 ds={d:(t,e)=>{for(var r in e)ds.o(e,r)&&!ds.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Hs={};ds.d(Hs,{A:()=>Tg,k:()=>Bs});var jr=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 Bs(){return jr(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(v){h=v.message.length}return h}function s(){return jr(this,void 0,void 0,function(){var h,d;return Nr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return jr(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 v=String(Math.random());try{var p=indexedDB.open(v,1);p.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(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var g,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(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return jr(this,void 0,Promise,function(){var d,v,p;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(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return jr(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=Bs);const Tg=Bs;Hs.A;const Rg=Hs.k,vn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(vn);return t===null?void 0:t==="true"}catch{return}}async function Og(){try{const t=sessionStorage.getItem(vn);if(t!==null)return t==="true";const{isPrivate:e}=await Rg();return sessionStorage.setItem(vn,e.toString()),e}catch{try{sessionStorage.setItem(vn,"false")}catch{}return!1}}function Vr(){return typeof window<"u"}function gd(t,e,r,n,a){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)t=t?t[e[n]]:a;return t===a?r:t}var Cg="function",Ag="string",tt="undefined",Ug="boolean",Sn="object",$g="array",Lg="number",qg="symbol",jg="null",hs=function(){},Iv="any",Pv="*",Vt="__",Ng="form",xg="input",Dg="button",Mg="select",In=typeof process!==tt?process:{};In.env&&In.env.NODE_ENV;var Ce=typeof document!==tt;In.versions!=null&&In.versions.node!=null;typeof Deno!==tt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==tt&&typeof navigator.userAgent!==tt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function Ev(t,e){return e.charAt(0)[t]()+e.slice(1)}var Fg=Ev.bind(null,"toUpperCase"),Kg=Ev.bind(null,"toLowerCase");function zg(t){return kv(t)?Fg(jg):typeof t===Sn?Wg(t):Object.prototype.toString.call(t).slice(8,-1)}function Pn(t,e){e===void 0&&(e=!0);var r=zg(t);return e?Kg(r):r}function nn(t,e){return typeof e===t}var ze=nn.bind(null,Cg),_t=nn.bind(null,Ag),fr=nn.bind(null,tt),Hg=nn.bind(null,Ug);nn.bind(null,qg);function kv(t){return t===null}function Bg(t){return Pn(t)===Lg&&!isNaN(t)}function _v(t){return Pn(t)===$g}function Ke(t){if(!Gg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Gg(t){return t&&(typeof t===Sn||t!==null)}function Wg(t){return ze(t.constructor)?t.constructor.name:null}function Vg(t){return t instanceof Error||_t(t.message)&&t.constructor&&Bg(t.constructor.stackTraceLimit)}function Tv(t,e){if(typeof e!="object"||kv(e))return!1;if(e instanceof t)return!0;var r=Pn(new t(""));if(Vg(e))for(;e;){if(Pn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Tv.bind(null,TypeError);Tv.bind(null,SyntaxError);function Hn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?Jg(t,e):r}function Jg(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Bn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Bn(Hn,Ng);Bn(Hn,Dg);Bn(Hn,xg);Bn(Hn,Mg);function Zg(t){return t?_v(t)?t:[t]:[]}function yd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function Yg(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function Xg(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function Qg(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=yd(r[1]),o=yd(r[2]);if(i)if(i.substring(i.length-2)==="[]"){var s=n[i=i.substring(0,i.length-2)]||(n[i]=[]);n[i]=Array.isArray(s)?s:[],n[i].push(o)}else n[i]=o===""||o}for(var u in n){var l=u.split("[");l.length>1&&(ey(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 ey(t,e,r){for(var n=e.length-1,a=0;a<n;++a){var i=e[a];if(i==="__proto__"||i==="constructor")break;i in t||(t[i]={}),t=t[i]}t[e[n]]=r}function Gn(){for(var t="",e=0,r=4294967295*Math.random()|0;e++<36;){var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],a=15&r;t+=n=="-"||n=="4"?n:(n=="x"?a:3&a|8).toString(16),r=e%8==0?4294967295*Math.random()|0:r>>4}return t}function ty(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 Ft="global",yr=Vt+Ft+Vt,wr=typeof self===Sn&&self.self===self&&self||typeof global===Sn&&global[Ft]===global&&global||void 0;function Jt(t){return wr[yr][t]}function Zt(t,e){return wr[yr][t]=e}function Or(t){delete wr[yr][t]}function Cr(t,e,r){var n;try{if(Ws(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}wr[yr]||(wr[yr]={});var on={};function Ws(t){if(typeof on[t]!==tt)return on[t];try{var e=window[t];e.setItem(tt,tt),e.removeItem(tt)}catch{return on[t]=!1}return on[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 Et="function",vt="undefined",Br="reducer",Rv="@@redux/",vs=Rv+"INIT",ry=Rv+Math.random().toString(36),wd=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),sn=" != "+Et;function Ov(t,e,r){var n;if(typeof e===Et&&typeof r===vt&&(r=e,e=void 0),typeof r!==vt){if(typeof r!==Et)throw new Error("enhancer"+sn);return r(Ov)(t,e)}if(typeof t!==Et)throw new Error(Br+sn);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!==Et)throw new Error("Listener"+sn);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===vt)throw new Error("ActType "+vt);if(u)throw new Error("Dispatch in "+Br);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:vs}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+Br+sn);a=d,h({type:vs})}})[wd]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function g(){p.next&&p.next(c())}return g(),{unsubscribe:v(g)}}})[wd]=function(){return this},d},n}function ny(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Br+" "+t+" returns "+vt}function br(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function ay(){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=br.apply(void 0,i)(o.dispatch)})}}}var Tt=Vt+"anon_id",Kt=Vt+"user_id",hr=Vt+"user_traits",ps="analytics",Pt="userId",dr="anonymousId",pn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ms=["name","EVENTS","config","loaded"],Q=pn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),bd=/^utm_/,Sd=/^an_prop_/,Id=/^an_trait_/;function iy(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(Tt,o.anonymousId),l||e(Kt,o.userId),u.traits&&e(hr,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(v,p){if(p.match(bd)||p.match(/^(d|g)clid/)){var g=p.replace(bd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Sd)&&(v.props[p.replace(Sd,"")]=i[p]),p.match(Id)&&(v.traits[p.replace(Id,"")]=i[p]),v},{campaign:{},props:{},traits:{}});r.dispatch(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 oy(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Tt)return ee({},e,{anonymousId:r.value});if(r.key===Kt)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[Kt,Tt,hr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Pd(t){return{userId:t.getItem(Kt),anonymousId:t.getItem(Tt),traits:t.getItem(hr)}}var gs=function(t){return Vt+"TEMP"+Vt+t};function sy(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&&([Kt,hr,Tt].forEach(function(d){n(d)}),[Pt,dr,"traits"].forEach(function(d){Or(gs(d))})),s.type===Q.identify){a(Tt)||r(Tt,Gn());var f=a(Kt),h=a(hr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Kt,u),l&&r(hr,ee({},h,l))}return o(s)}}}}var Fr={};function Ed(t,e){Fr[t]&&ze(Fr[t])&&(Fr[t](e),delete Fr[t])}function Cv(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 Cv(t,e,r-10).then(n,a)})})}function cy(t){return{abort:t}}function Av(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&ze(p)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Pt,dr].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=p({payload:P,config:o[d].config,instance:r,abort:cy}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=v+":"+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 Vo=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(vr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var j=w.type.match(vr)?(function(z,V,te,q,M){return function(N,S){var O=q?q.name:z,L=S&&Jr(S)?S:te;if(q&&(!(L=S&&Jr(S)?S:[z]).includes(z)||L.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(L)+" input valid");return ee({},M,{abort:{reason:N,plugins:L,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:uy(w),instance:g,config:b||{},abort:j}}})(n,d),p=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,j,z){return Promise.resolve(A).then(function(V){return j.method&&ze(j.method)?((function(N,S){var O=Ad(N);if(O&&O.name===S){var L=Ad(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(L?"or "+L.method:"")+" in "+S+" plugin insteadof "+N].join(`
|
|
35
|
-
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:V,instance:n,abort:(te=V,q=y,M=j.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[q],caller:f,from:M||q}})}),config:Td(j.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,q,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 j=g[b]?g[b]:{};if(h&&(j=A),Zo(j,b))return Jo({data:j,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(Zo(A,b))return m&&Jo({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(p.hasOwnProperty(b)&&p[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:j,instance:n,config:Td(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},q=ee({},A,te),M=g[b];if(Zo(M,b))Jo({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(kd)&&!f.match(_d)&&n.dispatch(ee({},h?q:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(q)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(vr)||f.match(/^registerPlugin/)||f.match(_d)||f.match(kd)||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)}},vr=/Start$/,kd=/^bootstrap/,_d=/^ready/;function Jo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Td(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Rd(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Od(t,e){var r=t.replace(vr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Zo(t,e){var r=t.abort;return!!r&&(r===!0||Cd(r,e)||r&&Cd(r.plugins,e))}function Uv(t,e){var r=t.abort;if(!r)return!1;if(r===!0||_t(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 Cd(t,e){return!(!t||!Jr(t))&&t.includes(e)}function Ad(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function uy(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 ly(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 Ed(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),p=[],g=[],P=o.disabled,w=v.map(function(m){var b=m.loaded,R=m.name,A=m.config;return Cv(m,function(){return b({config:A})},1e4).then(function(j){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!ms.includes(z)})}),n[R]=!0),p=p.concat(R),m}).catch(function(j){if(j instanceof Error)throw new Error(j);return g=g.concat(j.name),j})});Promise.all(w).then(function(m){var b={plugins:p,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 Av(a,e,t)},0),Promise.resolve((function(m,b,R,A,j){try{var z=ze(b)?b():b,V=m.type,te=V.replace(vr,"");if(m._&&m._.called)return Promise.resolve(m);var q=R.getState(),M=(O=z,(L=q.plugins)===void 0&&(L={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var _=F.plugins||{};return Hg(_[I])?_[I]:_.all!==!1&&(!L[I]||L[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys(q.plugins).filter(function(I){var _=q.plugins[I];return m.plugins.includes(I)&&!_.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,_){var x=Od(I).map(function(H){return Rd(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Od(I,J).map(function(ke){return Rd(ke,_)}),ne=fe[0],ce=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ce.length&&(H.duringNS[J]=ce),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,M);return Promise.resolve(Vo({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(I){function _(){var Y=(function(){if(V.match(vr))return Promise.resolve(Vo({action:ee({},x,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&Ed(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if(Uv(I,N.length))return I;var x,H=(function(){if(V!==te)return Promise.resolve(Vo({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(Y){x=Y});x=I})();return H&&H.then?H.then(_):_()})}catch(I){return Promise.reject(I)}var O,L,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 fy(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 dy=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return br.apply(void 0,o)(n)(a)}}}}};function hy(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=Ud(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=Ud(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,$d(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,$d(r.plugins,!0,e));default:return e}}}function Ud(t,e){return t.substring(e.length+1,t.length)}function $d(t,e,r){return t.reduce(function(n,a){return n[a]=ee({},r[a],{enabled:e}),n},r)}function $v(t){try{return JSON.parse(JSON.stringify(t))}catch{}return t}var vy={last:{},history:[]};function py(t,e){t===void 0&&(t=vy);var r=e.options,n=e.meta;if(e.type===Q.track){var a=$v(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 my={actions:[]};function gy(t,e){t===void 0&&(t=my);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 Lv=/#.*$/;function yy(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(Lv,""):"")}var qv,jv,Nv,xv,wy=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 v,p=document.getElementsByTagName("link"),g=0;v=p[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(Lv,"")})(l),f={title:r,url:c,path:yy(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},by={last:{},history:[]};function Sy(t,e){t===void 0&&(t=by);var r=e.options;if(e.type===Q.page){var n=$v(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}qv=(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"})(),jv=Ce?document.referrer:null,Nv=Yg(),xv=Xg();var Ld={initialized:!1,sessionId:Gn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:qv},userAgent:Ce?navigator.userAgent:"node",library:{name:ps,version:"0.13.1"},timezone:xv,locale:Nv,campaign:{},referrer:jv};function Iy(t,e){t===void 0&&(t=Ld);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({},Ld,t,{initialized:!0})}}var Py=["plugins","reducers","storage"];function Ey(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function ky(t){var e=Ey.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Dv(){return Zt(ps,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return wr[yr][ps].push(o.action||o),i(o)}})}}}function qd(t){return function(){return br(br.apply(null,arguments),Dv())}}function Yo(t){return t?_v(t)?t:[t]:[]}function jd(t,e,r){t===void 0&&(t={});var n,a,i=Gn();return e&&(Fr[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 _y(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,_){if(ze(_))return I.middlewares=I.middlewares.concat(_),I;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var x=_.EVENTS?Object.keys(_.EVENTS).map(function(J){return _.EVENTS[J]}):[];I.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(I.methods[_.name]=Object.keys(_.methods).reduce(function(J,fe){var ne;return J[fe]=(ne=_.methods[fe],function(){for(var ce=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ce.length;ke++)ae[ke]=ce[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete _.methods);var H=Object.keys(_).concat(x),Y=new Set(I.events.concat(H));if(I.events=Array.from(Y),I.pluginsArray=I.pluginsArray.concat(_),I.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return I.plugins[_.name]=_,I.plugins[_.name].loaded||(I.plugins[_.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Jt,setItem:Zt,removeItem:Or},i=(function(I){return function(_,x,H){return x.getState("user")[_]||(H&&Ke(H)&&H[_]?H[_]:Pd(I)[_]||Jt(gs(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ms.includes(I)}).sort(),u=new Set(s.concat(pn).filter(function(I){return!ms.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new dy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=Qg(),P=Pd(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Gn());var y=ee({enable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.enablePlugin,plugins:Yo(I),_:{originalAction:Q.enablePlugin}},x,[_])})},disable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.disablePlugin,plugins:Yo(I),_:{originalAction:Q.disablePlugin}},x,[_])})}},n.methods),m=!1,b={identify:function(I,_,x,H){try{var Y=_t(I)?I:null,J=Ke(I)?I:_,fe=x||{},ne=b.user();Zt(gs(Pt),Y);var ce=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ce,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[_,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(I,_,x,H){try{var Y=Ke(I)?I.event:I;if(!Y||!_t(Y))throw new Error("EventMissing");var J=Ke(I)?I:_||{},fe=Ke(x)?x:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Pt,b,_),anonymousId:i(dr,b,_)},ne,[_,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(I,_,x){try{var H=Ke(I)?I:{},Y=Ke(_)?_:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:wy(H),options:Y,userId:i(Pt,b,H),anonymousId:i(dr,b,H)},J,[I,_,x])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Pt||I==="id")return i(Pt,b);if(I===dr||I==="anonId")return i(dr,b);var _=b.getState("user");return I?gd(_,I):_},reset:function(I){return new Promise(function(_){S.dispatch({type:Q.resetStart},_,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(_){I&&I(_),m=!0})},on:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var x=/Start$|Start:/;if(I==="*"){var H=function(ne){return function(ce){return function(ae){return ae.type.match(x)&&_({payload:ae,instance:b,plugins:o}),ce(ae)}}},Y=function(ne){return function(ce){return function(ae){return ae.type.match(x)||_({payload:ae,instance:b,plugins:o}),ce(ae)}}};return h(H,cn),h(Y,un),function(){d(H,cn),d(Y,un)}}var J=I.match(x)?cn:un,fe=function(ne){return function(ce){return function(ae){return ae.type===I&&_({payload:ae,instance:b,plugins:o,abort:p}),ce(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var x=b.on(I,function(H){_({payload:H.payload,instance:b,plugins:o,abort:p}),x()});return x},getState:function(I){var _=S.getState();return I?gd(_,I):Object.assign({},_)},dispatch:function(I){var _=_t(I)?{type:I}:I;if(pn.includes(_.type))throw new Error("reserved action "+_.type);var x=ee({},_,{_:ee({originalAction:_.type},I._||{})});S.dispatch(x)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,_,x){S.dispatch({type:Q.setItemStart,key:I,value:_,options:x})},removeItem:function(I,_){S.dispatch({type:Q.removeItemStart,key:I,options:_})}},setAnonymousId:function(I,_){b.storage.setItem(Tt,I,_)},events:{core:pn,plugins:s}},R=n.middlewares.concat([function(I){return function(_){return function(x){return x.meta||(x.meta=jd()),_(x)}}},v(cn),ly(b,c,{all:l,plugins:s}),fy(a),iy(b),sy(b),v(un)]),A={context:Iy,user:oy(a),page:Sy,track:py,plugins:hy(c),queue:gy},j=br,z=br;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(j=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Dv():Ke(typeof arguments[0])?qd():qd().apply(null,arguments)}}var te,q=(function(I){return Object.keys(I).reduce(function(_,x){return Py.includes(x)||(_[x]=I[x]),_},{})})(t),M=n.pluginsArray.reduce(function(I,_){var x=_.name,H=_.config,Y=_.loaded,J=n.pluginEnabled[x];return I[x]={enabled:J,initialized:!!J&&!_.initialize,loaded:!!Y({config:H}),config:H},I},{}),N={context:q,user:w,plugins:M},S=Ov((function(I){for(var _=Object.keys(I),x={},H=0;H<_.length;H++){var Y=_[H];typeof I[Y]===Et&&(x[Y]=I[Y])}var J,fe=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ce){var ae=ne[ce];if(typeof ae(void 0,{type:vs})===vt||typeof ae(void 0,{type:ry})===vt)throw new Error(Br+" "+ce+" "+vt)})})(x)}catch(ne){J=ne}return function(ne,ce){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,x[De])(Le,ce);if(typeof Qe===vt){var St=ny(De,ce);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),N,z(j(ay.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:jd(I.meta,_,Yo(x))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:q,params:g,user:w,initialUser:r,persistedUser:P});var L=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,_){var x=I.bootstrap,H=I.config,Y=I.name;x&&ze(x)&&x({instance:b,config:H,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===_+1&&S.dispatch({type:Q.initializeStart,plugins:L,disabled:F})}),ky(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return Av(I,_,x)},3e3)})(S,c,b),b}var cn="before",un="after",zt="cookie",xt=Kv(),Mv=Wn,Ty=Wn;function Fv(t){return xt?Wn(t,"",-1):Or(t)}function Kv(){if(xt!==void 0)return xt;var t=zt+zt;try{Wn(t,t),xt=document.cookie.indexOf(t)!==-1,Fv(t)}catch{xt=!1}return xt}function Wn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return xt===!1&&(o?Zt(t,e):Jt(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",Ry=Ws.bind(null,mt);Cr(mt,"getItem",Jt);Cr(mt,"setItem",Zt);Cr(mt,"removeItem",Or);var gt="sessionStorage",Oy=Ws.bind(null,gt);Cr(gt,"getItem",Jt);Cr(gt,"setItem",Zt);Cr(gt,"removeItem",Or);function pr(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 Cy=Ry(),Ay=Oy(),Uy=Kv();function Ht(t,e){if(t){var r=Vs(e),n=!Xs(r),a=Js(r)?pr(localStorage.getItem(t)):void 0;if(n&&!fr(a))return a;var i=Zs(r)?pr(Mv(t)):void 0;if(n&&i)return i;var o=Ys(r)?pr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Jt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function En(t,e,r){if(t&&!fr(e)){var n={},a=Vs(r),i=JSON.stringify(e),o=!Xs(a);return Js(a)&&(n[mt]=ln(mt,e,pr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:Zs(a)&&(n[zt]=ln(zt,e,pr(Mv(t))),Ty(t,i),o)?n[zt]:Ys(a)&&(n[gt]=ln(gt,e,pr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ft]=ln(Ft,e,Jt(t)),Zt(t,e),o?n[Ft]:n)}}function $y(t,e){if(t){var r=Vs(e),n=Ht(t,Pv),a={};return!fr(n.localStorage)&&Js(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!fr(n.cookie)&&Zs(r)&&(Fv(t),a[zt]=n.cookie),!fr(n.sessionStorage)&&Ys(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!fr(n.global)&&Vn(r,Ft)&&(Or(t),a[Ft]=n.global),a}}function Vs(t){return t?_t(t)?t:t.storage:Iv}function Js(t){return Cy&&Vn(t,mt)}function Zs(t){return Uy&&Vn(t,zt)}function Ys(t){return Ay&&Vn(t,gt)}function Xs(t){return t===Pv||t==="all"}function Vn(t,e){return t===Iv||t===e||Xs(t)}function ln(t,e,r){return{location:t,current:e,previous:r}}var Ly={setItem:En,getItem:Ht,removeItem:$y};function qy(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nd(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?Nd(Object(r),!0).forEach(function(n){qy(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Nd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Ly};return _y(xd(xd({},e),t))}const Qs="@sesamy/sesamy-js",Jn="1.63.0";function Ny(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=Dy(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function xy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Dy(t){return["#","?"].forEach(e=>t=xy(t,e)),t}function My(){Ny(()=>{dt.page()})}var Xo="up",Qo="down";function Fy(t){if(t===void 0&&(t={}),!Ce)return hs;var e=Md(),r=ys(),n=Dd(),a=fn(n,e),i=fn(r,e),o=[],s=[],u=[],l=n,c=a,f=i,h=Object.keys(t);if(!h.length)return hs;var d=h.map(function(p){return Number(p)}),v=ty(function(){var p=Md(),g=(function(q,M){return M.map(function(N){return N===100?q-5:q*(N/100)})})(p,d),P=ys(),w=Dd(),y=fn(w,p),m=fn(P,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=Xo;b?R="initial":l<=w&&(R=Qo);var A=g,j=d;(R===Xo||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function(q,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),q.singleFunction=M),R===Qo&&!o.includes(M)&&w>=S&&M>i?(s.push(M),q.callbacks=q.callbacks.concat(M),q):R===Xo&&!o.includes(M)&&w<=S&&M<=y?(q.foundFunc=[M],q):(b&&w>=S&&q.foundFunc.length===0&&(q.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),q.singleFunction?u.push(M):q.singleFunction=M),q)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===Qo&&z.callbacks&&z.callbacks.forEach(function(q){ze(t[q])&&(t[q]({trigger:q,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(q))}),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",v),function(){return window.removeEventListener("scroll",v)}}function ys(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function Ky(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Dd(){return Math.round(ys()+Ky())}function Md(){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 fn(t,e){return Math.round(t/e*100)}var ec="Event",Fd=ec+"Listener";function zy(t){return function(e,r,n,a){var i=n||hs,o=a||!1;if(!Ce)return i;var s=kn(r),u=kn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+ec);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Fd:"remove"+Fd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?Hy(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function kn(t,e){if(_t(t))return e?kn(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=Zg(t);return e?i.map(function(o){return _t(o)?kn(o,!0):o}).flat():i}function Hy(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var es=zy(ec);function zv(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}zv.bind(null,"onerror");zv.bind(null,"onload");var Hv=typeof window>"u",Kd="hidden";function By(t){if(Hv)return!1;var e=Gy(),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 Gy(){var t=["webkit","moz","ms","o"];return Hv||Kd in document?Kd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Wy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Vy(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=By(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Wy.map(function(s){return es(document,s,r)})).concat(es(window,"load",r)).concat(es(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function Jy(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(g){d(),i&&!c&&i(xr(h),g),a&&c&&(c=!1,a(xr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(xr(h),g))},s)}var p=Vy(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=p();return function(){return f=!1,h=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:xr(h,f),idle:c?xr(r,f):0}}}}function xr(t,e){return e?0:Math.round((new Date-t)/1e3)}const zd=5e3;class Zy{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),Jy({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:zd}),Fy({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*zd:Date.now(),this.isInViewport&&this.trackAwake(e,r)}handleScroll(e){this.scrollCallback&&this.scrollCallback(e)}handleVisibilityChange(){this.isAwake=!1;const e=Math.round((Date.now()-this.lastEventAt)/1e3);e>1&&(this.lastEventAt=Date.now(),this.trackAwake(!1,e))}trackAwake(e,r){!e&&this.activeDurationCallback&&this.activeDurationCallback(r,this.isFlushing,this.lastEventAt),e&&this.idleDurationCallback&&this.idleDurationCallback(r,this.isFlushing,this.lastEventAt)}trackInViewport(){this.registeredView||(this.registeredView=!0,this.viewCallback&&this.viewCallback())}}function Bv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function Yy(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 Hd="sesamy_session_id";function Xy(){let t=sessionStorage.getItem(Hd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Hd,t)),t}function Gv(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 Qy(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}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"}},Wv=[],Vv=!1,Bt;function Jv(){const t=window.location.pathname;return Wv.find(e=>e.path?t.includes(e.path):!0)}function ew(t,e){Wv=t.content||[];const r=Jv();r&&r.type==="article"&&(Fe={...Fe,...Qy(r.selectors)},Vv=r.enablePaywallSettingsUrlFallback||!1),Bt=e}function tw(t,e){const{selector:r}=e;return r===Fe.article.selector?t:t.querySelector(r)}function Zv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Zv(t.parentElement,e):t.textContent??void 0}function mr(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 Yv({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||mr(`sesamy:${e}`)||mr(`og:${e}`)||mr(e)||r}function rw(){const t=document.querySelectorAll(Fe.article.selector);return Array.from(t).map(Zn).filter(e=>e!==null)}function Zn(t){const e=typeof t=="string"?document.querySelector(t):t;if(!e)return null;const r={element:e,selector:typeof t=="string"?t:Gv(e)},n=(i,o,s,u)=>{const l=tw(e,o);if(l){const c=Zv(l,o)||Yv({publisherContentId:s,key:i});c!==void 0&&(r[i]=u?u(c):c)}};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,i=>parseFloat(i)),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,i=>i||"entitlement");const a=Jv();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)),Vv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r}async function nw(t){const e=Zn(t);if(!e)throw new Error("Could not find article element");if(e.paywallUrl){const a=(await Bt.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement";if(e.accessLevel=a,a==="logged-in"){const i=await Bt.auth.isAuthenticated();return e.hasAccess=i,e}}if(!e.url)throw new Error("Article must have a URL");const r=await Bt.entitlements.hasAccess(e.url,e.pass?.split(",")||[]);return e.hasAccess=!!r,e.entitlement=r,e}async function aw(t,e){const r=typeof t=="string"?document.querySelector(t):t;if(!r)throw new Error("Could not find element");const n=Zn(r);if(!n?.url)throw new Error("Could not find content for element");const a=await Bt.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Bt.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Gv(r.parentElement||r);return Bt.proxy.getContent(i.token,n.url,o)}let Xv=!1,mn,_n,ws;function Qv(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:ws,requestId:Math.random().toString(36).slice(2,9),sessionId:Xy(),timestamp:new Date().toISOString(),version:Jn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:mr("sesamy:item-src"),publisherContentId:mr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Qs,userAgent:navigator.userAgent,clientId:ws}}}))}const ep=Yy(async t=>{if(t.length>0){const e=Qv(t);Xv?navigator.sendBeacon(_n,e):(await fetch(_n,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function ts(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(_n,Qv([e]))}else ep.push(t)}function iw(){return Xv=!0,ep.flush()}function ow(t,e,r){mn=e,_n=`${ot("logs",r)}/events`,ws=t}const sw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ts({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ts({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!mn)return;const{properties:e,anonymousId:r,userId:n}=t;ts({anonymousId:r,userId:n,properties:e,type:"identify"})}},Bd=["source","medium","campaign","term","content"],kt="utm_",cw=1800*1e3;function tp(t){return t?Date.now()-parseInt(t,10)>cw:!0}function Gd(){const t=document.referrer||"";if(!t)return;const e=Ht(`${kt}set_at`);(tp(e)||!Ht(`${kt}referrer`))&&En(`${kt}referrer`,t)}function uw(){const t=()=>{const r={};for(const a of Bd){const i=Ht(`${kt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Ht(`${kt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Gd()},campaign({payload:r}){const n=r?.campaign||{},a=Ht(`${kt}set_at`);if(Object.keys(n).length>0&&tp(a)){for(const o of Bd){const s=n[o];s&&En(`${kt}${o}`,s)}En(`${kt}set_at`,String(Date.now()))}Gd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const lw=uw(),Wd=new Map,Vd=new Map;function fw({clientId:t,enabled:e=!0,environment:r}){ow(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Vd.forEach((n,a)=>{n.bind(a)()}),iw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Wd.forEach((n,a)=>{n.bind(a)()})}),My(),Bv(()=>{const n=new Zy({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})}});Vd.set(document.body,()=>{n.flush()}),Wd.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=jy({app:Qs,version:Jn,plugins:[lw,sw]});function rp(t,e){dt.track(t,e)}function np(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});rp(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function dw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function hw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function vw(){return/android/i.test(navigator.userAgent)}let Oe,ap,Gr,bs=!1,gn=!1;Vr()&&window.addEventListener("pageshow",()=>{gn=!1});const Sr="sesamyAccessToken",rs="sesamyRefreshToken",Tn="sesamySilentAuthThrottle",pw=300*1e3;async function Yn(){return bs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{bs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function mw(t){if(!t)return null;const e=localStorage.getItem(rs);if(!e)return le("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(rs),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(rs,i.refresh_token),localStorage.setItem(Sr,i.access_token),i.access_token}catch{nc()}}async function tc(){const t=localStorage.getItem(Sr);if(!t)return null;const e=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await mw(e);if(r)return r;localStorage.removeItem(Sr)}return t}let dn=null;const gw=64;function yw(){try{if(dn!==null)return dn;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===gw)return dn=!0,!0}}catch(t){le(`Error checking for existing auth0 tokens: ${t.message}`)}return dn=!1,!1}function ww(t){if(t.domains&&t.domains.length>0){const e=Ir(window.location.href);if(e){for(const r of t.domains)if(Ir(`https://${r}`)===e)return le(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;le(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return le(`Using fallback domain property: ${t.domain}`),t.domain}function Ir(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function bw(t){if(t.enabled===!1)return;ap=t.organization;const e=ww(t);Gr=e&&!yw()?e:Sv("token",t.environment);const r={domain:Gr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",Ir(window.location.href)!==Ir(`https://${Gr}`)&&(r.useRefreshTokens=!0),le(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Pg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)le("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{le("Code found in URL, handling redirect");try{const u=await Oe.handleRedirectCallback();le(`Login result: ${JSON.stringify(u)}`);const l=await Oe.getUser();if(!l)throw le("No user found"),new Error("No user found");le(`User found ${JSON.stringify(l)}`),rc(),Wt(Be.AUTHENTICATED,l),le("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}bs=!0,Wt(Be.AUTH_INITIALIZED,{})}async function gr(){return await Yn(),await tc()?!0:Oe?Oe.isAuthenticated():!1}async function Sw(){return await Yn(),await tc()?(le("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function ip(t){if(gn)return le("Login already in progress"),null;if(gn=!0,setTimeout(()=>{gn=!1},3e3),localStorage.removeItem(Sr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:ap,redirect_uri:window.location.href,ui_locales:bn(),incognito:Gs(),...e}}}async function Xn(t){const e=ip(t);if(e)return Oe.loginWithRedirect(e)}async function op(t){const e=ip(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),rc(),np(Be.AUTHENTICATED,await Oe.getUser()).canceled||window.location.reload()}async function Iw(t){return Gr&&Ir(window.location.href)!==Ir(`https://${Gr}`)&&(hw()||vw()||Gs())?op(t):Xn(t)}function Pw(){try{const t=sessionStorage.getItem(Tn);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<pw}catch{return sessionStorage.removeItem(Tn),!1}}function Ew(){try{const t={timestamp:Date.now()};sessionStorage.setItem(Tn,JSON.stringify(t))}catch{le("Failed to set silent auth throttle in sessionStorage")}}function rc(){try{sessionStorage.removeItem(Tn)}catch{}}async function qt(t=!0,e=!1){await Yn();const r=await tc();if(r)return r;if(!e&&Pw()){if(le("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return le("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=ac(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),rc(),n}catch(n){const a=n;if(le(`Failed to get token silently: ${a.message}`),Ew(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await nc(),t)throw n;return null}}async function nc(t={}){if(await Yn(),localStorage.removeItem(Sr),Wt(Be.LOGOUT,{}),!!Oe)return le(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function ac(t){const e=t.split(".");if(e.length!==3)return null;const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),a=decodeURIComponent(atob(n).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(a)}async function Ss(t){const e=ac(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");le("Set token"),localStorage.setItem(Sr,t),Wt(Be.AUTHENTICATED,e)}const kw=(t,e)=>e.skipDedupe||e.method!=="GET",_w=(t,e)=>e.method+"@"+t,Tw=t=>t.clone(),Rw=({skip:t=kw,key:e=_w,resolver:r=Tw}={})=>{const n=new Map;return a=>(i,o)=>{if(t(i,o))return a(i,o);const s=e(i,o);if(!n.has(s))n.set(s,[]);else return new Promise((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)}}},Ow=(t,e)=>t*e,Cw=t=>t&&t.ok,Aw=({delayTimer:t=500,delayRamp:e=Ow,maxAttempts:r=10,until:n=Cw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,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(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};class Wr 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,Wr)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}var Rn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Rn||{});const Uw="application/json",sp="Content-Type",or=Symbol(),cp=Symbol();function Jd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===sp.toLowerCase()))===null||e===void 0?void 0:e[1]}function Zd(t){return/^application\/.*json.*/.test(t)}const Gt=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]=Gt(o,i,r):n[a]=i,n},{...t})},Pr={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function $w(t,e=!1){Pr.options=e?t:Gt(Pr.options,t)}function Lw(t,e=!1){Pr.polyfills=e?t:Gt(Pr.polyfills,t)}function qw(t){Pr.errorType=t}const jw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class up extends Error{}const Nw=t=>{const e=Object.create(null);t=t._addons.reduce((y,m)=>m.beforeRequest&&m.beforeRequest(y,t._options,e)||y,t);const{_url:r,_options:n,_config:a,_catchers:i,_resolvers:o,_middlewares:s,_addons:u}=t,l=new Map(i),c=Gt(a.options,n);let f=r;const h=jw(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,v=h.catch(y=>{throw{[or]:y}}).then(y=>{var m;if(!y.ok){const b=new up;if(b.cause=d,b.stack=b.stack+`
|
|
36
|
-
CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const 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}),p=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,or),R=b?m[or]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(or)&&l.get(or);if(A)return A(R,t);const j=l.get(cp);if(j)return j(R,t);throw R}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.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(or,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)},xw={_url:"",_options:{},_config:Pr,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:Gt(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:Gt(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:Gt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[sp]: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(cp,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=Jd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Zd(a));return n=r?o?n.json(r,a):n.body(r):n,Nw(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=Jd(this._options.headers);return this.content(e||Zd(r)&&r||Uw).body(JSON.stringify(t))}};function ct(t="",e={}){return{...xw,_url:t,_options:e}}ct.default=ct;ct.options=$w;ct.errorType=qw;ct.polyfills=Lw;ct.WretchError=up;const Dw=(t,e)=>e.skipDedupe||e.method!=="GET",Mw=(t,e)=>e.method+"@"+t,Fw=t=>t.clone(),Kw=({skip:t=Dw,key:e=Mw,resolver:r=Fw}={})=>{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)}}},zw=(t,e)=>e.skipCache||e.method!=="GET",Hw=(t,e)=>e.method+"@"+t,Bw=()=>!1,Gw=()=>null,Ww=t=>t.ok,Vw=({throttle:t=1e3,skip:e=zw,key:r=Hw,clear:n=Bw,invalidate:a=Gw,condition:i=Ww,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,v)=>{const p=r(d,v);let g=a(d,v);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,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(p)){if(s.has(p)){const P=s.get(p).clone();return o&&Object.defineProperty(P,o,{value:p,enumerable:!1}),Promise.resolve(P)}else if(u.has(p))return new Promise((P,w)=>{u.get(p).push([P,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(P=>(i(P.clone())&&s.set(p,P.clone()),u.get(p).forEach(([w])=>w(P.clone())),u.delete(p),P)).catch(P=>{throw u.get(p).forEach(([,w])=>w(P)),u.delete(p),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Jw=(t,e)=>t*e,Zw=t=>t&&t.ok,Yw=({delayTimer:t=500,delayRamp:e=Jw,maxAttempts:r=10,until:n=Zw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,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(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},Xw="@sesamy/sdk",Qw="1.17.0";class eb{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 Kr="sesamyCacheTimestamp",tb=t=>{const{libraryName:e=Xw,libraryVersion:r=Qw,cache:n}=t,a=n?.storage||new eb,i=[s=>async(u,l)=>{if(n?.mode===Rn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Kr),c||(c=Date.now().toString(),sessionStorage.setItem(Kr,c))):(c=a.get(Kr),c||(c=Date.now().toString(),a.set(Kr,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)},Kw()];n?.mode===Rn.NORMAL&&i.push(Vw({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(Yw({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?JSON.parse(u.body):void 0);break;case"put":h=c.put(u.body?JSON.parse(u.body):void 0);break;case"patch":h=c.patch(u.body?JSON.parse(u.body):void 0);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 v=await d.text().catch(()=>"Unknown error");throw new Wr(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Wr)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Wr(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},pt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Kr),"Cache cleared"),Dr={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"})}},ns={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`)},Yd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Xd={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Mr={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"})},as={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},sr={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)})},is={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"})}},cr={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(`meta-${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()}},os={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(`meta-${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)})},Qd={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},eh={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},rb={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},nb={list:async t=>t.request("/payment-issues")},ab={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)}},ib={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},th={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ob=t=>{const e=tb(t);return{profile:{get:r=>Dr.get(e,r),update:(r,n)=>Dr.update(e,r,n),checkSpotifyLink:()=>Dr.checkSpotifyLink(e),unlinkSpotify:()=>Dr.unlinkSpotify(e),delete:()=>Dr.delete(e)},entitlements:{list:r=>ns.list(e,r),get:r=>ns.get(e,r),getAccess:r=>ns.getAccess(e,r)},subscriptions:{list:()=>Yd.list(e),get:r=>Yd.get(e,r)},products:{get:r=>Xd.get(e,r),autoOnboard:r=>Xd.autoOnboard(e,r)},contracts:{list:()=>Mr.list(e),get:r=>Mr.get(e,r),cancel:r=>Mr.cancel(e,r),createAmendment:(r,n)=>Mr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Mr.confirmAmendment(e,r,n)},userMetadata:{get:()=>as.get(e),set:(r,n)=>as.set(e,r,n),delete:r=>as.delete(e,r)},tallies:{list:()=>sr.list(e),get:r=>sr.get(e,r),update:(r,n)=>sr.update(e,r,n),create:r=>sr.create(e,r),delete:r=>sr.delete(e,r),push:(r,n)=>sr.push(e,r,n)},tags:{list:()=>is.list(e),add:r=>is.add(e,r),remove:r=>is.remove(e,r)},checkouts:{generateLink:(r,n)=>cr.generateCheckoutLink(r,n),create:r=>os.create(e,r),get:r=>os.get(e,r),update:(r,n)=>os.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>cr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>cr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>cr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>cr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>cr.generateConsumeLink(r,n)},bills:{list:()=>Qd.list(e),get:r=>Qd.get(e,r)},fulfillments:{list:()=>eh.list(e),create:r=>eh.create(e,r)},paywalls:{get:r=>rb.get(e,r)},paymentIssues:{list:()=>nb.list(e)},proxy:{content:(r,n,a,i)=>ab.content(e,r,n,a,i)},transactions:{list:r=>ib.list(e,r)},vendor:{get:()=>th.get(e),list:()=>th.list(e)}}};class sb{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 Is(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function lp(t,e){if(Is(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 rh(t){return t.endsWith("/")?t.slice(0,-1):t}function nh(t,e){if(!Is(t)||!Is(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&rh(r.pathname)===rh(n.pathname)}function cb(t,e,r){const n=new URL(`${ot("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=lp(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(`meta-${c}`,String(f))}),n}const fp="sesamySignedURLs";function ic(){const t=sessionStorage.getItem(fp);return t?JSON.parse(t):[]}function ub(t){const e=ic();e.push(t),le(`Adding signed URL: ${t}`),sessionStorage.setItem(fp,JSON.stringify(e))}function lb(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ps="sesamyAttribution";function fb(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 db(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function On(){return fb(Ps)||{}}function dp(t){if(t===null)localStorage.removeItem(Ps);else{le(`Setting attribution ${JSON.stringify(t)}`);const e=On()??{},r=lb({...e,...db(t)});localStorage.setItem(Ps,JSON.stringify({value:r}))}}function hb(t){const e=t.endpoint||ot("api2",t.environment),n=ob({baseUrl:e,tokenProvider:async()=>{if(await gr())try{const L=await qt(!1);if(L)return`Bearer ${L}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:Qs,libraryVersion:Jn,vendorId:t.vendorId,cache:{mode:Rn.BROWSER,storage:new sb}}),a=S=>async(O,L)=>{let F=sessionStorage.getItem(pd);F||(F=Date.now().toString(),sessionStorage.setItem(pd,F));const I={...L,headers:{...L.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(L,F)=>{let I=null;if(I=await qt(S),!I){if(S)throw new Error("No access token available");return O(L,F)}const _={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(L,_)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Rw(),Aw({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:L=!0}=S,F=await gr()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return L&&F.push(...ic()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:_,purchaseOption:x}=lp(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||nh(S,I.url))return!0}return!!O.some(_=>nh(_,I.url))})}async function l(S,O,L){const F=new URL(ot("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),L&&F.searchParams.set("selector",L),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 gr()?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(L=>L.id===S)}async function v(){return await o.url("/tags").get().json()}async function p(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 Wt(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 L of S)O[L.id]=L.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 qt(!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 j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await qt(!1);if(!O)throw new Error("No access token available");const L=new URL(`${ot("access-sync",t.environment)}/spotify/sesamy-callback`);L.searchParams.set("access_token",O),L.searchParams.set("state",S),window.location.href=L.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:L}=await ct(_g).post({url:S,ttl:O}).json();return L}async function q(S){const O=await qt(!1,!0);let L;const F=S.language||bn(),I=On();switch(S.target){case"account":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":L=new URL(`${ot("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?L.href+=`/${S.episodeId}`:L.href+="/listen",L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":L=cb(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(L.hash=`#access_token=${O}`),S.shorten?te(L.href,S.ttl):L.href}async function M(){const S=await qt(!1),O=new URL(`${ot("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=On(),L=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,_]=F.trim().split("=");L.includes(I)&&!O[I]&&(O[I]=_)}),n.checkouts.create({language:bn(),...S,attribution:{...O,...S.attribution},vendorId:t.vendorId})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,generateLink:q,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:v,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:j,updateProfile:R,vendor:n.vendor}}const vb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function pb(){return new Promise(t=>{const e=vb.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function mb(){const t=navigator.userAgent.toLowerCase(),e=[{name:"Facebook",regex:/fbav|fban/i},{name:"LinkedIn",regex:/linkedin/i},{name:"Instagram",regex:/instagram/i},{name:"Gmail",regex:/gmail/i},{name:"Twitter",regex:/twitter/i},{name:"WeChat",regex:/micromessenger/i},{name:"Line",regex:/line/i},{name:"Snapchat",regex:/snapchat/i},{name:"Pinterest",regex:/pinterest/i},{name:"Kakao",regex:/kakaotalk/i},{name:"Skype",regex:/skype/i},{name:"WhatsApp",regex:/whatsapp/i}];for(const r of e)if(r.regex.test(t))return{isInAppBrowser:!0,browserName:r.name};return/; wv\)/.test(t)?{isInAppBrowser:!0,browserName:"Unknown In-App Browser"}:{isInAppBrowser:!1,browserName:null}}const hp="sesamyFlags";async function vp(t){try{localStorage.setItem(hp,JSON.stringify(t))}catch{le("Failed to save flags to localStorage")}}async function gb(t,e){const r=await Qn();r[t]=e,await vp(r)}async function yb(t){return(await Qn())[t]}async function wb(t){const e=await Qn();t in e&&(delete e[t],await vp(e))}async function Qn(){try{const t=localStorage.getItem(hp);return t?JSON.parse(t):{}}catch{return{}}}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:v,getTally:p,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:j,pushTally:z,requestDelivery:V,setTag:te,transactions:q,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=hb(t),L={analytics:{track:rp},attribution:{get:On,set:dp},auth:{getUser:f,getTokenSilently:qt,isAuthenticated:gr,loginWithRedirect:Xn,loginWithPopup:op,login:Iw,logout:nc,setToken:Ss},bills:r,browser:{detectAdblock:pb,isInAppBrowser:mb,isIncognito:Gs},checkouts:n,clearCache:pt,content:{list:rw,get:Zn,getLanguage:bn,hasAccess:nw,unlock:aw,getPropertyFromHTML:Yv},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:ic},events:{emit:np,cancel:dw},flags:{get:yb,set:gb,list:Qn,delete:wb},fulfillments:{list:c,requestDelivery:V},generateLink:u,getVersion:Sb,isReady:()=>exports.isInitialized,log:le,paywalls:R,paymentIssues:A,products:{...j,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:v,set:te},tallies:{delete:o,get:p,list:g,push:z},transactions:{...q,get:P},userMetadata:S,vendor:O,setToken:Ss};return t.namespace&&(window[t.namespace]=L),L}function Sb(){return Jn}function Ib(t,e){t.style.position="relative",t.style.height="200px",t.style.overflow="hidden";let n=0;const a=Array.from(t.children);for(const o of a){const s=o.offsetHeight;n+s>200?o.remove():n+=s}const i=document.createElement("style");i.innerHTML=`
|
|
34
|
+
**/var ds={d:(t,e)=>{for(var r in e)ds.o(e,r)&&!ds.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Hs={};ds.d(Hs,{A:()=>Ug,k:()=>Bs});var jr=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 Bs(){return jr(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(v){h=v.message.length}return h}function s(){return jr(this,void 0,void 0,function(){var h,d;return Nr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),i(!1),[3,3];case 2:return h=v.sent(),d=h instanceof Error&&typeof h.message=="string"?h.message:String(h),i(d.includes("unknown transient reason")),[3,3];case 3:return[2]}})})}function u(){var h;return jr(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 v=String(Math.random());try{var p=indexedDB.open(v,1);p.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(v)}},p.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var v=window.openDatabase,p=window.localStorage;try{v(null,null,null,null)}catch{return void i(!0)}try{p.setItem("test","1"),p.removeItem("test")}catch{return void i(!0)}i(!1)})(),d.label=3;case 3:return[2]}})})}function l(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(h,d){var v=Math.round(d/1048576),p=2*Math.round((function(){var g,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(v<p)},function(h){r(new Error("detectIncognito somehow failed to query storage quota: "+h.message))})}function c(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?l():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function f(){var h;return jr(this,void 0,Promise,function(){var d,v,p;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(),v=d instanceof Error&&typeof d.message=="string"?d.message:String(d),i(v.includes("Security error")),[2];case 4:return[3,6];case 5:(p=indexedDB.open("inPrivate")).onerror=function(P){p.error&&p.error.name==="InvalidStateError"&&P.preventDefault(),i(!0)},p.onsuccess=function(){indexedDB.deleteDatabase("inPrivate"),i(!1)},g.label=6;case 6:return[2]}})})}(function(){return jr(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=Bs);const Ug=Bs;Hs.A;const $g=Hs.k,gn="sesamy_incognito_mode";function Gs(){try{const t=sessionStorage.getItem(gn);return t===null?void 0:t==="true"}catch{return}}async function Lg(){try{const t=sessionStorage.getItem(gn);if(t!==null)return t==="true";const{isPrivate:e}=await $g();return sessionStorage.setItem(gn,e.toString()),e}catch{try{sessionStorage.setItem(gn,"false")}catch{}return!1}}function Jr(){return typeof window<"u"}function yd(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 qg="function",jg="string",tt="undefined",Ng="boolean",Pn="object",xg="array",Dg="number",Mg="symbol",Fg="null",hs=function(){},Pv="any",Ev="*",Vt="__",Kg="form",zg="input",Hg="button",Bg="select",En=typeof process!==tt?process:{};En.env&&En.env.NODE_ENV;var Ce=typeof document!==tt;En.versions!=null&&En.versions.node!=null;typeof Deno!==tt&&Deno.core;Ce&&window.name==="nodejs"||typeof navigator!==tt&&typeof navigator.userAgent!==tt&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom"));function kv(t,e){return e.charAt(0)[t]()+e.slice(1)}var Gg=kv.bind(null,"toUpperCase"),Wg=kv.bind(null,"toLowerCase");function Vg(t){return _v(t)?Gg(Fg):typeof t===Pn?Xg(t):Object.prototype.toString.call(t).slice(8,-1)}function kn(t,e){e===void 0&&(e=!0);var r=Vg(t);return e?Wg(r):r}function an(t,e){return typeof e===t}var ze=an.bind(null,qg),_t=an.bind(null,jg),fr=an.bind(null,tt),Jg=an.bind(null,Ng);an.bind(null,Mg);function _v(t){return t===null}function Zg(t){return kn(t)===Dg&&!isNaN(t)}function Tv(t){return kn(t)===xg}function Ke(t){if(!Yg(t))return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Yg(t){return t&&(typeof t===Pn||t!==null)}function Xg(t){return ze(t.constructor)?t.constructor.name:null}function Qg(t){return t instanceof Error||_t(t.message)&&t.constructor&&Zg(t.constructor.stackTraceLimit)}function Rv(t,e){if(typeof e!="object"||_v(e))return!1;if(e instanceof t)return!0;var r=kn(new t(""));if(Qg(e))for(;e;){if(kn(e)===r)return!0;e=Object.getPrototypeOf(e)}return!1}Rv.bind(null,TypeError);Rv.bind(null,SyntaxError);function Gn(t,e){var r=t instanceof Element||t instanceof HTMLDocument;return r&&e?ey(t,e):r}function ey(t,e){return e===void 0&&(e=""),t&&t.nodeName===e.toUpperCase()}function Wn(t){var e=[].slice.call(arguments,1);return function(){return t.apply(void 0,[].slice.call(arguments).concat(e))}}Wn(Gn,Kg);Wn(Gn,Hg);Wn(Gn,zg);Wn(Gn,Bg);function ty(t){return t?Tv(t)?t:[t]:[]}function wd(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return null}}function ry(){if(Ce){var t=navigator,e=t.languages;return t.userLanguage||(e&&e.length?e[0]:t.language)}}function ny(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}}function ay(t){return(function(e){for(var r,n=Object.create(null),a=/([^&=]+)=?([^&]*)/g;r=a.exec(e);){var i=wd(r[1]),o=wd(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&&(iy(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 iy(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 Vn(){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 oy(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 Ft="global",yr=Vt+Ft+Vt,wr=typeof self===Pn&&self.self===self&&self||typeof global===Pn&&global[Ft]===global&&global||void 0;function Jt(t){return wr[yr][t]}function Zt(t,e){return wr[yr][t]=e}function Or(t){delete wr[yr][t]}function Cr(t,e,r){var n;try{if(Ws(t)){var a=window[t];n=a[e].bind(a)}}catch{}return n||r}wr[yr]||(wr[yr]={});var un={};function Ws(t){if(typeof un[t]!==tt)return un[t];try{var e=window[t];e.setItem(tt,tt),e.removeItem(tt)}catch{return un[t]=!1}return un[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 Et="function",vt="undefined",Gr="reducer",Ov="@@redux/",vs=Ov+"INIT",sy=Ov+Math.random().toString(36),bd=(function(){return typeof Symbol===Et&&Symbol.observable||"@@observable"})(),ln=" != "+Et;function Cv(t,e,r){var n;if(typeof e===Et&&typeof r===vt&&(r=e,e=void 0),typeof r!==vt){if(typeof r!==Et)throw new Error("enhancer"+ln);return r(Cv)(t,e)}if(typeof t!==Et)throw new Error(Gr+ln);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!==Et)throw new Error("Listener"+ln);var v=!0;return l(),s.push(d),function(){if(v){v=!1,l();var p=s.indexOf(d);s.splice(p,1)}}}function h(d){if(!Ke(d))throw new Error("Act != obj");if(typeof d.type===vt)throw new Error("ActType "+vt);if(u)throw new Error("Dispatch in "+Gr);try{u=!0,i=a(i,d)}finally{u=!1}for(var v=o=s,p=0;p<v.length;p++)(0,v[p])();return d}return h({type:vs}),(n={dispatch:h,subscribe:f,getState:c,replaceReducer:function(d){if(typeof d!==Et)throw new Error("next "+Gr+ln);a=d,h({type:vs})}})[bd]=function(){var d,v=f;return(d={subscribe:function(p){if(typeof p!="object")throw new TypeError("Observer != obj");function g(){p.next&&p.next(c())}return g(),{unsubscribe:v(g)}}})[bd]=function(){return this},d},n}function cy(t,e){var r=e&&e.type;return"action "+(r&&r.toString()||"?")+Gr+" "+t+" returns "+vt}function br(){var t=[].slice.call(arguments);return t.length===0?function(e){return e}:t.length===1?t[0]:t.reduce(function(e,r){return function(){return e(r.apply(void 0,[].slice.call(arguments)))}})}function uy(){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=br.apply(void 0,i)(o.dispatch)})}}}var Tt=Vt+"anon_id",Kt=Vt+"user_id",hr=Vt+"user_traits",ps="analytics",Pt="userId",dr="anonymousId",yn=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ms=["name","EVENTS","config","loaded"],Q=yn.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:"+t},pluginReadyType:function(t){return"ready:"+t}}),Sd=/^utm_/,Id=/^an_prop_/,Pd=/^an_trait_/;function ly(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(Tt,o.anonymousId),l||e(Kt,o.userId),u.traits&&e(hr,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(v,p){if(p.match(Sd)||p.match(/^(d|g)clid/)){var g=p.replace(Sd,"");v.campaign[g==="campaign"?"name":g]=i[p]}return p.match(Id)&&(v.props[p.replace(Id,"")]=i[p]),p.match(Pd)&&(v.traits[p.replace(Pd,"")]=i[p]),v},{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 fy(t){return function(e,r){if(e===void 0&&(e={}),r===void 0&&(r={}),r.type===Q.setItemEnd){if(r.key===Tt)return ee({},e,{anonymousId:r.value});if(r.key===Kt)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[Kt,Tt,hr].forEach(function(n){t.removeItem(n)}),Object.assign({},e,{userId:null,anonymousId:null,traits:{}});default:return e}}}function Ed(t){return{userId:t.getItem(Kt),anonymousId:t.getItem(Tt),traits:t.getItem(hr)}}var gs=function(t){return Vt+"TEMP"+Vt+t};function dy(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&&([Kt,hr,Tt].forEach(function(d){n(d)}),[Pt,dr,"traits"].forEach(function(d){Or(gs(d))})),s.type===Q.identify){a(Tt)||r(Tt,Vn());var f=a(Kt),h=a(hr)||{};f&&f!==u&&i.dispatch({type:Q.userIdChanged,old:{userId:f,traits:h},new:{userId:u,traits:l},options:c}),u&&r(Kt,u),l&&r(hr,ee({},h,l))}return o(s)}}}}var Fr={};function kd(t,e){Fr[t]&&ze(Fr[t])&&(Fr[t](e),delete Fr[t])}function Av(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 Av(t,e,r-10).then(n,a)})})}function hy(t){return{abort:t}}function Uv(t,e,r){var n={},a=e(),i=t.getState(),o=i.plugins,s=i.queue,u=i.user;if(!i.context.offline&&s&&s.actions&&s.actions.length){var l=s.actions.reduce(function(f,h,d){return o[h.plugin].loaded?(f.process.push(h),f.processIndex.push(d)):(f.requeue.push(h),f.requeueIndex.push(d)),f},{processIndex:[],process:[],requeue:[],requeueIndex:[]});if(l.processIndex&&l.processIndex.length){l.processIndex.forEach(function(f){var h=s.actions[f],d=h.plugin,v=h.payload.type,p=a[d][v];if(p&&ze(p)){var g,P=(function(m,b){return m===void 0&&(m={}),b===void 0&&(b={}),[Pt,dr].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=p({payload:P,config:o[d].config,instance:r,abort:hy}))&&Ke(g)&&g.abort)return void(n[P.meta.rid]=!0);if(!w){var y=v+":"+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 Vo=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(vr),d=e.exact.map(function(g){return g.pluginName});h&&(d=o.during.map(function(g){return g.pluginName}));var v=(function(g,P){return function(w,y,m){var b=y.config,R=y.name,A=R+"."+w.type;m&&(A=m.event);var j=w.type.match(vr)?(function(z,V,te,q,M){return function(N,S){var O=q?q.name:z,L=S&&Zr(S)?S:te;if(q&&(!(L=S&&Zr(S)?S:[z]).includes(z)||L.length!==1))throw new Error("Method "+V+" can only abort "+z+" plugin. "+JSON.stringify(L)+" input valid");return ee({},M,{abort:{reason:N,plugins:L,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:vy(w),instance:g,config:b||{},abort:j}}})(n,d),p=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,j,z){return Promise.resolve(A).then(function(V){return j.method&&ze(j.method)?((function(N,S){var O=Ud(N);if(O&&O.name===S){var L=Ud(O.method);throw new Error([S+" plugin is calling method "+N,"Plugins cant call self","Use "+O.method+" "+(L?"or "+L.method:"")+" in "+S+" plugin insteadof "+N].join(`
|
|
35
|
+
`))}})(j.methodName,j.pluginName),Promise.resolve(j.method({payload:V,instance:n,abort:(te=V,q=y,M=j.pluginName,function(N,S){return ee({},te,{abort:{reason:N,plugins:S||[q],caller:f,from:M||q}})}),config:Rd(j.pluginName,l,i),plugins:l})).then(function(N){var S=Ke(N)?N:{};return Promise.resolve(ee({},V,S))})):V;var te,q,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 j=g[b]?g[b]:{};if(h&&(j=A),Zo(j,b))return Jo({data:j,method:f,instance:n,pluginName:b,store:s}),Promise.resolve(A);if(Zo(A,b))return m&&Jo({data:A,method:f,instance:n,store:s}),Promise.resolve(A);if(p.hasOwnProperty(b)&&p[b]===!0)return s.dispatch({type:"queue",plugin:b,payload:j,_:{called:"queue",from:"queueMechanism"}}),Promise.resolve(A);var z=v(g[b],i[b]);return Promise.resolve(R[f]({abort:z.abort,payload:j,instance:n,config:Rd(b,l,i),plugins:l})).then(function(V){var te=Ke(V)?V:{},q=ee({},A,te),M=g[b];if(Zo(M,b))Jo({data:M,method:f,instance:n,pluginName:b,store:s});else{var N=f+":"+b;(N.match(/:/g)||[]).length<2&&!f.match(_d)&&!f.match(Td)&&n.dispatch(ee({},h?q:j,{type:N,_:{called:N,from:"submethod"}}))}return Promise.resolve(q)})})}catch(A){return Promise.reject(A)}},Promise.resolve(r))).then(function(P){if(!(f.match(vr)||f.match(/^registerPlugin/)||f.match(Td)||f.match(_d)||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"}});$v(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)}},vr=/Start$/,_d=/^bootstrap/,Td=/^ready/;function Jo(t){var e=t.pluginName,r=t.method+"Aborted"+(e?":"+e:"");t.store.dispatch(ee({},t.data,{type:r,_:{called:r,from:"abort"}}))}function Rd(t,e,r){var n=e[t]||r[t];return n&&n.config?n.config:{}}function Od(t,e){return e.reduce(function(r,n){return n[t]?r.concat({methodName:t,pluginName:n.name,method:n[t]}):r},[])}function Cd(t,e){var r=t.replace(vr,""),n=e?":"+e:"";return[""+t+n,""+r+n,r+"End"+n]}function Zo(t,e){var r=t.abort;return!!r&&(r===!0||Ad(r,e)||r&&Ad(r.plugins,e))}function $v(t,e){var r=t.abort;if(!r)return!1;if(r===!0||_t(r))return!0;var n=r.plugins;return Zr(r)&&r.length===e||Zr(n)&&n.length===e}function Zr(t){return Array.isArray(t)}function Ad(t,e){return!(!t||!Zr(t))&&t.includes(e)}function Ud(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function vy(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 py(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 kd(o.meta.rid,{payload:o})},0),l===Q.initializeEnd){var h=e(),d=Object.keys(h),v=d.filter(function(m){return c.includes(m)}).map(function(m){return h[m]}),p=[],g=[],P=o.disabled,w=v.map(function(m){var b=m.loaded,R=m.name,A=m.config;return Av(m,function(){return b({config:A})},1e4).then(function(j){return n[R]||(a.dispatch({type:Q.pluginReadyType(R),name:R,events:Object.keys(m).filter(function(z){return!ms.includes(z)})}),n[R]=!0),p=p.concat(R),m}).catch(function(j){if(j instanceof Error)throw new Error(j);return g=g.concat(j.name),j})});Promise.all(w).then(function(m){var b={plugins:p,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 Uv(a,e,t)},0),Promise.resolve((function(m,b,R,A,j){try{var z=ze(b)?b():b,V=m.type,te=V.replace(vr,"");if(m._&&m._.called)return Promise.resolve(m);var q=R.getState(),M=(O=z,(L=q.plugins)===void 0&&(L={}),(F=m.options)===void 0&&(F={}),Object.keys(O).filter(function(I){var _=F.plugins||{};return Jg(_[I])?_[I]:_.all!==!1&&(!L[I]||L[I].enabled!==!1)}).map(function(I){return O[I]}));V===Q.initializeStart&&m.fromEnable&&(M=Object.keys(q.plugins).filter(function(I){var _=q.plugins[I];return m.plugins.includes(I)&&!_.initialized}).map(function(I){return z[I]}));var N=M.map(function(I){return I.name}),S=(function(I,_){var x=Cd(I).map(function(H){return Od(H,_)});return _.reduce(function(H,Y){var J=Y.name,fe=Cd(I,J).map(function(ke){return Od(ke,_)}),ne=fe[0],ce=fe[1],ae=fe[2];return ne.length&&(H.beforeNS[J]=ne),ce.length&&(H.duringNS[J]=ce),ae.length&&(H.afterNS[J]=ae),H},{before:x[0],beforeNS:{},during:x[1],duringNS:{},after:x[2],afterNS:{}})})(V,M);return Promise.resolve(Vo({action:m,data:{exact:S.before,namespaced:S.beforeNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(I){function _(){var Y=(function(){if(V.match(vr))return Promise.resolve(Vo({action:ee({},x,{type:te+"End"}),data:{exact:S.after,namespaced:S.afterNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(J){J.meta&&J.meta.hasCallback&&kd(J.meta.rid,{payload:J})})})();return Y&&Y.then?Y.then(function(){return I}):I}if($v(I,N.length))return I;var x,H=(function(){if(V!==te)return Promise.resolve(Vo({action:ee({},I,{type:te}),data:{exact:S.during,namespaced:S.duringNS},state:q,allPlugins:z,allMatches:S,instance:R,store:A,EVENTS:j})).then(function(Y){x=Y});x=I})();return H&&H.then?H.then(_):_()})}catch(I){return Promise.reject(I)}var O,L,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 my(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 gy=function(){var t=this;this.before=[],this.after=[],this.addMiddleware=function(e,r){t[r]=t[r].concat(e)},this.removeMiddleware=function(e,r){var n=t[r].findIndex(function(a){return a===e});n!==-1&&(t[r]=[].concat(t[r].slice(0,n),t[r].slice(n+1)))},this.dynamicMiddlewares=function(e){return function(r){return function(n){return function(a){var i={getState:r.getState,dispatch:function(s){return r.dispatch(s)}},o=t[e].map(function(s){return s(i)});return br.apply(void 0,o)(n)(a)}}}}};function yy(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=$d(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=$d(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,Ld(r.plugins,!1,e));case Q.enablePlugin:return ee({},e,Ld(r.plugins,!0,e));default:return e}}}function $d(t,e){return t.substring(e.length+1,t.length)}function Ld(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 wy={last:{},history:[]};function by(t,e){t===void 0&&(t=wy);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 Sy={actions:[]};function Iy(t,e){t===void 0&&(t=Sy);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 qv=/#.*$/;function Py(t){var e=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(t);return"/"+(e&&e[3]?e[3].split("?")[0].replace(qv,""):"")}var jv,Nv,xv,Dv,Ey=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 v,p=document.getElementsByTagName("link"),g=0;v=p[g];g++)if(v.getAttribute("rel")==="canonical")return v.getAttribute("href")}})();return d?d.match(/\?/)?d:d+h:window.location.href.replace(qv,"")})(l),f={title:r,url:c,path:Py(c),hash:u,search:l,width:o,height:s};return n&&n!==""&&(f.referrer=n),ee({},f,t)},ky={last:{},history:[]};function _y(t,e){t===void 0&&(t=ky);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}jv=(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"})(),Nv=Ce?document.referrer:null,xv=ry(),Dv=ny();var qd={initialized:!1,sessionId:Vn(),app:null,version:null,debug:!1,offline:!!Ce&&!navigator.onLine,os:{name:jv},userAgent:Ce?navigator.userAgent:"node",library:{name:ps,version:"0.13.1"},timezone:Dv,locale:xv,campaign:{},referrer:Nv};function Ty(t,e){t===void 0&&(t=qd);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({},qd,t,{initialized:!0})}}var Ry=["plugins","reducers","storage"];function Oy(t,e,r){if(Ce){var n=window[(r?"add":"remove")+"EventListener"];t.split(" ").forEach(function(a){n(a,e)})}}function Cy(t){var e=Oy.bind(null,"online offline",function(r){return Promise.resolve(!navigator.onLine).then(t)});return e(!0),function(r){return e(!1)}}function Mv(){return Zt(ps,[]),function(t){return function(e,r,n){var a=t(e,r,n),i=a.dispatch;return Object.assign(a,{dispatch:function(o){return wr[yr][ps].push(o.action||o),i(o)}})}}}function jd(t){return function(){return br(br.apply(null,arguments),Mv())}}function Yo(t){return t?Tv(t)?t:[t]:[]}function Nd(t,e,r){t===void 0&&(t={});var n,a,i=Vn();return e&&(Fr[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 Ay(t){t===void 0&&(t={});var e=t.reducers||{},r=t.initialUser||{},n=(t.plugins||[]).reduce(function(I,_){if(ze(_))return I.middlewares=I.middlewares.concat(_),I;if(_.NAMESPACE&&(_.name=_.NAMESPACE),!_.name)throw new Error("https://lytics.dev/errors/1");_.config||(_.config={});var x=_.EVENTS?Object.keys(_.EVENTS).map(function(J){return _.EVENTS[J]}):[];I.pluginEnabled[_.name]=!(_.enabled===!1||_.config.enabled===!1),delete _.enabled,_.methods&&(I.methods[_.name]=Object.keys(_.methods).reduce(function(J,fe){var ne;return J[fe]=(ne=_.methods[fe],function(){for(var ce=Array.prototype.slice.call(arguments),ae=new Array(ne.length),ke=0;ke<ce.length;ke++)ae[ke]=ce[ke];return ae[ae.length]=b,ne.apply({instance:b},ae)}),J},{}),delete _.methods);var H=Object.keys(_).concat(x),Y=new Set(I.events.concat(H));if(I.events=Array.from(Y),I.pluginsArray=I.pluginsArray.concat(_),I.plugins[_.name])throw new Error(_.name+"AlreadyLoaded");return I.plugins[_.name]=_,I.plugins[_.name].loaded||(I.plugins[_.name].loaded=function(){return!0}),I},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),a=t.storage?t.storage:{getItem:Jt,setItem:Zt,removeItem:Or},i=(function(I){return function(_,x,H){return x.getState("user")[_]||(H&&Ke(H)&&H[_]?H[_]:Ed(I)[_]||Jt(gs(_))||null)}})(a),o=n.plugins,s=n.events.filter(function(I){return!ms.includes(I)}).sort(),u=new Set(s.concat(yn).filter(function(I){return!ms.includes(I)})),l=Array.from(u).sort(),c=function(){return o},f=new gy,h=f.addMiddleware,d=f.removeMiddleware,v=f.dynamicMiddlewares,p=function(){throw new Error("Abort disabled inListener")},g=ay(),P=Ed(a),w=ee({},P,r,g.an_uid?{userId:g.an_uid}:{},g.an_aid?{anonymousId:g.an_aid}:{});w.anonymousId||(w.anonymousId=Vn());var y=ee({enable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.enablePlugin,plugins:Yo(I),_:{originalAction:Q.enablePlugin}},x,[_])})},disable:function(I,_){return new Promise(function(x){S.dispatch({type:Q.disablePlugin,plugins:Yo(I),_:{originalAction:Q.disablePlugin}},x,[_])})}},n.methods),m=!1,b={identify:function(I,_,x,H){try{var Y=_t(I)?I:null,J=Ke(I)?I:_,fe=x||{},ne=b.user();Zt(gs(Pt),Y);var ce=Y||J.userId||i(Pt,b,J);return Promise.resolve(new Promise(function(ae){S.dispatch(ee({type:Q.identifyStart,userId:ce,traits:J||{},options:fe,anonymousId:ne.anonymousId},ne.id&&ne.id!==Y&&{previousId:ne.id}),ae,[_,x,H])}))}catch(ae){return Promise.reject(ae)}},track:function(I,_,x,H){try{var Y=Ke(I)?I.event:I;if(!Y||!_t(Y))throw new Error("EventMissing");var J=Ke(I)?I:_||{},fe=Ke(x)?x:{};return Promise.resolve(new Promise(function(ne){S.dispatch({type:Q.trackStart,event:Y,properties:J,options:fe,userId:i(Pt,b,_),anonymousId:i(dr,b,_)},ne,[_,x,H])}))}catch(ne){return Promise.reject(ne)}},page:function(I,_,x){try{var H=Ke(I)?I:{},Y=Ke(_)?_:{};return Promise.resolve(new Promise(function(J){S.dispatch({type:Q.pageStart,properties:Ey(H),options:Y,userId:i(Pt,b,H),anonymousId:i(dr,b,H)},J,[I,_,x])}))}catch(J){return Promise.reject(J)}},user:function(I){if(I===Pt||I==="id")return i(Pt,b);if(I===dr||I==="anonId")return i(dr,b);var _=b.getState("user");return I?yd(_,I):_},reset:function(I){return new Promise(function(_){S.dispatch({type:Q.resetStart},_,I)})},ready:function(I){return m&&I({plugins:y,instance:b}),b.on(Q.ready,function(_){I&&I(_),m=!0})},on:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".on disabled for "+I);var x=/Start$|Start:/;if(I==="*"){var H=function(ne){return function(ce){return function(ae){return ae.type.match(x)&&_({payload:ae,instance:b,plugins:o}),ce(ae)}}},Y=function(ne){return function(ce){return function(ae){return ae.type.match(x)||_({payload:ae,instance:b,plugins:o}),ce(ae)}}};return h(H,fn),h(Y,dn),function(){d(H,fn),d(Y,dn)}}var J=I.match(x)?fn:dn,fe=function(ne){return function(ce){return function(ae){return ae.type===I&&_({payload:ae,instance:b,plugins:o,abort:p}),ce(ae)}}};return h(fe,J),function(){return d(fe,J)}},once:function(I,_){if(!I||!ze(_))return!1;if(I===Q.bootstrap)throw new Error(".once disabled for "+I);var x=b.on(I,function(H){_({payload:H.payload,instance:b,plugins:o,abort:p}),x()});return x},getState:function(I){var _=S.getState();return I?yd(_,I):Object.assign({},_)},dispatch:function(I){var _=_t(I)?{type:I}:I;if(yn.includes(_.type))throw new Error("reserved action "+_.type);var x=ee({},_,{_:ee({originalAction:_.type},I._||{})});S.dispatch(x)},enablePlugin:y.enable,disablePlugin:y.disable,plugins:y,storage:{getItem:a.getItem,setItem:function(I,_,x){S.dispatch({type:Q.setItemStart,key:I,value:_,options:x})},removeItem:function(I,_){S.dispatch({type:Q.removeItemStart,key:I,options:_})}},setAnonymousId:function(I,_){b.storage.setItem(Tt,I,_)},events:{core:yn,plugins:s}},R=n.middlewares.concat([function(I){return function(_){return function(x){return x.meta||(x.meta=Nd()),_(x)}}},v(fn),py(b,c,{all:l,plugins:s}),my(a),ly(b),dy(b),v(dn)]),A={context:Ty,user:fy(a),page:_y,track:by,plugins:yy(c),queue:Iy},j=br,z=br;if(Ce&&t.debug){var V=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;V&&(j=V({trace:!0,traceLimit:25})),z=function(){return arguments.length===0?Mv():Ke(typeof arguments[0])?jd():jd().apply(null,arguments)}}var te,q=(function(I){return Object.keys(I).reduce(function(_,x){return Ry.includes(x)||(_[x]=I[x]),_},{})})(t),M=n.pluginsArray.reduce(function(I,_){var x=_.name,H=_.config,Y=_.loaded,J=n.pluginEnabled[x];return I[x]={enabled:J,initialized:!!J&&!_.initialize,loaded:!!Y({config:H}),config:H},I},{}),N={context:q,user:w,plugins:M},S=Cv((function(I){for(var _=Object.keys(I),x={},H=0;H<_.length;H++){var Y=_[H];typeof I[Y]===Et&&(x[Y]=I[Y])}var J,fe=Object.keys(x);try{(function(ne){Object.keys(ne).forEach(function(ce){var ae=ne[ce];if(typeof ae(void 0,{type:vs})===vt||typeof ae(void 0,{type:sy})===vt)throw new Error(Gr+" "+ce+" "+vt)})})(x)}catch(ne){J=ne}return function(ne,ce){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,x[De])(Le,ce);if(typeof Qe===vt){var St=cy(De,ce);throw new Error(St)}ke[De]=Qe,ae=ae||Qe!==Le}return ae?ke:ne}})(ee({},A,e)),N,z(j(uy.apply(void 0,R))));S.dispatch=(te=S.dispatch,function(I,_,x){var H=ee({},I,{meta:Nd(I.meta,_,Yo(x))});return te.apply(null,[H])});var O=Object.keys(o);S.dispatch({type:Q.bootstrap,plugins:O,config:q,params:g,user:w,initialUser:r,persistedUser:P});var L=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,_){var x=I.bootstrap,H=I.config,Y=I.name;x&&ze(x)&&x({instance:b,config:H,payload:I}),S.dispatch({type:Q.registerPluginType(Y),name:Y,enabled:n.pluginEnabled[Y],plugin:I}),n.pluginsArray.length===_+1&&S.dispatch({type:Q.initializeStart,plugins:L,disabled:F})}),Cy(function(I){S.dispatch({type:I?Q.offline:Q.online})}),(function(I,_,x){setInterval(function(){return Uv(I,_,x)},3e3)})(S,c,b),b}var fn="before",dn="after",zt="cookie",xt=zv(),Fv=Jn,Uy=Jn;function Kv(t){return xt?Jn(t,"",-1):Or(t)}function zv(){if(xt!==void 0)return xt;var t=zt+zt;try{Jn(t,t),xt=document.cookie.indexOf(t)!==-1,Kv(t)}catch{xt=!1}return xt}function Jn(t,e,r,n,a,i){if(typeof window<"u"){var o=arguments.length>1;return xt===!1&&(o?Zt(t,e):Jt(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",$y=Ws.bind(null,mt);Cr(mt,"getItem",Jt);Cr(mt,"setItem",Zt);Cr(mt,"removeItem",Or);var gt="sessionStorage",Ly=Ws.bind(null,gt);Cr(gt,"getItem",Jt);Cr(gt,"setItem",Zt);Cr(gt,"removeItem",Or);function pr(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 qy=$y(),jy=Ly(),Ny=zv();function Ht(t,e){if(t){var r=Vs(e),n=!Xs(r),a=Js(r)?pr(localStorage.getItem(t)):void 0;if(n&&!fr(a))return a;var i=Zs(r)?pr(Fv(t)):void 0;if(n&&i)return i;var o=Ys(r)?pr(sessionStorage.getItem(t)):void 0;if(n&&o)return o;var s=Jt(t);return n?s:{localStorage:a,sessionStorage:o,cookie:i,global:s}}}function _n(t,e,r){if(t&&!fr(e)){var n={},a=Vs(r),i=JSON.stringify(e),o=!Xs(a);return Js(a)&&(n[mt]=hn(mt,e,pr(localStorage.getItem(t))),localStorage.setItem(t,i),o)?n[mt]:Zs(a)&&(n[zt]=hn(zt,e,pr(Fv(t))),Uy(t,i),o)?n[zt]:Ys(a)&&(n[gt]=hn(gt,e,pr(sessionStorage.getItem(t))),sessionStorage.setItem(t,i),o)?n[gt]:(n[Ft]=hn(Ft,e,Jt(t)),Zt(t,e),o?n[Ft]:n)}}function xy(t,e){if(t){var r=Vs(e),n=Ht(t,Ev),a={};return!fr(n.localStorage)&&Js(r)&&(localStorage.removeItem(t),a[mt]=n.localStorage),!fr(n.cookie)&&Zs(r)&&(Kv(t),a[zt]=n.cookie),!fr(n.sessionStorage)&&Ys(r)&&(sessionStorage.removeItem(t),a[gt]=n.sessionStorage),!fr(n.global)&&Zn(r,Ft)&&(Or(t),a[Ft]=n.global),a}}function Vs(t){return t?_t(t)?t:t.storage:Pv}function Js(t){return qy&&Zn(t,mt)}function Zs(t){return Ny&&Zn(t,zt)}function Ys(t){return jy&&Zn(t,gt)}function Xs(t){return t===Ev||t==="all"}function Zn(t,e){return t===Pv||t===e||Xs(t)}function hn(t,e,r){return{location:t,current:e,previous:r}}var Dy={setItem:_n,getItem:Ht,removeItem:xy};function My(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xd(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 Dd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xd(Object(r),!0).forEach(function(n){My(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xd(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fy(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e={storage:Dy};return Ay(Dd(Dd({},e),t))}const Qs="@sesamy/sesamy-js",Yn="1.64.0";function Ky(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=Hy(l);return a!==c&&(a=c,setTimeout(()=>t(l),0)),s.apply(r,u)}})}function zy(t,e){const r=t.indexOf(e);return r>-1?t.slice(0,r):t}function Hy(t){return["#","?"].forEach(e=>t=zy(t,e)),t}function By(){Ky(()=>{dt.page()})}var Xo="up",Qo="down";function Gy(t){if(t===void 0&&(t={}),!Ce)return hs;var e=Fd(),r=ys(),n=Md(),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 hs;var d=h.map(function(p){return Number(p)}),v=oy(function(){var p=Fd(),g=(function(q,M){return M.map(function(N){return N===100?q-5:q*(N/100)})})(p,d),P=ys(),w=Md(),y=vn(w,p),m=vn(P,p);if(c=y>c?y:c,f=m<f?m:f,!(o.length>=d.length)){var b=l===w,R=Xo;b?R="initial":l<=w&&(R=Qo);var A=g,j=d;(R===Xo||b)&&(A=g.slice().reverse(),j=d.slice().reverse());var z=j.reduce(function(q,M,N){var S=A[N];return u.includes(M)&&w<=S&&(u=u.filter(function(O){return O!==M}),q.singleFunction=M),R===Qo&&!o.includes(M)&&w>=S&&M>i?(s.push(M),q.callbacks=q.callbacks.concat(M),q):R===Xo&&!o.includes(M)&&w<=S&&M<=y?(q.foundFunc=[M],q):(b&&w>=S&&q.foundFunc.length===0&&(q.foundFunc=[M]),!s.includes(M)&&w>=S&&(s.push(M),q.singleFunction?u.push(M):q.singleFunction=M),q)},{foundFunc:[],singleFunction:null,callbacks:[],direction:R});if(l=w,R===Qo&&z.callbacks&&z.callbacks.forEach(function(q){ze(t[q])&&(t[q]({trigger:q,direction:R,scrollMin:f,scrollMax:c,range:[f,c]}),o.push(q))}),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",v),function(){return window.removeEventListener("scroll",v)}}function ys(){return Ce?document.body.scrollTop||document.documentElement.scrollTop:0}function Wy(){return Ce?window.innerHeight||document.documentElement.clientHeight:0}function Md(){return Math.round(ys()+Wy())}function Fd(){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 ec="Event",Kd=ec+"Listener";function Vy(t){return function(e,r,n,a){var i=n||hs,o=a||!1;if(!Ce)return i;var s=Tn(r),u=Tn(e,!0);if(!u.length)throw new Error("noElements");if(!s.length)throw new Error("no"+ec);var l=[];return(function c(f){f&&(l=[]);for(var h=f?"add"+Kd:"remove"+Kd,d=0;d<u.length;d++){var v=u[d];l[d]=f?o&&o.once?Jy(i):i:l[d]||i;for(var p=0;p<s.length;p++)v[h]?v["on"+s[p]]=f?l[d]:null:v[h](s[p],l[d],o)}return c.bind(null,!f)})(t)}}function Tn(t,e){if(_t(t))return e?Tn(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=ty(t);return e?i.map(function(o){return _t(o)?Tn(o,!0):o}).flat():i}function Jy(t,e){var r;return function(){return t&&(r=t.apply(this,arguments),t=null),r}}var es=Vy(ec);function Hv(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}Hv.bind(null,"onerror");Hv.bind(null,"onload");var Bv=typeof window>"u",zd="hidden";function Zy(t){if(Bv)return!1;var e=Yy(),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 Yy(){var t=["webkit","moz","ms","o"];return Bv||zd in document?zd:t.reduce(function(e,r){var n=r+"Hidden";return!e&&n in document?n:e},null)}var Xy=["mousemove","mousedown","touchmove","touchstart","touchend","keydown"];function Qy(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=Zy(function(s){s||r({type:"tabVisible"})});return n=[o].concat(Xy.map(function(s){return es(document,s,r)})).concat(es(window,"load",r)).concat(es(window,"scroll",r,{capture:!0,passive:!0})),i}function i(){n.map(function(o){return o()})}return a(),function(){return i(),a}}function ew(t){var e,r,n=t.onIdle,a=t.onWakeUp,i=t.onHeartbeat,o=t.timeout,s=o,u=t.throttle,l=u===void 0?2e3:u,c=!1,f=!1,h=new Date,d=function(){return clearTimeout(e)};function v(g){d(),i&&!c&&i(xr(h),g),a&&c&&(c=!1,a(xr(r),g),h=new Date),e=setTimeout(function(){c=!0,n&&(r=new Date,n(xr(h),g))},s)}var p=Qy(v,{throttle:l});return{disable:function(){f=!0,c=!1,d();var g=p();return function(){return f=!1,h=new Date,v({type:"load"}),g()}},getStatus:function(){return{isIdle:c,isDisabled:f,active:c?0:xr(h,f),idle:c?xr(r,f):0}}}}function xr(t,e){return e?0:Math.round((new Date-t)/1e3)}const Hd=5e3;class tw{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),ew({onIdle:r=>this.handleAwake(!1,r),onWakeUp:r=>this.handleAwake(!0,r),timeout:Hd}),Gy({25:this.handleScroll.bind(this),50:this.handleScroll.bind(this),75:this.handleScroll.bind(this),90:this.handleScroll.bind(this),100:this.handleScroll.bind(this)})}flush(){this.isFlushing=!0,this.handleAwake(!this.isAwake)}handleInViewPort(e){e?(this.isAwake=!0,this.trackInViewport()):this.handleAwake(!1),this.isInViewport=e}handleAwake(e,r=Math.round((Date.now()-this.lastEventAt)/1e3)){this.isAwake=e,this.lastEventAt=e?Date.now()-r*Hd: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 Gv(t){document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}function rw(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 Bd="sesamy_session_id";function nw(){let t=sessionStorage.getItem(Bd);return t||(t=Math.random().toString(36).slice(2,9),sessionStorage.setItem(Bd,t)),t}function Wv(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 aw(t){return t?Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0)):{}}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"}},Vv=[],Jv=!1,Bt;function Zv(){const t=window.location.pathname;return Vv.find(e=>e.path?t.includes(e.path):!0)}function iw(t,e){Vv=t.content||[];const r=Zv();r&&r.type==="article"&&(Fe={...Fe,...aw(r.selectors)},Jv=r.enablePaywallSettingsUrlFallback||!1),Bt=e}function ow(t,e){const{selector:r}=e;return r===Fe.article.selector?t:t.querySelector(r)}function Yv(t,e){if(t)return e.attribute?e.attribute==="textContent"?t.textContent??void 0:t.getAttribute(e.attribute)??Yv(t.parentElement,e):t.textContent??void 0}function mr(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 tc({publisherContentId:t,key:e,defaultValue:r=""}){return(t?document.body.querySelector(`sesamy-content-data[id='${t}']`):null)?.getAttribute(e)||mr(`sesamy:${e}`)||mr(`og:${e}`)||mr(e)||r}function Xv(){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:Wv(e)},n=(i,o,s,u)=>{const l=ow(e,o);if(l){const c=Yv(l,o)||tc({publisherContentId:s,key:i});c!==void 0&&(r[i]=u?u(c):c)}};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,i=>parseFloat(i)),n("currency",Fe.currency,r.id),n("url",Fe.url,r.id),n("pass",Fe.pass,r.id),n("paywallUrl",Fe.paywallUrl,r.id),n("accessLevel",Fe.accessLevel,r.id,i=>i||"entitlement");const a=Zv();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)),Jv&&!r.paywallUrl){const i=document.querySelector("sesamy-paywall");if(i){const o=i.getAttribute("settings-url");o&&(r.paywallUrl=o)}}return r}async function sw(t){const e=on(t);if(!e)throw new Error("Could not find article element");if(e.paywallUrl){const a=(await Bt.paywalls.get(e.paywallUrl)).settings.template==="LOGIN"?"logged-in":"entitlement";if(e.accessLevel=a,a==="logged-in"){const i=await Bt.auth.isAuthenticated();return e.hasAccess=i,e}}if(!e.url)throw new Error("Article must have a URL");const r=await Bt.entitlements.hasAccess(e.url,e.pass?.split(",")||[]);return e.hasAccess=!!r,e.entitlement=r,e}async function Qv(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 Bt.entitlements.hasAccess(n.url||"",n.pass?.split(",")||[]);if(!a)throw new Error("User does not have access to the content");const i=await Bt.entitlements.access(a.id);if(!i.token)throw new Error("Could not get access token");const o=e||Wv(r.parentElement||r);return Bt.proxy.getContent(i.token,n.url,o)}let ep=!1,wn,Rn,ws;function tp(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:ws,requestId:Math.random().toString(36).slice(2,9),sessionId:nw(),timestamp:new Date().toISOString(),version:Yn,event:e.event,context:{...e.context,page:{url:window.location.href,title:document.title,referrer:document.referrer,itemSrc:mr("sesamy:item-src"),publisherContentId:mr("sesamy:publisher-content-id")},campaign:r,locale:navigator.language,library:Qs,userAgent:navigator.userAgent,clientId:ws}}}))}const rp=rw(async t=>{if(t.length>0){const e=tp(t);ep?navigator.sendBeacon(Rn,e):(await fetch(Rn,{method:"POST",body:e,headers:{"Content-Type":"text/plain"}})).ok}},{max:10,interval:3e3});function ts(t){if(t.anonymousId)if(t.properties?.flushing){const e={...t};delete e.properties.flushing,navigator.sendBeacon(Rn,tp([e]))}else rp.push(t)}function cw(){return ep=!0,rp.flush()}function uw(t,e,r){wn=e,Rn=`${ot("logs",r)}/events`,ws=t}const lw={name:"custom-analytics-plugin",page:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ts({anonymousId:r,userId:n,properties:e,event:a,type:"page"})},track:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n,event:a}=t;ts({anonymousId:r,userId:n,properties:e,event:a,type:"track"})},identify:({payload:t})=>{if(!wn)return;const{properties:e,anonymousId:r,userId:n}=t;ts({anonymousId:r,userId:n,properties:e,type:"identify"})}},Gd=["source","medium","campaign","term","content"],kt="utm_",fw=1800*1e3;function np(t){return t?Date.now()-parseInt(t,10)>fw:!0}function Wd(){const t=document.referrer||"";if(!t)return;const e=Ht(`${kt}set_at`);(np(e)||!Ht(`${kt}referrer`))&&_n(`${kt}referrer`,t)}function dw(){const t=()=>{const r={};for(const a of Gd){const i=Ht(`${kt}${a}`);i&&(r[`utm_${a}`]=i)}const n=Ht(`${kt}referrer`);return n&&(r.utm_referrer=n),r};return{name:"attribution-tracking",initialize(){Wd()},campaign({payload:r}){const n=r?.campaign||{},a=Ht(`${kt}set_at`);if(Object.keys(n).length>0&&np(a)){for(const o of Gd){const s=n[o];s&&_n(`${kt}${o}`,s)}_n(`${kt}set_at`,String(Date.now()))}Wd()},page({payload:r}){return r.properties.campaign=t(),r},track({payload:r}){return r.properties.campaign=t(),r},getStoredCampaignData:t}}const hw=dw(),Vd=new Map,Jd=new Map;function vw({clientId:t,enabled:e=!0,environment:r}){uw(t,e,r),e&&(window.addEventListener("beforeunload",()=>{Jd.forEach((n,a)=>{n.bind(a)()}),cw()}),window.addEventListener("visibilitychange",()=>{document.visibilityState!=="visible"&&Vd.forEach((n,a)=>{n.bind(a)()})}),By(),Gv(()=>{const n=new tw({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})}});Jd.set(document.body,()=>{n.flush()}),Vd.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=Fy({app:Qs,version:Yn,plugins:[hw,lw]});function ap(t,e){dt.track(t,e)}function ip(t,e,r=!1){const n={name:t,data:e},a=new CustomEvent(t,{detail:n,cancelable:r,bubbles:!0});ap(`event:${t}`,{...e,timestamp:new Date().toISOString()});const i=window.dispatchEvent(a);return r&&!i?{canceled:!0,message:n.cancellationMessage}:{canceled:!1}}function pw(t,e){t.cancelable&&(t.detail.cancellationMessage=e,t.preventDefault())}function mw(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gw(){return/android/i.test(navigator.userAgent)}let Oe,op,Wr,bs=!1,bn=!1;Jr()&&window.addEventListener("pageshow",()=>{bn=!1});const Sr="sesamyAccessToken",rs="sesamyRefreshToken",On="sesamySilentAuthThrottle",yw=300*1e3;async function Xn(){return bs?!0:new Promise((t,e)=>{const r=setTimeout(()=>{bs?t(!0):e(new Error("Initialization failed: Timeout"))},2e3);window.addEventListener(Be.AUTH_INITIALIZED,()=>{clearTimeout(r),t(!0)})})}async function ww(t){if(!t)return null;const e=localStorage.getItem(rs);if(!e)return le("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(rs),new Error("Renew token failed");const i=await a.json();return localStorage.setItem(rs,i.refresh_token),localStorage.setItem(Sr,i.access_token),i.access_token}catch{ac()}}async function rc(){const t=localStorage.getItem(Sr);if(!t)return null;const e=ic(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3){const r=await ww(e);if(r)return r;localStorage.removeItem(Sr)}return t}let pn=null;const bw=64;function Sw(){try{if(pn!==null)return pn;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===bw)return pn=!0,!0}}catch(t){le(`Error checking for existing auth0 tokens: ${t.message}`)}return pn=!1,!1}function Iw(t){if(t.domains&&t.domains.length>0){const e=Ir(window.location.href);if(e){for(const r of t.domains)if(Ir(`https://${r}`)===e)return le(`Found matching domain in domains array: ${r} for TLD: ${e}`),r;le(`No matching domain found in domains array for TLD: ${e}`)}}if(t.domain)return le(`Using fallback domain property: ${t.domain}`),t.domain}function Ir(t){try{const e=new URL(t).hostname,r=e.split(".");if(r.length<=1)return e;const n=["co.uk","com.au","co.nz","co.za","com.br","co.jp","gov.uk","ac.uk","org.uk","net.uk","com.sg","com.my","co.in","co.id","co.th","co.kr","com.mx","com.ar","com.co","com.pe","com.ph","com.pk","com.sa","com.eg","com.ng","co.ke","co.tz","co.zw","co.bw","co.mz","gov.au","edu.au","org.au","net.au","asn.au","id.au"];for(const a of n)if(e.endsWith(`.${a}`)){const i=a.split(".").length+1;return r.slice(-i).join(".")}return r.slice(-2).join(".")}catch{return null}}async function Pw(t){if(t.enabled===!1)return;op=t.organization;const e=Iw(t);Wr=e&&!Sw()?e:Iv("token",t.environment);const r={domain:Wr,clientId:t.clientId,useCookiesForTransactions:!0};r.cacheLocation="localstorage",Ir(window.location.href)!==Ir(`https://${Wr}`)&&(r.useRefreshTokens=!0),le(`Initializing auth0 client: ${JSON.stringify(r)}`),Oe=await Rg(r);const n=new URLSearchParams(window.location.search),a=n.get("code"),i=n.get("state");if(a)if(window.opener)le("Code found in URL, posting to opener"),window.opener.postMessage({type:"authorization_response",response:{code:a,state:i}},window.location.origin);else{le("Code found in URL, handling redirect");try{const u=await Oe.handleRedirectCallback();le(`Login result: ${JSON.stringify(u)}`);const l=await Oe.getUser();if(!l)throw le("No user found"),new Error("No user found");le(`User found ${JSON.stringify(l)}`),nc(),Wt(Be.AUTHENTICATED,l),le("Rewrite url")}catch(u){alert("There was an error logging in"),console.error(u)}const o=new URL(location.href),s=o.searchParams;s.delete("code"),s.delete("state"),o.search=s.toString(),window.history.replaceState({},document.title,o.toString())}bs=!0,Wt(Be.AUTH_INITIALIZED,{})}async function gr(){return await Xn(),await rc()?!0:Oe?Oe.isAuthenticated():!1}async function Ew(){return await Xn(),await rc()?(le("Using local user"),{sub:"local",name:"Local User"}):Oe?Oe.getUser():null}function sp(t){if(bn)return le("Login already in progress"),null;if(bn=!0,setTimeout(()=>{bn=!1},3e3),localStorage.removeItem(Sr),!Oe)throw new Error("Auth0 client not initialized");const e=t?.authorizationParams||{};return{...t,authorizationParams:{organization:op,redirect_uri:window.location.href,ui_locales:Br(),incognito:Gs(),...e}}}async function Qn(t){const e=sp(t);if(e)return Oe.loginWithRedirect(e)}async function cp(t){const e=sp(t);if(!e)return;await Oe.loginWithPopup(e,{timeoutInSeconds:1800}),nc(),ip(Be.AUTHENTICATED,await Oe.getUser()).canceled||window.location.reload()}async function kw(t){return Wr&&Ir(window.location.href)!==Ir(`https://${Wr}`)&&(mw()||gw()||Gs())?cp(t):Qn(t)}function _w(){try{const t=sessionStorage.getItem(On);if(!t)return!1;const{timestamp:e}=JSON.parse(t);return Date.now()-e<yw}catch{return sessionStorage.removeItem(On),!1}}function Tw(){try{const t={timestamp:Date.now()};sessionStorage.setItem(On,JSON.stringify(t))}catch{le("Failed to set silent auth throttle in sessionStorage")}}function nc(){try{sessionStorage.removeItem(On)}catch{}}async function qt(t=!0,e=!1){await Xn();const r=await rc();if(r)return r;if(!e&&_w()){if(le("Silent auth is throttled due to recent failures, skipping request"),t)throw new Error("Silent auth throttled");return null}try{if(!Oe)return le("Auth client not initialized"),null;let n=await Oe.getTokenSilently();const a=ic(n);return e&&a?.exp&&a.exp+3600<new Date().getTime()/1e3&&(n=await Oe.getTokenSilently({cacheMode:e?"off":"on"})),nc(),n}catch(n){const a=n;if(le(`Failed to get token silently: ${a.message}`),Tw(),await Oe.isAuthenticated()&&(a.message==="Invalid refresh token"||a.message.includes("Missing Refresh Token"))&&await ac(),t)throw n;return null}}async function ac(t={}){if(await Xn(),localStorage.removeItem(Sr),Wt(Be.LOGOUT,{}),!!Oe)return le(`Logout with options: ${JSON.stringify(t)}`),Oe.logout({...t,logoutParams:{returnTo:window.location.href,...t.logoutParams}})}function ic(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 Ss(t){const e=ic(t);if(!e||!e.exp||e.exp<new Date().getTime()/1e3)throw new Error("Invalid token");le("Set token"),localStorage.setItem(Sr,t),Wt(Be.AUTHENTICATED,e)}const Rw=(t,e)=>e.skipDedupe||e.method!=="GET",Ow=(t,e)=>e.method+"@"+t,Cw=t=>t.clone(),Aw=({skip:t=Rw,key:e=Ow,resolver:r=Cw}={})=>{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)}}},Uw=(t,e)=>t*e,$w=t=>t&&t.ok,Lw=({delayTimer:t=500,delayRamp:e=Uw,maxAttempts:r=10,until:n=$w,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,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(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})};class Vr 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,Vr)}isClientError(){return this.status>=400&&this.status<500}isServerError(){return this.status>=500}isForbiddenError(){return this.status===403}isNotFoundError(){return this.status===404}}var Cn=(t=>(t.BROWSER="browser",t.NORMAL="normal",t))(Cn||{});const qw="application/json",up="Content-Type",or=Symbol(),lp=Symbol();function Zd(t={}){var e;const r=t instanceof Array?Object.fromEntries(t):t;return(e=Object.entries(r).find(([n])=>n.toLowerCase()===up.toLowerCase()))===null||e===void 0?void 0:e[1]}function Yd(t){return/^application\/.*json.*/.test(t)}const Gt=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]=Gt(o,i,r):n[a]=i,n},{...t})},Pr={options:{},errorType:"text",polyfills:{},polyfill(t,e=!0,r=!1,...n){const a=this.polyfills[t]||(typeof self<"u"?self[t]:null)||(typeof global<"u"?global[t]:null);if(e&&!a)throw new Error(t+" is not defined");return r&&a?new a(...n):a}};function jw(t,e=!1){Pr.options=e?t:Gt(Pr.options,t)}function Nw(t,e=!1){Pr.polyfills=e?t:Gt(Pr.polyfills,t)}function xw(t){Pr.errorType=t}const Dw=t=>e=>t.reduceRight((r,n)=>n(r),e)||e;class fp extends Error{}const Mw=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=Gt(a.options,n);let f=r;const h=Dw(s)((y,m)=>(f=y,a.polyfill("fetch")(y,m)))(r,c),d=new Error,v=h.catch(y=>{throw{[or]:y}}).then(y=>{var m;if(!y.ok){const b=new fp;if(b.cause=d,b.stack=b.stack+`
|
|
36
|
+
CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw b;const 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}),p=y=>y.catch(m=>{const b=Object.prototype.hasOwnProperty.call(m,or),R=b?m[or]:m,A=R?.status&&l.get(R.status)||l.get(R?.name)||b&&l.has(or)&&l.get(or);if(A)return A(R,t);const j=l.get(lp);if(j)return j(R,t);throw R}),g=y=>m=>p(y?v.then(b=>b&&b[y]()).then(b=>m?m(b):b):v.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(or,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)},Fw={_url:"",_options:{},_config:Pr,_catchers:new Map,_resolvers:[],_deferred:[],_middlewares:[],_addons:[],addon(t){return{...this,_addons:[...this._addons,t],...t.wretch}},errorType(t){return{...this,_config:{...this._config,errorType:t}}},polyfills(t,e=!1){return{...this,_config:{...this._config,polyfills:e?t:Gt(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:Gt(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:Gt(this._options,{headers:e})}},accept(t){return this.headers({Accept:t})},content(t){return this.headers({[up]: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(lp,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=Zd(n._options.headers),i=this._config.polyfill("FormData",!1),o=typeof r=="object"&&!(i&&r instanceof i)&&(!n._options.headers||!a||Yd(a));return n=r?o?n.json(r,a):n.body(r):n,Mw(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=Zd(this._options.headers);return this.content(e||Yd(r)&&r||qw).body(JSON.stringify(t))}};function ct(t="",e={}){return{...Fw,_url:t,_options:e}}ct.default=ct;ct.options=jw;ct.errorType=xw;ct.polyfills=Nw;ct.WretchError=fp;const Kw=(t,e)=>e.skipDedupe||e.method!=="GET",zw=(t,e)=>e.method+"@"+t,Hw=t=>t.clone(),Bw=({skip:t=Kw,key:e=zw,resolver:r=Hw}={})=>{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)}}},Gw=(t,e)=>e.skipCache||e.method!=="GET",Ww=(t,e)=>e.method+"@"+t,Vw=()=>!1,Jw=()=>null,Zw=t=>t.ok,Yw=({throttle:t=1e3,skip:e=Gw,key:r=Ww,clear:n=Vw,invalidate:a=Jw,condition:i=Zw,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,v)=>{const p=r(d,v);let g=a(d,v);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,v)&&s.clear(),e(d,v))return h(d,v);if(l.has(p)){if(s.has(p)){const P=s.get(p).clone();return o&&Object.defineProperty(P,o,{value:p,enumerable:!1}),Promise.resolve(P)}else if(u.has(p))return new Promise((P,w)=>{u.get(p).push([P,w])})}return u.has(p)||u.set(p,[]),c(p),h(d,v).then(P=>(i(P.clone())&&s.set(p,P.clone()),u.get(p).forEach(([w])=>w(P.clone())),u.delete(p),P)).catch(P=>{throw u.get(p).forEach(([,w])=>w(P)),u.delete(p),P})};return f.cacheResponse=function(h,d){c(h),s.set(h,d)},f.cache=s,f.inflight=u,f.throttling=l,f},Xw=(t,e)=>t*e,Qw=t=>t&&t.ok,eb=({delayTimer:t=500,delayRamp:e=Xw,maxAttempts:r=10,until:n=Qw,onRetry:a=null,retryOnNetworkError:i=!1,resolveWithLatestResponse:o=!1,skip:s}={})=>u=>(l,c)=>{let f=0;if(s&&s(l,c))return u(l,c);const h=(d,v)=>Promise.resolve(n(d,v)).then(p=>p?d&&o?d:v?Promise.reject(v):d:(f++,!r||f<=r?new Promise(g=>{const P=e(t,f);setTimeout(()=>{typeof a=="function"?Promise.resolve(a({response:d,error:v,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(v||new Error("Number of attempts exceeded."))));return u(l,c).then(h).catch(d=>{if(!i)throw d;return h(null,d)})},tb="@sesamy/sdk",rb="1.17.0";class nb{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 Kr="sesamyCacheTimestamp",ab=t=>{const{libraryName:e=tb,libraryVersion:r=rb,cache:n}=t,a=n?.storage||new nb,i=[s=>async(u,l)=>{if(n?.mode===Cn.BROWSER){let c;typeof sessionStorage<"u"?(c=sessionStorage.getItem(Kr),c||(c=Date.now().toString(),sessionStorage.setItem(Kr,c))):(c=a.get(Kr),c||(c=Date.now().toString(),a.set(Kr,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)},Bw()];n?.mode===Cn.NORMAL&&i.push(Yw({throttle:300*1e3,skip:(s,u)=>u.method!=="GET"})),i.push(eb({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?JSON.parse(u.body):void 0);break;case"put":h=c.put(u.body?JSON.parse(u.body):void 0);break;case"patch":h=c.patch(u.body?JSON.parse(u.body):void 0);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 v=await d.text().catch(()=>"Unknown error");throw new Vr(d.status,d.statusText,d.url,`API Error ${d.status}: ${v}`,v)}return await d.json()}catch(l){if(l instanceof Vr)throw l;const c=l.status||500,f=l.message||"Unknown error",h=`${t.baseUrl}${s}`;throw new Vr(c,f,h,`API Error ${c}: ${l.message||"Unknown error"}`,l.message||"Unknown error")}}}},pt=()=>(typeof sessionStorage<"u"&&sessionStorage.removeItem(Kr),"Cache cleared"),Dr={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"})}},ns={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`)},Xd={list:async t=>t.request("/subscriptions"),get:async(t,e)=>t.request(`/subscriptions/${e}`)},Qd={get:async(t,e)=>t.request(`/products/${e}`),autoOnboard:async(t,e)=>t.request(`/products/${e}/auto-onboard`,{method:"POST"})},Mr={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"})},as={get:async t=>t.request("/user-metadata"),set:async(t,e,r)=>{await t.request(`/user-metadata/${e}`,{method:"PUT",body:JSON.stringify({value:r})})},delete:async(t,e)=>{await t.request(`/user-metadata/${e}`,{method:"DELETE"})}},sr={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)})},is={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"})}},cr={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(`meta-${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()}},os={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(`meta-${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)})},eh={list:async t=>t.request("/bills"),get:async(t,e)=>t.request(`/bills/${e}`)},th={list:async t=>t.request("/fulfillments"),create:async(t,e)=>t.request("/fulfillments",{method:"POST",body:JSON.stringify(e)})},ib={get:async(t,e)=>{try{return new URL(e),t.request(e)}catch{return t.request(`/paywalls/${e}`)}}},ob={list:async t=>t.request("/payment-issues")},sb={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)}},cb={list:async(t,e)=>{const r=(e?new URLSearchParams({q:e}):new URLSearchParams).toString(),n=r?`/transactions?${r}`:"/transactions";return t.request(n)}},rh={get:async t=>t.request("/vendor"),list:async t=>t.request("/vendors")},ub=t=>{const e=ab(t);return{profile:{get:r=>Dr.get(e,r),update:(r,n)=>Dr.update(e,r,n),checkSpotifyLink:()=>Dr.checkSpotifyLink(e),unlinkSpotify:()=>Dr.unlinkSpotify(e),delete:()=>Dr.delete(e)},entitlements:{list:r=>ns.list(e,r),get:r=>ns.get(e,r),getAccess:r=>ns.getAccess(e,r)},subscriptions:{list:()=>Xd.list(e),get:r=>Xd.get(e,r)},products:{get:r=>Qd.get(e,r),autoOnboard:r=>Qd.autoOnboard(e,r)},contracts:{list:()=>Mr.list(e),get:r=>Mr.get(e,r),cancel:r=>Mr.cancel(e,r),createAmendment:(r,n)=>Mr.createAmendment(e,r,n),confirmAmendment:(r,n)=>Mr.confirmAmendment(e,r,n)},userMetadata:{get:()=>as.get(e),set:(r,n)=>as.set(e,r,n),delete:r=>as.delete(e,r)},tallies:{list:()=>sr.list(e),get:r=>sr.get(e,r),update:(r,n)=>sr.update(e,r,n),create:r=>sr.create(e,r),delete:r=>sr.delete(e,r),push:(r,n)=>sr.push(e,r,n)},tags:{list:()=>is.list(e),add:r=>is.add(e,r),remove:r=>is.remove(e,r)},checkouts:{generateLink:(r,n)=>cr.generateCheckoutLink(r,n),create:r=>os.create(e,r),get:r=>os.get(e,r),update:(r,n)=>os.update(e,r,n)},links:{generateCheckoutLink:(r,n)=>cr.generateCheckoutLink(r,n),generateAccountLink:(r,n)=>cr.generateAccountLink(r,n),generateChangePaymentLink:(r,n)=>cr.generateChangePaymentLink(r,n),generateChangePlanLink:(r,n)=>cr.generateChangePlanLink(r,n),generateConsumeLink:(r,n)=>cr.generateConsumeLink(r,n)},bills:{list:()=>eh.list(e),get:r=>eh.get(e,r)},fulfillments:{list:()=>th.list(e),create:r=>th.create(e,r)},paywalls:{get:r=>ib.get(e,r)},paymentIssues:{list:()=>ob.list(e)},proxy:{content:(r,n,a,i)=>sb.content(e,r,n,a,i)},transactions:{list:r=>cb.list(e,r)},vendor:{get:()=>rh.get(e),list:()=>rh.list(e)}}};class lb{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 Is(t){let e;try{e=new URL(t)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function dp(t,e){if(Is(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 nh(t){return t.endsWith("/")?t.slice(0,-1):t}function ah(t,e){if(!Is(t)||!Is(e))return!1;const r=new URL(t),n=new URL(e);return r.origin===n.origin&&nh(r.pathname)===nh(n.pathname)}function fb(t,e,r){const n=new URL(`${ot("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=dp(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(`meta-${c}`,String(f))}),n}const hp="sesamySignedURLs";function oc(){const t=sessionStorage.getItem(hp);return t?JSON.parse(t):[]}function db(t){const e=oc();e.push(t),le(`Adding signed URL: ${t}`),sessionStorage.setItem(hp,JSON.stringify(e))}function hb(t){const e={};return Object.keys(t).forEach(r=>{const n=t[r];n!=null&&(e[r]=n.toString())}),e}const Ps="sesamyAttribution";function vb(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 pb(t){return Object.keys(t).find(e=>e.startsWith("utm_"))?{utmSource:void 0,utmMedium:void 0,utmCampaign:void 0,...t}:t}function An(){return vb(Ps)||{}}function vp(t){if(t===null)localStorage.removeItem(Ps);else{le(`Setting attribution ${JSON.stringify(t)}`);const e=An()??{},r=hb({...e,...pb(t)});localStorage.setItem(Ps,JSON.stringify({value:r}))}}const pp="sesamyFlags";async function mp(t){try{localStorage.setItem(pp,JSON.stringify(t))}catch{le("Failed to save flags to localStorage")}}async function gp(t,e){const r=await sn();r[t]=e,await mp(r)}async function yp(t){return(await sn())[t]}async function wp(t){const e=await sn();t in e&&(delete e[t],await mp(e))}async function sn(){try{const t=localStorage.getItem(pp);return t?JSON.parse(t):{}}catch{return{}}}function mb(t){const e=t.endpoint||ot("api2",t.environment),n=ub({baseUrl:e,tokenProvider:async()=>{if(await gr())try{const L=await qt(!1);if(L)return`Bearer ${L}`}catch{}const S=localStorage.getItem("__anon_id");return`Basic ${btoa(`${t.clientId}|${S}:`)}`},libraryName:Qs,libraryVersion:Yn,vendorId:t.vendorId,cache:{mode:Cn.BROWSER,storage:new lb}}),a=S=>async(O,L)=>{let F=sessionStorage.getItem(md);F||(F=Date.now().toString(),sessionStorage.setItem(md,F));const I={...L,headers:{...L.headers,"Cache-Timestamp":F}};return S(O,I)},i=(S=!0)=>O=>async(L,F)=>{let I=null;if(I=await qt(S),!I){if(S)throw new Error("No access token available");return O(L,F)}const _={...F,headers:{...F.headers,...I?{Authorization:`Bearer ${I}`}:{}}};return O(L,_)},o=ct(e).headers({"Content-Type":"application/json"}).middlewares([a,i(),Aw(),Lw({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:L=!0}=S,F=await gr()?await n.entitlements.list({waitForEntitlementAfter:O?.toISOString()}):[];return L&&F.push(...oc()),F}async function u(S,O=[]){return(await s())?.find(I=>{if(S){const{sku:_,purchaseOption:x}=dp(S);if("sku"in I&&_===I.sku||x&&"purchaseOptionsId"in I&&x===I.purchaseOptionsId||ah(S,I.url))return!0}return!!O.some(_=>ah(_,I.url))})}async function l(S,O,L){const F=new URL(ot("api2",t.environment));return F.pathname="/proxy",F.searchParams.set("url",O),L&&F.searchParams.set("selector",L),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 gr()?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(L=>L.id===S)}async function v(){return await o.url("/tags").get().json()}async function p(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 Wt(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 L of S)O[L.id]=L.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 qt(!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 j(){return(await o.url("/profile/unlink-spotify").post().res()).ok}async function z(S){const O=await qt(!1);if(!O)throw new Error("No access token available");const L=new URL(`${ot("access-sync",t.environment)}/spotify/sesamy-callback`);L.searchParams.set("access_token",O),L.searchParams.set("state",S),window.location.href=L.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:L}=await ct(Ag).post({url:S,ttl:O}).json();return L}async function q(S){const O=await qt(!1,!0);let L;const F=S.language||Br(),I=An();switch(S.target){case"account":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}${S.contractId?`/${encodeURIComponent(S.contractId)}`:""}`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-payment":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/change-payment-method`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"change-plan":L=new URL(`${ot("account",t.environment)}/${encodeURIComponent(S.language||F)}/subscriptions/${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.contractId)}/edit-plan`),L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"consume":L=new URL(`${ot("consume",t.environment)}/${encodeURIComponent(S.language||F)}/@${encodeURIComponent(t.clientId)}/${encodeURIComponent(S.sku)}`),S.episodeId?L.href+=`/${S.episodeId}`:L.href+="/listen",L.searchParams.set("sesamy-redirect-url",S.redirectUrl||window.location.href);break;case"checkout":L=fb(t,{language:F,...S},I);break;default:throw new Error("Invalid target")}return O&&(L.hash=`#access_token=${O}`),S.shorten?te(L.href,S.ttl):L.href}async function M(){const S=await qt(!1),O=new URL(`${ot("account",t.environment)}/subscriptions/${t.clientId}`);S&&(O.hash=`#access_token=${S}`),window.location.href=O.toString()}async function N(S){const O=An(),L=["_ga","_gid","_fbp","_fbc"];return document.cookie.split(";").forEach(F=>{const[I,_]=F.trim().split("=");L.includes(I)&&!O[I]&&(O[I]=_)}),n.checkouts.create({language:Br(),...S,attribution:{...O,...S.attribution},vendorId:t.vendorId})}return{autoOnboardProduct:V,bills:n.bills,checkouts:{create:N,get:n.checkouts.get,update:n.checkouts.update},content:{list:Xv,get:on,getLanguage:Br,unlock:Qv,getPropertyFromHTML:tc},contracts:n.contracts,deleteTag:p,deleteTally:y,entitlements:n.entitlements,flags:{get:yp,set:gp,list:sn,delete:wp},generateLink:q,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:v,getTransaction:d,transactions:n.transactions,userMetadata:n.userMetadata,pushTally:m,setTag:g,unlinkSpotify:j,updateProfile:R,vendor:n.vendor}}const gb=["AdHeader","AdContainer","AD_Top","homead","ad-lead"];function yb(){return new Promise(t=>{const e=gb.map(r=>{const n=document.createElement("div");return n.innerHTML=" ",n.id=r,n.style.position="absolute",document.body.appendChild(n),n});window.setTimeout(()=>{const r=!e.every(n=>document.querySelector(`#${n.id}`)?.offsetParent);e.forEach(n=>n.remove()),t(r)},100)})}function wb(){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 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:v,getTally:p,getTallies:g,getTransaction:P,hasAccess:w,isSpotifyLinked:y,linkSpotify:m,openHostedAccountPage:b,paywalls:R,paymentIssues:A,products:j,pushTally:z,requestDelivery:V,setTag:te,transactions:q,unlinkSpotify:M,updateProfile:N,userMetadata:S,vendor:O}=mb(t),L={analytics:{track:ap},attribution:{get:An,set:vp},auth:{getUser:f,getTokenSilently:qt,isAuthenticated:gr,loginWithRedirect:Qn,loginWithPopup:cp,login:kw,logout:ac,setToken:Ss},bills:r,browser:{detectAdblock:yb,isInAppBrowser:wb,isIncognito:Gs},checkouts:n,clearCache:pt,content:{list:Xv,get:on,getLanguage:Br,hasAccess:sw,unlock:Qv,getPropertyFromHTML:tc},contracts:a,entitlements:{...s,access:s.getAccess,hasAccess:w,list:l,signedLinks:oc},events:{emit:ip,cancel:pw},flags:{get:yp,set:gp,list:sn,delete:wp},fulfillments:{list:c,requestDelivery:V},generateLink:u,getVersion:Sb,isReady:()=>exports.isInitialized,log:le,paywalls:R,paymentIssues:A,products:{...j,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:v,set:te},tallies:{delete:o,get:p,list:g,push:z},transactions:{...q,get:P},userMetadata:S,vendor:O,setToken:Ss};return t.namespace&&(window[t.namespace]=L),L}function Sb(){return Yn}function Ib(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=`
|
|
37
37
|
${e.selector}::before {
|
|
38
38
|
content: '';
|
|
39
39
|
position: absolute;
|
|
@@ -44,4 +44,4 @@ CAUSE: `+d.stack,b.response=y,b.status=y.status,b.url=f,y.type==="opaque")throw
|
|
|
44
44
|
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), white);
|
|
45
45
|
pointer-events: none;
|
|
46
46
|
}
|
|
47
|
-
`,document.head.appendChild(i)}async function Pb(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
|
|
47
|
+
`,document.head.appendChild(i)}async function Pb(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 sc(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 Pb(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 Eb(t,e){const r=e.insertionPoint||"inside",n=await sc(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 kb(t,e){const r=await sc(e);t.innerHTML=r}async function _b(t,e){const r=await sc(e);t.innerHTML=r.replace("${content}",t.innerHTML)}async function Tb({enabled:t=!1,rules:e}){t&&Gv(async()=>{const r=await gr(),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 Eb(s,a);break;case"replace":await kb(s,a);break;case"remove":o.remove();break;case"wrap":await _b(s,a);break;case"gradient":Ib(s,a);break;default:console.warn(`Unknown transform type: ${a.transform}`)}}}})}const ih="access_token";function Rb(){const t=new URLSearchParams(window.location.hash.substring(1)),e=t.get(ih);if(e){Ss(e);const r=new URL(window.location.href);t.delete(ih),r.hash=t.toString(),window.history.replaceState(null,"",r)}}const oh="sesamy-refresh",sh="force-refetch-entitlements";function Ob(){const t=new URLSearchParams(window.location.search),e=t.get(sh),r=t.get(oh);if(e!==null||r!==null){const n=new URL(window.location.href);t.delete(sh),t.delete(oh),n.search=t.toString(),pt(),window.history.replaceState(null,"",n)}}function Cb(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 Ab(){const t=new URLSearchParams(window.location.search),e=t.get("sesamy-token")||t.get("token");if(!e)return;try{const n=Cb(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()};db(i)}catch(n){le(`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 ch="sesamy-user";async function Ub(){const e=new URLSearchParams(window.location.search).get(ch)?.toLowerCase();if(!e)return;const r=await Ew();r?.email!==e?(le(`Current user does not match sesamy user: ${r?.email} !== ${e}`),pt(),Qn({authorizationParams:{login_hint:e}})):le(`Current user matches sesamy user: ${r?.email} === ${e}`);const n=new URL(window.location.href);n.searchParams.delete(ch),window.history.replaceState(null,"",n)}const uh="sesamy-purchase";function $b(){const t=new URLSearchParams(window.location.search),e=t.get(uh);if(e!==null){const r=new URL(window.location.href);t.delete(uh),r.search=t.toString(),le(`Purchase ${e}`),Wt(Be.PURCHASE,{itemSrc:e}),pt(),window.history.replaceState(null,"",r)}}const lh="sesamy-login",Lb="sesamy_login";async function qb(){const t=new URLSearchParams(window.location.search);if(!(t.get(lh)||t.get(Lb)))return;await gr()||Qn();const n=new URL(window.location.href);n.searchParams.delete(lh),window.history.replaceState(null,"",n)}const fh="sesamy-debug";async function jb(){const e=new URLSearchParams(window.location.search).get(fh)?.toLowerCase();if(!e)return;Dm(e==="true");const r=new URL(window.location.href);r.searchParams.delete(fh),window.history.replaceState(null,"",r)}function Nb(){if(!document.referrer.length)return;const t=new URL(document.referrer);if(!(t.hostname===window.location.hostname||t.hostname.includes("sesamy")))return document.referrer}async function xb(t){if(!Jr())return;const e=new URLSearchParams(window.location.search),r={utmSource:e.get("utm_source")??void 0,utmMedium:e.get("utm_medium")??void 0,utmCampaign:e.get("utm_campaign")??void 0,utmTerm:e.get("utm_term")??void 0,utmContent:e.get("utm_content")??void 0,ref:e.get("ref")??void 0,referrer:Nb()},[n]=t.content.list();n?.url&&(r.itemSrc=n.url,r.publisherContentId=n.id),vp(r)}function Db(){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(gd)==="true",n=t.has("code")||t.has("error")||t.has("state");!e||r||(sessionStorage.setItem(gd,"true"),n||(le("Reloading page to get query params in incognito browser"),window.location.reload()))}async function Mb(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 Fb(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 Kb(t){const e=mr("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 dh(t,e){le(`Init with config: ${JSON.stringify(t)}`);try{Db(),vw({clientId:t.clientId,environment:t.environment,...t.analytics}),await Pw({clientId:t.clientId,organization:t.organization,environment:t.environment,...t.auth}),iw(t,e),t.transform&&await Tb(t.transform),Lg(),jb(),xb(e),Rb(),Ob(),Ab(),await qb(),await Ub(),$b(),await Fb(e),await Mb(e),await Kb(e),exports.isInitialized=!0,Wt(Be.READY,{})}catch(r){le(`Failed to init ${r.message}`)}}async function bp(t){le("Initializing Sesamy");const e=t.api?.namespace||"sesamy";if(Jr()&&e in window)return le("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 Jr()?(t.awaitAllServices?await dh(t,r):dh(t,r),r):(exports.isInitialized=!0,r)}if(Jr()){const t=document.getElementById("sesamy-js");if(t?.textContent)try{const e=JSON.parse(t.textContent);bp(e)}catch(e){console.error("Failed to parse config",e)}}exports.Events=Be;exports.init=bp;
|